    /* Reset for <button> elements used in place of <span>/<div> click targets (a11y issue #9). */
    /* Placed at top so existing class rules (.sort-opt, .seg-opt, etc.) override the reset. */
    .as-link-btn { background: none; border: none; font: inherit; color: inherit; cursor: pointer; padding: 0; margin: 0; text-align: inherit; line-height: inherit; display: inline; }
    /* Keyboard-visible focus indicator on otherwise-invisible link buttons.
       :focus-visible only fires for keyboard/tab navigation — mouse clicks
       skip it so we don't get a persistent ring after every click. */
    .as-link-btn:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 2px; border-radius: 3px; }

    :root {
      --teal-deep: #0F6E56;
      --teal-bright: #1DC89A;
      --teal-bright-hover: #22dba9;
      --teal-light: #5ee8b8;
      --on-accent: #000;
      --bg: #0a0f1a;
      --surface: #111827;
      --surface2: #1a2332;
      --border: #1f2d3d;
      --text: #e8edf5;
      --text-secondary: #aab8c8;
      --text-muted: #8899aa;
      --error: #ef4444;
      --warning: #f59e0b;
      /* Semantic accents — reserved for meaning, not decoration */
      --sem-for: #60a5fa;          /* debate "for" side, reasoning/search badges */
      --sem-against: #be123c;      /* debate "against" side — burgundy, deliberately distinct from --error alarm red */
      --sem-draw: #818cf8;         /* debate draw, debate badge */
      --sem-factcheck: #a78bfa;    /* factcheck badge, reasoning badge */
      --sem-write: #f472b6;        /* write badge */
      --sem-role: #c8a84a;         /* chair / member role */
      --sem-private: #8ba7fa;      /* private badge */
      /* Verdict ladder (true → false) */
      --verdict-true: #22c55e;
      --verdict-mostly-true: #84cc16;
      --verdict-mixed: #f0c040;
      --verdict-mostly-false: #f97316;
      --verdict-false: var(--error);
      --radius: 10px;
      color-scheme: dark;
    }
    /* ── Consensise palette (editorial mono) ──
       Overrides the dark-theme defaults. Body text reads near-white on
       near-black for maximum legibility; indigo is kept only as an accent
       (wordmark gradient, buttons, badges, progress). Variable names keep
       the `--teal-*` prefix for compatibility with existing rules. */
    :root[data-product="consensise"],
    body[data-product="consensise"] {
      --teal-deep:           #6366f1;       /* indigo-500 — gradient end (accent only) */
      --teal-bright:         #818cf8;       /* indigo-400 — primary accent */
      --teal-bright-hover:   #a5b4fc;       /* indigo-300 */
      --teal-light:          #c7d2fe;       /* indigo-200 */
      --on-accent:           #ffffff;       /* white text on indigo */
      --bg:                  #0a0a0a;       /* near-black — softer than pure #000 */
      --surface:             #141414;       /* card / panel */
      --surface2:            #1c1c1c;       /* input / sub-panel */
      --border:              #2a2a2a;
      --text:                #f0f0f0;
      --text-secondary:      #b0b0b0;
      --text-muted:          #808080;
    }

    /* Light theme — Financial Times palette (FT Pink #FFF1E5) */
    :root[data-theme="light"] {
      /* Light mode uses FT claret as the single accent, replacing teal */
      --teal-deep: #7a0c31;
      --teal-bright: #990F3D;       /* FT claret */
      --teal-bright-hover: #7a0c31;
      --teal-light: #b81347;
      --on-accent: #FFF1E5;
      --bg: #FFF1E5;          /* FT Pink */
      --surface: #FFF9F2;     /* lighter paper */
      --surface2: #F2E5D5;    /* FT Pink darker — panels, inputs */
      --border: #E6D9C9;      /* FT rule */
      --text: #33302E;        /* FT body */
      --text-secondary: #66605C;
      --text-muted: #807973;
      --error: #cc0000;
      --warning: #b8860b;
      --sem-for: #1d4ed8;
      --sem-against: #990f3d;  /* FT claret */
      --sem-draw: #4f46e5;
      --sem-factcheck: #7c3aed;
      --sem-write: #c026d3;
      --sem-role: #8b6914;
      --sem-private: #3b5bdb;
      --verdict-true: #0a7a3b;
      --verdict-mostly-true: #5c8a00;
      --verdict-mixed: #b8860b;
      --verdict-mostly-false: #d97706;
      color-scheme: light;
    }
    /* Consensise light-mode override — editorial mono, indigo accent only. */
    :root[data-theme="light"][data-product="consensise"],
    :root[data-theme="light"] body[data-product="consensise"] {
      --teal-deep:           #4338ca;       /* indigo-700 — gradient end (accent only) */
      --teal-bright:         #4f46e5;       /* indigo-600 — primary accent */
      --teal-bright-hover:   #4338ca;       /* indigo-700 */
      --teal-light:          #6366f1;       /* indigo-500 */
      --on-accent:           #ffffff;
      --bg:                  #fafafa;       /* off-white */
      --surface:             #ffffff;
      --surface2:            #f0f0f0;       /* neutral panel */
      --border:              #e5e5e5;
      --text:                #0a0a0a;
      --text-secondary:      #525252;
      --text-muted:          #737373;
      --sem-against:         #4f46e5;       /* mirror accent for the "against" semantic */
    }
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html, body { height: 100%; }
    body {
      font-family: 'Outfit', sans-serif;
      font-variant-numeric: tabular-nums;
      background: var(--bg);
      color: var(--text);
      line-height: 1.6;
      min-height: 100vh;
      visibility: hidden;
    }
    body.ready { visibility: visible; }
    h1, h2, h3 { font-family: 'DM Serif Display', serif; }
    label, .label { font-family: 'Outfit', sans-serif; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
    /* Editorial kickers: any converted-from-mono class that uses uppercase + tracking inherits a semibold weight for legibility */
    .section-title, .auth-tab, .theme-opt, .account-plan, .result-q-label, .featured-q-label, .featured-q-free,
    .model-role-label, .modal-option-label, .dispatch-model-name, .review-agreement, .review-section h4, .review-card-header,
    .live-debate-rounds-title, .live-round-label, .live-round-side-label, .live-consensus-title,
    .debate-winner-label, .debate-chair-section h4, .debate-round-header, .debate-side-label, .debate-contrib-name, .debate-winner-badge,
    .community-type-tag, .history-badge, .team-member-badge,
    .transcript-turn-label, .transcript-section-label, .transcript-prompt-role, .transcript-response-label, .transcript-json-section,
    .conv-debate-round-label, .related-type-label, .length-custom-input .length-unit { font-weight: 600; }

    /* ── Layout ── */
    .screen { display: none; min-height: 100vh; padding: 2rem 1rem; }
    .screen.active { display: flex; flex-direction: column; align-items: center; }
    .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 640px; }

    /* ── Logo ── */
    .logo { text-align: center; margin-bottom: 2rem; }
    .logo h1 { font-size: 2rem; background: linear-gradient(135deg, var(--teal-bright), var(--teal-deep)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
    .logo p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }

    /* ── Forms ── */
    .form-group { margin-bottom: 1.25rem; }
    .form-group label { display: block; margin-bottom: 0.4rem; }
    input[type="text"], input[type="email"], input[type="password"], textarea, select {
      width: 100%; padding: 0.75rem 1rem;
      background: var(--surface2); border: 1px solid var(--border);
      border-radius: var(--radius); color: var(--text);
      font-family: 'Outfit', sans-serif; font-size: 1rem;
      outline: none; transition: border-color 0.2s;
    }
    input:focus, textarea:focus, select:focus { border-color: var(--teal-bright); }
    textarea { resize: vertical; min-height: 120px; }
    select option { background: var(--surface2); }

    /* ── Buttons ── */
    .btn {
      display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
      padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius);
      font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 500;
      cursor: pointer; transition: all 0.2s; text-decoration: none;
    }
    .btn-primary { background: var(--teal-bright); color: var(--on-accent); }
    .btn-primary:hover { background: var(--teal-bright-hover); }
    .btn-primary:disabled { background: var(--teal-deep); color: var(--text-muted); cursor: not-allowed; opacity: 0.6; }
    .btn-ghost { background: transparent; color: var(--teal-bright); border: 1px solid var(--teal-deep); }
    .btn-ghost:hover { background: var(--teal-deep); color: var(--text); }
    .btn-full { width: 100%; }

    /* ── Auth screen ── */
    .auth-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
    .auth-tab { display: block; flex: 1; padding: 0.6rem; text-align: center; cursor: pointer; font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-secondary); background: var(--surface2); transition: all 0.2s; }
    .auth-tab.active { background: var(--teal-deep); color: var(--text); }
    .auth-error { color: var(--error); font-size: 0.9rem; margin-bottom: 0.75rem; display: none; }

    /* ── Field validation hints ── */
    .field-hint { font-family: 'Outfit', sans-serif; font-size: 0.7rem; margin-top: 0.3rem; min-height: 1em; transition: color 0.2s; color: transparent; line-height: 1.4; }
    .field-hint.error { color: var(--error); }
    .field-hint.ok { color: var(--teal-bright); }
    .field-hint.muted { color: var(--text-muted); }
    input.input-error { border-color: var(--error) !important; }
    input.input-ok { border-color: var(--teal-bright) !important; }
    .auth-link { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }
    .auth-link span { color: var(--teal-bright); cursor: pointer; }
    .btn-social-login { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface2); color: var(--text); font-size: 0.9rem; font-family: 'Outfit', sans-serif; cursor: pointer; transition: all 0.2s; margin-bottom: 0.6rem; text-align: left; }
    .btn-social-login:hover { border-color: var(--teal-bright); background: color-mix(in srgb, var(--teal-bright) 5%, transparent); }
    .btn-social-login svg { flex-shrink: 0; }
    .auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 0.5rem 0 1.25rem; }
    .auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
    .auth-divider span { color: var(--text-secondary); font-family: 'Outfit', sans-serif; font-size: 0.7rem; }

    /* ── Account screen ── */
    .account-wrap { width: 100%; max-width: 800px; }
    .account-wrap h2 { font-family: 'DM Serif Display', serif; font-size: 1.4rem; margin-bottom: 1.5rem; }
    .account-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
    .account-header h2 { margin-bottom: 0; }
    .account-signout { padding: 0.4rem 0.9rem; font-size: 0.85rem; flex-shrink: 0; }
    .account-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1rem; font-size: 1rem; }
    .theme-switch { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
    .theme-opt { flex: 1; padding: 0.6rem; background: var(--surface2); color: var(--text-secondary); font-family: 'Outfit', sans-serif; font-size: 0.75rem; border: none; cursor: pointer; transition: all 0.2s; }
    .theme-opt + .theme-opt { border-left: 1px solid var(--border); }
    .theme-opt:hover { color: var(--text); }
    .theme-opt.active { background: var(--teal-deep); color: #fff; }
    :root[data-theme="light"] .theme-opt.active { background: #33302E; color: #FFF1E5; }
    /* Ensure accent-on-accent text stays legible in light mode (claret bg needs pink text) */
    :root[data-theme="light"] .btn-ghost:hover,
    :root[data-theme="light"] .auth-tab.active { color: #FFF1E5; }
    /* Preset segmented buttons: override hardcoded teal rgba with claret tint in light mode */
    :root[data-theme="light"] .preset-seg-opt.active { background: color-mix(in srgb, var(--teal-bright) 10%, transparent); color: var(--teal-bright); }
    :root[data-theme="light"] .preset-seg-opt.active:hover { background: color-mix(in srgb, var(--teal-bright) 16%, transparent); }
    /* Light mode: replace hardcoded teal rgba backgrounds with claret tints */
    :root[data-theme="light"] .btn-mode { background: color-mix(in srgb, var(--teal-bright) 6%, transparent); border-color: color-mix(in srgb, var(--teal-bright) 45%, transparent); }
    :root[data-theme="light"] .btn-mode:hover { background: color-mix(in srgb, var(--teal-bright) 14%, transparent); border-color: var(--teal-bright); }
    :root[data-theme="light"] .seg-opt.active { background: color-mix(in srgb, var(--teal-bright) 10%, transparent); }
    :root[data-theme="light"] .seg-opt.active:hover { background: color-mix(in srgb, var(--teal-bright) 16%, transparent); }
    :root[data-theme="light"] .model-card.selected { background: color-mix(in srgb, var(--teal-bright) 6%, transparent); }
    :root[data-theme="light"] .model-pill { background: color-mix(in srgb, var(--teal-bright) 8%, transparent); border-color: color-mix(in srgb, var(--teal-bright) 25%, transparent); }
    :root[data-theme="light"] .model-query-status.status-querying,
    :root[data-theme="light"] .model-query-status.status-done { background: color-mix(in srgb, var(--teal-bright) 10%, transparent); }
    :root[data-theme="light"] .cap-btn:hover { background: color-mix(in srgb, var(--teal-bright) 6%, transparent); }
    :root[data-theme="light"] .btn-social-login:hover { background: color-mix(in srgb, var(--teal-bright) 4%, transparent); }
    :root[data-theme="light"] .live-consensus-block { background: color-mix(in srgb, var(--teal-bright) 4%, transparent); }
    :root[data-theme="light"] .live-consensus-item { border-bottom-color: color-mix(in srgb, var(--teal-bright) 10%, transparent); }
    :root[data-theme="light"] .live-status-agrees { background: color-mix(in srgb, var(--teal-bright) 10%, transparent); }
    :root[data-theme="light"] .verdict-card { background: linear-gradient(135deg, color-mix(in srgb, var(--teal-bright) 12%, transparent), color-mix(in srgb, var(--teal-bright) 4%, transparent)); }
    :root[data-theme="light"] .source-consensus { background: color-mix(in srgb, var(--teal-bright) 10%, transparent); }
    :root[data-theme="light"] .source-discussion_resolved { background: color-mix(in srgb, var(--teal-bright) 8%, transparent); }
    :root[data-theme="light"] .bill-save { background: color-mix(in srgb, var(--teal-bright) 10%, transparent); }
    /* Light mode: replace hardcoded rgba(0,0,0,0.2) sunken wells (designed for dark bg) with a warm pink tint */
    :root[data-theme="light"] .transcript-prompt-block,
    :root[data-theme="light"] .transcript-json-raw,
    :root[data-theme="light"] .model-query-prompt { background: rgba(102, 51, 0, 0.06); }
    .account-section .section-title { margin-bottom: 1rem; }
    .acct-info-text { font-size: 0.9rem; color: var(--text); padding: 0.55rem 0.75rem; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); min-height: 2.4rem; }
    .account-plan { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); }
    .account-stats { display: flex; flex-direction: column; gap: 0.75rem; }
    .account-stat { background: var(--surface2); border-radius: calc(var(--radius) - 2px); padding: 0.875rem; }
    .account-stat-val { font-size: 1.1rem; font-weight: 600; color: var(--teal-bright); margin-bottom: 0.15rem; }
    .account-stat-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); }
    .account-stat-sub { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); opacity: 0.7; margin-top: 0.25rem; }
    .account-stat-bonus { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); opacity: 0.8; margin-top: 0.2rem; }
    .team-invite-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
    .team-invite-row input { flex: 1; }
    .team-member-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-top: 1px solid var(--border); }
    .team-member-row:first-child { border-top: none; }
    .team-member-info { flex: 1; min-width: 0; }
    .team-member-name { font-size: 0.9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .team-member-email { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .team-member-badge { font-family: 'Outfit', sans-serif; font-size: 0.7rem; padding: 0.15rem 0.4rem; border-radius: 4px; background: var(--surface2); color: var(--text-muted); flex-shrink: 0; }
    .team-member-badge.owner { color: var(--teal-bright); background: rgba(0,200,170,0.08); }
    .team-member-badge.pending { color: var(--warning); background: rgba(234,179,8,0.08); }
    .team-cap-wrap { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
    .team-cap-wrap .cap-spinner { height: 32px; }
    .team-cap-wrap .cap-btn { padding: 0 0.6rem; font-size: 1rem; }
    .team-cap-wrap .cap-val { min-width: 3.5rem; font-size: 0.8rem; }
    .team-cap-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); }
    .oauth-row { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
    .oauth-row:last-child { border-bottom: none; }
    .oauth-provider { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
    .oauth-email { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); }
    .oauth-badge { display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; font-family: 'Outfit', sans-serif; font-size: 0.75rem; font-weight: 700; color: #fff; flex-shrink: 0; background: var(--text-muted); }
    .oauth-badge-google   { background: #4285F4; }
    .oauth-badge-facebook { background: #1877F2; }
    .oauth-badge-apple    { background: #000; }
    .acct-error { color: var(--error); font-size: 0.8rem; margin-bottom: 0.75rem; display: none; }
    .acct-success { color: var(--teal-bright); font-size: 0.8rem; margin-bottom: 0.75rem; display: none; }
    .account-danger { border-color: rgba(239,68,68,0.25); }
    .account-danger .section-title { color: var(--error); }
    .btn-danger { background: transparent; border: 1px solid var(--error); color: var(--error); padding: 0.6rem 1.25rem; border-radius: var(--radius); cursor: pointer; font-family: 'Outfit', sans-serif; font-size: 0.9rem; transition: all 0.2s; }
    .btn-danger:hover { background: var(--error); color: #fff; }


    /* ── Site footer ── */
    /* .site-footer removed — legal + info links now live only inside the
       (?) help modal. Consent is captured at the auth screen. */

    /* ── Setup screen ── */
    .setup-wrap { width: 100%; max-width: 800px; }
    .section-title { font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }
    .acct-collapse-btn { cursor: pointer; user-select: none; display: block; width: 100%; text-align: left; }
    .acct-collapse-btn .section-toggle-icon { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); }
    /* Unified Account & Security card: sub-sections stacked without dividers */
    .acct-subsection { padding: 0.4rem 0; }
    .acct-subsection-title { font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
    .acct-subsection-header { font-family: 'Outfit', sans-serif; font-size: 0.9rem; color: var(--text-primary); font-weight: 500; margin-bottom: 0; padding: 0.25rem 0; }
    .models-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-bottom: 0.6rem; }
    .models-grid--6 { grid-template-columns: repeat(3, 1fr); }
    .model-card {
      background: var(--surface2); border: 2px solid var(--border);
      border-radius: var(--radius); padding: 0.875rem;
      cursor: pointer; transition: all 0.2s; position: relative;
    }
    .model-card:hover { border-color: var(--teal-deep); }
    .model-card.selected { border-color: var(--teal-bright); background: color-mix(in srgb, var(--teal-bright) 8%, transparent); }
    .model-card .model-name { font-weight: 500; font-size: 0.9rem; }
    .model-card .model-provider { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }
    .model-card .model-badge { font-family: 'Outfit', sans-serif; font-size: 0.7rem; margin-top: 0.3rem; }
    .badge-recommended { color: var(--teal-bright); }
    .badge-reasoning { color: var(--sem-factcheck); }
    .badge-search { color: var(--sem-for); }
    .badge-premium { color: var(--warning); }
    .model-card.premium-locked { opacity: 0.6; cursor: default; }
    .model-card.premium-locked:hover { border-color: var(--border); }
    .premium-warning { display: none; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.35); border-radius: var(--radius); padding: 0.65rem 0.9rem; font-size: 0.8rem; color: var(--warning); margin-bottom: 0.75rem; }
    /* ── Model tier UI ── */
    /* ── Model config form ── */
    .model-auto-info { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
    .model-auto-label { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
    .model-auto-names { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); }
    .model-assign-toggle { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; }
    .model-assign-toggle-label { font-size: 0.9rem; color: var(--text-muted); transition: color 0.15s; }
    .preset-seg { display: flex; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; background: var(--surface2); flex: 1; }
    .preset-seg-opt { flex: 1; padding: 0.3rem 0; text-align: center; font-family: 'Outfit', sans-serif; font-size: 0.8rem; cursor: pointer; color: var(--text-muted); transition: all 0.2s; white-space: nowrap; user-select: none; }
    .preset-seg-opt:hover:not(.disabled) { color: var(--text); }
    .preset-seg-opt.active { background: color-mix(in srgb, var(--teal-bright) 14%, transparent); color: var(--teal-bright); }
    .preset-seg-opt.active:hover { background: color-mix(in srgb, var(--teal-bright) 22%, transparent); }
    .preset-seg-opt.disabled { opacity: 0.3; cursor: not-allowed; }
    .preset-seg-opt.locked { opacity: 0.45; cursor: pointer; }
    .preset-seg-opt.locked:hover { opacity: 0.75; color: var(--text); }
    .preset-seg-opt.locked::after { content: " 🔒"; font-size: 0.65rem; opacity: 0.7; }
    .preset-seg-opt.guest-locked { opacity: 0.55; cursor: pointer; }
    .preset-seg-opt.guest-locked:hover { color: var(--text); opacity: 0.8; }
    .model-assign-toggle-label.active { color: var(--text); font-weight: 500; }
    .model-assign-desc { font-size: 0.7rem; color: var(--text-muted); font-family: 'Outfit', sans-serif; margin: 0 0 0.85rem; line-height: 1.4; }
    .settings-label { position: relative; }
    .info-btn { background: none; border: none; padding: 0; margin-left: 0.25rem; cursor: pointer; color: var(--text-muted); font-size: 0.72rem; line-height: 1; vertical-align: middle; transition: color 0.15s; }
    .info-btn:hover { color: var(--text); }
    #config-info-modal-body { font-family: 'Outfit', sans-serif; line-height: 1.7; }
    #config-info-modal-body strong { color: var(--text); font-weight: 600; }
    #config-info-modal-body .config-info-row { display: flex; gap: 0.5rem; margin-bottom: 0.3rem; }
    #config-info-modal-body .config-info-row:last-child { margin-bottom: 0; }
    #config-info-modal-body .config-info-name { color: var(--text); font-weight: 600; min-width: 4.5rem; flex-shrink: 0; }
    #config-info-modal-body .config-info-desc { flex: 1; }
    #config-info-modal-body .config-info-locked { opacity: 0.45; }
    .model-roles-grid { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.6rem 0.75rem; align-items: start; }
    .model-role-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); padding-top: 0.55rem; }
    .model-role-controls { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
    .model-role-controls select { width: 100%; font-size: 0.9rem; padding: 0.4rem 0.6rem; }
    .model-picker-btn { width: 100%; padding: 0.4rem 0.65rem; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); cursor: pointer; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; font-family: inherit; transition: border-color 0.15s; }
    .model-picker-btn:hover { border-color: var(--teal-bright); }
    .model-picker-btn-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .model-picker-btn-text.placeholder { color: var(--text-muted); }
    .model-picker-chevron { color: var(--text-muted); font-size: 0.7rem; flex-shrink: 0; }
    #model-picker { position: fixed; z-index: 10000; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.4); display: none; flex-direction: column; max-height: 55vh; }
    #model-picker.open { display: flex; }
    .model-picker-search-wrap { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
    .model-picker-search { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 0.3rem 0.5rem; font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text); outline: none; box-sizing: border-box; }
    .model-picker-search:focus { border-color: var(--teal-bright); }
    .model-picker-list { overflow-y: auto; padding: 0.3rem 0; }
    .model-picker-item { padding: 0.4rem 0.75rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
    .model-picker-item:hover { background: var(--surface2); }
    .model-picker-item-name { font-size: 0.9rem; color: var(--text); }
    .model-picker-item-provider { font-size: 0.7rem; color: var(--text-muted); font-family: 'Outfit', sans-serif; white-space: nowrap; }
    .model-picker-empty { padding: 0.5rem 0.75rem; font-size: 0.8rem; color: var(--text-muted); font-family: 'Outfit', sans-serif; }
    .model-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
    .model-pill { display: inline-flex; align-items: center; gap: 0.3rem; background: color-mix(in srgb, var(--teal-bright) 10%, transparent); border: 1px solid color-mix(in srgb, var(--teal-bright) 30%, transparent); border-radius: 5px; padding: 0.25rem 0.5rem 0.25rem 0.6rem; font-size: 0.9rem; color: var(--teal-bright); }
    .model-pill-x { background: none; border: none; color: var(--teal-bright); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; opacity: 0.7; }
    .model-pill-x:hover { opacity: 1; }
    .model-queries-grid { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
    .model-query-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.75rem; }
    .model-query-header { display: flex; align-items: center; gap: 0.5rem; }
    .model-query-name { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); }
    .model-query-status { font-family: 'Outfit', sans-serif; font-size: 0.7rem; padding: 0.15rem 0.4rem; border-radius: 4px; white-space: nowrap; }
    .model-query-status.status-waiting { color: var(--text-muted); }
    .model-query-status.status-querying { background: color-mix(in srgb, var(--teal-bright) 15%, transparent); color: var(--teal-bright); }
    .model-query-status.status-done { background: color-mix(in srgb, var(--teal-bright) 15%, transparent); color: var(--teal-bright); }
    .model-query-preview { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; display: none; padding-left: 0.875rem; border-left: 2px solid var(--border); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .model-query-prompt { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.4rem; padding: 0.4rem; background: rgba(0,0,0,0.2); border-radius: 4px; white-space: pre-wrap; display: none; max-height: 120px; overflow-y: auto; }
    .btn-copy { background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); padding: 0.4rem 0.85rem; font-size: 0.8rem; border-radius: var(--radius); cursor: pointer; font-family: 'Outfit', sans-serif; transition: all 0.2s; }
    .btn-copy:hover { border-color: var(--teal-bright); color: var(--teal-bright); }
    .result-actions-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
    .result-actions-left { display: flex; align-items: center; gap: 0.4rem; }
    .result-actions-right { display: flex; align-items: center; gap: 0.35rem; }
#native-share-btn { display: none; }
    html.in-app #native-share-btn, html.has-web-share #native-share-btn { display: flex; }
    .share-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-right: 0.15rem; }
    .btn-action-copy { background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); padding: 0.4rem 0.875rem; font-size: 0.8rem; border-radius: var(--radius); cursor: pointer; font-family: 'Outfit', sans-serif; display: flex; align-items: center; gap: 0.4rem; transition: all 0.2s; }
    .btn-action-copy:hover, .btn-action-copy.active { border-color: var(--teal-bright); color: var(--teal-bright); }
    .btn-social { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface2); color: var(--text-muted); cursor: pointer; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; transition: all 0.2s; padding: 0; }
    .btn-social:hover { border-color: var(--teal-bright); color: var(--teal-bright); }
    .result-question { display: block; width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; cursor: pointer; transition: border-color .15s; }
    .result-question:hover { border-color: var(--teal-bright); }
    .result-q-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); display: block; margin-bottom: 0.35rem; }
    .result-question-text { font-size: 1rem; font-weight: 500; color: var(--text); line-height: 1.5; }
    .btn-show-more { background: none; border: none; color: var(--teal-bright); cursor: pointer; font-size: 0.85rem; padding: 0; margin-left: 0.2rem; font-family: inherit; font-weight: 500; }
    .btn-show-more:hover { text-decoration: underline; }
    .model-positions-details { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
    .model-positions-summary { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); cursor: pointer; list-style: none; margin-bottom: 0.5rem; }
    .model-positions-summary::-webkit-details-marker { display: none; }
    .model-positions-summary::before { content: '▸ '; display: inline-block; transition: transform 0.15s; }
    .model-positions-details[open] .model-positions-summary::before { content: '▾ '; }
    .model-check { position: absolute; top: 0.5rem; right: 0.5rem; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 10px; transition: all 0.2s; }
    .model-card.selected .model-check { background: var(--teal-bright); border-color: var(--teal-bright); color: var(--on-accent); }
    /* ── Setup screen v2 (bottom-fixed input + inline mode pill) ───────── */
    /* Old .ask-card styles removed along with the mode-button row. The
       setup screen is now: scrollable .setup-wrap (examples) + fixed .setup-dock.
       Scope to .active so the inherited `.screen { display: none }` still
       hides the screen when another one is showing — otherwise the fixed
       dock bleeds across every screen. */
    /* Inherit align-items:center from .screen.active so the max-width 800px
       topbar stays centered. setup-wrap handles its own max-width + margin. */
    /* Only override what differs from the generic .screen rule — otherwise the
       shorthand wins over `html.in-app .screen { padding-top: 0.5rem }` on
       specificity and setup keeps a 2rem top gap inside the native app. */
    #screen-setup.active { flex-direction: column; padding-bottom: 0; min-height: 100vh; min-height: 100dvh; }
    #screen-setup.active .setup-wrap { flex: 1; width: 100%; max-width: 720px; padding: 0.75rem 0 220px; }
    .setup-examples-wrap { width: 100%; }
    .setup-examples-label { font-family: 'Outfit', sans-serif; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.6rem; padding-left: 0.15rem; }
    .setup-examples { display: flex; flex-direction: column; gap: 0.55rem; }
    .setup-example { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.85rem 1rem; text-align: left; cursor: pointer; width: 100%; font-family: inherit; font-size: 1rem; color: var(--text); line-height: 1.5; transition: border-color 0.15s ease; }
    .setup-example:hover, .setup-example:focus { border-color: var(--teal-bright); outline: none; }
    .setup-example:active { transform: scale(0.99); }

    /* .setup-dock is a body-level fixed element (not a child of any screen).
       It's visible on the setup and results screens only, driven by a
       body.dock-visible class set in showScreen(). Screens that need
       composer access (results follow-up) get the same dock as setup. */
    .setup-dock { display: none; position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); padding: 0.5rem 1rem 0.85rem; border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(0,0,0,0.1); z-index: 60; }
    body.dock-visible .setup-dock { display: block; }
    /* Reserve scroll-clearance at the bottom of the results wrap so long
       results don't sit under the dock. setup-wrap already carries its own
       padding-bottom:220px. */
    body.dock-visible #screen-results .results-wrap { padding-bottom: 220px; }
    .setup-dock-wrap { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.4rem; }

    /* Context strip — shown on the results screen so the user knows the dock
       is in follow-up mode. ✕ breaks the thread and returns to setup. */
    .dock-context-strip { display: flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.5rem; background: color-mix(in srgb, var(--teal-bright) 8%, transparent); border: 1px solid color-mix(in srgb, var(--teal-bright) 20%, transparent); border-radius: 8px; font-family: 'Outfit', sans-serif; font-size: 0.78rem; color: var(--text-secondary); line-height: 1.35; }
    .dock-context-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dock-context-x { flex-shrink: 0; background: transparent; border: 0; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; padding: 0.15rem 0.3rem; border-radius: 4px; line-height: 1; }
    .dock-context-x:hover { color: var(--text); background: color-mix(in srgb, var(--teal-bright) 15%, transparent); }
    /* Row above the input: settings summary (left) + mode pill (right). */
    .setup-config-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
    .setup-config-summary { display: inline-flex; align-items: center; gap: 0.3rem; background: transparent; border: 0; cursor: pointer; font-family: 'Outfit', sans-serif; font-size: 0.85rem; color: var(--text-secondary); padding: 0.3rem 0.6rem; border-radius: 6px; transition: background 0.15s ease; }
    .setup-config-summary:hover { background: var(--surface); color: var(--text); }
    .setup-config-arrow { font-size: 0.6rem; }
    .setup-config-summary[aria-expanded="true"] .setup-config-arrow { transform: rotate(180deg); }
    .setup-config-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.6rem 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
    .setup-config-panel[hidden] { display: none; }
    .setup-config-row { display: flex; align-items: center; gap: 0.5rem; }
    .setup-config-label { width: 5rem; flex-shrink: 0; color: var(--text-muted); font-family: 'Outfit', sans-serif; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
    .setup-config-panel-slot { flex: 1; min-width: 0; }

    /* Subtle fill makes the input-row read as an interactive area without
       drawing a full outline — a light surface background + small radius,
       no border. The rowclass changes on focus-within to highlight the
       accent colour so the user knows they're typing. */
    .setup-input-row { display: flex; align-items: flex-end; gap: 0.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.2rem 0.3rem; transition: border-color 0.15s ease; }
    .setup-input-row:focus-within { border-color: var(--teal-bright); }
    .setup-mode-pill { display: inline-flex; align-items: center; background: color-mix(in srgb, var(--teal-bright) 14%, transparent); color: var(--teal-bright); font-family: 'Outfit', sans-serif; font-size: 0.8rem; font-weight: 600; padding: 0.2rem 0.15rem 0.2rem 0.6rem; border-radius: 10px; flex-shrink: 0; }
    .setup-mode-pill[hidden] { display: none; }
    .setup-mode-pill-x { background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 0.75rem; line-height: 1; padding: 0.1rem 0.4rem; border-radius: 50%; margin-left: 0.15rem; }
    .setup-mode-pill-x:hover { background: color-mix(in srgb, var(--teal-bright) 25%, transparent); }

    /* Dock textarea starts as a single line and auto-grows via JS (see
       wireQuestionTextarea in app.js). min-height here must match one line
       — override the generic `textarea { min-height: 120px }` rule that
       applies globally (.setup-dock is outside #screen-setup, so the
       narrower #screen-setup selector no longer matched). */
    .setup-dock textarea#question { flex: 1; background: transparent; border: 0; outline: none; resize: none; font-family: inherit; font-size: 1.05rem; line-height: 1.45; color: var(--text); min-height: 1.6rem; max-height: 200px; padding: 0.35rem 0.4rem; overflow-y: hidden; display: block; }
    .setup-dock textarea#question::placeholder { color: var(--text-muted); opacity: 0.7; }
    .setup-dock .btn-clear-input { position: static; flex-shrink: 0; align-self: flex-end; background: transparent; border: 0; color: var(--text-muted); cursor: pointer; padding: 0.35rem; border-radius: 4px; margin-bottom: 0.1rem; }
    .setup-dock .btn-clear-input:hover { color: var(--text); }
    .setup-send-btn { background: var(--teal-bright); color: var(--on-accent); border: 0; width: 2.2rem; height: 2.2rem; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; align-self: flex-end; margin: 0.2rem; transition: background 0.15s ease; }
    .setup-send-btn:disabled { opacity: 0.35; cursor: not-allowed; }
    .setup-send-btn:not(:disabled):hover { background: var(--teal-bright-hover); }

    /* Help-circle icon is a regular SVG button — no custom sizing needed. */
    /* ── Featured public questions ── */
    .featured-q-wrap { margin-bottom: 0.75rem; }
    #featured-community-wrap { margin-top: 2.5rem; }
    .featured-q-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
    .featured-q-title { display: flex; align-items: center; gap: 0.5rem; }
    .featured-q-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); }
    .featured-q-free { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); background: color-mix(in srgb, var(--teal-bright) 12%, transparent); border: 1px solid color-mix(in srgb, var(--teal-bright) 30%, transparent); border-radius: 3px; padding: 1px 6px; }
    #guest-nudge-overlay.visible { display: flex; }
    .featured-q-dots { display: flex; gap: 4px; align-items: center; }
    .featured-q-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border); transition: background 0.3s; flex-shrink: 0; }
    .featured-q-dot.active { background: var(--teal-bright); }
    .featured-q-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.875rem 1rem; cursor: pointer; transition: border-color 0.2s; touch-action: pan-y; }
    .featured-q-card:hover { border-color: var(--teal-deep); }
    .featured-q-text { font-size: 0.9rem; color: var(--text); line-height: 1.5; transition: opacity 0.3s; }
    .featured-q-text.fading { opacity: 0; }
    /* ── Pre-processing modal ── */
    .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; overflow-y: auto; }
    /* max-height with dynamic viewport units (dvh) keeps the modal shorter
       than the visible viewport when the iOS keyboard is up — otherwise
       the submit button hides behind the keyboard. Internal scroll keeps
       long forms reachable. */
    .modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.75rem; width: 100%; max-width: 520px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; }
    .modal-title { font-family: 'DM Serif Display', serif; font-size: 1.2rem; margin-bottom: 0.75rem; }
    .modal-body-text { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1.25rem; line-height: 1.6; }
    .modal-actions { display: flex; flex-direction: column; gap: 0.6rem; }
    .modal-actions .btn { justify-content: flex-start; font-size: 0.9rem; }
    .modal-option-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.35rem; }
    .modal-rephrase-text { font-size: 0.9rem; color: var(--text-secondary); background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.875rem; margin-bottom: 0.1rem; font-style: italic; }
    /* ── Mode button style (unified green) ── */
    .btn-mode { background: color-mix(in srgb, var(--teal-bright) 8%, transparent); color: var(--teal-bright); border: 1px solid color-mix(in srgb, var(--teal-bright) 55%, transparent); font-weight: 600; }
    .btn-mode:hover { background: color-mix(in srgb, var(--teal-bright) 18%, transparent); border-color: var(--teal-bright); }
    /* ── Dispatch result cards ── */
    .dispatch-response-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; }
    .dispatch-model-name { font-family: 'Outfit', sans-serif; font-size: 0.75rem; color: var(--teal-bright); margin-bottom: 0.5rem; }
    .dispatch-response-text { font-size: 1.1rem; color: var(--text); line-height: 1.65; white-space: pre-wrap; }
    /* Dispatch tabs (final result view — one panel visible at a time) */
    .dispatch-tabs { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 0.75rem; }
    .dispatch-tab { flex: 1; padding: 0.6rem; background: var(--surface2); color: var(--text-secondary); font-family: 'Outfit', sans-serif; font-size: 0.85rem; border: none; cursor: pointer; transition: all 0.2s; }
    .dispatch-tab + .dispatch-tab { border-left: 1px solid var(--border); }
    .dispatch-tab:hover { color: var(--text); }
    .dispatch-tab.active { background: var(--teal-deep); color: #fff; }
    :root[data-theme="light"] .dispatch-tab.active { background: #33302E; color: #FFF1E5; }
    /* ── Review result ── */
    .review-summary-banner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; text-align: center; }
    .review-score { font-size: 2rem; font-weight: 700; color: var(--teal-bright); }
    .review-verdict { font-size: 0.95rem; color: var(--text); margin-top: 0.35rem; line-height: 1.6; }
    .review-agreement { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.5rem; }
    .review-section { margin-bottom: 1rem; }
    .review-section h4 { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.5rem; }
    .review-section ul { list-style: disc; padding-left: 1.25rem; }
    .review-section li { font-size: 0.9rem; color: var(--text); line-height: 1.6; margin-bottom: 0.25rem; }
    .review-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; }
    .review-card-header { font-family: 'Outfit', sans-serif; font-size: 0.75rem; color: var(--teal-bright); margin-bottom: 0.5rem; cursor: pointer; }
    .review-card-body { font-size: 0.9rem; color: var(--text); line-height: 1.6; }
    .review-card-body ul { list-style: disc; padding-left: 1.25rem; margin: 0.35rem 0; }
    .review-card-body li { margin-bottom: 0.15rem; }
    /* ── Debate processing ── */
    .live-debate-rounds-panel { margin-top: 1rem; }
    .live-debate-rounds-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
    .live-debate-rounds-title { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.75rem; }
    .live-round-card { margin-bottom: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
    .live-round-card:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
    .live-round-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); margin-bottom: 0.4rem; }
    .live-round-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .live-round-side { font-size: 0.8rem; color: var(--text-secondary); }
    .live-round-side-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; margin-bottom: 0.2rem; }
    .live-round-side.for .live-round-side-label  { color: var(--sem-for); }
    .live-round-side.against .live-round-side-label { color: var(--sem-against); }
    /* ── Debate results ── */
    .debate-result-wrap { width: 100%; }
    .debate-proposition { font-family: 'DM Serif Display', serif; font-size: 1.4rem; color: var(--text); margin-bottom: 0.75rem; line-height: 1.4; }
    .comp-role-chair   { color: var(--sem-role) !important; font-weight: 500; }
    .comp-role-member  { color: var(--sem-role) !important; font-weight: 500; }
    .comp-role-for     { color: var(--sem-for); font-weight: 500; }
    .comp-role-against { color: var(--sem-against); font-weight: 500; }
    .debate-winner-banner { border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
    .debate-winner-banner.winner-for     { background: rgba(96,165,250,0.1); border: 1px solid rgba(96,165,250,0.3); }
    .debate-winner-banner.winner-against { background: rgba(190,18,60,0.12); border: 1px solid rgba(190,18,60,0.35); }
    .debate-winner-banner.winner-draw    { background: rgba(129,140,248,0.1); border: 1px solid rgba(129,140,248,0.3); }
    .debate-winner-label { font-family: 'Outfit', sans-serif; font-size: 0.8rem; letter-spacing: 0.1em; margin-bottom: 0.35rem; }
    .debate-winner-banner.winner-for     .debate-winner-label { color: var(--sem-for); }
    .debate-winner-banner.winner-against .debate-winner-label { color: var(--sem-against); }
    .debate-winner-banner.winner-draw    .debate-winner-label { color: var(--sem-draw); }
    .debate-winner-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
    .debate-winner-banner.winner-for     .debate-winner-name { color: var(--sem-for); }
    .debate-winner-banner.winner-against .debate-winner-name { color: var(--sem-against); }
    .debate-winner-banner.winner-draw    .debate-winner-name { color: var(--sem-draw); }
    .debate-winner-reasoning { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.6; }
    .debate-chair-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
    .debate-chair-section h4 { font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
    .debate-chair-text { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.6; }
    .debate-chair-list { margin: 0; padding-left: 1.2rem; }
    .debate-chair-list li { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 0.25rem; }
    .debate-rounds-section { margin-top: 1rem; }
    .debate-round-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.75rem; overflow: hidden; }
    .debate-round-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); }
    .debate-round-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
    .debate-side-block { padding: 1rem; }
    .debate-side-block:first-child { border-right: 1px solid var(--border); }
    .debate-side-block.for-block     { background: rgba(96,165,250,0.05); }
    .debate-side-block.against-block { background: rgba(190,18,60,0.06); }
    .debate-side-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; margin-bottom: 0.5rem; }
    .debate-side-block.for-block   .debate-side-label { color: var(--sem-for); }
    .debate-side-block.against-block .debate-side-label { color: var(--sem-against); }
    .debate-side-text { font-size: 1rem; color: var(--text-secondary); line-height: 1.6; }
    .debate-contrib-name { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin: 0.6rem 0 0.2rem; }
    .debate-contrib-name:first-child { margin-top: 0; }
    /* ── Community debates ── */
    .featured-debate-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.875rem 1rem; cursor: pointer; transition: border-color 0.2s; }
    .featured-debate-card:hover { border-color: var(--teal-deep); }
    .featured-debate-statement { font-size: 0.9rem; color: var(--text); line-height: 1.5; margin-bottom: 0.5rem; }
    .featured-debate-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
    .debate-winner-badge { font-family: 'Outfit', sans-serif; font-size: 0.7rem; padding: 0.1rem 0.45rem; border-radius: 4px; }
    .debate-winner-badge.badge-for    { background: rgba(96,165,250,0.15);  color: var(--sem-for); }
    .debate-winner-badge.badge-against { background: rgba(190,18,60,0.18); color: var(--sem-against); }
    .debate-winner-badge.badge-draw   { background: rgba(129,140,248,0.15); color: var(--sem-draw); }
    .featured-debate-reasoning { font-size: 0.8rem; color: var(--text-muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    @media (max-width: 600px) {
      .debate-round-body { grid-template-columns: 1fr; }
      .debate-side-block:first-child { border-right: none; border-bottom: 1px solid var(--border); }
      .live-round-sides { grid-template-columns: 1fr; }
    }
    /* ── Community section ── */
    .featured-writing-excerpt { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; margin-top: 0.35rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .community-type-tag { font-family: 'Outfit', sans-serif; font-size: 0.7rem; padding: 0.1rem 0.45rem; border-radius: 3px; flex-shrink: 0; background: rgba(255,255,255,0.05); color: var(--text-secondary); }
    .community-card-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; flex-wrap: wrap; }
    /* ── Write result ── */
    .write-result-wrap { margin-bottom: 1.25rem; }
    #write-research-section { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1.75rem; }
    .write-article-title { font-size: 1.2rem; font-weight: 700; text-decoration: underline; color: var(--text); margin-bottom: 1.25rem; }
    .write-article-body { font-size: 1.1rem; line-height: 1.6; color: var(--text); }
    .write-article-body p { margin: 0 0 1.1rem; }
    .write-article-body p:last-child { margin-bottom: 0; }
    .write-citations-section { margin-top: 2rem; }
    .write-citations-header { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
    .write-citations-list { }
    .write-citation-item { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; padding: 0.15rem 0; display: flex; gap: 0.4rem; }
    .write-citation-num { font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-secondary); flex-shrink: 0; vertical-align: baseline; }
    .write-citation-url { color: var(--text-secondary); text-decoration: none; word-break: break-all; }
    .write-citation-url:hover { text-decoration: underline; }
    .cite-group { font-size: 0.75em; vertical-align: super; line-height: 0; }
    .cite-link { font-family: 'Outfit', sans-serif; color: var(--accent); text-decoration: none; }
    .cite-link:hover { text-decoration: underline; }
    .hide-citations .cite-group { display: none; }
    .hide-citations .write-citations-section { display: none !important; }
    .further-reading-section { margin-top: 1rem; }
    .further-reading-heading { cursor: pointer; font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); list-style: none; user-select: none; }
    .further-reading-heading::-webkit-details-marker { display: none; }
    .further-reading-heading::before { content: '▸'; display: inline-block; margin-right: 0.35rem; transition: transform 0.15s; }
    .further-reading-section[open] .further-reading-heading::before { transform: rotate(90deg); }
    .further-reading-section[open] .further-reading-heading { margin-bottom: 0.4rem; }
    .further-reading-list { list-style: disc; padding-left: 1.25rem; margin: 0; }
    .further-reading-list li { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; padding: 0.1rem 0; }
    .further-reading-list a { color: var(--text-secondary); text-decoration: none; word-break: break-all; }
    .further-reading-list a:hover { text-decoration: underline; }
    .hide-citations .further-reading-section { display: none !important; }
    #cite-visibility-btn.active { color: var(--accent); }
    /* ── Account → Delivery channels (email / browser / iOS / Android) ── */
    .notif-channels-desc { font-size: 0.85rem; color: var(--text-muted); margin: -0.25rem 0 1rem 0; line-height: 1.5; }
    .notif-channel { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-top: 1px solid var(--border); }
    .notif-channel:first-of-type { border-top: none; padding-top: 0.25rem; }
    .notif-channel-body { flex: 1; min-width: 0; }
    .notif-channel-name { font-size: 0.95rem; color: var(--text); font-weight: 500; }
    .notif-channel-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; line-height: 1.4; }
    .notif-channel-soon { font-family: 'Outfit', sans-serif; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 0.15rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; white-space: nowrap; }
    .toggle-switch { position: relative; display: inline-block; width: 34px; height: 18px; flex-shrink: 0; }
    .toggle-switch input { opacity: 0; width: 0; height: 0; }
    .toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 18px; transition: background .2s; }
    .toggle-slider::before { content: ''; position: absolute; width: 12px; height: 12px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
    .toggle-switch input:checked + .toggle-slider { background: var(--teal-bright); }
    .toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
    /* ── History screen ── */
    .history-wrap { width: 100%; max-width: 800px; }
    .history-toolbar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
    .history-toolbar h2 { font-size: 1.4rem; flex: 1; }
    .history-search-wrap { position: relative; flex: 1; min-width: 180px; max-width: 280px; }
    .history-search-wrap input { width: 100%; padding: 0.5rem 0.75rem 0.5rem 2rem; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: 'Outfit', sans-serif; font-size: 0.9rem; outline: none; transition: border-color 0.2s; }
    .history-search-wrap input:focus { border-color: var(--teal-bright); }
    .history-search-wrap input:disabled { opacity: 0.4; cursor: not-allowed; }
    .history-search-icon { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.8rem; pointer-events: none; }
    .history-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 0.6rem; cursor: pointer; transition: border-color 0.2s; }
    .history-card:hover { border-color: var(--teal-deep); }
    .history-card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
    .history-badge { font-family: 'Outfit', sans-serif; font-size: 0.7rem; padding: 0.1rem 0.45rem; border-radius: 4px; background: rgba(255,255,255,0.05); color: var(--text-secondary); }
    .badge-private { background: rgba(139,167,250,0.15); color: var(--sem-private); }
    .history-date { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }
    .history-card-question { font-size: 0.9rem; font-weight: 500; color: var(--text); line-height: 1.5; margin-bottom: 0.35rem; }
    .history-card-verdict { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
    .history-card-meta { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
    .history-conf { font-family: 'Outfit', sans-serif; font-size: 0.7rem; font-weight: 500; }
    .history-credits { font-family: 'Outfit', sans-serif; font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
    .history-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
    .history-empty p { font-size: 0.9rem; margin-top: 0.5rem; }
    .history-loading { }

    /* ── Skeleton loader ── */
    @keyframes shimmer { 0% { background-position: -600px 0 } 100% { background-position: 600px 0 } }
    .skeleton {
      display: block; border-radius: 4px;
      background: linear-gradient(90deg, var(--surface2) 25%, rgba(255,255,255,0.055) 50%, var(--surface2) 75%);
      background-size: 1200px 100%;
      animation: shimmer 1.4s ease-in-out infinite;
    }
    .history-upgrade { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; }
    .history-upgrade p { color: var(--text-muted); font-size: 0.9rem; margin: 0.5rem 0 1.25rem; }
    .history-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; min-height: 1.5rem; }
    .history-count { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); }
    .history-sort { display: flex; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; background: var(--surface2); }
    .sort-opt { font-family: 'Outfit', sans-serif; font-size: 0.7rem; padding: 0.3rem 0.75rem; cursor: pointer; color: var(--text-muted); transition: all 0.15s; user-select: none; }
    .sort-opt.active { background: var(--teal-deep); color: #fff; }

    /* ── Ask toggles ── */
    .seg-toggle { display: flex; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; background: var(--surface2); }
    .seg-opt { padding: 0.25rem 0.75rem; font-family: 'Outfit', sans-serif; font-size: 0.8rem; cursor: pointer; color: var(--text-muted); transition: all 0.2s; white-space: nowrap; user-select: none; }
    .seg-opt:hover { color: var(--text); }
    .seg-opt.active { background: color-mix(in srgb, var(--teal-bright) 14%, transparent); color: var(--teal-bright); }
    .seg-opt.active:hover { background: color-mix(in srgb, var(--teal-bright) 22%, transparent); }
    /* ── Upgrade modal ── */
    .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 500; padding: 1rem; overflow-y: auto; }
    /* Same dvh trick as .modal-card — keeps modal inside visible viewport
       when the iOS keyboard opens; internal scroll handles overflow. */
    .modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; max-width: 380px; width: 100%; text-align: center; max-height: 90vh; max-height: 90dvh; overflow-y: auto; }
    /* ── Transcript modal ── */
    .transcript-modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; max-width: 680px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; }
    .transcript-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
    .transcript-modal-header h3 { font-family: 'DM Serif Display', serif; font-size: 1.2rem; margin: 0; }
    .transcript-modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; padding: 0.25rem 0.5rem; line-height: 1; }
    .transcript-modal-close:hover { color: var(--text); }
    .transcript-modal-body { overflow-y: auto; padding: 1.25rem 1.5rem; flex: 1; }
    .transcript-turn-user { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.875rem 1rem; margin-bottom: 0.75rem; }
    .transcript-turn-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.35rem; }
    .transcript-turn-user .transcript-turn-label { color: var(--teal-bright); }
    .transcript-turn-ai .transcript-turn-label { color: var(--teal-bright); }
    .transcript-turn-content { font-size: 1rem; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
    .transcript-turn-ai { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.875rem 1rem; margin-bottom: 1rem; }
    .transcript-turn-verdict { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.4rem; line-height: 1.5; }
    .transcript-turn-confidence { font-family: 'Outfit', sans-serif; font-size: 0.7rem; margin-top: 0.35rem; }
    .transcript-loading { text-align: center; padding: 2rem; color: var(--text-muted); font-family: 'Outfit', sans-serif; font-size: 0.8rem; }
    .transcript-turn-block { margin-bottom: 1.25rem; }
    .transcript-section-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin: 0.75rem 0 0.4rem; }
    .transcript-model-response { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 0.5rem; }
    .transcript-model-name { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); margin-bottom: 0.3rem; }
    .model-tip { cursor: help; border-bottom: 1px dotted currentColor; }
    .model-tip-popup { position: fixed; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.25rem 0.55rem; font-size: 0.7rem; color: var(--text); z-index: 9999; pointer-events: none; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
    .conv-agrees { color: var(--teal-bright); font-style: normal; }
    .conv-debate-claim { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 0.75rem; }
    .conv-debate-claim-header { font-size: 0.9rem; font-style: italic; margin-bottom: 0.6rem; color: var(--text); }
    .conv-debate-round { margin-bottom: 0.5rem; }
    .conv-debate-round-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.35rem; }
    .transcript-prompt-summary { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); cursor: pointer; padding: 0.25rem 0; margin-bottom: 0.25rem; }
    .transcript-prompt-summary:hover { color: var(--text); }
    .transcript-prompt-block { background: rgba(0,0,0,0.2); border-radius: 4px; padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; }
    .transcript-prompt-msg { margin-bottom: 0.5rem; }
    .transcript-prompt-msg:last-child { margin-bottom: 0; }
    .transcript-prompt-role { font-family: 'Outfit', sans-serif; font-size: 0.7rem; display: block; margin-bottom: 0.15rem; }
    .transcript-prompt-content { font-family: 'Outfit', sans-serif; font-size: 0.85rem; color: var(--text); white-space: pre-wrap; line-height: 1.55; }
    .transcript-response-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); margin-bottom: 0.25rem; margin-top: 0.1rem; }
    .transcript-step-cost { text-transform: none; letter-spacing: 0; }
    .transcript-response-block { margin-top: 0.35rem; }
    .transcript-total-cost { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.75rem; text-align: right; }
    .transcript-json-section { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); margin: 0.5rem 0 0.25rem; }
    .transcript-json-list { margin: 0 0 0.5rem 1rem; padding: 0; font-size: 0.9rem; line-height: 1.6; color: var(--text); }
    .transcript-json-list li { margin-bottom: 0.2rem; }
    .transcript-json-claim { font-size: 0.9rem; font-style: italic; color: var(--text); margin-bottom: 0.25rem; }
    .transcript-json-positions { padding-left: 0.75rem; margin-bottom: 0.5rem; }
    .transcript-json-position { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0.2rem; }
    .transcript-json-raw { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); white-space: pre-wrap; overflow-x: auto; background: rgba(0,0,0,0.2); padding: 0.5rem; border-radius: 4px; }
    .transcript-json-raw .json-key    { color: var(--teal-bright); }
    .transcript-json-raw .json-string { color: #b5cea8; }
    .transcript-json-raw .json-number { color: #d19a66; }
    .transcript-json-raw .json-bool   { color: #c586c0; }
    .transcript-json-raw .json-null   { color: #569cd6; }
    .modal-box h3 { font-family: 'DM Serif Display', serif; font-size: 1.2rem; margin-bottom: 0.75rem; }
    .modal-box p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; line-height: 1.6; }
    .modal-box .btn-primary { background: var(--teal-bright); color: var(--on-accent); padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius); font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 500; cursor: pointer; width: 100%; transition: background 0.2s; text-decoration: none; display: block; }
    .modal-box .btn-primary:hover { background: var(--teal-bright-hover); }
    .modal-box .btn-later { background: transparent; color: var(--text-muted); border: none; font-family: 'Outfit', sans-serif; font-size: 0.9rem; cursor: pointer; margin-top: 0.75rem; padding: 0.5rem; width: 100%; transition: color 0.2s; }
    .modal-box .btn-later:hover { color: var(--text); }

    #config-panel { padding: 0.9rem 0 0.25rem; border-top: 1px solid var(--border); margin-top: 1rem; }
    .config-table { width: 100%; border-collapse: collapse; border-spacing: 0; }
    .config-table td { padding: 0; vertical-align: middle; }
    .config-info-cell { width: 1px; white-space: nowrap; padding-right: 0.4rem !important; position: relative; vertical-align: middle; }
    .config-info-btn { font-size: 1rem; display: flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; }
    .config-table tr + tr td { padding-top: 0.75rem !important; }
    .length-custom-input { display: none; align-items: center; gap: 0.3rem; margin-top: 0.4rem; }
    .length-custom-input.visible { display: flex; }
    .length-custom-input input { width: 4rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--text); font-family: 'Outfit', sans-serif; font-size: 0.75rem; padding: 0.2rem 0.4rem; text-align: center; outline: none; }
    .length-custom-input input:focus { border-color: var(--teal-bright); }
    .length-custom-input .length-unit { font-family: 'Outfit', sans-serif; font-size: 0.65rem; color: var(--text-muted); }


    /* ── Cap spinners ── */
    .cap-spinner { display: flex; align-items: center; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; height: 40px; }
    .cap-spinner.sm { height: 28px; border-radius: 6px; }
    .cap-btn { background: none; border: none; color: var(--text-muted); padding: 0 0.75rem; cursor: pointer; font-size: 1.1rem; line-height: 1; font-family: 'Outfit', sans-serif; transition: all 0.15s; flex-shrink: 0; height: 100%; }
    .cap-spinner.sm .cap-btn { padding: 0 0.5rem; font-size: 0.9rem; }
    .cap-btn:hover { color: var(--teal-bright); background: color-mix(in srgb, var(--teal-bright) 8%, transparent); }
    .cap-val { flex: 1; text-align: center; font-family: 'Outfit', sans-serif; font-size: 0.9rem; color: var(--text); user-select: none; }
    .cap-spinner.sm .cap-val, .cap-spinner.sm input.cap-val { font-size: 0.8rem; width: 3.5rem; }
    input.cap-val { border: none; background: transparent; outline: none; cursor: text; width: 4.5rem; padding: 0; user-select: text; }
    input.cap-val:focus { color: var(--teal-bright); }

    /* ── Profile icon ── */
    .profile-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--teal-deep); color: var(--text); display: flex; align-items: center; justify-content: center; font-family: 'Outfit', sans-serif; font-size: 0.8rem; font-weight: 600; cursor: pointer; flex-shrink: 0; transition: background 0.2s; }
    .profile-icon:hover { background: var(--teal-bright); color: var(--on-accent); }

    /* ── Related questions ── */
    .related-q { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem 1rem; margin-bottom: 0.5rem; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
    .related-q:hover { border-color: var(--teal-bright); color: var(--teal-bright); }
    .related-q::after { content: '→'; font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; }
    .related-type-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; margin: 0.75rem 0 0.4rem; }
    .related-group:first-child .related-type-label { margin-top: 0; }
    .related-type-ask { color: var(--teal-bright); }
    .related-type-write { color: var(--sem-write); }
    .related-type-factcheck { color: var(--warning); }
    .related-type-debate { color: var(--sem-draw); }

    /* ── Follow-up question ── */
    .followup-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
    .followup-wrap textarea { min-height: 72px; resize: vertical; font-size: 0.9rem; }
    .followup-submit { align-self: flex-end; }

    .topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; width: 100%; max-width: 800px; position: sticky; top: 0; background: var(--bg); z-index: 100; padding-top: 0.5rem; padding-bottom: 0.5rem; }
    .topbar-logo { font-family: 'DM Serif Display', serif; font-size: 1.4rem; background: linear-gradient(135deg, var(--teal-bright), var(--teal-deep)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; display: flex; align-items: center; gap: 0.45rem; }
    .topbar-logo img { width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0; -webkit-text-fill-color: initial; }
    .topbar-logo-mark { width: 26px; height: 26px; flex-shrink: 0; display: inline-block; background-color: var(--teal-bright); -webkit-mask: url(/logo.svg) center/contain no-repeat; mask: url(/logo.svg) center/contain no-repeat; -webkit-text-fill-color: initial; }
    .topbar-user { display: flex; align-items: center; gap: 1.1rem; }
    .topbar-user span { color: var(--teal-bright); cursor: pointer; display: inline-flex; align-items: center; opacity: 0.75; transition: opacity 0.15s; }
    .topbar-user span:hover { opacity: 1; }
    .topbar-user span svg { display: block; width: 22px; height: 22px; }

    /* ── Processing screen ── */
    .processing-wrap { width: 100%; max-width: 800px; }
    .pulse-ring { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--teal-bright); margin: 0 auto 2rem; animation: pulse 1.5s ease-in-out infinite; position: relative; display: flex; align-items: center; justify-content: center; }
    .pulse-ring::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--teal-deep); animation: pulse 1.5s ease-in-out infinite 0.3s; }
    .pulse-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--teal-bright); }
    @keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.1); } }

    .steps-list { list-style: none; margin-bottom: 1.5rem; }
    .step-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
    .step-item:last-child { border-bottom: none; }
    .step-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; margin-top: 2px; }
    .step-icon.pending { border: 2px solid var(--border); }
    .step-icon.running { border: 2px solid var(--teal-bright); animation: spin 1s linear infinite; }
    .step-icon.done { background: var(--teal-bright); color: var(--on-accent); }
    @keyframes spin { to { transform: rotate(360deg); } }
    .step-text { flex: 1; }
    .step-label { font-size: 0.9rem; }
    .step-sub { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }
    .processing-elapsed { text-align: center; font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-muted); margin: -1rem 0 1.5rem; }

    /* ── Live consensus & debate panels ── */
    .live-consensus-block { background: color-mix(in srgb, var(--teal-bright) 6%, transparent); border: 1px solid var(--teal-deep); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; }
    .live-consensus-title { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); letter-spacing: 0.1em; margin-bottom: 0.6rem; }
    .live-consensus-item { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.35rem 0; border-bottom: 1px solid color-mix(in srgb, var(--teal-bright) 10%, transparent); font-size: 0.9rem; color: var(--text); line-height: 1.5; }
    .live-consensus-item:last-child { border-bottom: none; }
    .live-consensus-item::before { content: '✓'; color: var(--teal-bright); font-size: 0.7rem; margin-top: 0.2rem; flex-shrink: 0; }

    .live-debate-block { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
    .live-debate-title { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.1em; margin-bottom: 0.75rem; }
    .live-claim-card { border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); padding: 0.875rem; margin-bottom: 0.6rem; background: var(--surface); transition: border-color 0.3s; }
    .live-claim-card:last-child { margin-bottom: 0; }
    .live-claim-card.resolved { border-color: var(--teal-deep); }
    .live-claim-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.6rem; }
    .live-claim-text { font-size: 0.9rem; color: var(--text); flex: 1; line-height: 1.5; }
    .live-claim-round { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; padding: 0.15rem 0.45rem; border: 1px solid var(--border); border-radius: 4px; flex-shrink: 0; }
    .live-claim-round.resolved { color: var(--teal-bright); border-color: var(--teal-deep); }
    .live-model-rows { display: flex; flex-direction: column; gap: 0.6rem; }
    .live-model-row { display: flex; flex-direction: column; gap: 0.2rem; }
    .live-model-header { display: flex; align-items: center; gap: 0.5rem; }
    .live-model-name { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); }
    .live-model-pos { font-size: 0.8rem; color: var(--text-muted); line-height: 1.55; padding-left: 0.875rem; border-left: 2px solid var(--border); margin-left: 0.1rem; }
    .live-model-status { font-family: 'Outfit', sans-serif; font-size: 0.7rem; padding: 0.15rem 0.4rem; border-radius: 4px; white-space: nowrap; }
    .live-status-agrees { background: color-mix(in srgb, var(--teal-bright) 15%, transparent); color: var(--teal-bright); }
    .live-status-updating { background: rgba(239,68,68,0.1); color: var(--error); }

    /* ── Results screen ── */
    .results-wrap { width: 100%; max-width: 800px; }

    .verdict-card { background: linear-gradient(135deg, rgba(15,110,86,0.2), color-mix(in srgb, var(--teal-bright) 8%, transparent)); border: 1px solid var(--teal-deep); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
    .verdict-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); margin-bottom: 0.5rem; }
    .verdict-text { font-size: 1.1rem; font-weight: 500; margin-bottom: 1rem; }
    .fc-grade-wrap { margin-top: 0.75rem; }
    .fc-grade-label { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.2rem; }
    .fc-grade-prefix { font-family: 'Outfit', sans-serif; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-right: 0.4rem; }
    .fc-grade-desc { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.1rem; }

    .result-section { margin-bottom: 1.5rem; }
    .result-section h3, .followup-heading { font-size: 1.4rem; margin-bottom: 0.75rem; color: var(--text); }
    .answer-heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
    .answer-heading-row h3 { margin-bottom: 0.5rem; }
    .panel-agreement-pill { font-family: 'Outfit', sans-serif; font-size: 0.72rem; color: var(--teal-bright); background: color-mix(in srgb, var(--teal-bright) 8%, transparent); border: 1px solid color-mix(in srgb, var(--teal-bright) 35%, transparent); border-radius: 999px; padding: 0.25rem 0.7rem; white-space: nowrap; margin-bottom: 0.5rem; }
    .panel-agreement-pill strong { color: var(--teal-bright); margin-left: 0.4rem; font-weight: 700; }
    .answer-box { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
    .synthesised-answer { font-size: 1.1rem; line-height: 1.6; color: var(--text); }
    .synthesised-answer p { margin-bottom: 0.75rem; }
    .synthesised-answer strong { color: #fff; }
    .synthesised-answer ul, .synthesised-answer ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
    .synthesised-answer li { margin-bottom: 0.25rem; }
    .synthesised-answer h1, .synthesised-answer h2, .synthesised-answer h3 { font-family: 'DM Serif Display', serif; margin: 1rem 0 0.5rem; }

    .claims-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
    .claim-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
    .claim-text { font-size: 1.1rem; margin-bottom: 0.6rem; }
    .claim-positions { display: flex; flex-direction: column; gap: 0.4rem; margin: 0 0 0.75rem 0; padding: 0.6rem 0.8rem; background: var(--surface); border-radius: calc(var(--radius) * 0.6); border: 1px solid var(--border); }
    .claim-position { display: grid; grid-template-columns: minmax(5rem, auto) 1fr; gap: 0.75rem; font-size: 0.9rem; }
    .claim-position-name { font-family: 'Outfit', sans-serif; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); padding-top: 0.1rem; }
    .claim-position-stance { color: var(--text); }
    .claim-meta { display: flex; align-items: center; gap: 0.75rem; }
    .claim-source { font-family: 'Outfit', sans-serif; font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 4px; vertical-align: 0.2em; margin-right: 0.35rem; white-space: nowrap; }
    .source-consensus { background: color-mix(in srgb, var(--teal-bright) 15%, transparent); color: var(--teal-bright); }
    .source-discussion_resolved { background: color-mix(in srgb, var(--teal-bright) 10%, transparent); color: var(--teal-light); }
    .source-disputed { background: rgba(239,68,68,0.12); color: var(--error); }
    .claim-support { font-family: 'Outfit', sans-serif; font-size: 0.7rem; padding: 0.2rem 0.65rem; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
    .support-full { background: color-mix(in srgb, var(--teal-bright) 15%, transparent); color: var(--teal-bright); border-color: color-mix(in srgb, var(--teal-bright) 35%, transparent); }
    .support-majority { background: color-mix(in srgb, var(--teal-bright) 8%, transparent); color: var(--teal-light); border-color: color-mix(in srgb, var(--teal-bright) 25%, transparent); }
    .support-split { background: rgba(240,192,64,0.12); color: var(--warning); border-color: rgba(240,192,64,0.35); }
    .support-none { background: rgba(239,68,68,0.12); color: var(--error); border-color: rgba(239,68,68,0.35); }
    .claim-dissenters { font-family: 'Outfit', sans-serif; font-size: 0.72rem; color: var(--text-muted); }
    .claim-dissenters::before { content: '· '; margin-right: 0.1rem; }
    .claim-verdict { font-family: 'Outfit', sans-serif; font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 4px; white-space: nowrap; }
    .verdict-true { background: rgba(34,197,94,0.15); color: var(--verdict-true); }
    .verdict-mostly_true { background: rgba(132,204,22,0.15); color: var(--verdict-mostly-true); }
    .verdict-mixed { background: rgba(240,192,64,0.15); color: var(--verdict-mixed); }
    .verdict-mostly_false { background: rgba(249,115,22,0.15); color: var(--verdict-mostly-false); }
    .verdict-false { background: rgba(239,68,68,0.15); color: var(--error); }
    .verdict-unverifiable { background: rgba(100,116,139,0.15); color: var(--text-muted); }
    .claim-details { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; margin-top: 0.5rem; }

    .agreed-disputed { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
    .agreed-col, .disputed-col { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
    .agreed-col h4 { color: var(--teal-bright); font-size: 0.9rem; margin-bottom: 0.6rem; }
    .disputed-col h4 { color: var(--error); font-size: 0.9rem; margin-bottom: 0.6rem; }
    .list-item { font-size: 0.9rem; color: var(--text-muted); padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
    .list-item:last-child { border-bottom: none; }

    .meta-bar { margin-bottom: 1.5rem; }
    .meta-bar-summary {
      cursor: pointer;
      font-family: 'Outfit', sans-serif;
      font-size: 0.75rem;
      color: var(--text-muted);
      list-style: none;
      padding: 0.25rem 0;
      user-select: none;
    }
    .meta-bar-summary::-webkit-details-marker { display: none; }
    .meta-bar-summary::before {
      content: '▸';
      display: inline-block;
      margin-right: 0.35rem;
      transition: transform 0.15s;
    }
    .meta-bar[open] .meta-bar-summary::before { transform: rotate(90deg); }
    .meta-bar[open] .meta-bar-summary { margin-bottom: 0.4rem; }
    .meta-row { font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; }
    .meta-row + .meta-row { margin-top: 0.25rem; }
    .meta-row span { color: var(--teal-bright); }
    .meta-label { color: var(--teal-bright) !important; }
    .meta-val { color: var(--text-secondary) !important; }
    .meta-val .model-tip { color: inherit; }
    .meta-sep { opacity: 0.4; }

    .debate-outcome-section { margin-bottom: 1rem; }
    .debate-outcome-item { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.875rem; margin-bottom: 0.5rem; }
    .debate-outcome-claim { font-size: 0.9rem; margin-bottom: 0.4rem; }
    .debate-outcome-meta { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); display: flex; gap: 0.75rem; flex-wrap: wrap; }

    @media (max-width: 600px) {
      .agreed-disputed { grid-template-columns: 1fr; }
      .models-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
      /* Logo on one row, icons on their own row on narrow screens — beats
         horizontal overflow that hides the sign-out button off-screen. */
      .topbar { flex-wrap: wrap; gap: 0.4rem 0.6rem; margin-bottom: 1.25rem; }
      .topbar-logo { font-size: 1.2rem; }
      .topbar-logo img { width: 22px; height: 22px; }
      .topbar-logo-mark { width: 22px; height: 22px; }
      .topbar-user { gap: 0.75rem; flex-wrap: wrap; }
    }
    /* Very narrow screens (iPhone SE / small Android, ~320–380px) — tighten
       modal padding and let long URLs / emails inside info-boxes wrap so
       the modal doesn't exceed the viewport width. */
    @media (max-width: 380px) {
      .modal-box { padding: 1.25rem; }
      .modal-card { padding: 1.25rem; }
      .info-box, .info-box p { overflow-wrap: anywhere; word-break: break-word; }
    }
    html.in-app .screen { padding-top: 0.5rem; }
    html.in-app .ios-legal-note { display: block !important; }

    /* ── iOS app install banner ── */
    #ios-banner { display:none; position:fixed; top:0; left:0; right:0; z-index:9998; background:#0f1e2e; border-bottom:1px solid var(--border); padding:10px 14px; align-items:center; gap:10px; }
    #ios-banner.visible { display:flex; }
    #ios-banner .ios-banner-icon { width:36px; height:36px; border-radius:8px; flex-shrink:0; }
    #ios-banner .ios-banner-text { flex:1; min-width:0; }
    #ios-banner .ios-banner-title { font-size:0.9rem; font-weight:600; color:var(--text); line-height:1.3; }
    #ios-banner .ios-banner-sub { font-family:'Outfit',sans-serif; font-size:0.7rem; color:var(--text-muted); margin-top:1px; }
    #ios-banner .ios-banner-get { background:var(--teal-bright); color:var(--on-accent); font-family:'Outfit',sans-serif; font-size:0.8rem; font-weight:600; padding:6px 14px; border-radius:20px; border:none; cursor:pointer; white-space:nowrap; text-decoration:none; }
    #ios-banner .ios-banner-close { background:none; border:none; color:var(--text-muted); font-size:1.2rem; cursor:pointer; padding:0 2px; line-height:1; flex-shrink:0; }
    body.ios-banner-shown .screen { padding-top: 58px; }

    /* ── Pricing screen ── */
    .pricing-hero { text-align: center; padding: 3rem 1rem 2rem; max-width: 640px; margin: 0 auto; width: 100%; }
    .pricing-hero h1 { font-family: 'DM Serif Display', serif; font-size: 2rem; margin-bottom: 0.75rem; }
    .pricing-hero p { color: var(--text-muted); font-size: 1rem; max-width: 480px; margin: 0 auto; }
    .billing-toggle { display: flex; align-items: center; background: var(--surface2); border: 1px solid var(--border); border-radius: 30px; padding: 4px; margin: 0 auto 2.5rem; width: fit-content; }
    .bill-opt { padding: 0.4rem 1.25rem; border-radius: 24px; cursor: pointer; font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-muted); transition: all 0.2s; white-space: nowrap; }
    .bill-opt.active { background: var(--teal-bright); color: var(--on-accent); }
    .bill-save { background: color-mix(in srgb, var(--teal-bright) 15%, transparent); color: var(--teal-bright); font-family: 'Outfit', sans-serif; font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 20px; margin-left: 0.35rem; }
    .bill-opt.active .bill-save { background: rgba(255,255,255,0.22); color: var(--on-accent); }
    .plans-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; max-width: 800px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
    @media (max-width: 700px) { .plans-grid { grid-template-columns: repeat(2, 1fr); } }
    @media (max-width: 440px) { .plans-grid { grid-template-columns: 1fr; } }
    .plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.75rem 1.5rem; display: flex; flex-direction: column; position: relative; transition: border-color 0.2s; }
    .plan-card:hover { border-color: var(--teal-deep); }
    .plan-card.highlighted { border-color: var(--teal-bright); background: linear-gradient(180deg, color-mix(in srgb, var(--teal-bright) 6%, transparent) 0%, var(--surface) 60%); }
    .plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--teal-bright); color: var(--on-accent); font-family: 'Outfit', sans-serif; font-size: 0.7rem; font-weight: 500; padding: 0.2rem 0.75rem; border-radius: 20px; white-space: nowrap; }
    .plan-name { font-family: 'Outfit', sans-serif; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); margin-bottom: 1rem; }
    .plan-card.highlighted .plan-name { color: var(--teal-bright); }
    .plan-price { margin-bottom: 0.35rem; }
    .price-amount { font-family: 'DM Serif Display', serif; font-size: 2rem; color: var(--text); line-height: 1; }
    .price-period { font-size: 1rem; color: var(--text-muted); margin-left: 0.1rem; }
    .price-note { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 1rem; min-height: 1rem; }
    .plan-credits { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.875rem; margin-bottom: 1.25rem; }
    .plan-credits-val { font-family: 'Outfit', sans-serif; font-size: 1rem; color: var(--teal-bright); font-weight: 500; }
    .plan-credits-label { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }
    .plan-features { list-style: none; flex: 1; margin-bottom: 1.5rem; }
    .plan-features li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.9rem; color: var(--text-muted); padding: 0.3rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
    .plan-features li:last-child { border-bottom: none; }
    .plan-features .feat-check { color: var(--teal-bright); flex-shrink: 0; font-size: 0.8rem; margin-top: 0.1rem; }
    .plan-inherit { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); margin-bottom: 0.5rem; }
    .btn-plan { width: 100%; padding: 0.75rem; border: none; border-radius: var(--radius); font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.2s; }
    .btn-plan-primary { background: var(--teal-bright); color: var(--on-accent); }
    .btn-plan-primary:hover { background: var(--teal-bright-hover); }
    .btn-plan-ghost { background: transparent; color: var(--teal-bright); border: 1px solid var(--teal-deep); }
    .btn-plan-ghost:hover { background: var(--teal-deep); color: var(--text); }
    .feature-table-wrap { max-width: 800px; margin: 4rem auto 0; padding: 0 1.5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
    .feature-table-wrap h2 { font-family: 'DM Serif Display', serif; font-size: 1.4rem; margin-bottom: 1.5rem; text-align: center; }
    /* min-width keeps 5 columns legible; on viewports narrower than this the
       wrap's overflow-x enables horizontal scroll instead of cramping cells. */
    .feature-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 0.9rem; }
    .feature-table th { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); padding: 0.75rem 1rem; text-align: center; border-bottom: 1px solid var(--border); }
    .feature-table th:first-child { text-align: left; }
    .feature-table th.col-pro { color: var(--teal-bright); }
    .feature-table td { padding: 0.65rem 1rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text-muted); }
    .feature-table td:first-child { text-align: left; color: var(--text); }
    .feature-table tr:hover td { background: rgba(255,255,255,0.02); }
    .feature-table .section-row td { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); padding: 1.25rem 1rem 0.5rem; background: transparent; border-bottom: 1px solid var(--border); }
    .ft-check { color: var(--teal-bright); font-size: 0.9rem; }
    .ft-dash { color: var(--border); }
    .ft-val { font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text); }
    .ft-val-muted { font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-muted); }
    .credit-explainer { max-width: 700px; margin: 4rem auto; padding: 0 1.5rem; width: 100%; }
    .credit-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; }
    .credit-box h2 { font-family: 'DM Serif Display', serif; font-size: 1.4rem; margin-bottom: 1rem; }
    .credit-items { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.25rem; }
    @media (max-width: 520px) { .credit-items { grid-template-columns: 1fr; } }
    .credit-item { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
    .credit-item-title { font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--teal-bright); margin-bottom: 0.4rem; }
    .credit-item p { font-size: 0.9rem; color: var(--text-muted); }
    .topup-pack { display: flex; align-items: center; justify-content: space-between; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.875rem 1rem; cursor: pointer; transition: border-color 0.15s; }
    .topup-pack:hover { border-color: var(--teal-bright); }
    .topup-pack-credits { font-family: 'Outfit', sans-serif; font-size: 0.9rem; color: var(--text); }
    .topup-pack-price { font-family: 'Outfit', sans-serif; font-size: 1rem; color: var(--teal-bright); font-weight: 500; }
    .vat-note { text-align: center; font-family: 'Outfit', sans-serif; font-size: 0.7rem; color: var(--text-muted); margin-top: 1.5rem; padding: 0 1.5rem; }

    /* ── RTL overrides ── */
    [dir="rtl"] .btn-social-login { text-align: right; }
    [dir="rtl"] .history-search-icon { left: auto; right: 0.6rem; }
    [dir="rtl"] .history-search-wrap input { padding: 0.5rem 2rem 0.5rem 0.75rem; }

    /* ── First-visitor hint under setup textarea ── */
    .setup-hint { font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-muted); margin: 0.25rem 0 0.75rem 0; padding: 0.25rem 0; }

    /* ── Explore screen (public community feed, shared across products) ── */
    .explore-wrap { width: 100%; max-width: 800px; margin: 0 auto; }
    .explore-toolbar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
    .explore-toolbar h2 { font-size: 1.4rem; flex: 1; }
    .explore-search-wrap { position: relative; flex: 1; min-width: 180px; max-width: 280px; }
    .explore-search-wrap input { width: 100%; padding: 0.5rem 0.75rem 0.5rem 2rem; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: 'Outfit', sans-serif; font-size: 0.9rem; outline: none; transition: border-color 0.2s; }
    .explore-search-wrap input:focus { border-color: var(--teal-bright); }
    .explore-search-icon { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.8rem; pointer-events: none; }
    .explore-mode-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
    .explore-mode-chip { padding: 0.3rem 0.85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-family: 'Outfit', sans-serif; font-size: 0.8rem; cursor: pointer; transition: all 0.15s; }
    .explore-mode-chip:hover { border-color: var(--teal-deep); color: var(--text); }
    .explore-mode-chip.active { background: var(--teal-bright); color: var(--on-accent); border-color: var(--teal-bright); }
    .explore-card { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.5rem; text-decoration: none; color: inherit; transition: border-color 0.2s; }
    .explore-card:hover { border-color: var(--teal-bright); }
    [dir="rtl"] .explore-search-icon { left: auto; right: 0.6rem; }
    [dir="rtl"] .model-query-preview { padding-left: 0; padding-right: 0.875rem; border-left: none; border-right: 2px solid var(--border); }
    [dir="rtl"] .live-model-pos { padding-left: 0; padding-right: 0.875rem; border-left: none; border-right: 2px solid var(--border); margin-left: 0; margin-right: 0.1rem; }
    [dir="rtl"] .synthesised-answer ul, [dir="rtl"] .synthesised-answer ol { padding-left: 0; padding-right: 1.5rem; }
    [dir="rtl"] .debate-chair-list { padding-left: 0; padding-right: 1.2rem; }
    [dir="rtl"] .transcript-json-positions { padding-left: 0; padding-right: 0.75rem; }
    [dir="rtl"] .feature-table th:first-child, [dir="rtl"] .feature-table td:first-child { text-align: right; }
    [dir="rtl"] .history-date { margin-left: 0; margin-right: auto; }
    [dir="rtl"] .model-check { right: auto; left: 0.5rem; }

    /* ── Language picker ── */
    .lang-btn { transition: opacity 0.15s; }
    .lang-btn:hover { opacity: 0.7; }
    #lang-picker { position: fixed; z-index: 10000; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 190px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); display: none; flex-direction: column; max-height: 70vh; }
    #lang-picker.open { display: flex; }
    .lang-search-wrap { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
    .lang-search { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 0.3rem 0.5rem; font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text); outline: none; box-sizing: border-box; }
    .lang-search:focus { border-color: var(--teal-bright); }
    .lang-list { overflow-y: auto; padding: 0.3rem 0; }
    .lang-option { padding: 0.45rem 1rem; font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
    .lang-option:hover { background: var(--surface2); color: var(--text); }
    .lang-option.active { color: var(--teal-bright); }
    .lang-option .lang-check { color: var(--teal-bright); font-size: 0.7rem; }
    .lang-divider { height: 1px; background: var(--border); margin: 0.3rem 0; }
    .lang-no-results { padding: 0.5rem 1rem; font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-muted); }

