/* ═══════════════════════════════════════════════════════════════
   LegalMinds — Unified Dashboard Design System (Phase 1)
   Accessible-first dark theme · WCAG 2.1 AA
   ═══════════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ──────────────────────────────── */

:root {
    /* Surfaces */
    --bg-primary: #0b0e14;
    --bg-secondary: #131722;
    --bg-card: #1b2130;
    --bg-input: #232a3b;
    --bg-elevated: #242c3f;

    /* Text — AA contrast on the surfaces above */
    --text-primary: #eef1f6;
    --text-secondary: #a9b1c0;
    --text-muted: #8b93a5;

    /* Accents */
    --accent: #5ba8ff;
    --accent-blue: #5ba8ff;
    --accent-green: #3ddba4;
    --accent-red: #ff8a8a;
    --accent-yellow: #ffd166;
    --accent-purple: #b8a5ff;
    --accent-orange: #ffab70;

    --border-color: #2e3548;
    --border-strong: #3d4763;
    --focus-ring: #8ec2ff;

    --sidebar-width: 260px;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-pop: 0 8px 30px rgba(0, 0, 0, 0.45);

    /* Motion */
    --transition-fast: 0.15s ease;
    --transition-med: 0.3s ease;

    /* Typography scale — driven by data-text-size on <html> */
    --font-scale: 1;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Agent colors */
    --agent-orchestrator: #5ba8ff;
    --agent-researcher: #3ddba4;
    --agent-strategist: #ff8a8a;
    --agent-advocate: #b8a5ff;
    --agent-psychologist: #ffd166;
    --agent-paralegal: #ffab70;
}

/* Text-size preference (Settings → Text size) */
html[data-text-size="small"]  { --font-scale: 0.875; }
html[data-text-size="medium"] { --font-scale: 1; }
html[data-text-size="large"]  { --font-scale: 1.125; }
html[data-text-size="xlarge"] { --font-scale: 1.3; }

/* High-contrast preference */
html[data-high-contrast="true"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #121212;
    --bg-input: #1a1a1a;
    --bg-elevated: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #c7c7c7;
    --border-color: #6b6b6b;
    --border-strong: #9a9a9a;
    --accent: #7cc0ff;
    --accent-blue: #7cc0ff;
    --accent-green: #5cf0bc;
    --accent-red: #ffa3a3;
    --accent-yellow: #ffe08a;
    --accent-purple: #cbbcff;
    --accent-orange: #ffc296;
    --focus-ring: #ffd166;
}

/* Dyslexia-friendly font preference */
html[data-dyslexia-font="true"] {
    --font-body: 'OpenDyslexic', 'Open-Dyslexic', 'Comic Sans MS', Verdana, sans-serif;
}
html[data-dyslexia-font="true"] body {
    letter-spacing: 0.03em;
    word-spacing: 0.08em;
    line-height: 1.7;
}

/* Reduced motion — manual toggle */
html[data-reduced-motion="true"] *,
html[data-reduced-motion="true"] *::before,
html[data-reduced-motion="true"] *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
}

/* Reduced motion — OS preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
        scroll-behavior: auto !important;
    }
}

/* ─── BASE ───────────────────────────────────────── */

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

html { font-size: calc(16px * var(--font-scale)); }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Visible focus for keyboard users — WCAG 2.4.7 */
:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: rgba(91, 168, 255, 0.35); }

/* Skip link — first tab stop */
.skip-link {
    position: absolute;
    top: -60px;
    left: 12px;
    z-index: 1000;
    background: var(--accent-blue);
    color: #04121f;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    transition: top var(--transition-fast);
}
.skip-link:focus { top: 12px; }

/* Screen-reader-only text */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─── UPL REMINDER BANNER ────────────────────────── */

