:root {
  color-scheme: dark;
  --ink: #edf5f7;
  --muted: #9aabb1;
  --paper: #0f1619;
  --paper-strong: #162126;
  --line: #2c3a40;
  --accent: #5cddd3;
  --accent-pale: #173337;
  --green: #66d99a;
  --shadow: 0 22px 70px rgba(0, 0, 0, .34);
  --page-background: radial-gradient(circle at 90% 0%, #193139 0%, transparent 34%), linear-gradient(145deg, #101719, #0b1113);
  --surface-soft: rgba(22, 33, 38, .82);
  --surface-hover: #1c2a2f;
  --code-bg: #091013;
  --code-ink: #e8f3f4;
  --subtle-ink: #77898f;
  --button-ink: #071114;
  --highlight: var(--accent);
  --evidence-text: var(--accent);
  --staged-accent: #f28a24;
  --staged-pale: rgba(242, 138, 36, .14);
  --reading-size: 15px;
  --compact-title-size: 13px;
  --compact-body-size: 12px;
  --metadata-size: 10px;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page-background);
  font-family: var(--font-body);
  min-height: 100vh;
}

.login-body { min-height: 100dvh; overflow-x: hidden; background: var(--page-background); }
.login-page.embedded-login { display: none; }
html[data-page="login"] body { overflow: hidden; }
html[data-page="login"] .embedded-login { display: grid; }
html[data-page="login"] .shell,
html[data-page="login"] .mobile-edge-pull { display: none !important; }
.login-page { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) clamp(340px, 34vw, 560px); }
.login-introduction { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 8vw, 132px); overflow: hidden; }
.login-introduction::before { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 1px; background: var(--line); }
.login-introduction::after { content: ""; position: absolute; width: min(58vw, 760px); aspect-ratio: 1; left: -25%; bottom: -58%; border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 50%; box-shadow: 0 0 100px color-mix(in srgb, var(--accent) 7%, transparent); pointer-events: none; }
.login-brand { position: absolute; top: clamp(28px, 4vw, 56px); left: clamp(30px, 5vw, 76px); display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.login-brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--accent); font-size: 10px; letter-spacing: .08em; }
.login-introduction > .eyebrow { margin: 0 0 16px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.login-introduction h1 { max-width: 780px; margin: 0; font: 680 clamp(48px, 6vw, 94px)/.94 var(--font-display); letter-spacing: -.065em; }
.login-copy { max-width: 640px; margin: 30px 0 0; color: var(--muted); font-size: clamp(15px, 1.3vw, 18px); line-height: 1.65; }
.login-features { max-width: 650px; display: grid; gap: 0; margin: 48px 0 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.login-features li { display: flex; align-items: center; gap: 18px; min-height: 52px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.login-features span { color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.login-panel { display: grid; place-items: center; min-height: 100%; padding: 48px; background: color-mix(in srgb, var(--paper) 91%, transparent); }
.login-panel-inner { width: min(100%, 390px); }
.login-panel .eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.login-panel h2 { margin: 0; font: 680 clamp(42px, 4vw, 60px)/1 var(--font-display); letter-spacing: -.055em; }
.login-panel h2 + p { margin: 18px 0 30px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.google-sign-in { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 13px; padding: 0 20px; border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line)); border-radius: 2px; background: var(--ink); color: var(--button-ink); cursor: pointer; font-size: 13px; font-weight: 780; transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease; }
.google-sign-in:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: 0 12px 30px rgba(0,0,0,.24); }
.google-sign-in:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.google-sign-in svg { width: 19px; height: 19px; flex: 0 0 19px; }
.login-feedback { min-height: 36px; margin: 13px 0 0; color: var(--subtle-ink); font-size: 10px; line-height: 1.5; }
.login-feedback[data-state="notice"] { color: var(--accent); }
.login-rule { height: 1px; margin: 28px 0; background: var(--line); }
.login-privacy { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.login-back { display: inline-block; margin-top: 24px; color: var(--ink); font-size: 11px; font-weight: 750; text-decoration: none; }
.login-back:hover { color: var(--accent); }
.account-action-link { display: inline-grid; place-items: center; min-height: 36px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: 11px; font-weight: 750; text-decoration: none; }
.account-action-link:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 820px) {
  .login-page { display: block; }
  html[data-page="login"] .embedded-login { display: block; }
  .login-introduction { min-height: 54dvh; justify-content: flex-end; padding: 112px 26px 46px; }
  .login-introduction::before { top: auto; left: 0; width: auto; height: 1px; }
  .login-brand { top: 28px; left: 26px; }
  .login-introduction h1 { font-size: clamp(44px, 13vw, 68px); }
  .login-copy { margin-top: 22px; font-size: 14px; }
  .login-features { display: none; }
  .login-panel { min-height: 46dvh; padding: 42px 26px max(42px, env(safe-area-inset-bottom)); }
}

button, textarea { font: inherit; }
.hidden { display: none !important; }
.mobile-only { display: none; }
.shell { width: 100%; max-width: none; margin: 0; padding: 0; }
.masthead {
  display: none;
}
.wordmark { display: flex; align-items: center; gap: 12px; font-weight: 750; letter-spacing: -.02em; }
.mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 10px; font: 800 11px var(--font-display); letter-spacing: .04em; }
.view-switcher { position: absolute; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); white-space: nowrap; }
.view-switcher button { min-width: 29px; min-height: 29px; padding: 0 9px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; transition: color 140ms ease; }
.view-switcher button:hover:not(:disabled) { background: transparent; color: var(--accent); }
.view-switcher button[aria-pressed="true"] { background: transparent; color: var(--accent); box-shadow: none; font-weight: 900; }
.view-switcher button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.view-switcher button:disabled { opacity: .38; cursor: default; }
.view-options-divider { align-self: stretch; width: 1px; margin: 5px 2px; background: var(--line); }
.page-options-mode-divider { align-self: stretch; width: 1px; margin: 5px 2px; background: var(--line); }
.page-options-label { padding: 0 4px 0 1px; color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .02em; }
.view-switcher .page-options-back { min-width: 27px; padding-inline: 7px; color: var(--accent); font-size: 14px; }
.view-switcher .page-options-more { min-width: 39px; color: var(--ink); }
.page-options-group { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.view-switcher .nav-option { color: var(--ink); }
.masthead-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.nav-settings-toggle { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: color 140ms ease, background-color 140ms ease; }
.nav-settings-toggle:hover, .nav-settings-toggle[aria-pressed="true"] { color: var(--accent); background: var(--accent-pale); }
.nav-settings-toggle:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.nav-settings-toggle svg { width: 17px; height: 17px; }
.reading-size-controls { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.reading-size-controls > span { padding: 0 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.reading-size-controls button { min-width: 31px; height: 29px; padding: 0 7px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 800; }
.reading-size-controls button:hover:not(:disabled) { background: var(--accent-pale); color: var(--accent); }
.reading-size-controls button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.reading-size-controls button:disabled { opacity: .35; cursor: default; }
.reading-size-controls .reading-size-value { min-width: 42px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.status { color: var(--muted); display: flex; gap: 9px; align-items: center; font-size: 13px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(62,112,80,.12); }

.application-grid { --desktop-pane-active-width: 50vw; --query-rail-width: clamp(244px, 17vw, 292px); display: grid; grid-template-columns: var(--query-rail-width) 9px minmax(0, 1fr); min-height: 100vh; }
.primary-stage { min-width: 0; padding-left: 0; }
.query-rail { position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column; padding: 34px 26px 54px; }
.query-rail-scale { display: contents; }
.query-resizer { position: relative; align-self: stretch; width: 9px; height: auto; min-height: 100vh; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; }
.query-resizer::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 1px; background: var(--line); box-shadow: 0 0 0 transparent; pointer-events: none; transition: background-color 180ms ease, box-shadow 260ms ease; }
.query-resizer:hover, .query-resizer:focus-visible, .query-resizer.dragging { outline: none; }
.query-resizer:hover::before, .query-resizer:focus-visible::before { background: color-mix(in srgb, var(--accent) 72%, var(--line)); box-shadow: 0 0 14px 2px color-mix(in srgb, var(--accent) 13%, transparent); }
.query-resizer.dragging::before { background: var(--accent); box-shadow: 0 0 22px 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.files-resizer { display: none; position: relative; width: 9px; height: 100%; min-height: 0; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; }
.files-resizer::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 1px; background: var(--line); box-shadow: 0 0 0 transparent; pointer-events: none; transition: background-color 180ms ease, box-shadow 260ms ease; }
.files-resizer:hover,
.files-resizer:focus-visible,
.files-resizer.dragging { outline: none; }
.files-resizer:hover::before,
.files-resizer:focus-visible::before { background: color-mix(in srgb, var(--accent) 72%, var(--line)); box-shadow: 0 0 14px 2px color-mix(in srgb, var(--accent) 13%, transparent); }
.files-resizer.dragging::before { background: var(--accent); box-shadow: 0 0 22px 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.query-rail-head { padding: 0; border: 0; }
.query-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 0 24px; overflow: hidden; }
.query-title-row > div { min-width: 0; overflow: hidden; }
.query-rail-head .eyebrow { margin: 0 0 6px; }
.query-rail-head h2 { max-width: 100%; margin: 0 0 12px; overflow: hidden; font: 680 clamp(34px, 3vw, 46px)/1 var(--font-display); letter-spacing: -.045em; text-overflow: clip; white-space: nowrap; }
.query-intro { margin: 0; color: var(--muted); font: 400 13px/1.55 var(--font-body); }
.staged-question-composer { flex: 0 0 auto; max-height: 0; margin: 0; overflow: hidden; opacity: 0; transform: translateY(-10px); transition: max-height 240ms ease, margin 240ms ease, opacity 160ms ease, transform 240ms ease; }
.staged-question-composer.open { max-height: 560px; margin: 0 0 18px; opacity: 1; transform: translateY(0); }
.staged-question-composer-inner { padding: 15px; border: 1px solid color-mix(in srgb, var(--staged-accent) 52%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--staged-pale) 48%, var(--paper-strong)); box-shadow: 0 14px 34px color-mix(in srgb, var(--staged-accent) 10%, transparent); }
.staged-question-composer #stagedQuestionLabel { display: block; margin-bottom: 9px; color: var(--staged-accent); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.staged-question-composer textarea { width: 100%; min-height: 78px; padding: 0; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--ink); font: 500 14px/1.48 var(--font-body); }
.staged-question-composer textarea::placeholder { color: var(--subtle-ink); }
.staged-question-files { margin: 11px 0 0; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--staged-accent) 24%, var(--line)); }
.staged-question-files-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.staged-question-files-heading span { color: var(--staged-accent); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.staged-question-files-heading small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.staged-question-files-list { max-height: 146px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overscroll-behavior: contain; }
.staged-question-file { min-height: 28px; display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 2px; border: 0; border-radius: 0; background: transparent; cursor: pointer; }
.staged-question-file input { order: 2; width: 10px; height: 10px; flex: 0 0 10px; margin: 0 2px 0 0; appearance: none; border: 1px solid color-mix(in srgb, var(--staged-accent) 58%, var(--line)); border-radius: 50%; background: transparent; cursor: pointer; transition: border-color 100ms ease, background-color 100ms ease, box-shadow 100ms ease; }
.staged-question-file input:checked { border-color: var(--staged-accent); background: var(--staged-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--staged-accent) 10%, transparent); }
.staged-question-file span { order: 1; min-width: 0; flex: 1; overflow: hidden; color: var(--ink); font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.staged-question-file:has(input:focus-visible) { outline: 2px solid color-mix(in srgb, var(--staged-accent) 38%, transparent); outline-offset: 1px; }
.staged-question-file:has(input:not(:checked)) { opacity: .58; }
.staged-question-files-empty { margin: 4px 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.staged-question-help { min-height: 30px; margin: 8px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.staged-question-help[data-state="error"] { color: #c85b43; }
.staged-question-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 11px; border-top: 1px solid color-mix(in srgb, var(--staged-accent) 24%, var(--line)); }
.staged-question-actions button { width: auto; height: 32px; min-height: 32px; display: inline-grid; place-items: center; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer; font-size: 11px; font-weight: 800; line-height: normal; }
.staged-question-cancel { background: transparent; color: var(--muted); }
.staged-question-submit { background: var(--staged-accent); color: #fff; }
.staged-question-actions button:disabled { opacity: .5; cursor: wait; }
.settings-page,
.files-page { display: none; min-height: 100vh; background: var(--paper); }
.application-grid.settings-view-active,
.application-grid.files-view-active { grid-template-columns: minmax(0, 1fr); }
.application-grid.settings-view-active .query-rail,
.application-grid.settings-view-active .query-resizer,
.application-grid.settings-view-active .source-resizer,
.application-grid.settings-view-active .files-resizer,
.application-grid.settings-view-active .primary-stage > .hero,
.application-grid.settings-view-active .primary-stage > .workspace,
.application-grid.settings-view-active .result-column,
.application-grid.settings-view-active .source-panel,
.application-grid.settings-view-active .files-page,
.application-grid.files-view-active .query-rail,
.application-grid.files-view-active .query-resizer,
.application-grid.files-view-active .primary-stage > .hero,
.application-grid.files-view-active .primary-stage > .workspace,
.application-grid.files-view-active .settings-page { display: none !important; }
.application-grid.settings-view-active .settings-page { display: block; }
.application-grid.settings-view-active .source-resizer,
.application-grid.settings-view-active .files-resizer { display: none !important; }
.application-grid.files-view-active .files-page { display: block; }
.settings-page-inner { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding: clamp(54px, 8vw, 104px) 0 80px; }
.settings-page h1 { margin: 8px 0 14px; font: 680 clamp(38px, 5vw, 64px)/1 var(--font-display); letter-spacing: -.045em; }
.settings-intro { width: min(620px, 100%); margin: 0; color: var(--muted); font: 400 16px/1.65 var(--font-body); }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 18px; margin-top: 42px; }
.settings-card { display: flex; min-width: 0; height: 100%; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); box-shadow: var(--shadow); }
.settings-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.settings-card-heading .eyebrow { margin: 0 0 7px; }
.settings-card h2 { margin: 0; font: 650 24px var(--font-display); letter-spacing: -.025em; }
.settings-card-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); font: 800 12px var(--font-display); }
.settings-card label { display: block; margin-bottom: 8px; color: var(--subtle-ink); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.settings-card select { width:100%; min-height:44px; padding:0 38px 0 13px; border:1px solid var(--line); border-radius:10px; background-color:var(--paper-strong); color:var(--ink); cursor:pointer; font:700 13px var(--font-body); appearance:none; -webkit-appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);
  background-position:calc(100% - 19px) center,calc(100% - 14px) center; background-size:5px 5px,5px 5px; background-repeat:no-repeat;
}
.settings-card select:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.settings-card > p { margin: 11px 1px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.settings-card input[type="text"] { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-strong); color: var(--ink); font: 650 13px var(--font-body); }
.settings-card input:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.settings-card select:disabled { opacity: .46; cursor: default; }
.workspace-preference-toggle { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; margin-top: 4px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.workspace-preference-toggle label { margin: 0; color: var(--ink); font-size: 12px; letter-spacing: 0; text-transform: none; }
.workspace-preference-toggle p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.workspace-preference-toggle input { width: 38px; height: 21px; margin: 0; appearance: none; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-strong); cursor: pointer; transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease; }
.workspace-preference-toggle input::before { content: ""; display: block; width: 15px; height: 15px; margin: 2px; border-radius: 50%; background: var(--muted); transition: transform 140ms ease, background-color 140ms ease; }
.workspace-preference-toggle input:checked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--paper-strong)); box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 15%, transparent); }
.workspace-preference-toggle input:checked::before { background: var(--accent); transform: translateX(17px); }
.workspace-preference-status { min-height: 18px; margin: 9px 1px 18px !important; color: var(--muted); font-size: 10px !important; }
.account-status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.account-status-row strong { color: var(--ink); font-size: 12px; }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.account-actions button { min-height: 40px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-strong); color: var(--ink); font-size: 12px; font-weight: 750; }
.account-actions button:disabled { opacity: .4; cursor: not-allowed; }
.setting-control-heading,
.highlight-color-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setting-control-heading output { color: var(--accent); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.source-settings input[type="range"] { width: 100%; margin: 2px 0 24px; accent-color: var(--accent); }
.source-settings > label { margin-top: 3px; }
.highlight-color-row { margin-top: 20px; }
.highlight-color-row + .highlight-color-row { margin-top: 12px; }
.highlight-color-row label { margin: 0; }
.highlight-color-row input[type="color"] { width:20px; height:20px; padding:0; border:0; border-radius:50%; background:transparent; box-shadow:none; appearance:none; -webkit-appearance:none; overflow:hidden; cursor:pointer; }
.highlight-color-row input[type="color"]::-webkit-color-swatch-wrapper { padding:0; }
.highlight-color-row input[type="color"]::-webkit-color-swatch { border:0; border-radius:50%; }
.highlight-color-row input[type="color"]::-moz-color-swatch { border:0; border-radius:50%; }
.highlight-color-row input[type="color"]:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.source-settings-preview { padding-top: 18px; border-top: 1px solid var(--line); }
.admin-summary { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.admin-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 10px 13px; background: var(--paper-strong); }
.admin-summary > div + div { border-top: 1px solid var(--line); }
.admin-summary span { color: var(--subtle-ink); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.admin-summary strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.admin-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.admin-actions button { display: grid; gap: 4px; min-height: 64px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-strong); color: var(--ink); text-align: left; cursor: pointer; }
.admin-actions button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 54%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--paper-strong)); }
.admin-actions button:disabled { opacity: .4; cursor: not-allowed; }
.admin-actions span { font-size: 12px; font-weight: 800; }
.admin-actions small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.files-page-inner { width: min(1080px, calc(100% - 48px)); margin: 0 auto; padding: clamp(48px, 7vw, 88px) 0 80px; }
.files-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 34px; overflow: hidden; }
.files-page-heading > div { min-width: 0; overflow: hidden; }
.files-page-heading .eyebrow { margin: 0 0 6px; }
.files-page h1 { max-width: 100%; margin: 0 0 13px; overflow: hidden; font: 680 clamp(34px, 3vw, 46px)/1 var(--font-display); letter-spacing: -.045em; text-overflow: clip; white-space: nowrap; }
.files-intro { width: min(650px, 100%); margin: 0; color: var(--muted); font: 400 16px/1.65 var(--font-body); }
.file-count { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: 12px; font-weight: 750; }
.file-upload-card { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-soft); box-shadow: var(--shadow); }
.file-upload-copy { display: flex; align-items: center; gap: 14px; }
.file-upload-copy strong { display: block; font: 650 19px var(--font-display); }
.file-upload-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.file-upload-glyph { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: var(--accent); background: var(--accent-pale); font-size: 21px; }
.file-upload-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.file-upload-actions input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.file-picker,
.file-upload-actions button,
.file-catalog-heading button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-strong); color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 750; }
.file-picker:hover,
.file-catalog-heading button:hover { border-color: var(--accent); color: var(--accent); }
.file-upload-actions button { margin-left: auto; border-color: var(--ink); background: var(--ink); color: var(--button-ink); }
.file-upload-actions button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent); }
.file-upload-actions button:disabled,
.file-catalog-heading button:disabled { opacity: .5; cursor: wait; }
#fileUploadName { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.file-upload-status { min-height: 19px; margin: 13px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.file-upload-status[data-state="success"] { color: var(--green); }
.file-upload-status[data-state="error"] { color: #b34f48; }
.file-upload-status[data-state="working"] { color: var(--accent); }
.file-catalog { margin-top: 44px; }
.file-catalog-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.file-catalog-heading .eyebrow { margin: 0 0 6px; }
.file-catalog-heading h2 { margin: 0; font: 650 26px var(--font-display); letter-spacing: -.025em; }
.file-list { display: grid; border-top: 1px solid var(--line); }
.file-list-empty { margin: 0; padding: 28px 4px; color: var(--muted); font-size: 13px; }
.file-row { width: 100%; min-width: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; column-gap: 15px; row-gap: 8px; padding: 16px 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: inherit; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.file-row:hover,
.file-row:focus-visible { background: var(--surface-soft); }
.file-kind { grid-column: 1; grid-row: 1 / span 2; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--accent); background: var(--paper-strong); font-size: 9px; font-weight: 850; }
.file-row-copy { grid-column: 2; grid-row: 1; min-width: 0; }
.file-row-copy strong,
.file-row-hash { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-copy strong { font-size: var(--compact-title-size); }
.file-row-hash { width: 100%; max-width: 100%; margin-top: 4px; color: var(--subtle-ink); background: none; font-size: var(--metadata-size); }
.file-row-meta { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.file-row-meta span { padding: 4px 7px; border-radius: 999px; background: var(--accent-pale); color: var(--accent); font-size: var(--metadata-size); font-weight: 750; }
.rail-new-question { width: 100%; display: flex; justify-content: space-between; align-items: center; margin: 0 0 13px; padding: 9px 12px; border-radius: 9px; font-size: 12px; }
.mcp-live { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-soft); cursor: pointer; font-size: 10px; font-weight: 750; white-space: nowrap; }
.mcp-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(62,112,80,.12); }
.mcp-live:hover,
.mcp-live:focus-visible,
.mcp-live[aria-expanded="true"] { outline: none; border-color: color-mix(in srgb, var(--accent) 36%, var(--line)); }
.mcp-live-separator { color: var(--line-strong); }
.mcp-live-add { color: var(--accent); font-weight: 800; }
.mcp-live[data-state="connecting"] i,
.mcp-live[data-state="reconnecting"] i { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); animation: observer-pulse 1.4s ease-in-out infinite; }
.mcp-live[data-state="offline"] i { background: #a64f46; box-shadow: 0 0 0 4px rgba(166,79,70,.12); }
@keyframes observer-pulse { 0%, 100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.08); } }
.mcp-events { flex: 1; min-height: 0; width: 100%; margin-left: 0; overflow: auto; padding: 0; display: grid; align-content: start; gap: 0; border-top: 0; background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat; }
.mcp-empty { margin: 0; padding: 16px 10px; color: var(--muted); font-size: 13px; }
.question-batch-controls { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:6px 14px 10px 26px; }
.question-batch-controls button { background:transparent; color:var(--accent); border:1px solid var(--line); border-radius:20px; padding:5px 10px; cursor:pointer; font:inherit; font-size:11px; }
.question-batch-controls button:disabled { opacity:.4; cursor:default; }
.question-batch-controls small { color:var(--muted); font-size:10px; }
.query-entry { position: relative; width: 100%; display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: 10px; padding: 16px 4px 16px 26px; border: 0; border-radius: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background 80ms ease, box-shadow 80ms ease, transform 80ms ease; }
.query-entry::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 1px; background: var(--line); pointer-events: none; }
.query-entry { --query-state-accent:var(--accent); }
.query-entry:hover { background: color-mix(in srgb, var(--query-state-accent) 8%, transparent); }
.query-entry.pending,
.query-entry.running { --query-state-accent:var(--staged-accent); }
.query-entry:active { background: color-mix(in srgb, var(--query-state-accent) 12%, transparent); box-shadow: inset 3px 0 0 var(--query-state-accent), 0 0 18px color-mix(in srgb, var(--query-state-accent) 16%, transparent); transform: scale(.995); }
.query-entry.selected { background: color-mix(in srgb, var(--query-state-accent) 12%, transparent); box-shadow: inset 3px 0 0 var(--query-state-accent); }
.query-entry-sequence { --number-block-width: 48px; width: 100%; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; padding-top: 0; white-space: nowrap; }
.query-entry-sequence b { display: block; width: var(--number-block-width); color: var(--accent); font: 800 36px/.88 "DIN Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .015em; text-align: left; }
.query-entry-sequence small { display: block; width: var(--number-block-width); color: var(--subtle-ink); font: 720 8px/1.2 var(--font-body); letter-spacing: .01em; text-align: left; }
.query-entry-body { min-width: 0; }
.query-entry-body strong,
.query-entry-synopsis { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; }
.query-entry-body strong { -webkit-line-clamp: 2; font-size: var(--compact-title-size); line-height: 1.35; }
.query-entry-synopsis { -webkit-line-clamp: 2; margin-top: 7px; color: var(--muted); font: var(--compact-body-size)/1.42 var(--font-body); }
.query-entry-body small { display: block; margin-top: 7px; color: var(--subtle-ink); font-size: 9px; line-height: 1.45; }
.query-entry.pending::after { background: color-mix(in srgb, var(--staged-accent) 34%, var(--line)); }
.query-entry.pending .query-entry-sequence b,
.query-entry.pending .query-entry-body > small { color: var(--staged-accent); }
.query-entry.pending .query-entry-synopsis { color: color-mix(in srgb, var(--staged-accent) 76%, var(--muted)); }
.query-entry.failed { --staged-accent: #e16363; --query-state-accent:#e16363; }
.query-entry.partial { --query-state-accent:var(--partial-accent); --staged-accent:var(--partial-accent); }
.query-entry.queued { --query-state-accent:var(--staged-accent); }
.query-entry.queued .query-entry-sequence b,
.query-entry.queued .query-entry-body > small,
.answer-question-status[data-answer-state="queued"] { color:var(--staged-accent); }
.query-entry.partial::after { background:color-mix(in srgb,var(--partial-accent) 34%,var(--line)); }
.query-entry.partial .query-entry-sequence b,
.query-entry.partial .query-entry-sequence small,
.query-entry.partial .query-entry-body > small { color:var(--partial-accent); }
.query-entry.running::after { background:color-mix(in srgb,var(--staged-accent) 34%,var(--line)); }
.query-entry.running .query-entry-sequence b,
.query-entry.running .query-entry-body > small { color:var(--staged-accent); }
.query-entry.failed::after { background: color-mix(in srgb, var(--staged-accent) 34%, var(--line)); }
.query-entry.failed .query-entry-sequence b,
.query-entry.failed .query-entry-sequence small,
.query-entry.failed .query-entry-body > small { color: var(--staged-accent); }
.query-entry.failed .query-entry-synopsis { color: color-mix(in srgb, var(--staged-accent) 76%, var(--muted)); }
.staged-question-entry-actions { display: flex; flex-direction: column; align-items: center; gap: 5px; align-self: center; }
.staged-question-entry-actions button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.staged-question-entry-actions button:hover,
.staged-question-entry-actions button:focus-visible { outline: none; color: var(--staged-accent); background: var(--staged-pale); }
.staged-question-entry-actions svg { width: 14px; height: 14px; }
.mcp-json-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.mcp-json-grid pre { max-height: 280px; overflow: auto; margin: 0; padding: 12px; border-radius: 9px; background: var(--code-bg); color: var(--code-ink); white-space: pre-wrap; word-break: break-word; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.mcp-evidence-list { display: grid; gap: 7px; margin-top: 12px; }
.mcp-evidence { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--paper-strong); color: var(--ink); cursor: pointer; }
.mcp-evidence:hover { border-color: var(--accent); }
.mcp-evidence span { display: block; margin-bottom: 5px; color: var(--accent); font: 800 10px ui-sans-serif, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; }
.mcp-evidence q { display: block; color: var(--muted); font: 13px/1.45 var(--font-body); }
.mcp-evidence b { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--accent); font: 800 11px ui-sans-serif, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .05em; }
.mcp-evidence b i { font-style: normal; font-size: 15px; }
.mcp-inspector { margin-top: 28px; }
.mcp-inspector summary { color: var(--accent); font: 800 11px ui-sans-serif, system-ui, sans-serif; cursor: pointer; text-transform: uppercase; letter-spacing: .06em; }

.hero { padding: clamp(62px, 9vw, 130px) 0 80px; max-width: 980px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; color: var(--accent); }
h1 { margin: 18px 0 24px; font: 720 clamp(48px, 7vw, 92px)/.94 var(--font-display); letter-spacing: -.065em; }
h1 em { color: var(--accent); font-style: normal; font-weight: 720; }
.intro { width: min(680px, 100%); color: var(--muted); font: 400 18px/1.65 var(--font-body); }
.ask-card { margin-top: 46px; width: min(850px, 100%); padding: 26px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.ask-card label { display: block; font-size: 12px; font-weight: 800; margin-bottom: 13px; }
.ask-card textarea { width: 100%; border: 0; resize: vertical; outline: none; background: transparent; color: var(--ink); font: 400 22px/1.45 var(--font-body); min-height: 92px; }
.ask-card textarea::placeholder { color: #a19d91; }
.observatory-empty { display: flex; align-items: center; gap: 18px; }
.observatory-empty strong { display: block; font: 650 19px var(--font-display); }
.observatory-empty p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.ask-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid var(--line); padding-top: 17px; }
.ask-footer > span { color: var(--muted); font-size: 12px; }
.ask-footer button, .new-question { border: 0; border-radius: 999px; padding: 12px 18px; background: var(--ink); color: var(--button-ink); cursor: pointer; font-weight: 700; }
.ask-footer button:hover { background: var(--accent); }
.sample { border: 0; background: transparent; padding: 16px 2px; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.voice-card { margin-top: 18px; width: min(850px, 100%); padding: 20px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-soft); }
.voice-copy { display: flex; align-items: center; gap: 14px; }
.voice-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: var(--accent-pale); }
.voice-copy h2 { margin: 0 0 4px; font: 650 19px var(--font-display); }
.voice-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.voice-button { margin-top: 16px; border: 0; border-radius: 999px; padding: 11px 18px; color: white; background: var(--accent); cursor: pointer; font-weight: 800; }
.voice-button[data-active="true"] { background: var(--ink); }
.voice-button:disabled { opacity: .55; cursor: wait; }
.voice-transcript { margin-top: 16px; padding: 13px 15px; border-left: 3px solid var(--accent); background: var(--paper-strong); font: 15px/1.5 var(--font-body); }
.voice-transcript p { margin: 5px 0; }
.voice-transcript strong { color: var(--accent); font: 800 10px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.question-options { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 17px; }
.option-heading { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; margin-bottom: 12px; }
.option-heading strong { font-size: 13px; }
.option-heading span { color: var(--muted); font-size: 11px; }
.option-list { display: grid; gap: 8px; }
.question-option { width: 100%; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-strong); color: var(--ink); cursor: pointer; }
.question-option:hover { border-color: var(--accent); background: var(--surface-hover); }
.question-option span:first-child { color: var(--accent); font-weight: 850; }
#voiceAudio { display: none; }

.workspace { --source-width: 48%; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; background: var(--paper); }
.workspace:not(.source-open) { align-content: start; }
.workspace.source-open { grid-template-columns: minmax(0, 1fr) 9px minmax(0, var(--source-width)); }
.result-column { min-width: 0; padding: 34px clamp(26px, 3vw, 54px) 70px; }
.result-column > * { width: min(820px, 100%); margin-left: auto; margin-right: auto; }
.viewer-empty { width: 100%; max-width: 420px; padding: 72px 8px 44px; text-align: left; color: var(--muted); }
.viewer-empty .source-glyph {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.viewer-empty h3 { margin: 0 0 8px; color: var(--ink); font: 650 27px/1.1 var(--font-display); }
.viewer-empty p { margin: 0; font: 400 16px/1.6 var(--font-body); }
.question-viewer-empty { align-self: start; }
.answer-glyph svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.result-topline { position: sticky; top: 0; z-index: 20; grid-column: 1 / -1; min-width: 0; min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 96%, transparent); backdrop-filter: blur(16px); }
.record-heading { min-width: 0; display: flex; align-items: center; gap: 12px; padding-left: clamp(22px, 2.4vw, 40px); }
.export-markdown { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; cursor: pointer; }
.export-markdown:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-pale); }
.export-markdown:disabled { opacity: .35; cursor: default; }
.result-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-right: 22px; }
.workspace.source-open .result-topline { display: grid; grid-template-columns: minmax(0, 1fr) 9px minmax(0, var(--source-width)); gap: 0; }
.workspace.source-open .result-topline > .record-heading { grid-column: 1; }
.workspace.source-open .result-actions { grid-column: 3; width: 100%; padding-left: 0; padding-right: 22px; border-left: 0; }

