/* LeanOS components. Everything here reads tokens.css; a change of colour, type or shape happens in the brand
   sources and reaches the parts through source/build.py. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* The page: warm ground under a fine dot field. The field is decoration and never carries meaning */
body {
  margin: 0;
  background: radial-gradient(var(--field-colour) var(--field-dot), transparent calc(var(--field-dot) + 0.2px)) 0 0 / var(--field-pitch) var(--field-pitch), var(--canvas);
  color: var(--text);
  font: 400 var(--size-body)/var(--leading-body) var(--font-structure);
  font-feature-settings: "cv08", "kern";
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: var(--line-strong) solid var(--focus); outline-offset: 3px; }

/* Type: Doto for the point, Inter for reading, Space Mono for labels and navigation, JetBrains Mono for exact material */
.display, .title { font-family: var(--font-display); font-weight: var(--weight-display); letter-spacing: var(--tracking-display); text-wrap: balance; overflow-wrap: anywhere; }
.display { margin: 0; font-size: var(--size-display); line-height: var(--leading-display); max-width: 20ch; }
.title { margin: 0; font-size: var(--size-title); line-height: var(--leading-title); max-width: 26ch; }
.heading { margin: 0; font-size: var(--size-heading); font-weight: var(--weight-strong); line-height: var(--leading-heading); letter-spacing: var(--tracking-heading); overflow-wrap: anywhere; }
.lead { margin: 0; font-size: var(--size-lead); line-height: var(--leading-lead); color: var(--text-secondary); max-width: 32em; }
.body { margin: 0; color: var(--text-secondary); max-width: var(--measure-body); }
.small { font-size: var(--size-small); line-height: var(--leading-small); }
.meta { margin: 0; font-size: var(--size-meta); line-height: var(--leading-meta); color: var(--text-muted); }
.figure { font-variant-numeric: tabular-nums lining-nums; }
.code { font-family: var(--font-exact); font-size: 0.94em; font-variant-ligatures: none; }
p .code, .body .code { padding: 0.05em 0.3em; background: var(--fill-surface); border-radius: var(--radius-mark); outline: var(--line) solid var(--line-regular); outline-offset: -1px; }
p .code, li .code, td .code, dd .code { overflow-wrap: anywhere; }

/* Label: names things, in mono capitals. label--mark adds the signal light before it */
.label { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0; font: 400 var(--size-label)/var(--leading-label) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); }
.label--mark::before { content: ""; width: 0.55em; height: 0.55em; flex: none; border-radius: var(--radius-round); background: var(--signal); box-shadow: var(--signal-glow); }
.label--declared { color: var(--declared); }
.label--judgment { color: var(--judgment); }
.label--judgment.label--mark::before { background: var(--judgment-fill); box-shadow: none; }

/* Link: red words on a fine red line; on hover the line thickens */
.link { color: var(--link); font-weight: 500; text-decoration: underline; text-decoration-color: currentColor; text-decoration-thickness: 1px; text-underline-offset: 5px; transition: color var(--motion-fast) var(--ease-state), text-decoration-thickness var(--motion-fast) var(--ease-state); }
.link:hover { text-decoration-thickness: 2px; }

/* Link on a tone: inside a coloured message it takes that message's own word colour */
.link--tone { color: var(--tone-word, currentColor); font-weight: 600; text-decoration-color: currentColor; text-decoration-thickness: 1px; }
.link--tone:hover { color: var(--text); }

/* Buttons are pills. The main one is bull red with a white signal light before its words */
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3); min-height: var(--control-height); padding: 0 var(--space-5); border: var(--line) solid transparent; border-radius: var(--radius-pill); font: 500 var(--size-body)/var(--leading-single) var(--font-structure); text-decoration: none; cursor: pointer; transition: background-color var(--motion-fast) var(--ease-state), border-color var(--motion-fast) var(--ease-state), color var(--motion-fast) var(--ease-state); }
.button--primary { background: var(--accent); color: var(--on-accent); }
.button--primary::before { content: ""; flex: none; width: var(--signal-size); height: var(--signal-size); border-radius: var(--radius-round); background: var(--on-accent); box-shadow: 0 0 8px oklch(1 0 0 / 0.9); }
.button--primary:hover { background: var(--accent-hover); }
.button--primary:active { transform: translateY(1px); }
.button--primary.button--icon::before, .button--primary.button--plain::before { display: none; }
.button--secondary { background: transparent; color: var(--text); border-color: var(--text); }
.button--secondary:hover { background: var(--fill-invert); color: var(--canvas); }
.button--small { min-height: var(--control-height-small); padding: 0 var(--space-4); gap: var(--space-2); font-size: var(--size-meta); }
.button--small.button--primary::before { width: 6px; height: 6px; }
.button[disabled], .button[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Segmented control: one choice from a few, always visible */
.segmented { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 2px; border: var(--line) solid var(--line-strong-colour); border-radius: var(--radius-pill); background: var(--fill-raised); }
.segmented button { min-height: calc(var(--control-height-small) - 6px); padding: 0 var(--space-3); background: none; border: 0; border-radius: var(--radius-pill); color: var(--text-secondary); font: 400 var(--size-meta)/var(--leading-single) var(--font-label); cursor: pointer; transition: color var(--motion-fast) var(--ease-state); }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--fill-invert); color: var(--canvas); }
.segmented button:focus-visible { outline-offset: -3px; }

/* Status: a light and a word. The word carries the meaning; the light's colour strengthens it */
.status { display: inline-flex; align-items: baseline; gap: 0.5em; color: var(--text); font: 500 var(--size-meta)/var(--leading-single) var(--font-structure); white-space: nowrap; }
.status::before { content: ""; align-self: center; flex: none; width: 0.55em; height: 0.55em; background: var(--status-colour, currentColor); border-radius: var(--radius-round); }
.status--pass { --status-colour: var(--pass); }
.status--review, .status--open { --status-colour: var(--review); }
.status--fail { --status-colour: var(--fail); }
.status--pending { --status-colour: transparent; color: var(--text-muted); }
.status--pending::before { border: var(--line) solid var(--pending); }

/* Band: a whole section set apart by space on the page's own ground. Words stay in the text colours */
.band { --band-text: var(--text); --band-secondary: var(--text-secondary); padding-block: var(--space-section); color: var(--band-text); }
.band .lead, .band .body { color: var(--band-secondary); }

/* Header: brand, navigation and actions; below 720 px the navigation folds behind a menu button */
.header { position: sticky; top: 0; z-index: var(--layer-sticky); background: var(--fill-header); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: var(--line) solid var(--line-regular); }
.header__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--space-4); min-height: var(--header-height); }
.header__nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-5); font: 400 var(--size-meta)/var(--leading-single) var(--font-label); }
.header__nav a:not(.button) { position: relative; color: var(--text-secondary); text-decoration: none; transition: color var(--motion-fast) var(--ease-state); }
.header__nav a:not(.button):hover, .header__nav a[aria-current]:not(.button) { color: var(--text); }
.header__nav a[aria-current]:not(.button) { box-shadow: 0 2px 0 var(--signal); padding-block: 2px; }
/* header--center: the wordmark at the start, the navigation centred, actions at the end */
@media (min-width: 45.0001em) {
  .header--center .header__row { display: grid; grid-template-columns: 1fr auto 1fr; }
  .header--center .header__nav { justify-self: center; }
  .header--center .header__row > :last-child:not(.header__nav) { justify-self: end; }
}
.header .header__toggle { display: none; }
@media (max-width: 45em) {
  .header { position: static; }
  .header .header__toggle { display: inline-flex; }
  .header__nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: var(--space-2); }
  .header__nav a { padding-block: var(--space-2); }
  .header__toggle[aria-expanded="true"] + .header__nav { display: flex; }
}
/* Wordmark: the name as a word with a red dot, or the mark alone where there is no room for the word. Never both */
.wordmark { display: inline-flex; align-items: baseline; color: var(--text); font: 680 calc(0.62 * var(--logo-height))/var(--leading-single) var(--font-structure); letter-spacing: -0.025em; text-decoration: none; white-space: nowrap; }
.wordmark::after { content: ""; flex: none; width: 0.2em; height: 0.2em; margin-left: 0.07em; background: var(--lean-red); border-radius: var(--radius-round); }
.logo { height: var(--logo-height); width: auto; }
.footer { padding-block: var(--space-6); border-top: var(--line) solid var(--line-regular); }
.footer__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); font-size: var(--size-meta); color: var(--text-muted); }
/* A person's words, beside the judgment rule */
.quote { margin: 0; padding-left: var(--space-5); border-left: var(--line-strong) solid var(--judgment-fill); font-size: var(--size-quote); line-height: var(--leading-quote); letter-spacing: -0.015em; max-width: 34ch; }
.quote footer { margin-top: var(--space-2); font: 400 var(--size-meta)/var(--leading-meta) var(--font-structure); letter-spacing: 0; color: var(--text-muted); }

/* Highlight: one value the point refers to, underlined in the judgment blue */
.mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--judgment-fill); text-decoration-thickness: 3px; text-underline-offset: 0.18em; text-decoration-skip-ink: none; }

