/**
 * AI ASP - Base CSS
 * Design: White base + Blue accent (#2563eb)
 * Fonts: LINE Seed JP + JetBrains Mono
 * Icons: Lucide Icons
 */

/* ============================================================
   1. CSS Variables
   ============================================================ */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-surface: #f1f5f9;
    --bg-dark: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    --accent-blue: #2563eb;
    --accent-blue-dark: #1d4ed8;
    --accent-blue-light: #eff6ff;
    --accent-red: #dc2626;
    --accent-red-light: #fef2f2;
    --accent-green: #16a34a;
    --accent-green-light: #f0fdf4;
    --accent-orange: #ea580c;
    --accent-orange-light: #fff7ed;
    --accent-yellow: #d97706;
    --accent-yellow-light: #fffbeb;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-strong: #cbd5e1;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --font-sans: 'LINE Seed JP', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --font-display: 'LINE Seed JP', -apple-system, sans-serif;
    --container: 1140px;
    --header-h: 64px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    --bg-tertiary: #e2e8f0;
    --text-tertiary: #94a3b8;
    --accent-light: #eff6ff;
    --z-modal: 2000;
    --z-toast: 2100;
    --z-dropdown: 1000;
    --accent-red-dark: #b91c1c;
    --accent-green-dark: #15803d;
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #141418;
    --bg-secondary: #1c1c22;
    --bg-surface: #25252d;
    --bg-dark: #0a0a0e;
    --text-primary: #e8e8ed;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --border: #2a2a35;
    --border-light: #1e1e28;
    --border-strong: #3a3a48;
    --border-color: #2a2a35;
    --bg-tertiary: #25252d;
    --text-tertiary: #6b6b7b;
    --accent-blue-light: rgba(37, 99, 235, 0.15);
    --accent-red-light: rgba(220, 38, 38, 0.15);
    --accent-green-light: rgba(22, 163, 74, 0.15);
    --accent-orange-light: rgba(234, 88, 12, 0.15);
    --accent-light: rgba(37, 99, 235, 0.15);
    --accent-yellow-light: rgba(217, 119, 6, 0.15);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   2. Reset & Base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    font-size: 16px;
    background: var(--bg-dark);
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

a { color: var(--accent-blue); text-decoration: none; transition: color var(--transition-base); }
a:hover { color: var(--accent-blue-dark); }

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { font-family: var(--font-sans); cursor: pointer; }
input, textarea, select { font-family: var(--font-sans); }

.lucide-icon { width: 16px; height: 16px; flex-shrink: 0; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

/* ============================================================
   3. Header
   ============================================================ */

.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 20px;
    text-decoration: none;
    flex-shrink: 0;
}
.header-logo:hover { color: var(--accent-blue); }

.header-subnav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    justify-content: center;
}
.header-subnav a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--transition-base);
}
.header-subnav a:hover { color: var(--accent-blue); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Theme Toggle */
.theme-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-secondary); cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base);
}
.theme-toggle:hover { background: var(--bg-surface); color: var(--text-primary); }
.icon-sun, .icon-moon { display: flex; align-items: center; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon, :root:not([data-theme="dark"]) .icon-moon { display: none; }

/* User dropdown */
.header-user-wrap { position: relative; }
.header-user {
    display: flex; align-items: center; gap: 8px;
    background: none; border: none; cursor: pointer;
    padding: 4px 8px; border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 14px;
    transition: background var(--transition-base);
}
.header-user:hover { background: var(--bg-surface); }
.header-user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.header-user-avatar--placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent-blue-light); color: var(--accent-blue);
}
.header-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-user-caret { transition: transform var(--transition-base); }
.header-user-wrap.is-open .header-user-caret { transform: rotate(180deg); }

.header-user-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    min-width: 200px; background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    padding: 8px 0; display: none; z-index: var(--z-dropdown);
}
.header-user-wrap.is-open .header-user-dropdown { display: block; }

.header-user-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; color: var(--text-primary);
    font-size: 14px; transition: background var(--transition-base);
}
.header-user-dropdown-item:hover { background: var(--bg-surface); color: var(--text-primary); }
.header-user-dropdown-item--danger { color: var(--accent-red); }
.header-user-dropdown-item--danger:hover { background: var(--accent-red-light); color: var(--accent-red); }
.header-user-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

@media (max-width: 768px) {
    .header-subnav { display: none; }
}

