:root {
  color-scheme: light;
  --paper: #f6f5ef;
  --surface: #fdfcf8;
  --ink: #1e2e27;
  --muted: #526158;
  --line: #d9ded3;
  --green: #245640;
  --pale: #e7efe3;
  --danger: #842f25;
  --danger-bg: #f9e9e2;
  font: 16px/1.55 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--green); text-underline-offset: .2em; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #3b7658; outline-offset: 3px; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner, .panel-heading, .footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.masthead-inner { min-height: 68px; }
.brand { color: var(--ink); font-weight: 750; text-decoration: none; }
.brand span { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 5px; border-radius: 7px; background: var(--green); color: white; }
.nav-link { font-size: .9rem; }
.hero { padding: clamp(36px, 6vw, 83px) 0 38px; display: flex; align-items: end; gap: 24px 64px; flex-wrap: wrap; }
.hero h1 { margin: 0; font: 400 clamp(3.25rem, 8vw, 7.5rem)/.86 Georgia, serif; letter-spacing: -.065em; }
.hero em { color: var(--green); }
.hero p { max-width: 34ch; margin: 0 0 4px; color: var(--muted); font-size: 1.08rem; }
.eyebrow { color: var(--muted); font: 700 .74rem/1.2 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .12em; }
.workflow { padding: 0; margin: 12px 0 24px; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.workflow li { padding: 13px 16px; display: grid; gap: 2px; background: var(--pale); }
.workflow li + li { border-inline-start: 1px solid var(--line); }
.workflow span, .muted { color: var(--muted); font-size: .87rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: clamp(17px, 3vw, 28px); min-width: 0; }
.panel-heading { margin-bottom: 16px; flex-wrap: wrap; }
.panel-heading h2, .panel-heading h3 { margin: 0; }
.panel h2 { font: 400 1.8rem/1.15 Georgia, serif; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 6px; background: var(--pale); color: var(--green); font: 700 .75rem/1.45 ui-monospace, monospace; }
label { display: block; margin: 12px 0 5px; font-size: .87rem; font-weight: 700; }
textarea, input, select { width: 100%; border: 1px solid #aebcaf; border-radius: 7px; background: #fff; color: var(--ink); padding: 8px 10px; }
textarea { resize: vertical; display: block; }
details { margin: 14px 0; font-size: .87rem; }
summary { color: var(--green); }
.actions { display: flex; flex-wrap: wrap; gap: 9px; }
button { border: 1px solid var(--green); border-radius: 8px; background: var(--green); color: white; padding: 8px 12px; font-weight: 650; font-size: .87rem; }
button:hover:not(:disabled) { filter: brightness(.88); }
button:disabled { cursor: default; opacity: .55; }
.secondary { background: var(--surface); color: var(--green); }
.text-button { background: transparent; border: 0; color: var(--green); padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.error, .flagged { color: var(--danger); }
.error { font-size: .87rem; }
progress { display: block; width: 100%; height: 8px; accent-color: var(--green); }
.stages, .run-log { list-style: none; padding: 0; }
.stages li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: .89rem; }
.stages li[data-state="Running"] { color: var(--green); font-weight: 750; }
.stages li[data-state="Failed"] { color: var(--danger); }
.stages span { text-align: right; color: var(--muted); font-size: .8rem; }
.run-log { max-height: 220px; overflow: auto; font: .77rem/1.55 ui-monospace, monospace; overflow-wrap: anywhere; }
.run-log li { margin-bottom: 4px; }
.run-log time { color: var(--muted); }
.result { margin-top: 18px; overflow-wrap: anywhere; }
.result-heading h2 { margin-top: 10px; font-size: clamp(2rem, 5vw, 3.4rem); }
.document { max-width: 75ch; }
.document h3 { font: 400 1.55rem Georgia, serif; margin-bottom: .3em; }
.document p { margin: .5em 0 1em; }
.citation { display: inline-block; font-weight: 700; padding-inline: 2px; }
.flagged { background: var(--danger-bg); }
.evidence { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.evidence h3 { margin-top: 0; }
.sources { padding-left: 25px; }
.sources li { padding-left: 4px; margin-bottom: 12px; }
.sources blockquote { margin: 3px 0 0; color: var(--muted); }
.source-url { display: block; font-size: .8rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 9px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--pale); }
td small { display: block; margin-top: 5px; color: var(--muted); }
.footer { flex-wrap: wrap; margin-top: 26px; padding-block: 18px 30px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); }
  .workspace { grid-template-columns: 1fr; }
  .workflow { grid-template-columns: repeat(2, 1fr); }
  .workflow li:nth-child(3) { border-inline-start: 0; }
  .workflow li:nth-child(n+3) { border-top: 1px solid var(--line); }
}