@media (min-width: 1181px) {
  /* Desktop treats Query, Answer, Document, and Files as peer workspaces.
     Each pane owns its surface and scroll context; the nine-pixel seams remain
     the resize targets rather than visually merging adjacent content. */
  .application-grid { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; background: var(--paper); }
  .query-rail {
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 0;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
    background: var(--paper);
  }
  .query-rail-scale {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    width: min(var(--desktop-pane-active-width), calc(100% / var(--query-content-scale, 1)));
    height: calc(100% / var(--query-content-scale, 1));
    min-width: 0;
    min-height: 0;
    padding: 34px 26px 54px;
    box-sizing: border-box;
    margin-right: auto;
    margin-left: auto;
    transform: scale(var(--query-content-scale, 1));
    transform-origin: left top;
  }
  .query-rail-scale .mcp-events {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  .answer-pane-scale,
  .source-page-inner,
  .files-page-inner {
    width: min(var(--desktop-pane-active-width), calc(100% / var(--pane-content-scale, 1)));
    min-width: 0;
    box-sizing: border-box;
    margin-right: auto;
    margin-left: auto;
    transform: scale(var(--pane-content-scale, 1));
    transform-origin: left top;
  }
  .answer-pane-scale,
  .files-page-inner {
    height: calc(100% / var(--pane-content-scale, 1));
    min-height: 0;
  }
  .answer-pane-scale {
    display: flex;
    flex-direction: column;
    padding: 34px 26px 0;
  }
  .source-page-inner { height: calc(100% / var(--pane-content-scale, 1)); }
  .primary-stage { position: relative; height: 100%; min-height: 0; overflow: hidden; background: var(--paper); }
  .application-grid.settings-view-active .settings-page,
  .application-grid.files-view-active .files-page {
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  .workspace {
    position: relative;
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }
  .workspace.source-open { grid-template-rows: minmax(0, 1fr); }
  .result-topline {
    position: absolute;
    inset: 0 0 auto;
    height: 68px;
    min-height: 68px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }
  .record-heading,
  .result-actions {
    height: 68px;
    min-height: 68px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper) 96%, var(--paper-strong));
  }
  .result-column {
    position: relative;
    grid-row: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: var(--paper);
  }
  .result-column > * {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }
  .result-column > .answer-pane-scale {
    width: min(var(--desktop-pane-active-width), calc(100% / var(--pane-content-scale, 1)));
    margin-right: auto;
    margin-left: auto;
  }
  .answer-page-heading { flex: 0 0 auto; }
  #answerView:not(.hidden) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .answer-body-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-bottom: 12px;
  }
  .receipt {
    flex: 0 0 auto;
    margin-top: 0;
    padding: 12px 0 14px;
  }
  .source-resizer {
    grid-row: 1;
    position: relative;
    top: auto;
    align-self: stretch;
    height: 100%;
    min-height: 0;
  }
  .source-panel {
    grid-row: 1;
    min-width: 0;
    position: relative;
    top: auto;
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    background: var(--paper);
  }
  .application-grid.files-pane-open .primary-stage {
    display: flex;
    align-items: stretch;
    height: 100%;
    overflow: hidden;
  }
  .application-grid.files-pane-open .primary-stage > .hero,
  .application-grid.files-pane-open .primary-stage > .workspace { order: 1; flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .application-grid.files-pane-open .files-resizer { order: 2; z-index: 2; flex: 0 0 9px; display: block; }
  .application-grid.files-pane-open .files-page {
    order: 3;
    position: relative;
    top: auto;
    flex: 0 0 var(--files-width, 50vw);
    width: var(--files-width, 50vw);
    min-width: 280px;
    display: block;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    border-left: 0;
    background: var(--paper);
  }
  .application-grid.files-only-layout .primary-stage > .hero,
  .application-grid.files-only-layout .primary-stage > .workspace,
  .application-grid.files-only-layout .files-resizer {
    display: none;
  }
  .application-grid.files-only-layout .files-page {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }
  .application-grid.files-pane-open .files-page-inner {
    height: calc(100% / var(--pane-content-scale, 1));
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 34px 26px 0;
  }
  .application-grid.files-pane-open .files-page-heading { align-items: flex-start; margin-bottom: 24px; }
  .application-grid.files-pane-open .files-page-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-bottom: 54px;
  }
  .application-grid.files-pane-open .files-page h1 { font-size: clamp(34px, 3vw, 46px); }
  .application-grid.files-pane-open .files-intro { font-size: 13px; }
  .application-grid.files-pane-open .file-count { padding: 6px 9px; font-size: 10px; }
  .application-grid.files-pane-open .file-upload-card { padding: 18px; box-shadow: none; }
  .application-grid.files-pane-open .file-upload-actions { align-items: stretch; flex-wrap: wrap; }
  .application-grid.files-pane-open #fileUploadName { flex: 1 1 120px; align-self: center; }
  .application-grid.files-pane-open .file-upload-actions button { width: 100%; margin-left: 0; }
  .application-grid.files-pane-open .file-catalog { margin-top: 34px; }
  .application-grid.files-pane-open .file-row {
    grid-template-columns: 38px minmax(0, 1fr);
    column-gap: 11px;
    row-gap: 7px;
    align-items: center;
    padding: 14px 2px;
  }
  .application-grid.files-pane-open .file-kind { grid-column: 1; grid-row: 1; align-self: start; }
  .application-grid.files-pane-open .file-row-copy { grid-column: 2; grid-row: 1; }
  .application-grid.files-pane-open .file-row-meta { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .application-grid.files-pane-open .workspace.source-open {
    grid-template-columns: minmax(0, 1fr) 9px minmax(0, var(--source-width));
  }
  .application-grid.files-pane-open .workspace.source-open .result-topline {
    grid-template-columns: minmax(0, 1fr) 9px minmax(0, var(--source-width));
  }
  .application-grid.question-pane-hidden { grid-template-columns: minmax(0, 1fr); }
  .application-grid.question-pane-hidden .query-rail,
  .application-grid.question-pane-hidden .query-resizer { display: none; }
  .workspace.answer-pane-hidden:not(.source-open) .result-topline,
  .workspace.answer-pane-hidden .result-column { display: none; }
  .workspace.answer-pane-hidden.source-open { grid-template-columns: minmax(0, 1fr); }
  .application-grid.files-pane-open .workspace.answer-pane-hidden.source-open {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace.answer-pane-hidden.source-open .result-topline { display: flex; }
  .workspace.answer-pane-hidden.source-open .record-heading,
  .workspace.answer-pane-hidden.source-open .source-resizer { display: none; }
  .workspace.answer-pane-hidden.source-open .result-actions { width: 100%; padding-left: 22px; }
  .workspace.answer-pane-hidden.source-open .source-panel { grid-column: 1; }
}
.new-question { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.answer-page-heading { min-width: 0; margin-bottom: 22px; overflow: hidden; }
.answer-page-heading .eyebrow { margin: 0 0 6px; }
.answer-page-heading h1 { max-width: 100%; margin: 0 0 13px; overflow: hidden; font: 680 clamp(34px, 3vw, 46px)/1 var(--font-display); letter-spacing: -.045em; text-overflow: clip; white-space: nowrap; }
.answer-question-heading { width: 100%; max-width: none; display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font: 400 13px/1.55 var(--font-body); letter-spacing: 0; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.loading { display: flex; gap: 18px; align-items: center; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-strong); }
.loading p { color: var(--muted); margin: 5px 0 0; }
.pulse { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.55); opacity: .45; } }
.brief-card { --answer-state-accent: var(--accent); display: block; border-left: 3px solid var(--answer-state-accent); background: color-mix(in srgb, var(--answer-state-accent) 12%, transparent); padding: 11px 15px; margin: 4px 0 28px; }
.brief-card[data-answer-state="pending"], .brief-card[data-answer-state="queued"], .brief-card[data-answer-state="running"] { --answer-state-accent: var(--staged-accent); }
.brief-card[data-answer-state="partial"] { --answer-state-accent: var(--partial-accent); }
.brief-card[data-answer-state="failed"] { --answer-state-accent: #e16363; }
#briefLabel { text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 900; color: var(--answer-state-accent, var(--accent)); margin-right: 12px; }
.brief-card p { font: 500 var(--compact-title-size)/1.55 var(--font-body); margin: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.brief-card #brief { white-space: pre-line; }
.brief-card[aria-expanded="true"] p { display: block; -webkit-line-clamp: unset; line-clamp: unset; }
.coverage-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 6px 12px; margin: -14px 0 26px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: color-mix(in srgb, var(--panel) 82%, transparent); }
.coverage-summary strong { color: var(--ink); font: 750 11px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.coverage-summary span { font: 600 12px/1.45 var(--font-body); }
.coverage-summary small { grid-column: 2; font: 500 11px/1.45 var(--font-body); color: var(--muted); }
.markdown { max-width: 100%; font: 400 var(--answer-font-size, var(--reading-size))/1.72 var(--font-body); }
.markdown { overflow-wrap: anywhere; }
.markdown :is(h1, h2, h3, h4, h5, h6) { color: var(--ink); line-height: 1.25; font-family: var(--font-display); font-weight: 700; }
.markdown h1 { font-size: 1.9em; margin: 1.4em 0 .5em; }
.markdown h2 { font-size: 1.55em; margin: 1.4em 0 .5em; }
.markdown h3 { font-size: 1.25em; margin: 1.35em 0 .4em; }
.markdown :is(h4, h5, h6) { font-size: 1.05em; margin: 1.2em 0 .4em; }
.markdown > :first-child { margin-top: 0; }
.markdown p { margin: 0 0 1em; }
.markdown :is(ul, ol) { margin: .6em 0 1.1em; padding-inline-start: 1.65em; }
.markdown li { margin: .4em 0; padding-inline-start: .15em; }
.markdown li > :is(ul, ol) { margin-block: .35em; }
.markdown li > p { margin-block: .4em; }
.markdown strong { font-weight: 750; }
.markdown .reasoning-development { margin: .7em 0; }
.markdown .reasoning-development > summary { display: list-item; list-style-position: outside; margin-inline-start: 1em; cursor: pointer; color: var(--ink); line-height: 1.5; }
.markdown .reasoning-development > summary::marker { color: var(--accent); font-size: .8em; }
.markdown .reasoning-development > summary:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.markdown .reasoning-development[open] > summary { margin-bottom: .65em; }
.markdown .reasoning-development > :last-child { margin-bottom: 0; }
.markdown em { font-style: italic; }
.markdown blockquote { margin: 1.1em 0; padding: .15em 0 .15em 1em; border-inline-start: 3px solid var(--accent); color: var(--muted); }
.markdown blockquote > :last-child { margin-bottom: 0; }
.markdown code { font: .86em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--accent-pale); padding: .15em .35em; border-radius: 4px; }
.markdown pre { max-width: 100%; overflow-x: auto; margin: 1.1em 0; padding: 1em; border: 1px solid var(--line); border-radius: 8px; background: var(--accent-pale); line-height: 1.5; white-space: pre; overflow-wrap: normal; }
.markdown pre code { padding: 0; background: transparent; }
.markdown hr { margin: 1.6em 0; border: 0; border-top: 1px solid var(--line); }
.markdown-table-scroll { max-width: 100%; overflow-x: auto; margin: 1.1em 0; }
.markdown table { width: 100%; border-collapse: collapse; font-size: .92em; line-height: 1.5; }
.markdown :is(th, td) { padding: .6em .75em; border: 1px solid var(--line); text-align: start; vertical-align: top; }
.markdown th { background: var(--accent-pale); font-weight: 700; }
.markdown a:not(.citation) { color: var(--accent); text-underline-offset: .15em; }
.markdown > :last-child { margin-bottom: 0; }
.citation { color: var(--accent); text-decoration: none; border-bottom: 0; text-shadow: 0 0 6px color-mix(in srgb, var(--accent) 24%, transparent); white-space: normal; margin-inline: .16em; }
.citation:hover, .citation.active { background: transparent; text-decoration: none; border-bottom: 0; text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 42%, transparent); }
.citation.citation-compact { font-size: .75em; line-height: 0; vertical-align: super; border-bottom: 0; padding-inline: 2px; }
.receipt { margin-top: 0; padding: 12px 0 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.scroll-fade-top {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20px, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 20px, #000 100%);
}
.scroll-fade-bottom {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 20px), transparent 100%);
}
.scroll-fade-top.scroll-fade-bottom {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
}
.error-card { padding: 22px; border: 1px solid #c87867; border-radius: 12px; background: #f8e3dc; }
.error-card p { margin-bottom: 0; }

.source-resizer { position: sticky; top: 0; align-self: start; width: 9px; height: 100vh; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; }
.source-resizer::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 1px; background: var(--line); box-shadow: 0 0 0 transparent; pointer-events: none; transition: background-color 180ms ease, box-shadow 260ms ease; }
.source-resizer:hover, .source-resizer:focus-visible, .source-resizer.dragging { outline: none; }
.source-resizer:hover::before, .source-resizer:focus-visible::before { background: color-mix(in srgb, var(--accent) 72%, var(--line)); box-shadow: 0 0 14px 2px color-mix(in srgb, var(--accent) 13%, transparent); }
.source-resizer.dragging::before { background: var(--accent); box-shadow: 0 0 22px 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.source-panel { min-width: 0; height: 100vh; padding: 0; max-height: 100vh; position: sticky; top: 0; background: transparent; }
.source-page-inner { width: 100%; min-height: 100%; padding: 34px 26px 54px; }
.source-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.source-glyph { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 14px; font: 700 24px var(--font-display); color: var(--accent); }
.document-view { width: 100%; height: auto; display: block; }
.document-structure { min-height: 34px; padding: 0 2px 13px; border-bottom: 1px solid var(--line); color: var(--muted); font: 700 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .035em; }
.source-toolbar { min-width: 0; width: 100%; display: flex; flex: 1 1 auto; align-items: center; gap: 5px; }
.view-switcher .source-toolbar { width: auto; flex: 0 0 auto; gap: 2px; }
.source-identity { min-width: 0; width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0; }
.source-heading-copy { min-width: 0; overflow: hidden; }
.source-identity span { display: block; margin: 0 0 6px; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; }
.source-identity strong { display: block; max-width: 100%; overflow: hidden; font: 680 clamp(34px, 3vw, 46px)/1 var(--font-display); letter-spacing: -.045em; text-overflow: clip; white-space: nowrap; }
.source-file-name { max-width: 100%; margin: 9px 0 0; overflow: hidden; color: var(--muted); font: 500 13px/1.5 var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.source-identity .citation-position { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 750; text-transform: none; letter-spacing: 0; }
.source-toolbar button { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 8px; font-size: 13px; font-weight: 750; cursor: pointer; }
.view-switcher .source-toolbar button { min-width: 29px; height: 29px; padding: 0 7px; border: 0; border-radius: 999px; font-size: 11px; }
.source-toolbar button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-pale); }
.source-toolbar button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-pale); }
.source-toolbar button:disabled { opacity: .35; cursor: default; }
.toolbar-divider { width: 1px; height: 22px; margin: 0 3px; background: var(--line); }
.document-view pre { width: 100%; overflow: visible; white-space: pre-wrap; word-break: break-word; margin: 0; padding: 22px 2px 0; border: 0; border-radius: 0; background: transparent; font: 400 var(--source-font-size, var(--reading-size))/1.72 ui-monospace, SFMono-Regular, Menlo, monospace; box-shadow: none; }
.document-view pre.wrap-off { white-space: pre; word-break: normal; overflow-wrap: normal; }
mark { background:var(--highlight-effect-color); color:var(--evidence-display-color); padding:2px 0; box-shadow:0 0 0 3px var(--highlight-effect-color); }
:root[data-highlight-style="glow"] mark { background:transparent; color:var(--evidence-display-color); padding:0; box-shadow:none;
  text-shadow:0 0 5px var(--highlight-effect-color),0 0 12px color-mix(in srgb,var(--highlight) var(--highlight-glow-mid),transparent),0 0 21px color-mix(in srgb,var(--highlight) var(--highlight-glow-far),transparent);
}
:root[data-highlight-style="underline"] mark { background:transparent; color:var(--evidence-display-color); box-shadow:inset 0 -3px 0 var(--highlight-effect-color); }
:root[data-highlight-style="text"] mark { background:transparent; color:var(--evidence-display-color); padding:0; box-shadow:none; text-shadow:none; }

