/* Grey Box site: one stylesheet for every page. Tokens first; dark mode follows the system unless the page sets data-theme. */
:root {
  --bg: #eef0f2; --panel: #f8f9fa; --ink: #182026; --mute: #59646e; --line: #cdd3d9;
  --accent: #2a6fd0; --flag: #b13f2a; --ok: #2f7d57; --warn: #9a6a00;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --maxw: 1120px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #10151a; --panel: #172027; --ink: #e4e8eb; --mute: #94a1ab; --line: #2a353e; --accent: #5b9be8; --flag: #ec7a5f; --ok: #6cc495; --warn: #e2b54f; color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #10151a; --panel: #172027; --ink: #e4e8eb; --mute: #94a1ab; --line: #2a353e; --accent: #5b9be8; --flag: #ec7a5f; --ok: #6cc495; --warn: #e2b54f; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--display); }
a { color: var(--accent); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
header.top { border-bottom: 1px solid var(--line); background: var(--panel); }
header.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 54px; flex-wrap: wrap; }
.brand { font: 760 18px/1 var(--display); font-stretch: 80%; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.brand span { color: var(--mute); font-weight: 500; }
nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
nav a { color: var(--mute); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
main { padding: 28px 0 48px; }
h1 { font: 760 34px/1.12 var(--display); font-stretch: 78%; margin: 0 0 10px; }
h2 { font: 720 22px/1.2 var(--display); font-stretch: 82%; margin: 34px 0 10px; }
h3 { font: 700 16px/1.3 var(--display); margin: 20px 0 6px; }
p { margin: 0 0 12px; max-width: 80ch; }
.lede { font-size: 17px; color: var(--mute); max-width: 76ch; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.card h3 { margin-top: 0; }
.card a.go { display: inline-block; margin-top: 6px; font-weight: 600; text-decoration: none; }
.label { font: 600 11px/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-bottom: 6px; }
.num { font: 700 26px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font: 600 11px/1.6 var(--mono); padding: 0 7px; border-radius: 3px; border: 1px solid var(--line); color: var(--mute); white-space: nowrap; }
.tag.pass { border-color: var(--ok); color: var(--ok); } .tag.fail { border-color: var(--flag); color: var(--flag); }
.tag.mixed, .tag.nt { border-color: var(--warn); color: var(--warn); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--mute); font-weight: 600; letter-spacing: .03em; }
td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
code, pre { font-family: var(--mono); font-size: 13px; }
pre { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; overflow-x: auto; line-height: 1.45; }
:not(pre) > code { background: color-mix(in srgb, var(--line) 45%, transparent); padding: 1px 5px; border-radius: 3px; }
figure { margin: 18px 0; }
figure img { max-width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
figcaption { font-size: 13px; color: var(--mute); margin-top: 6px; max-width: 90ch; }
.note { border-left: 3px solid var(--warn); padding: 8px 12px; background: var(--panel); margin: 14px 0; font-size: 14px; }
.note.limit { border-left-color: var(--flag); }
button, .btn { font: 600 14px var(--display); color: #fff; background: var(--accent); border: 0; border-radius: 5px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea, input[type=text], select { width: 100%; font: 13px/1.4 var(--mono); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 8px; }
footer { border-top: 1px solid var(--line); color: var(--mute); font-size: 13px; padding: 20px 0 40px; }
.muted { color: var(--mute); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
progress { width: 100%; height: 8px; }
@media (max-width: 640px) { h1 { font-size: 28px; } }

[hidden] { display: none !important; }   /* .row and other display rules must not override the hidden attribute */
select { max-width: 100%; }
/* labelling view: the whole conversation before the action */
.transcript { max-height: 380px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--panel); font-size: 13px; white-space: pre-wrap; }
.transcript > div { margin: 6px 0; overflow-wrap: anywhere; }
.transcript pre { white-space: pre-wrap; max-height: 240px; overflow-y: auto; }
.tx-user-later { border-left: 3px solid var(--flag); padding-left: 8px; background: color-mix(in srgb, var(--flag) 8%, transparent); }
.tx-task { border-left: 3px solid var(--ink); padding-left: 8px; }
.tx-call code { overflow-wrap: anywhere; }
/* tables that scroll sideways on a phone show it */
.tablewrap { overflow-x: auto; background: linear-gradient(to right, var(--bg) 30%, transparent), linear-gradient(to left, var(--bg) 30%, transparent) 100% 0,
  radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.18), transparent), radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.18), transparent) 100% 0;
  background-repeat: no-repeat; background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%; background-attachment: local, local, scroll, scroll; }
/* long tool names wrap so that the numbers stay visible on a phone */
#perTool code, .tablewrap td code { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 520px) { #perTool table { font-size: 13px; } #perTool th, #perTool td { padding: 4px 6px; } }
/* a figure that links to its full-size image (phones: tap to zoom) */
figure a.zoom { display: block; cursor: zoom-in; }
.zoomhint { display: none; }
@media (max-width: 640px) { .zoomhint { display: inline; } }

/* animated workflow (index): CSS + SMIL; colours from the tokens; static when the reader prefers reduced motion */
.workflow { margin: 18px 0 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px 4px; }
.workflow svg { width: 100%; height: auto; display: block; font-family: var(--display); }
.wf-h { font-size: 15px; font-weight: 700; fill: var(--ink); }
.wf-t { font-size: 11.5px; fill: var(--ink); }
.wf-mono { font-family: var(--mono); font-size: 10.5px; }
.wf-small { font-size: 10.5px; fill: var(--mute); }
.wf-tw { font-size: 12px; font-weight: 700; fill: #fff; }
.wf-card { fill: var(--bg); stroke: var(--line); }
.wf-ins { fill: color-mix(in srgb, var(--mute) 14%, var(--panel)); }
.wf-task { fill: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.wf-act { fill: color-mix(in srgb, var(--flag) 10%, var(--panel)); stroke: var(--flag); stroke-width: 2; animation: wfPulse 2.4s ease-in-out infinite; }
.wf-acth { font-weight: 700; fill: var(--flag); }
.wf-path { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 4 4; }
.wf-tok { fill: var(--accent); }
.wf-tok2 { fill: var(--mute); }
.wf-agent { fill: #1b2126; }
.wf-reader { fill: var(--accent); }
.wf-lock rect { fill: #fff; } .wf-lock path { stroke: #fff; stroke-width: 2; }
.wf-layers rect { fill: rgba(255,255,255,.28); }
.wf-scan rect { animation: wfScan 2.4s ease-in-out infinite; }
.wf-scan rect:nth-child(2) { animation-delay: .25s; } .wf-scan rect:nth-child(3) { animation-delay: .5s; }
.wf-scan rect:nth-child(4) { animation-delay: .75s; } .wf-scan rect:nth-child(5) { animation-delay: 1s; }
.wf-state rect { fill: var(--flag); fill-opacity: var(--o); stroke: var(--panel); stroke-width: 1.5; }
.wf-gauge rect { animation: wfShuffle 4.8s ease-in-out infinite; }
.wf-replica rect { animation: wfFill 2.4s ease-in-out infinite; }
.wf-link { stroke: var(--flag); stroke-width: 1.5; stroke-dasharray: 3 3; fill: none; }
.wf-linkt { fill: var(--flag); }
.wf-arrowhead { fill: var(--mute); }
.wf-safe { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 2; }
.wf-viol { fill: color-mix(in srgb, var(--flag) 25%, transparent); stroke: var(--flag); stroke-width: 2; }
.wf-axis { stroke: var(--mute); stroke-width: 1.5; }
.wf-cut { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 6 4; }
.wf-cutt { fill: var(--ink); }
.wf-needle { fill: var(--ink); stroke: var(--panel); stroke-width: 2; }
.wf-chip text { font-size: 12px; font-weight: 700; fill: #fff; }
.wf-allow rect { fill: var(--ok); } .wf-block rect { fill: var(--flag); }
.wf-loop { fill: none; stroke: var(--ok); stroke-width: 2; }
.wf-loopt { fill: var(--ok); font-weight: 600; }
@keyframes wfPulse { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: .35; } }
@keyframes wfScan { 0%, 100% { fill: rgba(255,255,255,.25); } 30% { fill: rgba(255,255,255,.85); } }
@keyframes wfFill { 0% { fill-opacity: .05; } 50%, 100% { fill-opacity: var(--o); } }
@keyframes wfShuffle { 0%, 40% { fill-opacity: var(--o); } 50%, 90% { fill-opacity: var(--p); } 100% { fill-opacity: var(--o); } }
@media (prefers-reduced-motion: reduce) {
  .wf-act, .wf-scan rect, .wf-replica rect, .wf-gauge rect { animation: none; }
  .wf-tok { display: none; }
}
@media (max-width: 700px) { .workflow { overflow-x: auto; } .workflow svg { min-width: 760px; } }
