/* Logos, in Bitbison's own design system (the code-frontend repository's
   token sheet): a warm coat for a ground, bone for text, one cool sky for
   an accent, edges rare and firm, 8px corners, few lines. Sentient for a
   page's sentence and the one large figure, Geist for the interface,
   JetBrains Mono for identifiers and commands.

   The states are the prairie's and mean one thing each, here as there:
   sage is benign, tallgrass gold is not benign, badlands clay is malicious.

   The run's page is a console someone leaves open: it takes the whole
   window. Pages that are for reading (a job's transcript, a review, a
   form) keep a reader's measure. */

@font-face { font-family: "Sentient"; font-style: normal; font-weight: 300; font-display: swap; src: url("/static/sentient-300.woff2") format("woff2"); }
@font-face { font-family: "Sentient"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/sentient-400.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/static/geist.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 460; font-display: swap; src: url("/static/jbm-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/jbm-500.woff2") format("woff2"); }

:root {
  --paper: #120F0C;            /* coat: the page */
  --sheet: #1B1713;            /* hide: a panel */
  --raised: #25201B;           /* hump: a pressed control */
  --lift: #2D2721;             /* an input, a toast */
  --inset: #0E0C0A;            /* a code block, sunk into the coat */
  --ink: #EDE6DA;              /* bone */
  --soft: #A89F92;
  --faint: #80776B;
  --rule: rgba(237, 230, 218, 0.08);
  --rule-strong: rgba(237, 230, 218, 0.16);
  --wash: rgba(237, 230, 218, 0.05);
  --act: #8FB0CC;              /* big sky: links, focus, what is switched on */
  --ring: rgba(143, 176, 204, 0.28);
  --button: #EDE6DA;           /* the one action a page asks for: bone, the coat's ink on it */
  --button-hover: #F7F2E9;
  --act-ink: #120F0C;
  --benign: #9DB58A;           /* sage */
  --notbenign: #D8A657;        /* tallgrass gold */
  --malicious: #DE7A63;        /* badlands clay */
  --benign-wash: rgba(157, 181, 138, 0.16);
  --notbenign-wash: rgba(216, 166, 87, 0.16);
  --malicious-wash: rgba(222, 122, 99, 0.16);
  --sev-critical: #F58A75;     /* a severity: one clay hue, the more severe the brighter */
  --sev-high: #D26454;
  --sev-medium: #A8544A;
  --sev-low: #7D4640;
  --think: #B9A3E0;            /* pasque flower: the agent's own reasoning */
  /* Light from above, the one depth: a panel a shade lighter at its top with a hairline of light along its edge. */
  --edge-light: linear-gradient(180deg, rgba(237, 230, 218, 0.055) 1px, rgba(237, 230, 218, 0) 1px);
  --panel: var(--edge-light), radial-gradient(ellipse 60% 120% at 100% 0%, rgba(143, 176, 204, 0.08), rgba(143, 176, 204, 0) 70%), linear-gradient(180deg, #1E1A16, #1B1713 55%);
  --card: var(--edge-light), linear-gradient(180deg, #1E1A16, #1B1713 96px);
  --caret: repeating-linear-gradient(180deg, rgba(18, 15, 12, 0.15) 0 1px, rgba(18, 15, 12, 0) 1px 3px),
    linear-gradient(180deg, rgba(143, 176, 204, 0) 62%, rgba(143, 176, 204, 0.28)), linear-gradient(180deg, #FBF8F2, #EDE6DA 48%, #D6CEC1);
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Sentient", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 8px;
  --radius-card: 12px;
  --control: 32px;
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2.25rem; --s7: 3.5rem;
  --gutter: clamp(1rem, 2.2vw, 2.75rem);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scrollbar-gutter: stable; background: var(--paper); color: var(--ink); color-scheme: dark;
  font: 435 14px/1.5 var(--sans); font-kerning: normal; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
body { margin: 0; min-height: 100vh; font-feature-settings: "tnum" 1; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, th { font-weight: inherit; }
strong, b { font-weight: 520; }
a { color: var(--act); text-decoration: none; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; border-radius: 2px; }
::selection { background: rgba(143, 176, 204, 0.32); color: var(--ink); }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: var(--s2) var(--s4); z-index: 10; }
.skip:focus { left: var(--s4); top: var(--s2); }

/* ---- the bar ---------------------------------------------------------- */
.top {
  display: flex; align-items: baseline; gap: var(--s5);
  padding: var(--s3) var(--gutter); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: var(--paper); z-index: 5;
}
.top { align-items: center; }
.mark { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.mark:hover { text-decoration: none; }
.mark-head { display: block; width: 32px; height: 32px; background: var(--ink); -webkit-mask: url("/static/bitbison-head.png") center / contain no-repeat; mask: url("/static/bitbison-head.png") center / contain no-repeat; }
.mark-word { font: 500 20px/1 var(--mono); font-variant-ligatures: none; white-space: nowrap; }
.mark-caret { display: inline-block; width: 0.72em; height: 1.35em; margin-left: 5px; vertical-align: -0.3em; background: var(--caret); }
.top nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.top nav a { color: var(--soft); padding: 6px 10px; border-radius: var(--radius); }
.top nav a:hover { color: var(--ink); background: var(--wash); text-decoration: none; }
.top nav a[aria-current="page"] { color: var(--ink); background: var(--raised); }
.who { display: flex; align-items: baseline; gap: var(--s3); color: var(--soft); font-size: 0.93rem; }

main { padding: var(--s5) var(--gutter) var(--s7); }
main:focus { outline: none; }
/* Pages made of prose and forms stop at a width a person reads at. */
main > form, main > .job-head, main > .tabs, main > .tabs ~ div, main > .report, main > .filters { max-width: 90rem; }

/* ---- controls --------------------------------------------------------- */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control); padding: 0 16px;
  line-height: normal; white-space: nowrap; color: var(--ink); background: transparent;
  border: 1px solid var(--rule-strong); border-radius: var(--radius); cursor: pointer;
  transition: background-color 150ms, border-color 150ms, color 150ms;
}
button:hover, .button:hover { background: var(--wash); text-decoration: none; }
button.primary { color: var(--act-ink); background: var(--button); border-color: var(--button); font-weight: 520; }
button.primary:hover { background: var(--button-hover); border-color: var(--button-hover); }
button.danger { color: var(--malicious); }
button.quiet { color: var(--soft); border-color: transparent; }
button.quiet:hover { color: var(--ink); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], select, textarea {
  height: var(--control); padding: 0 12px; width: 100%; background: var(--lift);
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--soft); }
input:focus, textarea:focus, select:focus-visible { outline: 3px solid var(--ring); outline-offset: 0; border-color: var(--act); }
textarea { height: auto; padding: 10px 12px; }
textarea { min-height: 5.5rem; resize: vertical; }
label { display: block; font-size: 12px; color: var(--soft); margin-bottom: 6px; }
.hint { color: var(--faint); font-size: 12px; }
.field { margin-bottom: var(--s4); }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row > .grow { flex: 1; min-width: 14rem; }
.row > .grow.cap { max-width: 34rem; }
.gap { margin-top: var(--s5); }
.check { display: flex; gap: var(--s2); align-items: baseline; font-size: 14px; color: var(--ink); }
.check input { margin: 0; }

/* ---- the run: its sentence -------------------------------------------- */
.sentence { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s4); flex-wrap: wrap; }
/* The run's state: a mark and a word, then what is being read, what waits and who reads, each a mark and a figure. */
.status { display: flex; align-items: center; gap: var(--s6); flex-wrap: wrap; }
.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.state { display: inline-flex; align-items: center; gap: 14px; font: 300 clamp(28px, 18px + 1.4vw, 44px)/1.1 var(--serif); }
.state .icon { width: 0.8em; height: 0.8em; padding: 0.22em; box-sizing: content-box; border-radius: 50%; background: var(--raised); }
.state.on .icon { color: var(--benign); background: var(--benign-wash); stroke-width: 1.9; }
.state.wait .icon { color: var(--act); background: var(--ring); }
.state.bad .icon { color: var(--malicious); background: var(--malicious-wash); }
.state.off .icon { color: var(--soft); }
.fig { display: inline-flex; align-items: baseline; gap: 10px; color: var(--soft); }
.fig .icon { width: 20px; height: 20px; align-self: center; color: var(--faint); }
.fig b { font: 300 28px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--ink); }
.sentence .why { margin-top: var(--s2); color: var(--soft); max-width: 80ch; }
.sentence .why.bad { color: var(--malicious); }
.sentence .acts { display: flex; gap: var(--s2); flex-wrap: wrap; padding-top: var(--s2); }