/* Exact material: words the reader runs, reads or copies, exactly as typed */
.copy { flex: none; min-width: calc(6ch + 2 * var(--space-3)); min-height: var(--copy-height); padding: 0 var(--space-3); background: transparent; color: inherit; border: var(--line) solid color-mix(in oklab, currentColor 32%, transparent); border-radius: var(--radius-copy); font: 400 var(--size-label)/var(--leading-single) var(--font-label); cursor: pointer; transition: background-color var(--motion-fast) var(--ease-state), color var(--motion-fast) var(--ease-state); }
.copy:hover { background: var(--copy-hover, oklch(1 0 0 / 0.12)); border-color: color-mix(in oklab, currentColor 60%, transparent); }
.copy[data-state="copied"] { color: var(--copy-done, var(--terminal-value)); }

/* Terminal: something to run, always on ink. Prompts stay out of what is copied */
.terminal { min-width: 0; margin: 0; overflow: hidden; border-radius: var(--radius-surface); background: var(--ink); color: var(--ink-text); box-shadow: var(--lift-1); }
.terminal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--bar-height); padding: var(--space-1) var(--space-3) var(--space-1) var(--space-5); color: var(--ink-muted); font: 400 var(--size-label)/var(--leading-single) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; border-bottom: var(--line) solid var(--terminal-line); }
.terminal__head .copy { letter-spacing: 0; text-transform: none; }
.terminal__body { margin: 0; padding: var(--space-4) var(--space-5); overflow-x: auto; font: 400 var(--size-code)/var(--leading-body) var(--font-exact); font-variant-ligatures: none; }
.terminal__line { display: block; white-space: pre; }
.terminal__body--prose .terminal__line { white-space: pre-wrap; }
.terminal__prompt { color: var(--terminal-prompt); user-select: none; }
.terminal__command { color: var(--terminal-command); }
.terminal__output { color: var(--ink-muted); }
.terminal__value { color: var(--terminal-value); }

/* Editor: a project to read. Choose the ground with editor--dark or editor--light */
.editor { --copy-hover: var(--editor-select); --copy-done: var(--code-keyword); container-type: inline-size; display: grid; min-width: 0; margin: 0; overflow: hidden; border-radius: var(--radius-surface); background: var(--editor-ground); color: var(--editor-text); font: 400 var(--size-meta)/var(--leading-body) var(--font-exact); font-variant-ligatures: none; outline: var(--line) solid var(--editor-line); outline-offset: -1px; box-shadow: var(--lift-1); }
.editor__title { display: flex; align-items: center; justify-content: center; min-height: var(--title-bar-height); padding-inline: var(--space-4); background: var(--editor-side); color: var(--editor-muted); font-size: var(--size-label); border-bottom: var(--line) solid var(--editor-line); }
.editor__frame { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
.editor__rail, .editor__tree { display: none; background: var(--editor-side); }
@container (min-width: 44em) {
  .editor__frame { grid-template-columns: calc(var(--icon) + 2 * var(--space-3)) calc(16ch + 2 * var(--space-3)) minmax(0, 1fr); }
  .editor__rail { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); padding-block: var(--space-3); border-right: var(--line) solid var(--editor-line); color: var(--editor-muted); }
  .editor__tree { display: block; padding-block: var(--space-2); border-right: var(--line) solid var(--editor-line); font-size: var(--size-meta); }
}
.editor__rail [data-current] { color: var(--editor-text); }
.editor__project { padding: var(--space-1) var(--space-3); font-size: var(--size-label); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--editor-muted); }
.editor__entry { display: block; width: 100%; padding: 2px var(--space-3); background: none; border: 0; border-radius: var(--radius-mark); color: var(--editor-muted); font: inherit; text-align: left; white-space: nowrap; }
.editor__entry[data-file] { color: var(--editor-text); cursor: pointer; }
.editor__entry[data-file]:hover { background: var(--editor-current); }
.editor__entry[data-current] { background: var(--editor-select); }
.editor__main { display: flex; flex-direction: column; min-width: 0; }
.editor__bar { display: flex; align-items: stretch; justify-content: space-between; background: var(--editor-side); border-bottom: var(--line) solid var(--editor-line); }
.editor__tabs { display: flex; min-width: 0; overflow-x: auto; }
.editor__tab { flex: none; min-height: var(--bar-height); padding: 0 var(--space-4); background: none; border: 0; border-right: var(--line) solid var(--editor-line); color: var(--editor-muted); font: inherit; font-size: var(--size-meta); cursor: pointer; }
.editor__tab[aria-selected="true"] { background: var(--editor-ground); color: var(--editor-text); box-shadow: inset 0 2px 0 var(--signal); }
.editor__bar .copy { align-self: center; margin-inline: var(--space-3); color: var(--editor-text); }
.editor__path { padding: var(--space-1) var(--space-4); color: var(--editor-muted); font-size: var(--size-label); }
.editor__panel { height: calc(13 * 1lh + var(--space-3)); padding-bottom: var(--space-3); overflow: auto; }
.editor__panel[hidden] { display: none; }
.editor__code { display: table; min-width: 100%; }
.editor__row { display: table-row; }
.editor__row[data-current] { background: var(--editor-current); }
.editor__number { display: table-cell; width: 1%; padding: 0 var(--space-4); text-align: right; color: var(--editor-gutter); user-select: none; }
.editor__text { display: table-cell; padding-right: var(--space-5); white-space: pre; }
.editor__status { display: flex; justify-content: space-between; gap: var(--space-4); padding: 2px var(--space-3); background: var(--accent); color: var(--on-accent); font-size: var(--size-label); font-weight: 500; }
/* One-page editor: a single file with nothing around it. Add editor--page to the editor; the page takes the height of its text */
/* A dark ground separates by itself; only the light editor keeps a fine edge, never lighter than its ground */
.editor--dark { outline-color: transparent; }
.editor--page { grid-template-columns: minmax(0, 1fr); }
.editor--page .editor__bar { min-height: var(--bar-height); }
.editor--page .editor__panel { height: auto; padding-block: var(--space-3); }
.editor--page .editor__code { font-family: inherit; }
.editor__name { align-self: center; min-width: 0; padding-inline: var(--space-4); overflow: hidden; color: var(--editor-muted); text-overflow: ellipsis; white-space: nowrap; }
.code-keyword { color: var(--code-keyword); }
.code-string { color: var(--code-string); }
.code-number { color: var(--code-number); }
.code-comment { color: var(--code-comment); }
.code-property { color: var(--code-property); }
.code-function { color: var(--code-function); }
/* Price */
.price { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4) var(--space-5); align-items: center; padding: var(--space-5) 0; border-top: var(--line) solid var(--line-regular); }
.price:first-child { border-top: var(--line-strong) solid var(--text); }
.price__amount { font: var(--weight-display) var(--size-title)/var(--leading-single) var(--font-display); letter-spacing: var(--tracking-display); }