/* ============================================================
   4. Buttons
   ============================================================ */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 700; font-family: var(--font-sans);
    cursor: pointer; transition: all var(--transition-base);
    text-decoration: none; white-space: nowrap; line-height: 1.4;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--accent-blue); color: var(--text-white);
}
.btn-primary:hover { background: var(--accent-blue-dark); color: var(--text-white); }

.btn-danger {
    background: var(--accent-red); color: var(--text-white);
}
.btn-danger:hover { background: var(--accent-red-dark); color: var(--text-white); }

.btn-outline {
    background: transparent; color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}
.btn-outline:hover { background: var(--accent-blue); color: var(--text-white); }

.btn-ghost {
    background: transparent; color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-strong); }

/* ============================================================
   5. Forms
   ============================================================ */

.form-group { margin-bottom: 20px; }
.form-label {
    display: block; margin-bottom: 6px;
    font-size: 14px; font-weight: 700; color: var(--text-primary);
}
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 15px; color: var(--text-primary); background: var(--bg-primary);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    line-height: 1.5;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { display: block; margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.form-submit { margin-top: 24px; }
.form-error { color: var(--accent-red); font-size: 13px; margin-top: 4px; }

/* ============================================================
   6. Alerts
   ============================================================ */

.alert {
    padding: 14px 18px; border-radius: var(--radius-sm);
    font-size: 14px; line-height: 1.6; margin-bottom: 16px;
}
.alert-error { background: var(--accent-red-light); color: var(--accent-red); }
.alert-success { background: var(--accent-green-light); color: var(--accent-green); }
.alert-info { background: var(--accent-blue-light); color: var(--accent-blue); }
.alert-warning { background: var(--accent-yellow-light); color: var(--accent-yellow); }

/* ============================================================
   7. Auth
   ============================================================ */

.auth-page {
    min-height: calc(100vh - var(--header-h));
    display: flex; align-items: center; justify-content: center;
    padding: 40px 24px;
    padding-top: calc(var(--header-h) + 40px);
}
.auth-card {
    width: 100%; max-width: 440px;
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 40px;
    box-shadow: var(--shadow-lg);
}
.auth-title {
    font-size: 24px; font-weight: 800; color: var(--text-primary);
    margin-bottom: 8px;
}
.auth-subtitle {
    font-size: 14px; color: var(--text-secondary);
    line-height: 1.7; margin-bottom: 24px;
}
.auth-divider {
    text-align: center; font-size: 13px; color: var(--text-muted);
    margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border);
}
.auth-divider a { font-weight: 700; }
.auth-terms-hint {
    text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-muted);
}
.auth-success { text-align: center; }
.auth-success-icon {
    display: flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; margin: 0 auto 16px;
    background: var(--accent-green-light); border-radius: 50%;
    color: var(--accent-green);
}
.auth-success-icon .lucide-icon { width: 32px; height: 32px; }
.auth-success h2 { font-size: 20px; margin-bottom: 8px; }
.auth-success p { color: var(--text-secondary); font-size: 14px; line-height: 1.7; }

.mail-providers {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 24px;
}
.mail-provider-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 14px; font-weight: 500;
    transition: background var(--transition-base);
}
.mail-provider-btn:hover { background: var(--bg-surface); color: var(--text-primary); }

/* Role selection */
.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.role-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 20px 16px; border: 2px solid var(--border); border-radius: var(--radius-md);
    cursor: pointer; transition: all var(--transition-base); text-align: center;
    background: var(--bg-primary);
}
.role-card:hover { border-color: var(--accent-blue); }
.role-card.is-active { border-color: var(--accent-blue); background: var(--accent-blue-light); }
.role-card .lucide-icon { width: 32px; height: 32px; color: var(--accent-blue); }
.role-card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.role-card-desc { font-size: 12px; color: var(--text-secondary); }

/* Auth Modal */
.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}
.auth-modal.is-visible {
    opacity: 1;
    visibility: visible;
}
.auth-modal-content {
    width: 100%;
    max-width: 440px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform var(--transition-slow);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}