/* ---- the run: the strip of money and controls ------------------------- */
.strip {
  display: flex; flex-wrap: wrap; align-items: stretch; margin: 0 0 var(--s5);
  background: var(--panel); border-radius: var(--radius-card); padding: 4px 20px;
}
.strip > div { padding: 16px var(--s5) 16px 0; margin-right: var(--s5); border-right: 1px solid var(--rule); display: flex; flex-direction: column; justify-content: center; gap: 0.15rem; }
.strip > div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.strip .what { color: var(--soft); font-size: 12px; }
.strip .big { font: 300 40px/1.05 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.strip .big.low { color: var(--malicious); }
.strip .mid { font: 400 24px/1.1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.strip .sub { color: var(--faint); font-size: 12px; }
.strip .sub a { color: inherit; }
.strip .counts { display: flex; gap: var(--s5); }
.strip .counts > span { display: flex; flex-direction: column; gap: 0.15rem; }

/* What is read: a severity is a switch that also says how many wait at it. */
.levels { display: flex; gap: var(--s2); flex-wrap: wrap; }
.level {
  height: 28px; padding: 0 12px; gap: 8px; border-radius: 999px; font-size: 13px; color: var(--soft);
}
.level::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); opacity: 0.35; }
.level b { font: 400 12px var(--mono); color: var(--faint); }
.level[aria-pressed="true"] { color: var(--ink); border-color: var(--act); background: var(--ring); }
.level[aria-pressed="true"]::before { opacity: 1; }
.level[aria-pressed="true"] b { color: var(--ink); }
.level.critical { --dot: var(--sev-critical); }
.level.high { --dot: var(--sev-high); }
.level.medium { --dot: var(--sev-medium); }
.level.low { --dot: var(--sev-low); }
.stepper { display: inline-flex; align-items: center; gap: var(--s1); }
.stepper button { width: 28px; height: 28px; padding: 0; border-radius: 999px; font-size: 16px; }
.stepper output { min-width: 2.6ch; text-align: center; font: 400 24px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }

/* ---- the run: its layout ---------------------------------------------- */
.console { display: grid; grid-template-columns: minmax(0, 1fr) clamp(17rem, 19vw, 23rem); gap: var(--s6); align-items: start; }
.lower { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s6); align-items: start; }
@media (max-width: 78rem) { .console, .lower { grid-template-columns: minmax(0, 1fr); } }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--s6); align-items: start; }
@media (max-width: 70rem) { .split { grid-template-columns: minmax(0, 1fr); } }
section { margin-bottom: var(--s6); }
section > h2, .side h2 { font: 520 16px/1.3 var(--sans); margin-bottom: var(--s2); display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
section > h2 small, .side h2 small, section > h2 a, .side h2 a { font-weight: 435; color: var(--soft); font-size: 12px; }
section > h2 a, .side h2 a { color: var(--act); }
.side > div { margin-bottom: var(--s4); background: var(--card); border-radius: var(--radius-card); padding: 16px; }
.empty { color: var(--soft); padding: var(--s4) 0; max-width: 60ch; }

/* ---- tables ----------------------------------------------------------- */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 435; color: var(--faint); font-size: 12px; line-height: 1.4; padding: 0 24px 8px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 8px 24px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; white-space: nowrap; }
td.num, th.num { text-align: right; }
td.num { font: 400 13px var(--mono); }
td.pkg { max-width: 34rem; overflow: hidden; text-overflow: ellipsis; }
td.pkg a { color: var(--ink); font: 400 13px var(--mono); font-variant-ligatures: none; }
td.pkg a:hover { text-decoration: underline; }
td.cmd { font: 400 12px/1.4 var(--mono); color: var(--soft); max-width: 0; width: 40%; overflow: hidden; text-overflow: ellipsis; }
td.empty { white-space: normal; }
tr.malicious td.pkg a { color: var(--malicious); }
tbody tr:hover td { background: var(--wash); }

/* What is being read now: the table the page is for. */
table.reading-now td { padding-block: 0.6rem; }
table.reading-now tbody tr { cursor: pointer; }
table.reading-now td.pkg .sub { display: block; font-weight: 400; margin-top: 0.1rem; }
table.reading-now td.now { max-width: 0; width: 44%; overflow: hidden; text-overflow: ellipsis; }
table.reading-now td.now .doing { color: var(--ink); }
table.reading-now td.now .raw { font: 400 12px/1.4 var(--mono); color: var(--faint); margin-left: 12px; }
table.reading-now td.now.wait .doing { color: var(--faint); font-style: italic; }
/* How much of its time a read has used: a hairline under the minutes. */
td.for { position: relative; }
td.for i { position: absolute; left: 0; right: var(--s4); bottom: 0.3rem; height: 2px; background: var(--rule); }
td.for i b { display: block; height: 100%; background: var(--act); width: 0; }
td.for.long i b { background: var(--notbenign); }