/* ── Product visibility ─────────────────────────────────────────────── */
body[data-product="consensable"] [data-product="consensise"],
body[data-product="consensise"] [data-product="consensable"] { display: none !important; }

/* Consensise-specific gates. The panel has no citations (no native-search
   models), so both the citation sections and the toggle-citations button on
   the result actions bar are hidden. Regular users cannot read the debate
   transcript either — only staff (consensise_plan='staff') see the
   transcript button, for diagnostic use. */
body[data-product="consensise"] .write-citations-section,
body[data-product="consensise"] #cite-visibility-btn { display: none !important; }
body[data-product="consensise"]:not([data-staff="1"]) #view-transcript-btn { display: none !important; }

/* Consensise model picker chips — used inside the shared #model-config-section
   when preset='custom' (Ultimate/staff). Other config controls (presets,
   length, visibility) reuse Consensable's preset-seg / seg-toggle styles. */
.cise-custom-models { display: flex; gap: 0.4rem; flex-wrap: wrap; max-width: 600px; }
.cise-model-chip {
  padding: 0.35rem 0.65rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface2); color: var(--text-secondary);
  font-family: 'Outfit', sans-serif; font-size: 0.78rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: all 0.15s;
}
.cise-model-chip:hover { border-color: var(--teal-bright); color: var(--text); }
.cise-model-chip.picked {
  background: color-mix(in srgb, var(--teal-bright) 12%, transparent); border-color: var(--teal-bright); color: var(--teal-bright);
}
:root[data-theme="light"] .cise-model-chip.picked { background: color-mix(in srgb, var(--teal-bright) 10%, transparent); }
.cise-model-chip .role-tag {
  font-size: 0.62rem;
  padding: 0.08rem 0.35rem; border-radius: 3px;
  background: var(--teal-bright); color: var(--on-accent);
}
.cise-model-chip .role-for     { background: #22c55e; }
.cise-model-chip .role-against { background: #ef4444; }

/* ── Consensise screens ─────────────────────────────────────────────── */
.queue-wrap { width: 100%; max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.queue-preamble { font-family: 'Outfit', sans-serif; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 1.25rem; padding: 0.75rem 1rem; background: var(--surface2); border-radius: var(--radius); border-left: 3px solid var(--teal-bright); }
.queue-position { font-size: 0.95rem; color: var(--text); margin-bottom: 0.25rem; font-weight: 500; }
.queue-position-note { font-family: 'Outfit', sans-serif; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }
.queue-footnote { font-family: 'Outfit', sans-serif; font-size: 0.8rem; color: var(--text-muted); line-height: 1.55; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.queue-footnote a { color: var(--teal-bright); text-decoration: none; }
.queue-footnote a:hover { text-decoration: underline; }
/* Inline pill used to prefix a question with its mode on the Consensise queue
   screen and in the Jobs list. Small, uppercase, indigo-accent. */
.mode-badge { display: inline-block; font-family: 'Outfit', sans-serif; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.15rem 0.5rem; border-radius: 4px; background: color-mix(in srgb, var(--teal-bright) 15%, transparent); color: var(--teal-bright); vertical-align: middle; margin-right: 0.4rem; }
.ticket-status { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.ticket-status-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.ticket-status-dot.pending { background: var(--warning); }
.ticket-status-dot.processing { background: var(--teal-bright); animation: cise-pulse 1.5s infinite; }
.ticket-status-dot.completed { background: #22c55e; }
.ticket-status-dot.failed { background: var(--error); }
@keyframes cise-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.ticket-status-text { font-size: 1.1rem; font-weight: 500; }
.ticket-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.ticket-meta span { margin-right: 1.5rem; }
.ticket-question { font-size: 1rem; padding: 1rem; background: var(--surface2); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 1.5rem; }

.jobs-wrap { width: 100%; max-width: 700px; }
.jobs-section-title { font-family: 'Outfit', sans-serif; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.75rem; margin-top: 1.5rem; }
.jobs-section-title:first-child { margin-top: 0; }
.job-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem; margin-bottom: 0.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color 0.2s;
}
.job-card:hover { border-color: var(--teal-bright); }
.job-question { flex: 1; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-time { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.status-pill {
  font-family: 'Outfit', sans-serif; font-size: 0.7rem; font-weight: 600;
  padding: 0.15rem 0.5rem; border-radius: 4px; white-space: nowrap;
}
.status-pill.queued_local { background: color-mix(in srgb, var(--text-muted) 15%, transparent); color: var(--text-muted); }
.status-pill.pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-pill.processing { background: color-mix(in srgb, var(--teal-bright) 15%, transparent); color: var(--teal-bright); }
.status-pill.completed { background: rgba(34,197,94,0.15); color: #22c55e; }
.status-pill.failed { background: rgba(239,68,68,0.15); color: var(--error); }
.status-pill.cancelled { background: color-mix(in srgb, var(--text-muted) 12%, transparent); color: var(--text-muted); font-style: italic; }
.job-card-delete {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0.2rem 0.4rem;
  font-size: 0.9rem; line-height: 1; border-radius: 4px;
}
.job-card-delete:hover { color: var(--error); background: color-mix(in srgb, var(--error) 10%, transparent); }
.tier-badge { font-family: 'Outfit', sans-serif; font-size: 0.65rem; font-weight: 600; padding: 0.15rem 0.4rem; border-radius: 3px; }
.tier-badge.free { background: rgba(136,153,170,0.15); color: var(--text-muted); }
.tier-badge.essential { background: color-mix(in srgb, var(--teal-bright) 15%, transparent); color: var(--teal-bright); }
.tier-badge.premium { background: rgba(168,132,74,0.15); color: #c8a84a; }
.tier-badge.ultimate { background: rgba(124, 58, 237, 0.16); color: #a78bfa; }

.topbar-jobs-btn { position: relative; }
.topbar-jobs-btn.active { color: var(--teal-bright); }
.cise-nav-badge {
  position: absolute; top: -4px; right: -6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal-bright); color: var(--on-accent);
  font-size: 0.58rem; font-weight: 700; line-height: 1;
  min-width: 14px; height: 14px; border-radius: 7px;
  padding: 0 3px; pointer-events: none;
}

@media (max-width: 600px) {
  .job-card { gap: 0.5rem; padding: 0.75rem; }
}
