/* Components of the interface. Read tokens.css first: nothing here writes a raw colour or shadow.
   Surfaces separate by material, air and hairlines, never by boxes around content. */

/* ================================================================ base */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
/* the window's own ground is the canvas under a shell, so a short page ends in no white band */
html:has(body[data-shell]) { background: var(--canvas); }
body {
  margin: 0;
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: var(--t-body);
  line-height: 1.47;
  letter-spacing: -.006em;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* Nothing animates while the page arrives. A page whose first styles are computed before its last sheet or its
   server answer is in (a dashboard is) would otherwise play every colour, shadow and background transition once
   from the browser's own look to the product's: in the dark theme a flash of light buttons fading to dark, and
   a text measured at its colours halfway. `static/ui/core.js` takes the class off once the page has loaded. */
html.is-loading, html.is-loading *, html.is-loading *::before, html.is-loading *::after { transition: none !important; }
/* one dissolve of the whole page when the theme or colour changes (core.js, swapAppearance) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .24s; animation-timing-function: ease-out; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); text-decoration: none; }
/* A link in running text carries a quiet underline: its shape says «link» whatever the primary is, so a red
   brand's links never read as an error, which is always a dot and a word. Navigation, rows and buttons are
   not running text and keep their own forms. */
p a:not([class]), .subhead a:not([class]), .footnote a:not([class]), .sheet-sub a:not([class]), .banner-text a:not([class]) {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}
p a:not([class]):hover, .subhead a:not([class]):hover, .footnote a:not([class]):hover, .sheet-sub a:not([class]):hover, .banner-text a:not([class]):hover { text-decoration-color: currentColor; }
ul, ol { list-style: none; margin: 0; padding: 0; }
.icon { width: var(--icon-b); height: var(--icon-b); flex: none; }
kbd { font-family: var(--font); font-size: 11.5px; font-weight: var(--w-medium); color: var(--label-2); background: var(--fill-soft); border-radius: 5px; padding: 1px 5px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* the ring follows each element's own radius: no radius is forced here */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--bg-elev); padding: 8px 14px; border-radius: var(--r-pill); box-shadow: var(--shadow-pop); }
.skip-link:not(:focus) { opacity: 0; pointer-events: none; }
.skip-link:focus { top: 12px; }
.num { font-variant-numeric: tabular-nums; }
/* continuous curvature where the engine has it */
@supports (corner-shape: squircle) { .sq { corner-shape: superellipse(1.6); } }

/* ================================================================ type */
.large-title { font-size: var(--t-large); line-height: 1.15; font-weight: 650; letter-spacing: -.022em; text-wrap: balance; }
.title-2 { font-size: var(--t-title); line-height: 1.25; font-weight: var(--w-semibold); letter-spacing: -.012em; }
.headline { font-size: var(--t-head); line-height: 1.3; font-weight: var(--w-semibold); letter-spacing: -.012em; }
.subhead { font-size: var(--t-sub); color: var(--label-2); letter-spacing: -.003em; }
.footnote { font-size: var(--t-foot); color: var(--label-2); line-height: 1.45; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.link-button {
  color: var(--accent); font-size: var(--t-control); font-weight: var(--w-medium); border-radius: var(--r-xs);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}
.link-button:hover { text-decoration-color: currentColor; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; }
.page-head .subhead { margin-top: var(--s2); max-width: 64ch; }
.page-actions { display: flex; align-items: center; gap: var(--s2); }

/* ================================================================ shell: sidebar */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 30;
  display: flex; flex-direction: column;
  background: var(--canvas);
  border-right: 1px solid var(--line);
  padding: var(--s4) var(--s3);
}
.sidebar-top { padding: 4px 4px 0; }
.brand { display: flex; align-items: center; gap: var(--s3); color: var(--label); font-weight: 650; font-size: 16px; letter-spacing: -.02em; height: 34px; padding: 0 var(--s2); border-radius: var(--r-sm); }
.brand-mark { width: 22px; height: 22px; color: var(--accent); display: inline-flex; }
.brand-mark svg { width: 22px; height: 22px; }
.search-field {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; margin: var(--s4) 0 var(--s3); padding: 0 var(--s2) 0 var(--s3);
  border-radius: var(--r-sm); background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--label-2); font-size: 13.5px; text-align: left;
  transition: box-shadow var(--fade) var(--ease-out);
}
.search-field:hover { box-shadow: 0 0 0 1px var(--line-strong); }
.search-field kbd { background: var(--track); border-radius: 5px; padding: 1px 6px; font-family: var(--mono); font-size: 11px; }
.search-field .icon { width: var(--icon-m); height: var(--icon-m); }
.search-field span { flex: 1; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 0 12px; scrollbar-width: none; }
/* Six groups in a 900 px window: rows of 28 px and 14 px between groups keep the list on one screen. A group's
   name is a quiet word in sentence case, not a label in capitals. */
.nav-group { margin-top: 14px; }
.nav-group-label { font-size: var(--t-foot); font-weight: var(--w-medium); letter-spacing: 0; text-transform: none; color: var(--label-2); padding: var(--s1) var(--s3); }
.nav-group-label::first-letter { text-transform: uppercase; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 28px; padding: 3px var(--s3); margin: 1px 0;
  border-radius: 7px; color: var(--label); font-size: var(--t-control); font-weight: 450;
  transition: background-color var(--fade) var(--ease-out);
}
.nav-link .icon { width: var(--icon-m); height: var(--icon-m); color: var(--label-2); }
.nav-link:hover { background: var(--side-hover); }
/* the primary is the colour of where a person is: the current entry's tint and ink */
.nav-link[aria-current='page'], .nav-link[aria-current='page']:hover { background: var(--primary-tint); color: var(--primary-ink); font-weight: var(--w-semibold); }
.nav-link[aria-current='page'] .icon { color: var(--primary-ink); }
/* a row that just received something (a pinned chart): one soft pulse of the accent */
.nav-link.is-receiving { animation: receive 900ms var(--ease-out); }
@keyframes receive { 0% { background-color: transparent; } 25% { background-color: var(--accent-soft); } 100% { background-color: transparent; } }
.nav-link[aria-current='page'].is-receiving { animation-name: receive-current; }
@keyframes receive-current { 0% { background-color: var(--primary-tint); } 25% { background-color: var(--accent-soft); } 100% { background-color: var(--primary-tint); } }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: var(--s3); }
.user-button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin-top: 2px; border-radius: var(--r-sm); text-align: left; transition: background-color var(--fade) var(--ease-out); }
.user-button:hover { background: var(--side-hover); }
.user-button > .icon { width: var(--icon-m); height: var(--icon-m); color: var(--label-3); }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--track); font-size: 11.5px; font-weight: var(--w-semibold); color: var(--label); flex: none; letter-spacing: 0; }
.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.user-name { font-size: 13.5px; font-weight: 550; }
.user-role { font-size: 12px; color: var(--label-2); }
.version { font-size: 11.5px; color: var(--label-2); padding: 8px 10px 0; }
.scrim { display: none; }
/* the sidebar plane is painted on the page too, so a full-page capture or a long page never
   shows the plane ending under the fixed sidebar */
body[data-shell] { min-height: 100dvh; background: var(--canvas); }
/* the window's own ground is the canvas under a shell at every width: a short page otherwise ended in a white band
   under the body, where the page's white ground showed through (the demo's `colour-shell.css:115-119`) */
html:has(body[data-shell]) { background: var(--canvas); }
@media (min-width: 901px) {
  /* the menu is a fixed column that a capture of a long page cuts at the window's height: its hairline is
     also drawn on the body, as tall as the page, so the edge never seems to end */
  body[data-shell] {
    background:
      linear-gradient(var(--line), var(--line)) calc(var(--sidebar-w) - 1px) 0 / 1px 100% no-repeat,
      var(--canvas);
  }
}
/* The text sits on the page's own colour, not on the gradient: the contrast proof
   (`tests/accessibility/test_served.py`) can measure a text only over a single colour. */
body[data-shell] main, .toolbar:not(.is-scrolled) { background-color: var(--canvas); }

/* ================================================================ shell: toolbar */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  margin-left: var(--sidebar-w);
  height: var(--toolbar-h); padding: 0 20px 0 var(--page-x);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  container-type: inline-size;
  background: transparent;
  transition: background-color .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