.sev { display: inline-flex; align-items: center; gap: 8px; color: var(--soft); }
.sev::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--sev-low); }
.sev.critical { color: var(--ink); } .sev.critical::before { background: var(--sev-critical); }
.sev.high::before { background: var(--sev-high); }
.sev.medium::before { background: var(--sev-medium); }

.det { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.det.benign { color: var(--benign); background: var(--benign-wash); }
.det.not-benign { color: var(--notbenign); background: var(--notbenign-wash); }
.det.malicious { color: var(--malicious); background: var(--malicious-wash); }
.det.none { color: var(--soft); padding: 0; }
.before { color: var(--soft); font-size: 0.9rem; white-space: nowrap; }
.before b.benign { color: var(--benign); } .before b.not-benign { color: var(--notbenign); } .before b.malicious { color: var(--malicious); }

/* ---- the order of the models ------------------------------------------ */
ol.order { list-style: none; margin: 0; padding: 0; counter-reset: place; }
ol.order li:last-child { border-bottom: 0; }
ol.order li { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: var(--s2); align-items: baseline; padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
ol.order li.on { counter-increment: place; }
ol.order li.on::before { content: counter(place); font: 400 20px var(--serif); color: var(--ink); }
ol.order li.off::before { content: ""; }
ol.order li.off .name { color: var(--soft); }
ol.order .name { font-weight: 520; }
ol.order .nums { color: var(--soft); font-size: 12px; grid-column: 2 / 4; }
ol.order .nums b { color: var(--ink); font: 400 12px var(--mono); }

/* ---- the log ---------------------------------------------------------- */
ol.log { list-style: none; margin: 0; padding: 0; font-size: 13px; max-height: 34rem; overflow-y: auto; }
ol.log li { display: grid; grid-template-columns: 4.6rem 1fr; gap: var(--s2); padding: 0.25rem 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
ol.log time { color: var(--faint); font: 400 12px/1.7 var(--mono); }
ol.log li.good span { color: var(--benign); }
ol.log li.notice span { color: var(--act); }
ol.log li.warn span { color: var(--notbenign); }
ol.log li.error span { color: var(--malicious); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s4); margin: 0; }
dl.facts dt { color: var(--soft); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---- a job: the reading ------------------------------------------------ */
.job-head { margin-bottom: var(--s5); }
.job-head h1 { font: 400 clamp(20px, 14px + 1.2vw, 30px)/1.25 var(--mono); font-variant-ligatures: none; overflow-wrap: anywhere; }
.job-head .line { margin-top: var(--s2); color: var(--soft); display: flex; gap: var(--s4); flex-wrap: wrap; align-items: baseline; }
.tabs { display: flex; gap: var(--s4); border-bottom: 1px solid var(--rule); margin-bottom: var(--s4); flex-wrap: wrap; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; height: auto; padding: var(--s2) 0; color: var(--soft); }
.tabs button:hover { background: none; color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--act); }

.reading { max-width: 84ch; }
.reading .round { font: 600 1rem var(--sans); color: var(--soft); margin: var(--s5) 0 var(--s2); }
.reading .turn { color: var(--faint); font-size: 0.87rem; margin: var(--s5) 0 var(--s1); border-top: 1px solid var(--rule); padding-top: var(--s2); }
.reading .think { font: 300 16px/1.6 var(--serif); color: var(--think); white-space: pre-wrap; overflow-wrap: anywhere; margin: var(--s2) 0; }
.reading .say { font: 400 16px/1.6 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; margin: var(--s2) 0; }
.reading .prompt { color: var(--soft); border-left: 3px solid var(--rule-strong); padding-left: var(--s3); margin: var(--s2) 0; }
.reading details.call { margin: var(--s2) 0; border-radius: var(--radius); background: var(--card); }
.reading details.call > summary { cursor: pointer; padding: var(--s2) var(--s3); display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: baseline; list-style: none; }
.reading details.call > summary::-webkit-details-marker { display: none; }
.reading details.call .tool { font: 500 12px var(--mono); }
.reading details.call .input { font: 400 12px/1.4 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soft); }
.reading details.call .took { color: var(--faint); font-size: 0.87rem; white-space: nowrap; }
.reading details.call.failed { border-color: var(--malicious); }
.reading details.call.failed .took { color: var(--malicious); }
.reading details.call pre { margin: 0 var(--s2) var(--s2); padding: var(--s3); border-radius: 6px; background: var(--inset); font: 400 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 26rem; overflow: auto; }
.reading details.call pre.in { color: var(--ink); }
.reading details.call pre.out { color: var(--soft); }
.reading .end { margin-top: var(--s5); color: var(--soft); }
.reading .live { display: inline-block; width: 0.72em; height: 1.2em; background: var(--caret); vertical-align: text-bottom; animation: caret 1.1s steps(2, start) infinite; }
@keyframes caret { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .reading .live { animation: none; } }
.follow { position: sticky; bottom: var(--s4); display: flex; justify-content: flex-end; pointer-events: none; }
.follow button { pointer-events: auto; background: var(--lift); }

/* An outline of a read, for someone who follows it without its content:
   the kind of work, a line each, the one under way in ink. */
ol.steps-done { list-style: none; margin: var(--s2) 0; padding: 0; border-left: 2px solid var(--rule-strong); }
ol.steps-done li { padding: 4px 0 4px var(--s3); font: 400 16px/1.5 var(--serif); color: var(--soft); }
ol.steps-done li small { color: var(--faint); font: 12px var(--sans); }
ol.steps-done li code { display: block; font: 400 12px/1.5 var(--mono); color: var(--faint); overflow-wrap: anywhere; }
ol.steps-done li code:empty { display: none; }
.outline-tally { color: var(--soft); margin: var(--s2) 0 var(--s3); }
.outline-tally b { font: 400 13px var(--mono); color: var(--ink); }
ol.steps-done li:last-child { color: var(--ink); }

.doc h3 { font: 520 16px var(--sans); margin: var(--s4) 0 var(--s1); }
.doc p, .doc li { max-width: 74ch; }
.doc .account { font: 400 16px/1.6 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 74ch; }
.doc pre.json { font: 400 12px/1.5 var(--mono); background: var(--inset); border-radius: var(--radius); padding: var(--s3); overflow: auto; max-height: 40rem; white-space: pre-wrap; overflow-wrap: anywhere; }
ul.findings { list-style: none; padding: 0; margin: 0; }
ul.findings li { padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
ul.findings .rule { font: 400 12px var(--mono); color: var(--faint); }
ul.findings .why { color: var(--soft); margin-top: var(--s1); max-width: 74ch; }
.judged { font-weight: 520; }
.judged.true { color: var(--malicious); } .judged.false { color: var(--benign); } .judged.unclear { color: var(--notbenign); }

/* ---- signing in ------------------------------------------------------- */
.door { max-width: 26rem; margin: 9vh auto 0; }
.door h1 { font: 300 56px/1.05 var(--serif); margin: var(--s5) 0 var(--s6); }
.door .mark-head { width: 48px; height: 48px; }
.door .lede { font: 400 20px/1.4 var(--serif); color: var(--soft); margin-bottom: var(--s6); text-wrap: pretty; }
.door form { margin-bottom: var(--s5); }
.error { color: var(--malicious); margin: var(--s2) 0; }

/* ---- submitting ------------------------------------------------------- */
.ask { max-width: 46rem; margin-bottom: var(--s6); }
.ask h1 { font: 300 clamp(26px, 16px + 1.4vw, 40px)/1.1 var(--serif); margin-bottom: var(--s3); }
.ask .lede { font: 400 16px/1.5 var(--sans); color: var(--soft); margin-bottom: var(--s5); max-width: 68ch; text-wrap: pretty; }
.steps { list-style: none; padding: 0; margin: var(--s4) 0; display: flex; gap: 0; flex-wrap: wrap; counter-reset: step; }
.steps li { counter-increment: step; padding: var(--s2) var(--s4) var(--s2) 0; margin-right: var(--s4); color: var(--faint); border-top: 3px solid var(--rule); min-width: 9rem; }
.steps li::before { content: counter(step) ". "; }
.steps li.done { color: var(--ink); border-top-color: var(--ink); }
.steps li.now { color: var(--ink); border-top-color: var(--act); }
.steps li.failed { color: var(--malicious); border-top-color: var(--malicious); }

/* ---- small things ------------------------------------------------------ */
#toasts { position: fixed; right: var(--s4); bottom: var(--s4); display: grid; gap: var(--s2); z-index: 20; max-width: min(34rem, 92vw); }
.toast { background: var(--lift); color: var(--ink); padding: var(--s3) var(--s4); border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow-wrap: anywhere; }
.toast.bad { border-color: var(--malicious); color: var(--malicious); }
.filters { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: end; margin-bottom: var(--s4); }
.filters .field { margin: 0; min-width: 9rem; }
.filters .grow { flex: 1; min-width: 14rem; }
.pager { display: flex; gap: var(--s3); align-items: center; margin-top: var(--s3); color: var(--soft); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--s4) var(--s5); }
.report pre { font: 400 12px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--inset); border-radius: var(--radius-card); padding: var(--s4); overflow: auto; }
kbd { font: 0.85rem var(--mono); border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 3px; padding: 0 0.3em; }