@media (min-width: 1181px) {
  .source-resizer {
    grid-row: 1;
    position: relative;
    z-index: 3;
    top: auto;
    align-self: stretch;
    height: 100%;
    min-height: 0;
  }
  .source-panel {
    grid-row: 1;
    position: relative;
    top: auto;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    background: var(--paper);
  }
  .source-page-inner {
    width: min(var(--desktop-pane-active-width), calc(100% / var(--pane-content-scale, 1)));
    height: calc(100% / var(--pane-content-scale, 1));
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .source-page-heading { flex: 0 0 auto; }
  .source-panel .document-view {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .source-panel .document-structure { flex: 0 0 auto; }
  .source-panel .document-view pre {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  .workspace.source-open .result-topline {
    grid-column: 1;
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace.source-open .result-topline > .record-heading { grid-column: 1; width: 100%; }
  .workspace.source-open .result-actions { display: none; }
  .workspace.answer-pane-hidden.source-open .result-topline { display: none; }
}

@media (max-width: 1180px) {
  .workspace, .workspace.source-open { grid-template-columns: 1fr; }
  .result-column { border-right: 0; padding-right: 0; }
  .answer-page-heading {
    position: sticky;
    top: 0;
    z-index: 8;
    margin-bottom: 16px;
    padding-bottom: 12px;
    background: color-mix(in srgb, var(--paper) 97%, transparent);
    backdrop-filter: blur(18px);
  }
  .source-resizer { display: none !important; }
  .source-panel { position: static; height: auto; max-height: none; border-top: 1px solid var(--line); padding: 0; }
  .workspace.source-open .result-topline { display: flex; }
  .result-topline { align-items: flex-start; }
  .workspace.source-open .result-actions { width: auto; padding-left: 0; padding-right: 22px; border-left: 0; }
  .result-actions { flex-wrap: wrap; }
  .source-toolbar { order: 2; width: 100%; justify-content: flex-end; }
  .empty-answer,
  .empty-source { padding: 40px 0 70px; }
  .document-view pre { max-height: 68vh; }
}

.mobile-edge-pull { display: none; }
.drawer-tabs { display: none; }

@media (min-width: 1181px) {
  .application-grid,
  .application-grid.question-pane-hidden,
  .application-grid.files-pane-open {
    display: flex;
    align-items: stretch;
    box-sizing: border-box;
    padding-inline: 0;
    grid-template-columns: none;
    grid-template-rows: none;
  }
  .drawer-tabs {
    display: contents;
  }
  .drawer-tabs button {
    --label-offset: 28px;
    position: relative;
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    height: 100%;
    min-height: 0;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    overflow: visible;
    cursor: pointer;
    transition: color 180ms ease;
  }
  .drawer-tabs button[data-drawer-view="question"] { order: 1; }
  .drawer-tabs button[data-drawer-view="answer"] { order: 3; }
  .drawer-tabs button[data-drawer-view="source"] { order: 4; }
  .drawer-tabs button[data-drawer-view="files"] { order: 5; }
  .application-grid.drawer-view-answer .drawer-tabs button[data-drawer-view="answer"] { order: 2; }
  .application-grid.drawer-view-source .drawer-tabs button[data-drawer-view="answer"] { order: 2; }
  .application-grid.drawer-view-source .drawer-tabs button[data-drawer-view="source"] { order: 3; }
  .application-grid.drawer-view-files .drawer-tabs button[data-drawer-view="answer"] { order: 2; }
  .application-grid.drawer-view-files .drawer-tabs button[data-drawer-view="source"] { order: 3; }
  .application-grid.drawer-view-files .drawer-tabs button[data-drawer-view="files"] { order: 4; }
  .drawer-tabs button:nth-child(2) { --label-offset: 150px; }
  .drawer-tabs button:nth-child(3) { --label-offset: 272px; }
  .drawer-tabs button:nth-child(4) { --label-offset: 394px; }
  .drawer-tabs button span {
    position: absolute;
    z-index: 8;
    top: var(--label-offset);
    left: 0;
    box-sizing: border-box;
    width: 34px;
    height: 108px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 9px 9px 0;
    background: var(--paper-strong);
    box-shadow: 5px 4px 15px color-mix(in srgb, var(--ink) 8%, transparent);
    font: 760 11px/1 var(--font-display);
    letter-spacing: .11em;
    text-transform: uppercase;
    opacity: .7;
    transition: opacity 180ms ease, color 180ms ease, border-color 180ms ease, background-color 180ms ease;
  }
  .drawer-tabs button span i {
    writing-mode: vertical-rl;
    transform: rotate(0deg);
    font: inherit;
    font-style: normal;
  }
  .drawer-tabs button small {
    position: absolute;
    z-index: 9;
    top: calc(var(--label-offset) + 83px);
    left: 11px;
    color: var(--subtle-ink);
    font: 750 8px/1 var(--font-body);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    opacity: .7;
    transition: opacity 180ms ease, color 180ms ease;
  }
  .drawer-tabs button:hover:not(:disabled),
  .drawer-tabs button:focus-visible {
    outline: none;
    color: var(--accent);
  }
  .drawer-tabs button:hover:not(:disabled) span,
  .drawer-tabs button:focus-visible span {
    opacity: 1;
    border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
    background: color-mix(in srgb, var(--accent-pale) 64%, var(--paper-strong));
  }
  .drawer-tabs button:hover:not(:disabled) small,
  .drawer-tabs button:focus-visible small { opacity: 1; }
  .drawer-tabs button[aria-pressed="true"] {
    z-index: 5;
    color: var(--accent);
    background: transparent;
    box-shadow: none;
  }
  .drawer-tabs button[aria-pressed="true"] span {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent-pale) 74%, var(--paper-strong));
  }
  .drawer-tabs button:disabled { opacity: .36; cursor: default; }
  .query-rail,
  .primary-stage {
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
  }
  .application-grid.drawer-view-question .query-rail { order: 2; }
  .application-grid.drawer-view-answer .primary-stage { order: 3; }
  .application-grid.drawer-view-source .primary-stage { order: 4; }
  .application-grid.drawer-view-files .primary-stage { order: 5; }
  .query-resizer { display: none !important; }
  .application-grid.drawer-view-question .query-rail { display: flex; }
  .application-grid.drawer-view-question .primary-stage { display: none; }
  .application-grid.drawer-view-answer .query-rail,
  .application-grid.drawer-view-source .query-rail,
  .application-grid.drawer-view-files .query-rail { display: none; }
  .application-grid.drawer-view-answer .primary-stage,
  .application-grid.drawer-view-source .primary-stage { display: block; }
  .application-grid.drawer-view-files .primary-stage { display: flex; }
  .application-grid.drawer-view-question .query-rail-scale,
  .application-grid.drawer-view-answer .answer-pane-scale,
  .application-grid.drawer-view-source .source-page-inner,
  .application-grid.drawer-view-files .files-page-inner {
    width: min(980px, calc(100% / var(--pane-content-scale, 1)));
  }
  .application-grid:not(.settings-view-active) .primary-stage,
  .application-grid:not(.settings-view-active) .query-rail {
    border-radius: 0;
    border-left: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-right: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    box-shadow: -10px 0 34px color-mix(in srgb, var(--ink) 7%, transparent),
      10px 0 34px color-mix(in srgb, var(--ink) 7%, transparent);
  }
  .application-grid.settings-view-active .drawer-tabs button { display: none; }
  .application-grid.settings-view-active {
    padding-inline: 0;
  }
  .application-grid.settings-view-active .primary-stage { order: 1; width: 100%; }
  .view-switcher > [data-workspace-view],
  .view-switcher > .view-options-divider { display: none; }
}

@media (min-width: 1181px) and (max-height: 760px) {
  .settings-page-inner {
    padding-top: clamp(24px, 5dvh, 40px);
    padding-bottom: clamp(32px, 7dvh, 56px);
  }
  .settings-page h1 { font-size: clamp(36px, 6dvh, 52px); }
  .settings-grid { margin-top: clamp(20px, 4dvh, 32px); }
  .settings-card { padding: 20px; }
  .settings-card-heading { margin-bottom: 20px; }
}

@media (min-width: 1181px) {
  /* Fixed filing order: each open leaf gets an equal share. A closed leaf has
     no width, leaving only its staggered index projection on the divider where
     that leaf belongs. */
  .query-resizer:not(.drawer-resizer-visible),
  .source-resizer:not(.drawer-resizer-visible),
  .files-resizer:not(.drawer-resizer-visible) {
    display: none !important;
  }
  .application-grid:not(.settings-view-active) .primary-stage,
  .application-grid:not(.settings-view-active) .workspace:not(.hidden),
  .application-grid:not(.settings-view-active) .workspace.hidden.empty-drawers-enabled {
    display: contents;
  }
  .application-grid:not(.settings-view-active) .hero,
  .application-grid:not(.settings-view-active) .result-topline {
    display: none !important;
  }

  .query-resizer.drawer-resizer-visible,
  .source-resizer.drawer-resizer-visible,
  .files-resizer.drawer-resizer-visible {
    position: fixed !important;
    z-index: 1000 !important;
    display: block !important;
    width: 9px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    cursor: col-resize;
    touch-action: none;
    pointer-events: auto !important;
  }
  .query-resizer.drawer-resizer-visible::before,
  .source-resizer.drawer-resizer-visible::before,
  .files-resizer.drawer-resizer-visible::before {
    left: 4px !important;
  }
  .query-resizer.drawer-resizer-visible::after,
  .source-resizer.drawer-resizer-visible::after,
  .files-resizer.drawer-resizer-visible::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 4px;
    width: 5px;
    height: 38px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 72%, var(--line));
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--paper) 82%, transparent);
    pointer-events: none;
  }
  .query-resizer.drawer-resizer-visible:hover::after,
  .query-resizer.drawer-resizer-visible:focus-visible::after,
  .source-resizer.drawer-resizer-visible:hover::after,
  .source-resizer.drawer-resizer-visible:focus-visible::after,
  .files-resizer.drawer-resizer-visible:hover::after,
  .files-resizer.drawer-resizer-visible:focus-visible::after {
    content: attr(data-boundary-label);
    left: 14px;
    width: max-content;
    height: auto;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    background: var(--paper-strong);
    transform: translateY(-50%);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 16%, transparent);
    font: 750 10px/1 var(--font-body);
    letter-spacing: .04em;
    white-space: nowrap;
  }

  .drawer-tabs button[data-drawer-view="files"] { order: 1 !important; }
  .files-page { order: 2 !important; }
  .drawer-tabs button[data-drawer-view="question"] { order: 3 !important; }
  .query-rail { order: 4 !important; }
  .drawer-tabs button[data-drawer-view="answer"] { order: 5 !important; }
  .result-column { order: 6 !important; }
  .drawer-tabs button[data-drawer-view="source"] { order: 7 !important; }
  .source-panel { order: 8 !important; }

  .application-grid:not(.settings-view-active) .query-rail,
  .application-grid:not(.settings-view-active) .result-column,
  .application-grid:not(.settings-view-active) .source-panel,
  .application-grid:not(.settings-view-active) .files-page {
    position: relative;
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    border-left: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-right: 0;
    box-shadow: none;
    overflow: hidden;
    background: var(--paper);
  }
  .application-grid:not(.settings-view-active) .result-column,
  .application-grid:not(.settings-view-active) .source-panel,
  .application-grid:not(.settings-view-active) .files-page {
    touch-action: pan-y;
  }
  .application-grid:not(.settings-view-active) .query-rail { display: flex; }
  .application-grid.question-pane-hidden:not(.settings-view-active) .query-rail,
  .application-grid.answer-pane-hidden:not(.settings-view-active) .result-column,
  .application-grid.source-pane-hidden:not(.settings-view-active) .source-panel,
  .application-grid:not(.files-pane-open):not(.settings-view-active) .files-page {
    display: none !important;
  }
  .application-grid:not(.answer-pane-hidden):not(.settings-view-active) .result-column,
  .application-grid:not(.source-pane-hidden):not(.settings-view-active) .source-panel,
  .application-grid.files-pane-open:not(.settings-view-active) .files-page {
    display: block;
  }
  .application-grid.files-pane-open:not(.settings-view-active) .files-page-inner {
    display: flex;
    width: min(var(--desktop-pane-active-width), calc(100% / var(--pane-content-scale, 1)));
    height: calc(100% / var(--pane-content-scale, 1));
  }

  .drawer-tabs button span {
    right: auto !important;
    left: 0 !important;
    border: 1px solid var(--line) !important;
    border-left: 0 !important;
    border-radius: 0 9px 9px 0 !important;
    box-shadow: 5px 4px 15px color-mix(in srgb, var(--ink) 8%, transparent) !important;
  }
  .drawer-tabs button small {
    right: auto !important;
    left: 11px !important;
  }
  .drawer-tabs button[aria-pressed="true"] span {
    border-color: var(--accent) !important;
    background: color-mix(in srgb, var(--accent-pale) 74%, var(--paper-strong));
  }
  /* One shared exception: any tag whose divider physically reaches the final
     wall turns inward. JavaScript assigns this class from rendered geometry. */
  .drawer-tabs button.is-right-wall span {
    right: 0 !important;
    left: auto !important;
    border-right: 0 !important;
    border-left: 1px solid var(--line) !important;
    border-radius: 9px 0 0 9px !important;
    box-shadow: -5px 4px 15px color-mix(in srgb, var(--ink) 8%, transparent) !important;
  }
  .drawer-tabs button.is-right-wall small {
    right: 11px !important;
    left: auto !important;
  }
  .drawer-tabs button.is-right-wall span i {
    transform: rotate(180deg);
  }
  .application-grid.settings-view-active .primary-stage {
    display: block;
    flex: 1 1 auto;
  }
}