#upl-reminder-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: linear-gradient(90deg, #1d1a10, #211c0e, #1d1a10);
    color: var(--accent-yellow);
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    border-bottom: 1px solid #3a331d;
    letter-spacing: 0.02em;
    position: sticky;
    top: 0;
    z-index: 300;
}
#upl-reminder-banner .banner-icon { flex-shrink: 0; }
#upl-reminder-banner a {
    color: var(--accent-yellow);
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0.25rem;
    border-radius: 4px;
}
#upl-reminder-banner a:hover { color: #fff3cd; }
html[data-high-contrast="true"] #upl-reminder-banner {
    background: #1a1a00;
    border-bottom-color: var(--border-strong);
}

/* ─── APP SHELL ──────────────────────────────────── */

.app-shell { display: flex; min-height: calc(100vh - 37px); }

/* ─── SIDEBAR ────────────────────────────────────── */

#sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 1.25rem 0 0;
    position: fixed;
    top: 37px;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 250;
    overflow-y: auto;
}

#sidebar .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}
#sidebar .logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(91, 168, 255, 0.25), rgba(184, 165, 255, 0.18));
    border: 1px solid rgba(91, 168, 255, 0.35);
    color: var(--accent-blue);
    flex-shrink: 0;
}
#sidebar .logo h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent-blue); /* fallback */
}
html[data-high-contrast="true"] #sidebar .logo h1 {
    background: none;
    -webkit-text-fill-color: var(--text-primary);
}
#sidebar .logo span {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
}

#sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0 0.85rem;
}

#sidebar nav a.nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 46px;           /* ≥44px touch target */
    padding: 0.65rem 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    transition: background var(--transition-fast), color var(--transition-fast);
    border-left: 3px solid transparent;
}
#sidebar nav a.nav-link .nav-icon { flex-shrink: 0; }
#sidebar nav a.nav-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}
#sidebar nav a.nav-link.active {
    color: var(--accent-blue);
    background: rgba(91, 168, 255, 0.12);
    border-left-color: var(--accent-blue);
    font-weight: 600;
}
html[data-high-contrast="true"] #sidebar nav a.nav-link.active {
    background: var(--bg-elevated);
    outline: 2px solid var(--accent-blue);
    outline-offset: -2px;
}

.pro-badge {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: linear-gradient(90deg, #b8a5ff, #5ba8ff);
    color: #0b0e14;
}
html[data-high-contrast="true"] .pro-badge { background: var(--accent-yellow); }

/* Guided / Manual mode toggle */
.mode-toggle-wrap {
    margin-top: auto;
    padding: 1rem 1.1rem;
    border-top: 1px solid var(--border-color);
}
.mode-toggle-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.mode-toggle {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}
.mode-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.5rem 0.6rem;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.mode-btn[aria-checked="true"] {
    background: var(--accent-blue);
    color: #04121f;
}
.mode-btn:hover:not([aria-checked="true"]) { color: var(--text-primary); }
.mode-hint {
    margin-top: 0.55rem;
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Guided vs Manual visibility helpers */
html[data-mode="manual"] .guided-only { display: none !important; }
html[data-mode="guided"] .manual-only { display: none !important; }

#sidebar .sidebar-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── User block (sidebar footer) ─────────────── */

.user-block {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.6rem;
}
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent-yellow);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-tier {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}
.logout-link {
    font-size: 0.82rem !important;
    opacity: 0.7;
    margin-bottom: 0.4rem;
}
.logout-link:hover { opacity: 1; }
.version-tag {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ─── MOBILE HEADER ─────────────────────────────── */

.mobile-header {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 37px;
    z-index: 240;
}
.mobile-brand { font-weight: 800; color: var(--accent-blue); }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
}
.icon-btn:hover { background: var(--bg-card); }

#sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 245;
}

/* ─── MAIN CONTENT ───────────────────────────────── */

#main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
    min-height: calc(100vh - 37px);
    max-width: calc(100vw - var(--sidebar-width));
}
#main-content:focus { outline: none; }

.page-header { margin-bottom: 1.75rem; }
.page-header h2 {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 70ch;
}