/* ---- scrollbars, in the palette: thin, bone at a low strength, no track ---- */
* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 999px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---- the run's page fits the window ------------------------------------
   Everything is above the fold: the state, the strip, then the tables,
   which take what height is left and scroll inside themselves under their
   own headings. On a short or narrow window the page scrolls as any other. */
@media (min-width: 78rem) and (min-height: 40rem) {
  body.fit { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
  body.fit main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: var(--s4); }
  body.fit .sentence { margin-bottom: var(--s3); }
  body.fit .strip { margin-bottom: var(--s4); }
  body.fit .console { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; gap: var(--s5); }
  body.fit .console > div { display: flex; flex-direction: column; min-height: 0; gap: var(--s4); }
  body.fit .console > div > section { flex: 3 1 0; }
  body.fit .lower { flex: 2 1 0; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; gap: var(--s5); }
  body.fit section { margin: 0; min-height: 0; display: flex; flex-direction: column; }
  body.fit section > .scroll, body.fit ol.log { flex: 1; min-height: 0; max-height: none; overflow: auto; }
  body.fit section > form { margin-top: var(--s3); }
  body.fit thead th { position: sticky; top: 0; z-index: 1; background: var(--paper); padding-top: 4px; }
  body.fit .side { overflow-y: auto; min-height: 0; padding-right: 2px; }
  body.fit .side > div:last-child { margin-bottom: 0; }
}