@media (min-width: 1181px) {
  /* Keep drawer controls in one quiet index rail. The content panes continue
     to open, close, share space, and resize exactly as before. */
  .application-grid .drawer-tabs {
    order: -10 !important;
    position: relative;
    z-index: 1100;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    border-right: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    background: var(--paper);
  }
  .application-grid.nav-rail-right .drawer-tabs {
    order: 10 !important;
    border-right: 0;
    border-left: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  }
  .application-grid.nav-rail-bottom {
    position: relative;
    padding-bottom: 52px;
  }
  .application-grid.nav-rail-bottom .drawer-tabs {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    width: 100%;
    min-width: 0;
    height: 52px;
    flex: none;
    flex-direction: row;
    border-top: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-right: 0;
    border-left: 0;
  }
  .application-grid .drawer-tabs button,
  .application-grid .drawer-tabs button[data-drawer-view],
  .application-grid.settings-view-active .drawer-tabs button {
    order: initial !important;
    position: relative;
    display: block !important;
    flex: 1 1 16.666%;
    width: 44px;
    min-width: 44px;
    height: auto;
    min-height: 0;
    border-bottom: 1px solid var(--line);
  }
  .application-grid .drawer-tabs button:last-child {
    border-bottom: 0;
  }
  .application-grid.nav-rail-bottom .drawer-tabs button,
  .application-grid.nav-rail-bottom .drawer-tabs button[data-drawer-view],
  .application-grid.nav-rail-bottom.settings-view-active .drawer-tabs button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: 52px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
  .application-grid.nav-rail-bottom .drawer-tabs button:last-child {
    border-right: 0;
  }
  .application-grid .drawer-tabs button span,
  .application-grid .drawer-tabs button.is-right-wall span {
    inset: 0 !important;
    width: 44px;
    height: 100%;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;
    box-shadow: none !important;
    opacity: .42;
    transition: opacity 160ms ease, background-color 160ms ease;
  }
  .application-grid .drawer-tabs button span i,
  .application-grid .drawer-tabs button.is-right-wall span i {
    transform: rotate(180deg);
  }
  .application-grid.nav-labels-top-to-bottom .drawer-tabs button span i,
  .application-grid.nav-labels-top-to-bottom .drawer-tabs button.is-right-wall span i {
    transform: rotate(0deg);
  }
  .application-grid.nav-rail-bottom .drawer-tabs button span,
  .application-grid.nav-rail-bottom .drawer-tabs button.is-right-wall span {
    width: 100%;
    height: 52px;
  }
  .application-grid.nav-rail-bottom .drawer-tabs button span i,
  .application-grid.nav-rail-bottom .drawer-tabs button.is-right-wall span i {
    writing-mode: horizontal-tb;
    transform: none;
  }
  .application-grid .drawer-tabs button small,
  .application-grid .drawer-tabs button.is-right-wall small {
    top: auto !important;
    right: 6px !important;
    bottom: 8px;
    left: auto !important;
    opacity: .48;
  }
  .application-grid.nav-rail-bottom .drawer-tabs button small,
  .application-grid.nav-rail-bottom .drawer-tabs button.is-right-wall small {
    top: 50% !important;
    right: 10px !important;
    bottom: auto;
    left: auto !important;
    transform: translateY(-50%);
  }
  .application-grid .drawer-tabs button:hover span,
  .application-grid .drawer-tabs button:focus-visible span {
    opacity: 1;
  }
  .application-grid .drawer-tabs button span i {
    text-shadow: none;
    transition: color 160ms ease, text-shadow 160ms ease;
  }
  .application-grid .drawer-tabs button[aria-pressed="true"] span {
    opacity: 1;
    background: transparent !important;
  }
  .application-grid .drawer-tabs button[aria-pressed="true"] span i {
    color: var(--accent);
    text-shadow: 0 0 5px color-mix(in srgb, var(--accent) 88%, transparent),
                 0 0 13px color-mix(in srgb, var(--accent) 62%, transparent);
  }
  .application-grid .drawer-tabs button:hover:not(:disabled) span,
  .application-grid .drawer-tabs button:focus-visible span {
    background: color-mix(in srgb, var(--accent) 22%, var(--paper)) !important;
  }
  .application-grid .drawer-tabs button.drawer-view-toggle:focus-visible {
    outline: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
    outline-offset: -2px;
  }
  .application-grid .drawer-tabs button.drawer-view-toggle span {
    opacity: 1;
  }
  .application-grid .drawer-tabs button.drawer-view-toggle:focus-visible span {
    background: transparent !important;
  }
  .application-grid .drawer-tabs button.drawer-view-toggle:hover span {
    background: color-mix(in srgb, var(--accent) 22%, var(--paper)) !important;
  }
  .application-grid .drawer-tabs button.drawer-view-toggle:hover span i,
  .application-grid .drawer-tabs button.drawer-view-toggle:focus-visible span i {
    text-shadow: none;
  }
  .application-grid .drawer-tabs .drawer-view-mode {
    display: inline-flex;
    gap: 16px;
  }
  .application-grid .drawer-tabs .drawer-view-mode b {
    color: var(--ink);
    font: inherit;
    font-style: normal;
    text-shadow: none;
  }
  .application-grid .drawer-tabs .drawer-view-mode b.is-current {
    color: var(--accent);
    text-shadow: 0 0 5px color-mix(in srgb, var(--accent) 88%, transparent),
                 0 0 13px color-mix(in srgb, var(--accent) 62%, transparent);
  }
  .masthead .nav-settings-toggle { display: none; }
}

