/* The console and the API reference share this stylesheet; the landing has its own (landing.css).
   Paper-and-ink variables, old faces, and a strict grid: every margin and padding is a
   multiple of 8 px, rules are 1 px hairlines, controls are 40 px tall with a 4 px radius,
   and the accent is kept for links, the primary button, the citation seal and claim status. */
:root {
  /* The landing's system (landing.css): white, Inter, near-black ink, gray secondary text,
     hairline borders, black pill buttons. Light only, like the landing. */
  --paper: #ffffff;
  --paper-2: #f6f7f8;
  --ink: #0a0a0a;
  --ink-2: #5b6168;
  --ink-3: #8a9097;
  --rule: rgba(0, 0, 0, .08);
  --accent: #0a0a0a;
  --accent-ink: #ffffff;
  --ok: #16a34a;
  --warn: #b45309;
  --code-bg: #f6f7f8;
  --display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --arabic: "Amiri", "Scheherazade New", serif;
  --radius: 12px;
  --control: 40px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 18px/1.55 var(--body); font-feature-settings: "liga", "onum", "kern";
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0; letter-spacing: 0; }
p { margin: 0 0 16px; }
code, pre { font-family: var(--mono); font-size: 14px; }
.ar { font-family: var(--arabic); direction: rtl; unicode-bidi: isolate; }
mark { background: color-mix(in srgb, var(--accent) 16%, transparent); color: inherit; padding: 0; }