.auth-modal.is-visible .auth-modal-content {
    transform: scale(1);
}
.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.auth-modal-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}
.auth-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base);
}
.auth-modal-close:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}
.auth-modal-close .lucide-icon {
    width: 20px;
    height: 20px;
}
.auth-modal .auth-view[hidden] {
    display: none;
}
.auth-modal-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base);
}
.auth-modal-back:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}
.auth-modal-back .lucide-icon {
    width: 18px;
    height: 18px;
}
.auth-modal-errors {
    margin-bottom: 16px;
}
.auth-modal-errors ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.auth-modal-errors li {
    font-size: 13px;
    color: var(--accent-red);
    line-height: 1.5;
}
.auth-modal .role-selector {
    margin-bottom: 16px;
}
.auth-modal .role-card {
    padding: 24px 16px;
}
.auth-modal .auth-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    margin-bottom: 16px;
}
body.modal-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .auth-modal-content {
        padding: 28px 20px;
    }
}

/* ============================================================
   8. Dashboard Components
   ============================================================ */

.dashboard-layout {
    display: flex; gap: 24px;
    padding-top: calc(var(--header-h) + 24px);
    min-height: 100vh;
}
.dashboard-sidebar {
    width: 240px; flex-shrink: 0;
    padding: 24px 0; position: sticky;
    top: calc(var(--header-h) + 24px); height: fit-content;
}
.dashboard-main { flex: 1; padding: 24px 0 48px; min-width: 0; }

.dashboard-sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; color: var(--text-secondary);
    font-size: 14px; font-weight: 500; border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}
.dashboard-sidebar-nav a:hover { background: var(--bg-surface); color: var(--text-primary); }
.dashboard-sidebar-nav a.is-active { background: var(--accent-blue-light); color: var(--accent-blue); font-weight: 700; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 20px;
}
.stat-card-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card-value { font-size: 28px; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); }
.stat-card-change { font-size: 12px; margin-top: 4px; }
.stat-card-change.is-up { color: var(--accent-green); }
.stat-card-change.is-down { color: var(--accent-red); }

/* Dashboard page header */
.dashboard-page-header { margin-bottom: 24px; }
.dashboard-page-title { font-size: 22px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.dashboard-page-desc { font-size: 14px; color: var(--text-secondary); }

/* Dashboard sidebar brand */
.dashboard-sidebar-brand { padding: 0 16px 16px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.dashboard-sidebar-role { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

/* Form extras */
.form-required { color: var(--accent-red); margin-left: 2px; font-size: 13px; }
.form-input.is-error, .form-select.is-error, .form-textarea.is-error {
    border-color: var(--accent-red);
}
.form-input.is-error:focus, .form-select.is-error:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15); }
.form-actions { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; gap: 12px; }

/* ============================================================
   9. Tables
   ============================================================ */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.table {
    width: 100%; border-collapse: collapse; font-size: 14px;
}
.table th {
    background: var(--bg-secondary); color: var(--text-secondary);
    font-weight: 700; font-size: 12px; text-transform: uppercase;
    letter-spacing: 0.05em; padding: 12px 16px; text-align: left;
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td {
    padding: 12px 16px; border-bottom: 1px solid var(--border-light);
    color: var(--text-primary); vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-secondary); }

/* ============================================================
   10. Badges
   ============================================================ */

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: var(--radius-full);
    font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-blue { background: var(--accent-blue-light); color: var(--accent-blue); }
.badge-green { background: var(--accent-green-light); color: var(--accent-green); }
.badge-red { background: var(--accent-red-light); color: var(--accent-red); }
.badge-orange { background: var(--accent-orange-light); color: var(--accent-orange); }
.badge-yellow { background: var(--accent-yellow-light); color: var(--accent-yellow); }
.badge-gray { background: var(--bg-surface); color: var(--text-muted); }

/* ============================================================
   11. Cards
   ============================================================ */

.card {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden;
}
.card-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header-title { font-size: 16px; font-weight: 700; }
.card-body { padding: 20px; }

/* ============================================================
   12. Footer
   ============================================================ */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    margin-top: 64px;
}
.footer-top {
    display: flex; gap: 48px;
}
.footer-brand { flex-shrink: 0; max-width: 280px; }
.footer-logo {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-primary); font-weight: 700; font-size: 18px;
}
.footer-logo:hover { color: var(--accent-blue); }
.footer-brand-desc { font-size: 13px; color: var(--text-secondary); margin-top: 12px; line-height: 1.7; }

