:root {
  color-scheme: dark;
  --ink: #edf6ff;
  --muted: #b9cfdd;
  --paper: #06172c;
  --surface: #0d2541;
  --line: #31536b;
  --gold: #dfbd72;
  --dark: #07182e;
  --accent: #81dfd1;
  --error: #ffb7b0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; position: relative; isolation: isolate; background: var(--paper); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(circle at 78% 2%, #1b527278, transparent 40%), radial-gradient(circle at 23% 62%, #113f5b77, transparent 48%), linear-gradient(135deg, #06172c, #0a1f37); }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
button svg { pointer-events: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 20px; background: var(--accent); color: var(--dark); padding: 10px 16px; z-index: 99; }
.skip-link:focus { top: 10px; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 226px; background: var(--dark); border-right: 1px solid var(--line); color: var(--ink); padding: 30px 22px 20px; display: flex; flex-direction: column; z-index: 5; overflow-y: auto; }
.brand { display: flex; align-items: center; justify-content: center; align-self: flex-start; width: 44px; min-height: 44px; text-decoration: none; border-radius: 11px; flex-shrink: 0; }
.brand img { border-radius: 11px; flex-shrink: 0; }
.nav-label { font-size: 11px; letter-spacing: 1px; color: var(--muted); margin: 0 10px 14px; }
.nav-item { border: 1px solid transparent; display: flex; align-items: center; gap: 11px; width: 100%; text-decoration: none; color: var(--muted); background: none; border-radius: 7px; font-size: 14px; text-align: left; min-height: 46px; padding: 10px; margin-bottom: 7px; }
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: #102d4c; color: var(--ink); }
.nav-item.active { background: #154255; color: #e0fff8; border-color: #55a99e; box-shadow: inset 3px 0 var(--accent); }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding: 17px 10px 0; color: var(--muted); font-size: 12px; }
.sidebar-bottom > span:first-child { font-size: 12px; letter-spacing: 1px; }
.app-shell { margin-left: 226px; }
main { max-width: 1500px; margin: auto; padding: 28px 36px 36px; }
.page-heading { display: grid; grid-template-columns: minmax(250px, .9fr) minmax(0, 1.3fr); gap: 28px; align-items: center; margin-bottom: 28px; }
.heading-copy { min-width: 0; }
.eyebrow { font-size: 12px; letter-spacing: 1.6px; font-weight: 650; color: var(--accent); margin-bottom: 10px; }
h1 { font-size: clamp(30px, 2.65vw, 40px); line-height: 1.14; letter-spacing: -1.1px; font-weight: 550; text-wrap: balance; }
.intro { color: var(--muted); margin-top: 13px; font-size: 16px; max-width: 39ch; line-height: 1.6; }
.draft-tag { display: inline-block; font-size: 11px; letter-spacing: 1.1px; color: var(--muted); margin-top: 16px; }
.hero-art { margin: 0; min-width: 0; border: 1px solid #5aafb166; border-radius: 10px; overflow: hidden; background: #0b2c50; box-shadow: 0 12px 42px #020e2533; }
.hero-art img { display: block; width: 100%; height: auto; aspect-ratio: 1672 / 941; }
.workspace-grid { display: grid; grid-template-columns: minmax(320px, .93fr) minmax(360px, 1.2fr); gap: 24px; align-items: start; }
.input-panel, .result-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0; box-shadow: 0 12px 40px #020b1b26; }
.panel-heading { display: flex; align-items: center; gap: 10px; padding: 18px 23px; border-bottom: 1px solid var(--line); background: #102d4c; }
.section-number { font-size: 12px; color: var(--accent); border: 1px solid #487599; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; flex-shrink: 0; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.4; }
.panel-heading h2 { font-size: 16px; }
.result-type { margin-left: auto; font-size: 12px; color: var(--muted); }
#review-form { padding: 22px 23px 18px; }
.mode-control { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: #071b31; margin: 0 0 11px; gap: 4px; min-width: 0; }
.mode-control label { flex: 1; position: relative; cursor: pointer; text-align: center; font-size: 14px; }
.mode-control input { position: absolute; opacity: 0; width: 100%; height: 100%; left: 0; top: 0; margin: 0; cursor: pointer; }
.mode-control span { display: flex; align-items: center; justify-content: center; height: 100%; padding: 8px 12px; border-radius: 4px; border: 1px solid transparent; }
.mode-control input:checked + span { background: #1d5264; color: #effffb; border-color: #63b4a8; font-weight: 600; }
.mode-control input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.mode-help { font-size: 14px; color: var(--muted); line-height: 1.55; margin-bottom: 16px; }
.field-heading { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 11px; flex-wrap: wrap; }
.field-heading label { font-size: 14px; font-weight: 600; }
.text-button { border: 0; background: none; padding: 7px 0; font-size: 12px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; min-height: 36px; }
.text-button:hover { color: #d5edff; }
textarea { display: block; resize: vertical; width: 100%; height: 184px; min-height: 170px; max-height: 520px; border: 1px solid #537291; border-radius: 6px; background: #071b31; color: var(--ink); padding: 15px; font-size: 16px; line-height: 1.6; }
textarea::placeholder { color: #9bb4cd; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #91ceff24; }
textarea[aria-invalid=true] { border-color: var(--error); }
.field-meta { display: flex; justify-content: space-between; gap: 15px; margin: 8px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.field-meta > span:first-child { max-width: 260px; }
#char-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.confirmation { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.55; margin-bottom: 21px; cursor: pointer; }
.confirmation input { accent-color: var(--accent); margin: 3px 0 0; width: 18px; height: 18px; flex-shrink: 0; }
.submit-button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; background: #a8eadf; color: #062d38; padding: 13px 17px; border: 1px solid #d0fff5; border-radius: 6px; min-height: 49px; font-size: 15px; font-weight: 650; transition: background .15s; }
.submit-button:hover { background: #c7f6eb; }
.submit-button:disabled:hover { background: #a8eadf; }
#submit-icon { font-size: 21px; line-height: 1; }
.submit-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }
.privacy-note { background: #0a2039; border-top: 1px solid var(--line); padding: 18px 23px; display: flex; gap: 10px; align-items: flex-start; }
.privacy-note svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); margin-top: 3px; }
.privacy-note p { font-size: 12px; color: var(--muted); line-height: 1.65; }
.privacy-note strong { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.privacy-note a { color: var(--accent); text-underline-offset: 3px; }
.policy-shell { max-width: 840px; margin: 0 auto; padding: 48px 28px 70px; }
.policy-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 42px; }
.policy-back { color: var(--accent); font-size: 14px; text-underline-offset: 3px; }
.policy-lead { color: var(--muted); font-size: 17px; line-height: 1.7; margin: 17px 0 30px; }
.policy-summary, .policy-section { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px 28px; }
.policy-summary { border-left: 4px solid var(--accent); }
.policy-summary p, .policy-section p, .policy-section li { line-height: 1.75; }
.policy-section { margin-top: 16px; }
.policy-section h2 { font-size: 19px; margin-bottom: 12px; }
.policy-section p + p, .policy-section p + ul, .policy-section ul + p { margin-top: 12px; }
.policy-section ul { padding-left: 23px; }
.policy-section li + li { margin-top: 7px; }
.policy-section a, .policy-summary a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
.policy-updated { color: var(--muted); font-size: 12px; margin-top: 22px; }
.result-panel { min-height: 625px; }
.empty-state { text-align: center; padding: 92px 22px 35px; }
.empty-symbol { width: 79px; height: 79px; border: 1px solid #498d94; background: linear-gradient(145deg, #23576b, #102c4b); border-radius: 16px; display: grid; place-items: center; margin: auto auto 25px; box-shadow: 0 0 35px #66dccc18; }
.empty-symbol svg { width: 36px; height: 41px; color: #b7dfff; }
.empty-state h3 { font-size: 26px; line-height: 1.4; font-weight: 500; letter-spacing: -.5px; }
.empty-state > p { font-size: 14px; color: var(--muted); line-height: 1.8; margin: 12px auto 25px; }
.output-preview { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.output-preview span { font-size: 12px; border: 1px solid var(--line); border-radius: 30px; padding: 5px 10px; color: var(--muted); }
.empty-state p.empty-footnote { font-size: 12px; color: var(--muted); margin-top: 56px; }
.error-box { background: #391f2c; color: var(--error); border: 1px solid #aa6470; border-radius: 5px; padding: 11px 13px; margin: 0 0 16px; font-size: 14px; }
.loading-state { text-align: center; padding: 140px 25px; color: var(--muted); }
.loading-state h3 { font-size: 18px; font-weight: 500; margin: 19px 0 8px; color: var(--ink); }
.loading-state p { font-size: 14px; }
.spinner { display: inline-block; width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-content { padding: 23px; font-size: 16px; overflow-wrap: anywhere; }
.result-notice { font-size: 13px; color: #d4eaff; background: #153a5b; border-left: 3px solid var(--accent); padding: 10px 12px; margin-bottom: 20px; }
.result-summary { font-size: 16px; line-height: 1.7; margin-bottom: 24px; }
.result-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.result-section h3 { font-size: 13px; letter-spacing: .5px; font-weight: 650; margin-bottom: 15px; color: #c3e3ff; }
.observation { margin-bottom: 20px; padding-left: 14px; border-left: 2px solid #66bfaf; }
.observation h4 { font-size: 16px; margin: 0 0 6px; font-weight: 600; }
.observation p { font-size: 16px; line-height: 1.7; color: var(--muted); }
.citation { display: inline-block; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; color: var(--accent); margin: 8px 8px 0 0; padding-bottom: 2px; }
.citation:hover { color: #d5edff; }
.citation-meta { font-size: .875rem; color: var(--muted); margin: .3rem 0; }
.citation-evidence { margin: .4rem 0 1rem; font-size: .875rem; }
.citation-evidence summary { cursor: pointer; text-decoration: underline; text-underline-offset: .2em; color: var(--accent); min-height: 36px; padding: 6px 0; }
.citation-evidence blockquote { margin: .6rem 0 0; padding: .7rem 1rem; border-left: 2px solid var(--accent); line-height: 1.7; overflow-wrap: anywhere; background: #081c33; color: var(--ink); }
.result-section ul, .result-section ol { padding-left: 21px; margin: 0; }
.result-section li { font-size: 16px; color: var(--muted); line-height: 1.7; padding-left: 3px; margin-bottom: 9px; }
.result-limitations { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #0a2039; }
.result-limitations p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.result-limitations p + p { margin-top: 10px; }
.human-check { margin-top: 18px; font-size: 13px; color: var(--muted); }
.sources-section { margin-top: 38px; }
.sources-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.source-dates { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.sources-heading .eyebrow { font-size: 12px; margin-bottom: 6px; }
.source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.source-card { display: flex; flex-direction: column; align-items: stretch; padding: 21px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; min-width: 0; transition: border-color .15s, background .15s; }
.source-card:hover { border-color: var(--accent); background: #123252; }
.source-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--accent); letter-spacing: 1px; margin-bottom: 13px; gap: 5px; }
.source-meta > span { font-size: 18px; }
.source-card h3 { font-size: 16px; margin-bottom: 7px; font-weight: 600; }
.source-card p { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 18px; }
.source-publisher { font-size: 12px; color: var(--accent); margin-top: auto; }
.source-scope { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.7; }
.source-date { color: var(--muted); font-size: 12px; max-width: 34ch; text-align: right; }
.field-heading #char-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 9px 0 19px; }
.sensitive-input-notice { background: #2b2130; border-left: 3px solid var(--error); padding: 11px 13px; margin: 0 0 4px; border-radius: 0 5px 5px 0; }
.sensitive-input-notice strong { display: block; color: #ffe0dc; font-size: 13px; line-height: 1.5; margin-bottom: 3px; }
.sensitive-input-notice p { color: #f3d3d6; font-size: 12px; line-height: 1.6; }
.sensitive-input-notice a { color: #fff1e9; text-underline-offset: 3px; }
.clear-input { display: block; margin: 0 0 12px; }
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.timeline > div { min-width: 0; border-top: 2px solid #62bbae; background: #0d2541; border-radius: 0 0 6px 6px; padding: 11px 14px 13px; }
.timeline strong { display: block; color: var(--accent); font-size: 14px; letter-spacing: .5px; margin-bottom: 2px; }
.timeline span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.result-kicker { display: inline-block; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .9px; margin-bottom: 6px; }
.observation .citation-list { display: flex; gap: 7px 14px; flex-wrap: wrap; margin-top: 7px; }
.observation .citation-list a { color: var(--accent); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
dialog { width: min(600px, calc(100vw - 32px)); padding: 27px; border: 1px solid #477296; border-radius: 10px; background: var(--surface); color: var(--ink); max-height: 85vh; box-shadow: 0 22px 100px #02081799; }
dialog::backdrop { background: #020b1db3; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 21px; }
.dialog-heading h2 { font-size: 27px; font-weight: 500; }
.dialog-heading button { border: 1px solid var(--line); background: #071b31; border-radius: 5px; width: 44px; height: 44px; font-size: 25px; line-height: 1; color: var(--ink); flex-shrink: 0; }
dialog p { font-size: 16px; line-height: 1.7; margin-bottom: 16px; }
dialog h3 { font-size: 16px; margin: 23px 0 12px; }
dialog a { font-size: 14px; color: var(--accent); }
dialog .dialog-footnote { font-size: 12px; color: var(--muted); padding-top: 20px; border-top: 1px solid var(--line); margin-top: 23px; margin-bottom: 0; }

@media (max-width: 1200px) {
  .sidebar { width: 196px; padding-left: 16px; padding-right: 16px; }
  .app-shell { margin-left: 196px; }
  main { padding: 26px 26px 32px; }
  .page-heading { grid-template-columns: minmax(240px, 1fr) minmax(0, 1.15fr); gap: 22px; }
  h1 { font-size: 31px; }
  .intro { font-size: 15px; }
  .workspace-grid { gap: 18px; grid-template-columns: minmax(300px, 1fr) minmax(300px, 1.1fr); }
  .panel-heading { padding: 17px; }
  #review-form { padding: 20px 17px 17px; }
  .result-content { padding: 20px 17px; }
  .privacy-note { padding: 17px; }
  .result-type { font-size: 11px; }
  .empty-state { padding: 96px 14px 25px; }
}
@media (max-width: 1000px) {
  .sidebar { position: static; width: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand img { width: 37px; height: 37px; }
  .nav-label, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; gap: 5px; }
  .nav-item { width: auto; margin: 0; min-height: 44px; font-size: 13px; padding: 8px 10px; }
  .nav-item svg { width: 17px; height: 17px; }
  .app-shell { margin-left: 0; }
  .page-heading { gap: 20px; }
  .workspace-grid { grid-template-columns: minmax(300px, 1fr) minmax(300px, 1.05fr); }
}
@media (max-width: 720px) {
  .policy-shell { padding: 26px 18px 45px; }
  .policy-header { margin-bottom: 28px; }
  .policy-summary, .policy-section { padding: 19px 20px; }
  .sidebar { padding: 14px 18px; gap: 12px; }
  .sidebar .nav-item { font-size: 0; padding: 10px; }
  .sidebar .nav-item svg { width: 20px; height: 20px; }
  .sidebar .nav-item.active { display: none; }
  main { padding: 25px 18px 28px; }
  .page-heading { grid-template-columns: 1fr; gap: 20px; margin-bottom: 24px; }
  h1 { font-size: 32px; max-width: 15ch; }
  .intro { font-size: 16px; }
  .draft-tag { margin-top: 12px; }
  .hero-art { border-radius: 7px; }
  .workspace-grid { grid-template-columns: 1fr; gap: 22px; }
  .panel-heading { padding: 18px 20px; flex-wrap: wrap; }
  #review-form { padding: 21px 20px 19px; }
  .field-heading { gap: 4px 10px; }
  .field-meta { flex-wrap: wrap; gap: 4px; }
  .field-meta > span:first-child { max-width: none; flex: 1; min-width: 180px; }
  textarea { height: 205px; }
  .result-panel { min-height: 440px; }
  .empty-state { padding: 50px 17px 25px; }
  .empty-state h3 { font-size: 25px; }
  .empty-state p.empty-footnote { margin-top: 35px; }
  .result-content { padding: 20px; }
  .result-type { font-size: 11px; }
  .source-grid { grid-template-columns: 1fr; gap: 12px; }
  .sources-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .source-date { text-align: left; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-card { padding: 18px 20px; }
  .sources-section { margin-top: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .spinner { border-top-width: 5px; }
}
@media print {
  :root { color-scheme: light; --ink: #17212b; --muted: #384757; --surface: #fff; --paper: #fff; --line: #b8c0c8; --accent: #164b75; }
  .sidebar, .input-panel, .sources-section, .draft-tag, .hero-art { display: none; }
  body { background: #fff; color: var(--ink); }
  body::before { display: none; }
  .app-shell { margin: 0; }
  main { padding: 0; }
  .page-heading, .workspace-grid { display: block; }
  .result-panel { border: 0; box-shadow: none; background: #fff; }
  .result-content { padding: 0; }
  .panel-heading, .result-notice, .result-limitations, .citation-evidence blockquote { background: #fff; color: var(--ink); }
  .result-section h3 { color: var(--ink); }
}

.privacy-tools { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.bot-check { margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.bot-check h3 { font-size: 15px; line-height: 1.5; }
.bot-check p { margin: 8px 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
#bot-check-widget { width: 100%; min-height: 65px; }
#bot-check-retry { margin-top: 10px; min-height: 44px; text-align: left; white-space: normal; }
.privacy-tools p { font-size: 14px; line-height: 1.6; color: var(--muted); }
.privacy-tools h3, #privacy-review h3 { font-size: 15px; line-height: 1.5; margin-bottom: 10px; }
.privacy-checklist { padding-left: 20px; margin: 10px 0; font-size: 14px; line-height: 1.6; }
.privacy-checklist li + li { margin-top: 6px; }
.privacy-review-note { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 12px 0; }
#privacy-status:not(:empty) { color: var(--ink); margin-top: 12px; }
@media (max-width: 420px) {
  .mode-control span { padding: 8px 4px; font-size: 13px; white-space: nowrap; }
}