/* Guided-mode helper callout */
.helper-callout {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: rgba(91, 168, 255, 0.08);
    border: 1px solid rgba(91, 168, 255, 0.25);
    border-left: 4px solid var(--accent-blue);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.helper-callout strong { color: var(--text-primary); }
.helper-callout svg { flex-shrink: 0; margin-top: 2px; color: var(--accent-blue); }

/* ─── CARDS ──────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-card);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.card-header h3 {
    font-size: 1.02rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

/* Stat tiles (My Case overview) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.stat-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    box-shadow: var(--shadow-card);
}
.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(91, 168, 255, 0.15); color: var(--accent-blue); }
.stat-icon.green  { background: rgba(61, 219, 164, 0.15); color: var(--accent-green); }
.stat-icon.red    { background: rgba(255, 138, 138, 0.15); color: var(--accent-red); }
.stat-icon.purple { background: rgba(184, 165, 255, 0.15); color: var(--accent-purple); }
.stat-value { font-size: 1.45rem; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); }

/* ─── BUTTONS ────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;           /* WCAG 2.5.5 target size */
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition-fast), opacity var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--accent-blue); color: #04121f; }
.btn-primary:hover:not(:disabled) { background: #79b8ff; }

.btn-danger { background: var(--accent-red); color: #2a0505; }
.btn-danger:hover:not(:disabled) { opacity: 0.9; }

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-elevated); border-color: var(--border-strong); }

.btn-sm { min-height: 36px; padding: 0.35rem 0.8rem; font-size: 0.82rem; }
.btn-xs { min-height: 28px; padding: 0.2rem 0.5rem; font-size: 0.75rem; border-radius: 4px; }

/* ─── FORMS ──────────────────────────────────────── */

input, textarea, select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.65rem 0.85rem;
    min-height: 44px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    width: 100%;
    font-family: inherit;
    transition: border-color var(--transition-fast);
}
textarea { min-height: 88px; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.85; }

input:focus, textarea:focus, select:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 1px;
    border-color: var(--accent-blue);
}

input[type="checkbox"], input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    min-height: 0;
    accent-color: var(--accent-blue);
    cursor: pointer;
}
input[type="range"] { min-height: 0; }

label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-group { margin-bottom: 1rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 220px; }

/* Settings forms (account management) */
.settings-form .form-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}
.settings-form .form-row > * { min-width: unset; flex: unset; }
.settings-form label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.settings-form input[type="text"],
.settings-form input[type="email"],
.settings-form input[type="password"] {
    width: 100%;
    max-width: 400px;
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}
.settings-form input:focus {
    border-color: var(--accent-yellow);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,209,102,0.15);
}
.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
}
.form-msg {
    font-size: 0.82rem;
    min-height: 1.2em;
}
.form-msg-ok { color: var(--accent-green); }
.form-msg-err { color: var(--accent-red); }

