/* AP Gov Site — Base Styles: shared vars, header, nav, app tabs */

/* AP Gov Site Styles — The O’Farrell High School 2026-27 */


    :root {
      --navy: #1a2e5a;
      --navy-dark: #0f1c38;
      --navy-light: #243f7a;
      --navy-xlight: #e8eef8;
      --crimson: #B22234;
      --crimson-dark: #8b1a27;
      --crimson-light: #fde8e8;
      --gold: #c8922a;
      --gold-light: #fdf3e0;
      --green: #1a5c2a;
      --green-light: #e4f4e8;
      --cream: #f5f0e8;
      --cream-dark: #e8e0d0;
      --white: #ffffff;
      --gray-100: #f8f8f8;
      --gray-200: #eeeeee;
      --gray-300: #dddddd;
      --gray-400: #aaaaaa;
      --gray-600: #666666;
      --gray-700: #444444;
      --text: #1a1a1a;
      --text-muted: #666666;
      --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
      --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
      --shadow-lg: 0 8px 32px rgba(0,0,0,0.13);
      --radius: 10px;
      --radius-sm: 6px;
      --radius-lg: 14px;
}


/* Source and AP-course context for the year-round politics calendar. */
.tdih-meta,
.tdih-source {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
}

.tdih-meta {
  color: var(--gray-600);
  font-family: 'IBM Plex Mono', monospace;
}