.footer-nav { display: flex; gap: 48px; flex: 1; }
.footer-col-title {
    font-size: 13px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em;
}
.footer-col-links li { margin-bottom: 8px; }
.footer-col-links a {
    color: var(--text-secondary); font-size: 13px;
    transition: color var(--transition-base);
}
.footer-col-links a:hover { color: var(--accent-blue); }

.footer-bottom {
    margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.footer-legal-links { display: flex; gap: 24px; }
.footer-legal-links a { color: var(--text-muted); font-size: 12px; }
.footer-legal-links a:hover { color: var(--accent-blue); }
.footer-copyright { font-size: 12px; color: var(--text-muted); }

@media (max-width: 768px) {
    .footer-top { flex-direction: column; gap: 32px; }
    .footer-nav { flex-direction: column; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
    .footer-legal-links { flex-wrap: wrap; justify-content: center; }
    .dashboard-layout { flex-direction: column; }
    .dashboard-sidebar { width: 100%; position: static; }
}

/* ============================================================
   13. Toast
   ============================================================ */

.toast-container {
    position: fixed; top: calc(var(--header-h) + 16px); right: 16px;
    z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px;
}
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    background: var(--bg-primary); border: 1px solid var(--border);
    box-shadow: var(--shadow-lg); font-size: 14px;
    animation: toastIn 0.3s ease;
    max-width: 360px;
}
.toast-success { border-color: var(--accent-green); }
.toast-error { border-color: var(--accent-red); }
.toast-info { border-color: var(--accent-blue); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   14. Utility
   ============================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 18px; }
.text-mono { font-family: var(--font-mono); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* Empty state */
.empty-state {
    text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty-state .lucide-icon { width: 48px; height: 48px; margin: 0 auto 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; color: var(--text-primary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 24px; }

/* Hamburger (mobile) */
.hamburger-btn {
    display: none; background: none; border: none; padding: 8px;
    color: var(--text-primary); cursor: pointer;
}
@media (max-width: 768px) {
    .hamburger-btn { display: flex; align-items: center; gap: 4px; }
}
.hamburger-lines { display: flex; flex-direction: column; gap: 4px; }
.hamburger-lines span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 1px; }
.hamburger-label { font-size: 11px; font-weight: 700; }

/* Mobile menu */
.mobile-menu {
    position: fixed; top: 0; right: -320px; width: 300px; height: 100vh;
    background: var(--bg-primary); z-index: 1100; overflow-y: auto;
    transition: right var(--transition-slow);
    border-left: 1px solid var(--border);
}
.mobile-menu.is-open { right: 0; }
.mobile-menu-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.mobile-menu-title { font-size: 16px; font-weight: 700; }
.mobile-menu-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; }
.mobile-menu-nav a,
.mobile-menu-nav .mobile-menu-auth-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px; color: var(--text-primary); font-size: 15px;
    border-bottom: 1px solid var(--border-light);
}
.mobile-menu-nav .mobile-menu-auth-btn {
    width: 100%; background: none; border: none; border-bottom: 1px solid var(--border-light);
    cursor: pointer; text-align: left; font-family: var(--font-sans);
}
.mobile-menu-nav a:hover,
.mobile-menu-nav .mobile-menu-auth-btn:hover { background: var(--bg-surface); }
.mobile-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.mobile-menu-footer { padding: 16px 20px; }

.mobile-menu-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5); z-index: 1099;
    opacity: 0; pointer-events: none; transition: opacity var(--transition-slow);
}
.mobile-menu-overlay.is-open { opacity: 1; pointer-events: auto; }

/* Mobile theme toggle */
.mobile-theme-toggle {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px; width: 100%; background: none; border: none;
    color: var(--text-primary); font-size: 15px; cursor: pointer;
    border-bottom: 1px solid var(--border-light);
}
.mobile-theme-toggle:hover { background: var(--bg-surface); }
[data-theme="dark"] .toggle-label-dark { display: none; }
[data-theme="light"] .toggle-label-light, :root:not([data-theme="dark"]) .toggle-label-light { display: none; }

/* Page title section */
.page-title-section {
    padding-top: calc(var(--header-h) + 32px);
    padding-bottom: 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.page-title { font-size: 28px; font-weight: 800; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* Pagination */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    margin-top: 32px;
}
.pagination a, .pagination span {
    display: flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 8px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; color: var(--text-secondary);
    transition: all var(--transition-base);
}
.pagination a:hover { background: var(--bg-surface); color: var(--text-primary); }
.pagination .is-active { background: var(--accent-blue); color: var(--text-white); border-color: var(--accent-blue); }

/* ============================================================
   15. Advertiser Dashboard
   ============================================================ */

/* Program cards grid */
.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.program-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: box-shadow var(--transition-base);
}
.program-card:hover {
    box-shadow: var(--shadow-md);
}