fieldset {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
legend {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Toggle switch (Settings) */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
    min-height: 56px;
}
.switch-row:last-child { border-bottom: none; }
.switch-info { flex: 1; }
.switch-title { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.switch-desc { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.15rem; }

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 30px;
    flex-shrink: 0;
}
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .slider {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: 30px;
    transition: background var(--transition-fast);
    pointer-events: none;
}
.switch .slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: transform var(--transition-fast), background var(--transition-fast);
}
.switch input:checked + .slider { background: var(--accent-blue); border-color: var(--accent-blue); }
.switch input:checked + .slider::before { transform: translateX(22px); background: #04121f; }
.switch input:focus-visible + .slider {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Segmented radio group (text size, voice mode) */
.segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.segmented .seg-option { position: relative; }
.segmented .seg-option input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.segmented .seg-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.segmented .seg-option input:checked + span {
    background: rgba(91, 168, 255, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}
.segmented .seg-option input:focus-visible + span {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}
.segmented .seg-option input:disabled + span { opacity: 0.5; cursor: not-allowed; }

/* ─── TABLES ─────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 0.7rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}
th {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
tr:hover td { background: rgba(255, 255, 255, 0.025); }

/* ─── BADGES ─────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.6rem;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
}
.badge-green  { background: rgba(61, 219, 164, 0.14); color: var(--accent-green);  border-color: rgba(61, 219, 164, 0.3); }
.badge-red    { background: rgba(255, 138, 138, 0.14); color: var(--accent-red);   border-color: rgba(255, 138, 138, 0.3); }
.badge-yellow { background: rgba(255, 209, 102, 0.14); color: var(--accent-yellow); border-color: rgba(255, 209, 102, 0.3); }
.badge-blue   { background: rgba(91, 168, 255, 0.14); color: var(--accent-blue);   border-color: rgba(91, 168, 255, 0.3); }
.badge-purple { background: rgba(184, 165, 255, 0.14); color: var(--accent-purple); border-color: rgba(184, 165, 255, 0.3); }
.badge-orange { background: rgba(255, 171, 112, 0.14); color: var(--accent-orange); border-color: rgba(255, 171, 112, 0.3); }

/* ─── DEADLINES ──────────────────────────────────── */

.deadline-urgent { border-left: 3px solid var(--accent-red); }
.deadline-soon   { border-left: 3px solid var(--accent-yellow); }
.deadline-ok     { border-left: 3px solid var(--accent-green); }

/* ─── TABS (My Case) ─────────────────────────────── */

.tabs {
    display: flex;
    gap: 0.35rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.65rem 1.2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn[aria-selected="true"] {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}
.tab-panel[hidden] { display: none; }

/* ─── DOCKET LEDGER ──────────────────────────────── */

.docket-ledger {
    position: relative;
    padding-left: 2rem;
}
.docket-ledger::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-strong);
}
.docket-entry {
    position: relative;
    padding: 0 0 1.4rem 1rem;
}
.docket-entry:last-child { padding-bottom: 0.25rem; }
.docket-entry::before {
    content: '';
    position: absolute;
    left: -1.65rem;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-blue);
    border: 3px solid var(--bg-primary);
    z-index: 1;
}
.docket-entry.type-motion::before   { background: var(--accent-purple); }
.docket-entry.type-order::before    { background: var(--accent-red); }
.docket-entry.type-evidence::before { background: var(--accent-green); }
.docket-entry.type-response::before { background: var(--accent-yellow); }
.docket-entry.type-complaint::before{ background: var(--accent-orange); }

.docket-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.1rem;
    transition: border-color var(--transition-fast);
}
.docket-card:hover { border-color: var(--border-strong); }
.docket-date {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.docket-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}
.docket-title a {
    color: var(--text-primary);
    text-decoration: none;
}
.docket-title a:hover { color: var(--accent-blue); text-decoration: underline; }
.docket-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.docket-month {
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0.25rem 0 0.9rem;
}

/* ─── CHAT ───────────────────────────────────────── */

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 10rem);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.chat-message {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    max-width: 85%;
}
.chat-message.user {
    align-self: flex-end;
    background: rgba(91, 168, 255, 0.1);
    border-color: rgba(91, 168, 255, 0.25);
}
.chat-message .agent-name {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.chat-message .agent-name.orchestrator { color: var(--agent-orchestrator); }
.chat-message .agent-name.researcher   { color: var(--agent-researcher); }
.chat-message .agent-name.strategist   { color: var(--agent-strategist); }
.chat-message .agent-name.advocate     { color: var(--agent-advocate); }
.chat-message .agent-name.psychologist { color: var(--agent-psychologist); }
.chat-message .agent-name.paralegal    { color: var(--agent-paralegal); }
.chat-message .content {
    font-size: 0.92rem;
    line-height: 1.65;
    white-space: pre-wrap;
}
.chat-input-area {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
}
.chat-input-area textarea {
    flex: 1;
    resize: none;
    min-height: 3rem;
    max-height: 8rem;
}
.chat-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

/* ─── WAR ROOM ───────────────────────────────────── */

.wargame-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    height: calc(100vh - 12rem);
}
.wargame-input, .wargame-output { display: flex; flex-direction: column; }
.wargame-input textarea {
    flex: 1;
    resize: none;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}