/* ---- the strip's graphs --------------------------------------------------
   A bar is a whole in parts, each part's width its share; the colours are
   the ones the rest of the page gives those things. */
.bar { display: flex; gap: 2px; height: 8px; width: 100%; min-width: 11rem; border-radius: 999px; overflow: hidden; background: var(--rule); }
.bar.thin { height: 4px; min-width: 9rem; }
.bar i { display: block; height: 100%; min-width: 3px; background: var(--faint); transition: width 300ms; }
.bar i.critical { background: var(--sev-critical); }
.bar i.high { background: var(--sev-high); }
.bar i.medium { background: var(--sev-medium); }
.bar i.low { background: var(--sev-low); }
.bar i.benign { background: var(--benign); }
.bar i.not-benign, .bar i.waiting { background: var(--notbenign); }
.bar i.malicious { background: var(--malicious); }
.bar i.onward, .bar i.spent, .bar i.on { background: var(--act); }
.bar i.left, .bar i.off, .bar i.failed { background: var(--rule-strong); }
@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } }
.keys { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.key::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--rule-strong); }
.key.benign::before { background: var(--benign); }
.key.not-benign::before, .key.waiting::before { background: var(--notbenign); }
.key.malicious::before { background: var(--malicious); }
.key.onward::before { background: var(--act); }
/* One cell an agent: the busy ones lit. */
.cells { display: grid; grid-template-columns: repeat(16, 8px); gap: 3px; margin-top: 4px; }
.cells i { width: 8px; height: 8px; border-radius: 2px; background: var(--rule-strong); }
.cells i.on { background: var(--act); }
.strip .counts > span { min-width: 12rem; gap: 6px; }
.strip > div { gap: 6px; }

/* ---- usage ------------------------------------------------------------------
   A month by organization and by person. What has reached its budget says
   so in the colour the page gives what is wrong. */
td.who { font: 400 13px var(--mono); font-variant-ligatures: none; max-width: 30rem; overflow: hidden; text-overflow: ellipsis; }
tr.over td.spent, tr.over td.left { color: var(--malicious); }
.budget { flex-wrap: nowrap; gap: var(--s2); }
.budget input { width: 11rem; }