/* ---- Form controls: every control is one box with one inset; text and any mark inside share it ---- */
.field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.field__label { font: 400 var(--size-label)/var(--leading-label) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-secondary); }
.field__label[data-required]::after { content: " *"; color: var(--fail); }
.field__hint { font-size: var(--size-meta); color: var(--text-muted); }
.field__error { display: flex; align-items: center; gap: var(--space-1); font-size: var(--size-meta); color: var(--fail); }
.field__foot { display: flex; justify-content: space-between; gap: var(--space-4); }
.field__count { font-size: var(--size-meta); color: var(--text-muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.input, .textarea, .select__trigger, .control { width: 100%; min-height: var(--control-height); padding-inline: var(--control-inset); color: var(--text); border: var(--line) solid var(--line-strong-colour); border-radius: var(--radius-control); font: 400 var(--size-body)/var(--leading-single) var(--font-structure); transition: border-color var(--motion-fast) var(--ease-state); }
.input, .textarea, .control { background: var(--raised); }
.input, .textarea, .select__trigger, .control, .otp input, .stepper { transition: border-color var(--motion-fast) var(--ease-state), box-shadow var(--motion-fast) var(--ease-state); }
.input::placeholder, .textarea::placeholder, .control input::placeholder { color: var(--text-muted); }
.input:hover, .textarea:hover, .select__trigger:hover, .control:hover { border-color: var(--text-muted); }
/* Focus: the edge turns link red and a soft ring of the same red surrounds it */
.input:focus-visible, .textarea:focus-visible, .select__trigger:focus-visible, .otp input:focus-visible, .control:focus-within { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px oklch(from var(--focus) l c h / 0.18); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .control:has([aria-invalid="true"]) { border-color: var(--fail); box-shadow: 0 0 0 3px oklch(from var(--fail) l c h / 0.12); }
.input:disabled, .textarea:disabled, .select__trigger:disabled, .control:has(:disabled) { background: transparent; border-color: var(--line-regular); color: var(--text-muted); cursor: not-allowed; }
.textarea { display: block; padding-block: var(--control-inset); line-height: var(--leading-body); resize: vertical; }
.input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; }

/* Control: a box holding an input with marks or buttons beside it */
.control { display: flex; align-items: center; gap: var(--space-2); }
.control input { flex: 1; min-width: 0; width: 100%; padding: 0; background: none; border: 0; color: inherit; font: inherit; outline: none; }
.control > .icon { color: var(--text-muted); }
.control__button { display: inline-grid; place-items: center; flex: none; width: var(--copy-height); height: var(--copy-height); margin-right: calc(-1 * var(--space-1)); background: none; border: 0; border-radius: var(--radius-tag); color: var(--text-secondary); cursor: pointer; }
.control__button:hover { background: var(--fill-hover); color: var(--text); }
.control__button[hidden] { display: none; }

/* Choices: checkbox, radio and toggle draw their own marks */
.check { display: inline-flex; align-items: flex-start; gap: var(--space-2); font-size: var(--size-small); cursor: pointer; }
.check input { flex: none; width: var(--check); height: var(--check); margin: 0.1em 0 0; display: grid; place-items: center; background: var(--raised); border: var(--line) solid var(--line-strong-colour); border-radius: 4px; -webkit-appearance: none; appearance: none; cursor: pointer; transition: background-color var(--motion-fast) var(--ease-state), border-color var(--motion-fast) var(--ease-state); }
.check input:hover { border-color: var(--text-muted); }
.check input[type="checkbox"]::after { content: ""; width: 72%; height: 72%; background: currentColor; color: var(--on-accent); opacity: 0; -webkit-mask: var(--glyph-check) center / contain no-repeat; mask: var(--glyph-check) center / contain no-repeat; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:focus-visible { outline: none; box-shadow: 0 0 0 3px oklch(from var(--focus) l c h / 0.24); border-color: var(--focus); }
.check input:checked::after { opacity: 1; }
.check input[type="radio"] { border-radius: var(--radius-round); }
.check input[type="radio"]::after { content: ""; width: 50%; height: 50%; border-radius: var(--radius-round); background: var(--on-accent); opacity: 0; }
.check input[type="radio"]:checked::after { opacity: 1; }
.check input:disabled, .check input:disabled + span { cursor: not-allowed; opacity: 0.5; }
.radio-group { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; border: 0; }
.radio-group legend { padding: 0; margin-bottom: var(--space-1); font: 400 var(--size-label)/var(--leading-label) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-secondary); }
.check input[role="switch"] { width: calc(2 * var(--check)); height: var(--check); margin-top: 0; padding: 2px; place-items: center start; border-radius: var(--radius-pill); background: var(--line-strong-colour); border-color: transparent; }
.check input[role="switch"]::after { content: ""; width: calc(var(--check) - 6px); height: calc(var(--check) - 6px); opacity: 1; background: var(--raised); border-radius: var(--radius-pill); box-shadow: 0 1px 2px oklch(from var(--lean-ink) l c h / 0.3); -webkit-mask: none; mask: none; transition: transform var(--motion-regular) var(--ease-state); }
.check input[role="switch"]:checked { background: var(--accent); }
.check input[role="switch"]:checked::after { background: var(--on-accent); transform: translateX(var(--check)); }

/* Listbox: the list a select or combobox opens */
.select, .combobox, .datepicker, .popover, .dropdown { position: relative; display: block; min-width: 0; }
.select__trigger { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); background: var(--fill-raised); box-shadow: none; text-align: left; cursor: pointer; }
.select__value[data-placeholder] { color: var(--text-muted); }
.listbox, .menu { position: absolute; z-index: var(--layer-popover); top: calc(100% + var(--space-1)); left: 0; min-width: 100%; max-height: calc(var(--rows-visible) * var(--control-height-small)); margin: 0; padding: var(--space-1); overflow: auto; background: var(--raised); border: var(--line) solid var(--line-regular); border-radius: var(--radius-menu); box-shadow: var(--edge-light), var(--overlay-shadow); list-style: none; }
.listbox[hidden], .menu[hidden] { display: none; }
.listbox[data-above], .menu[data-above] { top: auto; bottom: calc(100% + var(--space-1)); }
.option, .menu__item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; min-height: var(--control-height-small); padding: var(--space-1) var(--space-3); background: none; border: 0; border-radius: var(--radius-tag); color: var(--text); font: 400 var(--size-small)/var(--leading-heading) var(--font-structure); text-align: left; text-decoration: none; cursor: pointer; }
.option[data-active], .menu__item:hover, .menu__item:focus-visible { background: var(--fill-hover); outline: none; }
.option[aria-selected="true"] { background: var(--fill-selected); font-weight: 600; }
.option[aria-selected="true"]::after { content: ""; width: var(--icon); height: var(--icon); flex: none; background: currentColor; -webkit-mask: var(--glyph-check-thin) center / contain no-repeat; mask: var(--glyph-check-thin) center / contain no-repeat; }
.option[aria-disabled="true"] { color: var(--text-muted); cursor: not-allowed; }
.listbox__empty { padding: var(--space-2) var(--space-3); font-size: var(--size-small); color: var(--text-muted); }
.listbox__group { padding: var(--space-2) var(--space-3) var(--space-1); font: 400 var(--size-label)/var(--leading-heading) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); }

/* Number and code entry */
.stepper { display: inline-flex; align-items: stretch; width: fit-content; background: var(--raised); border: var(--line) solid var(--line-strong-colour); border-radius: var(--radius-control); overflow: hidden; }
.stepper input { width: 5ch; min-height: var(--control-height); padding: 0; background: none; border: 0; border-inline: var(--line) solid var(--line-regular); color: var(--text); font: 400 var(--size-body)/var(--leading-single) var(--font-structure); font-variant-numeric: tabular-nums; text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input:focus-visible { outline: none; }
.stepper:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px oklch(from var(--focus) l c h / 0.18); }
.stepper button { display: grid; place-items: center; width: var(--control-height); background: none; border: 0; color: var(--text-secondary); cursor: pointer; }
.stepper button:hover:not(:disabled) { background: var(--fill-hover); color: var(--text); }
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.otp { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, var(--control-height)); gap: var(--space-2); max-width: 100%; }
.otp input { width: 100%; min-height: var(--control-height); padding: 0; background: var(--raised); border: var(--line) solid var(--line-strong-colour); border-radius: var(--radius-control); color: var(--text); font: 500 var(--size-heading)/var(--leading-single) var(--font-exact); text-align: center; }

/* Slider and rating */
.slider { display: flex; flex-direction: column; gap: var(--space-2); }
.slider__head { display: flex; justify-content: space-between; gap: var(--space-4); font: 400 var(--size-label)/var(--leading-label) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-secondary); }
.slider__head output { font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: 0; }
.slider input { width: 100%; height: calc(var(--thumb) + 2px); margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.slider input::-webkit-slider-runnable-track { height: var(--u); border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--percent, 0%), var(--fill-track) var(--percent, 0%)); }
.slider input::-moz-range-track { height: var(--u); border-radius: 2px; background: var(--fill-track); }
.slider input::-moz-range-progress { height: var(--u); border-radius: 2px; background: var(--accent); }
.slider input::-webkit-slider-thumb { width: var(--thumb); height: var(--thumb); margin-top: calc((var(--u) - var(--thumb)) / 2); background: var(--raised); border: var(--line) solid var(--line-strong-colour); border-radius: var(--radius-pill); box-shadow: var(--lift-1); -webkit-appearance: none; }
.slider input::-moz-range-thumb { width: calc(var(--thumb) - 4px); height: calc(var(--thumb) - 4px); background: var(--raised); border: var(--line) solid var(--line-strong-colour); border-radius: var(--radius-pill); box-shadow: var(--lift-1); }
.rating { display: inline-flex; gap: var(--space-1); }
.rating button { display: grid; place-items: center; width: var(--copy-height); height: var(--copy-height); padding: 0; background: none; border: 0; color: var(--text-muted); cursor: pointer; }
.rating button[data-on] { color: var(--judgment-fill); }
.rating button[data-on] .icon { --glyph: var(--star-filled); }
.rating button:hover { color: var(--text); }