/* the material appears only once something scrolls beneath: there is nothing to blur before */
.toolbar.is-scrolled {
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 1px 0 var(--line);
}
.toolbar-lead { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.toolbar .sidebar-button { display: none; }
.toolbar-title {
  font-size: 14px; font-weight: var(--w-semibold); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-width: 0; justify-self: center;
  opacity: 0; transform: translateY(6px);
  transition: opacity .25s var(--ease-out), transform var(--spring-snappy-d) var(--spring-snappy);
}
.toolbar.show-title .toolbar-title { opacity: 1; transform: none; }
.toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.back-link { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 10px 0 4px; margin-left: -8px; border-radius: var(--r-pill); font-size: 14px; font-weight: var(--w-medium); color: var(--label-2); transition: background-color var(--fade); }
.back-link:hover { background: var(--track); color: var(--label); }
.back-link .icon { width: var(--icon-l); height: var(--icon-l); }
/* The toolbar is its own container: the back link keeps its word only when the toolbar has room
   for it beside the compact title. Under 900 px the media rule hides it too; between 901 and the
   width where the title and the actions leave room (the sidebar still takes 252 px) only the
   toolbar's own width tells. The word stays in the accessible name, as at 623. */
@container (max-width: 900px) {
  .back-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* something new that is not an error: the one place the tertiary marks the shell */
.bell-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--evidence); box-shadow: 0 0 0 2px var(--canvas); }


main { margin-left: var(--sidebar-w); padding: 0 var(--page-x) 120px; }
main:focus { outline: none; }

/* ================================================================ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--control-h); padding: 0 16px;
  border-radius: var(--r-pill); font-size: var(--t-control); font-weight: 550; white-space: nowrap;
  transition: background-color var(--fade) var(--ease-out), color var(--fade), box-shadow var(--fade), transform .35s var(--spring-snappy);
}
.btn .icon { width: var(--icon-m); height: var(--icon-m); }
.btn:active { transform: scale(.96); }
.btn[disabled] { opacity: .45; pointer-events: none; }
/* disabled but still reachable by keyboard and screen reader, so it can say why */
.btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }
.btn[aria-busy='true'] { opacity: 1; }
/* the primary button is the ink of an action; the secondary one a white face with a hairline */
.btn--primary { background: var(--accent-fill); color: var(--on-accent); box-shadow: none; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--gray, .btn--danger { background: var(--card); color: var(--label); box-shadow: 0 0 0 1px var(--line-strong); }
.btn--gray:hover, .btn--danger:hover { background: var(--track); }
.btn--plain { color: var(--accent); padding: 0 12px; }
.btn--plain:hover { background: var(--track); }
.btn--danger { color: color-mix(in srgb, var(--negative) 82%, var(--label)); }
.btn--icon { width: var(--control-h); padding: 0; }
.btn--large { height: 44px; font-size: var(--t-body); padding: 0 22px; }
.btn--block { width: 100%; }
.btn .spin { width: 17px; height: 17px; }

.icon-button {
  position: relative; display: inline-grid; place-items: center; width: var(--control-h); height: var(--control-h); border-radius: 50%;
  color: var(--label-2); transition: background-color var(--fade) var(--ease-out), color var(--fade), transform .3s var(--spring-snappy);
}
.icon-button:hover { background: var(--track); color: var(--label); }
.icon-button:active { transform: scale(.96); background: var(--fill); }
.icon-button[aria-expanded='true'] { background: var(--fill); color: var(--label); }

/* the follow-up capsule: grey, quiet, the whole question readable */
.capsule {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--control-h); padding: 7px 15px; border-radius: var(--r-sm);
  background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--label); font-size: var(--t-control); text-align: left; line-height: 1.35;
  transition: background-color var(--fade) var(--ease-out), transform .35s var(--spring-snappy);
}
.capsule .icon { width: var(--icon-m); height: var(--icon-m); color: var(--label-2); }
.capsule:hover { background: var(--card); box-shadow: 0 0 0 1px var(--line-strong); }
.capsule:active { transform: scale(.96); }

/* ================================================================ segmented, toggle, pop-up */
.segmented { position: relative; display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill-soft); isolation: isolate; }
.segmented [role='radio'] { position: relative; z-index: 1; height: 28px; padding: 0 12px; border-radius: var(--r-xs); font-size: var(--t-sub); font-weight: var(--w-medium); color: var(--label-2); display: inline-flex; align-items: center; gap: 6px; transition: color var(--fade); }
.segmented [role='radio'] .icon { width: var(--icon-m); height: var(--icon-m); }
.segmented [role='radio']:hover { color: var(--label); }
/* weight stays the same when checked, so the segments never change width under the thumb */
.segmented [role='radio'][aria-checked='true'] { color: var(--label); background: var(--thumb); box-shadow: var(--shadow-thumb); }
.seg-thumb { position: absolute; z-index: 0; top: 2px; left: 0; width: var(--w, 0); transform: translateX(var(--x, 0)); height: 28px; border-radius: var(--r-xs); background: var(--thumb); box-shadow: var(--shadow-thumb); }

.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--label); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { position: relative; width: 38px; height: 22px; border-radius: var(--r-pill); background: var(--fill-press); transition: background-color .25s var(--ease-out); flex: none; }
.toggle-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: var(--shadow-knob); transition: transform var(--spring-snappy-d) var(--spring-snappy); }
.toggle input:checked + .toggle-track { background: var(--accent-fill); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-track { outline: 3px solid var(--focus); outline-offset: 2px; }

/* pop-up button (filters): text with a double chevron, as a macOS pop-up */
.popup { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 12px; border-radius: 8px; font-size: 13.5px; font-weight: var(--w-medium); background: var(--fill-soft); transition: background-color var(--fade); white-space: nowrap; }
.popup:hover, .popup[aria-expanded='true'] { background: var(--fill); }
.popup .icon { width: var(--icon-s); height: var(--icon-s); color: var(--label-2); }
.popup.is-set { color: var(--accent); }

/* ================================================================ form controls */
.form { display: flex; flex-direction: column; gap: var(--s5); }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fieldset { border: 0; margin: 0; padding: 0; }
.fieldset > legend { padding: 0; margin-bottom: 6px; }
/* a collapsed reveal takes no room: it cancels the gap the form puts before it */
.form > .reveal { margin-top: calc(var(--s5) * -1); }
.form-label { font-size: var(--t-sub); font-weight: var(--w-semibold); color: var(--label); }
.form-label .optional { font-weight: var(--w-regular); color: var(--label-2); margin-left: 4px; }
.form-help { font-size: var(--t-foot); color: var(--label-2); line-height: 1.45; }
.form-error { display: flex; align-items: flex-start; gap: 6px; font-size: var(--t-foot); color: var(--negative); line-height: 1.45; }
.form-error .icon { width: var(--icon-s); height: var(--icon-s); margin-top: 1px; }
.input {
  width: 100%; height: var(--field-h); padding: 0 12px; border: 0; border-radius: var(--r-sm);
  background: var(--fill-soft); box-shadow: inset 0 0 0 var(--hairline) var(--sep);
  font-size: var(--t-body); color: var(--label); outline: none;
  transition: background-color var(--fade) var(--ease-out), box-shadow var(--fade) var(--ease-out);
}
.input::placeholder { color: var(--placeholder); }
.input:hover { background: var(--fill); }
.input:focus { background: var(--bg-elev); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--label) 55%, transparent), 0 0 0 3px var(--fill-strong); }
.input[aria-invalid='true'] { box-shadow: inset 0 0 0 1px var(--negative); }
.input[aria-invalid='true']:focus { box-shadow: inset 0 0 0 1px var(--negative), 0 0 0 4px color-mix(in srgb, var(--negative) 14%, transparent); }
/* the mask of a password is drawn in the system face: WebKit keeps a mask laid out before the web
   font arrived (a value filled at load, autofill) as missing-glyph boxes */
.input[type='password'] { font-family: var(--font-system); }
.input--code { font-family: var(--mono); font-size: 18px; letter-spacing: .32em; text-align: center; height: 48px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 44px; }
.input-wrap .icon-button { position: absolute; right: 3px; width: 34px; height: 34px; }
.select { position: relative; display: block; }
.select select { appearance: none; -webkit-appearance: none; width: 100%; height: var(--field-h); padding: 0 34px 0 12px; border: 0; border-radius: var(--r-sm); background: var(--fill-soft); box-shadow: inset 0 0 0 var(--hairline) var(--sep); font-size: var(--t-body); outline: none; }
.select select:focus-visible { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--label) 55%, transparent), 0 0 0 3px var(--fill-strong); }
.select .icon { position: absolute; right: 11px; top: 50%; width: var(--icon-s); height: var(--icon-s); margin-top: -7px; color: var(--label-2); pointer-events: none; }

/* the search field of a list page: the sidebar's search, one size up */
.search { position: relative; display: flex; align-items: center; width: min(320px, 100%); }
.search > .icon { position: absolute; left: 11px; width: var(--icon-m); height: var(--icon-m); color: var(--label-2); pointer-events: none; }
.search .input { height: 34px; padding-left: 34px; padding-right: 34px; font-size: var(--t-control); }
.search input::-webkit-search-cancel-button { display: none; }
.search .search-clear { position: absolute; right: 4px; width: 26px; height: 26px; }
.search .search-clear .icon { width: var(--icon-s); height: var(--icon-s); }