.program-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.program-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}
.program-card-category {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.program-card-stats {
    display: flex;
    gap: 16px;
    margin: 12px 0;
    padding: 12px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.program-card-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.program-card-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.program-card-stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.program-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Form row (2-column layout) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .program-grid {
        grid-template-columns: 1fr;
    }
}

/* Checkbox group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}
.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.filter-bar .form-select {
    width: auto;
    min-width: 180px;
}

/* Dashboard page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 800;
}

/* Settings form */
.settings-form {
    max-width: 640px;
}

/* Section title within dashboard */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Publisher / site cell layout in partnership table */
.publisher-cell,
.site-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.publisher-name {
    font-weight: 600;
    color: var(--text-primary);
}
.publisher-email,
.text-muted {
    color: var(--text-muted);
}
.text-sm {
    font-size: 12px;
}

/* Action buttons inline group */
.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

/* Dashboard page header (used in dashboard/settings) */
.dashboard-page-header { margin-bottom: 24px; }
.dashboard-page-title { font-size: 24px; font-weight: 800; color: var(--text-primary); }
.dashboard-page-desc { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* Sidebar brand */
.dashboard-sidebar-brand { padding: 0 16px 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.dashboard-sidebar-role { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Form required marker */
.form-required { color: var(--accent-red); font-size: 12px; }

/* Form actions row */
.form-actions { display: flex; align-items: center; gap: 12px; padding-top: 8px; }

/* Error border for inputs */
.form-input.is-error, .form-select.is-error, .form-textarea.is-error { border-color: var(--accent-red); }

/* Page header title (used in programs/form) */
.page-header-title { font-size: 18px; font-weight: 800; color: var(--text-primary); }

/* Filter bar margin-bottom override */
.filter-bar .form-group.mb-0 { margin-bottom: 0; }

/* Empty state sub text */
.empty-state-icon { width: 48px; height: 48px; margin: 0 auto 16px; opacity: 0.5; }
.empty-state-text { font-size: 16px; color: var(--text-primary); margin-bottom: 4px; }

/* ============================================================
   16. Publisher Dashboard
   ============================================================ */

/* Program search card (used in publisher/programs) */
.program-search-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: box-shadow var(--transition-base);
}
.program-search-card:hover {
    box-shadow: var(--shadow-md);
}
.program-search-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.program-search-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.program-search-card-advertiser {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.program-search-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}
.program-search-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    margin-bottom: 12px;
}
.program-search-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}
.program-search-meta-item .lucide-icon {
    width: 14px;
    height: 14px;
}
.program-search-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Tracking code display */
.tracking-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-primary);
}
.tracking-code-copy {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    display: flex;
    align-items: center;
    transition: color var(--transition-base);
}
.tracking-code-copy:hover {
    color: var(--accent-blue);
}

/* Report summary table highlight */
.report-summary-row td {
    font-weight: 700;
    background: var(--bg-secondary);
}

/* Section card within dashboard */
.section-card {
    margin-bottom: 24px;
}

/* Program search grid */
.program-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

@media (max-width: 640px) {
    .program-search-grid {
        grid-template-columns: 1fr;
    }
}
.empty-state-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }

/* ============================================================
   17. Tracking & Link Generation
   ============================================================ */

/* Link generation card */
.link-card {
    margin-bottom: 20px;
}
.link-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Link section within card */
.link-section {
    margin-bottom: 16px;
}
.link-section:last-child {
    margin-bottom: 0;
}

/* Copy row: input + button side by side */
.link-copy-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.link-copy-row .form-input {
    flex: 1;
    font-size: 13px;
    background: var(--bg-secondary);
    border-color: var(--border-light);
    cursor: text;
    user-select: all;
}
.link-copy-row .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Code snippet display */
.code-snippet {
    background: var(--bg-dark);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    position: relative;
}
.code-snippet-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #e2e8f0;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background var(--transition-base);
}
.code-snippet-copy:hover {
    background: rgba(255,255,255,0.2);
}

