/* GENERATED by brand/build.py from brand/tokens.json, brand/css/base.css and brand/css/components.css. Do not edit by hand: change brand/ and run python brand/build.py. */

@font-face { font-family: "Literata"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("fonts/Literata-Roman-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("fonts/Literata-Roman-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("fonts/Literata-Roman-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 200 900; font-display: swap; src: url("fonts/Literata-Italic-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 200 900; font-display: swap; src: url("fonts/Literata-Italic-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 200 900; font-display: swap; src: url("fonts/Literata-Italic-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Geologica"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/Geologica-Roman-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geologica"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/Geologica-Roman-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geologica"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/Geologica-Roman-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/PTMono-Roman-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/PTMono-Roman-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "PT Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/PTMono-Roman-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --ground: #F1F3EE;
  --surface: #FAFBF8;
  --sunk: #E7EBE4;
  --ink: #17201B;
  --ink-2: #56605A;
  --ink-3: #8C968E;
  --rule: #D3D9D1;
  --rule-2: #E3E7E0;
  --line-control: #7C867E;
  --accent: #143B75;
  --on-accent: #FFFFFF;
  --accent-wash: #DFE6F0;
  --ok: #2E6B3F;
  --wait: #7A5200;
  --wait-wash: #F4EAD3;
  --err: #B3261E;
  --err-wash: #F7E4E1;
  --overlay: #17201B61;
  --mark-field: var(--accent);
  --mark-leaf: var(--ground);
  --button-outline: var(--ink);
  --button-ring: var(--accent);
  --button-ring-gap: var(--ground);
  color-scheme: light;
  --font-display: "Literata", "PT Serif", Georgia, serif;
  --font-text: "Geologica", "PT Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "PT Mono", Consolas, "Courier New", monospace;
  --font-math: Cambria, Georgia, "Times New Roman", serif;
  --gap-stream: 12px;
  --pad-x: 10px;
  --pad-card: 10px;
  --gap-card: 9px;
  --radius: 2px;
  --radius-kbd: 3px;
  --radius-badge: 8px;
  --radius-round: 50%;
  --border-width: 1px;
  --border-strong: 1.5px;
  --border-err: 2px;
  --focus-width: 2px;
  --focus-offset: 2px;
  --icon-size: 18px;
  --icon-stroke: 1.6;
  --gutter: clamp(16px, 4vw, 48px);
  --wrap: 1320px;
  --duration-control: 120ms;
  --duration-appear: 220ms;
  --ease-appear: cubic-bezier(0.2, 0.7, 0.1, 1);
  --appear-shift: 4px;
  --duration-ring: 2.4s;
  --control-h: 42px;
  --control-pad-x: 18px;
  --control-pad-y: 0px;
  --ring-gap: 2px;
  --field-h: 40px;
  --field-pad-x: 10px;
  --mark-size: 24px;
  --display-size: clamp(32px, 6.2vw, 64px);
  --display-lh: 1;
  --display-weight: 500;
  --display-tracking: -0.025em;
  --title-size: clamp(30px, 5vw, 50px);
  --title-lh: 1;
  --title-weight: 500;
  --title-tracking: -0.02em;
  --heading-size: 32px;
  --heading-lh: 1;
  --heading-weight: 500;
  --heading-tracking: normal;
  --subheading-size: 26px;
  --subheading-lh: 1.1;
  --subheading-weight: 500;
  --subheading-tracking: normal;
  --section-size: clamp(34px, 4.6vw, 62px);
  --section-lh: 1.02;
  --section-weight: 460;
  --section-tracking: -0.022em;
  --block-size: 24px;
  --block-lh: 1.2;
  --block-weight: 600;
  --block-tracking: -0.01em;
  --latin-size: 1em;
  --latin-lh: 1.3;
  --latin-weight: 400;
  --latin-tracking: normal;
  --lede-size: 19px;
  --lede-lh: 1.5;
  --lede-weight: 400;
  --lede-tracking: normal;
  --small-size: 13px;
  --small-lh: 1.5;
  --small-weight: 400;
  --small-tracking: normal;
  --panel-title-size: 15.5px;
  --panel-title-lh: 1.3;
  --panel-title-weight: 600;
  --panel-title-tracking: normal;
  --code-size: 14px;
  --code-lh: 1.5;
  --code-weight: 400;
  --code-tracking: normal;
  --wordmark-size: 18px;
  --wordmark-lh: 1;
  --wordmark-weight: 500;
  --wordmark-tracking: -0.01em;
  --text-size: 17px;
  --text-lh: 1.55;
  --text-weight: 400;
  --text-tracking: normal;
  --control-size: 15px;
  --control-lh: 1.2;
  --control-weight: 500;
  --control-tracking: normal;
  --field-size: 15px;
  --field-lh: 1.3;
  --field-weight: 400;
  --field-tracking: normal;
  --label-size: 12px;
  --label-lh: 1.35;
  --label-weight: 400;
  --label-tracking: 0.08em;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
  --ground: #121614;
  --surface: #181D1A;
  --sunk: #0C0F0D;
  --ink: #E4E9E2;
  --ink-2: #9DA89F;
  --ink-3: #66716A;
  --rule: #2B332E;
  --rule-2: #1E2521;
  --line-control: #6B766E;
  --accent: #8DB2E8;
  --on-accent: #121614;
  --accent-wash: #1C2636;
  --ok: #7CC48E;
  --wait: #E2B45C;
  --wait-wash: #2E2718;
  --err: #F08A80;
  --err-wash: #33201D;
  --overlay: #000000A3;
  --mark-field: var(--accent);
  --mark-leaf: var(--ground);
  --button-outline: var(--ink);
  --button-ring: var(--accent);
  --button-ring-gap: var(--ground);
  color-scheme: dark;
}
}
:root[data-theme="dark"] {
  --ground: #121614;
  --surface: #181D1A;
  --sunk: #0C0F0D;
  --ink: #E4E9E2;
  --ink-2: #9DA89F;
  --ink-3: #66716A;
  --rule: #2B332E;
  --rule-2: #1E2521;
  --line-control: #6B766E;
  --accent: #8DB2E8;
  --on-accent: #121614;
  --accent-wash: #1C2636;
  --ok: #7CC48E;
  --wait: #E2B45C;
  --wait-wash: #2E2718;
  --err: #F08A80;
  --err-wash: #33201D;
  --overlay: #000000A3;
  --mark-field: var(--accent);
  --mark-leaf: var(--ground);
  --button-outline: var(--ink);
  --button-ring: var(--accent);
  --button-ring-gap: var(--ground);
  color-scheme: dark;
}
.palette-scale {
  --gap-stream: 12px;
  --pad-x: 10px;
  --pad-card: 10px;
  --gap-card: 9px;
  --radius: 2px;
  --radius-kbd: 3px;
  --radius-badge: 8px;
  --radius-round: 50%;
  --border-width: 1px;
  --border-strong: 1.5px;
  --border-err: 2px;
  --focus-width: 2px;
  --focus-offset: 2px;
  --icon-size: 18px;
  --icon-stroke: 1.6;
  --gutter: clamp(16px, 4vw, 48px);
  --wrap: 1320px;
  --duration-control: 120ms;
  --duration-appear: 220ms;
  --ease-appear: cubic-bezier(0.2, 0.7, 0.1, 1);
  --appear-shift: 4px;
  --duration-ring: 2.4s;
  --control-h: 30px;
  --control-pad-x: 12px;
  --control-pad-y: 4px;
  --ring-gap: 1px;
  --field-h: 30px;
  --field-pad-x: 8px;
  --mark-size: 22px;
  --display-size: 64px;
  --display-lh: 1;
  --display-weight: 500;
  --display-tracking: -0.025em;
  --title-size: 50px;
  --title-lh: 1;
  --title-weight: 500;
  --title-tracking: -0.02em;
  --heading-size: 32px;
  --heading-lh: 1;
  --heading-weight: 500;
  --heading-tracking: normal;
  --subheading-size: 26px;
  --subheading-lh: 1.1;
  --subheading-weight: 500;
  --subheading-tracking: normal;
  --section-size: 62px;
  --section-lh: 1.02;
  --section-weight: 460;
  --section-tracking: -0.022em;
  --block-size: 24px;
  --block-lh: 1.2;
  --block-weight: 600;
  --block-tracking: -0.01em;
  --latin-size: 1.04em;
  --latin-lh: 1.3;
  --latin-weight: 400;
  --latin-tracking: normal;
  --lede-size: 19px;
  --lede-lh: 1.5;
  --lede-weight: 400;
  --lede-tracking: normal;
  --small-size: 12px;
  --small-lh: 1.4;
  --small-weight: 400;
  --small-tracking: normal;
  --panel-title-size: 15.5px;
  --panel-title-lh: 1.3;
  --panel-title-weight: 600;
  --panel-title-tracking: normal;
  --code-size: 11px;
  --code-lh: 1.55;
  --code-weight: 400;
  --code-tracking: normal;
  --wordmark-size: 15.5px;
  --wordmark-lh: 1;
  --wordmark-weight: 500;
  --wordmark-tracking: -0.01em;
  --text-size: 13px;
  --text-lh: 1.45;
  --text-weight: 400;
  --text-tracking: normal;
  --control-size: 13px;
  --control-lh: 1.25;
  --control-weight: 500;
  --control-tracking: normal;
  --field-size: 12.5px;
  --field-lh: 1.3;
  --field-weight: 400;
  --field-tracking: normal;
  --label-size: 11px;
  --label-lh: 1.2;
  --label-weight: 400;
  --label-tracking: 0.06em;
  font-size: var(--text-size);
  line-height: var(--text-lh);
}
.type-display { font-family: var(--font-display); font-size: var(--display-size); line-height: var(--display-lh); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); }
.type-title { font-family: var(--font-display); font-size: var(--title-size); line-height: var(--title-lh); font-weight: var(--title-weight); letter-spacing: var(--title-tracking); }
.type-heading { font-family: var(--font-display); font-size: var(--heading-size); line-height: var(--heading-lh); font-weight: var(--heading-weight); letter-spacing: var(--heading-tracking); }
.type-subheading { font-family: var(--font-display); font-size: var(--subheading-size); line-height: var(--subheading-lh); font-weight: var(--subheading-weight); letter-spacing: var(--subheading-tracking); }
.type-section { font-family: var(--font-display); font-size: var(--section-size); line-height: var(--section-lh); font-weight: var(--section-weight); letter-spacing: var(--section-tracking); }
.type-block { font-family: var(--font-display); font-size: var(--block-size); line-height: var(--block-lh); font-weight: var(--block-weight); letter-spacing: var(--block-tracking); }
.type-wordmark { font-family: var(--font-display); font-size: var(--wordmark-size); line-height: var(--wordmark-lh); font-weight: var(--wordmark-weight); letter-spacing: var(--wordmark-tracking); }
.type-latin { font-family: var(--font-display); font-size: var(--latin-size); line-height: var(--latin-lh); font-weight: var(--latin-weight); letter-spacing: var(--latin-tracking); font-style: italic; }
.type-text { font-family: var(--font-text); font-size: var(--text-size); line-height: var(--text-lh); font-weight: var(--text-weight); letter-spacing: var(--text-tracking); }
.type-lede { font-family: var(--font-text); font-size: var(--lede-size); line-height: var(--lede-lh); font-weight: var(--lede-weight); letter-spacing: var(--lede-tracking); }
.type-small { font-family: var(--font-text); font-size: var(--small-size); line-height: var(--small-lh); font-weight: var(--small-weight); letter-spacing: var(--small-tracking); }
.type-panel-title { font-family: var(--font-text); font-size: var(--panel-title-size); line-height: var(--panel-title-lh); font-weight: var(--panel-title-weight); letter-spacing: var(--panel-title-tracking); }
.type-control { font-family: var(--font-text); font-size: var(--control-size); line-height: var(--control-lh); font-weight: var(--control-weight); letter-spacing: var(--control-tracking); }
.type-field { font-family: var(--font-text); font-size: var(--field-size); line-height: var(--field-lh); font-weight: var(--field-weight); letter-spacing: var(--field-tracking); }
.type-label { font-family: var(--font-mono); font-size: var(--label-size); line-height: var(--label-lh); font-weight: var(--label-weight); letter-spacing: var(--label-tracking); text-transform: uppercase; }
.type-code { font-family: var(--font-mono); font-size: var(--code-size); line-height: var(--code-lh); font-weight: var(--code-weight); letter-spacing: var(--code-tracking); }

/* ---- brand/css/base.css ---- */
/* Land Plan Ai brand v2 - base: resets, the focus ring and the type primitives.
   One source for the site, the cabinet and the palette (brand/build.py copies it into each surface's brand
   file). The palette's embedded Chromium is unknown (docs/ASSUMPTIONS.md A-006): no color-mix(), no :has(),
   no container queries, no logical shorthands (inset, margin-inline and the like). Every value is a token:
   change it in brand/tokens.json. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-size);
  line-height: var(--text-lh);
  font-weight: var(--text-weight);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
h1, h2, h3, h4 { margin: 0; font-weight: inherit; font-size: inherit; }
p, ul, ol, dl, dd, figure { margin: 0; }
b, strong { font-weight: 600; }
code, .mono { font-family: var(--font-mono); }

/* Label: the mono capitals over a heading, a block or a message. */
.label {
  font-family: var(--font-mono);
  font-size: var(--label-size);
  line-height: var(--label-lh);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--ink-2);
}