/* Colour picker */
.color { display: grid; gap: var(--space-3); width: min(100%, var(--measure-2)); }
.color__area { position: relative; aspect-ratio: 8 / 5; border-radius: var(--radius-control); background: linear-gradient(to top, oklch(0 0 0), transparent), linear-gradient(to right, oklch(1 0 0), hsl(var(--hue, 190) 100% 50%)); cursor: crosshair; touch-action: none; }
.color__point { position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: var(--thumb); height: var(--thumb); margin: calc(var(--thumb) / -2); border: 2px solid oklch(1 0 0); border-radius: var(--radius-round); box-shadow: 0 0 0 1px oklch(0 0 0 / 0.5); }
.color__hue { width: 100%; height: var(--thumb); margin: 0; border-radius: calc(var(--thumb) / 2); background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); -webkit-appearance: none; appearance: none; cursor: pointer; }
.color__hue::-webkit-slider-thumb { width: calc(var(--thumb) / 2); height: calc(var(--thumb) + 4px); background: oklch(1 0 0); border: 1px solid oklch(0 0 0 / 0.6); border-radius: 2px; -webkit-appearance: none; }
.color__row { display: flex; align-items: center; gap: var(--space-2); }
.color__swatch { flex: none; width: var(--control-height); height: var(--control-height); background: var(--value, var(--accent)); border: var(--line) solid var(--line-regular); border-radius: var(--radius-control); }
.color__presets { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.color__presets button { width: var(--tag-height); height: var(--tag-height); padding: 0; background: var(--preset); border: var(--line) solid var(--line-regular); border-radius: var(--radius-tag); cursor: pointer; }

/* Calendar */
.calendar { position: absolute; z-index: var(--layer-popover); top: calc(100% + var(--space-1)); left: 0; width: max-content; padding: var(--space-3); background: var(--raised); border: var(--line) solid var(--line-regular); border-radius: var(--radius-surface); box-shadow: var(--overlay-shadow); }
.calendar[hidden] { display: none; }
.calendar[data-above] { top: auto; bottom: calc(100% + var(--space-1)); }
.calendar__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); font-size: var(--size-small); font-weight: 600; }
.calendar table { border-collapse: collapse; font-size: var(--size-meta); }
.calendar th { width: var(--copy-height); height: var(--tag-height); font-weight: 500; color: var(--text-muted); }
.calendar td { padding: 1px; }
.calendar td button { width: var(--copy-height); height: var(--copy-height); padding: 0; background: none; border: 0; border-radius: var(--radius-tag); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.calendar td button:hover { background: var(--fill-hover); }
.calendar td button[aria-current] { font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent-text); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.calendar td button[aria-selected="true"] { background: var(--text); color: var(--canvas); }
.calendar td button:disabled { color: var(--text-muted); opacity: 0.45; cursor: not-allowed; }
.calendar td button[data-outside] { color: var(--text-muted); }

/* Inline edit */
.inline-edit { display: inline-flex; align-items: center; gap: var(--space-2); max-width: 100%; }
.inline-edit__show { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2); margin-left: calc(-1 * var(--space-2)); background: none; border: 0; border-radius: var(--radius-tag); color: var(--text); font: inherit; text-align: left; cursor: text; }
.inline-edit__show:hover { background: var(--fill-hover); }
.inline-edit__show .icon { color: var(--text-muted); }
.inline-edit input { min-height: var(--control-height-small); }

/* Showing state */
/* Badge: a short tag in a pill, set one step below the label (s(-3), 11 px) so the words sit well inside their height */
.badge { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tag-height); padding: 0 var(--space-3); background: transparent; border: var(--line) solid var(--line-strong-colour); border-radius: var(--radius-tag); color: var(--text-secondary); font: 400 var(--size-tag)/1 var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; white-space: nowrap; }
.badge--tint { background: var(--fill-tint); border-color: transparent; color: var(--text); }
.badge--signal::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: var(--radius-round); background: var(--signal); box-shadow: var(--signal-glow); }
.avatar { display: inline-grid; place-items: center; flex: none; width: var(--avatar, var(--control-height)); height: var(--avatar, var(--control-height)); overflow: hidden; background: var(--fill-tint); border-radius: var(--radius-round); color: var(--text); font: 600 calc(var(--avatar, var(--control-height)) * 0.36)/var(--leading-single) var(--font-structure); }
.avatar--sm { --avatar: var(--control-height-small); }
.avatar--lg { --avatar: calc(1.5 * var(--control-height)); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.separator { height: 0; margin: 0; border: 0; border-top: var(--line) solid var(--line-regular); }
.separator--vertical { align-self: stretch; height: auto; border-top: 0; border-left: var(--line) solid var(--line-regular); }
.spinner { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--size-meta); color: var(--text-secondary); animation: appear 1ms 400ms backwards; }
.spinner::before { content: ""; width: var(--icon); height: var(--icon); border: var(--line-strong) solid var(--fill-track); border-top-color: var(--text); border-radius: var(--radius-round); animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes appear { from { visibility: hidden; } }
.skeleton { display: block; height: 1em; background: var(--fill-track); border-radius: var(--radius-tag); animation: pulse 1600ms ease-in-out infinite; }
.skeleton--block { height: calc(5 * var(--size-body) * var(--leading-body)); border-radius: var(--radius-control); }
.skeleton--circle { width: var(--control-height); height: var(--control-height); border-radius: var(--radius-control); }
@keyframes pulse { 50% { opacity: 0.5; } }
.progress { display: flex; flex-direction: column; gap: var(--space-2); }
.progress__head { display: flex; justify-content: space-between; gap: var(--space-4); font-size: var(--size-meta); }
.progress__head span:last-child { font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.progress__track { height: calc(1.5 * var(--u)); overflow: hidden; background: var(--fill-track); border-radius: 3px; }
.progress__fill { display: block; width: var(--value, 0%); height: 100%; background: var(--accent); transition: width var(--motion-regular) var(--ease-enter); }
.progress[data-failed] .progress__fill { background: var(--fail); }
.progress-steps { display: flex; gap: var(--space-2); margin: 0; padding: 0; list-style: none; counter-reset: step; font-size: var(--size-meta); }
.progress-steps li { flex: 1; min-width: 0; padding-top: var(--space-2); border-top: var(--line-strong) solid var(--fill-track); color: var(--text-muted); counter-increment: step; }
.progress-steps li::before { content: counter(step, decimal-leading-zero); display: block; font: 400 var(--size-label)/var(--leading-heading) var(--font-label); }
.progress-steps li[data-done], .progress-steps li[aria-current] { color: var(--text); border-top-color: var(--text); }
.progress-steps li[aria-current] { font-weight: 600; border-top-color: var(--signal); }

/* Text helpers */
.strong { font-weight: 600; color: var(--text); }
.secondary { color: var(--text-secondary); }
.caption { font-size: var(--size-meta); color: var(--text-muted); }
.subheading { margin: 0; font-size: var(--size-body); font-weight: 600; line-height: var(--leading-lead); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: calc(var(--layer-toast) + 1); top: var(--space-2); left: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--text); color: var(--canvas); border-radius: var(--radius-control); font-size: var(--size-small); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.link--external::after { content: ""; display: inline-block; width: 0.8em; height: 0.8em; margin-left: 0.25em; background: currentColor; vertical-align: -0.05em; -webkit-mask: var(--glyph-external) center / contain no-repeat; mask: var(--glyph-external) center / contain no-repeat; }
.button--block { width: 100%; }
.button--icon { width: var(--control-height); padding: 0; }
.button--icon.button--small { width: var(--control-height-small); }
.button--quiet { background: transparent; color: var(--text); }
.button--quiet:hover { background: var(--fill-hover); }
.button--secondary[aria-pressed="true"] { background: var(--fill-invert); color: var(--canvas); }

/* Tooltip */
.tooltip { position: relative; display: inline-flex; }
.tooltip__bubble { position: absolute; z-index: var(--layer-popover); bottom: calc(100% + var(--space-3)); left: 50%; width: max-content; max-width: var(--measure-2); padding: var(--space-2) var(--space-3); background: var(--raised); color: var(--text); border: var(--line) solid var(--line-regular); border-radius: var(--radius-control); box-shadow: var(--edge-light), var(--overlay-shadow); font: 400 var(--size-meta)/var(--leading-meta) var(--font-structure); text-align: left; transform: translate(-50%, 4px); visibility: hidden; opacity: 0; transition: opacity var(--motion-fast) var(--ease-exit), transform var(--motion-fast) var(--ease-exit); pointer-events: none; }
.tooltip__bubble::after { content: ""; position: absolute; left: 50%; top: 100%; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--raised); border-right: var(--line) solid var(--line-regular); border-bottom: var(--line) solid var(--line-regular); transform: rotate(45deg); }
.tooltip:hover .tooltip__bubble, .tooltip:focus-within .tooltip__bubble { visibility: visible; opacity: 1; transform: translate(-50%, 0); transition: opacity var(--motion-regular) var(--ease-enter) 200ms, transform var(--motion-regular) var(--ease-enter) 200ms; }
.tooltip[data-dismissed] .tooltip__bubble { visibility: hidden; opacity: 0; }

/* Tree */
.tree, .tree ul { margin: 0; padding: 0; list-style: none; font: 400 var(--size-meta)/var(--leading-heading) var(--font-label); }
.tree ul { margin-left: calc(var(--space-2) + var(--icon) / 2); padding-left: var(--space-2); border-left: var(--line) solid var(--line-regular); }
.tree [role="treeitem"] > span { position: relative; display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-height-small); padding: 0 calc(2 * var(--space-3) + 6px) 0 var(--space-2); border-radius: var(--radius-control); color: var(--text); cursor: pointer; }
.tree [role="treeitem"] > span .icon { color: var(--text-muted); transition: transform var(--motion-fast) var(--ease-state); }
.tree [role="treeitem"]:not([aria-expanded]) > span { padding-left: calc(2 * var(--space-2) + var(--icon)); color: var(--text-secondary); }
.tree [role="treeitem"] > span:hover { background: var(--fill-hover); color: var(--text); }
.tree [role="treeitem"][aria-selected="true"] > span { background: var(--fill-raised); color: var(--text); box-shadow: inset 0 0 0 var(--line) var(--line-regular); }
.tree [role="treeitem"][aria-selected="true"] > span::after { content: ""; position: absolute; right: var(--space-3); top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: var(--radius-round); background: var(--signal); box-shadow: var(--signal-glow); }
.tree [role="treeitem"]:focus { outline: none; }
.tree [role="treeitem"]:focus-visible > span { outline: var(--line-strong) solid var(--focus); outline-offset: -2px; }
.tree [aria-expanded="false"] > ul { display: none; }
.tree [aria-expanded="false"] > span .icon--chevron-down { transform: rotate(-90deg); }