/* One measure: 1080 px of content, 24 px gutters (16 px on a phone). */
.wrap { box-sizing: content-box; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* Controls: one height, one radius, one focus ring. */
.btn { display: inline-flex; align-items: center; justify-content: center; height: var(--control); padding: 0 16px; border: 1px solid var(--ink); border-radius: var(--radius); color: var(--ink); background: transparent; text-decoration: none; font: 500 17px/1 var(--body); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--paper-2); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.solid:hover { filter: brightness(1.08); }
input, textarea, select { font: 400 17px/1.4 var(--body); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 8px; min-width: 0; }
input, select { height: var(--control); }
input { flex: 1 1 220px; }
textarea { width: 100%; min-height: 160px; padding: 8px; font-family: var(--body); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.top { border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.mark { font: 400 28px/1 var(--display); color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 24px; align-items: center; font-variant: small-caps; letter-spacing: .04em; font-size: 18px; }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav .btn { font-variant: normal; letter-spacing: 0; }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } }

/* Hero */
.hero { padding-top: 96px; padding-bottom: 96px; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.hero h1 { font-size: clamp(40px, 5.5vw, 64px); line-height: 1.08; }
.hero h1 em { font-style: italic; }
.lede { font-size: 20px; color: var(--ink-2); margin: 24px 0 32px; max-width: 32em; }
.cta { display: flex; gap: 16px; flex-wrap: wrap; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding-top: 64px; padding-bottom: 64px; gap: 48px; } }

/* The specimens: three answers in one tabbed group. Pure CSS: hidden radios, labels as tabs,
   and the checked radio shows its folio. Arrow keys move between tabs as in any radio group. */
.specimens { margin: 0; position: relative; }
.specimens > input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; }
.tabs label { padding: 0 0 8px; color: var(--ink-2); font-size: 16px; line-height: 24px; cursor: pointer; user-select: none; }
.tabs label:hover { color: var(--ink); }
.folio { display: none; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; }
#spec-clinical:checked ~ #folio-clinical, #spec-legal:checked ~ #folio-legal, #spec-classical:checked ~ #folio-classical { display: block; }
/* The active tab's 1 px line is a shadow drawn over the group's rule, so no negative margin is needed. */
#spec-clinical:checked ~ .tabs label[for="spec-clinical"], #spec-legal:checked ~ .tabs label[for="spec-legal"], #spec-classical:checked ~ .tabs label[for="spec-classical"] { color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
#spec-clinical:focus-visible ~ .tabs label[for="spec-clinical"], #spec-legal:focus-visible ~ .tabs label[for="spec-legal"], #spec-classical:focus-visible ~ .tabs label[for="spec-classical"] { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.folio .q { font-style: italic; color: var(--ink-2); padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--rule); }
.folio .a { font-size: 18px; }
.folio blockquote { margin: 16px 0; padding: 0 0 0 16px; border-left: 1px solid var(--ink); }
.folio blockquote.ar { padding: 0 16px 0 0; border-left: 0; border-right: 1px solid var(--ink); font-size: 22px; line-height: 1.8; text-align: right; }
.folio sup { color: var(--ink-3); font-size: .7em; line-height: 0; }
.folio .src { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 16px; color: var(--ink-2); display: grid; gap: 8px; }
.folio .excerpt { margin: 0; }
.folio .excerpt.ar { font-size: 20px; line-height: 1.8; }
.src-row { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.cite { font-family: var(--mono); font-size: 14px; color: var(--ink-3); }
.seal { display: inline-flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 14px; line-height: 24px; color: var(--accent); border: 1px solid currentColor; padding: 0 8px; border-radius: var(--radius); white-space: nowrap; }
.claims { font-family: var(--mono); font-size: 14px; color: var(--accent); }

/* Sections */
section { padding: 96px 0; border-top: 1px solid var(--rule); }
section > .wrap > h2 { font-size: clamp(32px, 4vw, 40px); max-width: 20em; }
section > .wrap > h2 + p { font-size: 20px; color: var(--ink-2); max-width: 36em; margin: 16px 0 0; }
@media (max-width: 640px) { section { padding: 64px 0; } }

.stages { display: grid; grid-template-columns: 1fr 1fr; margin-top: 48px; border-top: 1px solid var(--rule); }
.stage { padding: 32px 32px 32px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; align-content: start; }
.stage:nth-child(odd) { border-right: 1px solid var(--rule); }
.stage:nth-child(even) { padding-left: 32px; }
.stage .num { font: 400 32px/1.15 var(--display); color: var(--ink-3); grid-row: 1 / span 3; }
.stage > :not(.num) { grid-column: 2; }
.stage h3 { font-size: 24px; }
.stage p { color: var(--ink-2); margin: 8px 0 0; }
.stage ul { margin: 8px 0 0; padding-left: 24px; color: var(--ink-2); font-size: 17px; }
.stage li { margin: 0; }
@media (max-width: 820px) { .stages { grid-template-columns: 1fr; } .stage, .stage:nth-child(even) { padding: 24px 0; border-right: 0; } }

.figures { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 48px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.figures + .figures { margin-top: 0; border-top: 0; }
.figure { padding: 24px 24px 24px 0; }
.figure + .figure { padding-left: 24px; border-left: 1px solid var(--rule); }
.figure b { display: block; font: 400 40px/1.15 var(--display); color: var(--ink); }
.figure span { display: block; margin-top: 8px; font-size: 16px; color: var(--ink-2); line-height: 1.45; }
.figure sup a { text-decoration: none; }
@media (max-width: 900px) { .figures { grid-template-columns: 1fr 1fr; } .figure:nth-child(odd) { padding-left: 0; border-left: 0; } .figure:nth-child(n + 3) { border-top: 1px solid var(--rule); } }
@media (max-width: 520px) { .figures { grid-template-columns: 1fr; } .figure + .figure { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); } }
.notes { margin: 16px 0 0; font-size: 15px; color: var(--ink-3); max-width: 60em; padding-left: 24px; }
.notes li { margin: 0; }
.evaluate { margin: 24px 0 0; max-width: 40em; color: var(--ink-2); }

.api { display: grid; grid-template-columns: 2fr 3fr; gap: 48px; margin-top: 48px; align-items: start; }
.api dl { margin: 0; }
.api dt { font-family: var(--mono); font-size: 14px; color: var(--ink); margin-top: 16px; }
.api dt:first-child { margin-top: 0; }
.api dd { margin: 0; color: var(--ink-2); font-size: 17px; }
pre.code { background: var(--code-bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; overflow-x: auto; line-height: 1.6; margin: 0; color: var(--ink); max-width: 100%; }
pre.code .c { color: var(--ink-3); }
pre.code .s { color: var(--ink-2); }
@media (max-width: 900px) { .api { grid-template-columns: 1fr; } }

.uses { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 48px; }
.uses h3 { font-size: 24px; margin-bottom: 8px; }
.uses p { color: var(--ink-2); margin: 0; }
@media (max-width: 820px) { .uses { grid-template-columns: 1fr; gap: 32px; } }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 48px; border: 1px solid var(--rule); border-radius: var(--radius); }
.plan { padding: 32px 24px; display: flex; flex-direction: column; }
.plan + .plan { border-left: 1px solid var(--rule); }
.plan.featured { background: var(--paper-2); }
.plan h3 { font-size: 24px; }
.plan .price { font: 400 40px/1.15 var(--display); margin: 16px 0 0; }
.plan .price small { font: 400 16px var(--body); color: var(--ink-3); }
.plan .plan-note { color: var(--ink-2); font-size: 16px; margin: 8px 0 0; }
.plan ul { list-style: none; padding: 0; margin: 16px 0 24px; color: var(--ink-2); font-size: 17px; flex: 1; }
.plan li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 820px) { .plans { grid-template-columns: 1fr; } .plan + .plan { border-left: 0; border-top: 1px solid var(--rule); } }
.data { margin-top: 48px; max-width: 40em; }
.data h3 { font-size: 24px; margin-bottom: 8px; }
.data p { color: var(--ink-2); margin: 0; }

