    /* Hidden until auth is confirmed to avoid a flash of protected content */
    body { visibility: hidden; }
    :root {
      color-scheme: light;
      --navy: #1a2744;
      --navy-mid: #243356;
      --navy-light: #2e4070;
      --gold: #c9a84c;
      --gold-light: #e8c878;
      --white: #ffffff;
      --off-white: #f8f9fc;
      --gray-50: #f1f3f8;
      --gray-100: #e4e8f0;
      --gray-200: #c8d0e0;
      --gray-300: #a0aec0;
      --gray-500: #6b7a99;
      --gray-700: #3d4b6b;
      --gray-900: #1a2233;
      --green: #1a7a4a;
      --green-bg: #e8f5ee;
      --red: #a31515;
      --red-bg: #fdeaea;
      --amber: #8a6200;
      --amber-bg: #fdf6e3;
      --blue: #1a5fa3;
      --blue-bg: #e8f0fa;
      --purple: #5b1fa3;
      --purple-bg: #f0e8fa;
      --shadow-sm: 0 1px 3px rgba(26,39,68,0.08);
      --shadow: 0 2px 8px rgba(26,39,68,0.12);
      --shadow-lg: 0 4px 24px rgba(26,39,68,0.16);
      --radius: 8px;
      --radius-lg: 12px;
      --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
      --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;
    }
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { font-size: 16px; }
    body { font-family: var(--font); background: var(--gray-50); color: var(--gray-900); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }

    /* ── HEADER ── */
    header { background: var(--navy); color: var(--white); padding: 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
    .header-top { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex-shrink: 0; }
    .logo-icon { width: 38px; height: 38px; background: var(--gold); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
    .logo-text { }
    .logo-text h1 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
    .logo-text span { font-size: 0.72rem; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.06em; }
    .search-wrap { flex: 1; max-width: 540px; position: relative; }
    .search-wrap input { width: 100%; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 9px 16px 9px 40px; color: var(--white); font-size: 0.875rem; outline: none; transition: all 0.2s; }
    .search-wrap input::placeholder { color: rgba(255,255,255,0.45); }
    .search-wrap input:focus { background: rgba(255,255,255,0.15); border-color: var(--gold); }
    .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: 0.5; font-size: 15px; pointer-events: none; }
    .search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2); border: none; border-radius: 50%; width: 18px; height: 18px; display: none; align-items: center; justify-content: center; cursor: pointer; color: rgba(255,255,255,0.8); font-size: 11px; line-height: 1; padding: 0; transition: background 0.15s; }
    .search-clear:hover { background: rgba(255,255,255,0.35); color: #fff; }
    .search-clear.visible { display: flex; }
    .search-wrap input:not(:placeholder-shown) { padding-right: 32px; }
    .header-meta { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-shrink: 0; }
    .last-updated { font-size: 0.75rem; color: rgba(255,255,255,0.5); }
    .welcome { font-size: 0.8rem; color: rgba(255,255,255,0.75); font-weight: 500; white-space: nowrap; }
    .welcome b { color: #c8a84b; font-weight: 700; }
    .btn-primary { background: var(--gold); color: var(--navy); border: none; border-radius: 6px; padding: 8px 16px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
    .btn-primary:hover { background: var(--gold-light); }
    .btn-logout { background: rgba(255,255,255,0.1); color: var(--white); border: 1px solid rgba(255,255,255,0.25); border-radius: 6px; padding: 7px 14px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
    .btn-logout:hover { background: rgba(255,255,255,0.2); }
    .btn-settings { background: rgba(255,255,255,0.1); color: var(--white); border: 1px solid rgba(255,255,255,0.25); border-radius: 6px; padding: 7px 14px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.15s; white-space: nowrap; text-decoration: none; }
    .btn-settings:hover { background: rgba(255,255,255,0.2); }
    /* First-visit highlight for new admins locating the Firm Admin button. */
    .fa-pulse { animation: faPulse 1.1s ease-in-out 4; }
    @keyframes faPulse {
      0%, 100% { box-shadow: 0 0 0 0 rgba(200,168,75,0); background: rgba(255,255,255,0.1); }
      50%      { box-shadow: 0 0 0 5px rgba(200,168,75,0.55); background: rgba(200,168,75,0.28); }
    }
    .stats-bar { display: flex; align-items: center; gap: 24px; padding: 8px 24px; background: rgba(0,0,0,0.15); overflow-x: auto; }
    .stat-item { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: rgba(255,255,255,0.7); white-space: nowrap; }
    .stat-num { font-weight: 700; color: var(--gold); font-size: 0.9rem; }

    /* ── LAYOUT ── */
    .app-body { display: flex; flex: 1; }
    .sidebar { width: 280px; flex-shrink: 0; background: var(--white); border-right: 1px solid var(--gray-100); padding: 20px; overflow-y: auto; height: calc(100vh - 110px); position: sticky; top: 110px; }
    .main-content { flex: 1; padding: 20px 24px; min-width: 0; }

    /* ── SIDEBAR ── */
    .filter-section { margin-bottom: 24px; }
    .filter-section h3 { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-500); margin-bottom: 10px; }
    .filter-clear { float: right; font-size: 0.7rem; color: var(--blue); cursor: pointer; font-weight: 500; text-transform: none; letter-spacing: 0; }
    .filter-clear:hover { text-decoration: underline; }

    /* Court checkboxes */
    .court-list { display: flex; flex-direction: column; gap: 4px; }
    .court-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; transition: background 0.15s; }
    .court-item:hover { background: var(--gray-50); }
    .court-item input[type="checkbox"] { accent-color: var(--navy); width: 14px; height: 14px; cursor: pointer; }
    .court-label { font-size: 0.82rem; color: var(--gray-700); flex: 1; }
    .court-count { font-size: 0.7rem; color: var(--gray-300); }
    /* Collapsible Court section */
    .filter-section h3[data-action="toggle-courts"] { cursor: pointer; user-select: none; }
    .court-caret { display: inline-block; width: 0.85em; font-size: 0.62rem; color: var(--gray-500); }
    #courtSection.courts-collapsed .court-list { display: none; }

    /* Date range */
    .date-range { display: flex; flex-direction: column; gap: 6px; }
    .date-range input { width: 100%; border: 1px solid var(--gray-200); border-radius: 6px; padding: 6px 10px; font-size: 0.8rem; color: var(--gray-700); outline: none; }
    .date-range input:focus { border-color: var(--navy); }
    .date-range label { font-size: 0.72rem; color: var(--gray-500); }

    /* Tag browser */
    .tag-category { margin-bottom: 6px; }
    .tag-cat-header { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; cursor: pointer; transition: background 0.15s; user-select: none; }
    .tag-cat-header:hover { background: var(--gray-50); }
    .tag-cat-icon { font-size: 0.85rem; }
    .tag-cat-label { font-size: 0.8rem; font-weight: 600; color: var(--gray-700); flex: 1; }
    .tag-cat-count { font-size: 0.68rem; color: var(--gray-300); }
    .tag-cat-arrow { font-size: 0.65rem; color: var(--gray-300); transition: transform 0.2s; }
    .tag-cat-arrow.open { transform: rotate(90deg); }
    .tag-children { padding-left: 20px; display: none; }
    .tag-children.open { display: block; }
    .tag-child-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 5px; cursor: pointer; transition: background 0.15s; }
    .tag-child-item:hover { background: var(--gray-50); }
    .tag-child-item input[type="checkbox"] { accent-color: var(--navy); width: 13px; height: 13px; cursor: pointer; }
    .tag-child-label { font-size: 0.78rem; color: var(--gray-500); flex: 1; }
    .tag-child-count { font-size: 0.68rem; color: var(--gray-200); }

    /* Significance filter */
    .sig-pills { display: flex; flex-wrap: wrap; gap: 5px; }
    .sig-pill { padding: 4px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; cursor: pointer; border: 1.5px solid transparent; transition: all 0.15s; }
    .sig-pill.novel { background: var(--purple-bg); color: var(--purple); border-color: transparent; }
    .sig-pill.novel.active, .sig-pill.novel:hover { border-color: var(--purple); }
    .sig-pill.circuit-split { background: var(--red-bg); color: var(--red); }
    .sig-pill.circuit-split.active, .sig-pill.circuit-split:hover { border-color: var(--red); }
    .sig-pill.rule-change { background: var(--blue-bg); color: var(--blue); }
    .sig-pill.rule-change.active, .sig-pill.rule-change:hover { border-color: var(--blue); }
    .sig-pill.precedent { background: var(--amber-bg); color: var(--amber); }
    .sig-pill.precedent.active, .sig-pill.precedent:hover { border-color: var(--amber); }
    .sig-pill.notable { background: var(--green-bg); color: var(--green); }
    .sig-pill.notable.active, .sig-pill.notable:hover { border-color: var(--green); }

    /* Outcome filter */
    .outcome-select { width: 100%; border: 1px solid var(--gray-200); border-radius: 6px; padding: 7px 10px; font-size: 0.82rem; color: var(--gray-700); outline: none; background: var(--white); }
    .outcome-select:focus { border-color: var(--navy); }

    /* ── MAIN CONTENT ── */
    .content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
    .result-count { font-size: 0.85rem; color: var(--gray-500); }
    /* Active-filter chips: every filter in force, each removable in one click */
    .active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -6px 0 14px; }
    .active-filters:empty { display: none; }
    .af-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gray-400, #8a94a6); margin-right: 2px; }
    .af-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef2f8; color: var(--navy); border: 1px solid #d6dde9; border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 0.76rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
    .af-chip:hover { background: #e3e9f3; border-color: var(--gold); }
    .af-chip .af-k { font-weight: 500; color: var(--gray-500); }
    .af-chip .af-x { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: rgba(27,42,74,.12); font-size: 0.68rem; line-height: 1; }
    .af-chip:hover .af-x { background: var(--navy); color: #fff; }
    .af-clear { font-size: 0.76rem; font-weight: 700; color: var(--navy); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; background: none; border: 0; padding: 3px 6px; font-family: inherit; }
    .result-count strong { color: var(--gray-900); }
    .sort-wrap { display: flex; align-items: center; gap: 8px; }
    .sort-wrap label { font-size: 0.78rem; color: var(--gray-500); }
    .sort-wrap select { border: 1px solid var(--gray-200); border-radius: 6px; padding: 6px 10px; font-size: 0.8rem; color: var(--gray-700); background: var(--white); outline: none; }

    /* Case cards */
    .case-list { display: flex; flex-direction: column; gap: 12px; }
    .case-card { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 0; overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, border-color 0.2s; }
    .case-card:hover { box-shadow: var(--shadow); border-color: var(--gray-200); }
    .case-card.expanded { border-color: var(--navy); box-shadow: var(--shadow-lg); }
    .case-card-header { display: flex; align-items: flex-start; gap: 14px; padding: 16px 20px; cursor: pointer; }
    .court-badge { flex-shrink: 0; background: var(--navy); color: var(--gold); border-radius: 6px; padding: 4px 8px; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; margin-top: 2px; }
    .case-main { flex: 1; min-width: 0; }
    .case-name { font-size: 0.95rem; font-weight: 700; color: var(--navy); line-height: 1.3; margin-bottom: 3px; }
    /* Weekly demarcation lines between cards */
    .week-divider { display: flex; align-items: center; gap: 12px; margin: 18px 2px 6px; }
    .week-divider::before, .week-divider::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }
    .week-divider:first-child { margin-top: 0; }
    .week-divider-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gray-300); white-space: nowrap; }
    /* "New since your last visit" markers */
    .case-card.is-new { border-left: 3px solid var(--gold); }
    .new-badge { display: inline-block; background: var(--gold); color: var(--navy); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.05em; padding: 1px 6px; border-radius: 999px; vertical-align: middle; margin-right: 7px; position: relative; top: -1px; }
    .new-since-note { color: var(--gold); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
    .new-since-note:hover { filter: brightness(1.15); }
    .new-since-note.active { background: var(--gold); color: var(--ink, #0e1a2b); padding: 1px 8px; border-radius: 999px; text-decoration: none; }
    /* Courts we label but don't yet cover */
    .court-item-unavailable { opacity: 0.55; cursor: default; }
    .court-item-unavailable:hover { background: transparent; }
    .court-item-unavailable input { cursor: not-allowed; }
    .court-unavail-tag { font-style: italic; color: var(--gray-300); text-transform: none; }
    .case-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
    .case-number { font-size: 0.72rem; font-family: var(--font-mono); color: var(--gray-500); }
    .case-date { font-size: 0.72rem; color: var(--gray-700); }
    .case-card-header:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 8px; }
    .outcome-badge { padding: 2px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 600; }
    .outcome-affirmed { background: var(--green-bg); color: var(--green); }
    .outcome-reversed { background: var(--red-bg); color: var(--red); }
    .outcome-remanded { background: var(--amber-bg); color: var(--amber); }
    .outcome-amended { background: var(--blue-bg); color: var(--blue); }
    .outcome-quashed { background: var(--purple-bg); color: var(--purple); }
    .outcome-dismissed { background: var(--gray-100); color: var(--gray-500); }
    .case-summary { font-size: 0.82rem; color: var(--gray-500); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    /* When the card is open, show the full narrative summary (not the 2-line preview). */
    .case-card.expanded .case-summary { display: block; -webkit-line-clamp: unset; overflow: visible; margin-bottom: 4px; }
    .case-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
    .tag-chip { padding: 2px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 500; cursor: pointer; }
    .tag-chip:hover { opacity: 0.8; }
    .sig-badge { display: flex; align-items: center; gap: 4px; }
    .sig-icon { font-size: 0.75rem; }
    .expand-btn { flex-shrink: 0; color: var(--gray-300); transition: transform 0.2s, color 0.2s; margin-top: 2px; font-size: 1rem; }
    .case-card.expanded .expand-btn { transform: rotate(180deg); color: var(--navy); }

    /* Case detail panel */
    .case-detail { padding: 0 20px 20px; border-top: 1px solid var(--gray-100); display: none; }
    .case-card.expanded .case-detail { display: block; }
    .detail-section { margin-top: 16px; }
    .detail-section h4 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--gray-500); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
    .detail-section p, .detail-section li { font-size: 0.85rem; color: var(--gray-700); line-height: 1.65; }
    .detail-section ul { padding-left: 18px; }
    .detail-section li { margin-bottom: 4px; }
    .significance-box { background: var(--amber-bg); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; padding: 12px 14px; }
    .significance-box p { font-size: 0.84rem; color: var(--gray-700); line-height: 1.6; }
    .sig-type-label { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; margin-bottom: 8px; }
    .citations-list { display: flex; flex-direction: column; gap: 6px; }
    .citation-item { display: flex; align-items: flex-start; gap: 8px; background: var(--gray-50); border-radius: 6px; padding: 8px 12px; }
    .citation-icon { font-size: 0.8rem; margin-top: 1px; flex-shrink: 0; }
    .citation-text { font-size: 0.8rem; color: var(--gray-700); font-family: var(--font-mono); }
    .verified-badge { font-size: 0.65rem; background: var(--green-bg); color: var(--green); padding: 1px 6px; border-radius: 3px; font-family: var(--font); font-weight: 600; margin-left: 6px; }
    .source-links { display: flex; flex-wrap: wrap; gap: 6px; }
    .source-link { font-size: 0.75rem; color: var(--blue); text-decoration: none; padding: 3px 8px; background: var(--blue-bg); border-radius: 4px; }
    .source-link:hover { text-decoration: underline; }
    .window-note { font-size: 0.72rem; background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 5px; padding: 5px 10px; color: var(--gray-500); display: inline-flex; align-items: center; gap: 5px; margin-bottom: 8px; }

    /* Empty state */
    .empty-state { text-align: center; padding: 60px 20px; color: var(--gray-500); }
    .empty-state svg { opacity: 0.3; margin-bottom: 12px; }
    .empty-state h3 { font-size: 1rem; color: var(--gray-700); margin-bottom: 6px; }
    .empty-state p { font-size: 0.85rem; }

    /* ── FOOTER ── */
    footer { background: var(--navy); color: rgba(255,255,255,0.6); padding: 24px; margin-top: auto; }
    .footer-inner { max-width: 900px; margin: 0 auto; }
    .disclaimer-box { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
    .disclaimer-box h4 { color: var(--gold); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
    .disclaimer-box p { font-size: 0.78rem; line-height: 1.6; color: rgba(255,255,255,0.55); }
    .footer-links { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
    .footer-links span { font-size: 0.75rem; }

    /* ── MOBILE ── */
    @media (max-width: 768px) {
      .sidebar { display: none; }
      /* Let the header reflow instead of overflowing the viewport sideways. */
      .header-top { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
      .logo { flex: 1 1 auto; min-width: 0; }          /* allow the wordmark to shrink so its subtitle wraps */
      .logo-text h1 { font-size: 1rem; }
      .logo-text span { font-size: 0.62rem; white-space: normal; }
      .header-meta { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
      .header-meta .welcome { display: none; }          /* secondary identity text; drop it to reclaim width on phones */
      .header-meta .last-updated { display: none; }     /* keep the logout button visible on mobile */
      .search-wrap { order: 3; flex: 1 1 100%; max-width: none; }  /* search gets its own full-width row */
      .stats-bar { gap: 12px; padding: 8px 14px; }
      .main-content { padding: 14px; min-width: 0; }
      .case-card-header { flex-wrap: wrap; }
    }

    /* ── SCROLL HIGHLIGHT ── */
    .highlight { background: #fff3cd; border-radius: 2px; }

    /* ── TAG COLOR CLASSES ── */
    .tag-CIVIL_PROCEDURE { background: #e8f0fa; color: #1a5fa3; }
    .tag-EVIDENCE { background: #e8f5ee; color: #1a7a4a; }
    .tag-CONSTRUCTION { background: #fff3e0; color: #bf5700; }
    .tag-COMMERCIAL { background: #f3e8fa; color: #6a1fa3; }
    .tag-NEGLIGENCE { background: #fde8e8; color: #a31515; }
    .tag-DAMAGES { background: #fdf6e3; color: #8a6200; }
    .tag-INSURANCE { background: #e3f0ff; color: #0055aa; }
    .tag-PROFESSIONAL_LIABILITY { background: #f0f0f0; color: #444; }
    .tag-REAL_PROPERTY { background: #e8faf0; color: #1a6a3a; }
    .tag-APPELLATE_PRACTICE { background: #f5e8ff; color: #6a1aaa; }
    .tag-PROCEDURAL_POSTURE { background: #fff8e8; color: #7a5200; }
    .tag-ADMINISTRATIVE { background: #e0f7f7; color: #0a6b6b; }
    /* Criminal-track tag categories (namespaced parent IDs) */
    .tag-SEARCH_SEIZURE { background: #e8f0fa; color: #1a5fa3; }
    .tag-CONFESSIONS { background: #f3e8fa; color: #6a1fa3; }
    .tag-TRIAL_RIGHTS { background: #fff3e0; color: #bf5700; }
    .tag-JURY { background: #e8faf0; color: #1a6a3a; }
    .tag-EVIDENCE_CRIM { background: #e8f5ee; color: #1a7a4a; }
    .tag-SUFFICIENCY { background: #fde8e8; color: #a31515; }
    .tag-SENTENCING { background: #fdf6e3; color: #8a6200; }
    .tag-PLEAS { background: #f0f0f0; color: #444; }
    .tag-POSTCONVICTION { background: #f5e8ff; color: #6a1aaa; }
    .tag-PROBATION { background: #e3f0ff; color: #0055aa; }
    .tag-DUI_TRAFFIC { background: #fff8e8; color: #7a5200; }
    .tag-JUVENILE { background: #e0f7f7; color: #0a6b6b; }
    .tag-FINES_COSTS { background: #eef7e0; color: #4a6b0a; }
    .tag-CRIM_APPEAL { background: #f0e8fa; color: #5b1fa3; }

    /* Body-of-law switch (Civil | Criminal) */
    .track-tabs { display: flex; gap: 4px; align-items: stretch; justify-content: center; background: var(--navy); padding: 6px 16px 0; border-bottom: 1px solid rgba(255,255,255,0.08); position: sticky; top: 0; z-index: 99; }
    .track-tab { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: rgba(255,255,255,0.72); border: none; border-bottom: 3px solid transparent; padding: 10px 22px; font-family: var(--font); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: color .15s, background .15s, border-color .15s; border-radius: 6px 6px 0 0; }
    .track-tab:hover { color: #fff; background: rgba(255,255,255,0.06); }
    .track-tab.active { color: var(--gold-light); border-bottom-color: var(--gold); }
    .track-tab-icon { font-size: 1rem; line-height: 1; }
    .track-tab-count { background: rgba(255,255,255,0.14); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; min-width: 20px; text-align: center; }
    .track-tab.active .track-tab-count { background: var(--gold); color: var(--navy); }
    /* Locked (un-owned) library — an upsell to add it */
    .track-tab.locked { color: rgba(255,255,255,0.5); }
    .track-tab.locked:hover { color: #fff; background: rgba(201,168,76,0.14); border-bottom-color: rgba(201,168,76,0.5); }
    .track-tab-lock { font-size: 0.72rem; font-weight: 700; color: var(--gold-light); background: rgba(201,168,76,0.18); padding: 1px 9px; border-radius: 999px; }

    /* ── KEY FACTS & STRUCTURED HOLDINGS ── */
    .facts-list { display: flex; flex-direction: column; gap: 6px; }
    .fact-item { display: flex; align-items: flex-start; gap: 10px; background: var(--gray-50); border-left: 3px solid var(--gray-200); border-radius: 0 6px 6px 0; padding: 8px 12px; }
    .fact-item::before { content: "◆"; color: var(--gray-300); font-size: 0.55rem; margin-top: 5px; flex-shrink: 0; }
    .fact-item p { font-size: 0.84rem; color: var(--gray-700); line-height: 1.6; margin: 0; }
    .holding-item { margin-bottom: 10px; padding: 10px 14px; background: var(--gray-50); border-radius: 6px; border-left: 3px solid var(--navy-light); }
    .holding-item:last-child { margin-bottom: 0; }
    .holding-rule { font-size: 0.85rem; color: var(--gray-900); line-height: 1.6; font-weight: 500; margin-bottom: 0; }
    .holding-facts { font-size: 0.79rem; color: var(--gray-500); line-height: 1.55; margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--gray-100); font-style: italic; }
    .holding-facts::before { content: "Facts: "; font-weight: 600; font-style: normal; color: var(--gray-400); }

    /* ── My Library (sidebar) ── */
    .library-nav { display: flex; flex-direction: column; gap: 2px; }
    .lib-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 0.82rem; color: var(--gray-700); transition: background 0.15s; }
    .lib-item:hover { background: var(--gray-50); }
    .lib-item.active { background: var(--navy); color: #fff; }
    .lib-item .lib-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .lib-item .lib-count { font-size: 0.7rem; color: var(--gray-300); }
    .lib-item.active .lib-count { color: rgba(255,255,255,0.7); }
    .lib-item .lib-x { opacity: 0; color: var(--gray-300); font-size: 0.9rem; }
    .lib-item:hover .lib-x { opacity: 1; }
    .lib-item .lib-x:hover { color: var(--red); }
    .lib-newbtn { margin-top: 6px; font-size: 0.75rem; color: var(--blue); cursor: pointer; padding: 4px 8px; }
    .lib-newbtn:hover { text-decoration: underline; }

    /* ── Per-case action buttons ── */
    .case-actions { display: flex; gap: 4px; align-items: flex-start; flex-shrink: 0; }
    .ca-btn { background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 6px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.9rem; color: var(--gray-500); transition: all 0.15s; padding: 0; }
    .ca-btn:hover { background: var(--gray-100); color: var(--navy); border-color: var(--gray-200); }
    .ca-btn.active { color: var(--gold); border-color: var(--gold); background: #fdf9ef; }

    /* ── Popover (folder + share menus) ── */
    .popover { position: absolute; z-index: 500; background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; box-shadow: 0 8px 30px rgba(26,39,68,0.18); padding: 8px; min-width: 210px; max-width: 260px; }
    .pop-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); padding: 4px 8px 8px; }
    .pop-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 0.85rem; color: var(--gray-700); cursor: pointer; }
    .pop-row:hover { background: var(--gray-50); }
    .pop-row input { accent-color: var(--navy); }
    .pop-item { width: 100%; text-align: left; background: none; border: none; padding: 8px; border-radius: 6px; font-size: 0.85rem; color: var(--gray-700); cursor: pointer; display: flex; align-items: center; gap: 10px; }
    .pop-item:hover { background: var(--gray-50); }
    .pop-empty { padding: 6px 8px; font-size: 0.8rem; color: var(--gray-400); }
    .pop-new { display: flex; gap: 6px; margin-top: 6px; padding: 6px 6px 2px; border-top: 1px solid var(--gray-100); }
    .pop-new input { flex: 1; border: 1px solid var(--gray-200); border-radius: 6px; padding: 6px 8px; font-size: 0.8rem; outline: none; }
    .pop-new input:focus { border-color: var(--navy); }
    .pop-new button { background: var(--navy); color: #fff; border: none; border-radius: 6px; padding: 0 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer; }

    /* ── Library banner + toast ── */
    .lib-banner { display: none; align-items: center; gap: 10px; background: #eef2f9; border: 1px solid #dbe3f0; border-radius: 8px; padding: 8px 14px; margin-bottom: 14px; font-size: 0.82rem; color: var(--navy); }
    .practice-prompt { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: linear-gradient(90deg,#fbf7ec,#fff); border: 1px solid #ecd9a6; border-radius: 10px; padding: 11px 16px; margin-bottom: 14px; font-size: 0.88rem; color: var(--navy); }
    .pa-prompt-btn { background: var(--navy); color: #fff; border: none; border-radius: 7px; padding: 8px 16px; font-size: 0.83rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
    .pa-prompt-btn:hover { background: #243659; }
    .pa-prompt-x { color: #94a3b8; cursor: pointer; font-size: 1rem; padding: 2px 4px; }
    .pa-prompt-x:hover { color: #64748b; }
    /* Getting-started activation checklist (reuses .practice-prompt banner) */
    .gs-head { white-space: nowrap; }
    .gs-steps { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; flex: 1; }
    .gs-step { display: inline-flex; align-items: center; gap: 7px; }
    .gs-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.6px solid #cbb874; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; flex: none; }
    .gs-step.done .gs-dot { background: #15803d; border-color: #15803d; }
    .gs-step.done .gs-label { color: #64748b; }
    .gs-label { font-size: 0.86rem; }
    .gs-hint { color: #8a6d2f; }
    .gs-choose { padding: 5px 12px; font-size: 0.78rem; margin-left: 4px; }
    .lib-banner.show { display: flex; }
    .lib-banner .lib-clear { margin-left: auto; color: var(--blue); cursor: pointer; font-weight: 600; }
    .toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 0.85rem; box-shadow: 0 6px 24px rgba(0,0,0,0.2); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 600; }
    .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

    /* ── Show more + scroll-to-top/bottom ── */
    .show-more-wrap { text-align: center; padding: 20px 0 12px; }
    .show-more-btn { background: #fff; border: 1.5px solid var(--navy); color: var(--navy); border-radius: 8px; padding: 10px 24px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s; }
    .show-more-btn:hover { background: var(--navy); color: #fff; }
    .show-more-btn span { font-weight: 400; opacity: 0.7; font-size: 0.82rem; }
    .scroll-fab { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 6px; z-index: 400; }
    .scroll-fab button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--gray-200); background: #fff; color: var(--navy); font-size: 1.15rem; cursor: pointer; box-shadow: 0 4px 14px rgba(26,39,68,0.18); display: flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s, transform 0.1s; }
    .scroll-fab button:hover { background: var(--navy); color: #fff; }
    .scroll-fab button:active { transform: scale(0.94); }
    @media (max-width: 640px) { .scroll-fab { right: 12px; bottom: 12px; } .scroll-fab button { width: 38px; height: 38px; } }

    /* ── Notes & personal tags ── */
    .case-utags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
    .utag-chip-sm { display: inline-flex; align-items: center; gap: 4px; font-size: 0.68rem; font-weight: 600; padding: 2px 6px 2px 8px; border-radius: 999px; background: #eef2f9; color: var(--navy); border: 1px solid #dbe3f0; }
    .utag-x-sm { cursor: pointer; color: var(--gray-400); font-size: 0.62rem; line-height: 1; }
    .utag-x-sm:hover { color: var(--red); }
    .utags-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
    .utag-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; padding: 4px 6px 4px 10px; border-radius: 999px; background: #eef2f9; color: var(--navy); border: 1px solid #dbe3f0; }
    .utag-x { cursor: pointer; color: var(--gray-400); font-size: 0.75rem; line-height: 1; }
    .utag-x:hover { color: var(--red); }
    .ca-btn.ca-remove:hover { color: var(--red); border-color: #f3c9c9; background: #fdeeee; }
    .utag-input { border: 1px dashed var(--gray-300); border-radius: 999px; padding: 5px 12px; font-size: 0.8rem; outline: none; min-width: 130px; }
    .utag-input:focus { border-color: var(--navy); border-style: solid; }
    .note-box { width: 100%; min-height: 90px; border: 1px solid var(--gray-200); border-radius: 8px; padding: 10px 12px; font-size: 0.85rem; font-family: inherit; color: var(--gray-900); line-height: 1.55; resize: vertical; outline: none; background: #fff; }
    .note-box:focus { border-color: var(--navy); }
    .note-hint { font-size: 0.72rem; color: var(--gray-400); margin-top: 6px; }
    /* sidebar My Tags */
    .usertags-nav { display: flex; flex-direction: column; gap: 2px; }
    .utag-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; color: var(--gray-700); transition: background 0.15s; }
    .utag-item:hover { background: var(--gray-50); }
    .utag-item.active { background: var(--navy); color: #fff; }
    .utag-item .utag-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .utag-item .utag-cnt { font-size: 0.7rem; color: var(--gray-300); }
    .utag-item.active .utag-cnt { color: rgba(255,255,255,0.7); }

/* ── Cards open on their own page: name is a real link, chevron instead of ▼ ── */
.case-card-header { cursor: pointer; }
.case-link { color: inherit; text-decoration: none; }
.case-link:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.case-card-header:hover .expand-btn { color: var(--navy); transform: translateX(2px); }
.expand-btn { font-size: 1.3rem; line-height: 1; }
.case-card.expanded .expand-btn { transform: none; }

/* ── Effective-date tag on rule-amendment orders ── */
.eff-pill { display: inline-flex; align-items: center; gap: 5px; background: #fff3e0; color: #9a4a00; border: 1px solid #f3c88b; border-radius: 6px; padding: 3px 9px; font-size: 0.72rem; font-weight: 700; margin-bottom: 7px; white-space: nowrap; }
.eff-pill-lg { font-size: 0.8rem; padding: 4px 11px; margin-bottom: 0; }
.rules-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 8px; }
.rules-row-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-500); margin-right: 2px; }
.rule-chip { font-size: 0.74rem; font-weight: 600; background: #eef2f8; color: var(--navy); border: 1px solid #d6dde9; border-radius: 999px; padding: 2px 9px; }

/* ── Sidebar: Rule Changes section ── */
.rule-list { margin: 6px 0 2px 10px; padding-left: 10px; border-left: 2px solid var(--gray-100); }
.rule-list-hint { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400, #8a94a6); margin: 4px 0 2px; }

/* ── Key Facts / Key Holdings: one container each, numbered inside ── */
.detail-box { background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 10px; padding: 14px 18px 14px 16px; }
.detail-ol { margin: 0; padding-left: 24px; }
.detail-ol li { margin-bottom: 9px; font-size: 0.86rem; line-height: 1.62; color: var(--gray-700); padding-left: 2px; }
.detail-ol li:last-child { margin-bottom: 0; }
.detail-ol li::marker { color: var(--navy); font-weight: 700; }
.holdings-box .holding-rule { display: block; color: var(--gray-900); font-weight: 500; }
.holdings-box .holding-facts { display: block; font-size: 0.79rem; color: var(--gray-500); font-style: italic; margin-top: 3px; padding-top: 0; border-top: 0; }

/* ── Case page ── */
.case-page { max-width: 920px; margin: 0 auto; padding: 22px 20px 60px; }
.case-page .back-row { margin-bottom: 14px; }
.back-link { color: var(--navy); font-weight: 600; font-size: 0.88rem; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.case-page-head { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 22px 26px; box-shadow: var(--shadow-sm); }
.case-page-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.case-title { font-size: 1.45rem; color: var(--navy); line-height: 1.3; margin: 10px 0 10px; font-weight: 700; }
.case-page-head .case-meta { margin-bottom: 10px; }
.case-page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.ca-btn-lg { font-size: 0.82rem; padding: 7px 12px; width: auto; height: auto; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.ca-link { color: var(--navy); }
.case-page-body { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 6px 26px 26px; margin-top: 16px; box-shadow: var(--shadow-sm); }
.case-page-summary { font-size: 0.95rem !important; color: var(--gray-900) !important; line-height: 1.7 !important; }
.case-page .detail-section { margin-top: 22px; }
@media (max-width: 640px) { .case-page { padding: 14px 12px 40px; } .case-page-head, .case-page-body { padding-left: 16px; padding-right: 16px; } .case-title { font-size: 1.2rem; } }

/* ══ Legislation & rules ══ */
.legis-only { display: none; }
body.mode-legis .legis-only { display: block; }
body.mode-legis .case-only { display: none !important; }
.view-switch { display: inline-flex; gap: 4px; background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.vs-btn { border: 0; background: transparent; color: var(--gray-500); font: inherit; font-size: 0.85rem; font-weight: 600; padding: 7px 14px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.vs-btn.active { background: var(--white); color: var(--navy); box-shadow: var(--shadow-sm); }
.vs-badge { background: var(--gold); color: var(--navy); border-radius: 999px; font-size: 0.68rem; font-weight: 800; padding: 1px 7px; }
.lg-notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff8e6; border: 1px solid #f0d58a; color: var(--navy); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 0.86rem; }
.lg-notice a { color: var(--navy); font-weight: 700; }
.lg-x { margin-left: auto; border: 0; background: none; color: var(--gray-500); cursor: pointer; font-size: 0.9rem; }
.lg-upcoming { background: #fff8e6; border: 1px solid #f0d58a; color: var(--navy); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 0.86rem; cursor: pointer; }
.lg-link { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.lg-note { background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 10px; padding: 9px 13px; margin: 10px 0; font-size: 0.83rem; color: var(--gray-700); }
.lg-note a { color: var(--navy); font-weight: 700; }
.lg-card { margin-bottom: 12px; }
.lg-badge { background: #eef2f8; color: var(--navy); letter-spacing: .06em; }
.lg-meta-top:empty { display: none; }
.lg-meta-top { margin-bottom: 6px; }
.lg-stage { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef2f8; color: var(--navy); }
.lg-stage.stage-law, .lg-stage.stage-adopted { background: #e3f6ea; color: #14633a; }
.lg-stage.stage-passed_both { background: #e8f0fa; color: #1a5fa3; }
.lg-stage.stage-died, .lg-stage.stage-vetoed, .lg-stage.stage-withdrawn { background: #f1f2f4; color: #6b7280; }
.lg-headline { font-weight: 600; color: var(--gray-900); -webkit-line-clamp: 2; }
.lg-progress { display: flex; align-items: center; gap: 0; margin: 8px 0 6px; flex-wrap: wrap; row-gap: 4px; }
.lg-step { font-size: 0.66rem; font-weight: 700; color: var(--gray-300); text-transform: uppercase; letter-spacing: .04em; display: inline-flex; align-items: center; gap: 5px; }
.lg-step::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--gray-200); display: inline-block; }
.lg-step.on { color: var(--navy); }
.lg-step.on::before { background: var(--gold); }
.lg-bar { width: 18px; height: 2px; background: var(--gray-200); margin: 0 5px; }
.lg-end { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; margin-left: 8px; }
.lg-end.dead, .lg-step.dead { color: #9ca3af; }
.lg-pa { background: #f3f4f6; color: var(--gray-700); }
.eff-past { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.eff-soon { background: #fff3e0; color: #9a4a00; border-color: #f3c88b; }
.eff-proposed { background: #f8fafc; color: #64748b; border-color: #e2e8f0; font-weight: 600; }
.lg-side-group { margin-bottom: 8px; }
.lg-side-h { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); margin: 12px 0 4px; }
.lg-statute, .lg-session { width: 100%; box-sizing: border-box; border: 1px solid var(--gray-200); border-radius: 7px; padding: 7px 9px; font: inherit; font-size: 0.82rem; }
.lg-ai-head { font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.lg-key { font-size: 0.78rem; color: var(--gray-500); margin: -2px 0 10px; }
.lg-table { border-collapse: collapse; width: 100%; font-size: 0.86rem; }
.lg-table td { border-top: 1px solid var(--gray-100); padding: 7px 8px; vertical-align: top; }
.lg-table td a { color: var(--navy); font-weight: 700; text-decoration: none; white-space: nowrap; }
.lg-list { margin: 0; padding-left: 18px; font-size: 0.84rem; color: var(--gray-700); }
.lg-list li { margin-bottom: 4px; }
.lg-hist summary { cursor: pointer; font-size: 0.8rem; font-weight: 700; color: var(--navy); }
.tl-date { color: var(--gray-500); font-size: 0.78rem; margin-right: 6px; }
.lg-timeline { list-style: none; display: flex; gap: 0; padding: 0; margin: 12px 0 10px; flex-wrap: wrap; row-gap: 8px; }
.lg-timeline li { display: flex; flex-direction: column; align-items: flex-start; min-width: 120px; padding-right: 14px; position: relative; color: var(--gray-300); }
.lg-timeline li .tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gray-200); margin-bottom: 4px; }
.lg-timeline li.on { color: var(--navy); }
.lg-timeline li.on .tl-dot { background: var(--gold); }
.lg-timeline li.dead .tl-dot { background: #9ca3af; }
.lg-timeline .tl-l { font-size: 0.78rem; font-weight: 700; }
.lg-timeline .tl-date { margin: 0; }
.sbs { border: 1px solid var(--gray-100); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.sbs h3 { margin: 0; padding: 10px 14px; background: #eef2f8; color: var(--navy); font-size: 0.92rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sbs-act { font-weight: 500; color: var(--gray-500); font-size: 0.8rem; }
.sbs-ct { margin-left: auto; font-weight: 500; color: var(--gray-500); font-size: 0.74rem; }
.sbs-grid { display: grid; grid-template-columns: 1fr 1fr; }
.sbs-col { padding: 12px 14px; font-size: 0.84rem; line-height: 1.6; color: var(--gray-700); min-width: 0; overflow-wrap: anywhere; }
.sbs-col + .sbs-col { border-left: 1px solid var(--gray-100); }
.sbs-col p { margin: 0 0 8px; }
.sbs-hd { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); margin-bottom: 6px; }
.sbs-hd span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.sbs del, .lg-key del { background: #fde8e8; color: #a31515; text-decoration: line-through; }
.sbs ins, .lg-key ins { background: #e3f6ea; color: #14633a; text-decoration: none; border-bottom: 1px solid #8fd1a8; }
.sbs .na { color: var(--gray-500); font-style: italic; }
@media (max-width: 760px) { .sbs-grid { grid-template-columns: 1fr; } .sbs-col + .sbs-col { border-left: 0; border-top: 1px solid var(--gray-100); } .view-switch { display: flex; } .vs-btn { flex: 1; justify-content: center; padding: 7px 8px; } }