.tdih-source {
  width: fit-content;
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

    * { box-sizing: border-box; margin: 0; padding: 0; }
    [hidden] { display: none !important; }

    body {
      font-family: 'Public Sans', sans-serif;
      background: var(--cream);
      color: var(--text);
      min-height: 100vh;
    }

    .skip-link {
      position: fixed; top: 8px; left: 8px; z-index: 20000;
      padding: 10px 14px; border-radius: 6px;
      background: var(--white); color: var(--navy-dark);
      font-weight: 700; text-decoration: none;
      box-shadow: var(--shadow-lg); transform: translateY(-150%);
      transition: transform 0.15s;
    }
    .skip-link:focus { transform: translateY(0); }

    :focus-visible {
      outline: 3px solid #f6c453;
      outline-offset: 3px;
    }

    /* ── STRIPE + HEADER ── */
    .stars-stripe {
      height: 5px;
      background: repeating-linear-gradient(
        90deg,
        var(--crimson) 0px, var(--crimson) 18px,
        var(--white) 18px, var(--white) 36px
      );
    }

    header {
      background: var(--navy-dark);
      border-bottom: 4px solid var(--crimson);
      position: sticky;
      top: 0;
      z-index: 100;
    }

    .header-inner {
      max-width: 1140px;
      margin: 0 auto;
      padding: 0.85rem 1.5rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .header-brand { display: flex; align-items: center; gap: 13px; }

    .header-seal {
      width: 42px; height: 42px;
      background: var(--crimson);
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 20px; color: white; flex-shrink: 0;
      border: 2px solid rgba(255,255,255,0.18);
    }

    .header-text h1 {
      font-family: 'Public Sans', sans-serif;
      font-size: 17px; font-weight: 700;
      color: var(--white);
      text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.1;
    }

    .header-text p {
      font-size: 10px; color: rgba(255,255,255,0.5);
      letter-spacing: 0.1em; text-transform: uppercase; margin-top: 2px;
    }

    .header-right { display: flex; align-items: center; gap: 10px; }

    .header-year {
      background: rgba(255,255,255,0.09);
      color: rgba(255,255,255,0.65);
      font-size: 10px; padding: 4px 12px; border-radius: 99px;
      letter-spacing: 0.07em;
      border: 1px solid rgba(255,255,255,0.13);
    }

    /* ── NAV ── */
    nav {
      background: var(--navy);
      border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    .nav-inner {
      max-width: 1140px; margin: 0 auto;
      padding: 0 1.5rem;
      display: flex; gap: 0;
    }
    .nav-menu-toggle { display: none; }

    /* Top-level nav items */
    .nav-tab {
      font-family: 'Public Sans', sans-serif;
      font-size: 11px; font-weight: 700;
      letter-spacing: 0.1em; text-transform: uppercase;
      color: rgba(255,255,255,0.48);
      padding: 13px 16px; cursor: pointer;
      border-bottom: 3px solid transparent;
      white-space: nowrap;
      transition: color 0.2s, border-color 0.2s;
      user-select: none; position: relative;
      background: transparent; border-top: 0; border-left: 0; border-right: 0;
    }
    .nav-tab:hover { color: rgba(255,255,255,0.82); }
    .nav-tab.active { color: var(--white); border-bottom-color: var(--crimson); }

    /* Dropdown group */
    .nav-group {
      position: relative;
    }
    .nav-group-label {
      font-family: 'Public Sans', sans-serif;
      font-size: 11px; font-weight: 700;
      letter-spacing: 0.1em; text-transform: uppercase;
      color: rgba(255,255,255,0.48);
      padding: 13px 16px; cursor: pointer;
      border-bottom: 3px solid transparent;
      white-space: nowrap;
      transition: color 0.2s, border-color 0.2s;
      user-select: none;
      display: flex; align-items: center; gap: 5px;
      width: 100%; background: transparent; border-top: 0; border-left: 0; border-right: 0;
    }
    .nav-group-label::after {
      content: '▾'; font-size: 9px; opacity: 0.6;
    }
    .nav-group:hover .nav-group-label,
    .nav-group.has-active .nav-group-label {
      color: rgba(255,255,255,0.82);
    }
    .nav-group.has-active .nav-group-label {
      border-bottom: 3px solid var(--crimson);
      color: white;
    }
    .nav-dropdown {
      display: none;
      position: absolute; top: 100%; left: 0;
      background: var(--navy-dark);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 0 0 8px 8px;
      min-width: 180px; z-index: 200;
      box-shadow: 0 8px 24px rgba(0,0,0,0.4);
      padding: 6px 0;
    }
    .nav-group:hover .nav-dropdown,
    .nav-group:focus-within .nav-dropdown,
    .nav-group.open .nav-dropdown { display: block; }
    .nav-dropdown .nav-tab {
      display: block; padding: 9px 16px;
      border-bottom: none;
      font-size: 11px; letter-spacing: 0.08em;
      color: rgba(255,255,255,0.55);
    }
    .nav-dropdown .nav-tab:hover { color: white; background: rgba(255,255,255,0.06); }
    .nav-dropdown .nav-tab.active {
      color: white;
      background: rgba(178,34,52,0.2);
      border-left: 3px solid var(--crimson);
      padding-left: 13px;
    }
    .nav-dropdown .nav-link {
      display: block; padding: 9px 16px;
      font-size: 11px; letter-spacing: 0.08em;
      color: rgba(255,255,255,0.55);
      text-decoration: none;
      font-family: 'Public Sans', sans-serif;
      font-weight: 500;
      cursor: pointer;
      transition: color 0.15s, background 0.15s;
    }
    .nav-dropdown .nav-link:hover { color: white; background: rgba(255,255,255,0.06); }
    .nav-dropdown .nav-link.active {
      color: white;
      background: rgba(178,34,52,0.2);
      border-left: 3px solid var(--crimson);
      padding-left: 13px;
    }
    @media (max-width: 700px) {
      nav { padding: 0 1rem; }
      .nav-menu-toggle {
        width: 100%; min-height: 48px; display: flex; align-items: center;
        justify-content: space-between; gap: 8px; padding: 10px 0;
        color: white; background: transparent; border: 0;
        font: 700 12px 'Public Sans', sans-serif;
        letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
      }
      .nav-menu-toggle i { font-size: 20px; }
      .nav-inner {
        display: none; padding: 0 0 12px; max-height: min(70vh, 560px);
        overflow-y: auto; flex-direction: column;
      }
      nav.menu-open .nav-inner { display: flex; }
      .nav-tab, .nav-group-label {
        width: 100%; min-height: 44px; padding: 11px 12px;
        text-align: left; justify-content: space-between; border-bottom-width: 0;
      }
      .nav-tab.active, .nav-group.has-active > .nav-group-label {
        border-left: 3px solid var(--crimson); background: rgba(255,255,255,0.06);
      }
      .nav-group { width: 100%; }
      .nav-dropdown,
      .nav-group:hover .nav-dropdown,
      .nav-group:focus-within .nav-dropdown {
        display: none; position: static; min-width: 0; border: 0;
        border-radius: 0; box-shadow: none; padding: 2px 0 6px 14px;
        background: rgba(0,0,0,0.16);
      }
      .nav-group.open .nav-dropdown { display: block; }
      .nav-dropdown .nav-link, .nav-dropdown .nav-tab { min-height: 42px; padding: 10px 14px; }
    }

    /* ── MAIN LAYOUT ── */
    main {
      max-width: 1140px;
      margin: 0 auto;
      padding: 1.5rem;
    }

    /* ── CARDS ── */
    .card {
      background: var(--white);
      border-radius: var(--radius);
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--cream-dark);
      overflow: hidden;
    }

    .card-head {
      padding: 0.7rem 1rem;
      border-bottom: 1px solid var(--cream-dark);
      display: flex; align-items: center; gap: 8px;
    }
    .card-head i { font-size: 14px; color: var(--crimson); }
    .card-head h2 {
      font-family: 'Newsreader', sans-serif;
      font-size: 11px; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.12em; color: var(--navy);
    }
    .card-head .card-badge {
      margin-left: auto;
      font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; padding: 2px 8px; border-radius: 99px;
    }
    .badge-crimson { background: var(--crimson-light); color: var(--crimson); }
    .badge-navy { background: var(--navy-xlight); color: var(--navy); }
    .badge-gold { background: var(--gold-light); color: var(--gold); }
    .badge-green { background: var(--green-light); color: var(--green); }

    .card-body { padding: 1rem; }

    /* ── HOME GRID ── */
    #tab-home {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 16px;
    }

    /* ── HERO ── */
    .hero {
      grid-column: 1 / -1;
      background: linear-gradient(120deg, var(--navy-dark) 0%, var(--navy) 100%);
      color: white; border-radius: var(--radius-lg);
      padding: 1.4rem 1.6rem;
      display: flex; align-items: center; justify-content: space-between;
      border: none; box-shadow: var(--shadow-md);
      position: relative; overflow: hidden;
    }
    .hero::before {
      content: '';
      position: absolute; right: 0; top: 0; bottom: 0; width: 5px;
      background: repeating-linear-gradient(180deg, var(--crimson) 0px, var(--crimson) 12px, var(--white) 12px, var(--white) 24px);
    }
    .hero::after {
      content: '';
      position: absolute; right: 40px; top: -30px;
      width: 200px; height: 200px;
      background: radial-gradient(circle, rgba(178,34,52,0.12) 0%, transparent 70%);
      pointer-events: none;
    }
    .hero-eagle-watermark {
      position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
      width: 110px; height: 110px; opacity: 0.10;
      pointer-events: none;
    }
    @media (max-width: 690px) {
      .hero-eagle-watermark { display: none; }
    }
    .hero-unit-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.15em;
      text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 4px;
    }
    .hero h2 {
      font-family: 'Newsreader', sans-serif;
      font-size: 21px; font-weight: 900;
      text-transform: uppercase; letter-spacing: 0.03em;
      color: var(--white); line-height: 1.15;
    }
    .hero-week {
      font-size: 11px; color: rgba(255,255,255,0.48); margin-top: 5px; letter-spacing: 0.06em;
    }
    .hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-right: 14px; }
    .hero-badge {
      background: var(--crimson); color: white;
      font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
      text-transform: uppercase; padding: 5px 14px; border-radius: 99px;
    }
    .hero-date {
      font-size: 11px; color: rgba(255,255,255,0.4); letter-spacing: 0.04em;
    }

    /* ── TODAY COLUMN (vocab + links) ── */
    .today-col { display: flex; flex-direction: column; gap: 16px; }

    /* ── VOCAB OF THE DAY ── */
    .vocab-term {
      font-family: 'Newsreader', sans-serif;
      font-size: 18px; font-weight: 700; color: var(--navy);
      margin-bottom: 6px; line-height: 1.2;
    }
    .vocab-def {
      font-size: 13px; line-height: 1.6; color: var(--gray-700);
    }
    .vocab-nav {
      display: flex; align-items: center; justify-content: space-between;
      margin-top: 12px; padding-top: 10px;
      border-top: 1px solid var(--gray-200);
    }
    .vocab-nav button {
      background: none; border: 1px solid var(--gray-200);
      border-radius: var(--radius-sm); padding: 4px 10px;
      font-size: 11px; font-weight: 600; color: var(--navy);
      cursor: pointer; letter-spacing: 0.04em;
      transition: background 0.15s;
    }
    .vocab-nav button:hover { background: var(--navy-xlight); }
    .vocab-counter { font-size: 10px; color: var(--gray-400); letter-spacing: 0.06em; }

    /* ── KEY LINKS ── */
    .key-links-row {
      display: flex; gap: 8px;
    }
    .key-link {
      flex: 1;
      display: flex; flex-direction: column; align-items: center; gap: 6px;
      padding: 14px 10px;
      background: var(--gray-100); border-radius: var(--radius-sm);
      text-decoration: none; color: var(--text);
      border: 1px solid var(--gray-200);
      font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
      text-align: center;
      transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    }
    .key-link i { font-size: 22px; color: var(--navy); }
    .key-link:hover { background: var(--navy); color: white; box-shadow: var(--shadow-sm); }
    .key-link:hover i { color: white; }

    /* ── THIS DAY IN HISTORY ── */
    .tdih-card { grid-column: 1 / -1; }
    .tdih-body { display: flex; align-items: flex-start; gap: 14px; }
    .tdih-icon {
      width: 42px; height: 42px; background: var(--crimson);
      border-radius: 50%; display: flex; align-items: center; justify-content: center;
      color: white; font-size: 18px; flex-shrink: 0; margin-top: 2px;
    }
    .tdih-year {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 11px; font-weight: 500;
      text-transform: uppercase; letter-spacing: 0.1em; color: var(--crimson); margin-bottom: 4px;
    }
    .tdih-text { font-size: 14px; line-height: 1.65; color: var(--text); }
    .tdih-source { font-size: 11px; color: var(--gray-400); margin-top: 5px; }
    .tdih-actions { display: flex; gap: 8px; margin-top: 10px; }
    .tdih-btn {
      background: none; border: 1px solid var(--gray-200);
      border-radius: var(--radius-sm); padding: 4px 12px;
      font-size: 11px; font-weight: 600; color: var(--navy);
      cursor: pointer; letter-spacing: 0.04em;
      transition: background 0.15s;
    }
    .tdih-btn:hover { background: var(--navy-xlight); }
    .tdih-btn.crimson { border-color: var(--crimson); color: var(--crimson); }
    .tdih-btn.crimson:hover { background: var(--crimson-light); }

    /* ── GOV NEWS ── */
    .news-card { grid-column: span 2; }
    .news-item {
      display: flex; gap: 12px; padding: 10px 0;
      border-bottom: 1px solid var(--gray-200); text-decoration: none; color: inherit;
    }
    .news-item:last-child { border-bottom: none; padding-bottom: 0; }
    .news-tag {
      font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; padding: 2px 7px; border-radius: 4px;
      background: var(--navy-xlight); color: var(--navy);
      white-space: nowrap; align-self: flex-start; margin-top: 2px; flex-shrink: 0;
    }
    .news-content { flex: 1; }
    .news-headline {
      font-size: 13px; font-weight: 600; color: var(--text);
      line-height: 1.4; margin-bottom: 2px;
      transition: color 0.15s;
    }
    .news-item:hover .news-headline { color: var(--crimson); }
    .news-meta { font-size: 11px; color: var(--gray-400); }
    .news-empty {
      font-size: 13px; color: var(--text-muted); font-style: italic;
      padding: 8px 0;
    }

    /* ── MATERIALS ── */
    .material-row {
      display: flex; align-items: center; gap: 10px;
      padding: 8px 0; border-bottom: 1px solid var(--gray-200);
      text-decoration: none; color: inherit;
      transition: background 0.15s;
    }
    .material-row:last-child { border-bottom: none; }
    .material-row:hover .material-title { color: var(--crimson); }
    .material-icon {
      width: 30px; height: 30px; border-radius: var(--radius-sm);
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; font-size: 13px;
    }
    .material-icon.slides { background: #fff3cd; color: #856404; }
    .material-icon.doc { background: #d4edff; color: #0a5a99; }
    .material-icon.video { background: #fde8e8; color: #8b1a1a; }
    .material-icon.link { background: #e8f5e9; color: #1a5c2a; }
    .material-title { font-size: 13px; font-weight: 500; flex: 1; transition: color 0.15s; }
    .material-date { font-size: 10px; color: var(--gray-400); flex-shrink: 0; }

    /* ── UPCOMING ── */
    .upcoming-row-right {
      display: flex; align-items: center; gap: 8px; margin-left: auto;
    }
    .upcoming-cal-btn {
      display: flex; align-items: center; justify-content: center;
      width: 26px; height: 26px; border-radius: 6px;
      background: var(--navy-xlight); color: var(--navy);
      text-decoration: none; transition: background 0.15s, color 0.15s;
      font-size: 13px; flex-shrink: 0;
    }
    .upcoming-cal-btn:hover { background: var(--navy); color: white; }
    .upcoming-row {
      display: flex; align-items: center; justify-content: space-between;
      padding: 8px 0; border-bottom: 1px solid var(--gray-200); font-size: 13px;
    }
    .upcoming-row:last-child { border-bottom: none; }
    .upcoming-title { font-weight: 500; }
    .upcoming-date {
      font-size: 10px; font-weight: 700;
      background: var(--cream); color: var(--navy);
      padding: 2px 9px; border-radius: 99px;
      border: 1px solid var(--cream-dark); white-space: nowrap;
    }
    .upcoming-row.soon .upcoming-date { background: var(--crimson-light); color: var(--crimson); border-color: var(--crimson); }

    /* ── EXIT TICKET (home preview) ── */
    .exit-mini { grid-column: span 2; }
    .exit-question {
      background: var(--cream);
      border-left: 4px solid var(--crimson);
      border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
      padding: 10px 14px; font-size: 14px; font-weight: 500;
      line-height: 1.55; color: var(--navy); margin-bottom: 12px;
    }
    .exit-selects {
      display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px;
    }
    select, textarea {
      width: 100%; padding: 9px 12px;
      border: 1px solid var(--cream-dark); border-radius: var(--radius-sm);
      font-family: 'Public Sans', sans-serif; font-size: 13px;
      color: var(--text); background: var(--white);
      appearance: none; -webkit-appearance: none;
      outline: none; transition: border-color 0.2s;
    }
    select:focus, textarea:focus { border-color: var(--navy); }
    textarea { resize: vertical; min-height: 85px; margin-bottom: 10px; }
    .submit-btn {
      width: 100%; padding: 11px;
      background: var(--crimson); color: white; border: none;
      border-radius: var(--radius-sm);
      font-family: 'Public Sans', sans-serif;
      font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; cursor: pointer;
      display: flex; align-items: center; justify-content: center; gap: 7px;
      transition: background 0.2s, transform 0.1s;
    }
    .submit-btn:hover { background: var(--crimson-dark); }
    .submit-btn:active { transform: scale(0.99); }
    .submit-btn:disabled { background: var(--gray-400); cursor: not-allowed; }
    .submit-success {
      text-align: center; padding: 1rem;
      color: var(--green); font-size: 14px; font-weight: 500;
    }
    .submit-success i { font-size: 28px; display: block; margin-bottom: 6px; }

    /* ══════════════════════════════════
       UNITS TAB
    ══════════════════════════════════ */
    #tab-units { display: none; }
    #tab-units.active { display: block; }

    .units-grid {
      display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    }

    .unit-card {
      background: var(--white); border-radius: var(--radius-lg);
      border: 1px solid var(--cream-dark); box-shadow: var(--shadow-sm);
      overflow: hidden; position: relative;
    }
    .unit-card.current-unit {
      border-color: var(--crimson); box-shadow: 0 0 0 2px rgba(178,34,52,0.15), var(--shadow-md);
    }
    .unit-header {
      background: var(--navy); padding: 1rem 1.1rem;
      display: flex; align-items: flex-start; gap: 12px;
    }
    .unit-num {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 28px; font-weight: 500; color: rgba(255,255,255,0.2);
      line-height: 1; flex-shrink: 0; margin-top: 2px;
    }
    .unit-header-text { flex: 1; }
    .unit-title {
      font-family: 'Newsreader', sans-serif;
      font-size: 15px; font-weight: 700; color: var(--white); line-height: 1.2;
      margin-bottom: 4px;
    }
    .unit-weight {
      font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--gold); background: rgba(200,146,42,0.15);
      padding: 2px 8px; border-radius: 4px; display: inline-block;
    }
    .unit-body { padding: 0.9rem 1.1rem; }
    .unit-section-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--gray-400); margin-bottom: 6px; margin-top: 10px;
    }
    .unit-section-label:first-child { margin-top: 0; }
    .unit-topics { list-style: none; }
    .unit-topics li {
      font-size: 12px; color: var(--gray-700); padding: 3px 0;
      border-bottom: 1px solid var(--gray-100);
      display: flex; align-items: center; gap: 7px;
    }
    .unit-topics li:last-child { border-bottom: none; }
    .unit-topics li::before {
      content: ''; width: 4px; height: 4px; border-radius: 50%;
      background: var(--crimson); flex-shrink: 0;
    }
    .unit-cases { display: flex; flex-wrap: wrap; gap: 5px; }
    .case-chip {
      font-size: 10px; font-weight: 600;
      background: var(--crimson-light); color: var(--crimson);
      padding: 2px 8px; border-radius: 4px; cursor: default;
    }
    .unit-docs { display: flex; flex-wrap: wrap; gap: 5px; }
    .doc-chip {
      font-size: 10px; font-weight: 600;
      background: var(--navy-xlight); color: var(--navy);
      padding: 2px 8px; border-radius: 4px; cursor: default;
    }
    .current-badge {
      position: absolute; top: 10px; right: 10px;
      font-size: 8px; font-weight: 700; letter-spacing: 0.12em;
      text-transform: uppercase; background: var(--crimson);
      color: white; padding: 3px 8px; border-radius: 99px;
    }

    /* ══════════════════════════════════
       REVIEW TAB
    ══════════════════════════════════ */
    #tab-review { display: none; }
    #tab-review.active { display: block; }

    .review-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

    .frq-type-card {
      background: var(--white); border-radius: var(--radius);
      border: 1px solid var(--cream-dark); box-shadow: var(--shadow-sm);
      overflow: hidden; margin-bottom: 0;
    }
    .frq-header {
      background: var(--navy-dark);
      padding: 0.75rem 1rem;
      display: flex; align-items: center; justify-content: space-between;
    }
    .frq-header h3 {
      font-family: 'Newsreader', sans-serif;
      font-size: 14px; font-weight: 700; color: var(--white);
    }
    .frq-pts {
      font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; background: var(--gold);
      color: var(--white); padding: 3px 9px; border-radius: 99px;
    }
    .frq-tips { padding: 0.85rem 1rem; }
    .frq-tip {
      display: flex; align-items: flex-start; gap: 9px;
      padding: 5px 0; border-bottom: 1px solid var(--gray-100);
      font-size: 12px; line-height: 1.5; color: var(--gray-700);
    }
    .frq-tip:last-child { border-bottom: none; }
    .frq-tip-num {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 10px; font-weight: 500; color: var(--crimson);
      flex-shrink: 0; margin-top: 2px; min-width: 16px;
    }

    .required-docs-card {
      background: var(--white); border-radius: var(--radius);
      border: 1px solid var(--cream-dark); box-shadow: var(--shadow-sm);
    }
    .required-docs-grid {
      display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 1rem;
    }
    .doc-item {
      background: var(--navy-xlight); border-radius: var(--radius-sm);
      padding: 8px 10px;
    }
    .doc-item-name {
      font-size: 12px; font-weight: 600; color: var(--navy); line-height: 1.3; margin-bottom: 2px;
    }
    .doc-item-type { font-size: 10px; color: var(--gray-400); }

    .review-cases-card {
      grid-column: 1 / -1;
      background: var(--white); border-radius: var(--radius);
      border: 1px solid var(--cream-dark); box-shadow: var(--shadow-sm);
    }
    .cases-filter-row {
      padding: 0.75rem 1rem; border-bottom: 1px solid var(--gray-200);
      display: flex; gap: 6px; flex-wrap: wrap;
    }
    .filter-btn {
      font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
      text-transform: uppercase; padding: 4px 12px; border-radius: 99px;
      border: 1px solid var(--gray-200); background: var(--gray-100);
      color: var(--gray-600); cursor: pointer; transition: all 0.15s;
    }
    .filter-btn:hover { background: var(--cream-dark); }
    .filter-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
    .cases-grid {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
      padding: 0 0.5rem;
    }
    .case-item {
      padding: 10px 0.75rem; border-bottom: 1px solid var(--gray-100);
      cursor: pointer; transition: background 0.15s; border-radius: var(--radius-sm);
    }
    .case-item:hover { background: var(--gray-100); }
    .case-name { font-size: 12px; font-weight: 600; color: var(--navy); margin-bottom: 2px; }
    .case-year { font-size: 10px; color: var(--gray-400); }
    .case-unit-tag {
      font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
      text-transform: uppercase; padding: 1px 6px; border-radius: 3px;
      background: var(--crimson-light); color: var(--crimson);
      display: inline-block; margin-top: 3px;
    }

    /* Case detail modal */
    .case-modal {
      position: fixed; inset: 0; background: rgba(0,0,0,0.45);
      display: flex; align-items: center; justify-content: center;
      z-index: 1000; padding: 1rem; opacity: 0; pointer-events: none;
      transition: opacity 0.2s;
    }
    .case-modal.open { opacity: 1; pointer-events: all; }
    .case-modal-inner {
      background: var(--white); border-radius: var(--radius-lg);
      max-width: 560px; width: 100%; box-shadow: var(--shadow-lg);
      overflow: hidden; transform: translateY(10px);
      transition: transform 0.2s;
    }
    .case-modal.open .case-modal-inner { transform: translateY(0); }
    .case-modal-header {
      background: var(--navy-dark); padding: 1rem 1.2rem;
      display: flex; align-items: flex-start; justify-content: space-between;
    }
    .case-modal-header h3 {
      font-family: 'Newsreader', sans-serif;
      font-size: 18px; font-weight: 700; color: white; line-height: 1.2;
    }
    .case-modal-close {
      background: none; border: none; color: rgba(255,255,255,0.5);
      font-size: 20px; cursor: pointer; padding: 0 4px; line-height: 1;
    }
    .case-modal-body { padding: 1.2rem; }
    .case-detail-row {
      display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px;
    }
    .case-detail-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
      text-transform: uppercase; color: var(--gray-400);
      min-width: 80px; padding-top: 1px; flex-shrink: 0;
    }
    .case-detail-value { font-size: 13px; color: var(--text); line-height: 1.5; }
    .case-detail-value strong { color: var(--navy); }

    /* ══════════════════════════════════
       EXIT TICKET TAB (full page)
    ══════════════════════════════════ */
    #tab-exit { display: none; }
    #tab-exit.active { display: block; }
    .exit-page { max-width: 680px; margin: 0 auto; }
    .exit-page .exit-question { font-size: 16px; margin-bottom: 16px; padding: 14px 18px; }
    .exit-page .exit-selects { grid-template-columns: 1fr 1fr; }
    .exit-page textarea { min-height: 140px; font-size: 14px; }

    /* ══════════════════════════════════
       RESPONSIVE
    ══════════════════════════════════ */
    @media (max-width: 760px) {
      .header-inner { padding: 0.7rem 1rem; }
      .header-text h1 { font-size: 14px; }
      .header-text p { display: none; }
      .header-year { display: none; }
      main { padding: 1rem; }
      #tab-home { grid-template-columns: 1fr; }
      .hero { flex-direction: column; align-items: flex-start; gap: 10px; }
      .hero-right { align-items: flex-start; }
      .exit-mini { grid-column: 1; }
      .news-card { grid-column: 1; }
      .today-col { grid-column: 1; }
      .tdih-card { grid-column: 1; }
      .units-grid { grid-template-columns: 1fr; }
      .review-layout { grid-template-columns: 1fr; }
      .cases-grid { grid-template-columns: 1fr 1fr; }
      .review-cases-card { grid-column: 1; }
      .required-docs-grid { grid-template-columns: 1fr; }
    }

    @media (max-width: 480px) {
      .cases-grid { grid-template-columns: 1fr; }
      .exit-selects { grid-template-columns: 1fr !important; }
      .tdih-actions { align-items: stretch; }
      .tdih-actions .crimson { width: 100%; margin-left: 0 !important; }
    }

    /* ── UTILITY ── */
    .hidden { display: none !important; }
    .section-title {
      font-family: 'Public Sans', sans-serif;
      font-size: 13px; font-weight: 800; color: var(--navy);
      letter-spacing: 0.12em; text-transform: uppercase;
      margin-bottom: 14px; padding-bottom: 10px;
      border-bottom: 2px solid var(--cream-dark);
      display: flex; align-items: center; gap: 10px;
    }
    .section-title i { color: var(--crimson); font-size: 18px; }
    .section-subtitle { font-size: 12px; color: var(--text-muted); font-weight: 400; font-family: 'Public Sans', sans-serif; }

    footer {
      max-width: 1140px; margin: 0.5rem auto 2.5rem;
      padding: 0 1.5rem; text-align: center;
      font-size: 10px; color: var(--gray-400); letter-spacing: 0.06em;
    }

    /* ── LOADING STATE ── */
    .skeleton {
      background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
      background-size: 200% 100%;
      animation: shimmer 1.4s infinite;
      border-radius: 4px; height: 14px;
    }
    @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

    @media (prefers-reduced-motion: reduce) {
      * { animation: none !important; transition: none !important; }
      html { scroll-behavior: auto !important; }
    }

    /* ══════════════════════════════════
       GLOSSARY TAB
    ══════════════════════════════════ */
    #tab-glossary { display: none; }
    #tab-glossary.active { display: block; }

    .glossary-layout {
      display: grid;
      grid-template-columns: 240px 1fr;
      gap: 20px;
      align-items: start;
    }

    /* Sidebar */
    .glossary-sidebar {
      position: sticky;
      top: 80px;
    }
    .glossary-search-wrap {
      position: relative;
      margin-bottom: 12px;
    }
    .glossary-search-wrap i {
      position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
      color: var(--gray-400); font-size: 14px; pointer-events: none;
    }
    #glossary-search {
      width: 100%; padding: 9px 12px 9px 32px;
      border: 1px solid var(--cream-dark); border-radius: var(--radius-sm);
      font-family: 'Public Sans', sans-serif; font-size: 13px;
      color: var(--text); background: var(--white);
      outline: none; transition: border-color 0.2s;
    }
    #glossary-search:focus { border-color: var(--navy); }

    .glossary-unit-pills {
      display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px;
    }
    .glossary-unit-pill {
      display: flex; align-items: center; gap: 8px;
      padding: 7px 10px; border-radius: var(--radius-sm);
      border: 1px solid transparent; cursor: pointer;
      transition: background 0.15s, border-color 0.15s;
      text-decoration: none; color: var(--text);
    }
    .glossary-unit-pill:hover { background: var(--cream); }
    .glossary-unit-pill.active {
      background: var(--navy); color: white; border-color: var(--navy);
    }
    .glossary-unit-pill.active .gpu-count { background: rgba(255,255,255,0.2); color: white; }
    .gpu-label { font-size: 12px; font-weight: 600; flex: 1; line-height: 1.3; }
    .gpu-count {
      font-size: 10px; font-weight: 700;
      background: var(--cream-dark); color: var(--gray-600);
      padding: 2px 7px; border-radius: 99px; flex-shrink: 0;
    }

    .glossary-stats {
      font-size: 10px; color: var(--gray-400); letter-spacing: 0.06em;
      text-align: center; padding-top: 8px;
      border-top: 1px solid var(--gray-200);
    }

    /* Main panel */
    .glossary-main {}

    .glossary-search-results {
      background: var(--white); border-radius: var(--radius);
      border: 1px solid var(--cream-dark); box-shadow: var(--shadow-sm);
      margin-bottom: 20px; display: none;
    }
    .glossary-search-results.visible { display: block; }
    .search-result-head {
      padding: 0.6rem 1rem; border-bottom: 1px solid var(--gray-200);
      display: flex; align-items: center; gap: 8px;
    }
    .search-result-head i { color: var(--crimson); font-size: 13px; }
    .search-result-head span {
      font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--navy);
    }
    .search-result-list { padding: 0.5rem 0; max-height: 400px; overflow-y: auto; }
    .search-result-item {
      display: block; padding: 6px 1rem; cursor: pointer;
      transition: background 0.12s;
    }
    .search-result-item:hover { background: var(--gray-100); }
    .sri-term { font-size: 13px; font-weight: 600; color: var(--navy); }
    .sri-unit { font-size: 10px; color: var(--gray-400); }
    mark { background: #fff3cd; padding: 0 2px; border-radius: 2px; font-style: normal; }

    .glossary-unit-section { margin-bottom: 28px; }

    .glossary-unit-header {
      background: var(--navy-dark); border-radius: var(--radius);
      padding: 0.85rem 1.1rem; margin-bottom: 12px;
      display: flex; align-items: center; justify-content: space-between;
    }
    .guh-left {}
    .guh-num {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.3);
      letter-spacing: 0.1em; margin-bottom: 2px;
    }
    .guh-title {
      font-family: 'Newsreader', sans-serif;
      font-size: 16px; font-weight: 700; color: var(--white);
    }
    .guh-right { display: flex; align-items: center; gap: 8px; }
    .guh-count {
      font-size: 11px; font-weight: 700;
      background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.7);
      padding: 3px 10px; border-radius: 99px;
    }
    .guh-weight {
      font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; background: var(--gold);
      color: white; padding: 3px 9px; border-radius: 99px;
    }

    .glossary-group { margin-bottom: 16px; }
    .glossary-group-label {
      font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--crimson);
      padding: 4px 0 8px;
      border-bottom: 1px solid var(--cream-dark);
      margin-bottom: 0;
      display: flex; align-items: center; gap: 8px;
    }
    .glossary-group-label::before {
      content: '';
      display: inline-block; width: 3px; height: 12px;
      background: var(--crimson); border-radius: 2px; flex-shrink: 0;
    }

    .glossary-terms-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 6px;
      padding-top: 8px;
    }

    .gloss-term {
      background: var(--white); border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark);
      cursor: pointer; overflow: hidden;
      transition: box-shadow 0.15s, border-color 0.15s;
    }
    .gloss-term:hover { border-color: var(--navy-xlight); box-shadow: var(--shadow-sm); }
    .gloss-term.open { border-color: var(--navy); box-shadow: var(--shadow-sm); }
    .gloss-term-head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 8px 10px; gap: 8px;
    }
    .gloss-term-name {
      font-size: 12px; font-weight: 600; color: var(--navy);
      line-height: 1.3;
    }
    .gloss-term-standard {
      font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
      background: var(--navy-xlight); color: var(--navy);
      padding: 1px 6px; border-radius: 3px; flex-shrink: 0;
      font-family: 'IBM Plex Mono', monospace;
    }
    .gloss-term-toggle {
      font-size: 10px; color: var(--gray-400); flex-shrink: 0;
      transition: transform 0.2s;
    }
    .gloss-term.open .gloss-term-toggle { transform: rotate(180deg); }
    .gloss-term-body {
      display: none;
      padding: 0 10px 10px;
      font-size: 12px; line-height: 1.6; color: var(--gray-700);
      border-top: 1px solid var(--cream-dark);
      padding-top: 8px;
    }
    .gloss-term.open .gloss-term-body { display: block; }
    .gloss-term-links {
      display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap;
    }
    .gloss-link {
      font-size: 10px; font-weight: 600; padding: 2px 8px;
      border-radius: 4px; text-decoration: none;
      cursor: pointer;
      transition: background 0.15s;
    }
    .gloss-link.case-link {
      background: var(--crimson-light); color: var(--crimson);
    }
    .gloss-link.case-link:hover { background: #fbd0d5; }
    .gloss-link.copy-link {
      background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200);
    }
    .gloss-link.copy-link:hover { background: var(--cream-dark); }

    /* ── TERM TOOLTIP (hovers anywhere on site) ── */
    #term-tooltip {
      position: fixed;
      z-index: 9999;
      background: var(--navy-dark);
      color: var(--white);
      border-radius: var(--radius-sm);
      padding: 10px 14px;
      max-width: 320px;
      box-shadow: var(--shadow-lg);
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.15s;
      font-size: 12px;
      line-height: 1.5;
    }
    #term-tooltip.visible { opacity: 1; }
    .tt-term {
      font-family: 'Newsreader', sans-serif;
      font-size: 13px; font-weight: 700;
      color: #fff; margin-bottom: 4px;
    }
    .tt-standard {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 9px; color: var(--gold);
      margin-bottom: 5px; display: block;
    }
    .tt-def { color: rgba(255,255,255,0.8); }

    /* Term hotlinks — underlined term spans you can hover */
    .term-link {
      border-bottom: 1px dotted var(--navy);
      cursor: help;
      color: inherit;
    }

    /* ── GLOSSARY RESPONSIVE ── */
    @media (max-width: 820px) {
      .glossary-layout { grid-template-columns: 1fr; }
      .glossary-sidebar { position: static; }
      .glossary-unit-pills { flex-direction: row; flex-wrap: wrap; }
      .glossary-unit-pill { flex: 1; min-width: 120px; }
      .glossary-terms-grid { grid-template-columns: 1fr; }
    }

    /* ══ FLASHCARD MODE ══ */
    .fc-toolbar {
      display: flex; align-items: center; gap: 10px;
      margin-bottom: 16px; flex-wrap: wrap;
    }
    .fc-mode-btn {
      display: flex; align-items: center; gap: 6px;
      padding: 8px 16px; border-radius: var(--radius-sm);
      border: 1px solid var(--navy); background: transparent;
      color: var(--navy); font-size: 12px; font-weight: 700;
      letter-spacing: 0.06em; cursor: pointer;
      transition: background 0.15s, color 0.15s;
    }
    .fc-mode-btn.active { background: var(--navy); color: white; }
    .fc-mode-btn:hover:not(.active) { background: var(--navy-xlight); }
    .fc-unit-select {
      padding: 7px 10px; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark); font-size: 12px;
      font-family: inherit; color: var(--navy); background: white;
      cursor: pointer;
    }
    .fc-progress {
      margin-left: auto; font-size: 11px; color: var(--gray-400);
      font-family: 'IBM Plex Mono', monospace;
    }
    #flashcard-area { display: none; }
    #flashcard-area.visible { display: block; }
    .fc-stats-bar {
      display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
    }
    .fc-stat {
      display: flex; align-items: center; gap: 6px;
      font-size: 12px; font-weight: 600;
    }
    .fc-stat-dot {
      width: 10px; height: 10px; border-radius: 50%;
    }
    .fc-stat-dot.got { background: #22c55e; }
    .fc-stat-dot.learning { background: var(--crimson); }
    .fc-stat-dot.unseen { background: var(--gray-300); }
    .fc-card-wrap {
      perspective: 1000px; width: 100%; max-width: 680px;
      margin: 0 auto 20px; height: 260px; cursor: pointer;
    }
    .fc-card-inner {
      position: relative; width: 100%; height: 100%;
      transform-style: preserve-3d;
      transition: transform 0.45s cubic-bezier(.4,0,.2,1);
    }
    .fc-card-wrap.flipped .fc-card-inner { transform: rotateY(180deg); }
    .fc-front, .fc-back {
      position: absolute; width: 100%; height: 100%;
      backface-visibility: hidden; border-radius: var(--radius);
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      padding: 28px 32px; text-align: center;
      box-shadow: var(--shadow);
    }
    .fc-front {
      background: var(--navy-dark);
      border: 2px solid rgba(255,255,255,0.08);
    }
    .fc-back {
      background: var(--white);
      border: 2px solid var(--navy);
      transform: rotateY(180deg);
    }
    .fc-front-unit {
      font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--gold);
      margin-bottom: 12px;
    }
    .fc-front-term {
      font-family: 'Newsreader', sans-serif;
      font-size: 26px; font-weight: 700; color: white;
      line-height: 1.2; margin-bottom: 10px;
    }
    .fc-front-standard {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 10px; color: rgba(255,255,255,0.35);
    }
    .fc-front-hint {
      position: absolute; bottom: 14px;
      font-size: 10px; color: rgba(255,255,255,0.3);
      letter-spacing: 0.08em;
    }
    .fc-back-group {
      font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
      text-transform: uppercase; color: var(--crimson);
      margin-bottom: 10px;
    }
    .fc-back-def {
      font-size: 14px; line-height: 1.65; color: var(--gray-700);
    }
    .fc-nav {
      display: flex; align-items: center; justify-content: center;
      gap: 10px; margin-bottom: 12px;
    }
    .fc-nav-btn {
      padding: 8px 20px; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark); background: white;
      font-size: 12px; font-weight: 600; cursor: pointer;
      transition: background 0.15s, border-color 0.15s;
    }
    .fc-nav-btn:hover { background: var(--cream); }
    .fc-nav-btn:disabled { opacity: 0.35; cursor: default; }
    .fc-nav-counter {
      font-size: 12px; color: var(--gray-400);
      font-family: 'IBM Plex Mono', monospace; min-width: 60px; text-align: center;
    }
    .fc-response-btns {
      display: flex; gap: 10px; justify-content: center; margin-top: 4px;
    }
    .fc-resp-btn {
      padding: 9px 24px; border-radius: var(--radius-sm);
      border: none; font-size: 12px; font-weight: 700;
      cursor: pointer; transition: transform 0.1s, opacity 0.15s;
      letter-spacing: 0.04em;
    }
    .fc-resp-btn:active { transform: scale(0.96); }
    .fc-resp-btn.got-it {
      background: #22c55e; color: white;
    }
    .fc-resp-btn.still-learning {
      background: var(--crimson); color: white;
    }
    .fc-complete {
      text-align: center; padding: 40px 20px; display: none;
    }
    .fc-complete.visible { display: block; }
    .fc-complete-icon { font-size: 48px; margin-bottom: 12px; }
    .fc-complete-title {
      font-family: 'Newsreader', sans-serif;
      font-size: 22px; font-weight: 700; color: var(--navy);
      margin-bottom: 8px;
    }
    .fc-complete-sub { font-size: 13px; color: var(--gray-500); margin-bottom: 20px; }
    .fc-restart-btn {
      padding: 10px 24px; border-radius: var(--radius-sm);
      background: var(--navy); color: white; border: none;
      font-size: 13px; font-weight: 700; cursor: pointer;
    }

    /* ══ SCOTUS QUIZ ══ */
    #scotus-quiz-section {
      margin-top: 24px;
    }
    .quiz-launch-card {
      background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
      border-radius: var(--radius); padding: 24px 28px;
      display: flex; align-items: center; justify-content: space-between;
      gap: 16px; flex-wrap: wrap;
    }
    .quiz-launch-left {}
    .quiz-launch-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
    }
    .quiz-launch-title {
      font-family: 'Newsreader', sans-serif;
      font-size: 18px; font-weight: 700; color: white; margin-bottom: 4px;
    }
    .quiz-launch-sub { font-size: 12px; color: rgba(255,255,255,0.5); }
    .quiz-launch-btn {
      padding: 11px 24px; border-radius: var(--radius-sm);
      background: var(--crimson); color: white; border: none;
      font-size: 13px; font-weight: 700; cursor: pointer;
      white-space: nowrap; transition: opacity 0.15s;
      display: flex; align-items: center; gap: 6px;
    }
    .quiz-launch-btn:hover { opacity: 0.88; }
    #quiz-modal {
      position: fixed; inset: 0; z-index: 1000;
      background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
      display: none; align-items: center; justify-content: center;
      padding: 16px;
    }
    #quiz-modal.open { display: flex; }
    .quiz-modal-inner {
      background: white; border-radius: var(--radius);
      max-width: 560px; width: 100%; padding: 28px;
      box-shadow: var(--shadow-lg); position: relative;
    }
    .quiz-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 20px;
    }
    .quiz-header-left {}
    .quiz-q-counter {
      font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--gray-400); margin-bottom: 4px;
    }
    .quiz-case-name {
      font-family: 'Newsreader', sans-serif;
      font-size: 18px; font-weight: 700; color: var(--navy);
    }
    .quiz-unit-badge {
      font-size: 10px; font-weight: 700;
      background: var(--navy-xlight); color: var(--navy);
      padding: 3px 10px; border-radius: 99px;
    }
    .quiz-close {
      position: absolute; top: 16px; right: 16px;
      background: none; border: none; font-size: 20px;
      cursor: pointer; color: var(--gray-400); line-height: 1;
    }
    .quiz-question {
      font-size: 13px; font-weight: 600; color: var(--gray-700);
      margin-bottom: 6px; letter-spacing: 0.02em;
    }
    .quiz-prompt {
      font-size: 14px; color: var(--text);
      margin-bottom: 18px; line-height: 1.5;
      padding: 12px; background: var(--gray-100);
      border-radius: var(--radius-sm); border-left: 3px solid var(--navy);
    }
    .quiz-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
    .quiz-option {
      padding: 11px 14px; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark); background: white;
      text-align: left; font-size: 13px; cursor: pointer;
      transition: background 0.12s, border-color 0.12s;
      line-height: 1.4;
    }
    .quiz-option:hover:not(:disabled) { background: var(--cream); border-color: var(--navy-xlight); }
    .quiz-option.correct { background: #dcfce7; border-color: #22c55e; color: #166534; font-weight: 600; }
    .quiz-option.wrong { background: #fee2e2; border-color: var(--crimson); color: #991b1b; }
    .quiz-option:disabled { cursor: default; }
    .quiz-feedback {
      font-size: 12px; line-height: 1.6; padding: 10px 12px;
      border-radius: var(--radius-sm); margin-bottom: 16px;
      display: none;
    }
    .quiz-feedback.show { display: block; }
    .quiz-feedback.correct { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
    .quiz-feedback.wrong { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
    .quiz-next-btn {
      width: 100%; padding: 11px; border-radius: var(--radius-sm);
      background: var(--navy); color: white; border: none;
      font-size: 13px; font-weight: 700; cursor: pointer;
      display: none; transition: opacity 0.15s;
    }
    .quiz-next-btn.show { display: block; }
    .quiz-next-btn:hover { opacity: 0.88; }
    .quiz-progress-bar {
      height: 4px; background: var(--gray-200); border-radius: 2px;
      margin-bottom: 20px; overflow: hidden;
    }
    .quiz-progress-fill {
      height: 100%; background: var(--crimson);
      border-radius: 2px; transition: width 0.3s;
    }
    .quiz-score-screen { text-align: center; padding: 20px 0; display: none; }
    .quiz-score-screen.show { display: block; }
    .quiz-score-num {
      font-family: 'Newsreader', sans-serif;
      font-size: 52px; font-weight: 700; color: var(--navy); line-height: 1;
    }
    .quiz-score-label { font-size: 14px; color: var(--gray-500); margin: 6px 0 20px; }
    .quiz-retry-btn {
      padding: 10px 28px; border-radius: var(--radius-sm);
      background: var(--navy); color: white; border: none;
      font-size: 13px; font-weight: 700; cursor: pointer; margin: 0 6px;
    }

    /* ══ FRQ TIMER ══ */
    #frq-timer-section { margin-top: 24px; }
    .frq-timer-card {
      background: white; border-radius: var(--radius);
      border: 1px solid var(--cream-dark);
      box-shadow: var(--shadow-sm);
    }
    .frq-timer-head {
      padding: 14px 18px; border-bottom: 1px solid var(--cream-dark);
      display: flex; align-items: center; gap: 10px;
    }
    .frq-timer-head i { color: var(--crimson); font-size: 18px; }
    .frq-timer-head h3 {
      font-size: 14px; font-weight: 700; color: var(--navy); margin: 0; flex: 1;
    }
    .frq-type-btns {
      display: flex; gap: 6px; padding: 14px 18px;
      flex-wrap: wrap; border-bottom: 1px solid var(--cream-dark);
    }
    .frq-type-pick-btn {
      padding: 6px 14px; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark); background: white;
      font-size: 11px; font-weight: 600; cursor: pointer;
      color: var(--navy); transition: background 0.12s, border-color 0.12s;
    }
    .frq-type-pick-btn.active {
      background: var(--navy); color: white; border-color: var(--navy);
    }
    .frq-timer-body { padding: 18px; }
    .frq-timer-display {
      display: flex; align-items: center; justify-content: center;
      gap: 20px; margin-bottom: 18px;
    }
    .frq-clock {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 44px; font-weight: 700; color: var(--navy);
      letter-spacing: 0.04em; min-width: 120px; text-align: center;
    }
    .frq-clock.warning { color: var(--crimson); }
    .frq-timer-controls { display: flex; gap: 8px; }
    .frq-ctrl-btn {
      padding: 8px 18px; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark); background: white;
      font-size: 12px; font-weight: 700; cursor: pointer;
      transition: background 0.12s;
    }
    .frq-ctrl-btn.start { background: var(--navy); color: white; border-color: var(--navy); }
    .frq-ctrl-btn.start:hover { opacity: 0.88; }
    .frq-ctrl-btn:hover:not(.start) { background: var(--cream); }
    .frq-checklist { border-top: 1px solid var(--cream-dark); padding-top: 14px; }
    .frq-checklist-title {
      font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
      text-transform: uppercase; color: var(--gray-400); margin-bottom: 10px;
    }
    .frq-check-item {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 7px 0; border-bottom: 1px solid var(--gray-100);
      cursor: pointer;
    }
    .frq-check-item:last-child { border-bottom: none; }
    .frq-check-box {
      width: 18px; height: 18px; border-radius: 4px;
      border: 2px solid var(--cream-dark); flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      margin-top: 1px; transition: background 0.15s, border-color 0.15s;
    }
    .frq-check-item.checked .frq-check-box {
      background: #22c55e; border-color: #22c55e;
    }
    .frq-check-item.checked .frq-check-box::after {
      content: '✓'; color: white; font-size: 11px; font-weight: 700;
    }
    .frq-check-text {
      font-size: 12px; line-height: 1.5; color: var(--gray-700);
    }
    .frq-check-item.checked .frq-check-text {
      text-decoration: line-through; color: var(--gray-400);
    }
    .frq-pts-row {
      display: flex; align-items: center; gap: 6px;
      margin-bottom: 12px;
    }
    .frq-pts-badge {
      font-size: 11px; font-weight: 700;
      background: var(--crimson); color: white;
      padding: 2px 10px; border-radius: 99px;
    }
    .frq-pts-label { font-size: 11px; color: var(--gray-400); }

    /* ══════════════════════════════════════════════════════
       ADMIN PANEL
    ══════════════════════════════════════════════════════ */
    #admin-overlay {
      position: fixed; inset: 0; z-index: 10000;
      background: rgba(10,18,40,0.92); backdrop-filter: blur(6px);
      display: none; align-items: flex-start; justify-content: center;
      padding: 20px; overflow-y: auto;
    }
    #admin-overlay.open { display: flex; }
    #admin-panel {
      background: #f8f7f3; border-radius: 12px;
      width: 100%; max-width: 820px;
      box-shadow: 0 24px 80px rgba(0,0,0,0.5);
      overflow: hidden; margin: auto;
    }
    .admin-header {
      background: var(--navy-dark); padding: 18px 24px;
      display: flex; align-items: center; justify-content: space-between;
    }
    .admin-header-left { display: flex; align-items: center; gap: 12px; }
    .admin-logo {
      width: 32px; height: 32px; border-radius: 8px;
      background: var(--crimson); display: flex; align-items: center;
      justify-content: center; color: white; font-size: 16px;
    }
    .admin-title {
      font-family: 'Newsreader', sans-serif;
      font-size: 16px; font-weight: 700; color: white;
    }
    .admin-subtitle { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 1px; }
    .admin-close-btn {
      background: rgba(255,255,255,0.08); border: none; color: rgba(255,255,255,0.6);
      width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
      font-size: 18px; display: flex; align-items: center; justify-content: center;
      transition: background 0.15s;
    }
    .admin-close-btn:hover { background: rgba(255,255,255,0.15); color: white; }
    .admin-tabs {
      display: flex; border-bottom: 1px solid #e5e0d5;
      background: white; overflow-x: auto;
    }
    .admin-tab {
      padding: 11px 18px; font-size: 12px; font-weight: 700;
      color: var(--gray-500); border-bottom: 2px solid transparent;
      cursor: pointer; white-space: nowrap; transition: color 0.15s;
      letter-spacing: 0.04em;
    }
    .admin-tab:hover { color: var(--navy); }
    .admin-tab.active { color: var(--navy); border-bottom-color: var(--crimson); }
    .admin-body { padding: 24px; }
    .admin-section { display: none; }
    .admin-section.active { display: block; }
    .admin-field-group { margin-bottom: 20px; }
    .admin-label {
      display: block; font-size: 11px; font-weight: 700;
      letter-spacing: 0.1em; text-transform: uppercase;
      color: var(--gray-500); margin-bottom: 6px;
    }
    .admin-hint { font-size: 11px; color: var(--gray-400); margin-bottom: 6px; }
    .admin-input, .admin-textarea, .admin-select {
      width: 100%; padding: 9px 12px;
      border: 1px solid #ddd; border-radius: 6px;
      font-family: 'Public Sans', sans-serif; font-size: 13px;
      color: var(--text); background: white;
      transition: border-color 0.15s; box-sizing: border-box;
    }
    .admin-input:focus, .admin-textarea:focus { outline: none; border-color: var(--navy); }
    .admin-textarea { min-height: 80px; resize: vertical; }
    .admin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .admin-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
    .admin-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
    .admin-list-item {
      background: white; border: 1px solid #e5e0d5;
      border-radius: 6px; padding: 10px 12px;
      display: flex; align-items: center; gap: 10px;
    }
    .admin-list-item-fields { flex: 1; display: grid; gap: 6px; }
    .admin-list-item-fields.cols2 { grid-template-columns: 2fr 1fr; }
    .admin-list-item-fields.cols3 { grid-template-columns: 2fr 1fr 1fr; }
    .admin-list-item-fields.cols4 { grid-template-columns: 2fr 1fr 1fr 1fr; }
    .admin-remove-btn {
      background: none; border: 1px solid #e5e0d5; color: var(--gray-400);
      width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
      font-size: 14px; display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; transition: background 0.12s, color 0.12s;
    }
    .admin-remove-btn:hover { background: #fee2e2; color: var(--crimson); border-color: #fca5a5; }
    .admin-add-btn {
      display: flex; align-items: center; gap: 6px;
      padding: 8px 14px; border-radius: 6px;
      border: 1px dashed #bbb; background: transparent;
      color: var(--gray-500); font-size: 12px; font-weight: 600;
      cursor: pointer; width: 100%; justify-content: center;
      transition: background 0.12s, border-color 0.12s, color 0.12s;
    }
    .admin-add-btn:hover { background: #f0ede6; border-color: var(--navy); color: var(--navy); }
    .admin-section-divider {
      font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--crimson);
      margin: 20px 0 12px; padding-bottom: 6px;
      border-bottom: 1px solid #e5e0d5;
    }
    .admin-footer {
      padding: 16px 24px; background: white;
      border-top: 1px solid #e5e0d5;
      display: flex; align-items: center; justify-content: space-between;
      gap: 12px; flex-wrap: wrap;
    }
    .admin-footer-left { font-size: 11px; color: var(--gray-400); }
    .admin-footer-btns { display: flex; gap: 8px; }
    .admin-dl-btn {
      padding: 9px 20px; border-radius: 6px;
      background: var(--navy); color: white; border: none;
      font-size: 12px; font-weight: 700; cursor: pointer;
      display: flex; align-items: center; gap: 6px;
      transition: opacity 0.15s;
    }
    .admin-dl-btn:hover { opacity: 0.88; }
    .admin-dl-btn.secondary {
      background: white; color: var(--navy);
      border: 1px solid var(--navy);
    }
    .admin-toast {
      position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
      background: var(--navy-dark); color: white;
      padding: 10px 20px; border-radius: 8px; font-size: 13px;
      font-weight: 600; z-index: 10001; opacity: 0;
      transition: opacity 0.2s; pointer-events: none;
    }
    .admin-toast.show { opacity: 1; }
    .admin-period-block {
      background: white; border: 1px solid #e5e0d5;
      border-radius: 8px; margin-bottom: 16px; overflow: hidden;
    }
    .admin-period-head {
      background: var(--navy-xlight); padding: 10px 14px;
      font-size: 12px; font-weight: 700; color: var(--navy);
      display: flex; align-items: center; justify-content: space-between;
    }
    .admin-student-list { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
    .admin-student-row { display: flex; align-items: center; gap: 8px; }
    .admin-student-row input { flex: 1; }
    .admin-vocab-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
    .admin-vocab-item {
      background: white; border: 1px solid #e5e0d5;
      border-radius: 6px; padding: 10px 12px;
      display: flex; gap: 10px; align-items: flex-start;
    }
    .admin-vocab-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
  

    /* ══ STUMP THE CLASS ══ */
    #tab-stump { display: none; }
    #tab-stump.active { display: block; }
    .stump-layout {
      max-width: 780px; margin: 0 auto;
    }
    .stump-hero {
      background: var(--navy-dark); border-radius: var(--radius);
      padding: 32px; text-align: center; margin-bottom: 20px;
      position: relative; overflow: hidden;
    }
    .stump-hero::before {
      content: ''; position: absolute; inset: 0;
      background: repeating-linear-gradient(
        45deg, transparent, transparent 40px,
        rgba(255,255,255,0.015) 40px, rgba(255,255,255,0.015) 80px
      );
    }
    .stump-mode-badge {
      display: inline-block; font-size: 9px; font-weight: 700;
      letter-spacing: 0.18em; text-transform: uppercase;
      color: var(--gold); margin-bottom: 12px;
    }
    .stump-case-display {
      font-family: 'Newsreader', sans-serif;
      font-size: 36px; font-weight: 700; color: white;
      line-height: 1.2; margin-bottom: 8px; position: relative;
      min-height: 90px; display: flex; align-items: center; justify-content: center;
    }
    .stump-year-display {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 14px; color: rgba(255,255,255,0.45);
      margin-bottom: 16px;
    }
    .stump-issue-display {
      font-size: 15px; color: rgba(255,255,255,0.7);
      max-width: 560px; margin: 0 auto 20px; line-height: 1.6;
      min-height: 48px;
    }
    .stump-timer-ring {
      width: 80px; height: 80px; margin: 0 auto 16px;
      position: relative;
    }
    .stump-timer-ring svg { transform: rotate(-90deg); }
    .stump-timer-ring circle {
      fill: none; stroke-width: 6;
    }
    .stump-timer-bg { stroke: rgba(255,255,255,0.1); }
    .stump-timer-fill {
      stroke: var(--gold);
      stroke-linecap: round;
      stroke-dasharray: 220;
      stroke-dashoffset: 0;
      transition: stroke-dashoffset 1s linear, stroke 0.3s;
    }
    .stump-timer-num {
      position: absolute; inset: 0;
      display: flex; align-items: center; justify-content: center;
      font-family: 'IBM Plex Mono', monospace;
      font-size: 22px; font-weight: 700; color: white;
    }
    .stump-controls {
      display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
    }
    .stump-btn {
      padding: 10px 22px; border-radius: var(--radius-sm);
      border: none; font-size: 13px; font-weight: 700;
      cursor: pointer; transition: opacity 0.15s, transform 0.1s;
      display: flex; align-items: center; gap: 6px;
    }
    .stump-btn:active { transform: scale(0.96); }
    .stump-btn.primary { background: var(--crimson); color: white; }
    .stump-btn.secondary { background: rgba(255,255,255,0.12); color: white; }
    .stump-btn.success { background: #22c55e; color: white; }
    .stump-btn:hover { opacity: 0.88; }
    .stump-btn:disabled { opacity: 0.35; cursor: default; }
    .stump-reveal {
      background: white; border-radius: var(--radius);
      border: 2px solid var(--navy); padding: 20px 24px;
      margin-bottom: 16px; display: none;
      animation: stump-pop 0.3s cubic-bezier(0.34,1.56,0.64,1);
    }
    .stump-reveal.show { display: block; }
    @keyframes stump-pop {
      from { transform: scale(0.92); opacity: 0; }
      to { transform: scale(1); opacity: 1; }
    }
    .stump-reveal-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--crimson); margin-bottom: 6px;
    }
    .stump-reveal-name {
      font-family: 'Newsreader', sans-serif;
      font-size: 24px; font-weight: 700; color: var(--navy); margin-bottom: 6px;
    }
    .stump-reveal-ruling {
      font-size: 13px; color: var(--gray-700); line-height: 1.6;
      margin-bottom: 10px;
    }
    .stump-reveal-sig {
      font-size: 12px; color: var(--gray-500); line-height: 1.5;
      padding: 10px 12px; background: var(--gray-100);
      border-radius: var(--radius-sm); border-left: 3px solid var(--navy);
    }
    .stump-scoreboard {
      background: white; border-radius: var(--radius);
      border: 1px solid var(--cream-dark); padding: 16px 20px;
    }
    .stump-score-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 12px;
    }
    .stump-score-title {
      font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--navy);
    }
    .stump-score-reset {
      font-size: 11px; color: var(--gray-400); cursor: pointer;
      background: none; border: none; padding: 0;
    }
    .stump-score-reset:hover { color: var(--crimson); }
    .stump-score-row {
      display: flex; align-items: center; gap: 12px; margin-bottom: 6px;
    }
    .stump-score-label { font-size: 13px; font-weight: 600; color: var(--navy); flex: 1; }
    .stump-score-track {
      flex: 2; height: 8px; background: var(--gray-100);
      border-radius: 4px; overflow: hidden;
    }
    .stump-score-fill {
      height: 100%; border-radius: 4px;
      transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
    }
    .stump-score-fill.got { background: #22c55e; }
    .stump-score-fill.missed { background: var(--crimson); }
    .stump-score-num {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 12px; color: var(--gray-500); min-width: 32px; text-align: right;
    }
    .stump-round-info {
      font-size: 11px; color: var(--gray-400); text-align: center;
      margin-top: 8px;
    }

    /* ══ LIVING DOCUMENTS ══ */
    #tab-docs { display: none; }
    #tab-docs.active { display: block; }
    .docs-layout {
      display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start;
    }
    .docs-sidebar { position: sticky; top: 80px; }
    .docs-doc-list { display: flex; flex-direction: column; gap: 4px; }
    .docs-doc-icon {
      width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7;
    }
    .docs-doc-item-row { display: flex; align-items: flex-start; gap: 8px; }
    .docs-doc-item-text { flex: 1; }
    .docs-doc-item {
      padding: 9px 12px; border-radius: var(--radius-sm);
      border: 1px solid transparent; cursor: pointer;
      transition: background 0.12s, border-color 0.12s;
      font-size: 12px; font-weight: 600; color: var(--navy);
      line-height: 1.3;
    }
    .docs-doc-item:hover { background: var(--cream); }
    .docs-doc-item .docs-doc-icon { color: var(--gray-400); }
    .docs-doc-item.active .docs-doc-icon { color: rgba(255,255,255,0.7); }
    .docs-doc-item.active {
      background: var(--navy); color: white; border-color: var(--navy);
    }
    .docs-doc-item .doc-year {
      font-size: 10px; font-weight: 400; opacity: 0.6; display: block; margin-top: 1px;
    }
    .docs-main {}
    .docs-header {
      background: var(--navy-dark); border-radius: var(--radius);
      padding: 20px 24px; margin-bottom: 16px;
    }
    .docs-header-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
    }
    .docs-header-title {
      font-family: 'Newsreader', sans-serif;
      font-size: 22px; font-weight: 700; color: white; margin-bottom: 4px;
    }
    .docs-header-meta { font-size: 12px; color: rgba(255,255,255,0.45); }
    .docs-intro {
      font-size: 13px; line-height: 1.7; color: var(--gray-600);
      margin-bottom: 16px; padding: 14px 16px;
      background: var(--cream); border-radius: var(--radius-sm);
      border-left: 3px solid var(--gold);
    }
    .docs-section { margin-bottom: 20px; }
    .docs-section-title {
      font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
      text-transform: uppercase; color: var(--crimson);
      margin-bottom: 10px; padding-bottom: 6px;
      border-bottom: 1px solid var(--cream-dark);
    }
    .docs-clause {
      background: white; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark); margin-bottom: 8px;
      overflow: hidden; cursor: pointer;
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    .docs-clause:hover { border-color: var(--navy-xlight); box-shadow: var(--shadow-sm); }
    .docs-clause.open { border-color: var(--navy); }
    .docs-clause-head {
      display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
    }
    .docs-clause-num {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 10px; font-weight: 700; color: var(--navy);
      background: var(--navy-xlight); padding: 2px 8px;
      border-radius: 4px; flex-shrink: 0; margin-top: 2px;
    }
    .docs-clause-text {
      font-size: 13px; line-height: 1.6; color: var(--text);
      font-style: italic; flex: 1;
    }
    .docs-clause-arrow {
      font-size: 11px; color: var(--gray-400); flex-shrink: 0;
      margin-top: 3px; transition: transform 0.2s;
    }
    .docs-clause.open .docs-clause-arrow { transform: rotate(180deg); }
    .docs-clause-body {
      display: none; padding: 0 14px 14px 44px;
      border-top: 1px solid var(--cream-dark); padding-top: 12px;
    }
    .docs-clause.open .docs-clause-body { display: block; padding-top: 12px; }
    .docs-plain {
      font-size: 13px; line-height: 1.7; color: var(--gray-700); margin-bottom: 10px;
    }
    .docs-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
    .docs-tag {
      font-size: 10px; font-weight: 700; padding: 2px 8px;
      border-radius: 4px; letter-spacing: 0.05em;
    }
    .docs-tag.standard { background: var(--navy-xlight); color: var(--navy); }
    .docs-tag.case {
      background: var(--crimson-light); color: var(--crimson); cursor: pointer;
    }
    .docs-tag.case:hover { background: #fbd0d5; }
    .docs-connections {
      font-size: 11px; color: var(--gray-500); font-style: italic;
    }
    @media (max-width: 760px) {
      .docs-layout { grid-template-columns: 1fr; }
      .docs-sidebar { position: static; }
      .docs-doc-list { flex-direction: row; flex-wrap: wrap; }
      .docs-doc-item { flex: 1; min-width: 120px; }
    }

    /* ══ DIAGNOSTIC QUIZ ══ */
    #tab-diagnostic { display: none; }
    #tab-diagnostic.active { display: block; }
    .diag-layout { max-width: 680px; margin: 0 auto; }
    .diag-start-card {
      background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
      border-radius: var(--radius); padding: 36px; text-align: center;
      margin-bottom: 20px;
    }
    .diag-start-icon { font-size: 48px; margin-bottom: 12px; }
    .diag-start-title {
      font-family: 'Newsreader', sans-serif;
      font-size: 26px; font-weight: 700; color: white; margin-bottom: 8px;
    }
    .diag-start-sub {
      font-size: 13px; color: rgba(255,255,255,0.55); margin-bottom: 20px;
      max-width: 400px; margin-left: auto; margin-right: auto; line-height: 1.6;
    }
    .diag-unit-pills {
      display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px;
    }
    .diag-unit-pill {
      padding: 6px 14px; border-radius: 99px;
      border: 1px solid rgba(255,255,255,0.2);
      font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.6);
      cursor: pointer; transition: all 0.15s;
      background: transparent; font-family: inherit;
    }
    .diag-unit-pill.selected {
      background: var(--crimson); border-color: var(--crimson); color: white;
    }
    .diag-start-btn {
      padding: 12px 32px; border-radius: var(--radius-sm);
      background: var(--crimson); color: white; border: none;
      font-size: 14px; font-weight: 700; cursor: pointer;
      transition: opacity 0.15s;
    }
    .diag-start-btn:hover { opacity: 0.88; }
    .diag-selection-summary {
      color: rgba(255,255,255,0.72); font-size: 11px;
      font-weight: 700; letter-spacing: 0.05em; margin: -10px 0 18px;
    }
    .diag-q-card {
      background: white; border-radius: var(--radius);
      border: 1px solid var(--cream-dark); box-shadow: var(--shadow-sm);
      padding: 24px; margin-bottom: 16px; display: none;
    }
    .diag-q-card.show { display: block; }
    .diag-q-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 16px;
    }
    .diag-q-meta {
      font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--gray-400);
    }
    .diag-q-unit-tag {
      font-size: 10px; font-weight: 700;
      background: var(--navy-xlight); color: var(--navy);
      padding: 3px 10px; border-radius: 99px;
    }
    .diag-progress-bar {
      height: 4px; background: var(--gray-200); border-radius: 2px;
      margin-bottom: 20px; overflow: hidden;
    }
    .diag-progress-fill {
      height: 100%; background: var(--crimson); border-radius: 2px;
      transition: width 0.3s;
    }
    .diag-question {
      font-size: 15px; font-weight: 600; color: var(--navy);
      line-height: 1.5; margin-bottom: 16px;
    }
    .diag-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
    .diag-option {
      padding: 12px 14px; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark); background: white;
      text-align: left; font-size: 13px; cursor: pointer;
      transition: background 0.12s, border-color 0.12s; line-height: 1.4;
      display: flex; align-items: flex-start; gap: 10px;
    }
    .diag-option-letter {
      display: inline-flex; width: 24px; height: 24px; flex: 0 0 24px;
      align-items: center; justify-content: center; border-radius: 50%;
      background: var(--navy-xlight); color: var(--navy);
      font-size: 10px; font-weight: 800;
    }
    .diag-option.correct .diag-option-letter { background: #22c55e; color: white; }
    .diag-option.wrong .diag-option-letter { background: var(--crimson); color: white; }
    .diag-option:hover:not(:disabled) { background: var(--cream); border-color: var(--navy-xlight); }
    .diag-option.correct { background: #dcfce7; border-color: #22c55e; color: #166534; font-weight: 600; }
    .diag-option.wrong { background: #fee2e2; border-color: var(--crimson); color: #991b1b; }
    .diag-option:disabled { cursor: default; }
    .diag-feedback {
      font-size: 12px; line-height: 1.6; padding: 10px 12px;
      border-radius: var(--radius-sm); margin-bottom: 14px; display: none;
    }
    .diag-feedback.show { display: block; }
    .diag-feedback.correct { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
    .diag-feedback.wrong { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
    .diag-next-btn {
      width: 100%; padding: 11px; border-radius: var(--radius-sm);
      background: var(--navy); color: white; border: none;
      font-size: 13px; font-weight: 700; cursor: pointer; display: none;
    }
    .diag-next-btn.show { display: block; }
    .diag-results { display: none; }
    .diag-results.show { display: block; }
    .diag-results-hero {
      background: var(--navy-dark); border-radius: var(--radius);
      padding: 28px; text-align: center; margin-bottom: 16px;
    }
    .diag-score-big {
      font-family: 'Newsreader', sans-serif;
      font-size: 56px; font-weight: 700; color: white; line-height: 1;
    }
    .diag-score-label { font-size: 13px; color: rgba(255,255,255,0.5); margin: 4px 0 16px; }
    .diag-score-msg { font-size: 14px; color: rgba(255,255,255,0.75); }
    .diag-unit-breakdown {
      background: white; border-radius: var(--radius);
      border: 1px solid var(--cream-dark); padding: 20px;
      margin-bottom: 16px;
    }
    .diag-breakdown-title {
      font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--navy); margin-bottom: 14px;
    }
    .diag-unit-row {
      display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
    }
    .diag-unit-name { font-size: 12px; font-weight: 600; color: var(--navy); min-width: 80px; }
    .diag-unit-bar {
      flex: 1; height: 10px; background: var(--gray-100);
      border-radius: 5px; overflow: hidden;
    }
    .diag-unit-fill {
      height: 100%; border-radius: 5px;
      transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
    }
    .diag-unit-pct {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 11px; min-width: 78px; text-align: right;
    }
    .diag-focus-box {
      background: #fef3cd; border: 1px solid #fcd34d;
      border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px;
    }
    .diag-focus-title {
      font-size: 11px; font-weight: 700; color: #92400e;
      letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px;
    }
    .diag-focus-list { font-size: 13px; color: #78350f; line-height: 1.8; }
    .diag-retry-btns { display: flex; gap: 8px; }
    .diag-retry-btn {
      flex: 1; padding: 11px; border-radius: var(--radius-sm);
      border: none; font-size: 13px; font-weight: 700; cursor: pointer;
    }
    .diag-retry-btn.primary { background: var(--navy); color: white; }
    .diag-retry-btn.secondary { background: white; color: var(--navy); border: 1px solid var(--navy); }

    @media (max-width: 520px) {
      .diag-start-card { padding: 24px 16px; }
      .diag-start-title { font-size: 22px; }
      .diag-unit-pill { min-height: 40px; padding: 8px 13px; }
      .diag-q-card { padding: 18px 14px; }
      .diag-q-header { align-items: flex-start; gap: 8px; }
      .diag-q-unit-tag { text-align: right; }
      .diag-option { min-height: 48px; padding: 12px; }
      .diag-unit-row { gap: 8px; }
      .diag-unit-name { min-width: 46px; }
      .diag-unit-pct { min-width: 72px; }
      .diag-retry-btns { flex-direction: column; }
      .diag-retry-btn { min-height: 46px; }
    }

    /* ══ FRQ PRACTICE MODE ══ */
    .frq-practice-wrap {
      display: none; margin-top: 0;
    }
    .frq-practice-wrap.visible { display: block; }

    /* Prompt selector */
    .frq-prompt-selector {
      background: white; border-radius: var(--radius);
      border: 1px solid var(--cream-dark); overflow: hidden;
      margin-bottom: 0;
    }
    .frq-selector-head {
      background: var(--navy-dark); padding: 16px 20px;
      display: flex; align-items: center; justify-content: space-between;
      flex-wrap: wrap; gap: 10px;
    }
    .frq-selector-head-left {}
    .frq-selector-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--gold); margin-bottom: 3px;
    }
    .frq-selector-title {
      font-family: 'Newsreader', sans-serif;
      font-size: 16px; font-weight: 700; color: white;
    }
    .frq-selector-btns { display: flex; gap: 8px; flex-wrap: wrap; }
    .frq-type-select-btn {
      padding: 7px 14px; border-radius: var(--radius-sm);
      border: 1px solid rgba(255,255,255,0.2);
      background: transparent; color: rgba(255,255,255,0.6);
      font-size: 11px; font-weight: 700; cursor: pointer;
      transition: all 0.15s; white-space: nowrap;
    }
    .frq-type-select-btn:hover { background: rgba(255,255,255,0.1); color: white; }
    .frq-type-select-btn.active {
      background: var(--crimson); border-color: var(--crimson); color: white;
    }
    .frq-prompt-list {
      padding: 12px; display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 8px;
    }
    .frq-prompt-card {
      padding: 12px 14px; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark); background: var(--gray-50);
      cursor: pointer; transition: border-color 0.15s, background 0.15s;
    }
    .frq-prompt-card:hover { border-color: var(--navy); background: var(--cream); }
    .frq-prompt-card-unit {
      font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--crimson); margin-bottom: 4px;
    }
    .frq-prompt-card-text {
      font-size: 12px; line-height: 1.5; color: var(--navy); font-weight: 600;
    }
    .frq-prompt-card-type {
      font-size: 10px; color: var(--gray-400); margin-top: 4px;
    }
    .frq-random-btn {
      display: flex; align-items: center; gap: 6px;
      padding: 8px 18px; border-radius: var(--radius-sm);
      background: var(--navy-xlight); color: var(--navy);
      border: 1px solid var(--navy-xlight); font-size: 12px;
      font-weight: 700; cursor: pointer; margin: 0 12px 12px;
      transition: background 0.15s;
    }
    .frq-random-btn:hover { background: #dde5f5; }

    /* Practice screen */
    .frq-practice-screen {
      display: none;
    }
    .frq-practice-screen.visible { display: block; }
    .frq-practice-header {
      background: var(--navy-dark); border-radius: var(--radius) var(--radius) 0 0;
      padding: 14px 20px;
      display: flex; align-items: center; justify-content: space-between;
      flex-wrap: wrap; gap: 10px;
    }
    .frq-practice-header-left {}
    .frq-practice-type-badge {
      font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
      text-transform: uppercase; color: var(--gold); margin-bottom: 2px;
    }
    .frq-practice-title {
      font-size: 14px; font-weight: 700; color: white;
    }
    .frq-practice-header-right { display: flex; align-items: center; gap: 10px; }
    .frq-practice-clock {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 28px; font-weight: 700; color: white;
      letter-spacing: 0.04em;
    }
    .frq-practice-clock.warning { color: #fca5a5; }
    .frq-practice-ctrl-btn {
      padding: 6px 14px; border-radius: var(--radius-sm);
      border: 1px solid rgba(255,255,255,0.25);
      background: transparent; color: white;
      font-size: 11px; font-weight: 700; cursor: pointer;
      transition: background 0.15s;
    }
    .frq-practice-ctrl-btn:hover { background: rgba(255,255,255,0.12); }
    .frq-practice-body {
      display: grid; grid-template-columns: 1fr 280px;
      border: 1px solid var(--navy); border-top: none;
      border-radius: 0 0 var(--radius) var(--radius);
      overflow: hidden; background: white;
    }
    .frq-practice-left { padding: 20px; border-right: 1px solid var(--cream-dark); }
    .frq-prompt-display {
      font-size: 13px; line-height: 1.7; color: var(--text);
      margin-bottom: 14px;
    }
    .frq-chart-area {
      margin-bottom: 14px; background: var(--gray-50);
      border-radius: var(--radius-sm); border: 1px solid var(--cream-dark);
      padding: 12px; display: none;
    }
    .frq-chart-area.visible { display: block; }
    .frq-chart-title {
      font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--gray-500); margin-bottom: 10px;
      text-align: center;
    }
    .frq-response-area {
      width: 100%; min-height: 280px; padding: 12px;
      border: 1px solid var(--cream-dark); border-radius: var(--radius-sm);
      font-family: 'Public Sans', sans-serif; font-size: 13px;
      line-height: 1.7; color: var(--text); resize: vertical;
      box-sizing: border-box;
    }
    .frq-response-area:focus { outline: none; border-color: var(--navy); }
    .frq-word-count {
      font-size: 11px; color: var(--gray-400); margin-top: 4px; text-align: right;
    }
    .frq-practice-right { padding: 16px; background: var(--gray-50); }
    .frq-side-checklist-title {
      font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--navy); margin-bottom: 10px;
    }
    .frq-side-pts {
      display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
    }
    .frq-side-pts-badge {
      font-size: 11px; font-weight: 700; background: var(--crimson);
      color: white; padding: 2px 10px; border-radius: 99px;
    }
    .frq-side-pts-label { font-size: 11px; color: var(--gray-500); }
    .frq-side-check-item {
      display: flex; align-items: flex-start; gap: 8px;
      padding: 7px 0; border-bottom: 1px solid var(--gray-200);
      cursor: pointer;
    }
    .frq-side-check-item:last-of-type { border-bottom: none; }
    .frq-side-check-box {
      width: 16px; height: 16px; border-radius: 3px;
      border: 2px solid var(--cream-dark); flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      margin-top: 2px; transition: background 0.15s;
    }
    .frq-side-check-item.checked .frq-side-check-box {
      background: #22c55e; border-color: #22c55e;
    }
    .frq-side-check-item.checked .frq-side-check-box::after {
      content: '✓'; color: white; font-size: 10px; font-weight: 700;
    }
    .frq-side-check-text {
      font-size: 11px; line-height: 1.5; color: var(--gray-700);
    }
    .frq-side-check-item.checked .frq-side-check-text {
      text-decoration: line-through; color: var(--gray-400);
    }
    .frq-practice-footer {
      display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
    }
    .frq-practice-action-btn {
      padding: 8px 16px; border-radius: var(--radius-sm);
      font-size: 12px; font-weight: 700; cursor: pointer;
      transition: opacity 0.15s; display: flex; align-items: center; gap: 5px;
    }
    .frq-practice-action-btn.back {
      background: white; color: var(--navy);
      border: 1px solid var(--navy);
    }
    .frq-practice-action-btn.copy {
      background: var(--navy-xlight); color: var(--navy); border: none;
    }
    .frq-practice-action-btn.print {
      background: var(--navy); color: white; border: none;
    }
    .frq-practice-action-btn.ai {
      background: var(--gray-200); color: var(--gray-400);
      border: none; cursor: not-allowed;
    }
    .frq-practice-action-btn:hover:not(.ai) { opacity: 0.85; }

    @media (max-width: 760px) {
      .frq-practice-body { grid-template-columns: 1fr; }
      .frq-practice-right { border-top: 1px solid var(--cream-dark); border-right: none; }
    }

    /* ══ AMENDMENT TRACKER ══ */
    #tab-amendments { display: none; }
    #tab-amendments.active { display: block; }
    .amend-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
    .amend-sidebar { position: sticky; top: 80px; }
    .amend-era-group { margin-bottom: 14px; }
    .amend-era-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
      text-transform: uppercase; color: var(--gray-400);
      padding: 0 4px 4px; border-bottom: 1px solid var(--cream-dark); margin-bottom: 6px;
    }
    .amend-pill {
      display: flex; align-items: center; gap: 8px; padding: 6px 8px;
      border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 3px;
      transition: background 0.12s; border: 1px solid transparent;
    }
    .amend-pill:hover { background: var(--cream); }
    .amend-pill.active { background: var(--navy); border-color: var(--navy); }
    .amend-pill-num {
      font-family: 'IBM Plex Mono', monospace; font-size: 11px;
      font-weight: 700; color: var(--navy); min-width: 28px;
    }
    .amend-pill.active .amend-pill-num { color: white; }
    .amend-pill-title { font-size: 11px; color: var(--gray-600); line-height: 1.3; }
    .amend-pill.active .amend-pill-title { color: rgba(255,255,255,0.8); }
    .amend-main {}
    .amend-card {
      background: white; border-radius: var(--radius);
      border: 1px solid var(--cream-dark); overflow: hidden;
    }
    .amend-card-header {
      background: var(--navy-dark); padding: 20px 24px;
    }
    .amend-card-num {
      font-family: 'IBM Plex Mono', monospace; font-size: 11px;
      font-weight: 700; color: var(--gold); letter-spacing: 0.1em; margin-bottom: 4px;
    }
    .amend-card-title {
      font-family: 'Newsreader', sans-serif;
      font-size: 20px; font-weight: 700; color: white; margin-bottom: 4px;
    }
    .amend-card-meta { font-size: 11px; color: rgba(255,255,255,0.4); }
    .amend-card-body { padding: 20px 24px; }
    .amend-plain {
      font-size: 14px; line-height: 1.7; color: var(--text);
      margin-bottom: 16px; padding: 14px 16px;
      background: var(--cream); border-radius: var(--radius-sm);
      border-left: 3px solid var(--gold);
    }
    .amend-section-label {
      font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--crimson);
      margin-bottom: 8px; margin-top: 14px;
    }
    .amend-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
    .amend-tag {
      font-size: 10px; font-weight: 700; padding: 3px 10px;
      border-radius: 4px; letter-spacing: 0.04em;
    }
    .amend-tag.standard { background: var(--navy-xlight); color: var(--navy); }
    .amend-tag.case {
      background: var(--crimson-light); color: var(--crimson);
      cursor: pointer;
    }
    .amend-tag.case:hover { background: #fbd0d5; }
    .amend-sig {
      font-size: 13px; line-height: 1.65; color: var(--gray-700);
      margin-bottom: 10px;
    }
    .amend-frq {
      font-size: 12px; line-height: 1.65; color: var(--gray-600);
      background: var(--gray-100); padding: 10px 12px;
      border-radius: var(--radius-sm); border-left: 3px solid var(--navy);
    }
    .amend-nav-btns {
      display: flex; justify-content: space-between; padding: 14px 24px;
      border-top: 1px solid var(--cream-dark);
    }
    .amend-nav-btn {
      padding: 7px 16px; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark); background: white;
      font-size: 12px; font-weight: 600; cursor: pointer;
      transition: background 0.12s; color: var(--navy);
    }
    .amend-nav-btn:hover { background: var(--cream); }
    .amend-nav-btn:disabled { opacity: 0.35; cursor: default; }
    @media (max-width: 760px) {
      .amend-layout { grid-template-columns: 1fr; }
      .amend-sidebar { position: static; }
    }

    /* ══ FRQ ARCHIVE ══ */
    #tab-archive { display: none; }
    #tab-archive.active { display: block; }
    .archive-toolbar {
      display: flex; gap: 10px; flex-wrap: wrap;
      margin-bottom: 16px; align-items: center;
    }
    .archive-filter-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
    .archive-filter-label {
      font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--gray-400); white-space: nowrap;
    }
    .archive-filter-btn {
      padding: 5px 12px; border-radius: 99px;
      border: 1px solid var(--cream-dark); background: white;
      font-size: 11px; font-weight: 600; color: var(--navy);
      cursor: pointer; transition: all 0.12s; white-space: nowrap;
    }
    .archive-filter-btn:hover { background: var(--cream); }
    .archive-filter-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
    .archive-search {
      flex: 1; min-width: 180px; padding: 7px 12px;
      border: 1px solid var(--cream-dark); border-radius: var(--radius-sm);
      font-size: 12px; font-family: inherit;
    }
    .archive-search:focus { outline: none; border-color: var(--navy); }
    .archive-count {
      font-size: 11px; color: var(--gray-400);
      font-family: 'IBM Plex Mono', monospace; white-space: nowrap;
    }
    .archive-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
      gap: 10px;
    }
    .archive-card {
      background: white; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark);
      overflow: hidden; cursor: pointer;
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    .archive-card:hover { border-color: var(--navy); box-shadow: var(--shadow-sm); }
    .archive-card.open { border-color: var(--navy); }
    .archive-card-head {
      padding: 10px 14px; display: flex; align-items: flex-start; gap: 10px;
    }
    .archive-card-year {
      font-family: 'IBM Plex Mono', monospace; font-size: 11px;
      font-weight: 700; background: var(--navy); color: white;
      padding: 2px 8px; border-radius: 4px; flex-shrink: 0; margin-top: 2px;
    }
    .archive-card-info { flex: 1; }
    .archive-card-type {
      font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; margin-bottom: 2px;
    }
    .archive-card-type.ca { color: #0369a1; }
    .archive-card-type.qa { color: #7c3aed; }
    .archive-card-type.sc { color: var(--crimson); }
    .archive-card-type.ae { color: #065f46; }
    .archive-card-title {
      font-size: 13px; font-weight: 600; color: var(--navy); line-height: 1.3;
    }
    .archive-card-meta {
      font-size: 10px; color: var(--gray-400); margin-top: 2px;
    }
    .archive-card-toggle { color: var(--gray-400); font-size: 12px; transition: transform 0.2s; }
    .archive-card.open .archive-card-toggle { transform: rotate(180deg); }
    .archive-card-body {
      display: none; padding: 0 14px 14px;
      border-top: 1px solid var(--cream-dark); padding-top: 12px;
      font-size: 12px; line-height: 1.7; color: var(--gray-700);
      white-space: pre-wrap;
    }
    .archive-card.open .archive-card-body { display: block; }
    .archive-card-actions {
      display: flex; gap: 8px; margin-top: 10px;
    }
    .archive-action-btn {
      padding: 5px 12px; border-radius: var(--radius-sm);
      font-size: 11px; font-weight: 600; cursor: pointer;
      transition: opacity 0.15s; border: none;
    }
    .archive-action-btn.practice { background: var(--navy); color: white; }
    .archive-action-btn.copy { background: var(--gray-100); color: var(--gray-700); }
    .archive-action-btn:hover { opacity: 0.85; }
    .archive-empty {
      text-align: center; padding: 48px 20px;
      color: var(--gray-400); font-size: 14px;
    }

    /* ══ LANDMARK CASES TAB ══ */
    #tab-cases { display: none; }
    #tab-cases.active { display: block; }
    .cases-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
    .cases-sidebar { position: sticky; top: 80px; }
    .cases-filter-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
      text-transform: uppercase; color: var(--gray-400);
      padding: 0 4px 6px; border-bottom: 1px solid var(--cream-dark);
      margin-bottom: 8px; display: block;
    }
    .cases-unit-group { margin-bottom: 14px; }
    .cases-unit-head {
      font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--crimson);
      padding: 4px 0 6px; margin-bottom: 4px;
    }
    .cases-pill {
      padding: 7px 10px;
      border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 3px;
      transition: background 0.12s; border: 1px solid transparent;
    }
    .cases-pill .docs-doc-item-row { align-items: center; }
    .cases-pill:hover { background: var(--cream); }
    .cases-pill.active { background: var(--navy); border-color: var(--navy); }
    .cases-pill-year {
      font-family: 'IBM Plex Mono', monospace; font-size: 10px;
      font-weight: 700; color: var(--gray-400); flex-shrink: 0; min-width: 36px;
    }
    .cases-pill.active .cases-pill-year { color: rgba(255,255,255,0.5); }
    .cases-pill.active .docs-doc-icon { color: rgba(255,255,255,0.7); }
    .cases-pill .docs-doc-icon { color: var(--gray-400); }
    .cases-pill-name { font-size: 11px; color: var(--navy); line-height: 1.3; font-weight: 600; }
    .cases-pill.active .cases-pill-name { color: white; }
    .cases-main {}
    .cases-card {
      background: white; border-radius: var(--radius);
      border: 1px solid var(--cream-dark); overflow: hidden;
    }
    .cases-card-header { background: var(--navy-dark); padding: 20px 24px; }
    .cases-card-unit {
      font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
    }
    .cases-card-name {
      font-family: 'Newsreader', sans-serif;
      font-size: 22px; font-weight: 700; color: white; margin-bottom: 4px;
    }
    .cases-card-meta { font-size: 12px; color: rgba(255,255,255,0.4); }
    .cases-card-body { padding: 20px 24px; }
    .cases-section-label {
      font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--crimson); margin-bottom: 6px; margin-top: 14px;
    }
    .cases-issue {
      font-size: 14px; font-weight: 600; color: var(--navy);
      line-height: 1.5; margin-bottom: 4px;
    }
    .cases-ruling {
      font-size: 13px; line-height: 1.7; color: var(--gray-700);
      padding: 12px 14px; background: var(--cream);
      border-radius: var(--radius-sm); border-left: 3px solid var(--gold);
      margin-bottom: 4px;
    }
    .cases-sig {
      font-size: 13px; line-height: 1.7; color: var(--gray-700); margin-bottom: 4px;
    }
    .cases-tip {
      font-size: 12px; line-height: 1.65; color: var(--gray-600);
      background: var(--gray-100); padding: 10px 14px;
      border-radius: var(--radius-sm); border-left: 3px solid var(--navy);
    }
    .cases-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; margin-top: 6px; }
    .cases-tag {
      font-size: 10px; font-weight: 700; padding: 3px 10px;
      border-radius: 4px; letter-spacing: 0.04em;
    }
    .cases-tag.unit-tag { background: var(--navy-xlight); color: var(--navy); }
    .cases-tag.amend-tag { background: var(--crimson-light); color: var(--crimson); }
    .cases-nav-btns {
      display: flex; justify-content: space-between; padding: 14px 24px;
      border-top: 1px solid var(--cream-dark);
    }
    .cases-nav-btn {
      padding: 7px 16px; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark); background: white;
      font-size: 12px; font-weight: 600; cursor: pointer;
      transition: background 0.12s; color: var(--navy);
    }
    .cases-nav-btn:hover { background: var(--cream); }
    .cases-nav-btn:disabled { opacity: 0.35; cursor: default; }
    @media (max-width: 760px) {
      .cases-layout { grid-template-columns: 1fr; }
      .cases-sidebar { position: static; }
    }

    /* ══ CARTOON ANALYZER ══ */
    #tab-cartoons { display: none; }
    #tab-cartoons.active { display: block; }

    .cartoon-layout {
      display: grid; grid-template-columns: 1fr 380px;
      gap: 20px; align-items: start;
    }
    .cartoon-left {}
    .cartoon-img-wrap {
      background: white; border-radius: var(--radius);
      border: 1px solid var(--cream-dark);
      overflow: hidden; margin-bottom: 12px;
      box-shadow: var(--shadow-sm);
    }
    .cartoon-img-wrap img {
      width: 100%; height: auto; display: block;
    }
    .cartoon-img-meta {
      padding: 10px 14px; border-top: 1px solid var(--cream-dark);
      display: flex; align-items: center; justify-content: space-between;
    }
    .cartoon-img-title {
      font-family: 'Newsreader', sans-serif;
      font-size: 15px; font-weight: 700; color: var(--navy);
    }
    .cartoon-img-unit {
      font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase;
      background: var(--navy-xlight); color: var(--navy);
      padding: 3px 10px; border-radius: 99px;
    }
    .cartoon-nav-row {
      display: flex; align-items: center; gap: 8px;
    }
    .cartoon-nav-btn {
      padding: 7px 14px; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark); background: white;
      font-size: 12px; font-weight: 600; cursor: pointer;
      color: var(--navy); transition: background 0.12s;
    }
    .cartoon-nav-btn:hover { background: var(--cream); }
    .cartoon-nav-btn:disabled { opacity: 0.35; cursor: default; }
    .cartoon-random-btn {
      margin-left: auto; padding: 7px 14px;
      border-radius: var(--radius-sm);
      background: var(--navy-xlight); color: var(--navy);
      border: none; font-size: 12px; font-weight: 700;
      cursor: pointer; transition: background 0.15s;
      display: flex; align-items: center; gap: 5px;
    }
    .cartoon-random-btn:hover { background: #dde5f5; }

    /* Unit filter pills */
    .cartoon-filter-row {
      display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
    }
    .cartoon-filter-btn {
      padding: 5px 12px; border-radius: 99px;
      border: 1px solid var(--cream-dark); background: white;
      font-size: 11px; font-weight: 600; color: var(--navy);
      cursor: pointer; transition: all 0.12s;
    }
    .cartoon-filter-btn:hover { background: var(--cream); }
    .cartoon-filter-btn.active {
      background: var(--navy); color: white; border-color: var(--navy);
    }

    /* Right panel — questions */
    .cartoon-right {}
    .cartoon-q-panel {
      background: white; border-radius: var(--radius);
      border: 1px solid var(--cream-dark);
      overflow: hidden; box-shadow: var(--shadow-sm);
    }
    .cartoon-q-header {
      background: var(--navy-dark); padding: 14px 18px;
    }
    .cartoon-q-header-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
      text-transform: uppercase; color: var(--gold); margin-bottom: 3px;
    }
    .cartoon-q-header-title {
      font-size: 14px; font-weight: 700; color: white;
    }
    .cartoon-q-body { padding: 16px 18px; }
    .cartoon-q-item { margin-bottom: 16px; }
    .cartoon-q-label {
      font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--crimson); margin-bottom: 5px;
    }
    .cartoon-q-text {
      font-size: 13px; line-height: 1.6; color: var(--navy);
      font-weight: 600; margin-bottom: 8px;
    }
    .cartoon-answer {
      font-size: 12px; line-height: 1.7; color: var(--gray-700);
      background: var(--gray-100); padding: 10px 12px;
      border-radius: var(--radius-sm); border-left: 3px solid var(--navy);
      display: none;
    }
    .cartoon-answer.show { display: block; }
    .cartoon-reveal-btn {
      font-size: 11px; font-weight: 700; padding: 5px 12px;
      border-radius: var(--radius-sm); border: 1px solid var(--cream-dark);
      background: white; color: var(--gray-500); cursor: pointer;
      transition: all 0.12s;
    }
    .cartoon-reveal-btn:hover { border-color: var(--navy); color: var(--navy); }
    .cartoon-reveal-btn.revealed {
      background: var(--navy); color: white; border-color: var(--navy);
    }
    .cartoon-divider {
      height: 1px; background: var(--cream-dark); margin: 14px 0;
    }
    .cartoon-checklist {
      border-top: 1px solid var(--cream-dark); padding: 14px 18px;
      background: var(--gray-50);
    }
    .cartoon-checklist-title {
      font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--navy); margin-bottom: 8px;
    }
    .cartoon-check-item {
      display: flex; align-items: flex-start; gap: 8px;
      padding: 5px 0; cursor: pointer;
    }
    .cartoon-check-box {
      width: 16px; height: 16px; border-radius: 3px;
      border: 2px solid var(--cream-dark); flex-shrink: 0;
      margin-top: 2px; transition: background 0.15s;
      display: flex; align-items: center; justify-content: center;
    }
    .cartoon-check-item.checked .cartoon-check-box {
      background: #22c55e; border-color: #22c55e;
    }
    .cartoon-check-item.checked .cartoon-check-box::after {
      content: '✓'; color: white; font-size: 10px; font-weight: 700;
    }
    .cartoon-check-text {
      font-size: 11px; line-height: 1.5; color: var(--gray-700);
    }
    .cartoon-check-item.checked .cartoon-check-text {
      text-decoration: line-through; color: var(--gray-400);
    }
    .cartoon-reveal-all-btn {
      width: 100%; margin-top: 10px; padding: 9px;
      border-radius: var(--radius-sm); background: var(--crimson);
      color: white; border: none; font-size: 12px;
      font-weight: 700; cursor: pointer; transition: opacity 0.15s;
    }
    .cartoon-reveal-all-btn:hover { opacity: 0.88; }

    @media (max-width: 820px) {
      .cartoon-layout { grid-template-columns: 1fr; }
    }

    /* ══ WHAT WOULD MADISON SAY ══ */
    #tab-madison { display: none; }
    #tab-madison.active { display: block; }

    .madison-hero {
      display: flex; align-items: center; gap: 20px;
      background: var(--navy-dark); border-radius: var(--radius);
      padding: 20px 28px; margin-bottom: 20px;
    }
    .madison-hero-svg { width: 84px; height: 84px; flex-shrink: 0; }
    .madison-hero-text {}
    .madison-hero-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.16em;
      text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
    }
    .madison-hero-title {
      font-family: 'Newsreader', sans-serif;
      font-size: 22px; font-weight: 700; color: white; margin-bottom: 4px;
    }
    .madison-hero-sub {
      font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.5;
      max-width: 540px;
    }

    .madison-topic-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 10px; margin-bottom: 20px;
    }
    .madison-topic-card {
      background: white; border-radius: var(--radius-sm);
      border: 1px solid var(--cream-dark);
      padding: 14px 16px; cursor: pointer;
      transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    }
    .madison-topic-card:hover {
      border-color: var(--navy); box-shadow: var(--shadow-sm);
      transform: translateY(-1px);
    }
    .madison-topic-card.active {
      border-color: var(--crimson); background: var(--crimson-light);
    }
    .madison-topic-icon {
      font-size: 20px; margin-bottom: 6px; display: block;
    }
    .madison-topic-title {
      font-size: 12px; font-weight: 700; color: var(--navy); line-height: 1.3;
    }

    .madison-debate-area { display: none; }
    .madison-debate-area.show { display: block; }

    .madison-question-bar {
      background: white; border: 1px solid var(--cream-dark);
      border-radius: var(--radius); padding: 16px 20px;
      margin-bottom: 16px; text-align: center;
    }
    .madison-question-label {
      font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
      text-transform: uppercase; color: var(--gray-400); margin-bottom: 4px;
    }
    .madison-question-text {
      font-family: 'Newsreader', sans-serif;
      font-size: 18px; font-weight: 700; color: var(--navy);
    }

    .madison-sides {
      display: grid; grid-template-columns: 1fr 1fr;
      gap: 16px; margin-bottom: 16px;
    }
    .madison-side-card {
      background: white; border-radius: var(--radius);
      overflow: hidden; border: 2px solid transparent;
      box-shadow: var(--shadow-sm);
    }
    .madison-side-card.federalist { border-color: var(--navy); }
    .madison-side-card.antifederalist { border-color: var(--crimson); }

    .madison-side-header {
      display: flex; align-items: center; gap: 10px;
      padding: 12px 16px;
    }
    .madison-side-header.federalist { background: var(--navy-dark); }
    .madison-side-header.antifederalist { background: var(--crimson); }
    .madison-side-svg { width: 32px; height: 32px; flex-shrink: 0; }
    .madison-side-name {
      font-family: 'Newsreader', sans-serif;
      font-size: 14px; font-weight: 700; color: white;
    }
    .madison-side-tag {
      font-size: 9px; color: rgba(255,255,255,0.6);
      letter-spacing: 0.08em; text-transform: uppercase;
    }
    .madison-side-body { padding: 16px; }
    .madison-side-quote {
      font-size: 12px; font-style: italic; color: var(--gray-600);
      line-height: 1.6; padding: 10px 12px; background: var(--gray-100);
      border-radius: var(--radius-sm); margin-bottom: 12px;
      border-left: 3px solid var(--cream-dark);
    }
    .madison-side-source {
      font-size: 10px; font-weight: 700; color: var(--gray-400);
      margin-top: -8px; margin-bottom: 12px; text-align: right;
    }
    .madison-side-argument {
      font-size: 13px; line-height: 1.7; color: var(--text);
    }

    .madison-constitutional-box {
      background: white; border-radius: var(--radius);
      border: 1px solid var(--cream-dark); padding: 16px 20px;
      margin-bottom: 16px;
    }
    .madison-const-label {
      font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--gold); margin-bottom: 8px;
    }
    .madison-const-text {
      font-size: 13px; line-height: 1.7; color: var(--gray-700);
    }
    .madison-const-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
    .madison-const-tag {
      font-size: 10px; font-weight: 700; padding: 3px 10px;
      border-radius: 4px; background: var(--navy-xlight); color: var(--navy);
    }

    .madison-prompt-box {
      background: var(--cream); border-radius: var(--radius);
      border: 1px dashed var(--gold); padding: 18px 20px;
    }
    .madison-prompt-label {
      font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--crimson); margin-bottom: 8px;
    }
    .madison-prompt-text {
      font-size: 13px; line-height: 1.7; color: var(--navy);
      margin-bottom: 12px; font-weight: 600;
    }
    .madison-prompt-textarea {
      width: 100%; min-height: 100px; padding: 10px 12px;
      border: 1px solid var(--cream-dark); border-radius: var(--radius-sm);
      font-family: inherit; font-size: 13px; line-height: 1.6;
      box-sizing: border-box; resize: vertical;
    }
    .madison-prompt-textarea:focus { outline: none; border-color: var(--navy); }

    @media (max-width: 760px) {
      .madison-sides { grid-template-columns: 1fr; }
      .madison-hero { flex-direction: column; text-align: center; }
    }