/* Link info badge */
.link-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.link-info-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}
.link-info-item i {
    width: 14px;
    height: 14px;
}

/* Responsive */
@media (max-width: 640px) {
    .link-copy-row {
        flex-direction: column;
    }
    .link-copy-row .btn {
        width: 100%;
    }
}

/* ============================================================
   18. Admin Panel Utilities
   ============================================================ */

/* Admin action buttons in table */
.admin-action-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Admin stat card color variants (supplement admin.css) */
.admin-stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
}
.admin-stat-card-label {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 4px;
}
.admin-stat-card-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-mono);
    margin: 0 0 4px;
    line-height: 1.2;
}
.admin-stat-card-sub {
    font-size: 12px;
    color: var(--text-secondary);
}
.admin-stat-card--alert .admin-stat-card-value {
    color: var(--accent-red);
}
.admin-stat-card--ok .admin-stat-card-value {
    color: var(--accent-green);
}

/* Responsive admin grid */
@media (max-width: 1024px) {
    .admin-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .admin-header {
        padding: 0 16px;
    }
}

/* ============================================================
   19. Billing & Earnings
   ============================================================ */

/* Invoice / Payout summary card */
.billing-summary-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md, 12px);
    padding: 24px;
    margin-bottom: 24px;
}
.billing-summary-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

/* Billing detail rows */
.billing-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-primary);
}
.billing-detail-row + .billing-detail-row {
    border-top: 1px solid var(--border-subtle, var(--border-light));
}
.billing-detail-row.is-total {
    font-weight: 700;
    font-size: 16px;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 2px solid var(--text-primary);
}
.billing-detail-label {
    color: var(--text-secondary);
}
.billing-detail-value {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
}
.billing-detail-value.is-negative {
    color: var(--accent-red);
}
.billing-detail-value.is-positive {
    color: var(--accent-green);
}

/* Invoice status notice */
.billing-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-md, 12px);
    font-size: 13px;
    margin-bottom: 16px;
}
.billing-notice--info {
    background: var(--accent-blue-light);
    color: var(--accent-blue-dark, var(--accent-blue));
}
.billing-notice--warning {
    background: var(--accent-orange-light);
    color: var(--accent-orange);
}
.billing-notice--success {
    background: var(--accent-green-light);
    color: var(--accent-green);
}

/* Transaction amount color */
.tx-positive { color: var(--accent-green); }
.tx-negative { color: var(--accent-red); }

/* Monthly close form */
.billing-close-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 24px;
}
.billing-close-form .form-group {
    margin-bottom: 0;
}

/* ============================================================
   20. Billing Page - Additional Utilities
   ============================================================ */

/* Color utilities */
.text-danger  { color: var(--accent-red); }
.text-success { color: var(--accent-green); }
.text-bold    { font-weight: 700; }
.text-nowrap  { white-space: nowrap; }

/* stat-card value variant */
.stat-card-value--danger { color: var(--accent-red); }

/* Card empty state (inline in card) */
.card-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 12px;
    text-align: center;
}
.card-empty-icon {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    opacity: 0.5;
}
.card-empty-text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Definition list (請求先情報) */
.definition-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.definition-list-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.definition-list-row:last-child {
    border-bottom: none;
}
.definition-list-term {
    flex: 0 0 140px;
    color: var(--text-muted);
    font-weight: 500;
}
.definition-list-desc {
    flex: 1;
    color: var(--text-primary);
}

/* Invoice number monospace */
.invoice-number {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* Billing payment note */
.billing-payment-info {
    margin-top: 8px;
}
.billing-payment-note {
    font-size: 13px;
    line-height: 1.7;
    margin: 0;
}

/* ============================================================
   21. Payout Breakdown - 振込内訳 (publisher/earnings/)
   ============================================================ */
.payout-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 420px;
    margin: 0;
    padding: 0;
}
.payout-breakdown-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.payout-breakdown-row:last-child {
    border-bottom: none;
}
.payout-breakdown-row--deduction .payout-breakdown-label {
    color: var(--text-muted);
}
.payout-breakdown-row--total {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 2px solid var(--border);
}
.payout-breakdown-label {
    color: var(--text-primary);
    font-weight: 500;
}
.payout-breakdown-value {
    font-weight: 600;
    white-space: nowrap;
}
.payout-breakdown-value--deduction {
    color: var(--accent-red);
}
.payout-breakdown-value--total {
    font-size: 18px;
    color: var(--accent-blue);
}