@media (max-width: 900px) {
  .application-grid { view-transition-name: evidence-brief-view; }
  .mobile-edge-pull {
    --pull-progress: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 120;
    display: block;
    width: 24px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  /* iOS reserves the physical left edge for Safari's native Back gesture.
     Keep the app pull target adjacent to it, but outside that native layer. */
  .mobile-edge-pull-left { left: max(28px, env(safe-area-inset-left)); }
  body.mobile-history-open .mobile-edge-pull { display: none; }
  .mobile-edge-pull::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 3px;
    height: 46px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 38%, transparent);
    opacity: calc(.16 + (var(--pull-progress) * .64));
    transform: translateY(-50%) scaleY(calc(.72 + (var(--pull-progress) * .28)));
    transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  }
  .mobile-edge-pull-left::after { left: 3px; }
  .mobile-edge-pull.is-pulling::after {
    box-shadow: 0 0 calc(9px + (var(--pull-progress) * 12px)) color-mix(in srgb, var(--accent) 44%, transparent);
  }
  .query-rail,
  .result-column,
  .settings-page,
  .files-page,
  .source-panel { overscroll-behavior-x: contain; }
  html.mobile-view-forward::view-transition-old(evidence-brief-view),
  html.mobile-view-back::view-transition-old(evidence-brief-view),
  html.mobile-view-forward::view-transition-new(evidence-brief-view),
  html.mobile-view-back::view-transition-new(evidence-brief-view) {
    animation-duration: 260ms;
    animation-timing-function: cubic-bezier(.22, .78, .24, 1);
  }
  html.mobile-view-forward::view-transition-old(evidence-brief-view) { animation-name: mobile-view-out-left; }
  html.mobile-view-forward::view-transition-new(evidence-brief-view) { animation-name: mobile-view-in-right; }
  html.mobile-view-back::view-transition-old(evidence-brief-view) { animation-name: mobile-view-out-right; }
  html.mobile-view-back::view-transition-new(evidence-brief-view) { animation-name: mobile-view-in-left; }
  /* A page change owns the motion. If Answer was scrolled with its chrome
     hidden, do not also animate the masthead or the incoming Source toolbar
     down from the top while the page itself is sliding horizontally. */
  html.mobile-view-forward .masthead,
  html.mobile-view-back .masthead,
  html.mobile-view-forward .result-topline,
  html.mobile-view-back .result-topline,
  html.mobile-view-forward .query-rail-head,
  html.mobile-view-back .query-rail-head {
    transition: none !important;
  }
  /* Safari and embedded mobile clients may not expose View Transitions. Keep
     the same horizontal page motion without animating citation positioning. */
  html.mobile-view-fallback.mobile-view-forward .workspace.source-open,
  html.mobile-view-fallback.mobile-view-forward .workspace:not(.source-open):not(.hidden),
  html.mobile-view-fallback.mobile-view-forward .settings-page,
  html.mobile-view-fallback.mobile-view-forward .files-page,
  html.mobile-view-fallback.mobile-view-back .workspace:not(.source-open):not(.hidden),
  html.mobile-view-fallback.mobile-view-back .settings-page,
  html.mobile-view-fallback.mobile-view-back .files-page {
    animation-duration: 260ms;
    animation-timing-function: cubic-bezier(.22, .78, .24, 1);
    animation-fill-mode: both;
  }
  html.mobile-view-fallback.mobile-view-forward .workspace.source-open,
  html.mobile-view-fallback.mobile-view-forward .workspace:not(.source-open):not(.hidden),
  html.mobile-view-fallback.mobile-view-forward .settings-page,
  html.mobile-view-fallback.mobile-view-forward .files-page { animation-name: mobile-view-in-right; }
  html.mobile-view-fallback.mobile-view-back .workspace:not(.source-open):not(.hidden),
  html.mobile-view-fallback.mobile-view-back .settings-page,
  html.mobile-view-fallback.mobile-view-back .files-page { animation-name: mobile-view-in-left; }
  @keyframes mobile-view-out-left { to { opacity: .72; transform: translateX(-18%); } }
  @keyframes mobile-view-in-right { from { opacity: .72; transform: translateX(18%); } }
  @keyframes mobile-view-out-right { to { opacity: .72; transform: translateX(18%); } }
  @keyframes mobile-view-in-left { from { opacity: .72; transform: translateX(-18%); } }
  body.mobile-history-open,
  body.mobile-source-open { overflow: hidden; }
  .mobile-only { display: inline-grid; }
  .desktop-only { display: none !important; }
  .shell { width: 100%; padding: 0; }
  .masthead { position: sticky; top: 0; z-index: 100; height: 68px; padding: 0 14px; background: color-mix(in srgb, var(--paper) 97%, transparent); backdrop-filter: blur(18px); transition: transform 220ms ease; will-change: transform; }
  body.mobile-page-chrome-hidden .masthead { transform: translateY(-100%); }
  .record-heading { padding-left: 15px; }
  .result-actions, .workspace.source-open .result-actions { padding-right: 0; }
  .application-grid { grid-template-columns: 1fr; }
  .settings-page,
  .files-page { min-height: 100dvh; }
  .settings-page-inner { width: 100%; padding: 42px 18px max(48px, env(safe-area-inset-bottom)); }
  .settings-page h1 { font-size: 38px; }
  .settings-grid { margin-top: 30px; }
  .admin-summary,
  .admin-actions { grid-template-columns: 1fr; }
  .admin-summary > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .files-page-inner { width: 100%; padding: 38px 18px max(48px, env(safe-area-inset-bottom)); }
  .files-page-heading { align-items: flex-start; margin-bottom: 26px; }
  .files-page h1 { font-size: 38px; }
  .file-upload-actions { align-items: stretch; flex-wrap: wrap; }
  .file-picker { flex: 0 0 auto; }
  #fileUploadName { flex: 1 1 150px; align-self: center; }
  .file-upload-actions button { width: 100%; margin-left: 0; }
  .file-row { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 15px 2px; }
  .file-row-meta { grid-column: 2; }
  .primary-stage { padding-left: 0; }
  .query-resizer { display: none; }
  .query-rail { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 70; width: 100%; height: 100dvh; max-height: 100dvh; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 0 16px max(24px, env(safe-area-inset-bottom)); border: 0; background: var(--paper); box-shadow: var(--shadow); transform: translateX(-102%); opacity: 0; pointer-events: none; overscroll-behavior: contain; transition: transform 220ms ease, opacity 180ms ease; }
  .query-rail.mobile-open { transform: translateX(0); opacity: 1; pointer-events: auto; }
  body.mobile-page-chrome-hidden .query-rail.mobile-open { top: 0; height: 100dvh; max-height: 100dvh; }
  .query-rail-head { position: sticky; top: 0; z-index: 2; padding: 38px 2px 26px; background: color-mix(in srgb, var(--paper) 97%, transparent); backdrop-filter: blur(18px); transition: transform 220ms ease; will-change: transform; }
  .query-rail.history-chrome-hidden .query-rail-head { transform: translateY(-100%); }
  .mcp-events { flex: none; min-height: 0; max-height: none; overflow: visible; padding-right: 0; overscroll-behavior: contain; }
  .mcp-json-grid { grid-template-columns: 1fr; }
  .workspace, .workspace.source-open { display: block; min-height: 100dvh; }
  .result-column { padding: 22px 18px max(52px, env(safe-area-inset-bottom)); }
  .result-column > * { width: 100%; }
  .result-topline,
  .workspace.source-open .result-topline { position: sticky; top: 0; min-height: 58px; padding: 11px 0; transition: transform 220ms ease; will-change: transform; }
  body.mobile-page-chrome-hidden .workspace:not(.source-open) .result-topline { transform: translateY(-100%); }
  body.mobile-page-chrome-hidden .answer-page-heading { top: 0; }
  .workspace.source-open { position: fixed; inset: 0; z-index: 90; width: 100%; height: 100dvh; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: max(12px, env(safe-area-inset-top)); background: var(--paper); }
  body.mobile-page-chrome-hidden .workspace.source-open { inset: 0; height: 100dvh; }
  .workspace.source-open .result-topline { position: sticky; top: 0; z-index: 91; display: block; min-height: 0; padding: 0; border-bottom: 0; background: color-mix(in srgb, var(--paper) 97%, transparent); backdrop-filter: blur(18px); transition: transform 220ms ease; will-change: transform; }
  .workspace.source-open.source-chrome-hidden .result-topline { transform: translateY(-100%); }
  .workspace.source-open .record-heading { display: none; }
  .workspace.source-open .result-topline { display: none; }
  .workspace.source-open .result-column { display: none; }
  .workspace.source-open .source-resizer { display: none; }
  .source-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, auto); align-items: center; gap: 6px; width: 100%; }
  .source-page-inner { padding: 38px 18px max(48px, env(safe-area-inset-bottom)); }
  .source-page-heading { align-items: flex-start; margin-bottom: 26px; }
  .source-identity { width: 100%; }
  .query-rail-head h2,
  .answer-page-heading h1,
  .files-page h1,
  .source-identity strong { font-size: 38px; }
  .source-toolbar .citation-position { min-width: 0; margin: 0 auto 0 0; text-align: left; }
  .toolbar-divider { display: none; }
  .source-panel { position: static; inset: auto; z-index: auto; width: 100%; height: auto; max-height: none; border: 0; background: var(--paper); }
  .document-view { display: block; height: auto; max-height: none; }
  .document-structure { padding: 0 2px 13px; }
  .markdown { font-size: max(17px, var(--answer-font-size, var(--reading-size))); }
  .document-view pre { display: block; height: auto; min-height: calc(100dvh - 120px); max-height: none; overflow: visible; padding: 22px 2px 0; font-size: max(17px, var(--source-font-size, var(--reading-size))); line-height: 1.62; }
  .document-view pre.wrap-off { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: clip; }
  .citation { white-space: normal; }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .application-grid { view-transition-name: none; }
}

@media (max-width: 580px) {
  .masthead { height: 68px; }
  .hero { padding-top: 52px; }
  .ask-card { padding: 20px; }
  .ask-footer { align-items: stretch; flex-direction: column; }
  .ask-footer button { width: 100%; }
  .option-heading { display: block; }
  .option-heading span { display: block; margin-top: 5px; }
  .result-topline { align-items: start; gap: 12px; }
  .masthead-actions { gap: 4px; }
  .wordmark-label { display: none; }
  .wordmark { gap: 0; }
  .mark { width: 30px; height: 30px; }
  .view-switcher button { min-width: 25px; min-height: 27px; padding: 0 6px; font-size: 9px; }
  .view-switcher .source-toolbar button { min-width: 25px; height: 27px; padding: 0 5px; font-size: 9px; }
  .view-switcher .source-toolbar #toggleSourceWrap { padding: 0 6px; }
  .view-switcher .reading-size-controls button { min-width: 25px; height: 27px; padding: 0 5px; font-size: 9px; }
  .view-switcher .reading-size-controls .reading-size-value { min-width: 34px; }
  .nav-option-wide { display: none; }
  .view-options-divider { margin-inline: 0; }
  .nav-settings-toggle { width: 32px; height: 32px; }
  .status { display: none; }
}

/* The workspace always opens on a calm overview. New workspaces see the
   guided path; established workspaces see the same surface as a live status
   tracker. The class is removed as soon as the user opens a working pane. */
.workspace-home-panel {
  position: relative;
  width: 100%;
  max-width: none;
  min-height: 100%;
  display: grid;
  grid-auto-rows: max-content;
  align-content: safe center;
  padding: clamp(42px, 6dvh, 72px) clamp(34px, 6vw, 92px);
  overflow: auto;
  background: var(--page-background);
}
.workspace-home-panel > * { max-width: 880px; }
.workspace-home-close {
  position: absolute;
  top: 28px;
  right: 30px;
  width: auto;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--paper-strong) 82%, transparent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.workspace-home-resizer { display: none; }