/* Alert: a shape, then a clear order: title, what it means, what to do. A single sentence stands as it is */
/* Alert and toast: a module with a status light before its words. The light's colour strengthens the words; it never carries the meaning alone */
.alert, .toast { --tone-mark: var(--text-muted); --tone-word: var(--text); display: grid; grid-template-columns: var(--signal-size) minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); align-items: start; padding: var(--space-4) var(--space-5); background: var(--fill-raised); border: var(--line) solid var(--line-regular); border-radius: var(--radius-surface); box-shadow: var(--lift-1); font-size: var(--size-small); line-height: var(--leading-body); }
.alert::before, .toast::before { content: ""; grid-column: 1; grid-row: 1; width: var(--signal-size); height: var(--signal-size); margin-top: calc((var(--size-body) * var(--leading-lead) - var(--signal-size)) / 2); border-radius: var(--radius-round); background: var(--tone-mark); }
.alert:not(:has(.alert__title))::before { margin-top: calc((var(--size-small) * var(--leading-body) - var(--signal-size)) / 2); }
.alert > :not([data-dismiss]), .toast > :not(button) { grid-column: 2; grid-row: 1; min-width: 0; }
.alert > [data-dismiss], .toast > button { grid-column: 3; grid-row: 1; margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-3)) 0 0; }
.alert--warn, .toast--warn { --tone-mark: var(--judgment-fill); --tone-word: var(--judgment); }
.alert--error, .toast--error { --tone-mark: var(--fail); --tone-word: var(--fail); }
.alert--success, .toast--success { --tone-mark: var(--pass); --tone-word: var(--pass); }
.alert__title, .alert__message { display: block; margin: 0; }
.alert__title { color: var(--text); font-size: var(--size-body); font-weight: 600; line-height: var(--leading-lead); }
.alert__message { color: var(--text-secondary); }
.alert__title + .alert__message { margin-top: var(--space-1); }
.alert__action { margin-top: var(--space-3); }
/* Accordion */
.accordion { border-top: var(--line) solid var(--line-regular); }
.accordion:last-child { border-bottom: var(--line) solid var(--line-regular); }
.accordion + .accordion { border-top: var(--line) solid var(--line-regular); }
.accordion summary { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding-block: var(--space-4); font-weight: 600; cursor: pointer; list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary .icon { transition: transform var(--motion-regular) var(--ease-state); }
.accordion[open] summary .icon { transform: rotate(180deg); }
.accordion__body { padding-bottom: var(--space-4); color: var(--text-secondary); max-width: var(--measure-body); }

.palette { width: min(calc(100vw - 2 * var(--space-4)), var(--measure-body)); margin-top: 12vh; padding: 0; background: var(--raised); color: var(--text); border: var(--line) solid var(--line-regular); border-radius: var(--radius-surface); box-shadow: var(--overlay-shadow); }
.palette::backdrop { background: var(--scrim); }
.palette__search { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-height); padding-inline: var(--control-inset); border-bottom: var(--line) solid var(--line-regular); }
.palette__search input { flex: 1; min-width: 0; background: none; border: 0; color: inherit; font: inherit; outline: none; }
.palette__list { max-height: calc(var(--rows-visible) * var(--control-height-small)); padding: var(--space-1); overflow: auto; }

/* ---- Page structure ---- */
.page { width: min(100%, calc(var(--page-width) + 2 * var(--page-margin))); margin-inline: auto; padding-inline: var(--page-margin); }
.section { padding-block: var(--space-section); }
.section + .section { border-top: var(--line) solid var(--line-regular); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; min-width: 0; }
.stack--tight { gap: var(--space-2); }
.stack--wide { gap: var(--space-7); align-items: stretch; }
.stack--fill { align-items: stretch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
/* Columns: as many as fit, up to n. Tracks = min(n, floor((width + gap) / (track + gap))), so no breakpoints are needed */
.columns, .split, .feature-grid, .pricing, .team, .testimonials, .stats, .steps, .footer__columns, .alternating__row, .split-panels, .hero-block--split { --n: 1; --gap: var(--space-5); --track: var(--measure-3); display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, max(var(--track), calc((100% - (var(--n) - 1) * var(--gap)) / var(--n)))), 1fr)); }
.columns > *, .split > * { min-width: 0; }
.columns--2 { --n: 2; }
.columns--3 { --n: 3; }
.columns--4 { --n: 4; --track: var(--measure-4); }
.split, .alternating__row, .hero-block--split { --n: 2; --gap: var(--space-7); --track: var(--measure-1); align-items: center; }

/* A side and a main part: the main part keeps its measure and the side wraps when it no longer fits.
   Dividers sit one pixel outside the clipped box, so only the one between the parts shows */
.layout__body, .master-detail, .form-section, .content-sidebar { display: flex; flex-wrap: wrap; overflow: clip; }

/* Numbered steps */
.steps { --n: 4; --track: var(--measure-4); list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: var(--space-2); counter-increment: step; padding-top: var(--space-3); border-top: var(--line-strong) solid var(--text); }
.step::before { content: counter(step, decimal-leading-zero); display: block; font: 400 var(--size-label)/var(--leading-single) var(--font-label); color: var(--text-muted); }

/* Card: an object with a hairline. In a row, siblings share the lines of their heading and text */
.card { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: var(--space-3); align-content: start; padding: var(--space-5); background: var(--fill-raised); border: var(--line) solid var(--line-regular); border-radius: var(--radius-surface); box-shadow: var(--edge-light), var(--lift-1); transition: box-shadow var(--motion-regular) var(--ease-state); }
.card > :empty { display: none; }
a.card { color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--accent-text); box-shadow: var(--edge-light), var(--lift-2); }
.card--outlined { background: transparent; box-shadow: none; }
.card--elevated { border-color: transparent; box-shadow: var(--edge-light), var(--overlay-shadow); }
.card--tint { background: var(--fill-tint); border-color: transparent; box-shadow: none; }
.card--sky .body, .card--cream .body { color: var(--text); }
.card__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; align-self: end; margin-top: var(--space-2); }

/* Stat: one figure, what it counts and how it moved */
.stats { --n: 6; --track: var(--measure-3); padding-top: var(--space-5); border-top: var(--line) solid var(--text); }
.stat { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: var(--space-2); align-content: start; }
.stat .label::before { display: none; }
.stat__value { display: block; font: var(--weight-display) var(--size-title)/var(--leading-title) var(--font-display); letter-spacing: var(--tracking-display); font-variant-numeric: tabular-nums lining-nums; }
/* The change is a signed figure with its period: it says how much, and leaves good or bad to the reader */
.stat__change { font-size: var(--size-meta); color: var(--text-muted); }
.stat__amount { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }

/* Table: rows to scan and compare; figures align right, headers name, sorting is one press */
.table-wrap { min-width: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--size-small); }
.table th { padding: 0 var(--space-4) var(--space-3) 0; text-align: left; font: 400 var(--size-label)/var(--leading-heading) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; white-space: nowrap; border-bottom: var(--line) solid var(--text); }
.table th:first-child { border-top-left-radius: var(--radius-control); }
.table th:last-child { border-top-right-radius: var(--radius-control); }
.table td { padding: var(--space-3) var(--space-4) var(--space-3) 0; color: var(--text-secondary); border-bottom: var(--line) solid var(--line-regular); vertical-align: top; }
.table td:first-child { color: var(--text); font-weight: 600; }
.table td[data-figure], .table th[data-figure] { text-align: right; font-variant-numeric: tabular-nums; }
.table tr[hidden] { display: none; }
.table tr[data-selected] td { background: var(--fill-selected); }
.table--selectable td:first-child, .table--selectable th:first-child { width: 1%; padding-left: var(--space-3); }
.table--selectable td:nth-child(2) { color: var(--text); font-weight: 600; }
.table .check { vertical-align: middle; }
.table__sort { display: inline-flex; align-items: center; gap: var(--space-1); padding: 0; background: none; border: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.table__sort .icon { opacity: 0.45; }
th[aria-sort="ascending"] .table__sort .icon, th[aria-sort="descending"] .table__sort .icon { opacity: 1; }
th[aria-sort="ascending"] .table__sort .icon { --glyph: var(--sort-up); }
th[aria-sort="descending"] .table__sort .icon { --glyph: var(--sort-down); }
/* Stacked table: records whose values run long. While its wrap holds measure-1 (24 x body size, the width a
   main part keeps) it is a table; below that each row is a block and each value sits under its column name,
   taken from the cell's data-label. The first cell, left without a label, titles the record. The head is
   hidden from view and kept for assistive technology; a head with sort buttons stays as a bar of them. */
.table-wrap:has(> .table--stack) { container-type: inline-size; font-size: var(--size-body); }
@container (width < 24em) {
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; }
  .table--stack thead:not(:has(.table__sort)) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .table--stack thead:has(.table__sort) tr { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding-bottom: var(--space-3); }
  .table--stack thead:has(.table__sort) th { width: auto; padding: 0; background: none; box-shadow: none; border-bottom: 0; }
  .table--stack thead:has(.table__sort) th:not(:has(.table__sort, .check)) { display: none; }
  .table--stack tbody tr { padding-block: var(--space-3); border-bottom: var(--line) solid var(--line-regular); }
  .table--stack tbody tr:first-child { border-top: var(--line-strong) solid var(--text); }
  .table--stack tr[hidden] { display: none; }
  .table--stack td, .table--stack td:first-child { width: auto; padding: var(--space-1) 0; border-bottom: 0; overflow-wrap: anywhere; }
  .table--stack td[data-figure] { text-align: left; }
  .table--stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font: 400 var(--size-label)/var(--leading-heading) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); }
}
.table-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-3); font-size: var(--size-meta); color: var(--text-muted); }