.wargame-output { overflow-y: auto; }
.wargame-section { margin-bottom: 1.5rem; }
.wargame-section h4 {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.wargame-section.predicted h4  { color: var(--accent-red); }
.wargame-section.counter h4    { color: var(--accent-green); }
.wargame-section.improved h4   { color: var(--accent-blue); }
.wargame-section.persuasion h4 { color: var(--accent-purple); }
.wargame-section .card h4 {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* ─── FILE UPLOAD ────────────────────────────────── */

.upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.upload-zone:hover, .upload-zone.drag-over,
.upload-zone:focus-visible {
    border-color: var(--accent-blue);
    background: rgba(91, 168, 255, 0.05);
}
.upload-zone p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 0.88rem;
}

/* ─── LOADING / THINKING ─────────────────────────── */

.thinking {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 0.75rem 1rem;
}
.thinking-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-blue);
    animation: dot-bounce 1.4s infinite ease-in-out both;
}
.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ─── TEXT-TO-SPEECH CONTROLS ────────────────────── */

.tts-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
#tts-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
#tts-toggle:hover { border-color: var(--accent-blue); color: var(--text-primary); }
#tts-toggle.tts-active {
    background: rgba(61, 219, 164, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
}
.tts-icon { font-size: 1rem; }
.tts-speed-control {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.tts-speed-control input[type="range"] {
    width: 70px;
    height: 4px;
    padding: 0;
    accent-color: var(--accent-blue);
}
.tts-speak-btn {
    font-size: 0.78rem !important;
    padding: 0.3rem 0.7rem !important;
    min-height: 36px !important;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}
.tts-speak-btn:hover { opacity: 1; }
.chat-message .tts-speak-btn { margin-top: 0.5rem; display: inline-flex; }

/* ─── DOCUMENT VAULT ────────────────────────────── */

.doc-open-link {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.doc-open-link:hover { color: var(--text-primary); text-decoration: underline; }

/* ─── UTILITIES ──────────────────────────────────── */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-sm { font-size: 0.88rem; }
.text-xs { font-size: 0.76rem; }
.text-muted { color: var(--text-muted); }
.hidden { display: none; }

/* ─── HTMX TRANSITIONS ──────────────────────────── */

.htmx-indicator { opacity: 0; transition: opacity 200ms; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-settling { opacity: 0.8; }

/* ─── RESPONSIVE ────────────────────────────────── */

@media (max-width: 900px) {
    .mobile-header { display: flex; }

    #sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-med);
        top: 0;
        padding-top: 1rem;
        box-shadow: var(--shadow-pop);
    }
    #sidebar.open { transform: translateX(0); }

    #main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 1.25rem 1rem;
    }

    .wargame-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .wargame-input textarea { min-height: 260px; }
    .chat-container { height: calc(100vh - 14rem); }
    .chat-message { max-width: 100%; }
    .form-row > * { min-width: 100%; }
}

@media (max-width: 480px) {
    .page-header h2 { font-size: 1.3rem; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── PRICING GRID ───────────────────────────────── */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    padding: 1.75rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.2s, transform 0.2s;
}
.pricing-card:hover {
    border-color: var(--border-strong);
}

.pricing-featured {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 1px var(--accent-yellow), 0 4px 24px rgba(255,209,102,0.08);
}
.pricing-current {
    border-color: var(--accent-green);
}

.pricing-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-yellow);
    color: var(--bg-primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pricing-header h3 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    color: var(--text-primary);
}
.pricing-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.35rem;
}
.price-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-yellow);
    letter-spacing: -0.02em;
}
.price-period {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.pricing-tagline {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    flex: 1;
}
.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
}
.pricing-features li svg {
    color: var(--accent-green);
    flex-shrink: 0;
    margin-top: 2px;
}

