    /* ── Base ──────────────────────────────────────────── */
    /* ══ COLOR RULE (enforced — do not break) ═══════════════════════════════════
       ANY element with a colored background (badge, pill, banner, card)
       MUST use text color #f1f5f9 (white) or #e8f4fb.
       Color signals via border and background-tint ONLY.
       NO colored text on colored background. Ever.
    ═════════════════════════════════════════════════════ */
    *, *::before, *::after { box-sizing: border-box; }

    body {
      font-family: 'Inter', system-ui, sans-serif;
      margin: 0;
      min-height: 100vh;
      transition: background-color 0.2s, color 0.2s;
      line-height: 1.6;
      font-size: 15px;
    }

    /* ── Theme: Focus (default) ─────────────────────────
       Nav: deep navy-teal (logo palette)  |  Content: cool off-white */
    /* ── Theme: Focus — Institutional Slate (warm neutral, editorial intelligence) ── */
    [data-theme="focus"] body        { background: #F4F1EC; color: #1F2933; }
    [data-theme="focus"] .t-nav      { background: #0f0f0f; border-bottom: 1px solid #1a1a1a; }
    [data-theme="focus"] .t-nav-text { color: #f0ede8; }
    [data-theme="focus"] .t-card     { background: #FBF8F3; border: 1px solid #E2DDD6; }
    [data-theme="focus"] .t-input    { background: #FBF8F3; border: 1px solid #C8C2B8; color: #1F2933; }
    [data-theme="focus"] .t-input:focus { border-color: #0F6C73; outline: none; box-shadow: 0 0 0 2px rgba(15,108,115,0.15); }
    [data-theme="focus"] .t-muted    { color: #5B6672; }
    [data-theme="focus"] .t-label    { color: #1F2933; }
    [data-theme="focus"] .t-divider  { border-color: #E2DDD6; }
    [data-theme="focus"] .t-results  { background: transparent; border: none; }
    [data-theme="focus"] .t-pill     { background: #2A3440; color: #f0ede8; border: 1px solid rgba(15,108,115,0.4); }
    [data-theme="focus"] .t-section-head { color: #1F2933; }
    [data-theme="focus"] .t-toggle-btn { background: #EDE9E3; color: #3A3530; border: 1px solid #C8C2B8; }
    [data-theme="focus"] .t-toggle-btn.active { background: #0F6C73; color: #ffffff; border-color: #0F6C73; }
    [data-theme="focus"] .t-btn-primary { background: #0F6C73; color: #ffffff; }
    [data-theme="focus"] .t-btn-primary:hover { background: #0a4f56; }
    [data-theme="focus"] .t-mode-btn  { background: #EDE9E3; color: #3A3530; border: 1px solid #C8C2B8; }
    [data-theme="focus"] .t-mode-btn.active { background: #0F6C73; color: #ffffff; border-color: #0F6C73; }
    [data-theme="focus"] .t-export-btn { background: #FBF8F3; color: #3A3530; border: 1px solid #C8C2B8; }
    [data-theme="focus"] .t-export-btn:hover { background: #EDE9E3; }
    [data-theme="focus"] .t-error    { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; }
    [data-theme="focus"] .t-disclaimer-box { background: #fef9ed; border: 1px solid #e8c97a; color: #6b4a1a; }
    [data-theme="focus"] .t-check-label { color: #1F2933; }
    [data-theme="focus"] .t-bar-track { background: #E2DDD6; }

    /* ── Theme: Dark ────────────────────────────────────── */
    [data-theme="dark"] body        { background: #0f0f0f; color: #f0ede8; }
    [data-theme="dark"] .t-nav      { background: #0a0a0a; border-bottom: 1px solid #1a1a1a; }
    [data-theme="dark"] .t-nav-text { color: #f0ede8; }
    [data-theme="dark"] .t-card     { background: #161616; border: 1px solid #2a2a2a; }
    [data-theme="dark"] .t-input    { background: #111111; border: 1px solid #2a2a2a; color: #f0ede8; }
    [data-theme="dark"] .t-input:focus { border-color: #F5C140; outline: none; box-shadow: 0 0 0 2px rgba(232,168,56,0.2); }
    [data-theme="dark"] .t-muted    { color: #999999; }
    [data-theme="dark"] .t-label    { color: #e8e8e8; }
    [data-theme="dark"] .t-divider  { border-color: #2a2a2a; }
    [data-theme="dark"] .t-results  { background: #111111; border: 1px solid #2a2a2a; }
    [data-theme="dark"] .t-pill     { background: rgba(15,15,15,0.9); color: #f1f5f9; border: 1px solid rgba(232,168,56,0.32); }
    [data-theme="dark"] .t-section-head { color: #F5C140; }
    [data-theme="dark"] .t-toggle-btn { background: #1a1a1a; color: #ccc; border: 1px solid #333; }
    [data-theme="dark"] .t-toggle-btn.active { background: #2a2010; color: #f0ede8; border-color: #F5C140; }
    [data-theme="dark"] .t-btn-primary { background: #1a1a1a; color: #f0ede8; border: 1px solid #F5C140; }
    [data-theme="dark"] .t-btn-primary:hover { background: #222; }
    [data-theme="dark"] .t-mode-btn  { background: #1a1a1a; color: #999; border: 1px solid #333; }
    [data-theme="dark"] .t-mode-btn.active { background: #2a2010; color: #f0ede8; border-color: #F5C140; }
    [data-theme="dark"] .t-export-btn { background: #161616; color: #e0e0e0; border: 1px solid #2a2a2a; }
    [data-theme="dark"] .t-export-btn:hover { background: #1e1e1e; }
    [data-theme="dark"] .t-error    { background: #2d1010; border: 1px solid #7f1d1d; color: #fca5a5; }
    [data-theme="dark"] .t-disclaimer-box { background: #111111; border: 1px solid #2a2a2a; color: #999; }
    [data-theme="dark"] .t-check-label { color: #ccc; }
    [data-theme="dark"] .t-bar-track { background: #2a2a2a; }

    /* ── Theme: Light ───────────────────────────────────── */
    [data-theme="light"] body        { background: #f4f6f8; color: #1a1a1a; }
    [data-theme="light"] .t-nav      { background: #ffffff; border-bottom: 1px solid #dde1e7; }
    [data-theme="light"] .t-nav-text { color: #1a1a1a; }
    [data-theme="light"] .nav-wordmark { fill: #1a1a1a; }
    [data-theme="focus"] .nav-wordmark { fill: #f0ede8; }
    [data-theme="dark"]  .nav-wordmark { fill: #f0ede8; }
    [data-theme="light"] .t-card     { background: #ffffff; border: 1px solid #dde1e7; }
    [data-theme="light"] .t-input    { background: #ffffff; border: 1px solid #dde1e7; color: #1a1a1a; }
    [data-theme="light"] .t-input:focus { border-color: #00897B; outline: none; box-shadow: 0 0 0 2px rgba(0,137,123,0.15); }
    [data-theme="light"] .t-muted    { color: #5a6472; }
    [data-theme="light"] .t-label    { color: #3d4752; }
    [data-theme="light"] .t-divider  { border-color: #dde1e7; }
    [data-theme="light"] .t-results  { background: #ffffff; border: 1px solid #dde1e7; }
    [data-theme="light"] .t-pill     { background: rgba(0,137,123,0.10); color: #00897B; border: 1px solid rgba(0,137,123,0.30); }
    [data-theme="light"] .t-section-head { color: #00897B; }
    [data-theme="light"] .t-toggle-btn { background: #eef1f4; color: #3d4752; border: 1px solid #dde1e7; }
    [data-theme="light"] .t-toggle-btn.active { background: #1a1a1a; color: #ffffff; border-color: #1a1a1a; }
    [data-theme="light"] .t-btn-primary { background: #1a1a1a; color: #ffffff; }
    [data-theme="light"] .t-btn-primary:hover { background: #2d2d2d; }
    [data-theme="light"] .t-mode-btn  { background: #eef1f4; color: #3d4752; border: 1px solid #dde1e7; }
    [data-theme="light"] .t-mode-btn.active { background: #1a1a1a; color: #ffffff; border-color: #1a1a1a; }
    [data-theme="light"] .t-export-btn { background: #eef1f4; color: #3d4752; border: 1px solid #dde1e7; }
    [data-theme="light"] .t-export-btn:hover { background: #dde1e7; }
    [data-theme="light"] .t-error    { background: #fff1f2; border: 1px solid #fecdd3; color: #881337; }
    [data-theme="light"] .t-disclaimer-box { background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; }
    [data-theme="light"] .t-check-label { color: #475569; }
    [data-theme="light"] .t-bar-track { background: #e2e8f0; }

    [data-theme="focus"] .app-site-nav-border { border-color: rgba(255, 255, 255, 0.1); }
    [data-theme="focus"] .app-site-link { color: #8ba6bc; text-decoration: none; font-weight: 500; transition: color 0.15s; }
    [data-theme="focus"] .app-site-link:hover { color: #f1f5f9; }

    [data-theme="dark"] .app-site-nav-border { border-color: rgba(255, 255, 255, 0.08); }
    [data-theme="dark"] .app-site-link { color: #94a3b8; text-decoration: none; font-weight: 500; transition: color 0.15s; }
    [data-theme="dark"] .app-site-link:hover { color: #f1f5f9; }

    [data-theme="light"] .app-site-nav-border { border-color: #e2e8f0; }
    [data-theme="light"] .app-site-link { color: #64748b; text-decoration: none; font-weight: 500; transition: color 0.15s; }
    [data-theme="light"] .app-site-link:hover { color: #0f172a; }

    /* ── Shared structural styles ──────────────────────── */
    .logo-text {
      font-family: 'Courier New', Courier, monospace;
      font-size: 1.1rem;
      font-weight: 700;
      letter-spacing: 0.2em;
      color: #F5C140;
    }

    .score-display {
      font-family: 'Courier New', Courier, monospace;
      font-size: 4rem;
      font-weight: 700;
      line-height: 1;
    }

    .dim-bar-fill {
      height: 100%;
      border-radius: 2px;
      transition: width 0.6s ease;
    }

    .spinner {
      display: inline-block;
      width: 16px;
      height: 16px;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      vertical-align: middle;
      margin-right: 8px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    textarea { resize: vertical; }

    /* ── Info tooltip ───────────────────────────────────── */
    .dim-info-wrap {
      position: relative; display: inline-flex; align-items: center;
    }
    .dim-info-btn {
      display: inline-flex; align-items: center; justify-content: center;
      width: 15px; height: 15px; border-radius: 50%;
      font-size: 11px; font-weight: 700; line-height: 1;
      cursor: pointer; flex-shrink: 0; margin-left: 5px;
      border: 1.5px solid currentColor; opacity: 0.7; transition: opacity 0.15s;
      background: transparent; color: inherit; padding: 0;
    }
    .dim-info-btn:hover, .dim-info-btn:focus { opacity: 1; outline: none; }
    .dim-tooltip {
      visibility: hidden; opacity: 0;
      position: absolute; left: 0; top: calc(100% + 8px);
      z-index: 100; width: 280px; padding: 10px 12px;
      border-radius: 7px; font-size: 12px; line-height: 1.55;
      box-shadow: 0 6px 24px rgba(0,0,0,0.35);
      transition: opacity 0.15s; pointer-events: none;
    }
    [data-theme="focus"] .dim-tooltip { background: #1e2130; color: #d4cfc8; border: 1px solid #3a3f52; }
    [data-theme="dark"]  .dim-tooltip { background: #1a1d27; color: #c8d0e0; border: 1px solid #2a2d3a; }
    [data-theme="light"] .dim-tooltip { background: #1e2130; color: #e2e8f0; border: 1px solid #374151; }
    .dim-info-wrap:hover .dim-tooltip,
    .dim-info-wrap:focus-within .dim-tooltip { visibility: visible; opacity: 1; }

    .dim-label {
      font-size: 0.8rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* ── Signal Overview — compact 2-col grid ─── */
    #dimensions-overview {
      grid-template-columns: 1fr 1fr;
      gap: 4px 16px;
    }
    #dimensions-overview:not(.hidden) { display: grid; }
    /* ── Mobile layout (≤ 640px) ──────────────────────────── */
    @media (max-width: 640px) {
      /* Nav: tighten logo area */
      .t-nav .max-w-6xl { padding-left: 12px; padding-right: 12px; }

      /* Mobile nav links: show as a horizontal strip below the main nav */
      #mobile-nav-strip { display: flex !important; }

      /* Input section: stack vertically on mobile */
      #input-section .flex.gap-2 { flex-direction: column; }
      #input-section input, #input-section textarea { font-size: 16px; } /* prevent iOS zoom */
      #text-input { max-height: 160px; } /* keep checkbox + Analyze button above fold on mobile */

      /* Report card: comfortable side padding on mobile */
      #results-card { padding: 1.25rem 1rem; }

      /* Prose text: bump up for mobile readability — match quality news app sizing */
      .prose-body p {
        font-size: 17px !important;
        line-height: 1.75 !important;
        margin-bottom: 1.2rem !important;
      }
      .dim-analysis-note {
        font-size: 16px !important;
        line-height: 1.75 !important;
      }
      .dim-analysis-note p {
        font-size: 16px !important;
        margin-bottom: 1rem !important;
      }
      /* Section labels on mobile: more breathing room above */
      .sec-header { margin-top: 0.25rem; }
      .t-section-head { font-size: 13px !important; letter-spacing: 0.06em; }
      .intent-detail-label, .sc-detail-label { margin-top: 1.5rem !important; }
      /* Cards need more side margin */
      .t-card { padding: 1rem !important; }

      /* Jump nav: ensure horizontal scroll works */
      #jump-nav { top: 48px; } /* nav is shorter on mobile */

      /* Score display: scale down */
      #score-value { font-size: clamp(3rem, 18vw, 6rem) !important; }

      /* Dimension overview: single column */
      #dimensions-overview { grid-template-columns: 1fr; }

      /* Export bar: wrap on mobile */
      #export-bar { flex-wrap: wrap; gap: 6px; }
      #export-bar button { flex: 1 1 auto; min-width: 80px; }

      /* Source Intelligence: single column on mobile */
      #sec-source .grid { grid-template-columns: 1fr !important; }

      /* Section headers: full-width tap target */
      .sec-header { min-height: 48px; display: flex; align-items: center; width: 100%; }

      /* Settings panel: full-width on mobile, but still hide off-screen when closed */
      #settings-panel { width: 100% !important; max-width: 100% !important; right: -100% !important; left: auto !important; border-radius: 0 0 12px 12px !important; }
      #settings-panel.open { right: 0 !important; }
    }

    /* Mobile nav strip (below main nav, mobile only) */
    #mobile-nav-strip {
      display: none;
      overflow-x: auto;
      scrollbar-width: none;
      padding: 6px 12px;
      gap: 4px;
      border-bottom: 1px solid;
    }
    [data-theme="focus"] #mobile-nav-strip { border-color: #E2DDD6; background: #EDE9E3; }
    [data-theme="dark"]  #mobile-nav-strip { border-color: #2a3040; background: #0d1117; }
    [data-theme="light"] #mobile-nav-strip { border-color: #e2e8f0; background: #f8fafc; }
    #mobile-nav-strip a { color: inherit; text-decoration: none; font-size: 12px; padding: 4px 10px; border-radius: 20px; white-space: nowrap; opacity: 0.65; }
    #mobile-nav-strip a:hover { opacity: 1; }

    @media (max-width: 600px) {
      #dimensions-overview { grid-template-columns: 1fr; }
    }
    .dim-overview-row {
      display: flex;
      align-items: center;
      gap: 8px;
      height: 28px;
    }
    .dim-overview-label {
      width: 140px;
      flex-shrink: 0;
      font-size: 0.82rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .dim-overview-score {
      width: 30px;
      flex-shrink: 0;
      text-align: right;
      font-size: 14px;
      font-family: 'Courier New', Courier, monospace;
      font-weight: 700;
    }
    .dim-overview-track {
      flex: 1;
      height: 8px;
      border-radius: 3px;
      overflow: hidden;
      min-width: 80px;
    }
    .dim-overview-fill {
      height: 100%;
      border-radius: 2px;
      transition: width 0.6s ease;
    }

    /* ── Dimension Analysis ─────────────────────────────── */
    .dim-analysis-item + .dim-analysis-item {
      border-top: 1px solid;
    }
    [data-theme="focus"] .dim-analysis-item + .dim-analysis-item { border-color: #E2DDD6; }
    [data-theme="dark"]  .dim-analysis-item + .dim-analysis-item { border-color: #374151; }
    [data-theme="light"] .dim-analysis-item + .dim-analysis-item { border-color: #e2e8f0; }

    .dim-analysis-name {
      font-size: 13px;
      font-weight: 700;
    }
    .dim-score-badge {
      font-size: 12px;
      font-weight: 700;
      font-family: 'Courier New', Courier, monospace;
      padding: 2px 8px;
      border-radius: 20px;
      letter-spacing: 0.03em;
      color: #f1f5f9;
    }
    .dim-analysis-note {
      font-size: 15px;
      line-height: 1.75;
      margin-top: 8px;
    }
    .dim-analysis-note p {
      margin-bottom: 0.75rem;
      line-height: 1.75;
    }
    .dim-analysis-note p:last-child { margin-bottom: 0; }

    /* ── Global prose typography ────────────────────── */
    .prose-body p {
      line-height: 1.8;
      margin-bottom: 1.25rem;
      font-size: 16px;   /* desktop base */
    }
    .prose-body p:last-child { margin-bottom: 0; }

    /* Body text line length constraint — improves readability dramatically */
    .sec-body p, .sec-body li, .dim-analysis-note p, .t-card p, .prose-body p {
      max-width: 680px;
    }

    .t-card p { line-height: 1.75; font-size: 16px; margin-bottom: 1rem; }
    .t-card p:last-child { margin-bottom: 0; }

    /* Sub-labels (TRANSPARENCY, DESTINATION, etc.) — need visual breathing room */
    .intent-detail-label, .sc-detail-label {
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      margin-top: 1.25rem;
      margin-bottom: 0.35rem;
      opacity: 1.0;
      display: block;
    }
    .intent-detail-label:first-child, .sc-detail-label:first-child { margin-top: 0; }

    /* Sub-heading labels (TRANSPARENCY, DESTINATION etc.) — teal accent matching section heads */
    .t-label.text-xs.uppercase.tracking-wide.font-semibold {
      opacity: 1;
    }
    [data-theme="focus"] .t-label.text-xs.uppercase.tracking-wide { color: #5B6672 !important; }
    [data-theme="dark"]  .t-label.text-xs.uppercase.tracking-wide { color: #5dd0d8 !important; }
    [data-theme="light"] .t-label.text-xs.uppercase.tracking-wide { color: #0f766e !important; }

    .t-card .t-muted.text-xs.font-semibold { font-size: 12px !important; margin-bottom: 4px; }

    /* ── Weight badges ──────────────────────────────────── */
    .dim-weight-badge {
      font-size: 11px;
      font-weight: 600;
      padding: 1px 6px;
      border-radius: 20px;
      letter-spacing: 0.02em;
      white-space: nowrap;
      flex-shrink: 0;
      vertical-align: middle;
    }
    .weight-1-5 {
      background: color-mix(in srgb, #b45309 22%, transparent);
      color: #f1f5f9;
      border: 1px solid rgba(180, 83, 9, 0.45);
    }
    .weight-1-25 {
      background: color-mix(in srgb, #6366f1 22%, transparent);
      color: #f1f5f9;
      border: 1px solid rgba(99, 102, 241, 0.42);
    }
    /* Focus theme: solid weight badges — readable on warm neutral surface */
    [data-theme="focus"] .weight-1-5  { background: #B7791F; color: #ffffff; border: 1px solid #9a6518; }
    [data-theme="focus"] .weight-1-25 { background: #6C5B7B; color: #ffffff; border: 1px solid #574863; }
    [data-theme="dark"] .weight-1-5 {
      background: color-mix(in srgb, #f59e0b 20%, transparent);
      color: #f1f5f9;
      border: 1px solid rgba(251, 191, 36, 0.35);
    }
    [data-theme="dark"] .weight-1-25 {
      background: color-mix(in srgb, #818cf8 18%, transparent);
      color: #f1f5f9;
      border: 1px solid rgba(129, 140, 248, 0.35);
    }
    [data-theme="light"] .weight-1-5 {
      background: rgba(30, 41, 59, 0.92);
      color: #f1f5f9;
      border: 1px solid rgba(245, 158, 11, 0.45);
    }
    [data-theme="light"] .weight-1-25 {
      background: rgba(30, 41, 59, 0.92);
      color: #f1f5f9;
      border: 1px solid rgba(129, 140, 248, 0.45);
    }

    /* ── Debate Mode ───────────────────────────────────── */
    .speaker-card {
      border-radius: 8px;
      padding: 20px;
      flex: 1;
      min-width: 280px;
    }
    [data-theme="focus"] .speaker-card { background: #EDE9E3; border: 1px solid #E2DDD6; }
    [data-theme="dark"]  .speaker-card { background: #1c2333; border: 1px solid #374151; }
    [data-theme="light"] .speaker-card { background: #ffffff; border: 1px solid #e2e8f0; }

    .speaker-score {
      font-family: 'Courier New', Courier, monospace;
      font-size: 2.5rem;
      font-weight: 700;
      line-height: 1;
    }

    .comparison-section {
      border-radius: 8px;
      padding: 20px;
    }
    [data-theme="focus"] .comparison-section { background: #EDE9E3; border: 1px solid #E2DDD6; }
    [data-theme="dark"]  .comparison-section { background: #1c2333; border: 1px solid #374151; }
    [data-theme="light"] .comparison-section { background: #ffffff; border: 1px solid #e2e8f0; }

    /* ── Report source header ──────────────────────────── */
    #report-source-header {
      display: none;
      padding: 8px 0 2px 0;
      margin-bottom: -8px;
    }
    #report-source-header.visible { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .report-source-domain {
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.04em;
      opacity: 0.85;
      text-transform: uppercase;
    }
    .report-source-url {
      font-size: 12px;
      opacity: 0.8;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 400px;
    }

    /* ── Share card canvas ──────────────────────────────── */
    #share-canvas { display: none; }

    /* ── Loading micro-content card ───────────────────── */
    #loading-insight {
      display: none;
      margin-top: 16px;
      border-radius: 12px;
      padding: 28px 28px;
      position: relative;
      overflow: hidden;
    }
    [data-theme="focus"] #loading-insight { background: #1a2530; border: 1px solid #2a3a48; }
    [data-theme="dark"]  #loading-insight { background: #0f1117; border: 1px solid #2a3040; }
    [data-theme="light"] #loading-insight { background: #1e293b; border: 1px solid #334155; }
    #loading-insight.visible { display: block; }
    .insight-inner {
      animation: insight-fade-in 1.2s ease forwards;
    }
    @keyframes insight-fade-in {
      0%   { opacity: 0; transform: translateY(8px); }
      20%  { opacity: 1; transform: translateY(0); }
      80%  { opacity: 1; transform: translateY(0); }
      100% { opacity: 1; transform: translateY(0); }
    }
    .insight-badge {
      display: inline-block;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      padding: 4px 12px;
      border-radius: 20px;
      margin-bottom: 14px;
    }
    .insight-name {
      font-size: 22px;
      font-weight: 700;
      margin-bottom: 12px;
      line-height: 1.3;
    }
    .insight-def {
      font-size: 16px;
      line-height: 1.85;
    }
    .insight-footer {
      margin-top: 20px;
      font-size: 11px;
      opacity: 0.4;
      letter-spacing: 0.06em;
    }
    /* All themes use dark card — consistent, always readable */
    #loading-insight .insight-name { color: #e8f4fb; }
    #loading-insight .insight-def  { color: #94b8cc; }
    #loading-insight .insight-footer { color: #94b8cc; }

    /* ── Loading progress bar ─────────────────────────── */
    #analyze-progress {
      height: 3px;
      border-radius: 0 0 4px 4px;
      overflow: hidden;
      position: relative;
      display: none;
    }
    [data-theme="focus"] #analyze-progress { background: rgba(99,102,241,0.15); }
    [data-theme="dark"]  #analyze-progress { background: rgba(99,102,241,0.12); }
    [data-theme="light"] #analyze-progress { background: rgba(99,102,241,0.12); }
    @keyframes progress-fill {
      from { width: 0%; }
      to   { width: 92%; }  /* stop just short of 100% — completes when response arrives */
    }
    #analyze-progress-bar {
      position: absolute;
      top: 0; left: -40%;
      height: 100%;
      width: 0%;
      border-radius: 2px;
      background: #6366f1;
      animation: progress-fill 30s linear forwards;
    }

    /* ── Heat Grid ─────────────────────────────────────── */
    .heat-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
    }
    @media (max-width: 480px) {
      .heat-grid { grid-template-columns: repeat(3, 1fr); }
    }
    .heat-tile {
      border-radius: 6px;
      padding: 10px 8px;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      min-height: 72px;
    }
    .heat-tile-name {
      font-size: 12px;
      font-weight: 600;
      opacity: 0.85;
      line-height: 1.4;
    }
    .heat-tile-score {
      font-family: 'Courier New', Courier, monospace;
      font-size: 1.45rem;
      font-weight: 700;
      line-height: 1;
    }



    /* ── Print stylesheet ──────────────────────────────── */
    @media print {
      /* Hide UI chrome */
      .t-nav, #input-section, #export-bar, .no-print, #settings-overlay, #settings-panel, #loading-insight { display: none !important; }
      #jump-nav { display: none !important; }
      #quick-share-row { display: none !important; }
      #score-mode-wrap { display: none !important; }
      #lang-tier-wrap { display: none !important; }
      .intent-details-toggle { display: none !important; }
      #intent-details-body { display: block !important; }
      .sec-header-right { display: none !important; }

      /* Base styles */
      body { background: white !important; color: #0a1f2e !important; font-size: 11pt; line-height: 1.5; }
      #results-section { border: none !important; box-shadow: none !important; }
      .t-card, .t-results { background: white !important; border: 1px solid #ccc !important; }
      .score-display { color: #0a1f2e !important; }
      .t-muted { color: #555 !important; }

      /* Brand header/footer */
      .pdf-brand-header { display: flex !important; }
      .pdf-brand-footer { display: block !important; }
      #report-source-header.visible { display: flex !important; }

      /* Force all collapsible sections open */
      .sec-collapsed .sec-body { display: block !important; }
      .sec-chevron { display: none !important; }
      .sec-header { cursor: default !important; border-bottom: 1px solid #ccc !important; }
      .sec-header-right { display: none !important; }

      /* ── Page break control ── */
      /* Never break inside a section or card */
      .collapsible-sec { break-inside: avoid; page-break-inside: avoid; }
      .t-card { break-inside: avoid; page-break-inside: avoid; }
      .dim-analysis-item { break-inside: avoid; page-break-inside: avoid; }

      /* Section headers start a new page if they'd otherwise orphan */
      .sec-header { break-after: avoid; page-break-after: avoid; }

      /* Score + Construction always starts fresh */
      #sec-score { break-before: auto; page-break-before: auto; }

      /* Long sections that should break naturally between items */
      .dim-analysis-item + .dim-analysis-item { break-before: auto; }
      #argument-devices-list > div + div { break-before: auto; }
      #ecosystem-cards > div { break-inside: avoid; page-break-inside: avoid; }

      /* Prevent lone headings at bottom of page */
      h1, h2, h3, .t-section-head { break-after: avoid; page-break-after: avoid; orphans: 3; widows: 3; }

      /* Ensure paragraphs don't orphan */
      p { orphans: 3; widows: 3; }

      /* Dimension analysis section — can span pages but items stay together */
      #dimensions-analysis-wrap { break-inside: auto; }
      #dimensions-analysis > div { break-inside: avoid; page-break-inside: avoid; }

      /* Widen bar chart labels in print — more space available */
      .dim-overview-label { width: 160px !important; }
    }
    .pdf-brand-header {
      display: none;
      align-items: center;
      justify-content: space-between;
      padding: 0.75rem 0 1rem 0;
      border-bottom: 2px solid #0a1f2e;
      margin-bottom: 1.5rem;
    }
    .pdf-brand-header .pdf-logo {
      font-size: 1.3rem;
      font-weight: 800;
      letter-spacing: 2px;
      color: #0a1f2e;
      font-family: 'Rockwell','Georgia',serif;
      font-style: italic;
    }
    .pdf-brand-header .pdf-tagline {
      font-size: 0.6rem;
      letter-spacing: 3px;
      color: #4a6072;
      text-transform: uppercase;
    }
    .pdf-brand-header .pdf-meta {
      font-size: 0.65rem;
      color: #6b7280;
      text-align: right;
    }
    .pdf-brand-footer {
      display: none;
      margin-top: 2rem;
      padding-top: 0.75rem;
      border-top: 1px solid #d0dce6;
      font-size: 0.6rem;
      color: #9ca3af;
      text-align: center;
    }

    /* ── Jump Nav — inline inside results card ──────────── */
    #jump-nav {
      display: none;
      overflow-x: auto;
      scrollbar-width: none;
      -ms-overflow-style: none;
      padding: 6px 16px 8px 16px;
      border-bottom: 1px solid;
      /* Sticky: floats just below the main nav, follows scroll */
      position: sticky;
      top: 56px;  /* match main nav height */
      z-index: 40;
    }
    #jump-nav::-webkit-scrollbar { display: none; }
    [data-theme="focus"] #jump-nav { border-color: #1e3a50; background: #0a1f2e; }
    [data-theme="dark"]  #jump-nav { border-color: #374151; background: #0d1117; }
    [data-theme="light"] #jump-nav { border-color: #e2e8f0; background: #ffffff; }
    #jump-nav.visible { display: block; }
    .jump-nav-inner {
      display: flex;
      align-items: center;
      gap: 2px;
      white-space: nowrap;
      min-width: max-content;
    }
    .jump-link {
      font-size: 12px;
      font-weight: 500;
      padding: 8px 10px;
      border-radius: 20px;
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
      user-select: none;
      letter-spacing: 0.02em;
      line-height: 1;
    }
    [data-theme="focus"] .jump-link { color: #a8cfe0; }
    [data-theme="focus"] .jump-link:hover { background: rgba(232,168,56,0.15); color: #F5C140; }
    [data-theme="focus"] .jump-link.active { background: rgba(232,168,56,0.22); color: #F5C140; font-weight: 700; }
    [data-theme="dark"]  .jump-link { color: #94a3b8; }
    [data-theme="dark"]  .jump-link:hover { background: rgba(232,168,56,0.1); color: #F5C140; }
    [data-theme="dark"]  .jump-link.active { background: rgba(232,168,56,0.18); color: #F5C140; font-weight: 700; }
    [data-theme="light"] .jump-link { color: #334155; }
    [data-theme="light"] .jump-link:hover { background: #e2e8f0; color: #0f172a; }
    [data-theme="light"] .jump-link.active { background: #e2e8f0; color: #0f172a; font-weight: 700; }

    /* ── Collapsible sections ───────────────────────────── */
    .sec-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      user-select: none;
      padding: 20px 0 8px 0;
      width: 100%;
      transition: opacity 0.15s;
      /* No border-bottom — whitespace separates sections, not lines */
    }
    .sec-header:hover { opacity: 0.8; }
    .sec-header-right {
      display: flex;
      align-items: center;
      gap: 5px;
      flex-shrink: 0;
    }
    .sec-chevron {
      font-size: 11px;
      opacity: 0.5;
      transition: transform 0.2s;
      flex-shrink: 0;
    }
    .sec-collapse-label {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      opacity: 0.35;
    }
    /* Section title text — editorial weight */
    .sec-header .t-section-head {
      font-size: 14px !important;
      font-weight: 700 !important;
      letter-spacing: 0.08em !important;
    }
    .sec-collapsed .sec-chevron { transform: rotate(-90deg); }
    .sec-body { padding-top: 20px; padding-bottom: 12px; }

    /* ── Primary section accent — left border on top-level callouts ── */
    /* sec-score and sec-summary: no left accent border — hierarchy via typography */
    .sec-collapsed .sec-body { display: none; }

    /* ── Settings Panel ─────────────────────────────────── */
    #settings-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 60;
      background: rgba(0,0,0,0.4);
    }
    #settings-overlay.open { display: block; }
    #settings-panel {
      position: fixed;
      top: 0;
      right: -340px;
      width: 320px;
      max-width: 100vw;
      height: 100vh;
      z-index: 61;
      overflow-y: auto;
      transition: right 0.25s ease;
      padding: 24px 20px;
    }
    #settings-panel.open { right: 0; }
    [data-theme="focus"] #settings-panel { background: #0d2336; border-left: 1px solid #1e3a54; color: #c8dde8; }
    [data-theme="dark"]  #settings-panel { background: #0f1117; border-left: 1px solid #2a3040; color: #e2e8f0; }
    [data-theme="light"] #settings-panel { background: #ffffff; border-left: 1px solid #e2e8f0; color: #0f172a; }
    .settings-section-label {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      margin-bottom: 10px;
      margin-top: 20px;
    }
    [data-theme="focus"] .settings-section-label { color: #F5C140; }
    [data-theme="dark"]  .settings-section-label { color: #F5C140; }
    [data-theme="light"] .settings-section-label { color: #475569; }
    .settings-check-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 5px 0;
      font-size: 13px;
      cursor: pointer;
    }
    .settings-check-row input[type="checkbox"] {
      width: 15px;
      height: 15px;
      cursor: pointer;
      flex-shrink: 0;
    }
    .settings-scale-btn {
      padding: 5px 14px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      border: 1px solid transparent;
      transition: background 0.15s;
    }
    [data-theme="focus"] .settings-scale-btn { background: #143044; color: #c8dde8; border-color: #1e4060; }
    [data-theme="focus"] .settings-scale-btn.active { background: #F5C140; color: #0a1f2e; border-color: #F5C140; }
    [data-theme="dark"]  .settings-scale-btn { background: #131720; color: #cbd5e1; border-color: #2a3040; }
    [data-theme="dark"]  .settings-scale-btn.active { background: #F5C140; color: #0a1f2e; border-color: #F5C140; }
    [data-theme="light"] .settings-scale-btn { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
    [data-theme="light"] .settings-scale-btn.active { background: #0f172a; color: #f8fafc; border-color: #0f172a; }
    .settings-gear-btn {
      background: transparent;
      border: none;
      cursor: pointer;
      font-size: 18px;
      line-height: 1;
      padding: 4px 6px;
      border-radius: 6px;
      opacity: 0.7;
      transition: opacity 0.15s, background 0.15s;
      flex-shrink: 0;
      display: flex !important;
      visibility: visible !important;
    }
    .settings-gear-btn:hover { opacity: 1; }
    [data-theme="focus"] .settings-gear-btn { color: #a0bccf; }
    [data-theme="focus"] .settings-gear-btn:hover { background: rgba(232,168,56,0.12); color: #F5C140; }
    [data-theme="dark"]  .settings-gear-btn { color: #7a8fa0; }
    [data-theme="dark"]  .settings-gear-btn:hover { background: rgba(232,168,56,0.1); color: #F5C140; }
    [data-theme="light"] .settings-gear-btn { color: #64748b; }
    [data-theme="light"] .settings-gear-btn:hover { background: #e2e8f0; color: #0f172a; }
    .show-all-btn {
      width: 100%;
      padding: 8px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.05em;
      cursor: pointer;
      border: none;
      margin-bottom: 4px;
    }
    [data-theme="focus"] .show-all-btn { background: #F5C140; color: #0a1f2e; }
    [data-theme="dark"]  .show-all-btn { background: #F5C140; color: #0a1f2e; }
    [data-theme="light"] .show-all-btn { background: #0f172a; color: #f8fafc; }

    /* Analyze-page header wordmark — theme swap (two-img, CSS only, no JS).
       Modifier-only rules (no bare .us-brand-logo) so _hero.html and other
       us-brand-logo imgs are untouched. The [data-theme="light"] overrides are
       (0,2,0) and beat the (0,1,0) base rules on specificity — no !important,
       no source-order dependency. The imgs' inline display:block is removed so
       these rules govern. */
    .us-brand-logo--dark { display: block; }
    .us-brand-logo--light { display: none; }
    [data-theme="light"] .us-brand-logo--dark { display: none; }
    [data-theme="light"] .us-brand-logo--light { display: block; }

    /* Analyze-page header nav buttons (Dashboard, + New Analysis) — gold in
       dark/default, ink (var(--text-muted)) in light to match the adjacent
       Methodology/Pricing links. The light rule is (0,2,0) and beats the base
       (0,1,0) and the dark/light import clobber — no !important. */
    .us-nav-btn { border: 1px solid var(--accent); color: var(--accent); }
    [data-theme="light"] .us-nav-btn { border-color: var(--text-muted); color: var(--text-muted); }

    /* Analyze-page header primary CTA (New Analysis) — solid gold, ported from
       undersignal.css .nav-cta (this page does not load that sheet). Literal
       #F5C140/#0f0f0f (NOT var(--accent), which is #D4A032 dark / #A8761A light)
       so it reads identically in light and dark and matches the doc + dashboard
       nav CTAs. Theme-independent on purpose. */
    .us-cta-primary {
      background: #F5C140;
      color: #0f0f0f;
      padding: 0.5rem 1.25rem;
      border-radius: 0.375rem;
      font-weight: 700;
      font-size: 0.875rem;
      border: none;
      cursor: pointer;
      font-family: var(--font-body);
      text-decoration: none;
      white-space: nowrap;
      transition: opacity 0.15s;
    }
    .us-cta-primary:hover { opacity: 0.88; }

    @media print {
      #jump-nav, #settings-overlay, #settings-panel { display: none !important; }
      #tier-switcher, #upgrade-banner, #sub-cta-card, #report-counter-wrap, #report-warning-bar { display: none !important; }
      /* Force argument devices and cognitive bias sections visible in print */
      #argument-devices-wrap, #cognitive-biases-wrap { display: block !important; }
    }

    /* ── Tier Gate Overlay ──────────────────────────────────── */
    .tier-gate {
      position: relative;
    }
    .tier-gate-blur {
      filter: blur(4px);
      user-select: none;
      pointer-events: none;
    }
    .tier-gate-overlay {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 10;
      border-radius: 8px;
      text-align: center;
      gap: 12px;
      padding: 24px;
    }
    [data-theme="focus"] .tier-gate-overlay { background: rgba(248,250,253,0.92); }
    [data-theme="dark"]  .tier-gate-overlay { background: rgba(28,35,51,0.92); }
    [data-theme="light"] .tier-gate-overlay { background: rgba(255,255,255,0.92); }

    /* ── Upgrade Banner ─────────────────────────────────────── */
    #upgrade-banner {
      background: #0891a2;
      color: white;
      padding: 10px 20px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 16px;
    }

    /* ── Report Counter Badge ───────────────────────────────── */
    #report-counter {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      padding: 4px 10px;
      border-radius: 20px;
      opacity: 0.8;
    }
    [data-theme="focus"] #report-counter { background: #e0ecf4; color: #0a1f2e; }
    [data-theme="dark"]  #report-counter { background: #1c2333; color: #a0aec0; }
    [data-theme="light"] #report-counter { background: #f1f5f9; color: #334155; }

    /* ── Deep Reads Pill (Analyst) ──────────────────────────── */
    #deep-reads-pill {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.04em;
      padding: 4px 10px;
      border-radius: 20px;
      background: rgba(232,168,56,0.12);
      color: #F5C140;
      border: 1px solid rgba(0,200,212,0.28);
      white-space: nowrap;
      cursor: pointer;
      text-decoration: none;
    }
    #deep-reads-pill:hover {
      background: rgba(232,168,56,0.2);
      border-color: rgba(0,200,212,0.5);
    }

    /* ── Go Deep Button (Analyst) ───────────────────────────── */
    .go-deep-btn {
      background: rgba(232,168,56,0.1);
      color: #F5C140;
      border: 1px solid rgba(0,200,212,0.28);
      border-radius: 6px;
      padding: 3px 10px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      margin-right: 6px;
      transition: background 0.15s;
      white-space: nowrap;
    }
    .go-deep-btn:hover { background: rgba(232,168,56,0.2); }
    .go-deep-btn:disabled { cursor: default; }

    /* ── Admin Tier Switcher ────────────────────────────────── */
    #tier-switcher {
      position: fixed;
      bottom: 16px;
      left: 16px;
      z-index: 999;
      background: #0a1f2e;
      border: 1px solid #F5C140;
      border-radius: 8px;
      padding: 8px 12px;
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 11px;
      color: #a0aec0;
    }
    #tier-switcher button {
      padding: 4px 10px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      border: 1px solid transparent;
      background: transparent;
      color: #a0aec0;
      transition: background 0.15s, color 0.15s;
    }
    #tier-switcher button:hover { background: rgba(232,168,56,0.15); color: #F5C140; }
    #tier-switcher button.active { background: #F5C140; color: #0a1f2e; border-color: #F5C140; }
  #idx-mob-menu.open { display: flex !important; }
  @media (min-width: 641px) { #idx-mob-toggle { display: none !important; } #idx-mob-menu { display: none !important; } }