/* Breadcrumbs */
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--size-meta); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--space-2); }
.breadcrumbs li[hidden] { display: none; }
.breadcrumbs li + li::before { content: "/"; color: var(--text-muted); }
.breadcrumbs a, .breadcrumbs button { padding: 0; background: none; border: 0; color: var(--text-secondary); font: inherit; text-decoration: none; cursor: pointer; }
.breadcrumbs a:hover, .breadcrumbs button:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-text); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 600; }

/* Button group */
.button-group { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
.button-group--attached { gap: 0; max-width: 100%; overflow: clip; border: var(--line) solid var(--text); border-radius: var(--radius-control); }
.button-group--attached .button { flex: 1 1 calc((var(--measure-3) - 100%) * 999); margin: calc(-1 * var(--line)) 0 0 calc(-1 * var(--line)); border: 0; border-top: var(--line) solid var(--text); border-left: var(--line) solid var(--text); border-radius: 0; }
.button-group--attached .button:focus-visible { position: relative; z-index: 1; outline-offset: -4px; }

/* Menu */
.menu { min-width: var(--measure-3); }
.menu--end { left: auto; right: 0; }
.menu__item[aria-disabled="true"] { color: var(--text-muted); cursor: not-allowed; }
/* Menu items read as the device's controls: Space Mono, mixed case. The current page carries the signal light */
.menu .menu__item { position: relative; font: 400 var(--size-meta)/var(--leading-heading) var(--font-label); color: var(--text-secondary); border-radius: var(--radius-control); }
.menu .menu__item:hover, .menu .menu__item:focus-visible, .menu .menu__item[aria-current] { color: var(--text); }
.menu .menu__item--danger { color: var(--fail); }
.menu:has(.menu__item[aria-current]) .menu__item { padding-left: var(--space-6); }
.menu__item[aria-current]::before { content: ""; position: absolute; left: var(--space-3); top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: var(--radius-round); background: var(--signal); box-shadow: var(--signal-glow); }
.menu__item--danger { color: var(--fail); }
.menu__separator { height: 0; margin: var(--space-1) 0; border-top: var(--line) solid var(--line-regular); }
.menu__item .icon { color: var(--text-muted); }
.menu__item > span:first-child { display: inline-flex; align-items: center; gap: var(--space-2); }

/* Empty state: what is missing and the one step that fills it */
.empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-7) var(--space-5); border: var(--line) dashed var(--line-strong-colour); border-radius: var(--radius-surface); }
.empty-state .body { max-width: 32em; }

/* File */
.file { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--fill-raised); border: var(--line) solid var(--line-regular); border-radius: var(--radius-control); font-size: var(--size-small); }
.file__details { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file__name { overflow: hidden; color: var(--text); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.file__size { font-size: var(--size-meta); color: var(--text-muted); }
.file[data-failed] { border-color: var(--fail); }
.file[data-failed] .file__size { color: var(--fail); }
.file__actions { display: flex; flex: none; gap: var(--space-1); }

/* Navigation */
/* Navigation: the device's controls in Space Mono, mixed case, in secondary text. In a row the current page takes the
   red underline; in a column it takes the signal light in a lane of its own, never a filled pill */
.navigation__list { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); margin: 0; padding: 0; list-style: none; font: 400 var(--size-meta)/var(--leading-heading) var(--font-label); }
.navigation a { position: relative; display: flex; align-items: center; gap: var(--space-2); padding-block: var(--space-1); color: var(--text-secondary); text-decoration: none; transition: color var(--motion-fast) var(--ease-state); }
.navigation a:hover, .navigation a[aria-current] { color: var(--text); }
.navigation a[aria-current] { box-shadow: 0 2px 0 var(--signal); }
.navigation--vertical .navigation__list { flex-direction: column; flex-wrap: nowrap; gap: 0; }
.navigation--vertical a { min-height: var(--control-height-small); padding-inline: var(--space-5) var(--space-2); border-radius: var(--radius-control); }
.navigation--vertical a:hover { background: var(--fill-hover); }
.navigation--vertical a[aria-current] { box-shadow: none; }
.navigation--vertical a[aria-current]::before { content: ""; position: absolute; left: var(--space-2); top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: var(--radius-round); background: var(--signal); box-shadow: var(--signal-glow); }
.navigation__group { margin: var(--space-4) 0 var(--space-1); padding-inline: var(--space-2); font: 400 var(--size-label)/var(--leading-label) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); }
.navigation__group:first-child { margin-top: 0; }
.navigation__toggle { display: none; }
@media (max-width: 45em) {
  .navigation--collapsible .navigation__toggle { display: inline-flex; }
  .navigation--collapsible .navigation__toggle[aria-expanded="false"] + .navigation__list { display: none; }
  .navigation--collapsible .navigation__list { flex-direction: column; margin-top: var(--space-2); }
}

/* Pagination */
.pagination ul { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.pagination__item { display: inline-grid; place-items: center; min-width: var(--control-height-small); height: var(--control-height-small); padding: 0 var(--space-2); background: none; border: var(--line) solid transparent; border-radius: var(--radius-tag); color: var(--text-secondary); font: 500 var(--size-meta)/var(--leading-single) var(--font-structure); font-variant-numeric: tabular-nums; cursor: pointer; }
.pagination__item:hover:not(:disabled) { background: var(--fill-hover); color: var(--text); }
.pagination__item[aria-current] { background: var(--fill-invert); color: var(--canvas); }
.pagination__item:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination__gap { padding-inline: var(--space-1); color: var(--text-muted); }

/* Rich text editor */
.rte { border: var(--line) solid var(--line-strong-colour); border-radius: var(--radius-control); overflow: hidden; background: var(--raised); }
.rte:focus-within { border-color: var(--focus); }
.rte__toolbar { display: flex; flex-wrap: wrap; gap: var(--space-1); padding: var(--space-1); background: var(--fill-surface); border-bottom: var(--line) solid var(--line-regular); }
.rte__tool { display: inline-grid; place-items: center; width: var(--control-height-small); height: var(--control-height-small); background: none; border: 0; border-radius: var(--radius-tag); color: var(--text-secondary); cursor: pointer; }
.rte__tool:hover { background: var(--fill-hover); color: var(--text); }
.rte__tool[aria-pressed="true"] { background: var(--fill-invert); color: var(--canvas); }
.rte__body { min-height: calc(5 * var(--size-body) * var(--leading-body)); padding: var(--control-inset); outline: none; }
.rte__body > :first-child { margin-top: 0; }
.rte__body > :last-child { margin-bottom: 0; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: var(--space-5); width: calc(var(--measure-3) + 2 * var(--space-3)); max-width: 100%; padding: var(--space-4) var(--space-3); background: var(--fill-surface); border-right: var(--line) solid var(--line-regular); transition: width var(--motion-regular) var(--ease-state); }
.sidebar__head, .sidebar__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.sidebar__foot { margin-top: auto; font-size: var(--size-meta); }
.sidebar__group { display: flex; flex-direction: column; gap: var(--space-1); }
.sidebar__title { padding-inline: var(--space-2); font: 400 var(--size-label)/var(--leading-heading) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); }
.sidebar[data-collapsed] { width: calc(var(--control-height) + 2 * var(--space-3)); }
.sidebar__mark { display: none; }
.sidebar[data-collapsed] .sidebar__title, .sidebar[data-collapsed] .sidebar__label, .sidebar[data-collapsed] .wordmark { display: none; }
.sidebar[data-collapsed] .sidebar__mark { display: block; }
.sidebar[data-collapsed] .sidebar__head { flex-direction: column; }

/* Toast */
.toasts { position: fixed; z-index: var(--layer-toast); right: var(--space-4); bottom: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); width: min(calc(100vw - 2 * var(--space-4)), var(--measure-1)); }
.toast { box-shadow: var(--overlay-shadow); }
.toast .alert__message:empty { display: none; }