.pricing-action {
    margin-top: auto;
}
.btn-full { width: 100%; }

/* FAQ */
.faq-list details {
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 0;
}
.faq-list details:last-child { border-bottom: none; }
.faq-list summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.faq-list summary::before {
    content: '▸';
    transition: transform 0.15s;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.faq-list details[open] summary::before {
    transform: rotate(90deg);
}
.faq-list details p {
    margin: 0.5rem 0 0 1.2rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ─── PRINT ─────────────────────────────────────── */

@media print {
    #sidebar, .mobile-header, #upl-reminder-banner, .skip-link { display: none !important; }
    #main-content { margin-left: 0; }
    body { background: #fff; color: #000; }
}



/* ═══════════════════════════════════════════════════════════════
   Phase 4 — Marketing site, Case Strength Score, Referral
   ═══════════════════════════════════════════════════════════════ */

/* ─── MARKETING BODY (no app-shell sidebar) ──────── */

.marketing-body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── MARKETING HEADER ───────────────────────────── */

.marketing-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 14, 20, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.marketing-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.marketing-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--accent-yellow);
    font-weight: 700;
    font-size: 1.2rem;
}
.marketing-logo svg {
    stroke: var(--accent-yellow);
}
.marketing-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}
.marketing-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}
.marketing-nav a:hover {
    color: var(--text-primary);
}
.marketing-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}
.marketing-mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-color);
}
.marketing-mobile-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .marketing-nav { display: none; }
    .marketing-menu-btn { display: block; }
}

/* ─── BUTTONS (marketing) ────────────────────────── */

.btn-primary-sm, .btn-primary-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent-yellow);
    color: #0d0f14;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}
.btn-primary-sm {
    padding: 8px 18px;
    font-size: 0.9rem;
}
.btn-primary-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}
.btn-primary-sm:hover, .btn-primary-lg:hover {
    background: #ffe69a;
}

.btn-outline-sm, .btn-outline-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
    white-space: nowrap;
}
.btn-outline-sm {
    padding: 8px 18px;
    font-size: 0.9rem;
}
.btn-outline-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}
.btn-outline-sm:hover, .btn-outline-lg:hover {
    border-color: var(--accent-yellow);
    background: rgba(255, 209, 102, 0.06);
}

/* ─── HERO ───────────────────────────────────────── */

.hero {
    padding: 80px 24px 60px;
    text-align: center;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(91,168,255,0.12), transparent);
}
.hero-inner {
    max-width: 780px;
    margin: 0 auto;
}
.hero-badge {
    display: inline-block;
    background: rgba(91,168,255,0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(91,168,255,0.2);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
}
.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}
.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 36px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-note {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── SECTIONS ───────────────────────────────────── */

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}
.section-heading {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    text-align: center;
    margin: 0 0 8px;
}
.section-subheading {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin: 0 0 48px;
}

/* ─── HIGHLIGHT CARD (Case Score callout) ────────── */

.section-highlight {
    padding: 60px 24px;
}
.highlight-card {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
}
.highlight-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(61,219,164,0.12);
    border-radius: 12px;
}
.highlight-icon svg {
    stroke: var(--accent-green);
}
.highlight-text h2 {
    margin: 0 0 8px;
    font-size: 1.3rem;
    font-weight: 700;
}
.highlight-text p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 12px;
}
.highlight-link {
    color: var(--accent-green);
    font-weight: 600;
    text-decoration: none;
}
.highlight-link:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .highlight-card { flex-direction: column; }
}

/* ─── FEATURES GRID ──────────────────────────────── */

.section-features {
    padding: 80px 24px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 28px;
    transition: border-color 0.2s, transform 0.15s;
}
.feature-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}
.feature-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(91,168,255,0.1);
    border-radius: 10px;
    margin-bottom: 16px;
}
.feature-icon svg {
    stroke: var(--accent-blue);
}
.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px;
}
.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 12px;
}
.feature-tier {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-yellow);
    background: rgba(255,209,102,0.1);
    padding: 3px 10px;
    border-radius: 6px;
}