.colophon { padding: 96px 0; text-align: center; border-top: 1px solid var(--rule); }
.colophon h2 { font-size: clamp(32px, 4vw, 40px); max-width: 16em; margin: 0 auto; }
.colophon p { color: var(--ink-2); max-width: 34em; margin: 16px auto 32px; font-size: 20px; }
@media (max-width: 640px) { .colophon { padding: 64px 0; } }

footer { border-top: 1px solid var(--rule); padding: 32px 0 48px; color: var(--ink-3); font-size: 16px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--ink-2); }

/* Console */
.console { padding: 48px 0 80px; display: grid; gap: 24px; }
.panel { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2); padding: 24px; }
.panel h2 { font-size: 24px; margin-bottom: 8px; }
.panel p.hint { color: var(--ink-3); font-size: 16px; margin: 0 0 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.out { margin-top: 16px; display: grid; gap: 16px; }
.result { border-left: 1px solid var(--ink); padding: 0 0 0 16px; }
.result .meta { font-size: 15px; color: var(--ink-3); }
.result .txt { white-space: pre-wrap; font-size: 17px; }
.answer { white-space: pre-wrap; }
.status { font-family: var(--mono); font-size: 14px; color: var(--ink-3); }
.err { color: var(--warn); }
.key { font-family: var(--mono); font-size: 14px; word-break: break-all; background: var(--code-bg); padding: 8px; border: 1px solid var(--rule); border-radius: var(--radius); }

/* Console, second edition: the account strip, labeled fields, chips for kinds and claim status,
   lists with hairline rows, the opened page with its passage marked, and the evaluation tables.
   Nothing above changes; the same scale, radius, control height and accent carry through. */
.strip { display: flex; flex-wrap: wrap; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2); }
.strip > div { flex: 1 1 160px; min-width: 0; padding: 16px 24px; border-left: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 0 0 -1px -1px; }
.strip b { display: block; font: 400 24px/1.15 var(--display); overflow-wrap: anywhere; }
.strip span { display: block; font-size: 15px; line-height: 24px; color: var(--ink-3); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 8px; margin: 0 0 16px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field > span { font-size: 15px; line-height: 24px; color: var(--ink-3); }
.field > input, .field > select, .field > textarea { width: 100%; flex: none; }
.field.span2 { grid-column: 1 / -1; }
.field > textarea { min-height: 96px; }
.check { display: flex; align-items: center; gap: 8px; min-height: var(--control); font-size: 17px; color: var(--ink-2); }
.check > input { width: 16px; height: 16px; flex: none; margin: 0; accent-color: var(--accent); }
.warn { color: var(--warn); font-size: 15px; margin: 0 0 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.panel form + form, .panel .row + .row { margin-top: 8px; }
.sub { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rule); }
.sub h3 { font-size: 20px; margin-bottom: 8px; }
.btn.quiet { border-color: var(--rule); color: var(--ink-2); }
.btn:disabled { opacity: .5; cursor: default; }
button.linkish { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 8px; vertical-align: middle; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border: 1px solid var(--rule); border-radius: var(--radius); font-family: var(--mono); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.chip.ok { color: var(--ok); border-color: currentColor; }
.chip.warn { color: var(--warn); border-color: currentColor; }
.chip.bad { color: var(--accent); border-color: currentColor; }
.chip.dim { color: var(--ink-3); }
.chip.mute { color: var(--ink-3); border-style: dashed; }
.list { display: grid; }
.list > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 16px; }
.grow { flex: 1 1 240px; min-width: 0; }
.list code { font-size: 14px; }
details.fold { margin-top: 16px; }
details.fold > summary { cursor: pointer; font-size: 17px; color: var(--ink-2); padding: 8px 0; }
details.fold > form, details.fold > .list { margin-top: 8px; }
select[multiple] { height: auto; min-height: 112px; padding: 8px; }
textarea.mono { font-family: var(--mono); font-size: 14px; }
.page-head { font-size: 15px; color: var(--ink-3); padding-top: 8px; border-top: 1px solid var(--rule); }
.passage + .passage { margin-top: 8px; }
.page-view { margin-top: 16px; padding: 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); max-height: 480px; overflow: auto; white-space: pre-wrap; font-size: 17px; }
.page-view.ar { font-family: var(--arabic); font-size: 20px; line-height: 1.8; }
.page-view .meta { white-space: normal; font-size: 15px; color: var(--ink-3); padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
mark.span { background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: inset 0 -1px 0 var(--accent); }
.answer.ar { font-family: var(--arabic); font-size: 22px; line-height: 1.8; }
.answer a { text-decoration: none; font-family: var(--mono); font-size: 14px; }
.claim { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 16px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 17px; }
.claim .ar { font-family: var(--arabic); font-size: 20px; }
.claim .ev { display: block; font-size: 15px; color: var(--ink-3); }
.tbl { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 16px; }
table.grid th, table.grid td { text-align: left; padding: 8px 16px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.grid th { font-weight: 500; color: var(--ink-3); font-size: 15px; }
table.grid td.n, table.grid th.n { text-align: right; font-family: var(--mono); font-size: 14px; white-space: nowrap; }
table.grid .err { display: block; font-size: 15px; }
@media (max-width: 640px) { .panel { padding: 16px; } .strip > div { padding: 16px; } }
/* The console toggles blocks with the hidden attribute; a display rule above must not undo it. */
.console [hidden] { display: none !important; }


/* Second edition: the console and docs in the landing's look (agentset-style), by override so the
   markup and scripts above stay untouched. */
body { font-size: 16px; font-feature-settings: normal; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
a { color: var(--ink); }
a:hover { text-decoration: underline; }
.btn { border-radius: 999px; font: 500 14px/1 var(--body); padding: 0 18px; border-color: var(--rule); background: #fff; }
.btn:hover { background: var(--paper-2); }
.btn.solid { background: #0a0a0a; border-color: #0a0a0a; color: #fff; }
.btn.solid:hover { background: #262626; filter: none; }
input, textarea, select { font: 400 15px/1.4 var(--body); padding: 0 12px; border-radius: 12px; background: #fff; }
textarea { padding: 10px 12px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #0a0a0a; }
mark { background: #fef3c7; }
code, pre { font-size: 13px; }