/* Fieldset and form */
.fieldset { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; margin: 0; padding: 0; border: 0; }
.fieldset legend { padding: 0 0 var(--space-1); font: 400 var(--size-label)/var(--leading-label) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-secondary); }
.fieldset__hint { margin: 0; font-size: var(--size-meta); color: var(--text-muted); }
.form { display: flex; flex-direction: column; gap: var(--space-5); max-width: var(--measure-body); }
.form__fields { display: flex; flex-direction: column; gap: var(--space-4); }
.field__error[hidden] { display: none; }

/* File upload */
.upload { display: flex; flex-direction: column; gap: var(--space-3); }
.upload__zone { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-4); border: var(--line) dashed var(--line-strong-colour); border-radius: var(--radius-surface); font-size: var(--size-small); text-align: center; transition: background-color var(--motion-fast) var(--ease-state), border-color var(--motion-fast) var(--ease-state); }
.upload__zone:hover, .upload__zone[data-over] { background: var(--fill-selected); border-color: var(--text); }
.upload__zone:focus-within { outline: var(--line-strong) solid var(--focus); outline-offset: 2px; }
.upload__zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload__files { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }

/* Overlays: the native dialog gives focus, Escape and an inert page */
.modal, .drawer { padding: 0; background: var(--fill-raised); color: var(--text); border: var(--line) solid var(--line-regular); box-shadow: var(--overlay-shadow); }
.modal::backdrop, .drawer::backdrop { background: var(--scrim); }
.modal { width: min(calc(100vw - 2 * var(--space-4)), calc(var(--measure-1) + 2 * var(--space-5))); border-radius: var(--radius-surface); }
.drawer { width: min(calc(100vw - var(--space-7)), calc(var(--measure-1) + 2 * var(--space-5))); max-width: none; height: 100dvh; max-height: none; margin: 0 0 0 auto; border-block: 0; border-right: 0; }
.drawer--start { margin: 0 auto 0 0; border-right: var(--line) solid var(--line-regular); border-left: 0; }
.drawer[open] { display: flex; flex-direction: column; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5); border-bottom: var(--line) solid var(--line-regular); }
.dialog__head h2 { margin: 0; font-size: var(--size-heading); font-weight: var(--weight-strong); line-height: var(--leading-heading); }
.dialog__body { flex: 1; padding: var(--space-5); overflow: auto; }
.dialog__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5); border-top: var(--line) solid var(--line-regular); }
/* ---- Sections: a page's whole bands of content ---- */
.section-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-6); }
.section-head--center { align-items: center; text-align: center; }
.hero-block > * { min-width: 0; }
.hero-block--center { display: grid; justify-items: center; text-align: center; }
.hero-block--center .display, .hero-block--center .lead { margin-inline: auto; }
.hero-block--center .actions { justify-content: center; }
.alternating { display: flex; flex-direction: column; gap: var(--space-8); }
.alternating__row > * { min-width: 0; }
.alternating__row:nth-child(even) > :first-child { order: 1; }
.content-sidebar { gap: var(--space-7); overflow: visible; }
.content-sidebar > :first-child { flex: 999 1 0; min-inline-size: min(100%, var(--measure-1)); }
.content-sidebar__aside { flex: 1 1 var(--measure-3); min-width: 0; position: sticky; top: calc(var(--header-height) + var(--space-5)); align-self: start; }
.form-section { gap: var(--space-5) var(--space-8); overflow: visible; }
.form-section > :first-child { flex: 1 1 var(--measure-3); min-width: 0; }
.form-section > :last-child { flex: 999 1 0; min-inline-size: min(100%, var(--measure-1)); }
.feature { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: var(--space-2); align-content: start; padding-top: var(--space-3); border-top: var(--line) solid var(--text); }
.feature-grid { --n: 3; --track: var(--measure-3); row-gap: var(--space-6); }
.logo-cloud { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5) var(--space-7); }
.master-detail { min-height: calc(var(--rows-visible) * var(--control-height-small)); border: var(--line) solid var(--line-regular); border-radius: var(--radius-surface); }
.master-detail__list { flex: 1 1 var(--measure-3); min-width: 0; margin-right: calc(-1 * var(--line)); background: var(--fill-surface); border-right: var(--line) solid var(--line-regular); }
.master-detail__detail { flex: 999 1 0; min-inline-size: min(100%, var(--measure-1)); margin-top: calc(-1 * var(--line)); padding: var(--space-5); border-top: var(--line) solid var(--line-regular); }
.master-detail .list { border-top: 0; }
.pricing { --n: 3; --track: var(--measure-2); align-items: stretch; }
/* Plan: a module. The lead plan is marked by the signal light on its label, never by a heavier frame */
.plan { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: var(--space-4); align-content: start; min-width: 0; padding: var(--space-6); background: var(--fill-raised); border: var(--line) solid var(--line-regular); border-radius: var(--radius-surface); box-shadow: var(--edge-light), var(--lift-1); }
.plan--lead { box-shadow: var(--edge-light), var(--lift-2); }
.plan--lead > .label::before { content: ""; width: 0.55em; height: 0.55em; flex: none; border-radius: var(--radius-round); background: var(--signal); box-shadow: var(--signal-glow); }
.plan p { margin: 0; }
.plan__price { font: var(--weight-display) var(--size-quote)/var(--leading-single) var(--font-display); letter-spacing: var(--tracking-display); }
.plan__list { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: var(--space-4) 0 0; border-top: var(--line) solid var(--line-subtle); list-style: none; font-size: var(--size-small); color: var(--text-secondary); }
.plan__list li { display: flex; gap: var(--space-2); }
.plan__list .icon { margin-top: 0.2em; color: var(--text-muted); }
.plan > .button { justify-self: start; align-self: end; }
.screen-section__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.screen-section__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.split-panels { --n: 2; --gap: 0px; --track: var(--measure-2); border: var(--line) solid var(--line-regular); border-radius: var(--radius-surface); overflow: hidden; }
.split-panels > * { min-width: 0; padding: var(--space-5); }
.split-panels > :first-child { background: var(--fill-surface); }
.team { --n: 4; --track: var(--measure-3); }
.person { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.person p { margin: 0; }
.testimonials { --n: 2; --track: var(--measure-2); }
.testimonials .quote { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
.testimonials .quote footer { align-self: end; }
.timeline { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.timeline__entry { position: relative; display: grid; grid-template-columns: var(--space-7) minmax(0, 1fr); gap: var(--space-1) var(--space-3); padding-bottom: var(--space-5); counter-increment: step; }
.timeline__entry::before { content: counter(step, decimal-leading-zero); grid-row: span 2; font: 400 var(--size-label)/var(--leading-body) var(--font-label); color: var(--text-muted); }
.timeline__entry::after { content: ""; position: absolute; top: var(--space-5); bottom: 0; left: var(--space-2); border-left: var(--line) solid var(--line-regular); }
.timeline__entry:last-child::after { display: none; }
.timeline__entry:last-child { padding-bottom: 0; }

/* ---- Layouts: the regions of a whole screen ---- */
.layout { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 100dvh; }
.layout__body { min-width: 0; }
.layout__main { flex: 999 1 0; min-width: 0; min-inline-size: min(100%, var(--measure-1)); margin-top: calc(-1 * var(--line)); padding: var(--space-6) var(--page-margin); border-top: var(--line) solid var(--line-regular); }
.layout--sidebar .layout__main, .layout--aside .layout__main, .layout--three .layout__main { padding-inline: var(--space-6); }
.layout__main > * + * { margin-top: var(--space-7); }
.layout__nav, .layout__aside { min-width: 0; padding: var(--space-5) var(--space-4); }
.layout__nav { flex: 1 1 calc(var(--measure-3) + 2 * var(--space-4)); margin-right: calc(-1 * var(--line)); border-right: var(--line) solid var(--line-regular); }
.layout__aside { flex: 1 1 var(--measure-2); margin: calc(-1 * var(--line)) 0 0 calc(-1 * var(--line)); border-top: var(--line) solid var(--line-regular); border-left: var(--line) solid var(--line-regular); }
.layout > .layout__main { margin-top: 0; border-top: 0; }
.layout--narrow .layout__main { width: min(100%, calc(var(--measure-body) + 2 * var(--page-margin))); margin-inline: auto; }
.layout--stage .layout__main { display: grid; place-items: center; }
.layout--stage .layout__main > * { width: min(100%, var(--measure-1)); }
.layout--stage .layout__main > * + * { margin-top: 0; }
.layout--fixed { height: 100dvh; }
.layout--fixed .layout__main { overflow: auto; }
.layout .sidebar { width: auto; border-right: 0; }
.details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2) var(--space-4); margin: 0; font-size: var(--size-small); }
.details dt { color: var(--text-muted); }
.details dd { margin: 0; color: var(--text); }

@media (prefers-reduced-motion: no-preference) {
  .drawer[open] { animation: slide-in var(--motion-regular) var(--ease-enter); }
  .drawer--start[open] { animation-name: slide-in-start; }
  @keyframes slide-in { from { transform: translateX(100%); } }
  @keyframes slide-in-start { from { transform: translateX(-100%); } }
}

/* Popover */
.popover { display: inline-block; }
.popover__panel { position: absolute; z-index: var(--layer-popover); top: calc(100% + var(--space-2)); left: 0; width: min(80vw, calc(var(--measure-2) + 2 * var(--space-4))); padding: var(--space-4); background: var(--raised); border: var(--line) solid var(--line-regular); border-radius: var(--radius-surface); box-shadow: var(--overlay-shadow); font-size: var(--size-small); }
.popover__panel[hidden] { display: none; }
.popover__panel[data-above] { top: auto; bottom: calc(100% + var(--space-2)); }

/* Tabs */
.tabs__list { display: flex; gap: var(--space-1); overflow-x: auto; border-bottom: var(--line) solid var(--line-regular); }
.tabs__tab { flex: none; min-height: var(--control-height-small); padding: 0 var(--space-3); background: none; border: 0; color: var(--text-secondary); font: 500 var(--size-small)/var(--leading-single) var(--font-structure); cursor: pointer; }
.tabs__tab:hover { color: var(--text); }
.tabs__tab[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); font-weight: 600; }
.tabs__tab:focus-visible { outline-offset: -2px; }
.tabs__panel { padding-top: var(--space-4); }
.tabs__panel[hidden] { display: none; }
.tabs--contained .tabs__list { width: fit-content; max-width: 100%; padding: var(--space-1); background: var(--fill-surface); border: var(--line) solid var(--line-regular); border-radius: var(--radius-control); }
.tabs--contained .tabs__tab { border-radius: var(--radius-tag); }
.tabs--contained .tabs__tab[aria-selected="true"] { background: var(--fill-invert); color: var(--canvas); box-shadow: none; }