/* TextStyles: a Latin plant name, tabular figures, the second text colour. */
.latin { font-family: var(--font-display); font-style: italic; font-weight: var(--latin-weight); font-size: var(--latin-size); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }

/* Kbd: one key. */
kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px 2px;
  border: var(--border-width) solid var(--line-control);
  border-bottom-width: 2px;
  border-radius: var(--radius-kbd);
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
}

/* Icon: a symbol of brand/icons/sprite.svg, drawn with the text colour. */
svg.icon {
  display: block;
  flex: none;
  width: var(--icon-size);
  height: var(--icon-size);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Mark: #mk (64 px and up), #mk-m (24-63 px), #mk-xs (16-23 px). Field in the accent, leaf and stalk in the
   ground under it, veins in the field colour. */
svg.mark {
  display: block;
  flex: none;
  width: var(--mark-size);
  height: var(--mark-size);
  --m-field: var(--mark-field);
  --m-leaf: var(--mark-leaf);
}
.mk-field { fill: var(--m-field); }
.mk-leaf { fill: var(--m-leaf); }
.mk-stalk { fill: none; stroke: var(--m-leaf); stroke-linecap: round; }
.mk-vein { fill: none; stroke: var(--m-field); stroke-linecap: round; }

/* Wordmark: «Land Plan» italic 460, «Ai» upright in the wordmark style's weight, like a species name and its author. */
.wordmark {
  font-family: var(--font-display);
  font-size: var(--wordmark-size);
  font-weight: var(--wordmark-weight);
  letter-spacing: var(--wordmark-tracking);
  line-height: var(--wordmark-lh);
  white-space: nowrap;
}
.wordmark i { font-style: italic; font-weight: 460; }

/* The sprite region brand/build.py writes into each surface: never painted itself. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Hidden from the eye, read by a screen reader. */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* SkipLink: the first Tab stop of a page. */
.skip-link {
  position: fixed;
  z-index: 60;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--small-size);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--duration-control);
}
.skip-link:focus { transform: none; }

/* Only waiting and appearing steps move; with "reduce motion" nothing does. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---- brand/css/components.css ---- */
/* Land Plan Ai brand v2 - components: one rule set per catalog component (brand/catalog.json names each one,
   its states and where it is used). Sizes that differ by surface come from tokens (--control-h, --text-size,
   --pad-card ...); the palette-scale parts keep the mock's pixel values inside their own rule. A surface
   stylesheet may place a component (margins, grid and flex placement, width) but never restyles it.
   A-006: no color-mix(), no :has(), no container queries, no logical shorthands. */