/* ============================================================
   22. Notice Block - インライン通知ブロック
   ============================================================ */
.notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-md, 12px);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
}
.notice .lucide-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
}
.notice-info {
    background: var(--accent-blue-light);
    color: var(--accent-blue-dark, var(--accent-blue));
}
.notice-warning {
    background: var(--accent-orange-light, #fff7ed);
    color: var(--accent-orange, #ea580c);
}
.notice-success {
    background: var(--accent-green-light);
    color: var(--accent-green);
}
.notice-danger {
    background: var(--accent-red-light, #fef2f2);
    color: var(--accent-red);
}

/* text-strong */
.text-strong {
    font-weight: 700;
}

/* text-xs */
.text-xs {
    font-size: 11px;
}

/* ============================================================
   23. Guide Articles - ガイド記事
   ============================================================ */

/* パンくず */
.guide-breadcrumb {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}
.guide-breadcrumb-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: var(--text-muted);
}
.guide-breadcrumb-list li {
    display: flex;
    align-items: center;
    gap: 4px;
}
.guide-breadcrumb-list li + li::before {
    content: '/';
    color: var(--text-muted);
    margin: 0 2px;
}
.guide-breadcrumb-list a {
    color: var(--text-secondary);
    text-decoration: none;
}
.guide-breadcrumb-list a:hover {
    color: var(--accent-blue);
}

/* レイアウト */
.guide-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 40px;
    padding-top: 32px;
    padding-bottom: 64px;
    align-items: start;
}

/* 記事ヘッダー */
.guide-article-header {
    margin-bottom: 32px;
}
.guide-article-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.4;
    margin: 12px 0 16px;
    color: var(--text-primary);
}
.guide-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}
.guide-article-meta .lucide-icon {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    margin-right: 4px;
}

/* ハイライトボックス */
.guide-highlight-box {
    background: var(--accent-blue-light);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 32px;
}
.guide-highlight-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--accent-blue);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.guide-highlight-title .lucide-icon {
    width: 18px;
    height: 18px;
}
.guide-highlight-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.guide-highlight-list li {
    position: relative;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}
.guide-highlight-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: 700;
}

/* 記事本文 */
.guide-article-body h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 48px 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text-primary);
}
.guide-article-body h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text-primary);
}
.guide-article-body p {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text-secondary);
    margin: 0 0 16px;
}
.guide-article-body ul,
.guide-article-body ol {
    margin: 0 0 16px;
    padding-left: 24px;
}
.guide-article-body li {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.guide-article-body strong {
    color: var(--text-primary);
    font-weight: 700;
}
.guide-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 24px;
    font-size: 14px;
}
.guide-article-body th,
.guide-article-body td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}
.guide-article-body th {
    background: var(--bg-secondary);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}
.guide-article-body td {
    color: var(--text-secondary);
}
.guide-article-body .info-box {
    background: var(--accent-blue-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--accent-blue-dark, #1e40af);
}
.guide-article-body .warning-box {
    background: var(--accent-orange-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--accent-orange);
}
.guide-article-body .success-box {
    background: var(--accent-green-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--accent-green);
}
.guide-article-body .step-list {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
}
.guide-article-body .step-list li {
    counter-increment: step;
    position: relative;
    padding-left: 40px;
    margin-bottom: 16px;
}
.guide-article-body .step-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CTA */
.guide-cta {
    margin: 48px 0;
}
.guide-cta-inner {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    color: #fff;
}
.guide-cta-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 12px;
    color: #fff;
}
.guide-cta-desc {
    font-size: 15px;
    line-height: 1.7;
    opacity: 0.9;
    margin: 0 0 24px;
    color: #fff;
}
.guide-cta-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.guide-cta-actions .btn-primary {
    background: #fff;
    color: var(--accent-blue);
}
.guide-cta-actions .btn-primary:hover {
    background: #f0f0f0;
}
.guide-cta-actions .btn-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}
.guide-cta-actions .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* FAQ */
.guide-faq {
    margin-top: 48px;
}
.guide-faq-heading {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text-primary);
}
.guide-faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    overflow: hidden;
}
.guide-faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: inherit;
}
.guide-faq-question:hover {
    background: var(--bg-secondary);
}
.guide-faq-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}
.guide-faq-question[aria-expanded="true"] .guide-faq-icon {
    transform: rotate(180deg);
}
.guide-faq-answer {
    padding: 0 20px 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}