/* ─── STATS ──────────────────────────────────────── */

.section-stats {
    padding: 60px 24px;
    background: var(--bg-secondary);
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.stat-card {
    text-align: center;
    padding: 28px 20px;
}
.stat-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-yellow);
    margin-bottom: 4px;
}
.stat-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.stat-detail {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ─── CTA SECTION ────────────────────────────────── */

.section-cta {
    padding: 80px 24px;
    text-align: center;
}
.section-cta h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin: 0 0 12px;
}
.section-cta p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin: 0 0 32px;
}

/* ─── FOOTER ─────────────────────────────────────── */

.marketing-footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 24px;
}
.marketing-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-yellow);
    font-weight: 700;
    margin-bottom: 12px;
}
.footer-brand svg {
    stroke: var(--accent-yellow);
}
.footer-disclaimer {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 560px;
    margin: 0 auto 16px;
}
.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 16px;
}
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}
.footer-links a:hover {
    color: var(--text-primary);
}
.footer-copy {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ─── CASE STRENGTH SCORE PAGE ───────────────────── */

.score-page {
    padding: 60px 24px 80px;
}
.score-header {
    text-align: center;
    margin-bottom: 40px;
}
.score-header h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 800;
    margin: 0 0 12px;
}
.score-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}
.score-layout {
    max-width: 640px;
    margin: 0 auto;
}

/* ─── SCORE FORM ─────────────────────────────────── */

.score-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
}
.score-form .form-group {
    margin-bottom: 20px;
}
.score-form label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.label-optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.form-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 8px;
    line-height: 1.5;
}
.score-form select,
.score-form input[type="text"],
.score-form textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.score-form select:focus,
.score-form input:focus,
.score-form textarea:focus {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 2px rgba(255,209,102,0.15);
}
.score-form textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.6;
}
.char-count {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.score-submit {
    width: 100%;
    margin-top: 8px;
}
.score-submit .submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.spinner {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.score-disclaimer {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 16px;
    line-height: 1.5;
}

/* ─── SCORE RESULT ───────────────────────────────── */

.score-result {
    margin-top: 32px;
}
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 36px 32px;
    text-align: center;
}
.result-score-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--ring-color, var(--accent-green));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    background: rgba(0,0,0,0.3);
}
.result-score-num {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}
.result-grade {
    font-size: 1rem;
    font-weight: 700;
    opacity: 0.8;
}
.result-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 4px;
}
.result-case-type {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 16px;
    text-transform: capitalize;
}
.result-summary {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 24px;
    text-align: left;
}
.result-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Breakdown bars */
.result-breakdown {
    text-align: left;
    margin-bottom: 24px;
}
.result-breakdown h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 16px;
}
.breakdown-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.breakdown-label {
    width: 130px;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}
.breakdown-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}
.breakdown-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease-out;
}
.breakdown-val {
    width: 55px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}


/* ─── Voice Usage Meter ──────────────────────────── */
.usage-meter {
    max-width: 400px;
}
.usage-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}
.usage-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.6s ease;
}
.usage-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
}


/* ─── Panel Review Cards ─────────────────────────── */
.panel-review-card {
    border: 1px solid rgba(59,130,246,0.25);
    background: rgba(59,130,246,0.03);
}
.panel-agent-card,
.panel-synthesis-card,
.panel-audit-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.panel-synthesis-card {
    border-color: rgba(59,130,246,0.3);
    background: rgba(59,130,246,0.04);
}
.panel-audit-card {
    border-color: rgba(255,217,102,0.3);
    background: rgba(255,217,102,0.03);
}
.panel-agent-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.panel-agent-icon {
    font-size: 1.2rem;
}
.panel-agent-body {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.panel-agent-body h4 {
    color: var(--text-primary);
    margin: 0.75rem 0 0.25rem;
    font-size: 0.92rem;
}
.panel-agent-body h5 {
    color: var(--text-primary);
    margin: 0.5rem 0 0.15rem;
    font-size: 0.88rem;
}
.panel-gauntlet-stats {
    display: flex;
    gap: 1.25rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}
.panel-flagged {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.82rem;
    color: #fecaca;
}
.panel-flagged li {
    margin: 0.25rem 0;
}
.panel-upgrade-gate {
    text-align: center;
    padding: 1.5rem;
}
.panel-upgrade-gate p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}



