:root {
  --paper: #faf9f6;
  --white: #fffefa;
  --ink: #292b2c;
  --muted: #666762;
  --accent: #843d35;
  --line: #dedcd5;
  --serif: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
header, main { max-width: 1192px; margin: auto; padding-inline: 40px; }
header { display: flex; align-items: center; justify-content: space-between; min-height: 95px; border-bottom: 1px solid var(--line); }
a { color: var(--accent); }
button, input, textarea { font: inherit; }
button { cursor: pointer; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 3px; padding: 9px 15px; }
button:hover { border-color: var(--ink); background: #f0eee8; }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, summary:focus-visible, textarea:focus, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.brand { display: flex; gap: 13px; align-items: center; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 600; letter-spacing: -.5px; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.brand-mark { width: 43px; height: 43px; flex: 0 0 43px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ink); font: 19px/1 var(--serif); letter-spacing: -1px; white-space: nowrap; }
.local-tag { font-size: 12px; color: var(--muted); }
.eyebrow, .card .tag { color: var(--accent); font: 11px/1.5 ui-monospace, SFMono-Regular, monospace; letter-spacing: .2px; }
.intro { padding: 42px 0 36px; max-width: 780px; }
.intro h1 { font: normal 38px/1.2 var(--serif); letter-spacing: -.9px; margin: 12px 0 13px; }
.intro p { color: var(--muted); max-width: 630px; margin: 0; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 64px; align-items: start; }
.panel { padding: 0; }
.composer { padding-top: 23px; border-top: 2px solid var(--ink); }
.section-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
h2 { font-size: 19px; font-weight: 550; line-height: 1.35; margin: 0 0 22px; letter-spacing: -.25px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 18px; }
.text-button { color: var(--accent); border: 0; padding: 0; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { background: transparent; color: var(--ink); }
textarea, .search-query { display: block; width: 100%; padding: 13px 15px; border: 1px solid #babbb4; border-radius: 3px; background: var(--white); color: var(--ink); line-height: 1.6; }
textarea { resize: vertical; }
textarea::placeholder, .search-query::placeholder { color: #70736e; }
#question { font-size: 17px; min-height: 146px; }
.evidence-input { margin: 21px 0 25px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.evidence-input summary { cursor: pointer; font-size: 13px; }
.evidence-input summary span, .search-label .hint { margin-left: 7px; color: var(--muted); font-size: 12px; }
.evidence-input label { display: block; margin-top: 18px; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.55; }
fieldset { border: 0; padding: 0; margin: 0 0 23px; }
legend { font-size: 13px; font-weight: 550; margin-bottom: 12px; }
.modes { display: flex; gap: 32px; }
.modes label { display: flex; align-items: baseline; gap: 7px; font-size: 13px; }
.modes strong { font-weight: 500; }
.modes small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.unavailable { opacity: .75; }
input { accent-color: var(--accent); }
.retrieve { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.search-label { display: block; margin: 20px 0 8px; font-size: 13px; }
.form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-bottom .hint { margin: 0; max-width: 330px; font-size: 11px; }
.primary { background: var(--ink); color: white; border-color: var(--ink); white-space: nowrap; font-size: 13px; padding: 12px 18px; }
.primary:hover { background: #454747; color: white; }
.team { border-top: 2px solid var(--line); padding-top: 23px; }
.team h2 { font-size: 15px; margin-bottom: 17px; }
.team ol { list-style: none; margin: 0; padding: 0; }
.team li { display: flex; gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.team li > span { padding-top: 2px; color: var(--accent); font: 11px/1.6 ui-monospace, SFMono-Regular, monospace; }
.team li div { font-size: 13px; font-weight: 500; }
.team small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 2px; }
.history { margin-top: 34px; }
.history h3 { font-size: 13px; margin: 0; }
.history-item { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; padding: 14px 0; font-size: 12px; line-height: 1.5; }
.history-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; }
#status { margin-top: 20px; padding: 12px 15px; border-left: 3px solid var(--accent); background: #f0eee8; font-size: 13px; }
#status.error, .run-failure { background: #f8eeeb; color: #733c32; }
#status.pending::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 10px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#results { margin-top: 56px; padding-top: 28px; border-top: 2px solid var(--ink); scroll-margin-top: 24px; }
.results-header { display: flex; justify-content: space-between; align-items: start; gap: 28px; }
.results-header h2 { font: 28px/1.3 var(--serif); margin: 10px 0 22px; max-width: 760px; }
.exports { display: flex; gap: 8px; flex-shrink: 0; }
.exports button { font-size: 12px; }
.notice { border-left: 3px solid var(--line); padding: 10px 16px; font-size: 12px; color: var(--muted); background: #f0eee8; }
.tabs { display: flex; gap: 28px; margin: 26px 0; border-bottom: 1px solid var(--line); }
.tabs button { padding: 9px 0; border: 0; border-radius: 0; color: var(--muted); font-size: 13px; }
.tabs button:hover { background: transparent; color: var(--ink); }
.tabs [aria-current=page] { color: var(--ink); border-bottom: 2px solid var(--ink); }
.findings-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 45px; }
.card { padding: 22px 0; border-top: 1px solid var(--line); margin-bottom: 10px; }
.card h4 { font: 23px/1.3 var(--serif); margin: 9px 0 16px; }
.card p { font-size: 14px; color: #50534f; }
.card dl { font-size: 13px; }
.card dt { font-weight: 550; margin-top: 15px; text-transform: capitalize; }
.card dd { margin: 4px 0; color: #50534f; white-space: pre-wrap; overflow-wrap: anywhere; }
.card details { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 15px; }
.card summary { color: var(--accent); font-size: 13px; cursor: pointer; }
.limits { padding: 24px 0; border-top: 1px solid var(--line); margin-top: 24px; }
.limits p { color: var(--muted); font-size: 12px; margin: 8px 0; }
.source-card .source-link { font-size: 12px; overflow-wrap: anywhere; }
.source-card .meta { color: var(--muted); font-size: 12px; }
.empty { font-size: 13px; color: var(--muted); padding: 22px 0; }
.agent-output { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.7 ui-monospace, SFMono-Regular, monospace; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 10px; top: 10px; background: var(--white); padding: 10px; z-index: 2; }
.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; }
[hidden] { display: none !important; }
footer { display: flex; justify-content: space-between; align-items: center; margin-top: 55px; padding: 22px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
footer > span { font-family: var(--serif); color: var(--ink); }
@media (max-width: 900px) {
  header, main { padding-inline: 25px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
  .history { margin-top: 0; }
  .results-header { display: block; }
  .exports { margin-bottom: 20px; }
}
@media (max-width: 600px) {
  header { min-height: 83px; }
  .local-tag { display: none; }
  .intro { padding-top: 32px; }
  .intro h1 { font-size: 31px; }
  .sidebar, .findings-grid { grid-template-columns: minmax(0, 1fr); }
  .modes { gap: 20px; flex-wrap: wrap; }
  .form-bottom { flex-direction: column; align-items: stretch; gap: 16px; }
  .form-bottom .hint { max-width: none; }
  .section-top { align-items: baseline; }
  .tabs { gap: 21px; }
  .tabs button { font-size: 12px; }
  .results-header h2 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  #status.pending::before { animation: none; }
}