.guide-faq-answer p {
    margin: 0;
}

/* 関連記事 */
.guide-related {
    margin-top: 48px;
}
.guide-related-heading {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text-primary);
}
.guide-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.guide-related-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.guide-related-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.guide-related-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}
.guide-related-icon .lucide-icon {
    width: 18px;
    height: 18px;
}
.guide-related-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}
.guide-related-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}
.guide-related-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.guide-related-meta .lucide-icon {
    width: 12px;
    height: 12px;
}

/* TOC */
.guide-toc {
    position: sticky;
    top: calc(var(--header-h) + 24px);
}
.guide-toc-inner {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
}
.guide-toc-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.guide-toc-title .lucide-icon {
    width: 16px;
    height: 16px;
}
.guide-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.guide-toc-list li {
    margin-bottom: 4px;
}
.guide-toc-list > li > a {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.guide-toc-list > li > a:hover,
.guide-toc-list > li > a.active {
    color: var(--accent-blue);
    background: var(--accent-blue-light);
}
.guide-toc-list ol {
    list-style: none;
    margin: 2px 0 4px;
    padding-left: 16px;
}
.guide-toc-list ol a {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.guide-toc-list ol a:hover,
.guide-toc-list ol a.active {
    color: var(--accent-blue);
    background: var(--accent-blue-light);
}

/* SP TOC FAB + ドロワー */
.guide-toc-fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.guide-toc-fab .lucide-icon {
    width: 22px;
    height: 22px;
}
.guide-toc-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-xl);
    padding: 0 20px 20px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 200;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.guide-toc-drawer[aria-hidden="false"] {
    transform: translateY(0);
}
.guide-toc-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
}
.guide-toc-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}
.guide-toc-drawer-close .lucide-icon {
    width: 20px;
    height: 20px;
}
.guide-toc-drawer-nav .guide-toc-list > li > a {
    padding: 8px;
    font-size: 14px;
}
.guide-toc-drawer-nav .guide-toc-list ol a {
    padding: 6px 8px;
    font-size: 13px;
}
.guide-toc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 199;
}
.guide-toc-overlay[aria-hidden="false"] {
    display: block;
}

/* 記事一覧 */
.guide-list-hero {
    background: var(--bg-secondary);
    padding: 48px 0 40px;
    border-bottom: 1px solid var(--border);
}
.guide-list-title {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--text-primary);
}
.guide-list-desc {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}
.guide-list-content {
    padding: 32px 0 64px;
}
.guide-list-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.guide-filter-btn {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}
.guide-filter-btn:hover {
    color: var(--accent-blue);
    background: var(--accent-blue-light);
}
.guide-filter-btn.active {
    background: var(--accent-blue);
    color: #fff;
}
.guide-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}
.guide-card {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.guide-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.guide-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}
.guide-card-icon .lucide-icon {
    width: 22px;
    height: 22px;
}
.guide-card-body {
    flex: 1;
    min-width: 0;
}
.guide-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 6px 0 8px;
    line-height: 1.4;
}
.guide-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 10px;
    line-height: 1.5;
}
.guide-card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}
.guide-card-meta .lucide-icon {
    width: 12px;
    height: 12px;
    vertical-align: -1px;
    margin-right: 2px;
}

/* Badge追加 */
.badge-green {
    background: var(--accent-green-light);
    color: var(--accent-green);
}
.badge-blue {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
}
.badge-sm {
    font-size: 11px;
    padding: 2px 8px;
}

/* SP対応 */
@media (max-width: 768px) {
    .guide-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .guide-toc {
        display: none;
    }
    .guide-toc-fab {
        display: flex;
    }
    .guide-article-title {
        font-size: 22px;
    }
    .guide-article-body h2 {
        font-size: 19px;
    }
    .guide-article-body h3 {
        font-size: 16px;
    }
    .guide-cta-inner {
        padding: 28px 20px;
    }
    .guide-cta-title {
        font-size: 19px;
    }
    .guide-card-grid {
        grid-template-columns: 1fr;
    }
    .guide-card {
        padding: 16px;
    }
    .guide-list-hero {
        padding: 32px 0 28px;
    }
    .guide-list-title {
        font-size: 24px;
    }
    .guide-related-grid {
        grid-template-columns: 1fr;
    }
}