.setting-help { margin: 9px 0 18px !important; font-size: 10px !important; }
.workspace-home-close:hover,
.workspace-home-close:focus-visible { outline: none; border-color: var(--accent); color: var(--accent); }
.workspace-home-panel h1 { margin: 15px 0 22px; font-size: clamp(48px, 6vw, 84px); }
.workspace-home-panel .intro { min-height: 3.3em; }
.workspace-path {
  position: relative;
  width: min(100%, 560px);
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 38px;
  padding: 2px 0;
}
.workspace-path::before { content:none; }
.workspace-path-step:not(:last-child)::after {
  content:""; position:absolute; left:2px; bottom:-9px; width:18px; height:18px;
  background:var(--muted); opacity:.8; pointer-events:none; transition:background-color 150ms ease,filter 150ms ease,opacity 150ms ease;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 3 4 4 4-4m-8 6 4 4 4-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 3 4 4 4-4m-8 6 4 4 4-4' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.workspace-path-step[data-visited="true"]:not(:last-child)::after {
  background:var(--accent); opacity:1; filter:drop-shadow(0 0 4px color-mix(in srgb,var(--accent) 55%,transparent));
}
.workspace-path-step {
  --workspace-step-glow: var(--accent);
  position: relative;
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 8px 10px 8px 0;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.workspace-path-step:hover,
.workspace-path-step:focus-visible { outline: none; background: transparent; }
.workspace-path-dot {
  position:relative; z-index:1; width:22px; height:22px; display:grid; place-items:center;
  --workspace-ring-color:var(--subtle-ink);
  border:1px solid var(--workspace-ring-color); border-radius:50%;
  color:var(--workspace-ring-color); background:var(--paper); font:800 11px/1 var(--font-body);
  box-shadow:none; text-shadow:none; transition:color 150ms ease,border-color 150ms ease,box-shadow 150ms ease,text-shadow 150ms ease;
}
.workspace-path-dot::before,
.workspace-path-dot::after { content:none; }
.workspace-step-number {
  display:block; line-height:1; font-variant-numeric:lining-nums tabular-nums;
  transform:translateY(-1px);
}
.workspace-path-step[data-visited="true"] .workspace-path-dot,
.workspace-path-step:hover .workspace-path-dot,
.workspace-path-step:focus-visible .workspace-path-dot {
  --workspace-ring-color:var(--accent);
  box-shadow:0 0 7px color-mix(in srgb,var(--accent) 28%,transparent);
  text-shadow:0 0 5px color-mix(in srgb,var(--accent) 25%,transparent);
}
.workspace-path-step b,
.workspace-path-step small { display: block; }
.workspace-path-step b {
  font-size: 13px;
  letter-spacing: -.01em;
  transition: color 150ms ease, text-shadow 150ms ease;
}
.workspace-path-step small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.workspace-path-step:hover b,
.workspace-path-step:focus-visible b {
  color: var(--workspace-step-glow);
  text-shadow: 0 0 5px color-mix(in srgb, var(--workspace-step-glow) 88%, transparent),
               0 0 13px color-mix(in srgb, var(--workspace-step-glow) 58%, transparent);
}
.workspace-path-step > strong {
  min-width: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--paper-strong) 76%, transparent);
  font: 730 12px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.workspace-home-actions { display: flex; gap: 10px; margin-top: 26px; }
.workspace-home-actions.hidden {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}
.workspace-home-actions button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--paper-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.workspace-home-actions button:first-child { border-color: var(--ink); background: var(--ink); color: var(--button-ink); }
.workspace-home-actions button:hover,
.workspace-home-actions button:focus-visible { outline: none; border-color: var(--accent); }
.workspace-home-note { min-height: 3.3em; margin: 22px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }

/* Helper view keeps one active work tile beside the guide. Unlike Tiles view,
   answer and source replace the previous tile instead of accumulating panes. */
@media (min-width: 901px) {
  .application-grid.workspace-home:not(.settings-view-active) {
    --workspace-home-pane-width: 25vw;
  }
  .application-grid.workspace-home:not(.settings-view-active) .primary-stage {
    display: contents !important;
  }
  .application-grid.workspace-home:not(.settings-view-active) .query-rail,
  .application-grid.workspace-home.workspace-home-files:not(.settings-view-active) .files-page,
  .application-grid.workspace-home.workspace-home-answer:not(.settings-view-active) .result-column,
  .application-grid.workspace-home.workspace-home-source:not(.settings-view-active) .source-panel {
    order: 1 !important;
    flex: 0 0 var(--workspace-home-pane-width) !important;
    width: var(--workspace-home-pane-width) !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    display: block !important;
    overflow: hidden;
    border: 0 !important;
    box-shadow: none !important;
  }
  .application-grid.workspace-home:not(.workspace-home-files):not(.workspace-home-answer):not(.workspace-home-source):not(.settings-view-active) .query-rail {
    display: flex !important;
  }
  .application-grid.workspace-home.workspace-home-files:not(.settings-view-active) .query-rail,
  .application-grid.workspace-home.workspace-home-answer:not(.settings-view-active) .query-rail,
  .application-grid.workspace-home.workspace-home-source:not(.settings-view-active) .query-rail,
  .application-grid.workspace-home:not(.workspace-home-files):not(.settings-view-active) .files-page,
  .application-grid.workspace-home:not(.workspace-home-answer):not(.settings-view-active) .result-column,
  .application-grid.workspace-home:not(.workspace-home-source):not(.settings-view-active) .source-panel {
    display: none !important;
  }
  .application-grid.workspace-home.workspace-home-answer:not(.settings-view-active) .answer-pane-scale,
  .application-grid.workspace-home.workspace-home-source:not(.settings-view-active) .source-page-inner {
    width: min(var(--desktop-pane-active-width), calc(100% / var(--pane-content-scale, 1))) !important;
    max-width: none !important;
    height: calc(100% / var(--pane-content-scale, 1)) !important;
    margin-right: auto !important;
    margin-left: auto !important;
    transform: scale(var(--pane-content-scale, 1)) !important;
    transform-origin: left top !important;
  }
  .application-grid.workspace-home.workspace-home-answer:not(.settings-view-active) .result-column {
    padding: 0;
  }
  .application-grid.workspace-home.workspace-home-answer:not(.settings-view-active) .answer-pane-scale {
    padding: 34px 26px 54px;
    box-sizing: border-box;
  }
  .application-grid.workspace-home.workspace-home-files:not(.settings-view-active) .files-page-inner {
    width: min(var(--desktop-pane-active-width), calc(100% / var(--pane-content-scale, 1)));
    height: calc(100% / var(--pane-content-scale, 1));
    padding: 34px 26px 54px;
    transform: scale(var(--pane-content-scale, 1));
    transform-origin: left top;
  }
  .application-grid.workspace-home.workspace-home-source:not(.settings-view-active) .source-panel {
    position: relative;
    inset: auto;
    max-height: none;
    background: var(--paper);
  }
  .application-grid.workspace-home:not(.settings-view-active) .workspace-home-resizer {
    order: 2 !important;
    position: relative;
    z-index: 8;
    width: 9px;
    min-width: 9px;
    height: 100%;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: col-resize;
    touch-action: none;
  }
  .application-grid.workspace-home:not(.settings-view-active) .workspace-home-resizer::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 4px;
    width: 1px;
    background: var(--line);
    transition: background-color 160ms ease, box-shadow 160ms ease;
  }
  .application-grid.workspace-home:not(.settings-view-active) .workspace-home-resizer::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 4px;
    width: 5px;
    height: 38px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 72%, var(--line));
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--paper) 82%, transparent);
  }
  .application-grid.workspace-home:not(.settings-view-active) .workspace-home-resizer:hover::before,
  .application-grid.workspace-home:not(.settings-view-active) .workspace-home-resizer:focus-visible::before,
  .application-grid.workspace-home:not(.settings-view-active) .workspace-home-resizer.dragging::before {
    background: var(--accent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 26%, transparent);
  }
  .application-grid.workspace-home:not(.settings-view-active) .workspace-home-panel {
    order: 3 !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0;
    display: grid !important;
  }
}