/* ─── Case Odds widget ─────────────────────────────────────── */
.odds-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0 0.75rem;
}
.odds-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.odds-pct { font-size: 1.4rem; font-weight: 700; margin-left: 2px; }
.odds-verdict { font-size: 1.05rem; font-weight: 700; }
.odds-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.odds-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.odds-factors { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.odds-factor {
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}
.odds-factor-empty { opacity: 0.55; }
.odds-factor-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}
.odds-factor-label { font-weight: 600; }
.odds-factor-score { font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.odds-factor-weight { color: var(--text-muted, #98a2b3); font-weight: 400; }
.odds-na { color: var(--text-muted, #98a2b3); font-style: italic; }
.odds-factor-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin: 6px 0 4px;
}
.odds-factor-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.odds-factor-detail { margin-top: 2px; }



/* ─── Legal pages (Terms / Privacy) ────────────────────────── */
.legal-page { padding: 3rem 1.25rem 5rem; }
.legal-inner { max-width: 820px; margin: 0 auto; line-height: 1.7; }
.legal-inner h1 { font-size: 2rem; margin: 0 0 0.25rem; letter-spacing: -0.01em; }
.legal-updated { color: var(--text-muted, #98a2b3); font-size: 0.9rem; margin: 0 0 1.5rem; }
.legal-inner h2 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
.legal-inner p, .legal-inner li { font-size: 1rem; color: var(--text-secondary, #cdd3df); }
.legal-inner ul { padding-left: 1.25rem; }
.legal-inner li { margin-bottom: 0.35rem; }
.legal-inner a { color: var(--accent, #ffd966); }
.legal-callout {
    background: rgba(255, 217, 102, 0.08);
    border: 1px solid rgba(255, 217, 102, 0.25);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1rem 0 1.5rem;
    font-size: 0.98rem;
}
.legal-footnote {
    margin-top: 2rem;
    font-size: 0.88rem;
    color: var(--text-muted, #98a2b3);
    font-style: italic;
}

/* Attorney / find-a-lawyer page */
.attorney-list { padding-left: 1.25rem; margin: 0.5rem 0 1rem; }
.attorney-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0 1rem;
}
.attorney-resource {
    background: var(--surface-2, rgba(255,255,255,0.03));
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 12px;
    padding: 1rem 1.15rem;
}
.attorney-resource h3 { font-size: 1.05rem; margin: 0 0 0.4rem; }
.attorney-resource h3 a { color: var(--accent, #ffd966); text-decoration: none; }
.attorney-resource h3 a:hover,
.attorney-resource h3 a:focus-visible { text-decoration: underline; }
.attorney-resource p { font-size: 0.95rem; margin: 0; }
.attorney-partner-note {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border, rgba(255,255,255,0.18));
    border-radius: 12px;
    padding: 0.5rem 1.25rem 1rem;
    margin: 1.75rem 0 1rem;
}
.attorney-cta-line { margin-top: 1.75rem; font-weight: 500; }

/* Shareable card box (score result) */
.card-share-box {
    margin: 1rem 0 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 10px;
    text-align: left;
}
.card-share-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.card-share-row input {
    flex: 1 1 220px;
    min-width: 0;
    padding: 8px 12px;
    background: var(--bg-base, #0e1116);
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 13px;
    font-family: monospace;
}