/* choice rows (radio) and checkboxes: one hairline list, the mark at the leading edge */
.choice-list { border-radius: var(--r-md); box-shadow: inset 0 0 0 var(--hairline) var(--sep-strong); overflow: hidden; }
.choice { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; cursor: pointer; transition: background-color var(--fade); }
.choice + .choice { box-shadow: 0 calc(var(--hairline) * -1) 0 var(--sep); }
.choice:hover { background: var(--fill-soft); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-mark { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--sep-strong); display: grid; place-items: center; transition: background-color var(--fade), box-shadow var(--fade); }
.choice-mark::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--on-accent); transform: scale(0); transition: transform var(--spring-snappy-d) var(--spring-snappy); }
.choice input:checked + .choice-mark { background: var(--accent-fill); box-shadow: none; }
.choice input:checked + .choice-mark::after { transform: scale(1); }
.choice input[type='checkbox'] + .choice-mark { border-radius: 6px; }
.choice input[type='checkbox'] + .choice-mark::after { width: 11px; height: 6px; border-radius: 0; background: none; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg) scale(0); }
.choice input[type='checkbox']:checked + .choice-mark::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.choice input:focus-visible + .choice-mark { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.choice-title { font-size: var(--t-control); font-weight: var(--w-medium); }
.choice-sub { font-size: var(--t-foot); color: var(--label-2); margin-top: 2px; }

/* a section that appears inside a form when a choice needs more (progressive disclosure) */
.reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--spring-smooth-d) var(--spring-smooth); }
.reveal > div { overflow: hidden; min-height: 0; }
.reveal.is-open { grid-template-rows: 1fr; }
.reveal-inner { padding-top: var(--s5); }

/* ================================================================ popovers and menus */
.popover {
  position: fixed; left: var(--left, 0); top: var(--top, 0); transform-origin: var(--origin, left top); z-index: 60; min-width: 220px; max-width: min(360px, calc(100vw - 24px)); max-height: var(--max-h, calc(100dvh - 24px)); overflow-y: auto; overscroll-behavior: contain; padding: 6px;
  border-radius: var(--r-md); background: color-mix(in srgb, var(--bg-elev) 93%, transparent);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow-pop);
}
.popover--wide { width: 340px; }
.menu-item, .notif { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 6px 10px; border-radius: 8px; font-size: var(--t-control); text-align: left; color: var(--label); }
.menu-item .icon { width: var(--icon-m); height: var(--icon-m); color: var(--label-2); }
.menu-item:hover, .menu-item:focus-visible, .notif:hover, .notif:focus-visible { background: var(--accent-fill); color: var(--on-accent); outline: none; }
.menu-item:hover .icon, .menu-item:focus-visible .icon, .menu-item:hover .menu-hint, .menu-item:focus-visible .menu-hint { color: var(--on-accent-2); }
.menu-item.is-danger { color: var(--negative); }
.menu-item.is-danger .icon { color: var(--negative); }
.menu-item.is-danger:hover, .menu-item.is-danger:focus-visible { background: var(--negative); color: var(--white); }
.menu-item.is-danger:hover .icon, .menu-item.is-danger:focus-visible .icon { color: var(--white); }
.menu-item[aria-checked='true']::after { content: ''; width: 10px; height: 5px; margin-left: auto; border: 2px solid currentColor; border-top: 0; border-right: 0; transform: translateY(-2px) rotate(-45deg); }
.menu-text { flex: 1; }
.menu-hint { font-size: var(--t-sub); color: var(--label-2); }
.menu-status { font-size: var(--t-sub); color: var(--label-2); }
.menu-note { padding: 0 10px 6px; line-height: 1.35; }
.menu-sep { height: var(--hairline); background: var(--sep-strong); margin: 6px 10px; }
.menu-heading { font-size: 12px; font-weight: var(--w-semibold); color: var(--label-2); padding: 8px 10px 4px; }
.menu-heading--big { font-size: var(--t-control); color: var(--label); padding: 8px 10px 6px; }
.menu-card { display: flex; gap: 12px; align-items: center; padding: 8px 10px 10px; }
.menu-card-name { font-weight: var(--w-semibold); font-size: var(--t-control); }
.menu-card-sub { font-size: var(--t-foot); color: var(--label-2); }
.notif { align-items: flex-start; padding: 9px 10px; }
.notif-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.notif-dot.is-read { background: transparent; }
.notif-title { display: block; font-size: 13.5px; line-height: 1.35; }
.notif-time { display: block; font-size: 12px; color: var(--label-2); margin-top: 2px; }
.notif:hover .notif-time, .notif:focus-visible .notif-time { color: var(--on-accent-2); }
.notif:hover .notif-dot, .notif:focus-visible .notif-dot:not(.is-read) { background: var(--white); }

/* ================================================================ ⌘K: Spotlight's shape */
.palette-layer { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: flex; justify-content: center; padding-top: 14vh; }
.palette {
  width: min(620px, calc(100vw - 32px)); max-height: 60vh; display: flex; flex-direction: column; overflow: hidden; align-self: flex-start;
  border-radius: var(--r-lg); background: color-mix(in srgb, var(--bg-elev) 95%, transparent);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--shadow-pop);
}
.palette-field { display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 58px; border-bottom: var(--hairline) solid var(--sep); }
.palette-field .icon { width: var(--icon-l); height: var(--icon-l); color: var(--label-2); }
.palette-field input { flex: 1; min-width: 0; border: 0; background: none; font-size: var(--t-read); letter-spacing: -.015em; outline: none; }
.palette-field input::placeholder { color: var(--placeholder); }
.palette-list { overflow-y: auto; padding: 6px 8px 8px; }
.palette-group { font-size: 12px; font-weight: var(--w-semibold); color: var(--label-2); padding: 12px 12px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 12px; border-radius: var(--r-sm); font-size: 14.5px; cursor: pointer; }
.palette-item .icon { width: var(--icon-m); height: var(--icon-m); color: var(--label-2); }
.palette-item[aria-selected='true'] { background: var(--accent-fill); color: var(--on-accent); }
.palette-item[aria-selected='true'] .icon { color: var(--on-accent); }
.palette-empty { padding: 18px 12px; color: var(--label-2); font-size: var(--t-control); }
.palette-foot { display: flex; gap: 18px; padding: 10px 20px; border-top: var(--hairline) solid var(--sep); font-size: 12px; color: var(--label-2); }
.palette-foot kbd { margin-right: 3px; }

/* ================================================================ inspector: a sheet from the trailing edge */
.sheet-layer { position: fixed; inset: 0; z-index: 70; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); }
.sheet {
  position: absolute; top: 10px; right: 10px; bottom: 10px; width: min(480px, calc(100vw - 20px));
  display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-pop); overflow: hidden;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 18px 16px 10px 28px; }
.sheet-head h2 { font-size: 19px; font-weight: 650; letter-spacing: -.018em; }
.sheet-body { overflow-y: auto; padding: 4px 28px 32px; }
.sheet-section { font-size: var(--t-sub); font-weight: var(--w-semibold); color: var(--label-2); margin: 8px 0 10px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0 20px; margin: 0 0 28px; font-size: var(--t-control); }
.facts dt { color: var(--label-2); padding: 9px 0; border-bottom: var(--hairline) solid var(--sep); }
.facts .muted { color: var(--label-2); font-size: var(--t-sub); }
.facts dd { margin: 0; padding: 9px 0; border-bottom: var(--hairline) solid var(--sep); font-variant-numeric: tabular-nums; }
.facts dd .icon { width: var(--icon-s); height: var(--icon-s); color: var(--positive); vertical-align: -2px; margin-right: 4px; }

/* ================================================================ dialog: a form sheet anchored at a fixed top
   Built on <dialog> (focus trap, Esc, inert page for free). Header and footer stay put, the body
   scrolls when the form is taller than the window. The top edge never moves: a dialog centred
   vertically jumps by half of every change of its body (a field that appears, an error under a
   field), so it grows downwards instead, the way the sign-in column does. */
.dialog {
  --dialog-top: max(48px, 10vh);
  margin: var(--dialog-top) auto auto;
  width: min(520px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - var(--dialog-top) - 24px)); padding: 0; border: 0;
  border-radius: var(--r-lg); background: var(--bg-elev); color: var(--label); box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; }
.dialog::backdrop { background: var(--scrim); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding: 24px 16px 4px 28px; }
.dialog-head h2 { font-size: 19px; font-weight: 650; letter-spacing: -.018em; line-height: 1.3; }
.dialog-head p { margin-top: 6px; font-size: var(--t-control); color: var(--label-2); line-height: 1.5; }
.dialog-head .icon-button { margin-top: -6px; }
.dialog-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 28px 8px; overscroll-behavior: contain; }
.dialog > form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 20px; }
.dialog-lead { font-size: var(--t-control); color: var(--label-2); line-height: 1.5; margin-bottom: var(--s4); }
.dialog-lead strong { color: var(--label); font-weight: var(--w-semibold); }
.dialog.is-scrolling .dialog-foot { box-shadow: 0 calc(var(--hairline) * -1) 0 var(--sep); }
.dialog.is-scrolling .dialog-head { box-shadow: 0 var(--hairline) 0 var(--sep); }