@keyframes helper-question-pulse {
  0%, 100% { box-shadow: inset 0 0 0 1px transparent; }
  45% { box-shadow: inset 0 0 0 2px var(--staged-accent), 0 0 24px color-mix(in srgb, var(--staged-accent) 25%, transparent); }
}
@keyframes helper-citation-pulse {
  0%, 100% { text-shadow: none; }
  45% { text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 72%, transparent); }
}
.application-grid.helper-question-attention .query-rail {
  animation: helper-question-pulse 720ms ease-in-out 3;
}
.application-grid.helper-citation-attention .markdown .citation {
  animation: helper-citation-pulse 720ms ease-in-out 3;
  outline: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .application-grid.helper-question-attention .query-rail { animation: none; box-shadow: inset 0 0 0 2px var(--staged-accent); }
  .application-grid.helper-citation-attention .markdown .citation { animation: none; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
}

@media (max-width: 1180px) and (min-width: 901px) {
  .application-grid.workspace-home { --query-rail-width: 25vw !important; }
}

@media (max-width: 900px) {
  .application-grid.workspace-home {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 42dvh) minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    overflow: auto;
  }
  .application-grid.workspace-home .query-rail,
  .application-grid.workspace-home .query-rail.mobile-open {
    position: relative;
    inset: auto;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 280px;
    max-height: none;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .application-grid.workspace-home .query-rail-head { padding-top: 28px; }
  .application-grid.workspace-home .primary-stage { display: block; height: auto; min-height: 58dvh; overflow: visible; }
  .application-grid.workspace-home .workspace-home-panel { min-height: 58dvh; padding: 42px 22px 58px; }
  .application-grid.workspace-home .workspace,
  .application-grid.workspace-home .settings-page,
  .application-grid.workspace-home .files-page { display: none !important; }
  .application-grid.workspace-home.workspace-home-answer .query-rail,
  .application-grid.workspace-home.workspace-home-source .query-rail { display: none !important; }
  .application-grid.workspace-home.workspace-home-answer .workspace,
  .application-grid.workspace-home.workspace-home-source .workspace { display: contents !important; }
  .application-grid.workspace-home.workspace-home-answer .result-column,
  .application-grid.workspace-home.workspace-home-source .source-panel {
    grid-row: 1;
    display: block !important;
    width: 100%;
    height: 100%;
    overflow: auto;
  }
  .application-grid.workspace-home.workspace-home-answer .source-panel,
  .application-grid.workspace-home.workspace-home-source .result-column { display: none !important; }
  .application-grid.workspace-home.workspace-home-answer .workspace-home-panel,
  .application-grid.workspace-home.workspace-home-source .workspace-home-panel { grid-row: 2; }
  .application-grid.workspace-home.workspace-home-files {
    grid-template-rows: minmax(280px, 42dvh) minmax(0, 1fr);
  }
  .application-grid.workspace-home.workspace-home-files .query-rail { display: none !important; }
  .application-grid.workspace-home.workspace-home-files .primary-stage { display: contents !important; }
  .application-grid.workspace-home.workspace-home-files .files-page {
    grid-row: 1;
    display: block !important;
    width: 100%;
    min-width: 0;
    height: 100%;
    overflow: hidden;
  }
  .application-grid.workspace-home.workspace-home-files .files-page-inner {
    width: 100%;
    height: 100%;
    padding: 28px 22px 40px;
    transform: none;
  }
  .application-grid.workspace-home.workspace-home-files .workspace-home-panel { grid-row: 2; }
  .workspace-home-panel h1 { font-size: clamp(42px, 12vw, 64px); }
  .workspace-path { width: 100%; }
  .workspace-path-step { min-height: 58px; }
  .workspace-home-close { top: 18px; right: 18px; }
}

.google-sign-in{text-decoration:none}.capture-admin-backdrop{position:fixed;inset:0;z-index:120;background:#0009;backdrop-filter:blur(8px);padding:24px}.capture-admin-backdrop[hidden]{display:none}.capture-admin-panel{position:relative;width:min(560px,100%);max-height:calc(100vh - 48px);overflow:auto;margin:7vh auto 0;padding:28px;border:1px solid #ffffff24;border-radius:22px;background:#151719;color:#edf5f7;box-shadow:0 24px 80px #0008}.capture-admin-panel h2{margin:0 0 6px;font:600 30px/1.1 system-ui}.capture-admin-panel>p{margin:0 64px 20px 0;color:#aeb6ba}.capture-admin-close,.capture-admin-workspace button{border:1px solid #ffffff38;border-radius:999px;padding:8px 12px;background:#202427;color:#edf5f7;font:700 12px/1 system-ui;cursor:pointer}.capture-admin-close{position:absolute;right:20px;top:20px}.capture-admin-workspace{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 0;border-top:1px solid #ffffff18}.capture-admin-workspace div{display:grid;gap:3px}.capture-admin-workspace span{color:#98a1a6}.capture-admin-workspace button:disabled{opacity:.45;cursor:default}@media(max-width:700px){.capture-admin-panel{margin-top:2vh;padding:22px}.capture-admin-workspace{align-items:flex-start}}

/* Stable answer and status behavior, layered over server geometry. */
:root { --partial-accent: #e8c75b; }
.model-settings select + label { margin-top: 20px; }
.model-settings select:disabled { opacity: .5; cursor: wait; }
.model-settings [role="status"] { color: var(--accent); }
.answer-disclosure { cursor: pointer; }
.answer-disclosure:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.answer-question-heading[aria-expanded="true"] { display: block; -webkit-line-clamp: unset; line-clamp: unset; }
/* Long expanded headers remain readable even in a short viewport. */
.answer-page-heading { max-height: 55%; overflow-y: auto; flex-shrink: 0; }
.usage-summary {
  white-space: normal;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
}
.answer-usage-summary {
  font-size: 0.78em;
  opacity: 0.75;
  margin: 0 0 1rem;
}
.staged-question-entry-actions .mimic-run {
  width: auto;
  min-width: 6em;
  padding: 5px 9px;
  color: var(--accent, #91cec7);
  font: inherit;
  font-size: 11px;
}
.answer-question-status { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:8px; font-size:12px; color:var(--muted); }
.answer-question-status[data-answer-state="partial"] { color:var(--partial-accent); }
.answer-question-status button { border:1px solid currentColor; border-radius:999px; background:transparent; color:var(--accent,#91cec7); padding:4px 12px; font:inherit; cursor:pointer; }
.answer-question-status button:disabled { opacity:.55; cursor:wait; }
.answer-question-status [role="alert"] { color:var(--staged-accent,#e09570); }
.query-entry[data-staged-question] { cursor:pointer; }
html[data-diagnostics="false"] [data-diagnostics] { display: none !important; }

.local-preview-label { position:fixed; bottom:8px; right:14px; z-index:1200; margin:0; padding:5px 9px; border:1px solid var(--line); border-radius:999px; color:var(--muted); background:var(--paper); font:600 10px var(--font-body); pointer-events:none; opacity:.85; }
/* Do not keep the older server's always-orange staged background. */
.query-entry.pending { background:transparent; cursor:pointer; }
.query-entry.pending:hover { background:color-mix(in srgb,var(--query-state-accent) 8%,transparent); }
.query-entry.pending.selected { background:color-mix(in srgb,var(--query-state-accent) 12%,transparent); box-shadow:inset 3px 0 0 var(--query-state-accent); }
.query-entry.pending:active { transform:scale(.995); box-shadow:inset 3px 0 0 var(--query-state-accent); }
/* A quiet upward wash belongs to the divider, not the row hover treatment. */
.query-entry::before { content:""; position:absolute; left:0; right:0; bottom:1px; height:9px; background:linear-gradient(to top,color-mix(in srgb,var(--query-state-accent) 6%,transparent),transparent); pointer-events:none; }
.query-entry::after { background:color-mix(in srgb,var(--query-state-accent) 34%,var(--line)); }
.query-entry-sequence { min-width:0; }
.query-entry-sequence small { max-width:100%; white-space:normal; overflow-wrap:anywhere; line-height:1.35; }
html[data-diagnostics="false"] .query-entry[data-staged-question] .query-entry-synopsis { display:none; }
.answer-heading-row { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.answer-heading-row > div { min-width:0; }
.answer-heading-row h1 { min-width:0; }
.answer-heading-row .answer-export { flex:none; margin-top:0; border-radius:999px; padding:6px 9px; font:700 10px var(--font-body); white-space:nowrap; }
.answer-heading-row .answer-export, .answer-question-status button { border:1px solid var(--line); background:transparent; color:var(--accent); box-shadow:none; text-shadow:none; transition:border-color 160ms ease,box-shadow 160ms ease; }
.answer-heading-row .answer-export:is(:hover,:focus-visible):not(:disabled), .answer-question-status button:is(:hover,:focus-visible):not(:disabled) { outline:none; border-color:color-mix(in srgb,var(--accent) 36%,var(--line)); background:var(--surface-soft); box-shadow:0 0 8px color-mix(in srgb,var(--accent) 14%,transparent); text-shadow:none; }
.live-question-timer { font:600 11px/1.5 var(--font-body); font-variant-numeric:tabular-nums; color:var(--muted); }
.query-entry .live-question-timer { display:block; margin-top:7px; }
.live-question-timer[hidden], .usage-summary[hidden] { display:none !important; }
.brief-card #brief { display:inline; text-transform:none; letter-spacing:normal; font:inherit; color:inherit; }
.brief-card #briefLabel { display:inline; }
.query-title-row { flex-wrap:wrap; gap:12px; }
.query-title-row > div { min-width:0; }
.local-account-preview { border-style:dashed; }
.local-account-preview a { display:inline-block; margin-top:14px; color:var(--accent); }
.capture-admin-panel .preview-admin-notice { color:var(--staged-accent); font-size:12px; }
[data-preview-disabled] { opacity:.4; cursor:not-allowed !important; }
/* Headings, controls and reading bodies follow Questions' existing column.
   Pane dividers and the responsive scale controller remain unchanged. */
.brief-card { width:100%; max-width:100%; font:400 var(--answer-font-size,var(--reading-size))/1.72 var(--font-body); }
.answer-page-heading, .answer-body-scroll > .markdown, .source-page-heading, .document-view, .files-page-heading, .files-page-content { width:100%; max-width:100%; box-sizing:border-box; }
@media(min-width:1181px) {
  .query-rail-scale, .answer-pane-scale, .source-page-inner, .files-page-inner { box-sizing:border-box; padding-inline:26px; }
}
.settings-grid { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; gap:20px; margin-top:28px; }
.settings-group-heading { grid-column:1/-1; padding-top:10px; border-top:1px solid var(--line); }
.settings-group-heading h2 { margin:0; font:650 19px var(--font-display); }
.settings-group-heading p { margin:7px 0 0; color:var(--muted); font-size:13px; }
.settings-card { height:auto; min-width:0; }
.settings-grid > .admin-settings, .settings-preview-tools { grid-column:1/-1; }
.settings-preview-tools { padding:20px 0; border-top:1px solid var(--line); }
.settings-preview-tools > summary { cursor:pointer; color:var(--muted); font:600 14px var(--font-body); }
.settings-preview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin-top:18px; }
.workspace-scope { margin:12px 0 0; color:var(--muted); font:500 12px/1.6 var(--font-body); overflow-wrap:anywhere; }
@media(max-width:900px) { .brief-card { font-size:max(17px,var(--answer-font-size,var(--reading-size))); } }
@media(max-width:700px) { .settings-grid, .settings-preview-grid { grid-template-columns:minmax(0,1fr); } }


:root { --highlight-effect-strength:50%; --highlight-glow-mid:30%; --highlight-glow-far:15%; --evidence-text-strength:100%;
  --highlight-effect-color:color-mix(in srgb,var(--highlight) var(--highlight-effect-strength),transparent);
  --evidence-display-color:color-mix(in srgb,var(--evidence-text) var(--evidence-text-strength),var(--ink));
}
.source-settings .highlight-color-row label { flex:0 0 86px; }
.source-settings .highlight-color-row input[type="range"] { flex:1 1 auto; min-width:0; width:auto; margin:0; accent-color:var(--accent); }
.source-settings .highlight-color-row input[type="color"] { flex:0 0 20px; }
.source-settings .highlight-color-row input[type="range"]:disabled { opacity:.4; cursor:default; }


.settings-card input[type="range"] {
  appearance:none; -webkit-appearance:none; height:20px; padding:0; border:0; border-radius:0; cursor:pointer;
  background:linear-gradient(to right,var(--accent) 0 var(--range-progress,0%),var(--line) var(--range-progress,0%) 100%) center/100% 2px no-repeat;
}
.settings-card input[type="range"]::-webkit-slider-runnable-track { height:2px; border:0; background:transparent; }
.settings-card input[type="range"]::-webkit-slider-thumb {
  appearance:none; -webkit-appearance:none; width:12px; height:12px; margin-top:-5px; border:2px solid var(--accent); border-radius:50%; background:var(--paper);
}
.settings-card input[type="range"]::-moz-range-track { height:2px; border:0; background:var(--line); }
.settings-card input[type="range"]::-moz-range-progress { height:2px; background:var(--accent); }
.settings-card input[type="range"]::-moz-range-thumb { width:8px; height:8px; border:2px solid var(--accent); border-radius:50%; background:var(--paper); }
.settings-card input[type="range"]:focus-visible { outline:none; }
.settings-card input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 23%,transparent); }
.settings-card input[type="range"]:focus-visible::-moz-range-thumb { box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 23%,transparent); }

.application-grid.workspace-home.workspace-home-files:not(.settings-view-active) .files-page-inner {
  display:flex; flex-direction:column; min-height:0; padding-bottom:0;
}
.application-grid.workspace-home.workspace-home-files:not(.settings-view-active) .files-page-heading { flex:0 0 auto; }
.application-grid.workspace-home.workspace-home-files:not(.settings-view-active) .files-page-content {
  flex:1 1 auto; min-height:0; overflow-x:hidden; overflow-y:auto;
  overscroll-behavior:contain; scrollbar-gutter:stable; padding-bottom:54px;
}


.helper-exit-dialog { width:min(440px,calc(100vw - 40px)); padding:26px; border:1px solid var(--line); border-radius:14px; background:var(--paper); color:var(--ink); box-shadow:0 18px 70px #0008; }
.helper-exit-dialog::backdrop { background:#0008; backdrop-filter:blur(5px); }
.helper-exit-dialog h2 { margin:0 0 12px; font:650 23px/1.2 var(--font-display); }
.helper-exit-dialog p { margin:0; color:var(--muted); font:400 15px/1.65 var(--font-body); }
.helper-exit-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:24px; }
.helper-exit-actions button { padding:8px 18px; border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--accent); font:700 12px var(--font-body); cursor:pointer; }
.helper-exit-actions button:hover,.helper-exit-actions button:focus-visible { outline:none; border-color:var(--accent); box-shadow:0 0 8px color-mix(in srgb,var(--accent) 18%,transparent); }
.application-grid.workspace-home.helper-guide-hidden:not(.settings-view-active) .workspace-home-panel,
.application-grid.workspace-home.helper-guide-hidden:not(.settings-view-active) .workspace-home-resizer { display:none !important; }
@media(min-width:901px) {
  .application-grid.workspace-home.helper-guide-hidden:not(.settings-view-active) .query-rail,
  .application-grid.workspace-home.helper-guide-hidden.workspace-home-files:not(.settings-view-active) .files-page,
  .application-grid.workspace-home.helper-guide-hidden.workspace-home-answer:not(.settings-view-active) .result-column,
  .application-grid.workspace-home.helper-guide-hidden.workspace-home-source:not(.settings-view-active) .source-panel { flex:1 1 100% !important; width:100% !important; }
}

.answer-pane-scale:has(> #emptyAnswer:not(.hidden)) > .answer-page-heading,
.source-page-inner:has(> #emptySource:not(.hidden)) > .source-page-heading {
  min-height:calc(clamp(34px, 3vw, 46px) + 32px); margin-bottom:24px; padding-bottom:0; box-sizing:border-box; align-items:flex-start;
}
@media(max-width:900px) {
  .answer-pane-scale:has(> #emptyAnswer:not(.hidden)) > .answer-page-heading,
  .source-page-inner:has(> #emptySource:not(.hidden)) > .source-page-heading { min-height:70px; }
}

.empty-state-link { color:var(--accent); text-decoration:none; border-bottom:0; text-shadow:0 0 6px color-mix(in srgb,var(--accent) 24%,transparent); cursor:pointer; }
.empty-state-link:hover { text-decoration:none; border-bottom:0; text-shadow:0 0 8px color-mix(in srgb,var(--accent) 42%,transparent); }
.empty-state-link:focus-visible { outline:1px solid var(--accent); outline-offset:3px; border-radius:2px; }

.mobile-settings-button,.mobile-settings-dialog,.mobile-introduction,.mobile-walkthrough,.mobile-question-count,.mobile-question-breakdown { display:none; }
.mobile-guide-preference { display:none; }
@media(max-width:900px) {
  html.mobile-flow, html.mobile-flow body { height:auto!important; min-height:100%; overflow:visible!important; overflow-x:clip!important; }
  html.mobile-flow body { padding:0!important; touch-action:pan-y; background:var(--paper); }
  html.mobile-flow .shell { display:block!important; height:auto!important; min-height:100dvh; padding:max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(32px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))!important; overflow:visible!important; }
  html.mobile-flow .masthead, html.mobile-flow .drawer-tabs,
  html.mobile-flow .hero, html.mobile-flow .mobile-edge-pull,
  html.mobile-flow .query-resizer, html.mobile-flow .source-resizer,
  html.mobile-flow .files-resizer, html.mobile-flow .workspace-home-resizer { display:none!important; }
  html.mobile-flow .application-grid { display:flex!important; flex-direction:column!important; height:auto!important; min-height:0!important; width:100%!important; padding:0!important; gap:0!important; overflow:visible!important; }
  html.mobile-flow .application-grid .primary-stage,
  html.mobile-flow .application-grid #workspace { display:contents!important; opacity:1!important; visibility:visible!important; pointer-events:auto!important; }
  html.mobile-flow .application-grid #filesPage,
  html.mobile-flow .application-grid #queryRail,
  html.mobile-flow .application-grid .result-column,
  html.mobile-flow .application-grid #sourcePanel,
  html.mobile-flow .application-grid #settingsPage { display:block!important; position:static!important; inset:auto!important; width:100%!important; max-width:100%!important; height:auto!important; max-height:none!important; min-height:0!important; flex:none!important; align-self:stretch!important; opacity:1!important; visibility:visible!important; pointer-events:auto!important; margin:0!important; padding:24px 0!important; border:0!important; border-bottom:1px solid var(--line)!important; border-radius:0!important; overflow:visible!important; transform:none!important; box-shadow:none!important; scroll-margin-top:76px; }
  html.mobile-flow .mobile-introduction { display:block; order:-1; min-width:0; padding:0 0 32px; border-bottom:1px solid var(--line); color:var(--ink); }
  html.mobile-flow .mobile-introduction-header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
  html.mobile-flow .mobile-introduction-header p { margin:0; font:650 17px/1.4 var(--font-display); letter-spacing:-.025em; }
  html.mobile-flow .mobile-introduction-art { position:relative; isolation:isolate; height:172px; margin:20px 0 18px; pointer-events:none; }
  html.mobile-flow .mobile-introduction-art::before { content:''; position:absolute; inset:0 12%; z-index:-1; background:radial-gradient(ellipse,color-mix(in srgb,var(--accent) 12%,transparent),transparent 68%); }
  html.mobile-flow .mobile-introduction-page { position:absolute; top:24px; left:50%; width:130px; height:116px; box-sizing:border-box; padding:20px 17px; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
  html.mobile-flow .mobile-introduction-page span { display:block; height:2px; margin:0 0 12px; background:var(--line); border-radius:2px; }
  html.mobile-flow .mobile-introduction-page span:nth-child(2) { width:72%; }
  html.mobile-flow .mobile-introduction-page span:nth-child(4) { width:55%; }
  html.mobile-flow .mobile-introduction-page-back { transform:translateX(-78%) rotate(-15deg); opacity:.5; }
  html.mobile-flow .mobile-introduction-page-middle { transform:translateX(-22%) rotate(13deg); opacity:.65; }
  html.mobile-flow .mobile-introduction-page-front { transform:translateX(-50%); border-color:color-mix(in srgb,var(--accent) 50%,var(--line)); box-shadow:0 12px 40px rgb(0 0 0 / .1),0 0 20px color-mix(in srgb,var(--accent) 5%,transparent); }
  html.mobile-flow .mobile-introduction-page-front span:first-child { width:40%; height:4px; background:var(--accent); opacity:.8; }
  html.mobile-flow .mobile-introduction-page-front span:nth-child(3) { background:var(--accent); opacity:.5; box-shadow:0 0 10px color-mix(in srgb,var(--accent) 25%,transparent); }
  html.mobile-flow .mobile-introduction h1 { max-width:12ch; margin:0 0 14px; font:700 42px/1.08 var(--font-display); letter-spacing:-.045em; }
  html.mobile-flow .mobile-introduction-description { max-width:32ch; margin:0; color:var(--muted); font:400 15px/1.65 var(--font-body); }
  html.mobile-flow .mobile-walkthrough { display:block; order:0; min-width:0; padding:16px 0 24px; border-bottom:1px solid var(--line); color:var(--ink); overflow-wrap:anywhere; }
  html.mobile-flow .mobile-walkthrough[hidden] { display:none!important; }
  html.mobile-flow .mobile-guide-preference { display:grid; border-top:0; border-bottom:1px solid var(--line); margin:0 0 20px; }
  html.mobile-flow .mobile-walkthrough-label { margin:0 0 12px; color:var(--accent); font:650 10px/1.5 var(--font-body); letter-spacing:.14em; }
  html.mobile-flow .mobile-walkthrough h2 { max-width:16ch; margin:0 0 14px; font:700 32px/1.15 var(--font-display); letter-spacing:-.035em; }
  html.mobile-flow .mobile-walkthrough-intro { margin:0; color:var(--muted); font:400 14px/1.65 var(--font-body); }
  html.mobile-flow .mobile-walkthrough ol { list-style:none; counter-reset:walkthrough; margin:24px 0; padding:0; display:grid; gap:18px; }
  html.mobile-flow .mobile-walkthrough li { position:relative; counter-increment:walkthrough; padding-left:36px; }
  html.mobile-flow .mobile-walkthrough li::before { content:counter(walkthrough,decimal-leading-zero); position:absolute; left:0; top:1px; color:var(--accent); font:550 11px/1.7 var(--font-body); }
  html.mobile-flow .mobile-walkthrough li strong { font:650 14px/1.6 var(--font-body); }
  html.mobile-flow .mobile-walkthrough li p,
  html.mobile-flow .mobile-walkthrough-boundaries p { margin:4px 0 0; color:var(--muted); font:400 13px/1.65 var(--font-body); }
  html.mobile-flow .mobile-walkthrough-boundaries { border-top:1px solid var(--line); padding-top:12px; }
  html.mobile-flow .mobile-walkthrough-boundaries summary { cursor:pointer; min-height:44px; display:list-item; align-content:center; color:var(--ink); font:550 13px/1.6 var(--font-body); }
  html.mobile-flow .mobile-walkthrough-boundaries summary::marker { color:var(--accent); }
  html.mobile-flow .mobile-walkthrough-boundaries p { margin:0 0 12px; }
  html.mobile-flow .mobile-walkthrough nav { display:flex; flex-wrap:wrap; gap:4px 24px; margin-top:12px; }
  html.mobile-flow .mobile-walkthrough a { display:inline-flex; align-items:center; min-height:44px; color:var(--accent); text-decoration:none; font:550 13px/1.5 var(--font-body); }
  html.mobile-flow .mobile-walkthrough a:hover { text-shadow:0 0 10px var(--accent); }
  html.mobile-flow .mobile-walkthrough a:focus-visible { outline:1px solid var(--accent); outline-offset:3px; border-radius:2px; }
  html.mobile-flow #queryRail { order:1!important; }
  html.mobile-flow #filesPage { order:2!important; }
  html.mobile-flow .result-column { order:3!important; }
  html.mobile-flow #sourcePanel { order:4!important; }
  html.mobile-flow #settingsPage { order:5!important; }
  html.mobile-flow .files-page-inner, html.mobile-flow .query-rail-scale,
  html.mobile-flow .answer-pane-scale, html.mobile-flow .source-page-inner,
  html.mobile-flow .settings-page-inner { display:block!important; width:100%!important; max-width:100%!important; height:auto!important; min-height:0!important; flex:none!important; opacity:1!important; visibility:visible!important; pointer-events:auto!important; padding:0!important; margin:0!important; transform:none!important; overflow:visible!important; }
  html.mobile-flow .files-page-content, html.mobile-flow #mcpEvents,
  html.mobile-flow .answer-body-scroll, html.mobile-flow #documentText,
  html.mobile-flow .document-view, html.mobile-flow .source-reading-card { height:auto!important; max-height:none!important; min-height:0!important; overflow:visible!important; mask-image:none!important; -webkit-mask-image:none!important; }
  html.mobile-flow #documentText { white-space:pre-wrap!important; overflow-wrap:anywhere; font-size:16px; }
  html.mobile-flow .query-rail-head, html.mobile-flow .answer-page-heading,
  html.mobile-flow .files-page-heading, html.mobile-flow .source-page-heading { position:static!important; transform:none!important; padding-top:0!important; }
  html.mobile-flow .settings-grid { grid-template-columns:minmax(0,1fr)!important; }
  html.mobile-flow .settings-card:has(#layoutTitle) { display:none!important; }
  html.mobile-flow .viewer-empty { min-height:160px!important; padding:24px 12px!important; }
  html.mobile-flow .query-entry, html.mobile-flow .file-row { overflow-wrap:anywhere; }
  /* Only Questions and Files are top-level phone fields. Live Answer and Source
     are mounted inside an expanded card; originals are parked, not duplicated. */
  html.mobile-flow .application-grid #workspace,
  html.mobile-flow .application-grid #settingsPage { display:none!important; }
  html.mobile-flow .application-grid .result-column,
  html.mobile-flow .application-grid #sourcePanel { display:none!important; }
  html.mobile-flow .application-grid .mobile-question-body .result-column,
  html.mobile-flow .application-grid .mobile-question-body #sourcePanel:not(.mobile-source-closed),
  html.mobile-flow .application-grid .mobile-file-preview #sourcePanel:not(.mobile-source-closed) { display:block!important; }
  html.mobile-flow .mobile-question-card { width:100%; min-width:0; }
  html.mobile-flow .mobile-question-body[hidden],
  html.mobile-flow #sourcePanel.mobile-source-closed { display:none!important; }
  html.mobile-flow .mobile-question-body .result-column,
  html.mobile-flow .mobile-question-body #sourcePanel,
  html.mobile-flow .mobile-file-preview #sourcePanel { padding:18px 0!important; border-bottom:0!important; scroll-margin-top:12px; }
  html.mobile-flow .mobile-question-body .answer-heading-row h1 { font-size:22px; }
  html.mobile-flow .mobile-question-body #questionHeading,
  html.mobile-flow .mobile-question-body .answer-page-heading .eyebrow { display:none; }
  html.mobile-flow .query-entry { cursor:pointer; }
  html.mobile-flow .mobile-question-body { min-width:0; padding:0 12px 12px; border-bottom:1px solid var(--line); }
  html.mobile-flow .mobile-question-body .markdown { min-width:0; overflow-wrap:anywhere; }
  html.mobile-flow .mobile-file-preview:empty { display:none; }
  html.mobile-flow .mobile-settings-button { display:inline-block; margin-left:auto; background:transparent; color:var(--muted); border:1px solid var(--line); border-radius:8px; padding:8px 10px; font:inherit; font-size:12px; }
  html.mobile-flow .mobile-settings-dialog[open] { display:block; width:calc(100% - 24px); max-width:600px; max-height:90dvh; box-sizing:border-box; padding:16px; background:var(--paper); color:var(--ink); border:1px solid var(--line); border-radius:12px; overflow:auto; }
  html.mobile-flow .mobile-settings-dialog::backdrop { background:rgb(0 0 0 / .65); }
  html.mobile-flow .mobile-settings-dialog #settingsPage { display:block!important; position:static!important; width:100%!important; max-width:100%!important; height:auto!important; opacity:1!important; visibility:visible!important; pointer-events:auto!important; padding:16px 0!important; overflow:visible!important; transform:none!important; }
  html.mobile-flow .mobile-settings-dialog>button { border:1px solid var(--line); background:transparent; color:var(--accent); border-radius:8px; padding:8px 12px; }

  /* Phone controls stay outside the two plain, expandable name lists. */
  html.mobile-flow .application-grid { gap:24px!important; }
  html.mobile-flow .application-grid #queryRail,
  html.mobile-flow .application-grid #filesPage { padding:8px 0!important; border-bottom:0!important; }
  html.mobile-flow .query-title-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:8px; margin:0 0 18px; overflow:visible; }
  html.mobile-flow .query-rail-head .eyebrow,
  html.mobile-flow .files-page-heading .eyebrow { margin:0 0 5px; font-size:9px; letter-spacing:.14em; }
  html.mobile-flow .query-rail-head h2,
  html.mobile-flow .files-page-heading h1 { margin:0; font:700 28px/1.15 var(--font-display); letter-spacing:-.035em; }
  html.mobile-flow .files-page-heading { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
  html.mobile-flow .files-page-heading>div { min-width:0; flex:1; }
  html.mobile-flow .files-page-heading .workspace-scope { font-size:11px; line-height:1.5; margin:10px 0 0; }
  html.mobile-flow #stageQuestionToggle { min-width:0; min-height:44px; padding:0 12px; border:1px solid var(--line); border-radius:12px; background:var(--paper-strong); }
  html.mobile-flow #stageQuestionToggle #mcpStatus,
  html.mobile-flow #stageQuestionToggle i,
  html.mobile-flow #stageQuestionToggle .mcp-live-separator { display:none; }
  html.mobile-flow #stageQuestionToggle .mcp-live-add { font-size:0; }
  html.mobile-flow #stageQuestionToggle .mcp-live-add::after { content:'Add question'; font:650 12px/1 var(--font-body); text-transform:none; letter-spacing:0; }
  html.mobile-flow .mobile-settings-button { min-height:44px; margin:0; padding:0 10px; border-radius:12px; font-size:11px; }
  html.mobile-flow .question-batch-controls { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; padding:0; }
  html.mobile-flow .question-batch-controls button,
  html.mobile-flow .file-catalog-heading button,
  html.mobile-flow .file-picker,
  html.mobile-flow .file-upload-actions button,
  html.mobile-flow .answer-question-status button,
  html.mobile-flow .answer-export,
  html.mobile-flow .staged-question-actions button { min-height:44px; padding:10px 14px; border-radius:12px; font-size:12px; }
  html.mobile-flow .question-batch-controls small { flex:1 0 100%; font-size:11px; line-height:1.5; }
  html.mobile-flow #mcpEvents { display:grid; gap:0; background:none; }
  html.mobile-flow .mobile-question-card { border:0; border-radius:0; background:transparent; box-shadow:none; }
  html.mobile-flow .mobile-question-card:has(.query-entry:focus-visible) { outline:2px solid var(--accent); outline-offset:3px; }
  html.mobile-flow .mobile-question-card>.query-entry { grid-template-columns:max-content minmax(0,1fr) 24px; gap:10px; align-items:start; padding:16px 0; border-radius:0; min-height:56px; transform:none; background:transparent; box-shadow:none; }
  html.mobile-flow .mobile-question-card>.query-entry.selected,
  html.mobile-flow .mobile-question-card>.query-entry:hover,
  html.mobile-flow .mobile-question-card>.query-entry:active { background:transparent; box-shadow:none; }
  html.mobile-flow .mobile-question-card .query-entry-synopsis,
  html.mobile-flow .mobile-question-card .query-entry-body>small { display:none; }
  /* Reuse desktop's state accent and its quiet upward divider wash. The
     sequence is the existing stable question number, never a phone index. */
  html.mobile-flow .mobile-question-card .query-entry-sequence { grid-row:1; grid-column:1; display:flex; width:auto; min-width:24px; padding-top:1px; align-self:start; }
  html.mobile-flow .mobile-question-card .query-entry-sequence b { width:auto; color:var(--query-state-accent); font:650 14px/1.6 var(--font-body); font-variant-numeric:tabular-nums; letter-spacing:0; }
  html.mobile-flow .mobile-question-card .query-entry-sequence small { display:none; }
  html.mobile-flow .mobile-question-card .query-entry-body { grid-row:1; grid-column:2; }
  html.mobile-flow .mobile-question-card .query-entry-body strong { color:var(--query-state-accent); font:550 15px/1.6 var(--font-body); -webkit-line-clamp:2; }
  html.mobile-flow .mobile-question-card>.query-entry>.mobile-disclosure-icon { grid-column:3; }
  html.mobile-flow .mobile-question-open .query-entry-body strong { display:block; -webkit-line-clamp:unset; }
  html.mobile-flow .mobile-question-card .staged-question-entry-actions { display:none; }
  html.mobile-flow .mobile-question-open .staged-question-entry-actions { display:flex; grid-column:1/-1; grid-row:2; flex-direction:row; justify-content:flex-end; gap:4px; }
  html.mobile-flow .staged-question-entry-actions button { width:44px; height:44px; border-radius:12px; }
  html.mobile-flow .staged-question-entry-actions svg { width:16px; height:16px; }
  html.mobile-flow .mobile-question-body { padding:0 0 20px; border:0; background:transparent; }
  html.mobile-flow .mobile-question-body .answer-heading-row { align-items:center; gap:8px; }
  html.mobile-flow .mobile-question-body .answer-heading-row h1 { font-size:19px; }
  html.mobile-flow .mobile-question-body .brief-card { padding:12px 0; border:0; border-radius:0; background:transparent; box-shadow:none; }
  html.mobile-flow .mobile-question-body .markdown { font-size:15px; line-height:1.7; }
  html.mobile-flow .mobile-question-body #sourcePanel,
  html.mobile-flow .mobile-file-preview #sourcePanel { margin-top:12px!important; padding:12px 0!important; border:0!important; border-radius:0!important; background:transparent; }
  html.mobile-flow .mobile-question-body #documentText,
  html.mobile-flow .mobile-file-preview #documentText { font-size:15px; line-height:1.7; }
  html.mobile-flow .file-upload-card { padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
  html.mobile-flow .file-upload-copy strong { font-size:16px; }
  html.mobile-flow .file-upload-copy p { font-size:12px; line-height:1.6; }
  html.mobile-flow .file-upload-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; margin-top:14px; padding-top:14px; }
  html.mobile-flow .file-picker { display:flex; align-items:center; justify-content:center; }
  html.mobile-flow #fileUploadName { grid-row:2; grid-column:1/-1; min-width:0; overflow-wrap:anywhere; font-size:12px; }
  html.mobile-flow .file-upload-actions button { grid-row:1; grid-column:2; margin:0; }
  html.mobile-flow .file-upload-status:empty { display:none; }
  html.mobile-flow .file-catalog { margin-top:22px; }
  html.mobile-flow .file-catalog-heading { margin-bottom:12px; align-items:center; }
  html.mobile-flow .file-catalog-heading .eyebrow { display:none; }
  html.mobile-flow .file-catalog-heading h2 { font-size:16px; }
  html.mobile-flow .file-list { display:grid; grid-template-columns:minmax(0,1fr); gap:0; border:0; }
  html.mobile-flow .file-row,
  html.mobile-flow .file-row:hover,
  html.mobile-flow .file-row:active { display:grid; grid-template-columns:minmax(0,1fr) 24px; align-items:start; width:100%; min-height:56px; padding:16px 0; gap:8px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; box-shadow:none; }
  html.mobile-flow .file-row-copy { grid-column:1; grid-row:1; width:100%; min-width:0; }
  html.mobile-flow .file-row-copy strong { font:550 15px/1.6 var(--font-body); overflow-wrap:anywhere; white-space:normal; }
  html.mobile-flow .file-kind,
  html.mobile-flow .file-row-hash,
  html.mobile-flow .file-row-meta { display:none!important; }
  html.mobile-flow .mobile-file-preview[hidden] { display:none!important; }
  html.mobile-flow .mobile-file-preview:not([hidden]):not(:empty) { padding-bottom:16px; border-bottom:1px solid var(--line); }
  html.mobile-flow .file-row[aria-expanded="true"] { border-bottom-color:transparent; }
  html.mobile-flow .mobile-disclosure-icon { grid-column:2; grid-row:1; width:24px; height:24px; display:grid; place-items:center; color:var(--muted); pointer-events:none; }
  html.mobile-flow .mobile-disclosure-icon::before { content:''; width:7px; height:7px; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(45deg) translate(-1px,-1px); transform-origin:center; transition:transform .16s ease; }
  html.mobile-flow [aria-expanded="true"]>.mobile-disclosure-icon::before { transform:rotate(225deg) translate(-1px,-1px); }
  html.mobile-flow .file-count,
  html.mobile-flow .mobile-question-count { display:block; flex:none; margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; color:var(--muted); font:500 12px/1.5 var(--font-body); white-space:nowrap; }
  html.mobile-flow .mobile-question-count { grid-column:2; grid-row:1; justify-self:end; }
  html.mobile-flow .mobile-question-breakdown { display:flex; flex-wrap:wrap; gap:0 8px; margin:-6px 0 16px; color:var(--muted); font:400 12px/1.6 var(--font-body); }
  html.mobile-flow .mobile-question-breakdown span+span::before { content:'·'; margin-right:8px; color:var(--muted); }
  html.mobile-flow textarea,html.mobile-flow input[type="text"] { font-size:16px; }
  html.mobile-flow .citation[aria-busy="true"] { opacity:.65; }
  html.mobile-flow .citation.mobile-citation-open { text-decoration:none; }
  html.mobile-flow .mobile-citation-quote { white-space:pre-wrap; overflow-wrap:anywhere; quotes:'“' '”'; }
  html.mobile-flow .mobile-citation-source { display:block; margin:5px 0 8px; color:var(--muted); font:400 11px/1.5 var(--font-body); text-shadow:none; }
  html.mobile-flow .mobile-citation-error { display:block; color:var(--muted); font:400 12px/1.5 var(--font-body); margin:6px 0; }
  html.mobile-flow .staged-question-composer.open { max-height:none; }
  html.mobile-flow .staged-question-file { min-height:44px; }
  html.mobile-flow button,html.mobile-flow .query-entry { touch-action:manipulation; }
  /* Phone preview controls only: no changes to list labels, answer content,
     disclosure headings, source text, or citation rendering. */
  html.mobile-flow #stageQuestionToggle,
  html.mobile-flow #stagedQuestionComposer,
  html.mobile-flow #questionBatchControls,
  html.mobile-flow #fileUploadForm,
  html.mobile-flow #questionForm,
  html.mobile-flow #refreshFiles,
  html.mobile-flow .staged-question-entry-actions,
  html.mobile-flow #answerMoves,
  html.mobile-flow [data-question-action],
  html.mobile-flow .model-settings,
  html.mobile-flow .admin-settings,
  html.mobile-flow .capture-admin-backdrop { display:none!important; }
  html.mobile-flow .query-title-row { grid-template-columns:minmax(0,1fr) auto; }
  html.mobile-flow .mobile-settings-button { width:44px; height:44px; min-height:44px; display:inline-grid; place-items:center; padding:0; border:0; background:transparent; border-radius:10px; color:var(--muted); }
  html.mobile-flow .mobile-settings-button svg { width:22px; height:22px; display:block; }
  html.mobile-flow .mobile-settings-button:hover,
  html.mobile-flow .mobile-settings-button:focus-visible { color:var(--accent); }
  html.mobile-flow .mobile-settings-button:focus-visible { outline:1px solid var(--accent); outline-offset:2px; }
  html.mobile-flow .file-catalog { margin-top:0; }
  @media(max-width:360px) {
    html.mobile-flow .query-title-row { grid-template-columns:minmax(0,1fr) auto; }
    html.mobile-flow .query-title-row>div { grid-column:1; grid-row:1; }
    html.mobile-flow .query-title-row .mobile-settings-button { grid-column:2; grid-row:1; }
    html.mobile-flow #stageQuestionToggle { grid-column:1/-1; grid-row:2; width:100%; justify-content:center; }
  }
  @media(prefers-reduced-motion:reduce) {
    html.mobile-flow .query-entry,html.mobile-flow .mobile-disclosure-icon::before { transition:none; }
  }
}