/* List */
.list { margin: 0; padding: 0; list-style: none; border-top: var(--line) solid var(--line-regular); }
.list__item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--control-height); padding: var(--space-2) var(--space-2); border-bottom: var(--line) solid var(--line-regular); font-size: var(--size-small); }
.list__item[role="option"] { cursor: pointer; }
.list__item[role="option"]:hover { background: var(--fill-hover); }
.list__item[aria-selected="true"] { background: var(--fill-selected); }
.list__item:focus-visible { outline-offset: -2px; }
.list__title { color: var(--text); font-weight: 600; }
.list__line { display: block; color: var(--text-muted); font-size: var(--size-meta); }

/* Carousel: a sequence the reader can always stop */
.carousel { display: flex; flex-direction: column; gap: var(--space-3); }
.carousel__viewport { display: flex; gap: var(--space-4); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel__viewport::-webkit-scrollbar { display: none; }
.carousel__slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; padding: var(--space-6); background: var(--fill-tint); border-radius: var(--radius-surface); }
.carousel__slide:nth-child(2) { background: var(--fill-surface); }
.carousel__slide:nth-child(3) { background: var(--fill-surface); }
.carousel__controls { display: flex; align-items: center; gap: var(--space-2); }
.carousel__dots { display: flex; gap: var(--space-1); }
.carousel__dot { width: var(--space-5); height: var(--control-height-small); padding: 0; background: none; border: 0; cursor: pointer; }
.carousel__dot::before { content: ""; display: block; height: 3px; background: var(--fill-track); border-radius: 2px; }
.carousel__dot[aria-current="true"]::before { background: var(--text); }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(var(--measure-3), 1fr); gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); }
.kanban__column { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2); background: var(--fill-surface); border: var(--line) solid var(--line-regular); border-radius: var(--radius-surface); }
.kanban__column[data-over] { border-color: var(--text); background: var(--fill-selected); }
.kanban__head { display: flex; justify-content: space-between; align-items: center; padding: var(--space-1) var(--space-2); font: 400 var(--size-label)/var(--leading-heading) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.kanban__cards { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; min-height: var(--control-height); margin: 0; padding: 0; list-style: none; }
.kanban__card { padding: var(--space-3); background: var(--fill-raised); border: var(--line) solid var(--line-regular); border-radius: var(--radius-control); box-shadow: var(--edge-light), var(--lift-1); font-size: var(--size-small); cursor: grab; }
.kanban__card[data-dragging] { opacity: 0.5; }
.kanban__card:focus-visible { outline-offset: 0; }

/* Footer */
.footer__columns { --n: 6; --track: var(--measure-4); padding-bottom: var(--space-5); }
.footer__column h3 { margin: 0 0 var(--space-2); font: 400 var(--size-label)/var(--leading-heading) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.footer__column ul { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; padding: 0; list-style: none; font-size: var(--size-meta); }
.footer__column a, .footer__row a { color: var(--text-secondary); text-decoration: none; }
.footer__column a:hover, .footer__row a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-text); text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0ms !important; scroll-behavior: auto !important; }
  .button--primary::after, .button--warm::after { display: none; }
}

/* Module: a part of the structure (a product, a claim with its checks, a record, a figure) on the page's ground.
   Rounded, raised, a fine edge and a lit top edge, as a panel on a device */
.module { min-width: 0; padding: var(--space-5); background: var(--fill-raised); border: var(--line) solid var(--line-regular); border-radius: var(--radius-surface); box-shadow: var(--edge-light), var(--lift-1); }
.module--tint { background: var(--fill-tint); border-color: transparent; box-shadow: none; }

/* Terms: a spec list. Each term in mono capitals beside its text once the list is 368 px wide, above it below that */
.terms { container: terms / inline-size; margin: 0; max-width: calc(var(--measure-1) + var(--measure-2)); }
.terms > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1) var(--space-5); padding-block: var(--space-3); border-top: var(--line) solid var(--line-regular); }
.terms > div:last-child { border-bottom: var(--line) solid var(--line-regular); }
@container terms (width >= 368px) { .terms > div { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.terms dt { font: 700 var(--size-label)/1.9 var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text); }
.terms dd { margin: 0; font-size: var(--size-small); line-height: var(--leading-body); color: var(--text-secondary); }
.terms dd strong { color: var(--text); font-weight: var(--weight-strong); }

/* Index: a list of entries, each a task, its tag, what it does and the product link. The whole entry is the link's
   target; entries sit as modules in tracks of at least 240 px. index--rows sets one entry per row under rules, with
   the name and tag beside the text and the link at the end once there is room */
.index { display: grid; gap: var(--space-gutter); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); margin: 0; padding: 0; list-style: none; }
.index__item { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--space-2) var(--space-3); min-width: 0; padding: var(--space-5) var(--space-5); background: var(--fill-raised); border: var(--line) solid var(--line-regular); border-radius: var(--radius-surface); box-shadow: var(--edge-light), var(--lift-1); transition: border-color var(--motion-fast) var(--ease-state); }
.index__item--tint { background: var(--fill-tint); border-color: transparent; box-shadow: none; }
.index__name { margin: 0; font: 500 var(--size-lead)/1.3 var(--font-structure); letter-spacing: -0.01em; color: var(--text); }
.index__tag { order: -1; font: 400 var(--size-label)/var(--leading-label) var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); }
.index__text { margin: 0; font-size: var(--size-small); line-height: var(--leading-body); color: var(--text-secondary); max-width: 62ch; }
.index__text strong { color: var(--text); font-weight: var(--weight-strong); }
.index__link { justify-self: start; align-self: end; }
.index__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.index__item:has(.index__link:hover) { border-color: var(--accent-text); }
.index__item:has(.index__link:focus-visible) { outline: var(--line-strong) solid var(--focus); outline-offset: 2px; }
.index__link:focus-visible { outline: none; }
.index--rows { display: block; container: index / inline-size; border-top: var(--line) solid var(--line-regular); }
.index--rows .index__item { display: flex; flex-direction: column; padding: var(--space-5) var(--space-2); background: none; border: 0; border-bottom: var(--line) solid var(--line-regular); border-radius: 0; box-shadow: none; }
.index--rows .index__item--tint { padding-inline: var(--space-5); background: var(--fill-tint); }
.index--rows .index__link { align-self: flex-start; }
.index--rows .index__item:has(.index__link:hover) { border-color: var(--line-regular); background: var(--fill-hover); }
@container index (width >= 56em) {
  .index--rows .index__item { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) minmax(0, 12rem); grid-template-areas: "name text link" "tag text link"; align-items: start; }
  .index--rows .index__name { grid-area: name; }
  .index--rows .index__tag { grid-area: tag; order: 0; }
  .index--rows .index__text { grid-area: text; }
  .index--rows .index__link { grid-area: link; justify-self: end; align-self: start; }
}

/* Closing: the one closing section a page ends with, on the page's own ground. The main part (heading, first line,
   any terms) sits beside the main action once each holds measure-1, otherwise the action under it; related links
   follow in one row under a rule, wrapping at their own widths. A page without a main action leaves .closing__act out */
.closing { padding-block: var(--space-section); }
.closing__grid { display: grid; gap: var(--space-6) var(--space-7); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--measure-1)), 1fr)); align-items: end; }
.closing__main { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.closing__main > * { margin: 0; }
.closing__act { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); min-width: 0; }
.closing__act > p { margin: 0; max-width: var(--measure-1); }
.closing__related { margin-top: var(--space-7); padding-top: var(--space-5); border-top: var(--line) solid var(--line-regular); }
.closing__related:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.closing__related ul { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); margin: 0; padding: 0; list-style: none; }
.closing__related li { min-height: 24px; display: flex; align-items: center; }