/* alert: the short confirmation, centred text, two equal buttons */
.alert-layer { position: fixed; inset: 0; z-index: 85; background: var(--scrim); display: grid; place-items: center; padding: 20px; }
.alert { width: min(380px, 100%); padding: 26px 24px 18px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-pop); text-align: center; }
.alert h2 { font-size: 17px; font-weight: 650; letter-spacing: -.012em; }
.alert p { margin-top: 8px; font-size: var(--t-control); color: var(--label-2); line-height: 1.5; }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }

/* ================================================================ toast */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; min-height: 44px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--label) 92%, transparent); color: var(--bg); font-size: var(--t-control); font-weight: var(--w-medium);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow-pop);
}
.toast:not(:has(.toast-action)) { padding-right: 18px; }
.toast-action { color: inherit; font-weight: 650; padding: 4px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--bg) 18%, transparent); }

/* ================================================================ tables */
.table-wrap { overflow-x: auto; margin: 0 -12px; }
/* tabular figures only where numbers line up (.r, .num): in Inter they also widen hyphens */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.table .r, .table .num { font-variant-numeric: tabular-nums; }
.table th { position: relative; text-align: left; font-size: 12.5px; font-weight: var(--w-semibold); color: var(--label-2); padding: 0 12px 10px; border-bottom: var(--hairline) solid var(--sep-strong); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: var(--hairline) solid var(--sep); white-space: nowrap; }
/* a table whose cells hold sentences: the text wraps inside its column instead of widening
   the table, and the first cell keeps room for the row's name on a phone, where the mobile
   rule below lets it shrink to one letter with `overflow-wrap: anywhere`. */
.table--wrap td { white-space: normal; }
.table--wrap td:first-child { min-width: 13ch; }
.table tbody tr:last-child td { border-bottom: 0; }
/* «Tabelle: Compatte» of the preferences: the same rows with less air above and below */
[data-density='compact'] .table td { padding-block: 6px; }
[data-density='compact'] .table th { padding-bottom: 6px; }
.table .r { text-align: right; }
.table tbody tr:hover td { background: var(--fill-soft); }
.table tbody tr:hover td:first-child { border-radius: 8px 0 0 8px; }
.table tbody tr:hover td:last-child { border-radius: 0 8px 8px 0; }
.table .muted { color: var(--label-2); }
.table tr.is-peak td:first-child { font-weight: var(--w-semibold); }
/* A table is a card: the wrapper takes the card's ground, one hairline and the card's corners, so the rows
   have a surface of their own and the page reads as ordered cards on the canvas. The wrapper already scrolls
   sideways and its clip rounds the corners; its bleed of -12px is gone, because the card is the edge. A table
   inside a dialog, a sheet or a widget keeps the surface it is in. The wrapper's conditions are in `:where()`: they add
   no weight, so a page's own rule for its cells (the history's day label) still wins. */
.table-wrap:where(:has(> .table):not(.w-table *, .dialog *, .sheet-layer *)) {
  margin: 0 0 var(--s4); border-radius: var(--radius); background: var(--card); box-shadow: var(--card-shadow);
}
/* The measures below are for a wide screen: on a phone the lists of history, users and groups turn each row into a
   block of two lines with its own padding (`pages/history.css`, `pages/people.css`), and cells with padding here
   would outrank them. */
@media (min-width: 641px) {
  :where(.table-wrap:has(> .table):not(.w-table *, .dialog *, .sheet-layer *)) .table th {
    padding: 14px 16px 10px; border-bottom-color: var(--line); background: var(--card);
  }
  :where(.table-wrap:has(> .table):not(.w-table *, .dialog *, .sheet-layer *)) .table td {
    padding: 14px 16px; border-bottom-color: var(--line);
  }
  :where(.table-wrap:has(> .table):not(.w-table *, .dialog *, .sheet-layer *)) .table tbody tr:hover td {
    background: var(--track); border-radius: 0;
  }
  :where(.table-wrap:has(> .table):not(.w-table *, .dialog *, .sheet-layer *)) .table tbody tr.is-selected td { background: var(--accent-soft); }
  /* the row's menu button draws 5px past its own box: it keeps clear of the cell's edge, or the card scrolls by a pixel */
  :where(.table-wrap:has(> .table):not(.w-table *, .dialog *, .sheet-layer *)) .table :is(th, td).col-menu { padding-left: 0; }
  :where(.table-wrap:has(> .table):not(.w-table *, .dialog *, .sheet-layer *)) .table .row-menu { margin-right: var(--s1); }
  /* the first column is the row's name: the primary ink and a medium weight; figures stay on the right */
  :where(.table-wrap:has(> .table):not(.w-table *, .dialog *, .sheet-layer *)) .table tbody td:first-child:not(.col-check) { color: var(--label); font-weight: var(--w-medium); }
}
:where(.table-wrap:has(> .table):not(.w-table *, .dialog *, .sheet-layer *)) .table tbody tr:last-child td { border-bottom: 0; }
:where(.table-wrap:has(> .table):not(.w-table *, .dialog *, .sheet-layer *)) .table th { white-space: nowrap; }
@media (max-width: 640px) {
  /* the pinned first column of a phone takes the card's ground, not the page's */
  :where(.table-wrap:has(> .table):not(.w-table *, .dialog *, .sheet-layer *)) .table:not(.users-table) :is(th, td):first-child { background: var(--card); }
}
/* a sortable header is a button; the arrow shows only on the sorted column */
.th-sort { display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; border-radius: 5px; }
.th-sort:hover { color: var(--label); }
.th-sort .icon { width: var(--icon-s); height: var(--icon-s); opacity: 0; transition: transform .3s var(--spring-snappy), opacity var(--fade); }
[aria-sort='ascending'] .th-sort .icon, [aria-sort='descending'] .th-sort .icon { opacity: 1; }
[aria-sort='descending'] .th-sort .icon { transform: rotate(180deg); }
/* the row menu button: present always for the keyboard, quiet until the row is hovered */
.row-menu { width: 30px; height: 30px; color: var(--label-2); }
.row-menu .icon { width: var(--icon-m); height: var(--icon-m); }
@media (hover: hover) {
  .table tbody tr:not(:hover):not(:focus-within) .row-menu:not([aria-expanded='true']) { color: var(--label-3); }
}

/* a person cell: initials, name, email */
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.person-name { font-weight: var(--w-medium); color: var(--label); }
.person-mail { font-size: var(--t-foot); color: var(--label-2); overflow: hidden; text-overflow: ellipsis; }
/* a state is a dot and a word, never the colour alone: a soft ground of the state, a dot in its colour, the word
   in the ink. Green, amber and red are the states' and no installation's, so a red brand never reads as an error. */
.state {
  --tone: var(--label-2);
  display: inline-flex; align-items: center; gap: var(--s2); padding: 2px var(--s2) 2px 6px; border-radius: var(--r-pill);
  background: var(--track); color: var(--label);
}
.state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); flex: none; }
.state.is-on { --tone: var(--ok); background: var(--ok-soft); }
.state.is-warn { --tone: var(--warn); background: var(--warn-soft); }
.state.is-fail { --tone: var(--bad); background: var(--bad-soft); }
.state.is-now { --tone: var(--label-2); background: var(--track); }
/* in a table a state is the demo's pill (`demo-focus`, `colour-tables.css:83-96`): a larger shape with
   an 8 px dot and a medium word, on the demo's 7 px gap (`static/ui/components.css:459` of `demo-focus`). It reaches
   every table of the product, which is the point: the users, the groups, the history, the loads and the glossary's
   check wear the same pill. */
.table .state { gap: 7px; padding: 3px 12px 3px 10px; font-weight: var(--w-medium); }
.table .state::before { width: 8px; height: 8px; }

/* a technical name inside words or a row (table, column, reference): the mono face, no fill */
.code-inline { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; font-weight: var(--w-regular); color: var(--label); }

/* a search hit inside a name or a sentence */
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ================================================================ empty state and messages */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px 24px 56px; }
/* the icon sits in a neutral disc: a state of the page with nothing in it, not a mark over it */
.empty > .icon { box-sizing: content-box; width: var(--icon-xl); height: var(--icon-xl); padding: var(--s4); border-radius: 50%; background: var(--track); color: var(--label-2); margin-bottom: 14px; }
.empty h3 { font-size: 17px; font-weight: var(--w-semibold); letter-spacing: -.012em; }
.empty p { margin-top: 6px; max-width: 44ch; font-size: var(--t-control); color: var(--label-2); line-height: 1.5; }
.empty .btn { margin-top: 18px; }
/* a message in the page's flow, after something did not happen: a title, a sentence, the moves */
.outcome { max-width: 60ch; }
.outcome-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: var(--w-semibold); letter-spacing: -.012em; }
.outcome-title .icon { width: var(--icon-l); height: var(--icon-l); color: var(--negative); }
.outcome p { margin-top: 8px; font-size: var(--t-body); color: var(--label-2); line-height: 1.55; }
.outcome p strong { color: var(--label); font-weight: var(--w-semibold); }
.outcome-moves { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }

/* ================================================================ indicators */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s6); }
.kpi-label { font-size: var(--t-sub); color: var(--label-2); font-weight: var(--w-medium); }
.kpi-value { margin-top: 6px; font-size: var(--figure); line-height: 1.05; font-weight: var(--w-semibold); letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-unit { font-size: 17px; font-weight: 550; color: var(--label-2); letter-spacing: -.01em; margin-left: 3px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: var(--t-sub); color: var(--label-2); }
.delta { font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.delta.up { color: var(--positive); }
.delta.down { color: var(--negative); }
.kpi .spark { margin-top: 14px; width: 100%; height: 28px; }

/* ================================================================ charts */
.chart { display: block; overflow: visible; font-family: var(--font); }
.chart:focus-visible { outline-offset: 6px; border-radius: var(--r-xs); }
.chart-rule { stroke: var(--sep-strong); stroke-width: .75; stroke-dasharray: 2 3; }
.chart-base { stroke: var(--sep-strong); stroke-width: 1; }
.chart-axis { fill: var(--label-2); font-size: 11.5px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.mark-col { transform-box: fill-box; transform-origin: 50% 100%; transition: opacity var(--fade) var(--ease-out); }
.mark-col.is-dim { opacity: .35; }
.tone-accent { fill: var(--accent); stroke: var(--accent); }
.tone-muted { fill: var(--mark-muted); stroke: var(--mark-muted-line); }
.tone-accent-soft { fill: var(--accent-soft-2); }
.mark-col, .mark-bar { stroke: none; }
.mark-line { fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.mark-line.tone-muted { stroke-width: 1.75; }
.mark-area { stroke: none; opacity: .14; }
.mark-end { stroke: var(--bg); stroke-width: 2; }
.chart-cursor-rule { stroke: var(--label-3); stroke-width: 1; }
.chart-cursor-dot { stroke: var(--bg); stroke-width: 2.5; }
.mark-bar { transform-box: fill-box; transform-origin: 0 50%; }
.bar-label { fill: var(--label); font-size: 13px; }
.bar-value { fill: var(--label-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bar-value.is-caution { fill: var(--caution); font-weight: var(--w-semibold); }
.bar-ref { stroke: var(--label-3); stroke-width: 1; stroke-dasharray: 2 3; }
.spark { display: block; overflow: visible; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; }
.spark circle { fill: var(--accent); }

/* ================================================================ SQL and codes (the only monospace) */
.sql { margin: 0; padding: 18px 20px; border-radius: var(--r-md); background: var(--bg-group); font-family: var(--mono); font-size: 12.5px; line-height: 1.7; overflow-x: auto; white-space: pre; color: var(--label); }
.sql .k { color: var(--accent); font-weight: var(--w-medium); }
.sql .s { color: var(--label-2); }
.code-value { font-family: var(--mono); font-size: 20px; letter-spacing: .06em; }

/* ================================================================ the steps of a turn
   Five steps, each with a mark that is waiting (ring), working (a turning arc), done (a disc
   that springs in and a check that draws itself) or failed. The line between two marks fills
   with the accent when the step above is done. */
.turn { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: var(--s7); align-items: start; }
.turn.is-plain { grid-template-columns: minmax(0, 1fr); }
.steps { display: flex; flex-direction: column; }
.step { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; column-gap: 14px; padding-bottom: 20px; }
.step:last-child { padding-bottom: 0; }
.step::before, .step::after { content: ''; position: absolute; left: 11.5px; top: 30px; bottom: 6px; width: 1px; border-radius: 1px; }
.step::before { background: var(--sep-strong); }
.step::after { background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform var(--spring-smooth-d) var(--spring-smooth); }
.step.is-done::after { transform: scaleY(1); }
.step:last-child::before, .step:last-child::after { display: none; }
.step-mark { position: relative; grid-row: 1 / span 2; width: 24px; height: 24px; }
.step-mark svg { position: absolute; inset: 0; width: 24px; height: 24px; overflow: visible; }
.m-ring { fill: none; stroke: var(--sep-strong); stroke-width: 1.5; transition: stroke var(--fade); }
.m-disc { fill: var(--accent-fill); opacity: 0; transform: scale(.55); transform-origin: 12px 12px; transition: transform var(--spring-snappy-d) var(--spring-snappy), opacity 120ms var(--ease-out); }
.m-check, .m-bang { fill: none; stroke: var(--on-accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.m-check { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 240ms var(--ease-out) 70ms; }
.m-bang { opacity: 0; }
.step-spin { opacity: 0; transition: opacity var(--fade); }
.step-spin circle { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 18 100; }
.step.is-current .step-spin { opacity: 1; animation: spin 1s linear infinite; }
.step.is-current .m-ring { stroke: var(--sep); }
.step.is-done .m-disc, .step.is-failed .m-disc { transform: scale(1); opacity: 1; }
.step.is-done .m-check { stroke-dashoffset: 0; }
.step.is-failed .m-disc { fill: var(--negative); }
.step.is-failed .m-bang { opacity: 1; }
.step-title { font-size: var(--t-body); font-weight: var(--w-medium); color: var(--label-2); line-height: 24px; transition: color var(--fade); }
.step.is-current .step-title, .step.is-done .step-title, .step.is-failed .step-title { color: var(--label); }
.step-time { font-size: var(--t-sub); color: var(--label-2); line-height: 24px; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity var(--fade); }
.step.is-done .step-time { opacity: 1; }
/* the description has its own line; «doing» leaves before «done» arrives, so the two
   sentences are never on screen together */
.step-desc { grid-column: 2 / span 2; position: relative; min-height: 19px; font-size: var(--t-sub); line-height: 19px; color: var(--label-2); }
.step-desc span { display: block; transition: opacity 160ms var(--ease-out) 110ms, transform var(--spring-smooth-d) var(--spring-smooth) 110ms; }
.step-desc span + span { position: absolute; inset: 0 0 auto 0; }
.step-desc .is-out { opacity: 0; transform: translateY(-3px); transition-duration: 100ms; transition-delay: 0s; }
.step-desc .is-in-start { opacity: 0; transform: translateY(3px); transition: none; }
.step.is-failed .step-desc { color: var(--negative); }
.step.is-skipped .step-title { color: var(--label-2); }

/* what the step is doing, shown beside the list: one quiet surface, panels crossfading */
.turn-preview { position: relative; height: 276px; padding: 20px 24px; border-radius: var(--r-md); background: var(--bg-group); overflow: hidden; display: flex; flex-direction: column; }
.turn-panels { position: relative; flex: 1; min-height: 0; }
/* one panel per step, each with its own head; the leaving panel is gone before the next
   one starts to appear, so two panels never overlap */
.turn-panel { position: absolute; inset: 0; opacity: 0; transform: translateY(6px); visibility: hidden; transition: opacity 90ms var(--ease-out), transform 90ms var(--ease-out), visibility 0s 90ms; }
.turn-panel.is-active { opacity: 1; transform: none; visibility: visible; transition: opacity 200ms var(--ease-out) 90ms, transform var(--spring-smooth-d) var(--spring-smooth) 90ms, visibility 0s; }
.turn-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: 20px; }
.turn-preview-title { font-size: var(--t-control); font-weight: var(--w-semibold); }
.turn-preview-count { font-size: var(--t-sub); color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-item { opacity: 0; transform: translateY(4px); transition: opacity 200ms var(--ease-out), transform var(--spring-smooth-d) var(--spring-smooth); }
.turn-panel.is-active .tp-item { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * var(--tp-step, 90ms) + 140ms); }
.tp-terms { display: grid; grid-template-columns: auto 1fr; gap: 9px 20px; font-size: var(--t-control); }
.tp-terms dt { color: var(--label-2); }
.tp-terms dd { font-weight: var(--w-medium); }
.turn-panel .sql { padding: 0; background: none; border-radius: 0; font-size: 12px; line-height: 1.75; overflow: hidden; }
.turn-panel .sql .tp-item { display: block; }
.tp-checks { display: flex; flex-direction: column; gap: 10px; font-size: var(--t-control); }
.tp-checks li { display: flex; align-items: center; gap: 10px; }
.tp-check { flex: none; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--sep-strong); display: grid; place-items: center; color: var(--on-accent); transition: background-color var(--fade), box-shadow var(--fade); }
.tp-check .icon { width: 12px; height: 12px; stroke-width: 3; transform: scale(0); transition: transform var(--spring-bouncy-d) var(--spring-bouncy); }
.tp-checks li.is-ok .tp-check { background: var(--accent-fill); box-shadow: none; }
.tp-checks li.is-ok .tp-check .icon { transform: scale(1); }
.tp-checks li.is-no .tp-check { background: var(--negative); box-shadow: none; }
.tp-checks li.is-no .tp-check .icon { transform: scale(1); }
.tp-checks li.is-no { color: var(--negative); }
.tp-checks small { color: var(--label-2); font-size: var(--t-foot); margin-left: auto; text-align: right; }
.tp-read { display: flex; align-items: baseline; gap: 8px; }
.tp-read b { font-size: 30px; font-weight: 650; letter-spacing: -.028em; font-variant-numeric: tabular-nums; }
.tp-read span { font-size: var(--t-sub); color: var(--label-2); }
.tp-rows { margin-top: 10px; width: 100%; font-size: var(--t-sub); border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tp-rows td { padding: 4px 0; border-bottom: var(--hairline) solid var(--sep); }
.tp-rows td + td { text-align: right; color: var(--label-2); }
.tp-build { display: flex; align-items: flex-end; gap: 6px; height: 110px; }
.tp-build i { flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: var(--accent); transform: scaleY(0); transform-origin: bottom; transition: transform var(--spring-snappy-d) var(--spring-snappy); }
.turn-panel.is-active .tp-build i { transform: scaleY(1); transition-delay: calc(var(--i) * 45ms + 240ms); }
.tp-lines { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.tp-lines i { display: block; height: 9px; width: var(--w); border-radius: 5px; background: var(--fill); }

/* ================================================================ rolling digits, spinner */
.roll-cell { position: relative; display: inline-block; }
.roll-in { display: inline-block; }
.roll-out { position: absolute; left: 0; top: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }

/* ================================================================ narrow shell */
@media (max-width: 1180px) {
  :root { --page-x: 40px; }
  .kpis { grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; --page-x: 20px; --toolbar-h: 52px; }
  .sidebar {
    width: 284px; transform: translateX(-104%); background: var(--canvas);
    box-shadow: var(--shadow-pop); border-right: 0;
    transition: transform var(--spring-gentle-d) var(--spring-gentle), visibility 0s var(--spring-gentle-d);
    visibility: hidden;
  }
  .drawer-open .sidebar { transform: none; visibility: visible; transition: transform var(--spring-gentle-d) var(--spring-gentle), visibility 0s; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .toolbar .sidebar-button { display: inline-grid; margin-left: -8px; }
  .toolbar { padding: 0 12px 0 var(--page-x); grid-template-columns: auto 1fr auto; }
  .toolbar-title { justify-self: center; max-width: 40vw; }
  .switcher { margin-left: 4px; padding-left: 6px; }
  .switch-accent { width: 18px; }
  /* the word leaves the screen and stays in the accessible name: a link of one arrow still says where it goes */
  .back-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .turn { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
}
@media (max-width: 640px) {
  .large-title { font-size: 28px; }
  /* a banner with commands wraps them under its sentence instead of running past the edge */
  .banner { flex-wrap: wrap; }
  /* the shell's band on a phone: the move under the sentence, never squeezing it into a column
     of six lines; the close stays on the first row */
  body > .banner {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start;
    column-gap: 12px; row-gap: 6px; padding: 10px 14px; font-size: 13px; line-height: 1.45;
  }
  body > .banner > .icon { grid-area: 1 / 1; }
  body > .banner > .banner-text { grid-area: 1 / 2; }
  body > .banner > .icon-button { grid-area: 1 / 3; }
  body > .banner > .btn { grid-area: 2 / 2 / 3 / 4; justify-self: start; height: 30px; margin: 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .kpi-value { font-size: 26px; }
  .table-wrap { margin: 0 0 var(--s4); }
  /* a data table wider than the phone scrolls sideways: its first column (the row's name) stays
     put, and a soft edge on the right says that more is there. core.js sets .has-more.
     The fixed column keeps under half the wrapper and wraps its text: a long table name written
     in one nowrap line used to grow it past the screen, leaving the other columns behind it. */
  .table:not(.users-table, .w-table .table) :is(th, td):first-child {
    position: sticky; left: 0; z-index: 1; background: var(--bg); padding-left: 12px;
    max-width: 45vw; white-space: normal; overflow-wrap: anywhere;
  }
  /* a table whose cells carry sentences gives its first column the half of the phone it may
     take: the automatic layout would otherwise keep it at its minimum and break the name over
     four lines. */
  .table--wrap :is(th, td):first-child { min-width: 45vw; }
  .table-wrap.has-more { -webkit-mask-image: linear-gradient(to right, var(--black) calc(100% - 36px), transparent); mask-image: linear-gradient(to right, var(--black) calc(100% - 36px), transparent); }
  .segmented [role='radio'] { padding: 0 10px; }
  .dialog { --dialog-top: 8px; width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .dialog-head { padding: 20px 12px 4px 20px; }
  .dialog-body { padding: 16px 20px 8px; }
  .dialog-foot { padding: 14px 16px 16px; }
  .dialog-foot .btn { flex: 1; }
  .turn-preview { height: 256px; padding: 18px 18px; }
  .tp-checks small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .step.is-current .step-spin { opacity: 0; }
  .step.is-current .m-ring { stroke: var(--accent); stroke-width: 2; }
}

/* a page with a docked composer keeps its toasts above it */
body:has(.composer-dock) .toasts { bottom: 92px; }

/* small controls keep a 40 px target without growing visibly */
.row-menu::after, .search-clear::after, .w-remove::after, .w-resize::after, .switch-theme::after, .switch-accent::after { content: ''; position: absolute; inset: -6px; }
.search-clear, .switch-theme, .switch-accent { position: relative; }
.row-menu::after { inset: -5px; }
.switch-accent::after { inset: -6px 0; }

/* ================================================================ kit for the remaining pages
   Added with the foundation for the pages beyond the six screens of the direction. Same
   rules: no boxes around text, one accent, hairlines, springs. Each block is shown with its
   states in components.html. */

/* the bell's dot only while something is unread; a notification in the menu is a link */
.bell:not(.has-unread) .bell-dot { display: none; }
a.notif { color: var(--label); }

/* inspector with a form: a sentence under the title, the actions in a foot that stays */
.sheet--wide { width: min(640px, calc(100vw - 20px)); }
.sheet-sub { margin-top: 4px; font-size: var(--t-control); color: var(--label-2); line-height: 1.45; }
.sheet-head { align-items: flex-start; }
.sheet-head .icon-button { margin-top: -4px; }
.sheet-body { flex: 1; min-height: 0; overscroll-behavior: contain; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.sheet.is-scrolling .sheet-foot { box-shadow: 0 calc(var(--hairline) * -1) 0 var(--sep); }
.alert-type { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; text-align: left; font-size: var(--t-sub); color: var(--label-2); }
.alert-type strong { color: var(--label); font-weight: var(--w-semibold); }

/* tabs: words on one line, an accent bar slides under the chosen one (UI.tabs) */
.tabs { position: relative; display: flex; gap: var(--s5); box-shadow: inset 0 calc(var(--hairline) * -1) 0 var(--sep-strong); overflow-x: auto; scrollbar-width: none; }
.tabs [role='tab'] { position: relative; height: 40px; font-size: var(--t-control); font-weight: var(--w-medium); color: var(--label-2); white-space: nowrap; border-radius: var(--r-xs) var(--r-xs) 0 0; transition: color var(--fade); }
.tabs [role='tab']:hover, .tabs [role='tab'][aria-selected='true'] { color: var(--label); }
.tabs [role='tab']:focus-visible { outline-offset: -3px; }
.tabs [role='tab'] .tab-count { margin-left: 6px; color: var(--label-2); font-weight: var(--w-regular); font-variant-numeric: tabular-nums; }
.tabs-bar { position: absolute; left: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); pointer-events: none; }
/* a tab strip drawn by the server (a link per tab, no UI.tabs) has no sliding bar: its current
   tab draws the same bar from its own edge. A strip that carries a bar keeps the script's. */
.tabs:not(:has(.tabs-bar)) a[role='tab'][aria-selected='true']::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); }
.tabs.has-more { -webkit-mask-image: linear-gradient(to right, var(--black) calc(100% - 32px), transparent); mask-image: linear-gradient(to right, var(--black) calc(100% - 32px), transparent); }
.tabs.has-before { -webkit-mask-image: linear-gradient(to left, var(--black) calc(100% - 32px), transparent); mask-image: linear-gradient(to left, var(--black) calc(100% - 32px), transparent); }
.tabs.has-more.has-before { -webkit-mask-image: linear-gradient(to right, transparent, var(--black) 32px, var(--black) calc(100% - 32px), transparent); mask-image: linear-gradient(to right, transparent, var(--black) 32px, var(--black) calc(100% - 32px), transparent); }
[role='tabpanel']:focus-visible { outline-offset: 6px; border-radius: var(--r-xs); }

/* form layouts: two fields side by side, titled sections separated by air, the actions last */
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.form-section + .form-section { margin-top: var(--s7); }
.form-section-head { margin-bottom: var(--s5); }
.form-section-head h2 { font-size: var(--t-head); font-weight: var(--w-semibold); letter-spacing: -.012em; }
.form-section-head p { margin-top: 4px; font-size: var(--t-control); color: var(--label-2); line-height: 1.5; max-width: 60ch; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: var(--s6); }
.form-actions .spacer { flex: 1; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input--inline { background: transparent; box-shadow: none; height: 32px; padding: 0 8px; margin: 0 -8px; width: calc(100% + 16px); }
.input--inline:hover { background: var(--fill-soft); }
.input-count { align-self: flex-end; font-size: var(--t-foot); color: var(--label-2); font-variant-numeric: tabular-nums; }

/* settings: one row per setting, the words leading, the control trailing, hairlines between */
.settings { border-top: var(--hairline) solid var(--sep); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); padding: 16px 0; border-bottom: var(--hairline) solid var(--sep); }
.setting-text { min-width: 0; }
.setting-title { font-size: var(--t-body); font-weight: var(--w-medium); }
.setting-sub { margin-top: 2px; font-size: var(--t-sub); color: var(--label-2); line-height: 1.45; max-width: 60ch; }
.setting-control { flex: none; display: flex; align-items: center; gap: 8px; }
.setting-control .select { min-width: 200px; }

/* list rows: a thing per row, its words, what it needs on the trailing edge.
   The separator is a straight line inside the row's margins, drawn above every visible row but the first visible one
   (a filter may hide the earlier rows): a shadow on the rounded row would curl up at both ends. It fades under the
   pointer, as the row's own hover shape takes over. */
.rows > li > .row-item, .rows > .row-item { position: relative; }
.rows > li:not([hidden]) ~ li:not([hidden]) > .row-item::before, .rows > .row-item ~ .row-item::before { content: ''; position: absolute; top: 0; left: 10px; right: 10px; height: var(--hairline); background: var(--sep); transition: opacity var(--fade); }
.rows > li > .row-item:is(a, button):hover::before, .rows > li:has(> .row-item:is(a, button):hover) + li > .row-item::before { opacity: 0; }
.row-item { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 12px 10px; margin: 0 -10px; width: calc(100% + 20px); border-radius: var(--r-sm); color: var(--label); text-align: left; transition: background-color var(--fade); }
a.row-item:hover, button.row-item:hover { background: var(--fill-soft); }
.row-item > .icon { width: var(--icon-m); height: var(--icon-m); color: var(--accent); }
.row-text { flex: 1; min-width: 0; }
.row-title { display: block; font-size: var(--t-body); font-weight: var(--w-medium); overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: block; margin-top: 2px; font-size: var(--t-sub); color: var(--label-2); line-height: 1.45; }
.row-meta { flex: none; font-size: var(--t-sub); color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-item > .chev { width: var(--icon-s); height: var(--icon-s); color: var(--label-3); }
.row-item.is-unread .row-title { font-weight: var(--w-semibold); }
.row-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.row-dot.is-read { background: transparent; }

/* timeline: when on the leading edge, a dot on a thin line, what happened beside it */
.timeline { position: relative; }
.timeline > li { position: relative; display: grid; grid-template-columns: 96px 20px minmax(0, 1fr); column-gap: 12px; padding-bottom: 22px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before { content: ''; position: absolute; left: calc(96px + 12px + 9.5px); top: 18px; bottom: 0; width: 1px; background: var(--sep-strong); }
.timeline > li:last-child::before { display: none; }
.tl-when { font-size: var(--t-sub); color: var(--label-2); font-variant-numeric: tabular-nums; line-height: 22px; text-align: right; }
.tl-dot { width: 9px; height: 9px; margin: 6px 0 0 5px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--label-3); }
.tl-dot.is-ok { background: var(--positive); box-shadow: none; }
.tl-dot.is-warn { background: var(--caution); box-shadow: none; }
.tl-dot.is-fail { background: var(--negative); box-shadow: none; }
.tl-dot.is-now { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-title { font-size: var(--t-body); font-weight: var(--w-medium); line-height: 22px; }
.tl-sub { margin-top: 2px; font-size: var(--t-sub); color: var(--label-2); line-height: 1.45; }

/* meter: a share of a whole (spend against the cap, accuracy, a load) with an optional mark */
.meter { position: relative; display: block; height: 8px; border-radius: var(--r-pill); background: var(--fill); }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 100%); min-width: 8px; border-radius: inherit; background: var(--accent-fill); transform-origin: left; animation: meter-in var(--spring-smooth-d) var(--spring-smooth); }
@keyframes meter-in { from { transform: scaleX(0); } }
.meter.is-caution .meter-fill { background: var(--caution); }
.meter.is-negative .meter-fill { background: var(--negative); }
.meter.is-positive .meter-fill { background: var(--positive); }
.meter-mark { position: absolute; top: -4px; bottom: -4px; left: calc(var(--m) * 100%); width: 2px; margin-left: -1px; border-radius: 1px; background: var(--label); }
.meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: var(--t-sub); color: var(--label-2); }
.meter-head strong { color: var(--label); font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }

/* stepper of a wizard: the same marks as the turn's steps, in a row; a real sequence */
.stepper { display: flex; gap: var(--s4); counter-reset: st; container-type: inline-size; }
.stepper > li { position: relative; flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; font-size: var(--t-control); color: var(--label-2); }
.stepper > li:not(:last-child)::after { content: ''; flex: 1; height: 1px; min-width: 16px; background: var(--sep-strong); }
.stepper > li.is-done:not(:last-child)::after { background: var(--accent); }
.stepper > li.is-current, .stepper > li.is-done { color: var(--label); }
.stepper > li.is-current { font-weight: var(--w-semibold); }
.stepper-mark { position: relative; flex: none; width: 24px; height: 24px; }
.stepper-mark svg { width: 24px; height: 24px; overflow: visible; }
.stepper > li { counter-increment: st; }
.stepper-mark::after { content: counter(st); position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: var(--w-semibold); color: var(--label-2); }
.stepper > li.is-current .stepper-mark::after { color: var(--accent); }
.stepper > li.is-current .m-ring { stroke: var(--accent); stroke-width: 1.75; }
.stepper > li.is-done .stepper-mark::after { content: none; }
.stepper > li.is-done .m-disc { transform: scale(1); opacity: 1; }
.stepper > li.is-done .m-check { stroke-dashoffset: 0; }
.stepper-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.stepper > li:last-child { flex: 0 0 auto; }
@container (max-width: 560px) {
  .stepper .stepper-label { display: none; }
  .stepper > li.is-current .stepper-label { display: block; flex: 0 1 auto; }
}

/* file drop: a quiet area that lights up while a file is over it */
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 24px; border-radius: var(--r-md); text-align: center; background: var(--fill-soft); outline: 1.5px dashed var(--sep-strong); outline-offset: -1.5px; transition: background-color var(--fade), outline-color var(--fade); }
.drop > .icon { width: var(--icon-xl); height: var(--icon-xl); color: var(--label-3); margin-bottom: 4px; transition: color var(--fade), transform var(--spring-snappy-d) var(--spring-snappy); }
.drop-title { font-size: var(--t-body); font-weight: var(--w-medium); }
.drop-sub { font-size: var(--t-sub); color: var(--label-2); }
.drop .btn { margin-top: 8px; }
.drop input[type='file'] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop.is-over { background: var(--accent-soft); outline-color: var(--accent); }
.drop.is-over > .icon { color: var(--accent); transform: translateY(-3px); }
.file-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 6px; padding: 12px 0; border-bottom: var(--hairline) solid var(--sep); }
.file-row > .icon { width: var(--icon-l); height: var(--icon-l); color: var(--label-2); grid-row: span 2; }
.file-name { font-size: var(--t-control); font-weight: var(--w-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: var(--t-sub); color: var(--label-2); font-variant-numeric: tabular-nums; }
.file-row .meter { grid-column: 2 / span 2; height: 4px; }

/* code: the SQL block with its head (what it is, Copia); .sql stays the only monospace */
.code-block { border-radius: var(--r-md); background: var(--bg-group); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 0 20px; font-size: var(--t-sub); color: var(--label-2); }
.code-block .sql { background: none; padding-top: 10px; }
.sql .c { color: var(--label-2); font-style: italic; }
.sql--lines { counter-reset: ln; }
.sql--lines .ln { display: block; padding-left: 3.2em; position: relative; }
.sql--lines .ln::before { counter-increment: ln; content: counter(ln); position: absolute; left: 0; width: 2.2em; text-align: right; color: var(--label-3); }
.sql .ln.is-err { background: color-mix(in srgb, var(--negative) 10%, transparent); box-shadow: inset 2px 0 0 var(--negative); }

/* a sentence that says the state of a page, figures in semibold (the users summary, a cost) */
.summary { font-size: var(--t-body); color: var(--label-2); line-height: 1.55; max-width: 72ch; }
.summary strong { color: var(--label); font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.summary .link-button { font-size: inherit; }

/* banner: a page-level fact that changes what the person can do (a cap reached, data being
   updated). A tint of its state, an icon, one sentence, at most one move. Never decoration.
   The band without a variant is informative, so it takes the quiet grey: the accent marks
   action and the current state (`DIRECTION.md` rule 2), and with a red brand it read as a
   danger. The three state variants keep their own tone. */
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--tone) 9%, transparent); font-size: var(--t-control); line-height: 1.5; color: var(--label); }
.banner:not([class*='banner--']) { --tone: var(--label-2); }
.banner[hidden] { display: none; }
/* The shell's band (`templates/ui/base.html`) is a direct child of the body, so it takes the
   content column's margin and gutter itself; a page's own banner already sits inside `main`. */
body > .banner { margin-left: var(--sidebar-w); margin-right: var(--page-x); }
/* the sidebar is a drawer: the shell's band is the page again, edge to edge */
@media (max-width: 900px) { body > .banner { margin: 0; } }
.banner > .icon { width: var(--icon-m); height: var(--icon-m); margin-top: 2px; color: var(--tone); }
.banner-text { flex: 1; min-width: 0; }
.banner-text strong { font-weight: var(--w-semibold); }
.banner .btn, .banner .link-button { flex: none; margin: -3px 0; }
.banner--caution { --tone: var(--caution); }
.banner--negative { --tone: var(--negative); }
.banner--positive { --tone: var(--positive); }

/* loading: placeholders the shape of what is coming, breathing slowly; never a spinner alone */
.skeleton { display: block; border-radius: 6px; background: var(--fill); animation: breathe 1.6s ease-in-out infinite; }
.sk-line { height: 12px; margin: 10px 0; width: var(--sk-w, auto); }
.sk-title { height: 18px; width: 40%; }
.sk-block { height: 180px; border-radius: var(--r-sm); }
@keyframes breathe { 50% { opacity: .5; } }

/* checkbox of a table row (selection); the header one selects all */
.check { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; cursor: pointer; vertical-align: middle; }
.check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.check-mark { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--sep-strong); display: grid; place-items: center; transition: background-color var(--fade), box-shadow var(--fade); }
.check-mark::after { content: ''; width: 9px; height: 5px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform var(--spring-snappy-d) var(--spring-snappy); }
.check input:checked + .check-mark, .check input:indeterminate + .check-mark { background: var(--accent-fill); box-shadow: none; }
.check input:checked + .check-mark::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.check input:indeterminate + .check-mark::after { width: 8px; height: 0; border-left: 0; transform: none; }
.check input:focus-visible + .check-mark { outline: 3px solid var(--focus); outline-offset: 2px; }
.check::after { content: ''; position: absolute; inset: -10px; }
.table .col-check { width: 36px; padding-right: 0; }
.table tbody tr.is-selected td { background: var(--accent-soft); }
.table tbody tr.is-selected td:first-child { border-radius: 8px 0 0 8px; }
.table tbody tr.is-selected td:last-child { border-radius: 0 8px 8px 0; }

/* the bar of bulk actions: floats while rows are chosen, because the table scrolls beneath */
.bulk-bar { position: fixed; left: calc(50% + var(--sidebar-w) / 2); bottom: 24px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 18px; border-radius: var(--r-pill); background: var(--material); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: var(--shadow-pop); max-width: calc(100vw - var(--sidebar-w) - 24px); }
.bulk-count { font-size: var(--t-control); font-weight: var(--w-semibold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bulk-actions { display: flex; gap: 6px; }
body:has(.bulk-bar:not([hidden])) .toasts { bottom: 84px; }

/* pager: where the rows are, and the two arrows */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 2px; margin-top: var(--s4); }
.pager-text { font-size: var(--t-sub); color: var(--label-2); font-variant-numeric: tabular-nums; margin-right: 8px; }
.icon-button[disabled] { opacity: .35; pointer-events: none; }

/* token: a chosen value inside a field (a synonym, a recipient), removable */
.tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.token { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 11px; border-radius: var(--r-pill); background: var(--fill); font-size: var(--t-sub); font-weight: var(--w-medium); }
.token button { position: relative; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--label-2); }
.token button:hover { background: var(--fill-press); color: var(--label); }
.token button .icon { width: 12px; height: 12px; }
.token button::after { content: ''; position: absolute; inset: -6px; }

/* a quieter empty state, inside a widget or a section */
.empty--inline { padding: 28px 16px; }
.empty--inline > .icon { width: var(--icon-l); height: var(--icon-l); padding: var(--s3); margin-bottom: 10px; }
.empty--inline h3 { font-size: var(--t-body); }

/* a disclosure in text: «Come ho letto la domanda», «Opzioni avanzate» */
.disclosure summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: var(--t-control); color: var(--label-2); list-style: none; border-radius: var(--r-xs); }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary:hover { color: var(--label); }
.disclosure summary .icon { width: var(--icon-s); height: var(--icon-s); transition: transform .35s var(--spring-snappy); }
.disclosure[open] summary .icon { transform: rotate(90deg); }
.disclosure-body { padding: 14px 0 0 20px; }

/* chart additions: several series with a legend, a share of a whole, selectable rankings */
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; font-size: var(--t-sub); color: var(--label-2); }
.chart-legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-key.tone-accent { background: var(--accent); }
.legend-key.tone-ink { background: var(--label-2); }
.legend-key.tone-accent-2 { background: var(--accent-2); }
.legend-key.tone-muted { background: var(--mark-muted-line); }
.tone-ink { fill: var(--label-2); stroke: var(--label-2); }
.tone-accent-2 { fill: var(--accent-2); stroke: var(--accent-2); }
.mark-line.tone-ink, .mark-line.tone-accent-2 { fill: none; stroke-width: 2; }
.mark-area.tone-ink, .mark-area.tone-accent-2 { stroke: none; }
.chart.is-selectable .mark-col, .chart.is-selectable .bar-row { cursor: pointer; }
.bar-row { transition: opacity var(--fade) var(--ease-out); }
.bar-row.is-dim { opacity: .4; }
.stack-bar { display: flex; gap: 2px; height: 14px; border-radius: var(--r-pill); overflow: hidden; }
.stack-bar span { min-width: 3px; flex-grow: var(--v, 1); }
.stack-bar .tone-accent { background: var(--accent); }
.stack-bar .tone-ink { background: var(--label-2); }
.stack-bar .tone-accent-2 { background: var(--accent-2); }
.stack-bar .tone-muted { background: var(--mark-muted-line); }
.stack-list { margin-top: 16px; }
.stack-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 48px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: var(--hairline) solid var(--sep); font-size: var(--t-control); }
.stack-list li:last-child { border-bottom: 0; }
.stack-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-value { font-variant-numeric: tabular-nums; }
.stack-share { text-align: right; color: var(--label-2); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .bulk-bar { left: 50%; max-width: calc(100vw - 24px); }
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .setting { flex-direction: column; align-items: stretch; gap: 10px; }
  .setting-control .select { min-width: 0; width: 100%; }
  .timeline > li { grid-template-columns: 20px minmax(0, 1fr); }
  .timeline > li::before { left: 9.5px; }
  .tl-when { grid-column: 2; grid-row: 2; text-align: left; line-height: 1.4; }
  .stepper .stepper-label { display: none; }
  .stepper > li.is-current .stepper-label { display: block; }
  .stepper > li { flex: 0 1 auto; }
  .stepper > li:not(:last-child)::after { min-width: 12px; }
  .bulk-bar { bottom: 12px; padding-left: 14px; }
  .bulk-actions .btn span { display: none; }
  .bulk-actions .btn { width: var(--control-h); padding: 0; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions .spacer { display: none; }
}

/* The small confirmation: an `.alert` inside a native <dialog>. It is centred in the window, as the mockup's alert
   layer centres it: a form sheet keeps its fixed top because a field can appear in it and a centred box would jump,
   and an alert has no field that appears. After the mobile block above, so that its width wins over the phone's. */
.dialog--alert { width: min(380px, calc(100vw - 32px)); }
.dialog.dialog--alert { margin: auto; max-height: calc(100dvh - 32px); }
.dialog--alert .alert { width: auto; padding: 26px 24px 20px; background: transparent; box-shadow: none; }
.dialog--alert .alert-type { margin-top: var(--s4); }
.dialog--alert .alert-actions { margin-top: var(--s5); }
.dialog--alert .alert-actions .btn { min-width: 0; }