/* ============ Button ============ */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--control-h);
  padding: var(--control-pad-y) var(--control-pad-x);
  border: var(--border-width) solid var(--button-outline); border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font-family: var(--font-text); font-size: var(--control-size); line-height: var(--control-lh);
  font-weight: var(--control-weight); text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color var(--duration-control), border-color var(--duration-control), box-shadow var(--duration-control);
}
.button:hover { background: var(--sunk); }
.button svg.icon { width: 15px; height: 15px; }
.button-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button-danger { background: var(--err); border-color: var(--err); color: var(--on-accent); }
.button-primary:hover {
  background: var(--accent);
  box-shadow: 0 0 0 var(--ring-gap) var(--button-ring-gap), 0 0 0 calc(var(--ring-gap) + 1px) var(--button-ring);
}
.button-danger:hover {
  background: var(--err);
  box-shadow: 0 0 0 var(--ring-gap) var(--button-ring-gap), 0 0 0 calc(var(--ring-gap) + 1px) var(--button-ring);
}
.button:disabled, .button[aria-disabled="true"] {
  cursor: not-allowed; background: transparent; color: var(--ink-2);
  border: var(--border-width) dashed var(--line-control); box-shadow: none;
}
.button-full { width: 100%; }
.button-small {
  min-height: calc(var(--control-h) - 6px);
  padding: 0 calc(var(--control-pad-x) - 4px);
  font-size: calc(var(--control-size) - 1px);
}
.button-text {
  display: inline; padding: 0; border: 0; background: none; color: var(--accent);
  font-family: var(--font-text); font-size: var(--small-size); line-height: 1.4; font-weight: var(--small-weight);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.button-text:disabled { color: var(--ink-2); cursor: not-allowed; text-decoration: none; }
.button-toggle {
  padding: 9px 11px; border: var(--border-width) solid var(--line-control); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-family: var(--font-mono); font-size: 12px; line-height: 1; letter-spacing: .03em;
  white-space: nowrap; cursor: pointer;
}
.button-toggle:hover { background: var(--sunk); }
.button-toggle[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.segmented {
  display: inline-flex; flex-wrap: wrap; max-width: 100%;
  border: var(--border-width) solid var(--line-control); border-radius: var(--radius); overflow: hidden;
}
.segmented button {
  flex: 1 1 auto; border: 0; background: var(--surface); color: var(--ink);
  font-family: var(--font-mono); font-size: 12px; line-height: 1; letter-spacing: .03em;
  padding: 9px 11px; cursor: pointer; white-space: nowrap;
}
.segmented button + button { border-left: var(--border-width) solid var(--line-control); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.segmented button:focus-visible { outline-offset: -3px; }

/* ============ IconButton ============ */
.icon-button {
  position: relative; flex: none; display: inline-grid; place-items: center;
  width: 28px; height: 28px; padding: 0;
  border: var(--border-width) solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-button:hover { background: var(--sunk); color: var(--ink); }
.icon-button svg.icon { width: 18px; height: 18px; }
.icon-button[aria-expanded="true"], .icon-button[aria-pressed="true"] { background: var(--sunk); color: var(--ink); }
.icon-button:disabled, .icon-button[aria-disabled="true"] { color: var(--ink-3); background: transparent; cursor: not-allowed; }
.icon-button-small { width: 22px; height: 22px; }
.icon-button-small svg.icon { width: 14px; height: 14px; }
.count-badge {
  position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: var(--radius-badge); background: var(--accent); color: var(--on-accent);
  font-family: var(--font-text); font-size: 11px; line-height: 15px; font-weight: 600; text-align: center;
}
.dot-badge {
  position: absolute; top: 3px; right: 3px; width: 8px; height: 8px;
  border-radius: var(--radius-round); background: var(--accent); box-shadow: 0 0 0 2px var(--ground);
  pointer-events: none;
}
.dot-badge.is-wait { background: var(--wait); }

/* ============ Link ============ */
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { text-decoration-thickness: 2px; }
.nav-link {
  padding: 6px 0; border: 0; background: none; color: var(--ink-2);
  font: inherit; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--ink); border-bottom: var(--border-strong) solid var(--accent); }
.url {
  font-family: var(--font-mono); font-size: 11.5px;
  -webkit-user-select: all; user-select: all; overflow-wrap: anywhere;
}

/* ============ Field ============ */
.field { display: grid; gap: 5px; min-width: 0; }
.field-label { font-size: var(--small-size); line-height: 1.35; font-weight: 500; color: var(--ink); }
.field-input {
  width: 100%; min-width: 0; height: var(--field-h); padding: 0 var(--field-pad-x);
  border: var(--border-width) solid var(--line-control); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-family: var(--font-text); font-size: var(--field-size); line-height: var(--field-lh);
}
textarea.field-input { height: auto; min-height: 7em; padding-top: 8px; padding-bottom: 8px; resize: vertical; }
.field-input::placeholder { color: var(--ink-2); opacity: 1; }
.field-input[readonly] { background: var(--sunk); color: var(--ink-2); }
.field-input:disabled { cursor: not-allowed; color: var(--ink-2); }
.field-input.is-mono { font-family: var(--font-mono); }
.field-input.is-code { font-family: var(--font-mono); font-size: 22px; line-height: 1; letter-spacing: .34em; text-align: center; }
.field.is-bad .field-input { border: var(--border-err) solid var(--err); }
.field-error { display: flex; gap: 6px; align-items: flex-start; font-size: var(--small-size); color: var(--err); }
.field-error svg.icon { width: 15px; height: 15px; margin-top: 2px; }
.field-help { font-size: var(--small-size); line-height: 1.45; color: var(--ink-2); }
.field-help b { color: var(--ok); font-weight: 500; }
.field-help.is-ok { color: var(--ok); }
.field-help.is-bad { color: var(--err); }
.field-help.is-live { min-height: 1.45em; }
.field-row { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.field-row .field-input { flex: 1 1 160px; width: auto; }
.field-search { position: relative; display: block; }
.field-search svg.icon { position: absolute; left: 8px; top: 50%; margin-top: -7px; width: 14px; height: 14px; color: var(--ink-2); }
.field-search .field-input { padding-left: 28px; }

/* ============ ChoiceRow ============ */
.choice {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 1px 9px;
  align-items: start; cursor: pointer;
}
.choice input { margin: 2px 0 0; width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.choice-title { font-size: 13.5px; font-weight: 600; }
.choice-note { grid-column: 2; font-size: var(--small-size); color: var(--ink-2); }
.choice-sub { display: grid; gap: 7px; margin-left: 25px; }

/* ============ StatusChip ============ */
.status-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; max-width: 100%; padding: 0 8px 0 6px;
  border: var(--border-width) solid var(--rule); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-family: var(--font-text); font-size: 12px; font-weight: 400;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.status-chip-text { overflow: hidden; text-overflow: ellipsis; }
.status-chip-icon { display: grid; place-items: center; width: 14px; height: 14px; flex: none; }
.status-chip-icon svg.icon { width: 14px; height: 14px; }
.status-chip.is-idle .status-chip-icon { color: var(--ink-2); }
.status-chip.is-run .status-chip-icon { color: var(--accent); }
.status-chip.is-wait { border: var(--border-width) dashed var(--wait); }
.status-chip.is-wait .status-chip-icon { color: var(--wait); }
.status-chip.is-ok .status-chip-icon { color: var(--ok); }
.status-chip.is-err { border-color: var(--err); }
.status-chip.is-err .status-chip-icon { color: var(--err); }
.state-dot { display: block; width: 10px; height: 10px; border: var(--border-strong) solid currentColor; border-radius: var(--radius-round); }

/* ============ ModelChip ============ */
.model-chip {
  display: inline-flex; align-items: center; gap: 3px; height: 24px; max-width: 100%; padding: 0 5px 0 7px;
  border: var(--border-width) solid var(--rule); border-radius: var(--radius); background: transparent;
  color: var(--ink); font-family: var(--font-mono); font-size: 11.5px; line-height: 1; white-space: nowrap; cursor: pointer;
}
.model-chip-text { overflow: hidden; text-overflow: ellipsis; }
.model-chip svg.icon { width: 13px; height: 13px; color: var(--ink-2); }
.model-chip:hover, .model-chip[aria-expanded="true"] { background: var(--sunk); border-color: var(--line-control); }
.model-chip:disabled { cursor: not-allowed; color: var(--ink-2); background: transparent; border-color: var(--rule); }

/* ============ ModeChip ============ */
.mode-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; max-width: 100%; padding: 0 4px;
  border: var(--border-width) solid transparent; border-radius: var(--radius); background: transparent;
  color: var(--ink-2); font-size: 12px; white-space: nowrap;
}
.mode-chip svg.icon { width: 14px; height: 14px; color: var(--accent); }
.mode-chip-text { overflow: hidden; text-overflow: ellipsis; }
button.mode-chip { cursor: pointer; }
button.mode-chip:hover, button.mode-chip[aria-expanded="true"] { background: var(--sunk); color: var(--ink); }

/* ============ StateChip ============ */
.state-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px;
  border: var(--border-width) solid var(--rule); border-radius: var(--radius);
  color: var(--ink); font-family: var(--font-text); font-size: 12px; font-weight: 400; line-height: 1;
  letter-spacing: normal; white-space: nowrap; vertical-align: middle;
}
.state-chip svg.icon { width: 13px; height: 13px; }
.state-chip.is-ok svg.icon { color: var(--ok); }
.state-chip.is-wait { border: var(--border-width) dashed var(--wait); }
.state-chip.is-wait svg.icon { color: var(--wait); }
.state-chip.is-off { color: var(--ink-2); }
.state-chip.is-err { border-color: var(--err); }
.state-chip.is-err svg.icon { color: var(--err); }

/* ============ Tag ============ */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px;
  border: var(--border-width) solid var(--line-control); border-radius: var(--radius);
  color: var(--ink); font-family: var(--font-text); font-size: 11px; font-weight: 400; white-space: nowrap;
}
.tag svg.icon { width: 12px; height: 12px; stroke-width: 2; }
.tag.is-manual { border-style: dashed; }

/* ============ RingLoader ============ */
.ring-loader { position: relative; display: inline-block; width: 14px; height: 14px; flex: none; }
.ring-loader i {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  border: var(--border-strong) solid currentColor; border-radius: var(--radius-round); opacity: 0;
}
.ring-loader i:nth-child(1) { transform: scale(.34); animation: ring-1 var(--duration-ring) linear infinite; }
.ring-loader i:nth-child(2) { transform: scale(.67); animation: ring-2 var(--duration-ring) linear infinite; }
.ring-loader i:nth-child(3) { animation: ring-3 var(--duration-ring) linear infinite; }
@keyframes ring-1 { 0% { opacity: 0; } 6%, 84% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ring-2 { 0%, 25% { opacity: 0; } 31%, 84% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ring-3 { 0%, 50% { opacity: 0; } 56%, 84% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ring-loader i { animation: none; opacity: 1; } }

/* ============ Lockup (wordmark and mark together) ============ */
.lockup { display: inline-flex; align-items: center; gap: 8px; flex: none; min-width: 0; color: var(--ink); text-decoration: none; }
.lockup-button { padding: 2px 4px 2px 2px; border: 0; border-radius: var(--radius); background: transparent; cursor: pointer; }
.lockup-button:hover, .lockup-button[aria-expanded="true"] { background: var(--sunk); }
.lockup-proportional { --s: 72px; display: inline-flex; align-items: center; gap: calc(var(--s) * .28); margin: calc(var(--s) * .25); color: var(--ink); }
.lockup-proportional svg.mark { width: var(--s); height: var(--s); }
.lockup-proportional .wordmark { font-size: calc(var(--s) * .5); }

/* ============ PaletteHeader ============ */
.palette-top { position: relative; flex: none; padding: 8px var(--pad-x); border-bottom: var(--border-width) solid var(--rule); background: var(--ground); }
.palette-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.palette-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: none; }
.palette-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }

/* ============ Message ============ */
.message-who {
  display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.2; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.message-user {
  max-width: 100%; padding: 6px 10px 7px;
  border: var(--border-width) solid var(--rule); border-radius: var(--radius); background: var(--surface);
  white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word;
}
.message-user.is-pending { border-style: dashed; border-color: var(--line-control); background: var(--sunk); }
.message-user.is-returned { color: var(--ink-2); background: var(--sunk); }
.message-assistant p + p { margin-top: 6px; }
.message-files { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.message-file {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 6px 2px 4px;
  border: var(--border-width) solid var(--rule); color: var(--ink-2); font-size: 11.5px;
}
.message-file svg.icon { width: 13px; height: 13px; color: var(--accent); }
.message-shot { display: block; width: 56px; height: 40px; padding: 0; overflow: hidden; border: var(--border-width) solid var(--rule); background: var(--sunk); cursor: zoom-in; }
.message-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.message-caption { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 4px; font-size: 11px; color: var(--ink-2); }
.message-caption svg.icon { width: 12px; height: 12px; stroke-width: 2; }
.message-caption.is-delivered { color: var(--ok); }
.message-caption.is-returned { color: var(--wait); }
.message-actions { display: flex; gap: 4px; margin-top: 4px; opacity: 0; transition: opacity var(--duration-control); }
:hover > .message-actions, .message-actions:focus-within { opacity: 1; }
.message-action {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px;
  border: var(--border-width) solid var(--rule); border-radius: var(--radius); background: var(--surface);
  color: var(--ink-2); font-size: 11px; cursor: pointer;
}
.message-action svg.icon { width: 12px; height: 12px; }
.message-action:hover { color: var(--ink); border-color: var(--line-control); }
.message-action.is-copied { color: var(--ok); border-color: var(--ok); }

/* ============ StepList ============ */
.steps { min-width: 0; border: var(--border-width) solid var(--rule); background: var(--surface); }
.steps-head { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-bottom: var(--border-width) solid var(--rule-2); font-size: 12px; color: var(--ink-2); }
.steps-head .mono { font-size: 11px; }
.step-list { list-style: none; margin: 0; padding: 1px 10px; }
.step {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: start;
  padding: 6px 0; border-top: var(--border-width) solid var(--rule-2); font-size: 12.5px; line-height: 1.4;
}
.step:first-child { border-top: 0; }
button.step {
  width: 100%; margin: 0; border-left: 0; border-right: 0; border-bottom: 0;
  background: transparent; color: inherit; text-align: left; cursor: pointer;
}
.step-icon { display: grid; place-items: center; width: 16px; height: 17px; }
.step-icon svg.icon { width: 15px; height: 15px; stroke-width: 1.9; }
.step-icon .state-dot { width: 9px; height: 9px; }
.step.is-done .step-icon { color: var(--ok); }
.step.is-run .step-icon { color: var(--accent); }
.step.is-wait .step-icon { color: var(--wait); }
.step.is-err .step-icon { color: var(--err); }
.step.is-skip { color: var(--ink-2); }
.step-text { min-width: 0; overflow-wrap: anywhere; }
.step-name { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.step-cost { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 11px; line-height: 1.6; color: var(--ink-2); white-space: nowrap; }
.step.is-err .step-cost { color: var(--err); }
.step.is-wait .step-cost { color: var(--wait); }
.step-cost svg.icon { width: 13px; height: 13px; transition: transform var(--duration-control); }
.step[aria-expanded="true"] .step-cost svg.icon { transform: rotate(180deg); }
.step.is-appearing { animation: step-in var(--duration-appear) var(--ease-appear); }
@keyframes step-in { from { opacity: 0; transform: translateY(var(--appear-shift)); } to { opacity: 1; transform: none; } }
.step-details { padding: 0 10px 9px; border-top: var(--border-width) solid var(--rule-2); }
.step-details .label { display: block; margin: 8px 0 4px; }
.step-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 10px; border-top: var(--border-width) solid var(--rule-2); font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.step-foot:empty { display: none; }
.step-error { margin: 0; padding: 8px 10px; border-top: var(--border-err) solid var(--err); background: var(--err-wash); color: var(--ink); font-size: 12.5px; line-height: 1.45; }
.step-error-list { list-style: none; margin: 0; padding: 0 10px 8px; background: var(--err-wash); color: var(--ink); font-size: 12px; line-height: 1.5; }
.step-error-list li { display: flex; flex-wrap: wrap; gap: 8px; padding: 3px 0; overflow-wrap: anywhere; }
.step-error-path { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--err); word-break: break-all; }

/* ============ Card ============ */
.card { display: grid; gap: var(--gap-card); min-width: 0; padding: var(--pad-card); border: var(--border-width) solid var(--rule); background: var(--surface); }
.card.is-wait { border: var(--border-strong) dashed var(--wait); padding: calc(var(--pad-card) - .5px); }
.card.is-err { border: var(--border-err) solid var(--err); padding: calc(var(--pad-card) - 1px); }
.card.is-rejected { color: var(--ink-2); }
.card:focus-visible { outline-offset: 3px; }
.card-head { display: flex; align-items: flex-start; gap: 7px; min-width: 0; font-weight: 600; line-height: 1.35; }
.card-head svg.icon { width: 17px; height: 17px; margin-top: 1px; }
.card.is-ok > .card-head svg.icon { color: var(--ok); }
.card.is-wait > .card-head svg.icon { color: var(--wait); }
.card.is-err > .card-head svg.icon { color: var(--err); }
.card.is-rejected > .card-head svg.icon { color: var(--ink-2); }
.card-meta { margin-left: auto; font-family: var(--font-mono); font-size: 11px; line-height: 1.6; font-weight: 400; color: var(--ink-2); white-space: nowrap; }
.card-note { font-size: 11.5px; line-height: 1.45; color: var(--ink-2); }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.card-result { font-size: 12.5px; }
.card-result .button-text { margin-left: 4px; }
.card-fix-head { font-size: 12.5px; font-weight: 600; }
.card-fix { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 12.5px; }
.card details summary { cursor: pointer; }
.receipt { display: flex; align-items: center; gap: 6px; padding: 2px; font-size: 12px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.receipt svg.icon { width: 14px; height: 14px; color: var(--ok); }

/* ============ KeyValue ============ */
.key-value { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; margin: 0; font-size: .96em; }
.key-value dt { color: var(--ink-2); }
.key-value dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ============ ConfirmCard (a waiting Card whose answers stack) ============ */
.confirm .card-actions { display: grid; }
.confirm-question { font-weight: 600; }

/* ============ UndoKeys ============ */
.undo-keys { display: grid; gap: 7px; padding-top: 9px; border-top: var(--border-width) solid var(--rule-2); }
.undo-keys-head { font-size: 12.5px; }
.undo-keys-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.undo-keys-list li { display: grid; gap: 4px; justify-items: start; }
.undo-keys-list span { font-size: 11px; color: var(--ink-2); }
.undo-keys-list .undo-keys-arrow { align-self: start; padding-top: 3px; color: var(--ink-3); font-size: 12px; }

/* ============ Banner ============ */
.banner {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 2px 9px;
  padding: var(--pad-card); border-bottom: var(--border-width) solid var(--rule);
  background: var(--accent-wash); color: var(--ink);
}
.banner.is-boxed { border: var(--border-width) solid var(--rule); }
.banner-icon { width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.banner-text { min-width: 0; }
.banner-text b { display: block; font-weight: 600; }
.banner-text span { display: block; font-size: 12px; color: var(--ink-2); }
.banner-actions { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 7px; }
.banner-news { grid-column: 2; margin: 8px 0 0; padding: 8px 0 0 16px; border-top: var(--border-width) solid var(--rule); font-size: 12px; display: grid; gap: 3px; }
.banner.is-must { background: var(--wait-wash); border-bottom: var(--border-strong) dashed var(--wait); }
.banner.is-must.is-boxed { border: var(--border-strong) dashed var(--wait); }
.banner.is-must .banner-icon { color: var(--wait); }
.banner.is-installing { background: var(--sunk); }
.banner.is-installing .banner-icon { color: var(--ok); }
.banner-progress { grid-column: 2; display: flex; align-items: center; gap: 8px; margin-top: 7px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.banner-progress i { display: block; flex: 1; height: 4px; background: var(--ok); }
.banner-chip {
  height: 24px; padding: 0 7px; border: var(--border-width) solid var(--accent); border-radius: var(--radius);
  background: transparent; color: var(--accent); font-family: var(--font-mono); font-size: 11.5px; line-height: 1; cursor: pointer;
}

/* ============ Attachment ============ */
.attachment-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.attachment {
  position: relative; display: flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0;
  padding: 4px 28px 4px 4px; border: var(--border-width) solid var(--rule); border-radius: var(--radius); background: var(--surface);
}
.attachment.is-inert { padding-right: 10px; }
.attachment-thumb { display: block; width: 38px; height: 38px; flex: none; border: var(--border-width) solid var(--rule); object-fit: cover; }
.attachment-glyph { width: 38px; height: 38px; flex: none; display: grid; place-items: center; background: var(--sunk); color: var(--accent); }
.attachment-glyph svg.icon { width: 20px; height: 20px; }
.attachment-text { display: grid; min-width: 0; }
.attachment-name { max-width: 176px; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-meta { font-size: 11px; color: var(--ink-2); }
.attachment-remove {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--ink-2); cursor: pointer;
}
.attachment-remove:hover { background: var(--sunk); color: var(--ink); }
.attachment-remove svg.icon { width: 13px; height: 13px; stroke-width: 2; }
.attachment.is-refused { flex-basis: 100%; border: var(--border-strong) dashed var(--err); }
.attachment.is-refused .attachment-glyph { color: var(--err); background: var(--err-wash); }
.attachment.is-refused .attachment-name { max-width: none; }
.attachment.is-refused .attachment-meta { color: var(--err); white-space: normal; }
.attachment-none { font-size: 12px; color: var(--ink-2); }

/* ============ Composer ============ */
.composer { padding: 8px var(--pad-x) 6px; border-top: var(--border-width) solid var(--rule); }
.composer-box { border: var(--border-width) solid var(--line-control); border-radius: var(--radius); background: var(--surface); }
.composer-box:focus-within { outline: var(--focus-width) solid var(--accent); outline-offset: 1px; }
.composer-box.is-drop { border-color: var(--accent); background: var(--accent-wash); }
.composer-input {
  display: block; width: 100%; min-height: 46px; max-height: 150px; resize: none; padding: 7px 9px 2px;
  border: 0; outline: 0; background: transparent; color: var(--ink);
  font-family: var(--font-text); font-size: var(--text-size); line-height: var(--text-lh);
}
.composer-input::placeholder { color: var(--ink-2); opacity: 1; }
.composer-input:disabled { cursor: not-allowed; }
.composer-tools { display: flex; align-items: center; gap: 3px; padding: 2px 4px 4px 9px; }
.composer-hint { flex: 1; min-width: 0; font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-hint.is-flash { color: var(--accent); }
.composer-snap {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 7px;
  border: var(--border-width) solid transparent; border-radius: var(--radius); background: transparent;
  color: var(--ink-2); font-size: 12px; white-space: nowrap; cursor: pointer;
}
.composer-snap:hover { background: var(--sunk); color: var(--ink); }
.composer-snap svg.icon { width: 15px; height: 15px; }
.composer-snap.is-busy { color: var(--accent); border-color: var(--accent); }
.composer-clip.is-on { color: var(--accent); border-color: var(--accent); }
.composer-send {
  width: var(--control-h); height: var(--control-h); flex: none; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); cursor: pointer;
}
.composer-send svg.icon { width: 17px; height: 17px; stroke-width: 2; }
.composer-send.is-stop { background: var(--err); }
.composer-send:disabled, .composer-snap:disabled, .composer-clip:disabled { background: transparent; color: var(--ink-3); cursor: not-allowed; }
.composer-send:disabled { border: var(--border-width) dashed var(--line-control); }
.composer-foot { padding: 0 var(--pad-x) 8px; font-size: 11px; line-height: 1.35; color: var(--ink-2); }
@media (max-width: 390px) {
  .composer-hint { visibility: hidden; }
  .composer-snap span { display: none; }
}

/* ============ EmptyState ============ */
.empty-title { font-size: var(--panel-title-size); line-height: var(--panel-title-lh); font-weight: var(--panel-title-weight); }
.empty-text { margin-top: 3px; color: var(--ink-2); }
.ready-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; padding: 9px 10px; border: var(--border-width) solid var(--rule); background: var(--surface); font-size: 12.5px; }
.ready-list dt { color: var(--ink-2); }
.ready-list dd { margin: 0; display: flex; align-items: center; gap: 5px; min-width: 0; }
.ready-list dd svg.icon { width: 14px; height: 14px; color: var(--ok); }
.examples { display: grid; gap: 5px; }
.examples .label { margin-bottom: 1px; }
.example {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 5px 10px;
  border: var(--border-width) solid var(--rule); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); font-size: 13px; text-align: left; cursor: pointer;
}
.example:hover { border-color: var(--line-control); }
.example svg.icon { width: 18px; height: 18px; color: var(--accent); }
.example.is-demo { border-style: dashed; color: var(--ink-2); }
.hints { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12px; color: var(--ink-2); }
.hints li { display: flex; gap: 8px; align-items: flex-start; }
.hints svg.icon { width: 15px; height: 15px; margin-top: 1px; }

/* ============ Thought ============ */
.thought { min-width: 0; }
.thought-head {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 0;
  border: 0; background: transparent; color: var(--ink-2); font-size: 12px; text-align: left; cursor: pointer;
}
.thought-head:hover { color: var(--ink); }
.thought-head svg.icon { width: 14px; height: 14px; transition: transform var(--duration-control); }
.thought-head[aria-expanded="true"] svg.icon { transform: rotate(180deg); }
.thought-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thought-time { flex: none; font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.thought-body {
  max-height: 168px; margin-top: 2px; padding: 6px 10px; overflow-y: auto; overflow-x: hidden;
  border: var(--border-width) solid var(--rule-2); background: var(--surface); color: var(--ink-2);
  font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word;
}

/* ============ ActivityLine ============ */
.activity-line { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 2px 6px; color: var(--ink-2); font-size: 12px; line-height: 1.4; }
.activity-line .ring-loader { color: var(--accent); }
.activity-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { flex: none; font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.activity-policy { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; color: var(--wait); }
.activity-policy > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) {
  .activity-line { flex-wrap: wrap; }
  .activity-policy { flex: 1 1 100%; order: 1; }
  .activity-policy > span { white-space: normal; overflow: visible; text-overflow: clip; }
}

/* ============ Prose (the model's Markdown; the renderer's md-* names are kept) ============ */
.prose { font-size: var(--text-size); line-height: 1.55; overflow-wrap: break-word; word-break: break-word; }
.prose p { margin: 0 0 8px; }
.prose p:last-child { margin-bottom: 0; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose code { padding: 1px 4px; border-radius: var(--radius); background: var(--sunk); font-family: var(--font-mono); font-size: .92em; }
.prose .md-h { margin: 14px 0 6px; font-weight: 600; line-height: 1.35; }
.prose .md-h1 { font-size: calc(var(--text-size) + 3px); }
.prose .md-h2 { font-size: calc(var(--text-size) + 2px); }
.prose .md-h3 { font-size: calc(var(--text-size) + 1px); margin-top: 12px; }
.prose .md-h4 { font-size: var(--text-size); margin-top: 10px; }
.prose .md-h + .md-h { margin-top: 4px; }
.prose .md-list { margin: 0 0 8px; padding-left: 20px; }
.prose ul.md-list { list-style-type: disc; }
.prose .md-list ul.md-list { list-style-type: circle; }
.prose ol.md-list { padding-left: 22px; list-style-type: decimal; }
.prose .md-list li { margin: 0 0 3px; }
.prose .md-list li:last-child { margin-bottom: 0; }
.prose .md-list li > p { margin: 0; }
.prose .md-loose > li { margin-bottom: 6px; }
.prose .md-list li > .md-list { margin: 3px 0 0; }
.prose .md-list li::marker { color: var(--ink-2); }
.prose ol.md-list > li::marker { font-variant-numeric: tabular-nums; }
.prose li.md-task { display: flex; align-items: flex-start; gap: 7px; margin-left: -18px; list-style: none; }
.md-check {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 14px; height: 14px; margin-top: 3px;
  border: var(--border-strong) solid var(--line-control); border-radius: var(--radius); background: var(--surface); color: var(--on-accent);
}
.md-check[data-checked="true"] { border-color: var(--accent); background: var(--accent); }
.md-check svg.icon { width: 10px; height: 10px; stroke-width: 3; }
.md-task-body { flex: 1; min-width: 0; }
.md-task[data-checked="true"] > .md-task-body { color: var(--ink-2); }
.prose .md-quote { margin: 0 0 8px; padding: 6px 10px; border-left: var(--border-strong) solid var(--line-control); }
.prose .md-quote > :last-child { margin-bottom: 0; }
.md-quote-label { margin-bottom: 2px; font-family: var(--font-mono); font-size: var(--label-size); letter-spacing: var(--label-tracking); text-transform: uppercase; color: var(--ink-2); }
.prose .md-alert-warning, .prose .md-alert-caution { border-left-color: var(--wait); background: var(--wait-wash); }
.md-alert-warning > .md-quote-label, .md-alert-caution > .md-quote-label { color: var(--wait); }
.prose .md-hr { height: 0; margin: 12px 0; border: 0; border-top: var(--border-width) solid var(--rule); }
.prose del { color: var(--ink-2); }
.prose .md-pre {
  margin: 0 0 8px; padding: 8px 9px; overflow-x: auto; border: var(--border-width) solid var(--rule); background: var(--sunk);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5; white-space: pre; word-break: normal; overflow-wrap: normal; tab-size: 4;
}
.prose .md-pre code { padding: 0; background: none; font: inherit; }
.prose .md-url { color: var(--ink-2); font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; word-break: normal; -webkit-user-select: all; user-select: all; }
.prose .md-math {
  padding: 0 3px; background: var(--sunk); font-family: var(--font-math); font-size: 1.07em; line-height: 1;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.prose .md-math-block { display: block; margin: 0 0 8px; padding: 8px 10px; overflow-x: auto; font-size: 1.14em; line-height: 1.5; white-space: nowrap; }
.prose .md-math sup, .prose .md-math sub { font-size: .72em; line-height: 0; }
.prose .md-table-wrap {
  width: -webkit-fit-content; width: fit-content; max-width: 100%; margin: 0 0 8px; overflow-x: auto; overflow-y: hidden;
  border: var(--border-width) solid var(--rule); background: var(--surface);
}
.prose .md-table { width: 100%; border-collapse: collapse; border-spacing: 0; font-size: 12.5px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.prose .md-table th, .prose .md-table td { padding: 5px 8px; border-bottom: var(--border-width) solid var(--rule-2); text-align: left; vertical-align: top; word-break: normal; overflow-wrap: normal; }
.prose .md-table th + th, .prose .md-table td + td { border-left: var(--border-width) solid var(--rule-2); }
.prose .md-table tbody tr:last-child td { border-bottom: 0; }
.prose .md-table th { background: var(--sunk); font-weight: 600; }
.prose .md-table td strong { font-weight: 600; }
.prose .md-table .md-num { text-align: right; white-space: nowrap; }
.prose .md-table .md-center { text-align: center; }
.prose .md-plain { white-space: pre-wrap; }
.prose .md-table-wrap::-webkit-scrollbar, .prose .md-pre::-webkit-scrollbar, .prose .md-math-block::-webkit-scrollbar { height: 6px; }
.prose .md-table-wrap::-webkit-scrollbar-track, .prose .md-pre::-webkit-scrollbar-track, .prose .md-math-block::-webkit-scrollbar-track { background: transparent; }
.prose .md-table-wrap::-webkit-scrollbar-thumb, .prose .md-pre::-webkit-scrollbar-thumb, .prose .md-math-block::-webkit-scrollbar-thumb { background: var(--line-control); }
.caret::after { content: ""; display: inline-block; width: 2px; height: 14px; margin-left: 3px; background: var(--accent); vertical-align: -3px; animation: caret-blink 1s step-end infinite; }
@keyframes caret-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ============ Screenshot (a figure in the stream and the full-size view) ============ */
.shot { margin: 0; }
.shot-button { display: block; width: 100%; padding: 0; overflow: hidden; border: var(--border-width) solid var(--rule); background: var(--sunk); cursor: zoom-in; }
.shot-button:hover { border-color: var(--line-control); }
.shot-button img { display: block; width: 100%; max-width: 100%; height: auto; }
.shot figcaption { margin-top: 5px; font-size: 11.5px; color: var(--ink-2); }
dialog.lightbox { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; padding: 0; border: 0; background: transparent; color: var(--ink); }
.lightbox-panel { display: flex; flex-direction: column; gap: 8px; width: 100%; height: 100%; padding: 12px; background: var(--ground); }
.lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; }
.lightbox-caption { min-width: 0; font-size: 12.5px; color: var(--ink-2); overflow-wrap: break-word; }
.lightbox-image { flex: 1; min-height: 0; max-width: 100%; object-fit: contain; border: var(--border-width) solid var(--rule); background: var(--sunk); }

/* ============ OutputRow (a PDF the model wrote) ============ */
.output-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-top: var(--border-width) solid var(--rule-2); background: var(--accent-wash); }
.output-glyph { display: grid; width: 24px; height: 24px; flex: none; place-items: center; color: var(--accent); }
.output-texts { flex: 1 1 150px; min-width: 0; display: grid; }
.output-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.output-meta { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.output-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.output-note { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; font-size: 11.5px; color: var(--ink-2); overflow-wrap: break-word; }

/* ============ Popover ============ */
.popover {
  position: absolute; z-index: 30; top: calc(100% - 4px); left: var(--pad-x); width: 300px; max-width: calc(100% - 20px);
  padding: 10px 10px 12px; border: var(--border-width) solid var(--line-control); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
.popover.is-end { left: auto; right: var(--pad-x); width: 320px; }
.popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.popover-title { font-size: 13px; font-weight: 600; }
.popover-list { display: grid; gap: 4px; margin: 8px 0 0; }
.popover-list > div { display: flex; justify-content: space-between; gap: 12px; }
.popover-list dt { font-size: 12px; color: var(--ink-2); }
.popover-list dd { margin: 0; font-family: var(--font-mono); font-size: 11.5px; text-align: right; overflow-wrap: anywhere; }
.popover-note { margin-top: 8px; font-size: 11.5px; line-height: 1.45; color: var(--ink-2); }
.popover-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.popover-body { display: grid; gap: 4px; margin-top: 8px; max-height: 190px; overflow-y: auto; }
.popover-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.popover-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popover-row span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.popover-empty { font-size: 12px; color: var(--ink-2); }
@media (max-width: 400px) { .popover, .popover.is-end { left: 8px; right: auto; width: calc(100% - 16px); max-width: none; } }

/* ============ Drawer (the chats list) ============ */
.drawer-scrim { position: absolute; z-index: 34; top: 0; right: 0; bottom: 0; left: 0; background: var(--overlay); animation: scrim-in var(--duration-appear) ease; }
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: absolute; z-index: 35; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; width: 320px; max-width: 100%;
  border-right: var(--border-width) solid var(--line-control); background: var(--ground);
  animation: drawer-in var(--duration-appear) var(--ease-appear);
}
@keyframes drawer-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 380px) { .drawer { width: 100%; border-right: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; padding: 10px 8px 8px var(--pad-x); border-bottom: var(--border-width) solid var(--rule); }
.drawer-title { font-size: 15px; font-weight: 600; }
.drawer-create { display: grid; gap: 6px; flex: none; padding: 10px var(--pad-x) 8px; }
.create-choice {
  display: grid; gap: 2px; padding: 8px 10px; border: var(--border-width) solid var(--rule); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-size: 13px; text-align: left; cursor: pointer;
}
.create-choice:hover { border-color: var(--line-control); }
.create-choice.is-primary { border-color: var(--accent); background: var(--accent-wash); }
.create-choice:disabled { cursor: not-allowed; color: var(--ink-2); border-style: dashed; background: transparent; }
.create-choice-row { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.create-choice-row svg.icon { width: 16px; height: 16px; color: var(--accent); }
.create-choice-note { font-size: 12px; line-height: 1.4; color: var(--ink-2); }
.drawer-search { flex: none; margin: 0 var(--pad-x) 8px; }
.drawer-list { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 6px 12px; }
.chat-group { display: block; padding: 10px 4px 4px; }
.chat-row { display: flex; align-items: center; gap: 2px; min-width: 0; border: var(--border-width) solid transparent; border-radius: var(--radius); }
.chat-row:hover { background: var(--sunk); }
.chat-row.is-active { border-color: var(--rule); background: var(--accent-wash); }
.chat-open { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 7px 4px 7px 8px; border: 0; background: transparent; color: var(--ink); font-size: 13px; text-align: left; cursor: pointer; }
.chat-open svg.icon { width: 16px; height: 16px; color: var(--ink-2); }
.chat-row.is-active .chat-open svg.icon { color: var(--accent); }
.chat-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-meta { display: inline-flex; flex: none; align-items: center; }
.chat-time { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chat-status { display: inline-flex; align-items: center; gap: 5px; flex: none; color: var(--accent); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chat-status svg.icon { width: 13px; height: 13px; }
.chat-status .ring-loader { width: 12px; height: 12px; }
.chat-status.is-wait { color: var(--wait); }
.chat-status.is-ok { color: var(--ok); }
.chat-status.is-err { color: var(--err); }
.chat-warn { display: inline-flex; flex: none; align-items: center; margin-right: 5px; color: var(--wait); }
.chat-warn svg.icon { width: 13px; height: 13px; }
.chat-actions { display: flex; align-items: center; gap: 2px; flex: none; padding-right: 4px; opacity: 0; }
.chat-row:hover .chat-actions, .chat-actions:focus-within, .chat-actions.is-open { opacity: 1; }
.chat-ask { display: flex; align-items: center; gap: 6px; padding-right: 6px; font-size: 11px; color: var(--ink-2); }
.chat-rename {
  flex: 1; min-width: 0; height: 28px; margin: 4px 6px; padding: 0 7px; border: var(--border-width) solid var(--accent);
  border-radius: var(--radius); outline: 0; background: var(--surface); color: var(--ink); font-size: 13px;
}
.chat-empty { padding: 14px 6px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }

/* ============ ModelPicker ============ */
.model-options { display: grid; gap: 2px; margin-top: 8px; max-height: 260px; overflow-y: auto; }
.model-option {
  display: block; width: 100%; padding: 6px 8px; border: var(--border-width) solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--ink); font-size: 12px; text-align: left; cursor: pointer;
}
.model-option:hover { background: var(--sunk); border-color: var(--rule); }
.model-option[aria-selected="true"] { background: var(--accent-wash); border-color: var(--rule); }
.model-option-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.model-option-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-option-mark { flex: none; color: var(--accent); }
.model-option[data-missing="true"] .model-option-mark { color: var(--wait); }
.model-option-id { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-option-desc { display: -webkit-box; margin-top: 2px; font-size: 11px; line-height: 1.35; color: var(--ink-2); overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ============ SettingsSheet ============ */
dialog.sheet { width: 460px; max-width: 100vw; max-height: 100vh; padding: 0; border: 0; background: transparent; color: var(--ink); }
dialog.sheet::backdrop, dialog.lightbox::backdrop { background: var(--overlay); }
dialog.fallback-open { display: block; position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; background: var(--overlay); }
.sheet-panel { display: flex; flex-direction: column; max-height: 100vh; width: 460px; max-width: 100vw; margin: 0 auto; border: var(--border-width) solid var(--line-control); background: var(--ground); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; padding: 10px 10px 8px; border-bottom: var(--border-width) solid var(--rule); }
.sheet-title { font-size: 15px; font-weight: var(--panel-title-weight); line-height: var(--panel-title-lh); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; }
.sheet-section { display: grid; gap: 8px; padding: 12px 10px; border-bottom: var(--border-width) solid var(--rule); }
.sheet-help { display: grid; gap: 6px; padding: 8px 9px; border: var(--border-width) solid var(--rule); background: var(--surface); color: var(--ink-2); font-size: var(--small-size); line-height: 1.5; }
.sheet-help p { margin: 0; overflow-wrap: anywhere; }
.sheet-help code { display: inline-block; max-width: 100%; margin-top: 2px; padding: 2px 5px; background: var(--sunk); color: var(--ink); font-size: var(--code-size); overflow-wrap: anywhere; word-break: break-all; }
.cli-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; align-items: center; padding: 7px 8px; border: var(--border-width) solid var(--rule); background: var(--surface); }
.cli-row > b { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.cli-row > b svg.icon { width: 14px; height: 14px; color: var(--ok); }
.cli-row small { grid-column: 1; font-size: 11.5px; color: var(--ink-2); }
.cli-row .card-actions { grid-column: 2; grid-row: 1 / span 2; }
.cli-row.is-soon { border-style: dashed; color: var(--ink-2); }
.cli-row.is-soon > b { color: var(--ink); }
.soon-tag { padding: 4px 6px; border: var(--border-width) dashed var(--line-control); color: var(--ink-2); font-family: var(--font-mono); font-size: var(--label-size); line-height: 1; letter-spacing: var(--label-tracking); text-transform: uppercase; }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: none; padding: 10px; }
.sheet-spacer { flex: 1; }
.sheet-status { min-height: 14px; padding: 0 10px; font-size: 12px; text-align: right; color: var(--ok); }
.sheet-status.is-bad { color: var(--err); }
.sheet-legal { padding: 0 10px 8px; font-size: 11px; color: var(--ink-2); }

/* ============ Toast ============ */
.toast {
  position: fixed; right: var(--pad-x); bottom: 12px; z-index: 50; max-width: 340px; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px 9px 12px; border: var(--border-width) solid var(--line-control); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-size: 12px; line-height: 1.45;
  opacity: 0; transform: translateY(var(--appear-shift)); visibility: hidden; pointer-events: none;
  transition: opacity var(--duration-appear), transform var(--duration-appear), visibility 0s linear var(--duration-appear);
}
.toast.is-visible { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.toast.is-actionable { pointer-events: auto; }
.toast-text { flex: 1; min-width: 0; overflow-wrap: break-word; }
@media (max-width: 400px) { .toast { left: 10px; max-width: none; } }

/* ============ VersionTree (drawn by brand/js/vtree.js in the text colour) ============ */
canvas.version-tree { display: block; flex: none; width: 44px; height: 56px; color: var(--ink); }
.version-mark { display: flex; align-items: flex-start; gap: 12px; padding-top: 14px; border-top: var(--border-width) solid var(--rule); font-size: 13px; color: var(--ink-2); }
.version-mark canvas.version-tree { width: 36px; height: 46px; }
.about-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.about-line canvas.version-tree { width: 16px; height: 20px; }

/* ============ TopNav ============ */
.top-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding-top: 14px; padding-bottom: 14px;
  padding-left: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  padding-right: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  border-bottom: var(--border-width) solid var(--rule); background: var(--ground); font-size: 14px;
}
.top-nav.is-secondary { padding-top: 8px; padding-bottom: 8px; background: var(--sunk); }
.top-nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin-left: auto; }
.top-nav.is-secondary .top-nav-links { margin-left: 0; }
@media (max-width: 819px) {
  .top-nav > .button { margin-left: auto; }
  .top-nav-links { order: 1; flex-basis: 100%; margin-left: 0; }
}

/* ============ LegalFooter ============ */
.legal-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 18px;
  padding-top: 14px; padding-bottom: 14px;
  padding-left: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  padding-right: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  border-top: var(--border-width) solid var(--rule);
  font-family: var(--font-mono); font-size: 11px; line-height: 1.4; color: var(--ink-2);
}
.legal-footer b { color: var(--ink); font-weight: 400; }

/* ============ Section ============ */
.section { display: grid; gap: 14px; min-width: 0; padding-top: 18px; border-top: var(--border-strong) solid var(--ink); }
.section-title { font-family: var(--font-display); font-size: var(--block-size); line-height: var(--block-lh); font-weight: var(--block-weight); letter-spacing: var(--block-tracking); }
.section-lead { max-width: 62ch; font-size: 14px; color: var(--ink-2); }

/* ============ Table ============ */
.table-wrap { overflow-x: auto; border-top: var(--border-strong) solid var(--ink); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 10px 14px 10px 0; border-bottom: var(--border-width) solid var(--rule); text-align: left; white-space: nowrap;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.3; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.table td { padding: 12px 14px 12px 0; border-bottom: var(--border-width) solid var(--rule-2); vertical-align: top; }
.table td small { display: block; font-size: 12px; color: var(--ink-2); }
.table .mono { font-size: 13px; white-space: nowrap; }
.table .is-wrap { white-space: normal; overflow-wrap: anywhere; word-break: break-all; }

/* ============ NoticeStrip ============ */
.notice-strip {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px;
  border: var(--border-width) solid var(--rule); background: var(--surface); color: var(--ink); font-size: 14px; line-height: 1.45;
}
.notice-strip svg.icon { width: 17px; height: 17px; margin-top: 1px; }
.notice-strip.is-ok svg.icon { color: var(--ok); }
.notice-strip.is-wait { background: var(--wait-wash); border: var(--border-strong) dashed var(--wait); }
.notice-strip.is-wait svg.icon { color: var(--wait); }
.notice-strip.is-err { background: var(--err-wash); border: var(--border-err) solid var(--err); }
.notice-strip.is-err svg.icon { color: var(--err); }
.notice-strip.is-bar {
  border-left: 0; border-right: 0; border-top: 0;
  padding-left: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  padding-right: max(var(--gutter), calc((100% - var(--wrap)) / 2));
}

/* ============ DownloadFile (file, checksum, check command) ============ */
.download-file { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: var(--border-strong) solid var(--ink); border-bottom: var(--border-width) solid var(--rule); }
.download-file .mono { display: block; font-size: 14px; overflow-wrap: anywhere; }
.download-file small { display: block; font-size: 13px; color: var(--ink-2); }
.copy-value { display: grid; gap: 8px; min-width: 0; }
.copy-value-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.copy-value code { display: block; padding: 10px 12px; border: var(--border-width) solid var(--rule); background: var(--surface); font-size: var(--code-size); line-height: var(--code-lh); overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }
.download-command { font-size: 13px; color: var(--ink-2); }
.download-command code { display: block; margin-top: 4px; padding: 8px 10px; border: var(--border-width) solid var(--rule); background: var(--surface); color: var(--ink); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }

/* ============ NumberedSteps ============ */
.numbered-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; }
.numbered-steps li { counter-increment: step; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: var(--border-width) solid var(--rule-2); font-size: 14px; }
.numbered-steps li::before { content: counter(step); font-family: var(--font-mono); font-size: 12px; line-height: 1.7; color: var(--accent); }

/* ============ NewsList ============ */
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.news-list li { position: relative; padding-left: 16px; }
.news-list li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: var(--border-strong); background: var(--ink-2); }

/* ============ WorkCycle (the site's three steps, drawn with palette-scale fragments) ============ */
.work-cycle { list-style: none; margin: 0 0 0 12px; padding: 0; display: grid; border-left: var(--border-strong) solid var(--ink); }
.work-cycle > li { position: relative; display: grid; gap: 8px; padding: 0 0 22px 26px; }
.work-cycle > li:last-child { padding-bottom: 0; }
.work-cycle-n {
  position: absolute; left: -13px; top: -2px; width: 24px; height: 24px; border: var(--border-strong) solid var(--ink);
  border-radius: var(--radius-round); background: var(--ground); font-family: var(--font-text); font-size: 12px; line-height: 21px; font-weight: 500; text-align: center;
}
.work-cycle b { font-size: 15px; }
.work-cycle .attachment { align-self: start; width: max-content; max-width: 100%; }
.work-cycle .attachment-name { max-width: none; }
.work-cycle .message-user { align-self: start; width: max-content; font-size: 14px; }
.work-cycle .card { max-width: 420px; font-size: 13px; }

/* ============ Capabilities ============ */
.capabilities { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: var(--border-width) solid var(--rule); }
.capabilities li { display: grid; gap: 10px; align-content: start; padding: 16px 20px; border-right: var(--border-width) solid var(--rule); border-bottom: var(--border-width) solid var(--rule); font-size: 14px; }
.capabilities svg.icon { width: 24px; height: 24px; color: var(--accent); stroke-width: 1.5; }
@media (min-width: 560px) { .capabilities { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .capabilities { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ============ Stat ============ */
.stat { display: grid; gap: 4px; padding: 14px 0; border-top: var(--border-strong) solid var(--ink); }
.stat-value { font-family: var(--font-display); font-size: var(--heading-size); line-height: var(--heading-lh); font-weight: var(--heading-weight); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--ink-2); }

/* ============ PlanSketch ============ */
.plan-sketch { display: block; width: 100%; height: auto; }
.plan-sketch text { font-family: var(--font-mono); font-size: 9px; fill: var(--ink-2); }
.plan-fence { stroke: var(--ink); stroke-width: 1.5; }
.plan-tick { stroke: var(--ink); stroke-width: 7; }
.plan-crowns circle { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 1.5; }
.plan-dots circle { fill: var(--ink); }
.plan-num text { fill: var(--ink); font-size: 10px; }
.plan-dim path { stroke: var(--ink-2); stroke-width: .8; fill: none; }
.plan-slab { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 1.3; }
.plan-hatch { stroke: var(--accent); stroke-width: .6; opacity: .7; }
.plan-porch { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.plan-todo { fill: none; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }

/* ============ CodeBlock ============ */
.code-block {
  margin: 0; padding: 8px 9px; border: var(--border-width) solid var(--rule); background: var(--sunk); color: var(--ink);
  font-family: var(--font-mono); font-size: var(--code-size); line-height: var(--code-lh); white-space: pre-wrap; overflow-wrap: anywhere;
}
.code-block.is-scroll { max-height: 220px; overflow: auto; }
.code-block-note { display: block; color: var(--err); }

/* ============ KeyList ============ */
.key-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 14px; align-items: baseline; }
.key-list dt { white-space: nowrap; }
.key-list dd { margin: 0; color: var(--ink-2); }

/* ============ ModelList (brand book only: a later wave) ============ */
.model-list { display: grid; border: var(--border-width) solid var(--rule); background: var(--surface); }
.model-list-group { padding: 6px 8px 3px; border-top: var(--border-width) solid var(--rule); font-family: var(--font-mono); font-size: 11px; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.model-list-group:first-child { border-top: 0; }
.model-row { display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; gap: 0 8px; align-items: center; padding: 5px 8px; border-top: var(--border-width) solid var(--rule-2); cursor: pointer; }
.model-list-group + .model-row { border-top: 0; }
.model-row input { margin: 0; width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; }
.model-row-name { display: grid; min-width: 0; }
.model-row-name b { font-weight: 500; font-size: 12.5px; }
.model-row-name code { font-size: 11px; color: var(--ink-2); overflow-wrap: anywhere; }
.model-row-price { text-align: right; font-family: var(--font-mono); font-size: 11px; line-height: 1.35; color: var(--ink-2); white-space: nowrap; }
.model-row-price b { display: block; color: var(--ink); font-weight: 400; font-size: 11.5px; }
.model-row.is-on { background: var(--accent-wash); }
.model-list-none { padding: 8px; font-size: 12px; color: var(--ink-2); }

/* ============ ModelResult (brand book only: model search, a later wave) ============ */
.model-results { display: grid; gap: 6px; min-width: 0; }
.model-results-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-2); }
.model-result { display: grid; grid-template-columns: 16px 72px minmax(0, 1fr); gap: 8px 9px; align-items: start; min-width: 0; padding: 8px; border: var(--border-width) solid var(--rule); background: var(--surface); cursor: pointer; }
.model-result input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.model-result.is-selected { border: 2px solid var(--accent); padding: 7px; }
.model-result.is-manual { border-style: dashed; cursor: default; }
.model-result.is-manual input { cursor: not-allowed; }
.model-result-preview { position: relative; display: block; width: 72px; height: 54px; background: var(--sunk); }
.model-result-preview svg { display: block; width: 100%; height: 100%; fill: none; stroke: var(--ink-2); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.model-result-format { position: absolute; left: 0; bottom: 0; padding: 1px 4px; background: var(--ink); color: var(--ground); font-family: var(--font-mono); font-size: 11px; line-height: 1.35; }
.model-result-body { display: grid; gap: 1px; min-width: 0; }
.model-result-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.model-result-meta { font-size: 11.5px; color: var(--ink-2); }
.model-result-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin-top: 5px; }
.model-results-actions { display: grid; gap: 6px; }
