/*
 * Builder stylesheet
 *
 * Import order is cascade order, general to specific:
 *   settings  – tokens as custom properties, produce no CSS
 *   base      – reset and element selectors, no classes
 *   blocks    – BEM blocks, one block per file (block, block__element, block--modifier)
 */

:root {
  /*
   * Two themes, one token each: light-dark(light, dark) takes the side of the color-scheme
   * in use. Auto follows the system; a theme chosen in the preferences is written as
   * data-theme on <html> by src/theme-start.ts before the first paint.
   */
  color-scheme: light dark;

  /*
   * Colours. Text tokens are checked with the WCAG 2 contrast formula against every
   * neutral ground text sits on, the one with the least contrast --color-surface-hover (a
   * row under the pointer, an open row) in the dark theme and --color-workspace (a
   * tooltip, a field) in the light one; src/tokens.test.ts checks the readable ones:
   *                                     bg      surface  raised  hover   workspace
   *   --color-text         dark  #e6e6e9  14.4:1  13.2:1  12.0:1  10.6:1  15.3:1
   *   --color-text-muted   dark  #9a9ca5   6.5:1   6.0:1   5.5:1   4.8:1   7.0:1
   *   --color-text-subtle  dark  #9598a2   6.2:1   5.7:1   5.2:1   4.6:1   6.6:1 – the floor for readable text
   *   --color-text         light #1b1c20  15.6:1  16.5:1  17.0:1  14.7:1  13.9:1
   *   --color-text-muted   light #50535c   7.0:1   7.4:1   7.7:1   6.6:1   6.3:1
   *   --color-text-subtle  light #565962   6.4:1   6.8:1   7.0:1   6.0:1   5.7:1
   *   --color-text-faint   fails AA on every ground; decorative only, never for readable
   *                        text (the line-number gutter, nothing else)
   */
  --color-bg: light-dark(#f4f5f7, #16171a);
  --color-workspace: light-dark(#e6e8ec, #0f1012);
  --color-surface: light-dark(#fbfbfc, #1e1f23);
  --color-surface-raised: light-dark(#ffffff, #26272c);
  --color-surface-hover: light-dark(#eceef1, #2e3036);
  /* A button lifted off a tinted bar (the selection's actions), lighter than any surface in the dark theme so it reads as the thing to press */
  --color-surface-lifted: light-dark(#ffffff, #393c45);
  --color-surface-lifted-hover: light-dark(#eceef1, #444852);
  --color-border: light-dark(#dfe1e6, #313339);
  --color-border-strong: light-dark(#c3c7cf, #43464e);
  --color-text: light-dark(#1b1c20, #e6e6e9);
  /* The strongest text, for the one name a page leads with: a product's beside its mark */
  --color-text-strong: light-dark(#0b0b0d, #ffffff);
  --color-text-muted: light-dark(#50535c, #9a9ca5);
  --color-text-subtle: light-dark(#565962, #9598a2);
  --color-text-faint: light-dark(#a2a5ad, #6b6e77);
  /*
   * The colours of a kind or a standing below are text too, on --color-surface and on
   * their own muted fill over it (a badge), and every filled one carries --color-on-accent,
   * at rest and under the hover's brightness(1.1): all of it 4.5:1 or more in both themes.
   */
  /*
   * The accent is the logo's orange (decided 2026-11-14, variant B1 of "elpresso Two Roasts"),
   * and it has three jobs with a colour each, since the orange that carries a label is too
   * light for a line or for words on the light theme's grounds: --color-accent is a fill and
   * carries --color-on-accent (a button, a count, the picked day), --color-accent-line is a
   * line or a mark (a focus ring, a selection's edge, a bar: 3:1 on every ground) and
   * --color-accent-text is words (4.5:1 on every ground and on --color-accent-muted).
   */
  --color-accent: light-dark(#fb7d0e, #fe952b);
  --color-accent-line: light-dark(#c04f00, #fe952b);
  --color-accent-text: light-dark(#963c00, #ffb366);
  --color-accent-muted: light-dark(rgb(251 125 14 / 0.14), rgb(254 149 43 / 0.16));
  /* The label on the accent's fill: the logo's espresso on its orange, in both themes */
  --color-on-accent: light-dark(#3a1200, #3a1200);
  /*
   * elmachine is the dark roast: its fill is the espresso of the logo's glyph with a cream
   * label, in the dark theme, where espresso would vanish, the logo's copper with a dark one;
   * its lines and words are the burnt orange of its tile. So a tab of the machine is told
   * from one of the builder at a glance.
   */
  --color-machine: light-dark(#471800, #d9652f);
  --color-machine-line: light-dark(#a83a0c, #f5803a);
  --color-machine-text: light-dark(#8a3200, #ff9f6b);
  --color-machine-muted: light-dark(rgb(184 64 13 / 0.12), rgb(245 128 58 / 0.16));
  --color-on-machine: light-dark(#ffe8cc, #240b00);
  /*
   * The series of a chart, in this order and never cycled. The machine's espresso reads black as
   * a 2px line, so the first series is a warmer orange beside it. Checked as a pair on
   * --color-surface in each theme by src/tokens.test.ts: both inside the theme's lightness
   * band, chroma above the floor, apart by ΔE 8 or more under protanopia and deuteranopia and
   * 15 or more for normal vision, both above 3:1. The wash is the first series under its line.
   */
  --color-chart-1: light-dark(#c2631f, #d27a36);
  --color-chart-2: light-dark(#2f6be0, #5b8cff);
  --color-chart-1-wash: light-dark(rgb(194 99 31 / 0.1), rgb(210 122 54 / 0.1));
  /*
   * Text on the filled colour of a kind (a component's, a frame's, the consent's Save, a
   * Delete under the pointer, a condition's label): white on the light theme's deep colours,
   * dark on the dark theme's light ones, and the hover's brightness filter only raises it.
   */
  --color-on-fill: light-dark(#ffffff, #0f1012);
  --color-text-selection: light-dark(rgb(251 125 14 / 0.25), rgb(254 149 43 / 0.35));
  /*
   * Components: a place, and the component being edited, are violet rather than blue, so
   * what belongs to the whole site is never mistaken for the page.
   */
  --color-component: light-dark(#7a3fd6, #b98cff);
  --color-component-muted: light-dark(rgb(122 63 214 / 0.12), rgb(185 140 255 / 0.16));
  /*
   * Templates: a page without an address, published once per entry, is teal, so it is told
   * apart from the page it looks like and from a component.
   */
  --color-template: light-dark(#0a6f65, #4cc9b8);
  --color-template-muted: light-dark(rgb(10 111 101 / 0.12), rgb(76 201 184 / 0.16));
  /*
   * Frames: what surrounds every page, and the frame mode, are olive (decided 2026-11-14,
   * since the accent took the orange they had), so Save, Save frame and Save component are
   * three buttons at a glance. The one stretch of the wheel nothing else stands in.
   */
  --color-frame: light-dark(#566300, #b9cc3a);
  --color-frame-muted: light-dark(rgb(86 99 0 / 0.12), rgb(185 204 58 / 0.16));
  /*
   * The consent layer (#92): the banner, its settings and the placeholder of a blocked
   * embed, and the consent mode, are rose, a fourth kind beside page, component and frame.
   */
  --color-consent: light-dark(#a8326a, #f08ab8);
  --color-consent-muted: light-dark(rgb(168 50 106 / 0.12), rgb(240 138 184 / 0.16));
  /*
   * Conditions: an element the website shows only when its condition holds is marked
   * amber, in the structure and as its dashed outline on the canvas.
   */
  --color-condition: light-dark(#8c590c, #d99a32);
  --color-danger: light-dark(#b8262c, #ff7b72);
  /* Behind a danger icon under the pointer: the red stays readable on it */
  --color-danger-muted: light-dark(rgb(184 38 44 / 0.1), rgb(255 123 114 / 0.14));
  /* Something is waiting to be done, not something is wrong: a page with unpublished changes */
  --color-pending: light-dark(#845b00, #e3b341);
  --color-pending-muted: light-dark(rgb(132 91 0 / 0.12), rgb(227 179 65 / 0.16));
  /*
   * The one chosen of several, the main domain's filled star. Gold rather than yellow: a
   * yellow light enough to read as one stays under 3:1 on the light surface.
   */
  --color-star: light-dark(#9a6700, #f2c94c);
  /*
   * Standing of a page or an entry, as a filled tag: live is green, a draft rose, changes
   * waiting are --color-pending.
   */
  --color-live: light-dark(#187032, #56d364);
  --color-live-muted: light-dark(rgb(24 112 50 / 0.12), rgb(86 211 100 / 0.16));
  --color-draft: light-dark(#b4337f, #ec8ec4);
  --color-draft-muted: light-dark(rgb(180 51 127 / 0.12), rgb(236 142 196 / 0.16));
  /*
   * News in a toast. Blue in elmachine too, where the accent is a burnt orange and would read
   * as a warning beside --color-pending. Readable on --color-surface-raised, the toast's ground.
   */
  --color-info: light-dark(#2357d1, #5b8cff);
  --color-info-muted: light-dark(rgb(35 87 209 / 0.12), rgb(91 140 255 / 0.16));
  /*
   * The categories of a nav (#103): each group of the builder's manage panel and of the
   * console stands in one of these, its frame and pill tinted with the colour and the pill's
   * words, and the open section's icon, in its -text. One lightness and saturation for all,
   * so no category shouts louder than another; a new category takes a new hue of the same.
   * side-nav.css mixes the tints; src/tokens.test.ts checks the words on them.
   */
  --color-category-blue: light-dark(#2563eb, #6ea8fe);
  --color-category-blue-text: light-dark(#1d4ed8, #8ab9ff);
  --color-category-violet: light-dark(#9333ea, #c084fc);
  --color-category-violet-text: light-dark(#7e22ce, #cf9eff);
  --color-category-green: light-dark(#059669, #34d399);
  --color-category-green-text: light-dark(#05664a, #4ee0ab);
  --color-category-orange: light-dark(#ea580c, #fb923c);
  --color-category-orange-text: light-dark(#a83a0f, #ffa45c);
  --color-category-yellow: light-dark(#ca8a04, #facc15);
  --color-category-yellow-text: light-dark(#7d5200, #fad445);
  --color-category-pink: light-dark(#db2777, #f472b6);
  --color-category-pink-text: light-dark(#a51a57, #f9a0cc);
  /* An icon beside its words, quieter than them: 3:1 on the grounds a nav stands on, as a graphic needs */
  --color-icon: light-dark(#7c7f88, #75767f);
  /* The page itself: the author's website is white in both themes until its own CSS says otherwise */
  --color-canvas: #ffffff;
  --color-backdrop: light-dark(rgb(20 22 28 / 0.4), rgb(0 0 0 / 0.55));
  /* Words over a picture, such as where a share picture comes from: dark enough over any photo in both themes */
  --color-scrim: rgb(0 0 0 / 0.62);
  --color-on-scrim: rgb(255 255 255);
  /* A picture viewed large: dark in both themes, as a gallery shows it, with its own words on it */
  --color-lightbox: rgb(12 13 16 / 0.95);
  --color-on-lightbox: #ececef;
  --color-on-lightbox-muted: #a6a8b0;
  /* The squares behind what a picture leaves transparent, as image editors draw them */
  --color-checker-light: #ffffff;
  --color-checker-dark: #d9dbe0;

  /* Fonts */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-code: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;

  /*
   * Fluid type after the Utopia method:
   * clamp(min, intercept + slope * 100vw, max), linear between 1024px and 1920px viewport.
   * The builder is a desktop tool, hence the narrow range.
   */
  --step--1: clamp(0.6875rem, 0.6161rem + 0.1116vw, 0.75rem);
  --step-0: clamp(0.8125rem, 0.7411rem + 0.1116vw, 0.875rem);
  --step-1: clamp(0.9375rem, 0.8661rem + 0.1116vw, 1rem);
  --step-2: clamp(1.0625rem, 0.9196rem + 0.2232vw, 1.1875rem);
  /* The name and the clock a card leads with: the server in the overview's host card */
  --step-2-5: clamp(1.5rem, 1.2143rem + 0.4464vw, 1.75rem);
  /* One figure a section is about: the security score */
  --step-3: clamp(2rem, 1.4286rem + 0.8929vw, 2.5rem);

  /*
   * Code: not fluid, so the line-number gutter, the highlighted <pre> and the textarea share
   * one exact line grid. rem, not px, so the editor still follows the user's font-size setting.
   */
  --code-font-size: 0.8125rem;
  --code-line-height: 1.25rem;

  /*
   * Code colours after VS Code "Light+" and "Dark+", the light ones deepened where Light+
   * falls below 4.5:1 on --color-bg, the editor's ground (checked in src/tokens.test.ts).
   */
  --code-text: light-dark(#1f1f1f, #d4d4d4);
  --code-comment: light-dark(#3a7230, #6a9955);
  --code-string: light-dark(#a31515, #ce9178);
  --code-number: light-dark(#0b7050, #b5cea8);
  --code-keyword: light-dark(#9a1fb8, #c586c0);
  --code-storage: light-dark(#1b4fd1, #569cd6);
  --code-function: light-dark(#795e26, #dcdcaa);
  --code-variable: light-dark(#0b4f8a, #9cdcfe);
  --code-type: light-dark(#1d7287, #4ec9b0);
  --code-regex: light-dark(#a52a3b, #d16969);
  /* Dark+ gives tags the colour of --code-storage, Light+ a maroon of their own. */
  --code-tag: light-dark(#800000, #569cd6);
  --code-selector: light-dark(#8a4a00, #d7ba7d);
  /* Fills behind a selector, id or preset badge above the CSS editor, like --color-template-muted */
  --code-selector-muted: light-dark(rgb(138 74 0 / 0.12), rgb(215 186 125 / 0.16));
  --code-storage-muted: light-dark(rgb(27 79 209 / 0.12), rgb(86 156 214 / 0.16));
  --code-type-muted: light-dark(rgb(29 114 135 / 0.12), rgb(78 201 176 / 0.16));
  /* The same fills, deeper, for the badge whose CSS is open */
  --code-selector-strong: light-dark(rgb(138 74 0 / 0.24), rgb(215 186 125 / 0.32));
  --code-storage-strong: light-dark(rgb(27 79 209 / 0.24), rgb(86 156 214 / 0.32));
  --code-type-strong: light-dark(rgb(29 114 135 / 0.24), rgb(78 201 176 / 0.32));
  --code-punctuation: light-dark(#5f6268, #808080);

  /* Spacing */
  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-s: 12px;
  --space-m: 16px;
  --space-l: 24px;
  --space-xl: 32px;

  /* Control sizes: heights of inputs, buttons and rows, so bars and their children line up */
  --size-control-s: 24px;
  --size-control-m: 28px;
  --size-control-l: 32px;

  /* Shape */
  --radius-s: 4px;
  --radius-m: 6px;
  --radius-l: 10px;
  /* Shadows: the light theme's are lighter, or a white dialog would stand in a grey cloud */
  --shadow-canvas:
    0 0 0 1px light-dark(rgb(20 22 28 / 0.12), rgb(0 0 0 / 0.4)),
    0 8px 32px light-dark(rgb(20 22 28 / 0.1), rgb(0 0 0 / 0.35));
  --shadow-raised: 0 24px 80px light-dark(rgb(20 22 28 / 0.22), rgb(0 0 0 / 0.6));
  /* A button raised off a tinted bar, the selection's actions */
  --shadow-button: 0 1px 2px light-dark(rgb(20 22 28 / 0.14), rgb(0 0 0 / 0.45));
  --shadow-toast: 0 8px 32px light-dark(rgb(20 22 28 / 0.18), rgb(0 0 0 / 0.45));

  /*
   * Stacking, from bottom to top. The backdrop dims the app, the overlay (maximized pane,
   * modal) sits on it. Toasts and the tooltip need no number: they stand in the browser's
   * top layer, above everything.
   */
  --z-resizer: 1;
  --z-backdrop: 10;
  --z-overlay: 11;

  /* Motion */
  --duration-fast: 120ms;
  /* One beat of something that asks to be noticed, like the website button after a publish */
  --duration-attention: 1200ms;
  /* One breath of something that goes on, like the dot of an action that is running */
  --duration-pulse: 1600ms;
  /* A panel folding in or out, like the nav to its icons */
  --duration-fold: 180ms;

  /* Layout */
  --panel-header-height: 40px;
  --taskbar-height: 48px;
}

/* A theme chosen in the preferences, instead of the system's */
:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

/*
 * The machine's pages take its accent; the server writes data-product into <html>. The one
 * place a data-* attribute is a selector outside the canvas, and data-theme above the other:
 * both are on <html> before the first paint, where no script could set a class in time.
 */
:root[data-product="elmachine"] {
  --color-accent: var(--color-machine);
  --color-accent-line: var(--color-machine-line);
  --color-accent-muted: var(--color-machine-muted);
  --color-accent-text: var(--color-machine-text);
  --color-on-accent: var(--color-on-machine);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

ul[role="list"],
ol[role="list"] {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.5;
}

/* Focus is always an outline: it survives forced colours, where box-shadow is dropped. */
:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

::selection {
  background: var(--color-text-selection);
}

/*
 * A select's open list takes its colours from its options. Chrome draws the list of a select
 * whose background is transparent in white, whatever the color-scheme, under options that
 * inherit the select's text: light text on white in the dark theme.
 */
option,
optgroup {
  background-color: var(--color-surface-raised);
  color: var(--color-text);
}

/* Present for assistive technology only, e.g. the page heading. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/*
 * The two media queries the builder allows (see .claude/rules/css.md): both are user
 * preferences, not breakpoints, and both live only here.
 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
    /* An endless animation at that speed would flicker; once, it ends where it rests */
    animation-iteration-count: 1;
  }
}

/*
 * Forced colours (Windows high contrast) drop backgrounds and box-shadows. Everything that
 * carries state only through them gets a border or outline; transparent ones in the blocks
 * become visible here, and system colours mark the active state. `:root` in front lifts
 * each rule above the block's own, which comes later in the cascade and would otherwise
 * win with the block's colour, forced to the plain text colour.
 */
@media (forced-colors: active) {
  :root .switch {
    border-color: ButtonText;
  }

  :root .switch::before {
    background: ButtonText;
  }

  :root .switch:checked {
    border-color: Highlight;
  }

  :root .switch:checked::before {
    background: Highlight;
  }

  :root .tabs__tab--active {
    border-bottom-color: Highlight;
  }

  :root .progress-bar {
    border: 1px solid CanvasText;
  }

  :root .progress-bar__fill {
    background: Highlight;
  }

  :root .resizer--horizontal {
    border-top: 1px solid CanvasText;
  }

  :root .resizer--vertical {
    border-inline-start: 1px solid CanvasText;
  }

  :root .structure__tree--drop-end::after,
  :root .structure__row--drop-before::before,
  :root .structure__row--drop-after::before {
    outline: 1px solid Highlight;
  }

  :root .structure__row--drop-inside {
    outline-color: Highlight;
  }

  :root .structure__row--selected {
    border-inline-start-color: Highlight;
  }

  :root .structure__item:focus-visible > .structure__row,
  :root .code-editor:focus-within {
    outline-color: Highlight;
  }

  :root .element-panel__field:focus-within,
  :root .context-menu__item:focus-visible {
    outline-color: Highlight;
  }

  /* What is chosen, pressed or open, carried by a fill in the blocks */
  :root .combobox__option--active,
  :root .pages__option--active,
  :root .entry-chip__option--active,
  :root .segmented__option[aria-checked="true"],
  :root .segmented__option[aria-pressed="true"],
  :root .data-table__filter[aria-pressed="true"],
  :root .data-table__views > [aria-pressed="true"],
  :root .data-table__card--selected,
  :root .style-manager__filter[aria-pressed="true"],
  :root .image-picker__item[aria-pressed="true"],
  :root .side-list__button[aria-current="true"],
  :root .side-nav__item--active,
  :root .moment-picker__day--picked {
    border-color: Highlight;
  }

  /* The nav's edge shows its line by a fill alone */
  :root .side-nav__edge:hover .side-nav__resize::before,
  :root .side-nav__resize--active::before,
  :root .side-nav__resize:focus-visible::before {
    forced-color-adjust: none;
    background: Highlight;
  }

  /* The selection's frame is a shadow, which forced colours drop: an outline stands in */
  :root .data-table__selection {
    outline: 1px solid Highlight;
    outline-offset: -1px;
  }

  /* Forced colours draw no pictures: the picked row's line becomes a border, the padding giving back its width */
  :root .data-table__row--picked > .data-table__cell:first-child {
    padding-inline-start: calc(var(--space-s) - 3px);
    border-inline-start: 3px solid Highlight;
  }

  /* The option the arrow keys are on: a border alone is a hairline beside the others */
  :root .combobox__option--active,
  :root .pages__option--active,
  :root .entry-chip__option--active {
    outline: 1px solid Highlight;
    outline-offset: -1px;
  }

  :root .class-switcher__item--active {
    outline-color: Highlight;
  }

  /* A toast's time would vanish with its colours */
  :root .toast__fill {
    forced-color-adjust: none;
    background: Highlight;
  }
}

/*
 * App shell: canvas top left, code editor below it, sidebar (structure and element
 * settings) on the right, or on the left with --sidebar-start, taskbar for inserting
 * elements across the full width at the bottom.
 */
/*
 * Until main.ts knows who logged in, nothing shows: an editor must never see the owner's
 * tools flash up before they are taken away.
 */
.app--starting {
  visibility: hidden;
}

.app {
  --app-sidebar-width: 280px;
  --app-editor-height: 260px;
  --app-resizer-size: 1px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--app-resizer-size) var(--app-sidebar-width);
  grid-template-rows: minmax(0, 1fr) var(--app-resizer-size) var(--app-editor-height) auto;
  grid-template-areas:
    "canvas         sidebar-resizer sidebar"
    "editor-resizer sidebar-resizer sidebar"
    "editor         sidebar-resizer sidebar"
    "taskbar        taskbar         taskbar";
  height: 100dvh;
  overflow: hidden;
}

/* The sidebar docked on the leading edge: the same grid, mirrored */
.app--sidebar-start {
  grid-template-columns: var(--app-sidebar-width) var(--app-resizer-size) minmax(0, 1fr);
  grid-template-areas:
    "sidebar sidebar-resizer canvas"
    "sidebar sidebar-resizer editor-resizer"
    "sidebar sidebar-resizer editor"
    "taskbar taskbar         taskbar";
}

.app__canvas {
  grid-area: canvas;
}

.app__editor-resizer {
  grid-area: editor-resizer;
}

.app__editor {
  grid-area: editor;
}

.app__sidebar-resizer {
  grid-area: sidebar-resizer;
}

.app__sidebar {
  grid-area: sidebar;
}

.app__taskbar {
  grid-area: taskbar;
}

/*
 * The manage panel lies over the whole app, taskbar included: Save, undo and the page
 * switcher belong to the page in the canvas, and leaving them under a panel about the
 * website invites people to press the wrong one.
 */
.app__manage {
  grid-area: 1 / 1 / 5 / 4;
  z-index: var(--z-overlay);
}

/* While a resizer or canvas handle is dragged: no text selection anywhere (see canvas.css for the iframe) */
.app--resizing {
  user-select: none;
}

/*
 * Button that shows only an icon (SVG or a text glyph); its name lives in title/aria-label.
 * Size modifiers set the two block-local properties; a block that needs positioning adds
 * its own class next to this one and keeps only positional rules there.
 */
.icon-button {
  --icon-button-size: var(--size-control-s);
  --icon-button-icon-size: 16px;

  display: grid;
  flex: none;
  place-items: center;
  width: var(--icon-button-size);
  height: var(--icon-button-size);
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--step-2);
  line-height: 1;
  cursor: pointer;
  transition:
    background-color var(--duration-fast),
    border-color var(--duration-fast),
    color var(--duration-fast);
}

.icon-button:hover:not(:disabled, [aria-disabled="true"]) {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.icon-button:active:not(:disabled, [aria-disabled="true"]) {
  background: var(--color-surface-raised);
}

.icon-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Off but focusable, with its reason in the tooltip: only the icon fades */
.icon-button[aria-disabled="true"] {
  cursor: not-allowed;
}

.icon-button[aria-disabled="true"] > .icon-button__icon {
  opacity: 0.35;
}

.icon-button[aria-disabled="true"]:hover {
  background: transparent;
  color: var(--color-text-muted);
}

/* Takes something away for good: red at rest, so it is found without reading */
.icon-button--danger {
  color: var(--color-danger);
}

/* A button that folds something open under it turns its chevron down while it is open */
.icon-button[aria-expanded="true"] > .icon-button__icon {
  rotate: 90deg;
}

/* An action that can do something right now, among actions that mostly cannot */
.icon-button--accent:not([aria-disabled="true"]) {
  color: var(--color-accent-text);
}

/*
 * The one of a group that is on, the main domain's star: in its own colour, and not faded
 * when it is off as an action, since being on is what it says
 */
.icon-button--chosen,
.icon-button--chosen[aria-disabled="true"]:hover {
  color: var(--color-star);
}

.icon-button--chosen[aria-disabled="true"] > .icon-button__icon {
  opacity: 1;
}

.icon-button--danger:hover:not(:disabled, [aria-disabled="true"]) {
  background: var(--color-danger-muted);
  color: var(--color-danger);
}

.icon-button--danger[aria-disabled="true"]:hover {
  color: var(--color-danger);
}

.icon-button--s {
  --icon-button-size: 22px;
  --icon-button-icon-size: 14px;
}

.icon-button--m {
  --icon-button-size: var(--size-control-m);
}

/* Taskbar style: wider than tall, with a border on hover */
.icon-button--l {
  --icon-button-size: var(--size-control-l);
  --icon-button-icon-size: 18px;

  width: 36px;
  border-radius: var(--radius-m);
}

.icon-button--l:hover:not(:disabled, [aria-disabled="true"]) {
  border-color: var(--color-border);
}

/* As tall as the buttons of a bar beside it, and square: the theme's switch at the end of the header */
.icon-button--control {
  --icon-button-size: var(--size-control-l);
  --icon-button-icon-size: 18px;

  border-radius: var(--radius-m);
}

/* In a box of its own, so a lone icon at the end of the header does not look lost */
.icon-button--boxed {
  border-color: var(--color-border);
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.icon-button--boxed:hover:not(:disabled, [aria-disabled="true"]) {
  border-color: var(--color-border-strong);
  background: var(--color-surface-hover);
}

.icon-button__icon {
  width: var(--icon-button-icon-size);
  height: var(--icon-button-icon-size);
}

/* A tag beside a name, what it is or where it stands; one block for every list. */
/*
 * Kind (Home, Template, Frame) or standing (Live, Changed, Draft), so a colour means the
 * same thing wherever it shows. Facts like counts are text, never a badge.
 */
.badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--space-2xs);
  padding-inline: var(--space-xs);
  border-radius: var(--radius-s);
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 400;
  line-height: 1.6;
  white-space: nowrap;
}

/* A standing carries a dot as well, so it is not told by its colour alone */
.badge--live::before,
.badge--changed::before,
.badge--draft::before,
.badge--failed::before,
.badge--running::before,
.badge--neutral::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* On the website as it is stored here */
.badge--live {
  background: var(--color-live-muted);
  color: var(--color-live);
}

/* Waiting for something: a publish, an approval */
.badge--changed {
  background: var(--color-pending-muted);
  color: var(--color-pending);
}

/* Only in the builder, never on the website */
.badge--draft {
  background: var(--color-draft-muted);
  color: var(--color-draft);
}

/* Goes on the website at a moment the owner chose: a scheduled page or entry */
.badge--scheduled {
  background: var(--color-info-muted);
  color: var(--color-info);
}

/* Stopped by an error and needs somebody: a service of the machine */
.badge--failed {
  background: var(--color-danger-muted);
  color: var(--color-danger);
}

/* Still under way, an action of the machine: the dot pulses until it has ended; the word says it without the motion */
.badge--running {
  background: var(--color-pending-muted);
  color: var(--color-pending);
}

.badge--running::before {
  animation: badge-pulse var(--duration-pulse) ease-in-out infinite;
}

@keyframes badge-pulse {
  50% {
    opacity: 0.25;
    scale: 0.6;
  }
}

/* A standing that is neither good nor waiting, "Not known" or "Defaults": outlined, so it reads as a badge on a card too */
.badge--neutral {
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  background: transparent;
  color: var(--color-text-muted);
}

/* The role a page plays (the page the website's address opens, the one every other address shows), and the main domain */
.badge--home,
.badge--not-found,
.badge--role {
  background: var(--color-accent-muted);
  color: var(--color-text);
}

/* The one the builder has open, or the account that is you */
.badge--current {
  box-shadow: inset 0 0 0 1px var(--color-accent-line);
  background: transparent;
  color: var(--color-accent-text);
}

.badge--template {
  background: var(--color-template-muted);
  color: var(--color-template);
}

.badge--frame {
  background: var(--color-frame-muted);
  color: var(--color-frame);
}

.badge--component {
  background: var(--color-component-muted);
  color: var(--color-component);
}

/* Who plays a role in the Role field: another page, which gives it up on Save, in the pending colour; nobody yet in green. No dot: it is no standing */
.badge--holder {
  background: var(--color-pending-muted);
  color: var(--color-pending);
}

.badge--free {
  background: var(--color-live-muted);
  color: var(--color-live);
}

/* Members only: a property of the page, outlined so it never reads as a standing */
.badge--members {
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  background: transparent;
}

/* A property of a row that is no standing, outlined like members only: a rule set up by hand, a list's source */
.badge--outlined {
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  background: transparent;
}

/* Tighter, for the rows of the page switcher */
.badge--compact {
  padding-inline: var(--space-2xs);
}

/* An element of the cookie consent: its kind in the consent colour */
.badge--consent {
  background: var(--color-consent-muted);
  color: var(--color-consent);
}

/* The icon buttons at the end of a list row, in fixed slots, with Delete last and apart. */
.row-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-3xs);
}

/* A slot this row has no action for: it keeps its width, so the columns line up */
.row-actions__gap {
  width: var(--size-control-m);
  height: var(--size-control-m);
}

/* Lower, for a list of one line a row: the buttons and the empty slots a size smaller */
.row-actions--compact > .row-actions__button {
  --icon-button-size: var(--size-control-s);
}

.row-actions--compact > .row-actions__gap {
  width: var(--size-control-s);
  height: var(--size-control-s);
}

/* Between the actions and Delete, which takes something away for good */
.row-actions__divider {
  width: 1px;
  height: var(--space-m);
  margin-inline: var(--space-2xs);
  background: var(--color-border);
}

/*
 * The canvas is an iframe: the customer site's CSS stays fully separated from the
 * builder's CSS, in both directions.
 *
 * Selection and hover are drawn inside the page, by the core's canvas CSS on attributes the
 * bridge sets (data-elpresso-selected, data-elpresso-hover), so they scroll with the page;
 * nothing of them is in this block.
 */
.canvas {
  --canvas-handle-size: var(--space-s);
  /* Set by TypeScript while the preview is resized at the handles; 1fr fills the stage. */
  --canvas-width: 1fr;
  --canvas-height: 1fr;

  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  /* The size label sits in the top edge, the handles form the sides and the bottom. */
  padding: var(--space-l) 0 0;
  background: var(--color-workspace);
}

/* Current canvas width and height, shown in the top edge */
.canvas__size {
  position: absolute;
  inset: 0 0 auto;
  height: var(--space-l);
  font-size: var(--step--1);
  line-height: var(--space-l);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--color-text-subtle);
  pointer-events: none;
}

/*
 * What the canvas shows, at the start of the top edge: the page switcher, then for a
 * template the entry chip. Half the width at most, so the size in the middle stays clear.
 */
.canvas__bar {
  position: absolute;
  inset-block-start: 1px;
  inset-inline-start: var(--canvas-handle-size);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  max-width: calc(50% - 4rem);
}

/* The toggles of what the canvas shows at the right of the top edge, across from the bar: drafts, a visitor without consent, the moon last; a hidden one leaves no gap */
.canvas__views {
  position: absolute;
  inset-block-start: 1px;
  inset-inline-end: var(--canvas-handle-size);
  z-index: var(--z-overlay);
  display: flex;
  gap: var(--space-3xs);
}

/* Pressed, the lists leave their drafts out, as visitors get the page after the next publish */
.canvas__state {
  block-size: var(--size-control-s);
  padding-inline: var(--space-2xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--step--1);
}

.canvas__state:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -2px;
}

.canvas__drafts[aria-pressed="true"] {
  background: var(--color-draft-muted);
  color: var(--color-draft);
}

.canvas__visitor[aria-pressed="true"] {
  background: var(--color-consent-muted);
  color: var(--color-consent);
}

/* Pressed, the canvas shows the page in its dark scheme */
.canvas__scheme[aria-pressed="true"] {
  background: var(--color-accent-muted);
  color: var(--color-accent-text);
}

/*
 * The page switcher keeps its width and gives way only to its floor (`.pages`), after the
 * entry chip gave up what it can. No percentage: the bar is only as wide as its content, so
 * 40 % of it was 40 % of the switcher itself, which squeezed the name away (#79).
 */
.canvas__pages {
  flex: 0 1 auto;
}

/*
 * The entry chip takes what the switcher leaves: from a basis of 0 it grows into the room
 * there is, so a short page name like "Tour" stays whole beside a long entry title (#50).
 */
.canvas__entry {
  flex: 1 1 0;
}

/*
 * Handles left, right and below the viewport. A px size caps its track, so the canvas
 * stays centred horizontally and keeps its top edge while it shrinks.
 */
.canvas__stage {
  display: grid;
  flex: 1;
  grid-template-columns: var(--canvas-handle-size) minmax(0, var(--canvas-width)) var(--canvas-handle-size);
  grid-template-rows: minmax(0, var(--canvas-height)) var(--canvas-handle-size);
  justify-content: center;
  align-content: start;
  min-width: 0;
  min-height: 0;
}

/* Responsive preview: the canvas is narrowed at the side handles and shortened at the bottom one. */
.canvas__handle {
  position: relative;
  cursor: col-resize;
  touch-action: none;
}

.canvas__handle::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 4px;
  height: 48px;
  border-radius: 2px;
  background: var(--color-border-strong);
  translate: -50% -50%;
  transition: background-color var(--duration-fast);
}

.canvas__handle--left {
  grid-area: 1 / 1;
}

.canvas__handle--right {
  grid-area: 1 / 3;
}

.canvas__handle--bottom {
  grid-area: 2 / 2;
  cursor: row-resize;
}

.canvas__handle--bottom::before {
  width: 48px;
  height: 4px;
}

.canvas__handle:hover::before,
.canvas__handle:focus-visible::before,
.canvas__handle--active::before {
  background: var(--color-accent-line);
}

/* The focus ring stays inside the handle so it never overlaps the page */
.canvas__handle:focus-visible {
  outline-offset: -2px;
}

/*
 * Cross-block on purpose: the resizing state lives on the app root because every drag
 * (sidebar, editor, canvas handles) crosses the iframe, and the iframe must not swallow
 * pointer events while one is in progress. The canvas cannot know about the drag itself.
 */
.app--resizing .canvas__frame {
  pointer-events: none;
}

.app--resizing .canvas__size {
  color: var(--color-text);
}

.canvas__viewport {
  position: relative;
  grid-area: 1 / 2;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius-s);
  background: var(--color-canvas);
  box-shadow: var(--shadow-canvas);
}

.canvas__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--color-canvas);
}

/*
 * The sidebar: where what is open stands, the structure tree, the settings of the selected
 * element below it, split by resizers. Each section folds to its header; the other one then takes the room.
 */
.sidebar {
  /* Height of the element section; set by TypeScript from the resizer */
  --sidebar-panel-height: 320px;

  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--color-surface);
}

.sidebar__section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Where what is open stands: as tall as what it says, or as far as its edge was dragged up
   (set by TypeScript), above the two that share the rest; where the room runs out it gives way
   first and scrolls, so the structure keeps a few rows */
.sidebar__section--publishing {
  flex: 0 1 auto;
  min-height: var(--panel-header-height);
  max-height: var(--sidebar-publishing-height, none);
}

/* A folded or absent Publishing section has no edge to drag */
.sidebar__section--publishing:is([hidden], .sidebar__section--collapsed) + .sidebar__resizer {
  display: none;
}

.sidebar__section--structure {
  flex: 1 1 0;
  min-height: calc(3 * var(--panel-header-height));
}

.sidebar__section--element {
  flex: 0 0 var(--sidebar-panel-height);
}

/* The editor has no tree and no element settings, so this one section takes the sidebar */
.sidebar__section--content-fields {
  flex: 1 1 0;
  overflow-y: auto;
}

/* Folded to its header */
.sidebar__section--collapsed {
  flex: none;
  min-height: 0;
}

/* The other section is folded: this one takes all the room */
.sidebar__section--fill {
  flex: 1 1 0;
}

.sidebar__resizer {
  flex: none;
  height: 1px;
}

.sidebar__header {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-2xs);
  height: var(--panel-header-height);
  padding-inline: var(--space-xs) var(--space-s);
  border-bottom: 1px solid var(--color-border);
}

.sidebar__section--collapsed .sidebar__header {
  border-bottom-color: transparent;
}

/* Every folded section but the last keeps a line below, so two headers do not merge */
.sidebar__section--collapsed:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

.sidebar__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: var(--step-0);
  font-weight: 600;
}

/* The whole title is the disclosure button; the heading around it keeps the outline of the page */
.sidebar__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  width: 100%;
  min-width: 0;
  height: var(--size-control-m);
  padding-inline: var(--space-2xs);
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.sidebar__toggle:hover {
  background: var(--color-surface-hover);
}

.sidebar__toggle:focus-visible {
  outline-offset: -2px;
}

.sidebar__toggle-icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--color-text-subtle);
  transition: transform var(--duration-fast);
}

.sidebar__toggle--expanded .sidebar__toggle-icon {
  transform: rotate(90deg);
}

.sidebar__title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-3xs);
}

.sidebar__body {
  flex: 1;
  min-height: 0;
  padding: var(--space-m);
  overflow-x: hidden;
  overflow-y: auto;
}

/* Tree view of the inserted elements */
.structure {
  --structure-indent: 14px;
  /* Set by TypeScript per row; the root level is 1 */
  --structure-level: 1;
  /* Width of the selection mark on the row's leading edge */
  --structure-selection-width: 2px;

  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.structure__empty {
  margin: auto 0;
  padding: var(--space-l) var(--space-s);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-m);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-align: center;
  text-wrap: balance;
}

.structure__tree,
.structure__group {
  padding: 0;
  list-style: none;
}

.structure__tree {
  position: relative;
}

/* The empty state and the tree itself receive focus programmatically; the ring stays inside them */
.structure__empty:focus-visible,
.structure__tree:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -2px;
}

/* Dropping at the end of the top level: line below the whole tree */
.structure__tree--drop-end::after {
  content: "";
  position: absolute;
  inset-inline: var(--space-2xs) 0;
  bottom: -2px;
  height: 2px;
  border-radius: 1px;
  background: var(--color-accent-line);
}

/* Focus is shown on the row (see below), not on the item that holds the children too */
.structure__item {
  outline: none;
}

/* The dragged element and its children stay visible but pale */
.structure__item--dragging {
  opacity: 0.4;
}

.structure__row {
  --structure-row-inset: calc(var(--space-2xs) + (var(--structure-level) - 1) * var(--structure-indent));
  /* The actions fade in over this colour; each state below sets its own */
  --structure-row-background: var(--color-surface);

  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  height: var(--size-control-m);
  padding-inline: var(--structure-row-inset) var(--space-2xs);
  border-radius: var(--radius-s);
  color: var(--color-text-muted);
  user-select: none;
  cursor: grab;
}

/* Dropping before/after, and where the taskbar would insert: line at the indent of this row (z-index keeps it above the row's children) */
.structure__row--drop-before::before,
.structure__row--drop-after::before {
  content: "";
  position: absolute;
  inset-inline: var(--structure-row-inset) 0;
  z-index: 1;
  height: 2px;
  border-radius: 1px;
  background: var(--color-accent-line);
  pointer-events: none;
}

.structure__row--drop-before::before {
  top: -1px;
}

.structure__row--drop-after::before {
  bottom: -1px;
}

/* Dropping inside: whole row marked as target, dashed so it differs from the solid focus ring */
.structure__row--drop-inside {
  background: var(--color-accent-muted);
  outline: 2px dashed var(--color-accent-line);
  outline-offset: -2px;
  color: var(--color-text);
}

/* While dragging, the row's children must not distort the drop target */
.structure__row > * {
  pointer-events: none;
}

.structure__row > .structure__toggle,
.structure__row > .structure__actions,
.structure__actions > .structure__action,
.structure__row > .structure__label,
.structure__row > .structure__name,
.structure__row > .structure__rename {
  pointer-events: auto;
}

.structure__row:hover {
  --structure-row-background: var(--color-surface-hover);

  background: var(--color-surface-hover);
  color: var(--color-text);
}

.structure__row:active {
  cursor: grabbing;
}

/*
 * Selected: tinted plus a bar on the leading edge, so selection is not colour-only and
 * differs from hover. The bar takes its width from the padding, so nothing shifts.
 */
.structure__row--selected,
.structure__row--selected:hover {
  --structure-row-background: var(--color-accent-muted);

  padding-inline-start: calc(var(--structure-row-inset) - var(--structure-selection-width));
  border-inline-start: var(--structure-selection-width) solid var(--color-accent-line);
  background: var(--color-accent-muted);
  color: var(--color-text);
}

/* A place of a component, and the component being edited: the component colour, not the page's */
/* Shown on a condition: its name and icon are amber, like its outline on the canvas */
.structure__row--condition > .structure__icon,
.structure__row--condition > .structure__name {
  color: var(--color-condition);
}

.structure__row--component > .structure__icon,
.structure__row--component > .structure__name {
  color: var(--color-component);
}

.structure__row--component.structure__row--selected,
.structure__row--component.structure__row--selected:hover {
  --structure-row-background: var(--color-component-muted);

  border-inline-start-color: var(--color-component);
  background: var(--color-component-muted);
}

/* @content, where a frame's pages go: the frame colour */
.structure__row--frame > .structure__icon,
.structure__row--frame > .structure__name {
  color: var(--color-frame);
}

.structure__row--frame.structure__row--selected,
.structure__row--frame.structure__row--selected:hover {
  --structure-row-background: var(--color-frame-muted);

  border-inline-start-color: var(--color-frame);
  background: var(--color-frame-muted);
}

/* A part of the consent layer the runtime reads: an answer, a toggle, the list of categories */
.structure__row--login > .structure__icon,
.structure__row--login > .structure__name {
  color: var(--color-info);
}

.structure__row--login.structure__row--selected,
.structure__row--login.structure__row--selected:hover {
  --structure-row-background: var(--color-info-muted);

  border-inline-start-color: var(--color-info);
  background: var(--color-info-muted);
}

.structure__row--consent > .structure__icon,
.structure__row--consent > .structure__name {
  color: var(--color-consent);
}

.structure__row--consent.structure__row--selected,
.structure__row--consent.structure__row--selected:hover {
  --structure-row-background: var(--color-consent-muted);

  border-inline-start-color: var(--color-consent);
  background: var(--color-consent-muted);
}

/* The page around the component being edited: shown for orientation, not for editing */
.structure__row--outside {
  opacity: 0.4;
  cursor: default;
}

.structure__row--outside:hover {
  background: none;
  color: var(--color-text-muted);
}

.structure__item:focus-visible > .structure__row {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -2px;
}

.structure__toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--color-text-subtle);
  cursor: pointer;
}

.structure__toggle--hidden {
  visibility: hidden;
}

.structure__toggle-icon {
  width: 12px;
  height: 12px;
  transition: transform var(--duration-fast);
}

.structure__toggle--expanded .structure__toggle-icon {
  transform: rotate(90deg);
}

.structure__icon {
  flex: none;
  width: 14px;
  height: 14px;
}

/* The tag is the secondary information: the readable name next to it carries the row */
.structure__label {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-subtle);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structure__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--step--1);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Renaming in place: the input keeps the row's height so nothing jumps while editing */
.structure__rename {
  flex: 1;
  min-width: 0;
  height: var(--size-control-s);
  padding-block: 0;
  padding-inline: var(--space-3xs);
  border: 1px solid var(--color-accent-line);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  /* The row suppresses selection for dragging; inside the input text must stay selectable */
  user-select: text;
}

/* Editing the tag: code face, as narrow as the tag it replaces */
.structure__rename--tag {
  flex: none;
  font-family: var(--font-code);
}

.structure__rename:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -2px;
}

/* Hidden on the canvas, the element and everything in it: pale, and marked by the flag below */
.structure__row--hidden > .structure__icon,
.structure__row--hidden > .structure__label,
.structure__row--hidden > .structure__name,
.structure__row--hidden > .structure__preview {
  opacity: 0.5;
}

/* The struck-through eye on the hidden element itself; it stays when the row is not hovered */
.structure__flag {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--color-text-subtle);
}

/* Shown on a condition: amber like its outline on the canvas */
.structure__flag--condition {
  color: var(--color-condition);
}

/* The actions float over the flag: their eye button says the same while they are shown */
.structure__row:hover > .structure__flag,
.structure__row--selected > .structure__flag {
  visibility: hidden;
}

.structure__preview {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
 * Hide, duplicate and delete (.icon-buttons): one bar for the selected row and one that
 * TypeScript moves to the row under the pointer, shown only while their row is hovered or
 * selected, so the bar left in a row the pointer moved off is hidden. They float over the end
 * of the row, fading in over its background, so the name is not cut short to make room for
 * buttons that are not there.
 */
.structure__actions {
  position: absolute;
  inset-block: 0;
  inset-inline-end: var(--space-2xs);
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
  padding-inline-start: var(--space-m);
  /* The row's tint is translucent on a selected row: the panel's own colour underneath keeps
     the name or text behind the buttons from showing through. */
  background:
    linear-gradient(to right, transparent, var(--structure-row-background) var(--space-m)),
    linear-gradient(to right, transparent, var(--color-surface) var(--space-m));
  opacity: 0;
  pointer-events: none;
}

.structure__row:hover .structure__actions,
.structure__row--selected .structure__actions {
  opacity: 1;
  pointer-events: auto;
}

/* Settings of the selected element below the structure: one card per value, label above it */
.element-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.element-panel__empty {
  margin: auto 0;
  padding: var(--space-l) var(--space-s);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-m);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-align: center;
  text-wrap: balance;
}

.element-panel__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.element-panel__group-title {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* A card with the reason its value was refused below it */
.element-panel__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

/* A card: the label on top, the value below; the whole card shows the focus of its field */
.element-panel__field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  padding: var(--space-xs) var(--space-s);
  border: 1px solid transparent;
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
}

.element-panel__field:focus-within {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -2px;
}

.element-panel__field--invalid,
.element-panel__field--invalid:focus-within {
  border-color: var(--color-danger);
  outline-color: var(--color-danger);
}

/* The field for a new attribute: dashed like the button below it, so it is not taken for one that exists */
.element-panel__field--new {
  border: 1px dashed var(--color-accent-line);
  background: transparent;
}

/* Room at the end of the card for its remove button or the arrow of its suggestions */
.element-panel__field--with-action {
  padding-inline-end: calc(var(--space-s) + 22px);
}

.element-panel__label {
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Attribute names are code: same face as in the HTML editor */
.element-panel__label--code {
  font-family: var(--font-code);
}

/* The card carries the focus ring, so the field inside it draws none of its own */
.element-panel__input,
.element-panel__select,
.element-panel__textarea {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: var(--step-0);
}

/* A picture's displayed width: the choice, and beside it the pixels of a fixed one */
.element-panel__display {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

.element-panel__input:focus-visible,
.element-panel__select:focus-visible,
.element-panel__textarea:focus-visible {
  outline: none;
}

.element-panel__input::placeholder,
.element-panel__textarea::placeholder {
  color: var(--color-text-subtle);
}

/* An alt text that follows its picture's or its entry's: what the website writes stands in the empty field */
.element-panel__input--follow::placeholder {
  color: var(--color-text-muted);
  font-style: italic;
}

/* A card's label with what stands beside it: the alt text's badge and its Decorative switch */
.element-panel__label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3xs) var(--space-xs);
  min-height: 20px;
}

/* The label keeps its words; the switch moves to a line of its own where the row is too narrow */
.element-panel__label-row .element-panel__label {
  flex: none;
}

.element-panel__mini-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  margin-inline-start: auto;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  cursor: pointer;
}

/* Small actions below a card that read as links: back to the upload's alt text, keep one in Uploads */
.element-panel__text-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs) var(--space-s);
}

.element-panel__text-action {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--step--1);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.element-panel__text-action:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.element-panel__input--code {
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.element-panel__select {
  cursor: pointer;
}

.element-panel__textarea {
  min-height: 5lh;
  resize: vertical;
}

/* A value that cannot be edited here, e.g. the preset marker */
.element-panel__value {
  overflow: hidden;
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Remove button (an .icon-button) in the top corner of a card */
.element-panel__field-action {
  position: absolute;
  inset-block-start: var(--space-2xs);
  inset-inline-end: var(--space-2xs);
}

/* The reason a value was not taken, right below its card */
.element-panel__message {
  margin: 0;
  color: var(--color-danger);
  font-size: var(--step--1);
}

/* The selected element is a place of a component: what it is and the two ways to change it */
.element-panel__place {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding: var(--space-s);
  border: 1px solid var(--color-component);
  border-radius: var(--radius-m);
  background: var(--color-component-muted);
}

/* @content of a frame: the same box in the frame colour */
.element-panel__place--frame {
  border-color: var(--color-frame);
  background: var(--color-frame-muted);
}

.element-panel__place-text {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step--1);
}

.element-panel__place-actions {
  display: flex;
  gap: var(--space-xs);
}

/* A warning below a card that does not refuse the value, e.g. a collection that does not exist */
.element-panel__note {
  margin: 0;
  color: var(--color-pending);
  font-size: var(--step--1);
}

/* The way to a video's still below the picture before consent */
.element-panel__poster-link {
  color: var(--color-accent-text);
  font-size: var(--step--1);
}

/* What a value does, in words, e.g. the entries a filter keeps */
.element-panel__note--info {
  color: var(--color-text-subtle);
}

/* A label and a switch on one line */
.element-panel__switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: var(--step-0);
  cursor: pointer;
}

.element-panel__hints {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  margin: 0;
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-inline-start: 2px solid var(--color-accent-line);
  border-radius: var(--radius-m);
  list-style: none;
}

.element-panel__hint {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* "Add attribute" below the list, as a dashed card that is not there yet */
.element-panel__add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--size-control-l);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--step-0);
  cursor: pointer;
}

.element-panel__add:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.element-panel__kbd {
  color: var(--color-text-subtle);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.element-panel__add-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

/* Rows over a filter or condition in the element panel: one bordered fieldset per clause, narrow enough for the sidebar */
.condition-editor {
  display: grid;
  gap: var(--space-xs);
  margin-top: var(--space-3xs);
}

.condition-editor__rows {
  display: grid;
  gap: var(--space-xs);
}

.condition-editor__row {
  display: grid;
  gap: var(--space-2xs);
  min-width: 0;
  margin: 0;
  padding: var(--space-2xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
}

/* The field to compare and the button that removes the row */
.condition-editor__head,
.condition-editor__value {
  display: flex;
  gap: var(--space-2xs);
  align-items: center;
  min-width: 0;
}

.condition-editor__values {
  display: grid;
  gap: var(--space-2xs);
}

.condition-editor__select,
.condition-editor__input {
  flex: 1;
  min-width: 0;
  height: 24px;
  padding: 0 var(--space-2xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--step--1);
}

/* The date kind is short; the value takes the rest of the line */
.condition-editor__value > .condition-editor__select {
  flex: none;
  width: auto;
}

.condition-editor__select:focus-visible,
.condition-editor__input:focus-visible {
  border-color: var(--color-accent-line);
  outline: 1px solid var(--color-accent-line);
  outline-offset: -1px;
}

/* The value to compare with the arrow of its suggestions inside its end */
.condition-editor__field {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
}

/* Room for the toggle of the suggestions, an icon-button--s inside the border */
.condition-editor__field > .condition-editor__input {
  padding-inline-end: var(--size-control-s);
}

/* A field that names nothing a condition can compare, e.g. a placeholder with a fallback */
.condition-editor__input[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.condition-editor__remove {
  flex: none;
}

.condition-editor__footer {
  display: flex;
  gap: var(--space-s);
  align-items: center;
  justify-content: space-between;
}

/* Text buttons: they add or switch, the rows themselves are the content */
.condition-editor__add,
.condition-editor__or,
.condition-editor__mode {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
}

.condition-editor__mode {
  margin-inline-start: auto;
  color: var(--color-text-muted);
}

.condition-editor__add:hover,
.condition-editor__or:hover,
.condition-editor__mode:hover {
  text-decoration: underline;
}

.condition-editor__mode:disabled,
.condition-editor__mode[aria-disabled="true"] {
  color: var(--color-text-subtle);
  text-decoration: none;
  cursor: default;
}

.condition-editor__add:focus-visible,
.condition-editor__or:focus-visible,
.condition-editor__mode:focus-visible {
  border-radius: var(--radius-s);
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

/* Suggestions below a text field; fixed and outside the panel, so no scrolling box clips them */
.combobox__list {
  /* Set by TypeScript from the field's position */
  --combobox-top: 0px;
  --combobox-left: 0px;
  --combobox-width: 160px;

  position: fixed;
  inset-block-start: var(--combobox-top);
  inset-inline-start: var(--combobox-left);
  z-index: var(--z-overlay);
  width: var(--combobox-width);
  max-height: 240px;
  margin: 0;
  padding: var(--space-2xs);
  overflow-y: auto;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-toast);
  list-style: none;
}

.combobox__option {
  padding: var(--space-3xs) var(--space-xs);
  /* A long placeholder wraps rather than scrolling the list sideways */
  overflow-wrap: anywhere;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
  line-height: var(--code-line-height);
  cursor: pointer;
}

/* The value after a suggestion's label: what the field will hold, e.g. a collection's slug */
.combobox__value {
  margin-inline-start: var(--space-xs);
  color: var(--color-text-subtle);
}

/* The option the arrow keys are on: the focus stays in the field, so the option carries the ring */
.combobox__option--active {
  border-color: var(--color-accent-line);
  background: var(--color-accent-muted);
}

/* The value the field holds right now */
.combobox__option--current {
  font-weight: 600;
}

/* The arrow button at the end of the field; the field's card leaves room for it */
.combobox__toggle {
  position: absolute;
  inset-block-end: var(--space-xs);
  inset-inline-end: var(--space-2xs);
}

/* In a field that stands alone, without a card's padding around it: inside its border */
.combobox__toggle--tight {
  inset-block-end: 1px;
  inset-inline-end: 1px;
}

.combobox__toggle-icon {
  rotate: 90deg;
}

/* Menu at the pointer or the focused row; fixed, so no scrolling container can clip it */
.context-menu {
  /* Set by TypeScript: where the menu opens, kept inside the window */
  --context-menu-top: 0px;
  --context-menu-left: 0px;

  position: fixed;
  inset-block-start: var(--context-menu-top);
  inset-inline-start: var(--context-menu-left);
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: var(--space-2xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-toast);
}

.context-menu:focus-visible {
  outline-offset: -2px;
}

.context-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  height: var(--size-control-m);
  padding-inline: var(--space-xs);
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: var(--step--1);
  text-align: start;
  cursor: pointer;
}

.context-menu__item:hover,
.context-menu__item:focus-visible {
  background: var(--color-surface-hover);
}

.context-menu__item:focus-visible {
  outline-offset: -2px;
}

.context-menu__item--danger {
  color: var(--color-danger);
}

.context-menu__shortcut {
  color: var(--color-text-subtle);
  font-family: var(--font-code);
}

.context-menu__separator {
  height: 1px;
  margin-block: var(--space-2xs);
  background: var(--color-border);
}

/*
 * Three areas: the manage panel's openers and undo/redo on the start side, the elements to
 * insert in the middle, publish and save at the end. The sides take what they need; the
 * middle gets the rest and scrolls when that is not enough.
 */
.taskbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-m);
  height: var(--taskbar-height);
  padding-inline: var(--space-s);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.taskbar__start,
.taskbar__end {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  /* A flex item's minimum is its content; without this the group would overflow into the elements column */
  min-width: 0;
}

.taskbar__end {
  position: relative;
  justify-content: flex-end;
}

/*
 * Speaks only while the site styles travel, fail or have just arrived. It stands above the
 * bar's end, out of the row: in the row its coming and going moved every button before it,
 * and a press meant for Preview met its neighbour.
 */
.taskbar__styles {
  position: absolute;
  inset-block-end: calc(100% + var(--space-xs));
  inset-inline-end: 0;
  max-width: 60vw;
  overflow: hidden;
  margin: 0;
  padding: var(--space-2xs) var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Nothing to say, nothing to show */
.taskbar__styles:empty {
  display: none;
}

.taskbar__styles--failed {
  color: var(--color-danger);
}

/* Save keeps its width whether it says Save or Saved, so the taskbar never moves */
.taskbar__save {
  min-inline-size: 6.5em;
}

/* Between the panel's openers and undo/redo */
.taskbar__divider {
  width: 1px;
  height: var(--space-m);
  margin-inline: var(--space-2xs);
  background: var(--color-border);
}

/*
 * The toolbar scrolls sideways when the window is too narrow. The bar has a fixed height,
 * so the scrollbar must fit into the slack around the buttons: full height, thin scrollbar.
 */
.taskbar__elements {
  display: flex;
  align-self: stretch;
  align-items: center;
  /* "safe" keeps the first buttons reachable when the row is narrower than its content */
  justify-content: safe center;
  gap: var(--space-xs);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.taskbar__group {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.taskbar__item {
  flex: none;
}

/* The consent widgets' opener, in the consent colour like the mode's Save */
.taskbar__item--consent {
  color: var(--color-consent);
}

/* The opener of the manage panel carries the count of waiting comments in its corner */
.taskbar__manage {
  position: relative;
}

.taskbar__badge {
  position: absolute;
  inset-block-start: -2px;
  inset-inline-end: -2px;
  min-width: 16px;
  padding-inline: var(--space-3xs);
  border-radius: 8px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

/* Page switcher on the canvas's top edge: a select over the pages of the site, a settings button per row */
.pages {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  /* Never narrower than its content allows, so the badges and the chevron stay inside the border */
  min-width: min-content;
}

/* Holds the list, which opens downwards over the canvas */
.pages__switcher {
  position: relative;
  min-width: 0;
}

.pages__current {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  /* As wide as the name: a short one leaves the edge to the entry chip */
  max-width: 100%;
  height: 22px;
  padding-inline: var(--space-xs) var(--space-2xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: var(--step--1);
  cursor: pointer;
}

.pages__current:hover {
  background: var(--color-surface-hover);
}

/* The focus ring sits on the border, which turns accent at the same time */
.pages__current:focus-visible,
.pages__current[aria-expanded="true"] {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

/*
 * One line, cut with an ellipsis, but free to break between words: a name that may not wrap
 * is as wide as its whole text at min-content, so the switcher's floor (`.pages`) would be
 * the whole name; this way it is the longest word.
 */
.pages__name {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  /* A cut falls at a word, and a button centres what is left of the line */
  text-align: start;
}

.pages__badges {
  display: flex;
  flex: none;
  gap: var(--space-3xs);
}

.pages__chevron {
  flex: none;
  width: 12px;
  height: 12px;
  margin-inline-start: auto;
  color: var(--color-text-muted);
}

.pages__list {
  position: absolute;
  inset-block-start: calc(100% + var(--space-2xs));
  inset-inline-start: 0;
  z-index: var(--z-overlay);
  display: grid;
  /* minmax(0, …): a long address is cut with an ellipsis instead of widening the list */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2xs);
  width: 28rem;
  max-width: calc(100vw - 2 * var(--space-m));
  max-height: 60vh;
  padding: var(--space-2xs);
  overflow-y: auto;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-toast);
}

/*
 * The list keeps the focus while the arrow keys walk it: its ring stays, inside its edge,
 * and the active option carries a border of its own besides
 */
.pages__list:focus-visible {
  outline-offset: -2px;
}

.pages__group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.pages__group-label {
  padding: var(--space-3xs) var(--space-xs);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* One line per page: the name with its badges, the address to the right */
.pages__option {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-3xs) var(--space-xs);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  color: var(--color-text);
  font-size: var(--step--1);
  cursor: pointer;
}

.pages__option:hover {
  background: var(--color-surface-hover);
}

.pages__option--active {
  border-color: var(--color-accent-line);
  background: var(--color-accent-muted);
}

/*
 * The button to a page's settings: in the row's layout from the start, so the address does
 * not move, and shown where the pointer or the arrow keys are.
 */
.pages__option-edit {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--size-control-s);
  height: var(--size-control-s);
  margin-block: calc(-1 * var(--space-3xs));
  border-radius: var(--radius-s);
  color: var(--color-text-muted);
  visibility: hidden;
}

.pages__option:hover .pages__option-edit,
.pages__option--active .pages__option-edit {
  visibility: visible;
}

.pages__option-edit:hover {
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.pages__option-edit-icon {
  width: 16px;
  height: 16px;
}

/* The page the builder has open */
.pages__option[aria-selected="true"] .pages__option-name {
  font-weight: 600;
}

.pages__option-line {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: var(--space-2xs);
  min-width: 0;
}

.pages__option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pages__option-path {
  flex: 1 1 0;
  min-width: 4rem;
  margin-inline-start: auto;
  overflow: hidden;
  text-align: end;
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A button showing the option picked and a list of options with an icon and badges, which a native select cannot show: the Role and Visibility fields of the page settings */
.option-menu {
  position: relative;
  min-width: 0;
}

.option-menu__current {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  min-width: 0;
  padding: var(--space-2xs) var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font: inherit;
  font-size: var(--step-0);
  text-align: start;
  cursor: pointer;
}

/* A button that adds rather than picks: Add a collection, dashed in the accent */
.option-menu__current--add {
  border-style: dashed;
  color: var(--color-accent-text);
}

.option-menu__current:hover {
  background: var(--color-surface-hover);
}

/* The focus ring sits on the border, which turns accent at the same time */
.option-menu__current:focus-visible,
.option-menu__current[aria-expanded="true"] {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

.option-menu__icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

.option-menu__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The icons' chevron points right; turned, it says the list opens below */
.option-menu__chevron {
  flex: none;
  rotate: 90deg;
  width: 12px;
  height: 12px;
  color: var(--color-text-muted);
}

/* Opens downwards over the form, as wide as the field */
.option-menu__list {
  position: absolute;
  inset-block-start: calc(100% + var(--space-3xs));
  inset-inline: 0;
  z-index: var(--z-overlay);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-height: 60vh;
  padding: var(--space-3xs);
  overflow-y: auto;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-toast);
}

/* The list keeps the focus while the arrow keys walk it; its ring stays inside its edge */
.option-menu__list:focus-visible {
  outline-offset: -2px;
}

.option-menu__group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
}

/* One line per role: its icon, its name, and who plays it at the end */
.option-menu__option {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-2xs) var(--space-xs);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  color: var(--color-text);
  font-size: var(--step-0);
  cursor: pointer;
}

/* The first option stands apart from the others: None from the roles */
.option-menu__list--first-apart .option-menu__option:first-child {
  margin-block-end: var(--space-3xs);
  border-block-end-color: var(--color-border);
  border-end-start-radius: 0;
  border-end-end-radius: 0;
}

.option-menu__option:hover {
  background: var(--color-surface-hover);
}

.option-menu__option--active,
.option-menu__list--first-apart .option-menu__option--active:first-child {
  border-color: var(--color-accent-line);
  border-radius: var(--radius-s);
  background: var(--color-accent-muted);
}

.option-menu__option-icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

/* The role the field holds */
.option-menu__option[aria-selected="true"] .option-menu__option-icon {
  color: var(--color-accent-text);
}

.option-menu__option[aria-selected="true"] .option-menu__option-name {
  font-weight: 600;
}

/* The name takes the room, so the badge stands at the end of the line */
.option-menu__option-line {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

.option-menu__option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The entry a template shows on the canvas: step through the entries or search one */
.entry-chip {
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
}

.entry-chip[hidden] {
  display: none;
}

/* Which collection's entries, for a template that serves several */
.entry-chip__collection {
  flex: none;
  max-width: 10rem;
  height: 22px;
  padding-inline: var(--space-2xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: var(--step--1);
}

.entry-chip__collection:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

/* The one chevron turned back for the previous entry */
.entry-chip__step-icon--previous {
  rotate: 180deg;
}

.entry-chip__current {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-width: 0;
  height: 22px;
  padding-inline: var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: var(--step--1);
  cursor: pointer;
}

.entry-chip__current:hover {
  background: var(--color-surface-hover);
}

.entry-chip__current:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

.entry-chip__current[aria-expanded="true"] {
  border-color: var(--color-accent-line);
}

/* One line cut with an ellipsis, like the page's name: free to break between words, so the chip's floor is its longest word, not its whole title */
.entry-chip__label {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  /* A cut falls at a word, and a button centres what is left of the line */
  text-align: start;
}

/* Not on the website: the canvas shows it, visitors will not see it */
.entry-chip__badge {
  flex: none;
  padding: 0 var(--space-2xs);
  border-radius: var(--radius-s);
  background: var(--color-pending-muted);
  color: var(--color-pending);
  font-size: var(--step--1);
  line-height: 1.5;
}

.entry-chip__badge[hidden] {
  display: none;
}

.entry-chip__count {
  flex: none;
  color: var(--color-text-subtle);
  font-variant-numeric: tabular-nums;
}

.entry-chip__popover {
  position: absolute;
  inset-block-start: calc(100% + var(--space-2xs));
  inset-inline-start: 0;
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  width: 20rem;
  max-width: calc(100vw - 2 * var(--space-m));
  padding: var(--space-2xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-toast);
}

.entry-chip__popover[hidden] {
  display: none;
}

.entry-chip__search {
  height: var(--size-control-m);
  padding-inline: var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--step--1);
}

.entry-chip__search:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

.entry-chip__list {
  max-height: 240px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.entry-chip__option {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-3xs) var(--space-xs);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  color: var(--color-text);
  font-size: var(--step--1);
  cursor: pointer;
}

.entry-chip__option:hover {
  background: var(--color-surface-hover);
}

/* The option the arrow keys are on: the focus stays in the search, so the option carries the ring */
.entry-chip__option--active {
  border-color: var(--color-accent-line);
  background: var(--color-accent-muted);
}

/* The entry the canvas shows right now */
.entry-chip__option[aria-selected="true"] {
  font-weight: 600;
}

.entry-chip__option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-chip__note {
  margin: 0;
  padding-inline: var(--space-xs);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

.entry-chip__note:empty {
  display: none;
}

/* The frame the open page stands in, above the canvas: shaped like the page switcher, the pencil leads into the frame mode */
.frame-chip {
  display: flex;
  flex: none;
  min-width: 0;
}

.frame-chip[hidden] {
  display: none;
}

.frame-chip__edit {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  max-width: 16rem;
  height: 22px;
  padding-inline: var(--space-xs) var(--space-2xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: var(--step--1);
  cursor: pointer;
}

.frame-chip__edit:hover {
  background: var(--color-surface-hover);
}

/* The focus ring sits on the border, which turns accent at the same time, as on the switcher */
.frame-chip__edit:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

.frame-chip__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The same badge the switcher shows on a frame */
.frame-chip__badge {
  flex: none;
  padding: 0 var(--space-2xs);
  border-radius: var(--radius-s);
  background: var(--color-frame-muted);
  color: var(--color-frame);
  line-height: 1.6;
}

.frame-chip__icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
}

.frame-chip__edit:hover .frame-chip__icon {
  color: var(--color-text);
}

/* Publish group at the end of the taskbar: preview, export download, the website, publish */
.publish {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  margin-inline-end: var(--space-xs);
}

/* Links styled as buttons keep the button's colour and get no underline */
.publish__preview,
.publish__export {
  text-decoration: none;
}

/* Before the first publish there is nothing to preview */
.publish__preview[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

/* Just published: the way to the website glows twice, so it is found */
.publish__site--fresh {
  animation: publish-site-glow var(--duration-attention) ease-in-out 2;
}

@keyframes publish-site-glow {
  50% {
    background: var(--color-accent-muted);
    color: var(--color-accent-text);
  }
}

/* The icon of the moment what is open waits for */
.publish__scheduled-icon {
  width: 16px;
  height: 16px;
}

/* The notice that maintenance mode is on: its icon and its words, the icon alone where the window is narrow, since the words pushed the group over the elements and the openers */
.publish__away-label {
  margin-inline-start: var(--space-2xs);
}

@media (max-width: 1280px) {
  .publish__away-label {
    display: none;
  }
}

/*
 * Code editors for the selected element. The header carries only the tabs and, with tabs,
 * the classes, and at its end the layout and maximize buttons: side by side it is hidden,
 * because every pane has its own header and the first one takes the layout button. The
 * footer shows only while there is a parse error.
 */
.code-panel {
  /* Set by TypeScript per pane while the splitters are dragged; equal shares by default */
  --code-panel-pane-grow: 1;

  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--color-surface);
}

.code-panel__header {
  display: flex;
  flex: none;
  height: var(--panel-header-height);
  padding-inline: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

/* Every child may shrink, so the classes list truncates instead of overflowing */
.code-panel__header > * {
  min-width: 0;
}

/* Layout and maximize at the end of the panel header */
.code-panel__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-2xs);
  margin-inline-start: auto;
}

/* Layout and maximize buttons in a header (an .icon-button): only its position lives here */
.code-panel__action {
  align-self: center;
}

.code-panel__body {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}

/*
 * Each editor sits in a pane. With tabs, the active pane fills the space and has no header.
 * With .code-panel--split all three stand side by side.
 */
.code-panel__pane {
  display: flex;
  /* The width is a share of the space, not a fixed value: set while dragging the splitters */
  flex: var(--code-panel-pane-grow) 1 0;
  flex-direction: column;
  min-width: 0;
  background: var(--color-surface);
}

.code-panel__pane-header {
  display: none;
  flex: none;
  align-items: center;
  height: var(--size-control-l);
  padding-inline: var(--space-m) var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

/* Never shrinks: the three titles are short, and "CSS" must not end up as "C…" */
.code-panel__pane-title {
  flex: none;
  margin-inline-end: auto;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-panel__pane-body {
  position: relative;
  flex: 1;
  min-height: 0;
}

/* Under the script, in its corner: the service of the cookie consent it waits for on the website */
.code-panel__consent {
  position: absolute;
  inset-block-end: var(--space-xs);
  inset-inline-end: var(--space-s);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-3xs) var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  font-size: var(--step--1);
}

.code-panel__consent[hidden] {
  display: none;
}

.code-panel__consent-label {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.code-panel__consent-select {
  max-inline-size: 14rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.code-panel__consent-select:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 1px;
}

.code-panel--split .code-panel__pane-header,
.code-panel__pane--maximized .code-panel__pane-header {
  display: flex;
}

/* Splitter between two panes (mixed with .resizer): drag it to resize the panes. */
.code-panel__splitter {
  flex: none;
  width: 1px;
}

/* Maximized pane: large in the middle of the screen, the rest dimmed by the backdrop. */
.code-panel__pane--maximized {
  position: fixed;
  inset: 8dvh 10vw;
  z-index: var(--z-overlay);
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-raised);
}

.code-panel__backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: var(--color-backdrop);
}

.code-panel__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-l);
  background: var(--color-bg);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-align: center;
}

.code-panel__footer {
  display: flex;
  flex: none;
  align-items: center;
  min-height: var(--size-control-m);
  padding-block: var(--space-3xs);
  padding-inline: var(--space-m);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

/* Every refusal of the core, one a line; a long list scrolls rather than pushing the editor away */
.code-panel__error {
  flex: 1;
  min-width: 0;
  max-block-size: 5lh;
  overflow-y: auto;
  color: var(--color-danger);
  white-space: pre-line;
}

/* A hint about HTML that was applied anyway, e.g. a line break that became a space */
.code-panel__error--note {
  color: var(--color-text-muted);
}

/* Tab strip in the code-panel header; the active tab carries a real bottom border, not only a colour */
.tabs {
  display: flex;
  gap: var(--space-3xs);
}

.tabs__tab {
  position: relative;
  display: flex;
  align-items: center;
  padding-inline: var(--space-m);
  border: 0;
  /* Transparent here so the active state does not shift the label; forced colours make it visible */
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color var(--duration-fast);
}

.tabs__tab:hover:not(:disabled) {
  color: var(--color-text);
}

.tabs__tab:disabled {
  color: var(--color-text-subtle);
  cursor: default;
}

.tabs__tab:focus-visible {
  outline-offset: -4px;
}

.tabs__tab--active {
  border-bottom-color: var(--color-accent-line);
  color: var(--color-text);
}

/* How many a tab holds, a small figure after its label */
.tabs__count {
  min-width: 18px;
  margin-inline-start: var(--space-xs);
  padding-inline: var(--space-2xs);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  letter-spacing: 0;
  text-align: center;
}

.tabs__tab--active > .tabs__count {
  background: var(--color-accent-muted);
  color: var(--color-text);
}

/*
 * Classes of the selected element as badges: pick the active class whose CSS is edited,
 * rename one in place, take it off with its ×, delete it with its trash, add one with the
 * + at the end (it opens the add-class dialog).
 */
.class-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-width: 0;
  padding-inline: var(--space-s);
}

/*
 * The chips scroll sideways, but the scrollbar is never drawn: inside a header this low it
 * would take the height the chips need. Scroll with the wheel; tabbing to a chip brings it
 * into view.
 */
/*
 * Holds the scrolling chips and draws the edges over them. The edges live here and not on
 * the list, because anything inside the list would scroll away with the chips.
 */
.class-switcher__strip {
  /* Set by TypeScript: the edge grows where chips are hidden, 0 where they are not */
  --class-switcher-fade-start: 0px;
  --class-switcher-fade-end: 0px;

  position: relative;
  display: flex;
  min-width: 0;
}

.class-switcher__strip::before,
.class-switcher__strip::after {
  content: "";
  position: absolute;
  inset-block: 0;
  z-index: var(--z-resizer);
  pointer-events: none;
}

.class-switcher__strip::before {
  inset-inline-start: 0;
  width: var(--class-switcher-fade-start);
  background: linear-gradient(to right, var(--color-border-strong), transparent);
}

.class-switcher__strip::after {
  inset-inline-end: 0;
  width: var(--class-switcher-fade-end);
  background: linear-gradient(to left, var(--color-border-strong), transparent);
}

.class-switcher__list {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  touch-action: pan-x;
  mask-image: linear-gradient(
    to right,
    transparent 0,
    black var(--class-switcher-fade-start),
    black calc(100% - var(--class-switcher-fade-end)),
    transparent 100%
  );
}

/*
 * A chip is a badge like the page badges (Template, Draft): a tinted fill and text in one
 * hue, nothing else, a little lower than those. The active chip gets a deeper fill. The
 * outline stays transparent and is never drawn; it is there for forced colours, which would
 * otherwise lose the chip, and unlike a border it takes no height.
 */
.class-switcher__item {
  display: flex;
  flex: none;
  align-items: stretch;
  border-radius: var(--radius-s);
  outline: 1px solid transparent;
  outline-offset: -1px;
  background: var(--code-selector-muted);
  color: var(--code-selector);
  font-size: var(--step--1);
  line-height: 1.4;
  transition: background-color var(--duration-fast);
}

.class-switcher__item--active {
  background: var(--code-selector-strong);
}

/* An id is set apart from the classes by the blue of the style manager */
.class-switcher__item--id {
  background: var(--code-storage-muted);
  color: var(--code-storage);
}

.class-switcher__item--id.class-switcher__item--active {
  background: var(--code-storage-strong);
}

/* The marker chip of an element preset: the default look of every such element, in teal like the Template badge */
.class-switcher__item--element {
  background: var(--code-type-muted);
  color: var(--code-type);
}

.class-switcher__item--element.class-switcher__item--active {
  background: var(--code-type-strong);
}

.class-switcher__class,
.class-switcher__action {
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* Negative offsets keep the focus ring inside the badge, clear of the neighbouring button */
.class-switcher__class:focus-visible,
.class-switcher__action:focus-visible {
  outline-offset: -2px;
}

/* Same colour a selector has in the CSS editor, because a chip is a selector */
.class-switcher__class {
  padding-inline: var(--space-2xs);
  font-family: var(--font-code);
}

.class-switcher__item--element .class-switcher__class {
  font-family: var(--font-ui);
}

/* Name field while renaming, in place of the label */
.class-switcher__rename {
  min-width: 0;
  padding-inline: var(--space-2xs);
  border: 0;
  border-radius: var(--radius-s);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: inherit;
  line-height: inherit;
  user-select: text;
}

/*
 * × takes the class off the element, the trash deletes it everywhere. They stay dim until
 * the chip is pointed at, focused inside or active, so a row of badges reads calm; dim, not
 * hidden, so Tab still finds them.
 */
.class-switcher__action {
  display: grid;
  place-items: center;
  padding-inline: var(--space-3xs);
  opacity: 0.45;
  transition:
    opacity var(--duration-fast),
    color var(--duration-fast);
}

.class-switcher__action:last-child {
  padding-inline-end: var(--space-2xs);
}

.class-switcher__item:hover .class-switcher__action,
.class-switcher__item:focus-within .class-switcher__action,
.class-switcher__item--active .class-switcher__action {
  opacity: 1;
}

.class-switcher__action:hover {
  color: var(--color-text);
}

.class-switcher__action--delete:hover {
  color: var(--color-danger);
}

.class-switcher__icon {
  width: 12px;
  height: 12px;
}

/* Only a strip with hidden chips can be dragged, so only then does the pointer say so */
.class-switcher__list--scrollable {
  cursor: grab;
}

/* While dragging, the chips under the pointer must not look clickable or get selected */
.class-switcher__list--dragging,
.class-switcher__list--dragging .class-switcher__class,
.class-switcher__list--dragging .class-switcher__action {
  cursor: grabbing;
  user-select: none;
}

/* The + that opens the add-class dialog (an .icon-button): it never scrolls away */
.class-switcher__add {
  flex: none;
}

/* The dialog behind the + in the class row: one field for one or more class names */
.add-class {
  display: grid;
  gap: var(--space-xs);
  min-width: min(26rem, 80vw);
}

.add-class__label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.add-class__input {
  height: var(--size-control-l);
  padding-inline: var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-bg);
  color: var(--code-selector);
  font-family: var(--font-code);
  font-size: var(--step-0);
}

.add-class__input::placeholder {
  color: var(--color-text-subtle);
}

/* The focus ring sits on the border, which turns accent at the same time */
.add-class__input:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

.add-class__input--invalid,
.add-class__input--invalid:focus-visible {
  border-color: var(--color-danger);
  outline-color: var(--color-danger);
}

/* How several are typed at once, always below the field */
.add-class__note {
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

/* Why a name was not accepted */
.add-class__hint {
  color: var(--color-danger);
  font-size: var(--step--1);
}

.add-class__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
  margin-block-start: var(--space-xs);
}

/*
 * Highlighted code as a <pre> behind a transparent textarea. Both need the same font,
 * padding, wrapping and scrollbar gutter, otherwise text and caret drift apart.
 *
 * Long lines wrap instead of scrolling sideways, so a line number cannot live in a column
 * of its own: every line is a block that draws its number into its own start padding.
 */
.code-editor {
  /* Room for a three-digit line number plus the gap to the code */
  --code-editor-gutter-width: 36px;
  /* How far the textarea has scrolled; the highlight behind it moves up as far (set by code-editor.ts) */
  --code-editor-scroll: 0px;

  position: absolute;
  inset: 0;
  background: var(--color-bg);
  font-family: var(--font-code);
  font-size: var(--code-font-size);
  line-height: var(--code-line-height);
}

.code-editor__highlight,
.code-editor__input {
  position: absolute;
  inset: 0;
  margin: 0;
  border: 0;
  font: inherit;
  line-height: inherit;
  /* hidden across: lines wrap. The stable gutter keeps both boxes equally wide. */
  overflow: hidden auto;
  scrollbar-gutter: stable;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  tab-size: 2;
}

.code-editor__highlight {
  padding: var(--space-xs) var(--space-m) var(--space-xs) 0;
  color: var(--code-text);
  /* The gutter is reserved like the textarea's, the bar itself is never drawn */
  scrollbar-color: transparent transparent;
  pointer-events: none;
}

.code-editor__code {
  display: block;
  font: inherit;
  translate: 0 calc(-1 * var(--code-editor-scroll));
}

/* One source line. Its number sits in the start padding and stays put when the line wraps. */
.code-editor__row {
  position: relative;
  display: block;
  min-height: var(--code-line-height);
  padding-inline-start: var(--code-editor-gutter-width);
}

/* Line numbers are decorative (the active one is readable), so the faint colour is allowed here */
.code-editor__row::before {
  content: attr(data-line);
  position: absolute;
  inset-inline-start: 0;
  width: calc(var(--code-editor-gutter-width) - var(--space-xs));
  color: var(--color-text-faint);
  text-align: end;
  user-select: none;
}

.code-editor__row--active::before {
  color: var(--color-text-muted);
}

/* Focus is shown on the whole editor (below), not on the transparent textarea */
.code-editor__input {
  width: 100%;
  height: 100%;
  padding: var(--space-xs) var(--space-m) var(--space-xs) var(--code-editor-gutter-width);
  outline: 0;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: var(--code-text);
}

.code-editor__input::selection {
  background: var(--color-text-selection);
  color: transparent;
}

.code-editor__token--comment { color: var(--code-comment); }
.code-editor__token--string { color: var(--code-string); }
.code-editor__token--number { color: var(--code-number); }
.code-editor__token--keyword { color: var(--code-keyword); }
.code-editor__token--storage { color: var(--code-storage); }
.code-editor__token--function { color: var(--code-function); }
.code-editor__token--variable { color: var(--code-variable); }
.code-editor__token--type { color: var(--code-type); }
.code-editor__token--regex { color: var(--code-regex); }
.code-editor__token--tag { color: var(--code-tag); }
.code-editor__token--attr { color: var(--code-variable); }
.code-editor__token--property { color: var(--code-variable); }
.code-editor__token--selector { color: var(--code-selector); }
.code-editor__token--value { color: var(--code-string); }
.code-editor__token--punctuation { color: var(--code-punctuation); }

/* Cursor line in the bottom corner, only while the editor is being typed in */
.code-editor__position {
  position: absolute;
  inset-block-end: var(--space-2xs);
  inset-inline-end: var(--space-m);
  display: none;
  padding: 0 var(--space-2xs);
  border-radius: var(--radius-s);
  background: var(--color-surface);
  color: var(--color-text-subtle);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  pointer-events: none;
}

.code-editor:focus-within .code-editor__position {
  display: block;
}

/*
 * Focus ring drawn inside the editor: the inset shadow is the visible ring, the transparent
 * outline is what forced colours render instead.
 */
.code-editor:focus-within {
  outline: 2px solid transparent;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 2px var(--color-accent-line);
}

/*
 * Visibly only 1px wide. ::after enlarges the hit area, ::before shows a wider accent
 * line on hover and while dragging.
 */
.resizer {
  position: relative;
  z-index: var(--z-resizer);
  background: var(--color-border);
  touch-action: none;
}

.resizer::before,
.resizer::after {
  content: "";
  position: absolute;
}

.resizer::before {
  background: transparent;
  transition: background-color var(--duration-fast);
}

.resizer:hover::before,
.resizer:focus-visible::before,
.resizer--active::before {
  background: var(--color-accent-line);
}

/* The ring hugs the accent line; the outline itself comes from base.css */
.resizer:focus-visible {
  outline-offset: 1px;
}

.resizer--horizontal {
  cursor: row-resize;
}

.resizer--horizontal::before {
  inset: -1px 0;
}

.resizer--horizontal::after {
  inset: -4px 0;
}

.resizer--vertical {
  cursor: col-resize;
}

.resizer--vertical::before {
  inset: 0 -1px;
}

.resizer--vertical::after {
  inset: 0 -4px;
}

/* Button with a text label */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--size-control-l);
  padding-inline: var(--space-m);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--color-text);
  font-size: var(--step--1);
  font-weight: 600;
  /* A link that looks like a button, the 404 page's way back, carries no underline */
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--duration-fast),
    border-color var(--duration-fast),
    filter var(--duration-fast);
}

.button:hover:not(:disabled, [aria-disabled="true"]) {
  background: var(--color-surface-hover);
}

/* Off for a reason the surrounding text gives: muted, whatever the modifier. aria-disabled
   is the same look for a button that stays focusable so its tooltip can say why. */
.button:disabled,
.button[aria-disabled="true"] {
  border-color: var(--color-border);
  background: transparent;
  color: var(--color-text-subtle);
  cursor: not-allowed;
  filter: none;
}

/* Filled: the accent's own label on it, see --color-on-accent for the contrast figure */
.button--primary {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.button--primary:hover:not(:disabled, [aria-disabled="true"]) {
  background: var(--color-accent);
  filter: brightness(1.1);
}

.button--primary:active:not(:disabled, [aria-disabled="true"]) {
  filter: brightness(0.95);
}

/* Saves a component rather than the page: the component colour says which one it is */
.button--component {
  border-color: var(--color-component);
  background: var(--color-component);
  color: var(--color-on-fill);
}

.button--component:hover:not(:disabled) {
  background: var(--color-component);
  filter: brightness(1.1);
}

/* Saves a frame rather than the page: the frame colour says which one it is */
.button--frame {
  border-color: var(--color-frame);
  background: var(--color-frame);
  color: var(--color-on-fill);
}

.button--frame:hover:not(:disabled) {
  background: var(--color-frame);
  filter: brightness(1.1);
}

/* Saves the consent layer rather than the page: its colour says which one it is */
.button--consent {
  border-color: var(--color-consent);
  background: var(--color-consent);
  color: var(--color-on-fill);
}

.button--consent:hover:not(:disabled) {
  background: var(--color-consent);
  filter: brightness(1.1);
}

/* Exit of the consent mode: outlined in the consent colour beside its filled Save */
.button--consent-quiet {
  border-color: var(--color-consent);
  color: var(--color-consent);
}

.button--consent-quiet:hover:not(:disabled) {
  background: var(--color-consent-muted);
}

/* An action that cannot be undone: outlined in the danger colour, filled on hover */
.button--danger {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.button--danger:hover:not(:disabled) {
  background: var(--color-danger);
  color: var(--color-on-fill);
}

/* Something that waits on the owner, maintenance mode while it is on: outlined in the pending colour on its muted fill */
.button--pending {
  border-color: var(--color-pending);
  background: var(--color-pending-muted);
  color: var(--color-pending);
}

/* Scheduling (#106) in the colour of the Scheduled badge: the taskbar's chip of when what is open goes out, its icon before the time, and the Publishing card's Schedule */
.button--scheduled {
  gap: var(--space-2xs);
  border-color: var(--color-info);
  background: var(--color-info-muted);
  color: var(--color-info);
}

/* It did not go out at its moment and waits for the owner */
.button--scheduled-failed {
  border-color: var(--color-danger);
  background: var(--color-danger-muted);
  color: var(--color-danger);
}

/* The action that refreshes a section's data, in the section head: outlined in the accent on its muted fill, told apart from a card's Save */
.button--accent {
  gap: var(--space-2xs);
  padding-inline: var(--space-s);
  border-color: var(--color-accent-line);
  background: var(--color-accent-muted);
  color: var(--color-accent-text);
}

.button--accent:hover:not(:disabled, [aria-disabled="true"]) {
  background: var(--color-accent-muted);
  filter: brightness(1.15);
}

/* An icon before the words; it takes the button's colour */
.button__icon {
  flex: none;
  width: 14px;
  height: 14px;
}

/* The Publish button with its chevron and the menu of the other ways to publish (#106); the menu stands in the top layer, placed by publish-button.ts */
.publish-button {
  --publish-button-menu-top: 0;
  --publish-button-menu-left: 0;

  display: inline-flex;
  align-items: stretch;
}

.publish-button__main {
  gap: var(--space-2xs);
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  padding-inline: var(--space-s);
}

.publish-button__more {
  width: var(--size-control-m);
  padding-inline: 0;
  border-inline-start-width: 0;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

/* The Publishing card's, as wide as the card: the main part takes what the chevron leaves */
.publish-button--wide {
  display: flex;
}

.publish-button--wide .publish-button__main {
  flex: 1;
  min-width: 0;
}

/* The card's is tinted in the live colour, where a publish takes the piece; the inspector's foot
   keeps the one filled button, Save. With nothing to publish the whole of it stays quiet, the
   chevron too, whose menu still offers the rest (decided 2026-11-03) */
.publish-button--wide:not(.publish-button--quiet) .publish-button__main:not(:disabled, [aria-disabled="true"]),
.publish-button--wide:not(.publish-button--quiet) .publish-button__more:not(:disabled) {
  border-color: var(--color-live);
  background: var(--color-live-muted);
  color: var(--color-live);
}

.publish-button--wide:not(.publish-button--quiet) .publish-button__main:hover:not(:disabled, [aria-disabled="true"]),
.publish-button--wide:not(.publish-button--quiet) .publish-button__more:hover:not(:disabled) {
  background: var(--color-live-muted);
  filter: brightness(1.15);
}

.publish-button--m .publish-button__main,
.publish-button--m .publish-button__more {
  height: var(--size-control-m);
}

/* The chevron points where the menu opens */
.publish-button__more--up .publish-button__icon {
  rotate: 180deg;
}

.publish-button__icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.publish-button__label {
  white-space: nowrap;
}

.publish-button__menu {
  position: fixed;
  inset: var(--publish-button-menu-top) auto auto var(--publish-button-menu-left);
  width: min(20rem, calc(100vw - 2 * var(--space-s)));
  margin: 0;
  padding: var(--space-2xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-raised);
  color: var(--color-text);
}

/* What is open and where it stands */
.publish-button__head {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-2xs) var(--space-xs) var(--space-xs);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-3xs);
}

.publish-button__name {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publish-button__item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3xs) var(--space-xs);
  width: 100%;
  padding: var(--space-xs);
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: var(--step--1);
  text-align: start;
  cursor: pointer;
}

.publish-button__item:hover,
.publish-button__item:focus-visible {
  background: var(--color-surface-hover);
}

.publish-button__item:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -2px;
}

/* Unpublish takes something away from visitors */
.publish-button__item--danger,
.publish-button__item--danger .publish-button__item-icon {
  color: var(--color-danger);
}

.publish-button__item[aria-disabled="true"] {
  color: var(--color-text-subtle);
  cursor: default;
}

.publish-button__item-icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--color-icon);
}

.publish-button__item-label {
  font-weight: 600;
}

.publish-button__item-hint {
  color: var(--color-text-subtle);
  white-space: nowrap;
}

/* The second line says what happens, under the label */
.publish-button__item-sub {
  grid-column: 2 / 4;
  color: var(--color-text-muted);
  font-weight: 400;
}

.publish-button__line {
  height: 1px;
  margin: var(--space-3xs) var(--space-3xs);
  background: var(--color-border);
}

/* The Publishing card at the top of an inspector and of the canvas's sidebar (#106): the switch between Draft and Live, a panel with where the piece stands and its moments, and its Publish button; the panel is the card's one frame (decided 2026-11-04) */
.publish-card {
  display: grid;
  gap: var(--space-xs);
}

/* In the canvas's sidebar the section around it names it; the switch stands in its header */
.publish-card--bare {
  gap: var(--space-xs);
}

.publish-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.publish-card__title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  margin: 0;
  font-size: var(--step--1);
  font-weight: 600;
}

.publish-card__icon {
  width: 14px;
  height: 14px;
  color: var(--color-icon);
}

.publish-card__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
}

/* Holding the switch between Draft and Live at the head's end */
.publish-card__badge--end {
  gap: var(--space-2xs);
  margin-inline-start: auto;
}

/* The switch keeps its two choices on one line */
.publish-card__visibility {
  flex-wrap: nowrap;
}

/* The panel, raised like the reference of the decision: the steps above, the rows below */
.publish-card__panel {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
}

/* The steps: an icon on a line that joins them, then what it is and a sentence */
.publish-card__steps {
  display: grid;
  margin: 0;
  padding: var(--space-s);
  list-style: none;
}

.publish-card__step {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: var(--space-xs);
  position: relative;
  padding-block-end: var(--space-s);
}

.publish-card__step:last-child {
  padding-block-end: 0;
}

/* The line from this step's icon down to the next one's */
.publish-card__step:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-block: 22px 2px;
  inset-inline-start: 8px;
  border-inline-start: 1.5px solid var(--color-border-strong);
}

/* The room of "Edits not saved" kept while there are none, so the form below does not move */
.publish-card__step--reserved {
  visibility: hidden;
}

.publish-card__step:has(+ .publish-card__step--reserved)::after {
  display: none;
}

.publish-card__step-icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--color-icon);
}

.publish-card__step--live .publish-card__step-icon {
  color: var(--color-live);
}

.publish-card__step--pending .publish-card__step-icon {
  color: var(--color-pending);
}

.publish-card__step--info .publish-card__step-icon {
  color: var(--color-info);
}

.publish-card__step--draft .publish-card__step-icon {
  color: var(--color-draft);
}

.publish-card__step--danger .publish-card__step-icon {
  color: var(--color-danger);
}

.publish-card__step-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.publish-card__step-title {
  font-weight: 600;
}

.publish-card__step-text {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.publish-card__step--danger .publish-card__step-text {
  color: var(--color-danger);
}

/* The rows of facts below the steps, each a name and its moment */
.publish-card__rows {
  display: grid;
  border-top: 1px solid var(--color-border);
}

.publish-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  min-height: var(--size-control-m);
  padding: var(--space-3xs) var(--space-s);
  font-size: var(--step--1);
}

.publish-card__row + .publish-card__row,
.publish-card__made + .publish-card__row {
  border-top: 1px solid var(--color-border);
}

/* Created and saved, folded under their toggle */
.publish-card__made {
  display: grid;
}

.publish-card__row--quiet {
  min-height: 0;
  padding-block: 0 var(--space-2xs);
  color: var(--color-text-subtle);
}

.publish-card__key {
  color: var(--color-text-muted);
}

.publish-card__values {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
}

.publish-card__value {
  font-variant-numeric: tabular-nums;
}

.publish-card__value:focus-visible {
  border-radius: var(--radius-s);
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.publish-card__row[data-row="goes-out"] .publish-card__value {
  color: var(--color-info);
  font-weight: 600;
}

/* The toggle of Created and saved is a row of its own */
.publish-card__fold {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--step--1);
  text-align: start;
  cursor: pointer;
}

.publish-card__fold:hover {
  background: var(--color-surface-hover);
}

.publish-card__fold:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -2px;
}

.publish-card__fold-icon {
  width: 14px;
  height: 14px;
  color: var(--color-icon);
  transition: rotate var(--duration-fold);
}

.publish-card__fold[aria-expanded="true"] .publish-card__fold-icon {
  rotate: 180deg;
}

.publish-card__history {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.publish-card__history:hover {
  text-decoration: underline;
}

.publish-card__history:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

/* At the foot, the button for changes above Schedule, each as wide as the card */
.publish-card__foot {
  display: grid;
  gap: var(--space-2xs);
}

/* As tall as the button above it */
.publish-card__schedule {
  gap: var(--space-2xs);
  width: 100%;
  height: var(--size-control-m);
}

.publish-card__schedule-icon {
  width: 16px;
  height: 16px;
}

.publish-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-s);
  margin-block-start: var(--space-3xs);
}

/* The actions of a step read as links, so the step keeps its weight */
.publish-card__action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
}

.publish-card__action:hover {
  color: var(--color-text);
}

.publish-card__action:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.publish-card__action--danger,
.publish-card__action--danger:hover {
  color: var(--color-danger);
}

.publish-card__action-icon {
  width: 14px;
  height: 14px;
}

/* The pencil of a moment, beside it */
.publish-card__row-action {
  flex: none;
}

/* Messages that come and go, stacked at the bottom right in the browser's top layer: the kind by colour and by its icon's shape, the bar along the bottom edge is the time left. */
.toast {
  --toast-bottom: calc(var(--taskbar-height) + var(--space-m));

  display: contents;
}

/* A page without the taskbar: the console and the login */
.toast--corner {
  --toast-bottom: var(--space-m);
}

/* The stack is a manual popover; its own look replaces the browser's popover box */
.toast__list {
  position: fixed;
  inset: auto var(--space-m) var(--toast-bottom) auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  width: min(22rem, calc(100vw - 2 * var(--space-m)));
  max-height: calc(100vh - var(--toast-bottom) - var(--space-m));
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--color-text);
  list-style: none;
}

.toast__list:not(:popover-open) {
  display: none;
}

.toast__item {
  --toast-colour: var(--color-info);
  --toast-wash: var(--color-info-muted);

  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-s);
  padding: var(--space-s) var(--space-xs) calc(var(--space-s) + 3px) var(--space-s);
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-toast);
  transition:
    opacity var(--duration-fast),
    translate var(--duration-fast);
}

.toast__item--success {
  --toast-colour: var(--color-live);
  --toast-wash: var(--color-live-muted);
}

.toast__item--warning {
  --toast-colour: var(--color-pending);
  --toast-wash: var(--color-pending-muted);
}

.toast__item--error {
  --toast-colour: var(--color-danger);
  --toast-wash: var(--color-danger-muted);
}

/* State before fading in and after fading out */
.toast__item--hidden {
  opacity: 0;
  translate: 12px 0;
}

.toast__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--size-control-s);
  height: var(--size-control-s);
  border-radius: 50%;
  background: var(--toast-wash);
  color: var(--toast-colour);
}

.toast__glyph {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.toast__body {
  display: grid;
  flex: 1;
  gap: var(--space-3xs);
  min-width: 0;
  padding-block-start: var(--space-3xs);
}

.toast__title {
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.toast__count {
  margin-inline-start: var(--space-2xs);
  color: var(--color-text-subtle);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.toast__detail {
  color: var(--color-text-muted);
  font-size: var(--step--1);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* One text button in the kind's colour */
.toast__action {
  flex: none;
  height: var(--size-control-s);
  padding-inline: var(--space-xs);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--toast-colour);
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--duration-fast);
}

.toast__action:hover {
  background: var(--toast-wash);
}

.toast__close {
  flex: none;
}

/* The time left: a track in the kind's wash, filled left to right in its colour (toast.ts animates the fill) */
.toast__bar {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--toast-wash);
}

.toast__fill {
  display: block;
  height: 100%;
  background: var(--toast-colour);
  transform-origin: left;
  scale: 0 1;
}

/* An error has no time: its edge is its colour, filled */
.toast__item--error .toast__fill {
  scale: 1 1;
}

/* The one tooltip, in the browser's top layer, so no scrolling list cuts it off; tooltip.ts places it. */
.tooltip {
  --tooltip-top: 0;
  --tooltip-left: 0;

  position: fixed;
  inset: var(--tooltip-top) auto auto var(--tooltip-left);
  width: max-content;
  max-width: 18rem;
  margin: 0;
  padding: calc(var(--space-2xs) - 1px) calc(var(--space-xs) - 1px);
  /* A border of its own, not a ring of shadow, so it keeps an edge in forced colours. */
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-workspace);
  box-shadow: var(--shadow-toast);
  color: var(--color-text);
  font-size: var(--step--1);
  line-height: 1.4;
  /* It can be hovered, and its words selected and copied (WCAG 1.4.13). */
  user-select: text;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* With a value to copy: the words, a hairline, the copy button. The class would override the popover's own hiding, hence :popover-open. */
.tooltip--copy:popover-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-2xs);
  padding-inline-end: var(--space-3xs);
}

.tooltip__copy {
  position: relative;
  margin-inline-start: var(--space-2xs);
}

.tooltip__copy::before {
  position: absolute;
  inset-block: var(--space-3xs);
  inset-inline-start: calc(-1 * var(--space-2xs) - 1px);
  border-inline-start: 1px solid var(--color-border);
  content: "";
}

/* Modal built on <dialog>. The reset removes the dialog's margin, so auto is restored here to centre it. */
.modal {
  width: min(480px, calc(100vw - 2 * var(--space-l)));
  max-height: calc(100dvh - 2 * var(--space-l));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-l);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-raised);
}

/* For content that lists things side by side, e.g. the widgets */
.modal--wide {
  width: min(44rem, calc(100vw - 2 * var(--space-l)));
}

.modal[open] {
  display: flex;
  flex-direction: column;
}

.modal::backdrop {
  background: var(--color-backdrop);
}

/* Title at the start, close button (an .icon-button) at the end; a title of two lines, a long page name, makes it taller */
.modal__header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  min-height: 48px;
  padding-block: var(--space-xs);
  padding-inline: var(--space-l) var(--space-s);
  border-bottom: 1px solid var(--color-border);
}

.modal__title {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 600;
}

.modal__body {
  flex: 1;
  min-height: 0;
  padding: var(--space-l);
  overflow-y: auto;
}

/* The error line and the buttons of a form stay in view at the bottom of a tall, scrolling body, on the modal's own ground; the negative margin lets it sit over the body's padding, so a short dialog looks as before */
.modal__foot {
  position: sticky;
  bottom: calc(-1 * var(--space-l));
  display: grid;
  gap: var(--space-xs);
  margin-bottom: calc(-1 * var(--space-l));
  padding-block: var(--space-xs) var(--space-l);
  background: var(--color-surface);
}

/* Settings: what belongs to the person, not the website — a list of rows, each a label and its switch or select */

.settings__list {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-bg);
}

.settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding: var(--space-s) var(--space-m);
  font-size: var(--step-0);
  cursor: pointer;
}

.settings__row + .settings__row {
  border-top: 1px solid var(--color-border);
}

/* Toggle switch: a checkbox with role="switch", drawn entirely in CSS. Focus comes from base.css. */
.switch {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  margin: 0;
  appearance: none;
  /* Transparent here; forced colours turn it into the visible track outline */
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--color-border-strong);
  cursor: pointer;
  transition: background-color var(--duration-fast);
}

.switch::before {
  content: "";
  position: absolute;
  inset-block-start: 1px;
  inset-inline-start: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-text);
  transition: translate var(--duration-fast);
}

.switch:checked {
  background: var(--color-accent);
}

/* On, the knob is the accent's label colour: the text's would vanish on the machine's espresso */
.switch:checked::before {
  background: var(--color-on-accent);
  translate: 16px 0;
}

.switch:disabled,
.switch[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* A small one in a label row, beside a badge */
.switch--s {
  width: 26px;
  height: 15px;
  border-radius: 8px;
}

.switch--s::before {
  width: 11px;
  height: 11px;
}

.switch--s:checked::before {
  translate: 11px 0;
}

/*
 * Style manager: a section of the manage panel, a list of every class on the left and the
 * CSS of the picked one on the right. Its tabs pick selectors, stylesheets or variables.
 */
.style-manager {
  --style-manager-list-width: 360px;

  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--color-bg);
}

/* Where the site styles stand, at the end of the section's bar in the header; they save themselves, so this is all there is to press */
/* At the bar's end: where the styles stand, their versions and the Save that puts them live */
.style-manager__live {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-width: 0;
  margin-inline-start: auto;
}

.style-manager__saved {
  overflow: hidden;
  margin: 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-manager__saved--failed {
  color: var(--color-danger);
}

/* Stored, but not on the website until Save */
.style-manager__saved--waiting {
  color: var(--color-pending);
}

.style-manager__go-live {
  flex: none;
}

.style-manager__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

/* ---- Selectors ---- */

.style-manager__selectors {
  display: grid;
  flex: 1;
  grid-template-columns: var(--style-manager-list-width) minmax(0, 1fr);
  min-height: 0;
}

/* ---- List ---- */

.style-manager__list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-inline-end: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* Search and buttons in one row while they fit; the buttons drop to a second row when not */
.style-manager__toolbar {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-s) var(--space-s) var(--space-xs);
}

.style-manager__search {
  flex: 1 1 8rem;
  min-width: 0;
  height: var(--size-control-l);
  padding-inline: var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--step-0);
}

.style-manager__search::placeholder {
  color: var(--color-text-subtle);
}

.style-manager__search:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

/* Two rows of filters, the kind and the state; the rows share the tinted background of the list */
.style-manager__filters {
  display: grid;
  flex: none;
  gap: var(--space-3xs);
  padding: var(--space-2xs) var(--space-s) var(--space-xs);
}

.style-manager__filter-group {
  display: flex;
  gap: var(--space-3xs);
}

/* Segmented filter: the pressed one is filled */
.style-manager__filter {
  flex: none;
  height: var(--size-control-s);
  white-space: nowrap;
  padding-inline: var(--space-xs);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--duration-fast),
    color var(--duration-fast);
}

.style-manager__filter:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.style-manager__filter[aria-pressed="true"] {
  border-color: var(--color-border-strong);
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.style-manager__items {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 var(--space-xs) var(--space-xs);
  overflow-y: auto;
  list-style: none;
}

.style-manager__option {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  height: var(--size-control-m);
  padding-inline: var(--space-xs);
  border-radius: var(--radius-s);
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}

.style-manager__option:hover {
  background: var(--color-surface-hover);
}

.style-manager__option:focus-visible {
  outline-offset: -2px;
}

/* Picked: tinted plus a bar on the leading edge, like the selected row in the structure */
.style-manager__option--selected,
.style-manager__option--selected:hover {
  padding-inline-start: calc(var(--space-xs) - 2px);
  border-inline-start: 2px solid var(--color-accent-line);
  background: var(--color-accent-muted);
  color: var(--color-text);
}

/* Same colour a selector has in the CSS editor */
.style-manager__selector {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--code-selector);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-manager__uses {
  flex: none;
  min-width: 1.5em;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.style-manager__uses--none {
  font-style: italic;
}

/* "no CSS" or a problem mark; the problem keeps its meaning without colour through the "!" */
.style-manager__flag {
  flex: none;
  padding-inline: var(--space-2xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  line-height: 1.4;
}

.style-manager__flag--problem {
  min-width: 1.4em;
  border-color: var(--color-danger);
  color: var(--color-danger);
  font-weight: 700;
  text-align: center;
}

.style-manager__empty {
  margin: auto var(--space-s);
  padding: var(--space-l) var(--space-s);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-m);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-align: center;
  text-wrap: balance;
}

/* The strip along the bottom of a pane: the list's summary on the left and the editor's
   problem line on the right are the same bar, so they share their geometry here. Sized
   apart they would sit at different heights and their top borders would not meet. */
.style-manager__summary,
.style-manager__footer {
  display: flex;
  flex: none;
  align-items: center;
  height: var(--size-control-m);
  padding-inline: var(--space-m);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

/* The height is fixed, so a long summary is cut off instead of wrapping out of the bar. */
.style-manager__summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Editor ---- */

.style-manager__editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* The name field on the left, the actions on the right */
.style-manager__editor-header {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-s);
  height: 48px;
  padding-inline: var(--space-m);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.style-manager__name-field {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  color: var(--code-selector);
  font-family: var(--font-code);
  font-size: var(--step-1);
}

/*
 * The kinds read apart by colour: classes in the selector yellow, ids in blue, element
 * presets in teal, each the colour the CSS editor gives the same kind of token.
 */
.style-manager__selector--id,
.style-manager__name-field--id {
  color: var(--code-storage);
}

.style-manager__selector--element,
.style-manager__name-field--element {
  color: var(--code-type);
  font-family: var(--font-ui);
}

/* The name is an input that looks like text until it is hovered or focused */
.style-manager__name {
  flex: 1;
  min-width: 0;
  height: var(--size-control-l);
  /* No start padding: the dot before the field must read as part of the selector */
  padding-inline: 0 var(--space-2xs);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: inherit;
  font: inherit;
}

.style-manager__name:hover {
  border-color: var(--color-border-strong);
}

.style-manager__name:focus-visible {
  border-color: var(--color-accent-line);
  background: var(--color-bg);
  outline-offset: -1px;
}

.style-manager__name--invalid,
.style-manager__name--invalid:focus-visible {
  border-color: var(--color-danger);
  outline-color: var(--color-danger);
}

/* Why the typed name is refused */
.style-manager__hint {
  flex: none;
  margin: 0;
  color: var(--color-danger);
  font-size: var(--step--1);
}

.style-manager__actions {
  display: flex;
  flex: none;
  gap: var(--space-xs);
}

/* The elements that carry the class, as chips that jump to the element */
.style-manager__usage {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-m);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.style-manager__usage-label {
  margin-inline-end: var(--space-2xs);
}

.style-manager__element {
  height: var(--size-control-s);
  padding-inline: var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: var(--step--1);
  cursor: pointer;
  transition:
    background-color var(--duration-fast),
    border-color var(--duration-fast);
}

.style-manager__element:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-hover);
}

/* The code editor positions itself absolutely inside */
.style-manager__code {
  position: relative;
  flex: 1;
  min-height: 0;
}

.style-manager__footer {
  gap: var(--space-m);
}

.style-manager__problem {
  min-width: 0;
  overflow: hidden;
  color: var(--color-danger);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* No class picked: one sentence in the middle of the editor area */
.style-manager__blank {
  display: grid;
  flex: 1;
  place-items: center;
  margin: 0;
  padding: var(--space-l);
  color: var(--color-text-subtle);
  font-size: var(--step-0);
  text-align: center;
  text-wrap: balance;
}

/* ---- Stylesheets ---- */

/* The stylesheet list has no search, so its one button sits at the end of the toolbar */
.style-manager__toolbar--end {
  justify-content: flex-end;
}

/* Stylesheet names are prose, not selectors */
.style-manager__sheet-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--step-0);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-manager__name-field--text {
  color: var(--color-text);
  font-family: var(--font-ui);
}

/* The base layer's name is fixed: the field stays a label, no border on hover */
.style-manager__name:read-only,
.style-manager__name:read-only:hover {
  border-color: transparent;
  cursor: default;
}

/* Move up and down (icon-buttons): the chevron points the way */
.style-manager__move-icon {
  rotate: -90deg;
}

.style-manager__move-icon--down {
  rotate: 90deg;
}

/* ---- Variables ---- */

.style-manager__variables {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

/* Hint on the left, the button on the right */
.style-manager__variables-header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding: var(--space-s) var(--space-m);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.style-manager__variables-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* The history of the styles: each version that went live, newest first, with Restore beside the older ones */
.style-versions {
  display: grid;
  gap: var(--space-s);
}

.style-versions__intro,
.style-versions__empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.style-versions__list {
  display: grid;
  max-height: min(60vh, 32rem);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.style-versions__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3xs) var(--space-s);
  padding: var(--space-xs) 0;
  border-top: 1px solid var(--color-border);
}

.style-versions__item:first-child {
  border-top: 0;
}

.style-versions__head {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
}

.style-versions__time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.style-versions__time:focus-visible {
  border-radius: var(--radius-s);
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.style-versions__text {
  grid-column: 1;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.style-versions__restore {
  grid-row: 1 / 3;
  grid-column: 2;
  gap: var(--space-2xs);
}

.style-versions__icon {
  width: 16px;
  height: 16px;
}

/* The History window of a Publishing card: what happened to a piece, newest first and by day, the version visitors have marked */
.history-log {
  display: grid;
  gap: var(--space-s);
}

.history-log__name {
  color: var(--color-text-muted);
  font-weight: 400;
}

.history-log__chips {
  display: inline-flex;
  flex-wrap: wrap;
  justify-self: start;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-m);
  background: var(--color-surface-hover);
}

.history-log__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  padding: var(--space-3xs) var(--space-xs);
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
}

.history-log__chip[aria-pressed="true"] {
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.history-log__chip:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 1px;
}

.history-log__count {
  color: var(--color-text-subtle);
}

.history-log__list {
  display: grid;
  max-height: min(60vh, 36rem);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.history-log__day {
  padding: var(--space-s) 0 var(--space-3xs);
  color: var(--color-text-subtle);
  font-family: var(--font-code);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.history-log__day--future {
  color: var(--color-info);
}

.history-log__item {
  display: grid;
  grid-template-columns: 3.5rem 16px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-2xs);
  border-top: 1px solid var(--color-border);
  border-radius: var(--radius-s);
}

.history-log__day + .history-log__item {
  border-top-color: transparent;
}

/* The version visitors have now */
.history-log__item--current {
  background: var(--color-live-muted);
}

.history-log__time {
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.history-log__time:focus-visible {
  border-radius: var(--radius-s);
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.history-log__icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--color-icon);
}

.history-log__item--live .history-log__icon {
  color: var(--color-live);
}

.history-log__item--info .history-log__icon {
  color: var(--color-info);
}

.history-log__item--draft .history-log__icon {
  color: var(--color-draft);
}

.history-log__item--danger .history-log__icon {
  color: var(--color-danger);
}

.history-log__main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.history-log__title {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
  font-weight: 600;
}

.history-log__text {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The piece a line of the overview's last activity is about, which opens it */
.history-log__piece {
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.history-log__piece:hover {
  text-decoration: underline;
}

.history-log__piece:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.history-log__empty {
  padding: var(--space-s) 0;
  color: var(--color-text-muted);
}

/* Table of the custom properties: name and value are inputs that look like text until focused */
.variables {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-0);
}

.variables__head {
  position: sticky;
  top: 0;
  background: var(--color-surface);
}

.variables__heading {
  padding: var(--space-xs) var(--space-s);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: start;
}

.variables__row:hover {
  background: var(--color-surface-hover);
}

.variables__cell {
  padding: var(--space-3xs) var(--space-s);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.variables__value {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.variables__cell--sheet {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.variables__cell--uses {
  width: 6em;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.variables__cell--none {
  font-style: italic;
}

.variables__cell--actions {
  width: 0;
}

.variables__input {
  width: 100%;
  height: var(--size-control-m);
  padding-inline: var(--space-xs);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.variables__input:hover {
  border-color: var(--color-border-strong);
}

.variables__input:focus-visible {
  border-color: var(--color-accent-line);
  background: var(--color-bg);
  outline-offset: -1px;
}

/* Same colour a variable has in the CSS editor */
.variables__input--name {
  color: var(--code-variable);
}

/* The colour a value stands for; the value is set by TypeScript, only when it is a colour */
.variables__swatch {
  --variables-swatch: transparent;

  flex: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--variables-swatch);
}

/* beanCSS's variables below the website's own, read only: a name copies its var() */
.variables__bean {
  display: grid;
  gap: var(--space-xs);
  margin-block-start: var(--space-l);
}

/* The group's name and words, in line with the cells below them */
.variables__bean-head {
  display: grid;
  gap: var(--space-2xs);
  padding-inline: var(--space-m);
}

.variables__bean-title {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-0);
  font-weight: 600;
}

.variables__copy {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-align: start;
  cursor: pointer;
}

.variables__copy:hover {
  color: var(--color-accent-text);
}

.variables__bean-value {
  overflow: hidden;
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Body of the confirmation dialog: the question, then Cancel and the action side by side */
.confirm {
  display: grid;
  gap: var(--space-m);
}

.confirm__message {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-0);
  text-wrap: pretty;
}

.confirm__actions {
  display: flex;
  /* A long answer, "Keep both as …", goes onto a line of its own instead of widening the dialog. */
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-xs);
}

/* The export dialog: what goes into the zip, and which pages that turns out to be */
.export {
  display: grid;
  gap: var(--space-xs);
  min-width: min(30rem, 84vw);
}

.export__scope {
  display: grid;
  gap: var(--space-2xs);
  padding: var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
}

.export__legend,
.export__label {
  padding-inline: var(--space-2xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.export__check {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--step--1);
}

/* The list scrolls rather than pushing the buttons off a small screen */
.export__pages {
  display: grid;
  gap: var(--space-3xs);
  max-height: 14rem;
  overflow-y: auto;
  padding: var(--space-2xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-bg);
}

.export__item {
  list-style: none;
}

.export__summary {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* What ticking a members-only page gives away, in the colour of a caution, not an error */
.export__warning {
  color: var(--color-pending);
  font-size: var(--step--1);
}

.export__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
  margin-block-start: var(--space-xs);
}

/* The check before publishing: what the website would get that is worth a second look, per page */
.publish-check {
  display: grid;
  gap: var(--space-s);
}

.publish-check__intro {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  text-wrap: pretty;
}

/* The pages scroll rather than pushing the buttons off a small screen */
.publish-check__pages {
  display: grid;
  gap: var(--space-s);
  max-height: 22rem;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.publish-check__page {
  display: grid;
  gap: var(--space-2xs);
}

.publish-check__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs);
}

.publish-check__path {
  color: var(--code-selector);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

/* The pages a component's or a frame's finding stands on */
.publish-check__on {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.publish-check__items {
  display: grid;
  gap: var(--space-3xs);
  margin: 0;
  padding-inline-start: var(--space-m);
  color: var(--color-text);
  font-size: var(--step--1);
}

/* Notes sit below the problems and say less loudly what is worth knowing */
.publish-check__notes-title {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 600;
}

.publish-check__pages--notes {
  max-height: 10rem;
}

.publish-check__items--note {
  color: var(--color-text-muted);
}

.publish-check__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
}

/* The settings of a page or template in its inspector: title, slug, the collections of a template and the reasons something was refused */
.page-form {
  display: grid;
  /* The form scrolls once a template lists its collections; without this the grid squeezes
     the textarea, a scroll container whose automatic minimum height is zero */
  grid-auto-rows: max-content;
  /* One column that never grows past the inspector: a select with a long option, or a long
     value, would otherwise widen it and the inspector would scroll sideways */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xs);
}

.page-form__label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.page-form__input {
  /* Shrinks with its column instead of keeping the width of its longest option */
  min-width: 0;
  height: var(--size-control-l);
  padding-inline: var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--step-0);
}

/* An input with the buttons that act on its value beside it */
.page-form__row {
  display: flex;
  gap: var(--space-xs);
}

.page-form__row > .page-form__input {
  flex: 1;
}

/* A text of a few lines, like the description, grows downwards instead of scrolling one line */
.page-form__input--area {
  height: auto;
  padding-block: var(--space-2xs);
  resize: vertical;
  font-family: inherit;
  line-height: 1.4;
}

.page-form__input--code {
  color: var(--code-selector);
  font-family: var(--font-code);
}

.page-form__input::placeholder {
  color: var(--color-text-subtle);
}

/* A placeholder in a field for code is words, "Anywhere", not code */
.page-form__input--code::placeholder {
  font-family: var(--font-ui);
}

/* The focus ring sits on the border, which turns accent at the same time */
.page-form__input:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

.page-form__input--invalid,
.page-form__input--invalid:focus-visible {
  border-color: var(--color-danger);
  outline-color: var(--color-danger);
}

/* Label, input and hint that come and go together, like the slug a template does not have */
.page-form__group {
  display: grid;
  gap: var(--space-xs);
}

/* A group that changes what the page is, set apart from the settings above it */
.page-form__group--apart {
  margin-top: var(--space-s);
  padding-top: var(--space-s);
  border-top: 1px solid var(--color-border);
}

/* Where a template gets its addresses from, in place of the slug it does not have */
.page-form__note {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The hint of a field the browser refused for being too short: it says the rule, so it takes the error colour */
.page-form__note--bad {
  color: var(--color-danger);
}

/* What a choice does to another page, said before Save */
.page-form__moves {
  display: block;
  color: var(--color-pending);
}

/* Why a slug or a description was not accepted */
.page-form__hint {
  color: var(--color-danger);
  font-size: var(--step--1);
}

/* A checkbox reads as one line with its words, unlike the stacked label and input above */
.page-form__check {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The collections a template shows, one row each: name, address and a way out */
.page-form__rows {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A value to copy, a one-time link: the field and its Copy button on one line */
.page-form__copy {
  display: flex;
  gap: var(--space-xs);
}

/* The value to copy takes the row's whole width, so a long link shows in full. */
.page-form__copy > .page-form__input {
  flex: 1 1 auto;
  min-width: 0;
}

/* A field's name with the button whose tooltip says more about it (decided 2026-10-17: short names, the long words in the tip) */
.page-form__head {
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
  min-width: 0;
}

.page-form__info {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-subtle);
  cursor: help;
}

.page-form__info:hover,
.page-form__info:focus-visible {
  color: var(--color-accent-text);
}

.page-form__info-icon {
  width: 15px;
  height: 15px;
}

/* The settings as a list of properties: the name left, the value right, one line each */
.page-form__props {
  display: grid;
  gap: var(--space-xs);
  margin-block-start: var(--space-2xs);
}

.page-form__prop {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2xs) var(--space-xs);
}

/* What belongs to a property but stands under its value: a reason, a box that goes with it */
.page-form__prop-below {
  grid-column: 2;
}

/* A property whose name stands above its value, as the name of the page does; a switch keeps its name beside it */
.page-form__prop--stacked {
  grid-template-columns: minmax(0, 1fr);
}

.page-form__prop--stacked .page-form__prop-below {
  grid-column: 1;
}

/* A field with what goes before its value: the slash of an address */
.page-form__affix {
  display: flex;
  min-width: 0;
}

.page-form__affix-part {
  display: grid;
  place-items: center;
  padding-inline: var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-inline-end: 0;
  border-start-start-radius: var(--radius-s);
  border-end-start-radius: var(--radius-s);
  background: var(--color-surface-hover);
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.page-form__affix-input {
  flex: 1;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

/* How many characters the description has, while it is written */
.page-form__count {
  margin-inline-start: auto;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

/* The card a shared link makes: the share picture, the website, the title and the description written in it */
.page-form__card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
}

/* The picture, at the 1.91 : 1 of a shared link; Change and Remove over it on hover or focus */
.page-form__pic {
  position: relative;
  aspect-ratio: 1.91 / 1;
  overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--color-surface-hover) 0 10px, var(--color-surface) 10px 20px);
}

.page-form__pic-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* On a template, where the picture comes from: "{{photo}} of each entry" or "Fallback for every entry" */
.page-form__pic-badge {
  position: absolute;
  inset-block-start: var(--space-xs);
  inset-inline-start: var(--space-xs);
  z-index: 1;
  padding-inline: var(--space-xs);
  border-radius: var(--radius-s);
  background: var(--color-scrim);
  color: var(--color-on-scrim);
  font-size: var(--step--1);
  line-height: 1.6;
  pointer-events: none;
}

.page-form__pic-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  background: var(--color-backdrop);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.page-form__pic:hover .page-form__pic-actions,
.page-form__pic-actions:focus-within {
  opacity: 1;
}

.page-form__pic-remove {
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface-raised);
  color: var(--color-danger);
}

/* Without a picture the whole area chooses one */
.page-form__pic-choose {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-3xs);
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  cursor: pointer;
}

.page-form__pic-choose:hover {
  color: var(--color-accent-text);
}

.page-form__pic-choose:focus-visible {
  outline-offset: -3px;
}

.page-form__pic-choose-icon {
  width: 22px;
  height: 22px;
}

.page-form__card-text {
  display: grid;
  gap: 1px;
  padding: var(--space-xs) var(--space-s) var(--space-s);
  font-size: var(--step--1);
}

.page-form__card-site {
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-form__card-title {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The description is written in the card itself: its text, a border on hover and the accent while it is written; it grows with the text */
.page-form__card-desc {
  margin: 1px calc(-1 * var(--space-3xs)) 0;
  padding: 2px var(--space-3xs);
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  line-height: 1.45;
  resize: none;
  field-sizing: content;
  min-height: calc(1.45em + 6px);
}

.page-form__card-desc::placeholder {
  color: var(--color-accent-text);
}

.page-form__card-desc:hover {
  border-color: var(--color-border);
  background: var(--color-surface);
}

.page-form__card-desc:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
  background: var(--color-surface);
}

/* The website's placeholders a click puts into the tab title where the cursor stands */
.page-form__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs);
}

.page-form__chip {
  padding: 0 var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--color-component);
  font-family: var(--font-code);
  font-size: var(--step--1);
  line-height: 1.6;
  cursor: pointer;
}

.page-form__chip:hover {
  background: var(--color-component-muted);
}

/* A collection a template shows: its name, how many entries and a way out, the whole address below */
.page-form__coll {
  display: grid;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
}

.page-form__coll-top {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.page-form__coll-name {
  margin-inline-end: auto;
  color: var(--color-text);
  font-weight: 600;
}

.page-form__coll-count {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The picture an entry's page shares, its name before the image field picked */
.page-form__coll-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--step--1);
}

.page-form__coll-line-name {
  color: var(--color-text-muted);
}

.page-form__coll-none {
  color: var(--color-pending);
}

/* A disclosure in a form dialog: fields most people never touch, behind their name */
.page-form__fold {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
}

.page-form__fold:hover {
  color: var(--color-text);
}

.page-form__fold-icon {
  width: 14px;
  height: 14px;
  transition: rotate var(--duration-fold);
}

.page-form__fold[aria-expanded="true"] .page-form__fold-icon {
  rotate: 90deg;
}

.page-form__fold-body {
  padding-left: var(--space-s);
  border-left: 2px solid var(--color-border);
}

/* Texts a field takes at a click: the placeholders of a message */
.page-form__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

.page-form__chip {
  height: 20px;
  padding-inline: var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
  cursor: pointer;
}

.page-form__chip:hover {
  color: var(--color-text);
}

/* A field with the arrow that shows every suggestion inside its end (#101, B3): the arrow is placed against it */
.page-form__combo {
  position: relative;
}

/* The Auto-BEM dialog: the block name, and every class it would add before anything changes */
.auto-bem {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.auto-bem__intro {
  margin: 0 0 var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.auto-bem__label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.auto-bem__input {
  height: var(--size-control-l);
  padding-inline: var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-bg);
  color: var(--code-selector);
  font-family: var(--font-code);
  font-size: var(--step-0);
}

.auto-bem__input:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

.auto-bem__input--invalid,
.auto-bem__input--invalid:focus-visible {
  border-color: var(--color-danger);
  outline-color: var(--color-danger);
}

.auto-bem__hint {
  margin: 0;
  color: var(--color-danger);
  font-size: var(--step--1);
}

.auto-bem__summary {
  margin: var(--space-xs) 0 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.auto-bem__preview {
  max-height: 16rem;
  margin: 0;
  padding: var(--space-xs) var(--space-s);
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-bg);
  list-style: none;
}

.auto-bem__entry {
  display: flex;
  justify-content: space-between;
  gap: var(--space-m);
  font-size: var(--step--1);
  line-height: var(--code-line-height);
}

.auto-bem__element {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-bem__class {
  flex: none;
  color: var(--code-selector);
  font-family: var(--font-code);
}

.auto-bem__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
  margin-block-start: var(--space-xs);
}

/* The uploads section: the table of uploads, and the whole section takes a drop of files. */
.assets {
  min-width: min(40rem, 80vw);
}

/* Says that a drop works anywhere here; lights up while files are dragged over the section */
.assets__drop {
  margin: 0;
  padding: var(--space-xs);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-m);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-align: center;
  transition: border-color var(--duration-fast), background-color var(--duration-fast);
}

.assets__drop--over {
  border-color: var(--color-accent-line);
  background: var(--color-surface-hover);
  color: var(--color-text);
}

/* The native file input stays for assistive technology; Upload in the toolbar opens it */
.assets__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.assets__status {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The picture in the inspector, a button that opens it large as a gallery's thumbnail does */
.assets__look {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

/* A drawing has no width of its own to give the button, so the button takes the inspector's */
.assets__look:has(> .inspector__image--vector) {
  width: 100%;
}

.assets__look:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -2px;
}

/* A picture waiting for its sizes, under its name in the list and on its card: how far the worker is */
.assets__sizes {
  display: grid;
  grid-template-columns: minmax(3rem, 8rem) auto;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.assets__sizes-words {
  white-space: nowrap;
}

/* A picture without an alt text, among its facts */
.assets__missing {
  color: var(--color-pending);
}

/*
 * Content: a section of the manage panel, the collections on the left, the entries of the
 * picked one in the middle and the inspector on the right. The entries table is the
 * data-table block's, the panel on the right the inspector block's.
 */
.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--color-bg);
}

/* auto, not a fixed track: a hidden column takes no width at all (the side-list), a folded inspector only its rail */
.content__body {
  display: grid;
  flex: 1;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 0;
}

/* A website without collections, for somebody who cannot make one: the note alone, across the section */
.content--none .content__body {
  grid-template-columns: minmax(0, 1fr);
}

/* A narrow panel: the collections are a select in a bar above the entries (side-list--compact), so the table keeps the width it needs for its actions */
.content--compact .content__body {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
}

/* The card of the entries, with the room and the gaps of every list's column (list-view__main) */
.content__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  min-height: 0;
  padding: var(--space-l);
  overflow-y: auto;
}

.content__blank {
  margin: 0;
  color: var(--color-text-muted);
}

/* The identifiers of a saved entry: three read-only fields in its folded Identifiers */
.content__identifiers {
  display: grid;
  gap: var(--space-s);
}

/* A read-only field with its copy button inside, at the end */
.content__readonly {
  position: relative;
}

.content__readonly-input {
  padding-inline-end: calc(var(--space-s) + 22px);
  border-color: var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.content__readonly-copy {
  position: absolute;
  inset-block: 0;
  inset-inline-end: var(--space-2xs);
  margin-block: auto;
}

/* An image field: the picture field, the alt text the entry writes for its picture below it */
.content__image {
  display: grid;
  gap: var(--space-xs);
}

/* An alt text that follows the picture's: its alt text from Uploads stands in the empty field */
.content__input--follow::placeholder {
  color: var(--color-text-muted);
  font-style: italic;
}

/* An entry field: the slug with the list of the collection's entries, the title below */
.content__reference-box {
  display: grid;
  gap: var(--space-3xs);
}

.content__reference {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.content__reference-input {
  flex: 1;
  min-width: 0;
}

/* The identifiers of a saved entry, folded away below its values */
.content__more {
  display: grid;
  gap: var(--space-s);
  padding-block-start: var(--space-xs);
  border-top: 1px solid var(--color-border);
}

.content__more--open {
  padding-block-end: var(--space-xs);
}

.content__more-body {
  display: grid;
  gap: var(--space-s);
}

.content__more-body[hidden] {
  display: none;
}

.content__more-summary {
  width: fit-content;
  border-radius: var(--radius-s);
  color: var(--color-text-muted);
  font-size: var(--step--1);
  cursor: pointer;
}

/* The fold's own toggle, beside its ⓘ: a chevron that turns down while it is open */
.content__more-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--step--1);
}

.content__more-chevron {
  width: 0.9em;
  height: 0.9em;
  transition: transform 0.15s;
}

.content__more-toggle[aria-expanded="true"] > .content__more-chevron {
  transform: rotate(90deg);
}

.content__control {
  display: grid;
  gap: var(--space-3xs);
}

/* An action under a field, "Give Termine pages": as wide as its words, not as the field */
.content__control-action {
  justify-self: start;
  margin-top: var(--space-2xs);
}

.content__control--inline {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-xs);
}

/* A field that follows another inside one control, the entry's Search engines under its Own page */
.content__control--follows {
  margin-top: var(--space-xs);
}

.content__label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.content__input,
.content__textarea {
  width: 100%;
  min-width: 0;
  padding: var(--space-2xs) var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  font-size: var(--step-0);
}

.content__input {
  height: var(--size-control-l);
}

/* A field key two rows share: the hint below the form names it */
.content__input--invalid,
.content__input--invalid:focus-visible {
  border-color: var(--color-danger);
  outline-color: var(--color-danger);
}

.content__input--code {
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.content__textarea {
  resize: vertical;
}

/* The focus ring sits on the border, which turns accent at the same time */
.content__input:focus-visible,
.content__textarea:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

.content__checkbox {
  width: var(--space-m);
  height: var(--space-m);
  accent-color: var(--color-accent-line);
}

/*
 * The fields of a collection in the inspector beside the table: two lines a field, label
 * and type above, key with up, down and remove below, an entry field's collection under
 * them. The rows share the columns, so they line up.
 */
/* The fields of a collection, a card each (decided 2026-10-17, as a template's collections) */
.content__fields {
  display: grid;
  gap: var(--space-xs);
}

.content__field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "head head"
    "label type"
    "key key"
    "collection collection"
    "options options"
    "subs subs";
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
}

/* Wide in its dialog, the label, the key and the type share a line */
.content__fields--wide > .content__field {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(max-content, 3fr);
  grid-template-areas:
    "head head head"
    "label key type"
    ". . collection"
    "options options options"
    "subs subs subs";
}

/* The field's name, its placeholder and its type, and the moves and the way out at the end */
.content__field-head {
  display: flex;
  grid-area: head;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

.content__field-title {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-xs);
  min-width: 0;
}

.content__field-name {
  min-width: 0;
  color: var(--color-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.content__field-token {
  min-width: 0;
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
  overflow-wrap: anywhere;
}

.content__field-label {
  grid-area: label;
}

.content__field-key {
  grid-area: key;
}

.content__field-type {
  grid-area: type;
}

/* An entry field's collection, on a line of its own under the field */
.content__field-collection {
  grid-area: collection;
}

/* A select field's options, one a line, under the field */
.content__field-options {
  grid-area: options;
}

/* A multi-select in an entry: its options as boxes, the field's name as the group's */
.content__picks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-s);
  margin: 0;
  padding: 0;
  border: 0;
}

.content__picks > .content__label {
  flex-basis: 100%;
  padding: 0;
}

.content__pick {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--step-0);
}

/* Add field as wide as its word, under the fields */
.content__add-field {
  justify-self: start;
}

/* Add field under the cards: across the inspector, dashed in the accent, as Add a collection */
.content__add-field--new {
  display: inline-flex;
  justify-self: stretch;
  align-items: center;
  gap: var(--space-2xs);
  border-style: dashed;
  color: var(--color-accent-text);
}

.content__add-field-icon {
  width: 14px;
  height: 14px;
}

/* A field whose value follows a "/", the address of the entries */
.content__affix {
  display: flex;
  min-width: 0;
}

.content__affix-part {
  display: grid;
  place-items: center;
  padding-inline: var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-inline-end: 0;
  border-start-start-radius: var(--radius-s);
  border-end-start-radius: var(--radius-s);
  background: var(--color-surface-hover);
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.content__affix > .content__input {
  flex: 1;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

/* What only pages for entries have, under their switch: the template, the address, which entries */
.content__detail--nested {
  padding-inline-start: var(--space-s);
  border-inline-start: 2px solid var(--color-border);
}

.content__hint {
  margin: 0;
  color: var(--color-danger);
  font-size: var(--step--1);
}

/* What the entries of a collection are ordered by, on the website */
.content__order {
  display: grid;
  gap: var(--space-2xs);
}



/* Whether the entries are pages of their own: the template and the address they get */
.content__detail {
  display: grid;
  gap: var(--space-2xs);
}

/* A setting that has nothing to pick yet says why, with the way to change that below its words */
.content__notice {
  display: grid;
  justify-items: start;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-s);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-s);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.content__notice-action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.content__notice-icon {
  width: 1em;
  height: 1em;
}

.content__hint-text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* A slug no entry has, below an entry field */
.content__hint-text--problem {
  color: var(--color-danger);
}



/* A repeater's item fields, under the field: label, key, type and remove a line each */
.content__subfields {
  display: grid;
  grid-area: subs;
  gap: var(--space-2xs);
  padding: var(--space-xs);
  border-inline-start: 2px solid var(--color-border-strong);
}

.content__subfield-list {
  display: grid;
  gap: var(--space-2xs);
}

.content__subfield {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2xs);
}

.content__subfield-options {
  grid-column: 1 / -1;
}

/* A gallery in an entry: each picture with what it shows, then Add pictures and Upload */
.content__gallery,
.content__items {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  border: 0;
}

.content__gallery > .content__label,
.content__items > .content__label {
  padding: 0;
}

.content__gallery-list,
.content__item-list {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.content__gallery-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: var(--space-xs);
}

.content__gallery-thumb {
  width: 48px;
  height: 36px;
  border-radius: var(--radius-s);
  object-fit: cover;
  background: var(--color-workspace);
}

.content__gallery-actions {
  display: flex;
  gap: var(--space-xs);
}

/* A repeater's item: its number and moves on a line, its fields below, framed apart */
.content__item {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
}

.content__item-head {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.content__item-title {
  flex: 1;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 600;
}

.content__add-item {
  justify-self: start;
}

/* Text and pictures: an editor's sidebar, the page's texts and pictures as fields grouped per element */
.content-fields {
  display: grid;
  /* One column no wider than the sidebar: a label that does not wrap would widen an auto track and cut every field off */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-s);
  padding: var(--space-s);
}

.content-fields__empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Where the entries behind a list are edited, below the fields of its part of the page */
.content-fields__note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.content-fields__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* The choice of an entry table's columns: one row per column, a tick and two moves */
.columns {
  display: grid;
  gap: var(--space-xs);
}

.columns__intro,
.columns__note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The list scrolls rather than pushing the buttons off a small screen */
.columns__list {
  display: grid;
  gap: var(--space-3xs);
  max-height: 22rem;
  margin: 0;
  padding: var(--space-2xs);
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-bg);
}

.columns__item {
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
  list-style: none;
}

.columns__check {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--step--1);
}

/* The entry column's box is off but focusable, with its reason in the tooltip */
.columns__box[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.columns__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
  margin-block-start: var(--space-xs);
}

/* Reset stands apart from the pair that closes the dialog */
.columns__reset {
  margin-inline-end: auto;
}

/* The matrix of roles and permissions under People: the permissions down, a role a column of boxes, a cell that differs from its default marked */
.permission-matrix__role {
  width: 6.5rem;
  text-align: center;
  vertical-align: top;
}

/* A group of permissions: its name at the start of a row of its own */
.permission-matrix__group {
  text-align: start;
}

/* A role's name over what stands under it, both in the middle of its column of boxes */
.permission-matrix__role-head {
  display: grid;
  justify-items: center;
  gap: var(--space-3xs);
}

/* Under a role's name: why its column is off, or the way back to its default */
.permission-matrix__role-note,
.permission-matrix__reset {
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.permission-matrix__reset {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.permission-matrix__reset[aria-disabled="true"] {
  color: var(--color-text-subtle);
  text-decoration: none;
  cursor: default;
}

.permission-matrix__name {
  font-weight: 400;
  text-align: start;
}

/* What the name leaves open, in a line of its own that wraps */
.permission-matrix__hint {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The permission's name with its mark beside it */
.permission-matrix__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3xs) var(--space-xs);
}

.permission-matrix__cell {
  text-align: center;
  vertical-align: middle;
}

/* A cell the owner changed: the pending colour's tint and a line at its start, drawn as a picture so no box moves */
.permission-matrix__cell--differs {
  background:
    linear-gradient(var(--color-pending), var(--color-pending)) left / 3px 100% no-repeat,
    var(--color-pending-muted);
}

/* A box of a column nobody changes, the owner's and a member's: quieter than one that can be ticked */
.permission-matrix__box--fixed {
  opacity: 0.45;
  cursor: not-allowed;
}

/* A list to tick inside a dialog, the packages of an upgrade, the folders of uploads or what waits for the website: one box for every item above, a quick pick and the count */
.pick-list {
  --pick-list-depth: 0;

  display: grid;
  gap: var(--space-2xs);
}

.pick-list__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-s);
  padding-inline: var(--space-2xs);
}

.pick-list__all {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--step--1);
  font-weight: 600;
}

/* Words that act, quieter than a button beside the box it changes */
.pick-list__quick {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
}

.pick-list__quick:hover {
  text-decoration: underline;
}

.pick-list__quick:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.pick-list__count {
  margin-inline-start: auto;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The list scrolls rather than pushing the password and the buttons off a small screen */
.pick-list__items {
  display: grid;
  gap: var(--space-3xs);
  max-height: 18rem;
  margin: 0;
  padding: var(--space-3xs);
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-bg);
}

.pick-list__item {
  list-style: none;
}

/* The box, the name and its badge on one line, the versions under the name */
.pick-list__check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 var(--space-2xs);
  padding: var(--space-3xs) var(--space-2xs);
  /* Indented by its depth where the items are a tree, the folders */
  padding-inline-start: calc(var(--space-2xs) + var(--pick-list-depth) * var(--space-m));
  border-radius: var(--radius-s);
  cursor: pointer;
}

/* What an item holds or how many of the chosen it already has, quiet at the end of its line */
.pick-list__meta {
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.pick-list__check:hover {
  background: var(--color-surface-hover);
}

.pick-list__box {
  margin: 0;
  accent-color: var(--color-accent-line);
  cursor: pointer;
}

/* Off without root's part, but focusable, with the reason in the tooltip */
.pick-list__box[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.pick-list__name {
  overflow-wrap: anywhere;
  font-size: var(--step--1);
  font-weight: 500;
}

/* What a line is and what happens to it, quiet under its name: "Page · goes live" */
.pick-list__sub {
  grid-column: 2 / -1;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.pick-list__versions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 2 / -1;
  align-items: center;
  gap: var(--space-3xs);
}

.pick-list__note {
  margin: 0;
  padding-inline: var(--space-2xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The date and the time format, each ready-made one shown as what it writes now, an own pattern with its parts, and the places the format reaches */
.format-picker {
  display: grid;
  gap: var(--space-m);
  min-width: 0;
}

.format-picker__group {
  display: grid;
  gap: var(--space-xs);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.format-picker__legend {
  margin-block-end: var(--space-xs);
  padding: 0;
  font-size: var(--step-0);
  font-weight: 600;
}

/* As many choices a row as fit, never one wider than the picker */
.format-picker__options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(9.5rem, 100%), 1fr));
  gap: var(--space-xs);
}

.format-picker__option {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--space-3xs);
  min-width: 0;
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
  cursor: pointer;
}

.format-picker__option:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-hover);
}

.format-picker__option:has(.format-picker__radio:checked) {
  border-color: var(--color-accent-line);
  background: var(--color-accent-muted);
  box-shadow: inset 0 0 0 1px var(--color-accent-line);
}

/* The radio stays in the page for the keyboard and screen readers; its choice shows as the frame */
.format-picker__option:has(.format-picker__radio:focus-visible) {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.format-picker__radio {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

/* The server's format, which a website follows until it chooses another */
.format-picker__option--follow {
  border-style: dashed;
}

.format-picker__result {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.format-picker__option--own .format-picker__result {
  color: var(--color-accent-text);
}

/* The pattern above who writes it so, in every choice alike */
.format-picker__meta {
  display: grid;
  gap: var(--space-3xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.format-picker__code {
  color: var(--color-text);
  font-family: var(--font-code);
}

.format-picker__own {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.format-picker__label {
  font-size: var(--step--1);
  font-weight: 600;
}

.format-picker__own-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
}

.format-picker__input {
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 20rem;
  height: var(--size-control-m);
  padding-inline: var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--code-font-size);
}

.format-picker__input[aria-invalid="true"],
.format-picker__input[aria-invalid="true"]:focus-visible {
  border-color: var(--color-danger);
  outline-color: var(--color-danger);
}

/* What the own pattern writes now, beside it */
.format-picker__sample {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.format-picker__parts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

.format-picker__part {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2xs);
  padding: var(--space-3xs) var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
}

.format-picker__part:hover {
  border-color: var(--color-accent-line);
  color: var(--color-text);
}

.format-picker__part-code {
  color: var(--color-accent-text);
  font-family: var(--font-code);
  font-weight: 700;
}

.format-picker__problem {
  margin: 0;
  color: var(--color-danger);
  font-size: var(--step--1);
}

.format-picker__problem:empty {
  display: none;
}

.format-picker__preview {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-bg);
}

.format-picker__preview-title {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.format-picker__rows {
  display: grid;
  margin: 0;
}

.format-picker__row {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: var(--space-s);
  padding-block: var(--space-2xs);
  border-block-start: 1px solid var(--color-border);
}

.format-picker__row:first-child {
  border-block-start: 0;
}

.format-picker__term {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.format-picker__where {
  display: block;
  color: var(--color-text-subtle);
}

.format-picker__value {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Where a card holds two pickers, each says what it is for */
.format-picker__head {
  display: grid;
  gap: var(--space-3xs);
}

.format-picker__title {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 600;
}

.format-picker__intro {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* A day and a time on the website's clock: a month of days to pick from, the time with a quarter hour's − and +, and the zone it is read in */
.moment-picker {
  display: grid;
  gap: var(--space-m);
}

.moment-picker__calendar {
  display: grid;
  gap: var(--space-xs);
}

.moment-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
}

.moment-picker__month,
.moment-picker__label {
  margin: 0;
  padding: 0;
  color: var(--color-text);
  font-size: var(--step-0);
  font-weight: 600;
}

.moment-picker__nav {
  display: flex;
  gap: var(--space-2xs);
}

.moment-picker__grid {
  display: grid;
  gap: var(--space-3xs);
}

.moment-picker__week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-3xs);
}

.moment-picker__weekday {
  padding-block: var(--space-3xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 600;
  text-align: center;
}

.moment-picker__cell {
  display: grid;
  place-items: center;
}

/* As wide as its column up to a square and a bit, so a wide dialog keeps its days apart */
.moment-picker__day {
  position: relative;
  width: 100%;
  max-width: 44px;
  height: 36px;
  padding: 0;
  /* Carries the picked day's frame in forced colours, where its fill is dropped */
  border: 1px solid transparent;
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: var(--step-0);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color var(--duration-fast);
}

.moment-picker__day:hover:not(:disabled) {
  background: var(--color-surface-hover);
}

.moment-picker__day--out {
  color: var(--color-text-subtle);
}

/* Past days and those beyond a year: faded like an icon button that is off */
.moment-picker__day:disabled {
  color: var(--color-text-subtle);
  opacity: 0.4;
  cursor: default;
}

.moment-picker__day--today {
  color: var(--color-accent-text);
  font-weight: 700;
}

/* Today is told by a dot as well as its colour */
.moment-picker__day--today::after {
  position: absolute;
  inset-block-end: 5px;
  inset-inline-start: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  translate: -50% 0;
}

.moment-picker__day--picked,
.moment-picker__day--picked:hover:not(:disabled) {
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
}

.moment-picker__time {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* A legend stands outside its fieldset's layout, so its distance is its own */
.moment-picker__label {
  margin-block-end: var(--space-xs);
}

.moment-picker__clock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
}

.moment-picker__number {
  width: 48px;
  height: var(--size-control-l);
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--step-1);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.moment-picker__number:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

.moment-picker__colon {
  color: var(--color-text-muted);
  font-weight: 600;
}

.moment-picker__period {
  margin-inline-start: var(--space-2xs);
}

.moment-picker__until {
  margin-inline-start: var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.moment-picker__until--problem {
  color: var(--color-danger);
}

.moment-picker__zone {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.moment-picker__icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--color-icon);
}

/* One upload viewed large over the whole window, dark in both themes as a gallery shows a picture */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--color-lightbox);
  color: var(--color-on-lightbox);
}

.lightbox[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

/* The dialog covers the window itself; no second dimming behind it */
.lightbox::backdrop {
  background: transparent;
}

.lightbox__close {
  position: fixed;
  inset-block-start: var(--space-s);
  inset-inline-end: var(--space-s);
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--color-on-lightbox-muted);
  border-radius: 50%;
  background: var(--color-lightbox);
  color: var(--color-on-lightbox);
  font-size: var(--step-1);
  line-height: 1;
  cursor: pointer;
}

.lightbox__stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: var(--space-xl) var(--space-l) var(--space-s);
  overflow: auto;
}

/* What a PNG or SVG leaves transparent, shown as squares */
.lightbox__stage--checker .lightbox__image {
  background-color: var(--color-checker-light);
  background-image:
    linear-gradient(45deg, var(--color-checker-dark) 25%, transparent 25%),
    linear-gradient(-45deg, var(--color-checker-dark) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--color-checker-dark) 75%),
    linear-gradient(-45deg, transparent 75%, var(--color-checker-dark) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

/* Fitted to the window until a click shows it at its own size */
.lightbox__image {
  max-width: 100%;
  max-height: calc(100dvh - 9rem);
  object-fit: contain;
}

.lightbox__image--zooms {
  cursor: zoom-in;
}

.lightbox--actual .lightbox__stage {
  place-items: start;
}

.lightbox--actual .lightbox__image {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.lightbox__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-m);
  padding: var(--space-s) var(--space-l);
  font-size: var(--step--1);
}

.lightbox__name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.lightbox__facts {
  color: var(--color-on-lightbox-muted);
  font-variant-numeric: tabular-nums;
}

.lightbox__spacer {
  flex: 1;
}

.lightbox__button {
  height: var(--size-control-m);
  padding-inline: var(--space-s);
  border: 1px solid var(--color-on-lightbox-muted);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-on-lightbox);
  font: inherit;
  cursor: pointer;
}

.lightbox__button[aria-pressed="true"] {
  border-color: var(--color-on-lightbox);
  font-weight: 600;
}

.lightbox__button:focus-visible,
.lightbox__close:focus-visible {
  outline: 2px solid var(--color-on-lightbox);
  outline-offset: 2px;
}

/* The folders an upload is in, in its inspector: one tag a folder with its remove button, and a select that adds one */
.folder-tags {
  display: grid;
  gap: var(--space-xs);
}

.folder-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.folder-tags__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  max-width: 100%;
  min-height: var(--size-control-s);
  padding-inline: var(--space-xs) var(--space-3xs);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface-raised);
  font-size: var(--step--1);
}

.folder-tags__name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.folder-tags__remove {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.folder-tags__remove:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.folder-tags__remove:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 1px;
}

.folder-tags__icon {
  width: 12px;
  height: 12px;
}

.folder-tags__none {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.folder-tags__add {
  justify-self: start;
  max-width: 100%;
}

/* Widgets dialog: the ready-made elements as cards, each with the line that says what it does */
.widgets {
  display: grid;
  gap: var(--space-m);
}

.widgets__intro {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.widgets__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xs);
}

.widgets__item {
  display: flex;
  align-items: start;
  gap: var(--space-s);
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.widgets__item:hover:not(:disabled, [aria-disabled="true"]) {
  border-color: var(--color-border-strong);
  background: var(--color-surface-hover);
}

.widgets__item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Off but focusable, with its reason in the tooltip: the content fades, the focus ring does not */
.widgets__item[aria-disabled="true"] {
  cursor: not-allowed;
}

.widgets__item[aria-disabled="true"] > * {
  opacity: 0.5;
}

.widgets__icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--color-accent-text);
}

.widgets__text {
  display: grid;
  gap: var(--space-3xs);
  min-width: 0;
}

.widgets__label {
  font-size: var(--step-0);
  font-weight: 600;
}

.widgets__description {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Components dialog: the site's components as cards, inserted with one click */
.components {
  display: grid;
  gap: var(--space-m);
}

.components__intro,
.components__empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.components__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xs);
}

.components__item {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.components__item:hover:not(:disabled, [aria-disabled="true"]) {
  border-color: var(--color-component);
  background: var(--color-surface-hover);
}

.components__item:focus-visible {
  outline: 2px solid var(--color-component);
  outline-offset: 2px;
}

.components__item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Off but focusable, with its reason in the tooltip: the content fades, the focus ring does not */
.components__item[aria-disabled="true"] {
  cursor: not-allowed;
}

.components__item[aria-disabled="true"] > * {
  opacity: 0.5;
}

.components__icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--color-component);
}

.components__text {
  display: grid;
  gap: var(--space-3xs);
  min-width: 0;
}

.components__label {
  overflow: hidden;
  font-size: var(--step-0);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.components__tag {
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

/* Where the open page shows the component already, at the card's end */
.components__where {
  flex: none;
  margin-inline-start: auto;
}

/* Image picker: the website's pictures as a grid of thumbnails, one picked for an image field */
.image-picker {
  display: grid;
  gap: var(--space-s);
}

/* The folder and the search side by side, wrapping where the dialog is narrow */
.image-picker__bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.image-picker__folder {
  max-width: 16rem;
}

.image-picker__search {
  flex: 1;
  min-width: 12rem;
}

.image-picker__empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.image-picker__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: var(--space-xs);
  max-height: 60vh;
  overflow-y: auto;
}

.image-picker__item {
  display: grid;
  gap: var(--space-3xs);
  padding: var(--space-2xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.image-picker__item:hover {
  border-color: var(--color-accent-line);
  background: var(--color-surface-hover);
}

/* The picture the field holds now */
.image-picker__item[aria-pressed="true"] {
  border-color: var(--color-accent-line);
  box-shadow: inset 0 0 0 1px var(--color-accent-line);
}

.image-picker__thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-s);
  background: var(--color-surface);
  object-fit: cover;
}

.image-picker__name {
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A picture without an alt text, worth giving one in Uploads */
.image-picker__missing {
  color: var(--color-pending);
  font-size: var(--step--1);
}

/* A product's mark, the logo's tile: before its name in a header, above it on the login page, alone in the taskbar. Written by scripts/brand.mjs from brand/, never by hand */
.brand-mark {
  display: inline-block;
  flex: none;
  width: var(--size-control-m);
  aspect-ratio: 1;
  background: center / contain no-repeat;
}

/* Inside an icon button, the taskbar's way to the manage panel */
.brand-mark--s {
  width: var(--size-control-s);
}

/* Above a name that stands alone on its page */
.brand-mark--l {
  width: calc(var(--size-control-l) + var(--space-xs));
}

.brand-mark--barista {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 531.4 531.4'%3E%3Cdefs%3E%3ClinearGradient id='g1' x1='504.71' y1='31.29' x2='18.92' y2='507.74' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23fe952b'/%3E%3Cstop offset='0.46' stop-color='%23ffdeb3'/%3E%3Cstop offset='1' stop-color='%23f76a01'/%3E%3C/linearGradient%3E%3ClinearGradient id='g2' x1='58.62' y1='26.56' x2='473.14' y2='504.84' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23ffcc8b'/%3E%3Cstop offset='1' stop-color='%23f76a01'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g1)' d='M124.55 0 L406.85 0 C475.637 0 531.4 55.763 531.4 124.55 L531.4 406.85 C531.4 475.637 475.637 531.4 406.85 531.4 L124.55 531.4 C55.763 531.4 0 475.637 0 406.85 L0 124.55 C0 55.763 55.763 0 124.55 0 Z'/%3E%3Cpath fill='url(%23g2)' d='M13.06 406.86 L13.06 124.55 C13.06 62.92 63.1 12.88 124.73 12.88 L407.04 12.88 C468.67 12.88 518.71 62.92 518.71 124.55 L518.71 406.86 C518.71 468.49 468.67 518.53 407.04 518.53 L124.73 518.53 C63.1 518.53 13.06 468.49 13.06 406.86 Z'/%3E%3Cpath fill='%23471800' d='M320.26 119.1 C286.99 111.04 224.67 108.73 172.77 179.66 C97.98 281.86 159.62 367.14 159.62 367.14 C159.62 367.14 143.85 324.03 258.19 250.6 C316.1 213.41 337.35 182.27 344.23 160.59 C349.96 142.51 338.7 123.56 320.27 119.1 Z M308.03 145.3 C307.01 145.16 305.49 145.09 303.57 144.93 C301.66 144.79 299.32 144.74 296.67 144.68 C294.01 144.7 291.02 144.68 287.77 144.91 C284.52 144.98 281.04 145.54 277.36 145.87 C275.53 146.1 273.66 146.51 271.76 146.83 C269.86 147.18 267.9 147.44 265.96 148 C264.02 148.48 262.04 148.98 260.04 149.48 C258.06 150.04 256.12 150.82 254.11 151.43 C250.05 152.56 246.23 154.48 242.32 156.17 C240.31 156.91 238.5 158.04 236.62 159.04 C234.76 160.06 232.9 161.07 231.05 162.08 C227.55 164.42 224.1 166.72 220.76 168.95 C217.63 171.5 214.61 173.96 211.74 176.3 C210.23 177.4 209.03 178.75 207.77 179.97 C206.51 181.19 205.3 182.37 204.13 183.51 C201.81 185.8 199.53 187.79 197.89 189.89 C196.12 191.9 194.58 193.65 193.31 195.09 C190.72 197.96 189.18 199.58 189.18 199.58 C189.18 199.58 190.23 197.64 192.18 194.28 C193.18 192.61 194.39 190.57 195.78 188.24 C197.09 185.83 199.03 183.46 201.13 180.84 C203.28 178.27 205.32 175.19 208.12 172.53 C210.89 169.85 213.76 166.91 216.94 164.11 C220.35 161.61 223.75 158.8 227.48 156.34 C229.42 155.23 231.38 154.11 233.34 152.99 C235.32 151.89 237.23 150.65 239.36 149.83 C243.57 148.1 247.69 146.15 252.03 145.01 C254.17 144.37 256.28 143.66 258.42 143.19 C260.57 142.78 262.69 142.37 264.78 141.97 C266.85 141.51 268.93 141.29 270.97 141.14 C273.01 140.99 274.98 140.74 276.92 140.68 C280.8 140.64 284.46 140.54 287.82 140.91 C291.18 141.07 294.24 141.59 296.92 142.02 C299.6 142.5 301.92 143.05 303.8 143.56 C305.68 144.06 307.14 144.57 308.12 144.93 C309.1 145.27 309.61 145.49 309.61 145.49 C309.61 145.49 309.06 145.39 308.03 145.29 Z M369.73 153.93 C369.73 153.93 368.71 210.15 276.16 262.21 C224.74 291.13 200.65 326.06 189.38 351.39 C177.79 377.45 192.97 408.34 220.83 414.45 C234.52 417.45 252.07 417.16 274.16 409.93 C295.65 402.89 315.38 391.22 332.24 376.16 C370.18 342.28 431.41 264.98 369.72 153.94 Z M332.87 333.2 C332.75 333.57 332.61 334.04 332.42 334.58 C332.23 335.12 332.01 335.73 331.75 336.43 C331.49 337.12 331.17 337.87 330.83 338.69 C330.66 339.1 330.46 339.52 330.26 339.95 C330.06 340.38 329.85 340.84 329.63 341.3 C328.71 343.14 327.6 345.19 326.25 347.35 C325.56 348.42 324.83 349.53 324.02 350.64 C323.63 351.21 323.2 351.76 322.77 352.33 C322.55 352.61 322.34 352.9 322.12 353.18 C321.89 353.46 321.67 353.74 321.44 354.03 C319.59 356.3 317.51 358.59 315.21 360.81 C314.92 361.09 314.63 361.37 314.34 361.65 C314.04 361.92 313.74 362.19 313.44 362.47 C312.84 363.02 312.22 363.56 311.6 364.09 C310.98 364.64 310.34 365.15 309.7 365.69 C309.06 366.22 308.39 366.72 307.73 367.24 C305.07 369.29 302.24 371.18 299.34 372.96 C297.89 373.84 296.4 374.67 294.92 375.49 C293.43 376.3 291.93 377.05 290.43 377.78 C288.93 378.52 287.42 379.18 285.92 379.83 C285.17 380.15 284.42 380.46 283.67 380.77 C282.92 381.07 282.18 381.36 281.44 381.64 C278.48 382.76 275.57 383.72 272.79 384.53 C271.4 384.93 270.04 385.3 268.72 385.64 C267.4 385.96 266.12 386.28 264.89 386.53 C262.42 387.06 260.15 387.47 258.12 387.77 C256.1 388.07 254.32 388.28 252.86 388.41 C251.4 388.55 250.24 388.59 249.46 388.63 C249.07 388.65 248.77 388.65 248.56 388.65 C248.36 388.65 248.25 388.65 248.25 388.65 C248.25 388.65 248.65 388.54 249.41 388.32 C250.16 388.11 251.26 387.77 252.65 387.35 C255.43 386.5 259.38 385.24 264.03 383.56 C266.36 382.73 268.86 381.78 271.48 380.73 C274.1 379.69 276.83 378.52 279.63 377.27 C281.02 376.63 282.44 375.98 283.85 375.3 C284.56 374.95 285.27 374.61 285.98 374.24 C286.34 374.06 286.69 373.88 287.05 373.71 C287.4 373.53 287.76 373.34 288.12 373.16 C290.96 371.68 293.81 370.1 296.57 368.4 C299.35 366.73 302.05 364.94 304.65 363.08 C305.29 362.61 305.94 362.15 306.56 361.67 C307.19 361.19 307.83 360.73 308.43 360.24 C309.04 359.76 309.66 359.28 310.25 358.79 C310.55 358.55 310.85 358.3 311.14 358.06 C311.43 357.81 311.72 357.57 312.01 357.32 C314.32 355.35 316.47 353.35 318.43 351.36 C320.39 349.38 322.16 347.41 323.74 345.54 C324.13 345.07 324.51 344.6 324.88 344.15 C325.26 343.7 325.59 343.23 325.94 342.8 C326.65 341.93 327.25 341.05 327.86 340.25 C328.44 339.43 328.98 338.66 329.47 337.95 C329.95 337.22 330.4 336.56 330.8 335.95 C331.19 335.34 331.53 334.79 331.85 334.31 C332.15 333.83 332.39 333.42 332.6 333.08 C333.01 332.41 333.23 332.06 333.23 332.06 C333.23 332.06 333.11 332.46 332.88 333.21 Z'/%3E%3C/svg%3E");
}

.brand-mark--machine {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 531.4 531.4'%3E%3Cdefs%3E%3ClinearGradient id='g1' x1='504.71' y1='31.29' x2='18.92' y2='507.74' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23f5803a'/%3E%3Cstop offset='0.46' stop-color='%23ffdec4'/%3E%3Cstop offset='1' stop-color='%23b8400d'/%3E%3C/linearGradient%3E%3ClinearGradient id='g2' x1='58.44' y1='26.56' x2='472.96' y2='504.85' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23ffc79c'/%3E%3Cstop offset='0.46' stop-color='%23f5803a'/%3E%3Cstop offset='1' stop-color='%23b8400d'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g1)' d='M124.55 0 L406.85 0 C475.637 0 531.4 55.763 531.4 124.55 L531.4 406.85 C531.4 475.637 475.637 531.4 406.85 531.4 L124.55 531.4 C55.763 531.4 0 475.637 0 406.85 L0 124.55 C0 55.763 55.763 0 124.55 0 Z'/%3E%3Cpath fill='url(%23g2)' d='M12.88 406.85 L12.88 124.54 C12.88 62.91 62.92 12.87 124.55 12.87 L406.86 12.87 C468.49 12.87 518.53 62.91 518.53 124.54 L518.53 406.85 C518.53 468.48 468.49 518.52 406.86 518.52 L124.55 518.52 C62.92 518.52 12.88 468.48 12.88 406.85 Z'/%3E%3Cpath fill='%23471800' d='M394.46 382.85 C394.46 376.57 391.34 371.01 385.42 368.4 C382.35 367.07 378.68 367.02 375.24 366.93 L368.63 346.33 C367.62 343.3 367.39 340.14 367.62 337.02 L370.19 309.68 L377.03 225.36 L154.62 225.36 L163.2 325.05 L164.67 341.61 L156.96 366.57 C151.64 366.39 146.82 366.98 142.88 370.1 C138.38 373.63 136.87 379.05 136.92 384.64 L137.01 410.65 C137.01 412.67 139.26 416.75 142.1 416.75 L386.86 416.75 C389.66 416.75 391.4 416.29 392.69 414.96 C393.97 413.68 394.53 411.47 394.53 409.45 L394.48 382.84 Z M242.83 236.6 L288.98 236.69 C288.84 240.91 291.46 253.21 284.53 253.25 L247.69 253.34 C240.17 253.34 242.69 241.5 242.83 236.6 Z M194.25 366.43 L194.25 236.6 L231.59 236.55 C231.5 241.78 231.45 246.14 231.96 251 C233.61 257.84 238.43 263.57 245.68 263.98 L255.27 264.48 L255.45 283.38 L263.71 283.2 L263.71 283.15 L268.3 283.15 L268.3 283.2 L276.83 283.34 L276.88 264.58 L284.77 264.17 C292.98 263.71 298.81 257.88 299.96 249.81 L300.28 236.64 L337.49 236.69 L337.58 366.39 L288.31 366.44 L194.26 366.44 Z M354.27 403.5 C346.47 405.01 337.48 402.08 329.4 401.85 C336.69 400.61 345.55 401.12 352.16 397.95 C358.4 394.74 361.24 387.95 361.43 381.16 C361.98 375.84 362.39 370.47 362.9 365.15 C363.68 370.47 364.37 375.75 365.24 381.07 L365.88 385.02 C367.62 392.96 362.16 401.63 354.27 403.51 Z'/%3E%3Cpath fill='%23471800' d='M367.85 114.65 L164.02 114.65 C147.83 114.97 136.08 128.64 137.55 144.61 L143.97 215.17 L388.08 215.26 L394.18 143.09 C395.46 127.77 382.94 115.33 367.85 114.65 Z M157.91 157.46 C157.18 164.53 156.63 171.59 155.98 178.65 C154.97 171.63 154.05 164.61 152.91 157.59 L152.04 152.36 C149.75 141.9 156.95 130.43 167.36 127.91 C177.73 125.94 189.61 129.79 200.25 130.11 C190.62 131.76 178.92 131.07 170.15 135.25 C161.89 139.52 158.18 148.51 157.9 157.46 Z M193.38 195.67 C186.68 195.67 181.31 190.3 181.31 183.65 C181.31 177 186.68 171.58 193.38 171.58 C200.08 171.58 205.4 176.95 205.4 183.65 C205.4 190.35 200.03 195.67 193.38 195.67 Z M265.86 202.6 C255.4 202.6 246.96 194.16 246.96 183.7 C246.96 173.24 255.4 164.84 265.86 164.84 C276.32 164.84 284.76 173.28 284.76 183.7 C284.76 194.12 276.27 202.6 265.86 202.6 Z M290.45 149.2 L239.62 149.06 C233.2 149.06 227.46 145.21 224.99 139.7 C223.02 135.34 222.7 130.66 223.2 126.26 L307.94 126.35 C310.65 137.18 302.89 149.24 290.46 149.2 Z M338.49 195.72 C331.84 195.72 326.42 190.31 326.42 183.65 C326.42 176.99 331.83 171.58 338.49 171.58 C345.15 171.58 350.56 176.95 350.56 183.65 C350.56 190.35 345.15 195.72 338.49 195.72 Z'/%3E%3Cpath fill='%23471800' d='M291.35 318.85 L290.8 313.32 C290.63 311.65 289.3 310.48 287.59 310.48 L246.09 310.48 C244.52 310.48 243.15 311.56 242.96 313.12 C241.38 325.98 242.59 341.02 248.75 352.63 C250.37 355.68 252.29 358.4 254.73 360.82 C256.7 362.77 259.18 364.07 262 364.07 L271.8 364.07 C274.05 364.06 276.2 363.17 277.89 361.74 C281.57 358.64 284.67 353.83 286.58 349.36 L291.6 345.47 C293.99 343.62 296.24 341.76 298.39 339.64 C299.95 337.94 301.46 336.3 302.43 334.18 C303.79 331.22 304 327.84 303.24 324.71 C301.86 319.45 296.34 317.13 291.32 318.85 Z M256 353.88 C255.31 354.09 252.95 350.43 252.53 349.72 C249.21 344 247.82 336.92 247.3 330.37 C246.94 325.84 247.02 321.4 247.29 316.87 C247.33 316.26 247.69 315.93 248.28 315.93 L251.18 315.93 C251.63 315.93 252.15 316.21 252.12 316.75 C251.55 326.2 251.65 337.21 253.81 346.48 C254.37 348.89 255.08 351.1 256.09 353.42 C256.14 353.52 256.09 353.85 256 353.88 Z M296.71 334.7 C295.76 335.75 294.74 336.7 293.54 337.56 L289.65 340.34 C290.79 335.31 291.4 330.42 291.48 325.27 C293.83 325.37 295.9 323.01 297.57 325.27 C298.45 326.46 298.71 327.88 298.71 329.36 C298.71 331.4 298.09 333.19 296.72 334.71 Z'/%3E%3Cpath fill='%23471800' d='M266.88 308.7 C266.87 308.64 266.83 308.5 266.77 308.44 C265.1 306.85 264.85 304.15 265.89 302.06 C266.36 301.12 266.91 300.28 267.51 299.41 C269.11 297.08 270.05 293.57 268.55 290.99 C267.61 289.37 265.8 288.96 265.78 289.32 C265.75 289.8 268.24 290.68 267 294.77 C266.09 297.78 264.46 298.61 263.52 301.57 C262.91 303.46 263.17 305.5 264.29 307.14 C265.26 308.57 266.96 309.09 266.88 308.68 Z'/%3E%3Cpath fill='%23471800' d='M260.97 302.07 C261.51 301.79 258.98 300.12 260.85 296.59 L262.41 293.65 C263.57 291.46 263.66 288.6 261.58 286.95 C261.51 286.9 261.33 286.89 261.27 286.95 C260.98 287.28 262.31 289.08 261.17 291.74 C260.75 292.73 260.31 293.63 259.83 294.58 C259.35 295.53 258.98 296.48 258.82 297.52 C258.54 299.28 259.2 300.92 260.61 302.02 C260.68 302.08 260.89 302.11 260.97 302.07 Z'/%3E%3Cpath fill='%23471800' d='M272.31 308.37 C272.47 308.47 272.69 308.42 272.68 308.37 C272.61 307.7 270.44 305.44 272.14 302.19 C272.89 300.77 273.8 299.2 273.02 297.61 C272.99 297.55 272.87 297.44 272.81 297.41 C272.75 297.38 272.61 297.49 272.55 297.57 C271.69 298.79 271 300.24 270.33 301.63 C269.16 304.05 270.24 307.08 272.31 308.37 Z'/%3E%3C/svg%3E");
}

/*
 * Manage panel: everything about the website that is not the page in the canvas. Covers
 * canvas, code editor and sidebar (the taskbar stays), a nav of the website's parts on the
 * left and the picked section on the right. Where it sits in the app grid is app.css's
 * business.
 */
.manage {
  --manage-section-padding: var(--space-l);
  /* How wide the open section's first column is, where its tabs start in the header (--split) */
  --manage-head-split: 0px;

  /*
   * Two columns, the nav's and the sections', which the header shares (subgrid): the line
   * after the product's name stands where the nav ends, at every width the nav is dragged to
   * and folded to its icons too, gliding with it.
   */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: var(--color-bg);
}

/*
 * The product's name above the nav, then the open section's name with its ⓘ, its bar and the
 * theme's switch at the very end (decided 2026-10-21, proposal E of the header's artifact),
 * as tall as the builder's taskbar.
 */
.manage__header {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  min-height: var(--taskbar-height);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* Above the nav and as wide: no width of its own (0, then the whole column), so the nav alone sets the column's */
.manage__home {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  width: 0;
  min-width: 100%;
  padding-inline: var(--space-s);
  overflow: hidden;
  border-inline-end: 1px solid var(--color-border);
}

/* The product's name, a link or a button that leads home: the console's overview, the builder's canvas */
.manage__product {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: var(--step-1);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.manage__product-name {
  overflow: hidden;
  color: var(--color-text-strong);
  font-size: var(--step-2);
  font-weight: 700;
  text-overflow: ellipsis;
}

/* The name and, small under it, whose product it is: two lines that fit the header's height */
.manage__label {
  display: grid;
  min-width: 0;
  line-height: 1.15;
  text-align: start;
}

/* Set in a little, so its straight first letter stands under the name's round one */
.manage__by {
  padding-inline-start: var(--space-3xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 400;
}

/* The nav folded to its icons: the arrow back or the mark alone, in the middle of the narrow column */
.manage:has(.side-nav--rail) .manage__home {
  justify-content: center;
  padding-inline: 0;
}

.manage:has(.side-nav--rail) .manage__label {
  display: none;
}

/* The builder's product stands beside its arrow back, which alone has room in the narrow column */
.manage:has(.side-nav--rail) .manage__product--folds {
  display: none;
}

/* Above the sections, from where their content starts: the open section's name and the rest of the header */
.manage__head {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
  padding-inline: var(--manage-section-padding) var(--space-m);
}

/* The open section's name with its ⓘ */
.manage__name {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

/*
 * A section with tabs (decided 2026-10-30, proposal H of "Settings Where They Act"): a line
 * after its name, then the tabs; with a first column (Styles' list, the uploads' folders,
 * --split) the name stands over that column and as wide, so the tabs start where the
 * section's content does.
 */
.manage__head--bar {
  padding-inline-start: 0;
}

.manage__head--bar .manage__name {
  flex: none;
  align-self: stretch;
  padding-inline: var(--manage-section-padding) var(--space-m);
  border-inline-end: 1px solid var(--color-border);
}

/*
 * As wide as the section's first column while there is room; where the bar needs more than
 * the window leaves, the name gives its room up first, down to its own words, so the bar's
 * last button is never cut or drawn under the header's end.
 */
.manage__head--split .manage__name {
  flex: 0 1000 var(--manage-head-split);
  min-width: min-content;
  padding-inline-end: var(--space-s);
}

/* The open section's bar (block section-bar), between its name and the header's end, the whole height of the header */
.manage__bars {
  display: flex;
  /* Its content's width to start from, so the name before it shrinks before the bar does */
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
}

/* A section's panel behind one of its tabs, its cards one below the other as the section's own */
.manage__tab-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  min-width: 0;
}

/* In a section that leaves its padding to what it holds: the panel pads and scrolls itself */
.manage__tab-panel--flush {
  flex: 1;
  min-height: 0;
  padding: var(--manage-section-padding);
  overflow-y: auto;
}

.manage__title {
  margin: 0;
  overflow: hidden;
  font-size: var(--step-1);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The ⓘ after the name, whose tooltip is the section's line */
.manage__about {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-accent-muted);
  color: var(--color-accent-text);
  cursor: help;
}

.manage__about-icon {
  width: 14px;
  height: 14px;
}

/*
 * The end of the header, after a line that sets it apart from the open section's bar: what
 * holds in every section (maintenance mode, a firewall's change that waits), then the theme's
 * switch, last of all; the same in the builder and the console (#101).
 */
.manage__end {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-s);
  min-width: 0;
  margin-inline-start: auto;
  padding-inline-start: var(--space-s);
  border-inline-start: 1px solid var(--color-border);
}

/* The notice that maintenance mode is on, in the header's end before the theme's switch, shown only while it is */
.manage__away {
  flex: none;
}

/* Its words go where the window is narrow, so a section's bar keeps its room: the icon says it, the tooltip the rest */
.manage__away-label {
  margin-inline-start: var(--space-2xs);
}

@media (max-width: 1280px) {
  .manage__away-label {
    display: none;
  }
}

/* The nav and the open section, in the header's two columns */
.manage__body {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  min-height: 0;
}

/* The nav is the block side-nav; here it only takes its column, as wide as it makes itself */
.manage__nav {
  min-height: 0;
}

/* The way to the nav on a phone: hidden where the nav stands beside the sections */
.manage__menu {
  display: none;
  align-items: center;
  gap: var(--space-xs);
}

.manage__menu-label {
  font-weight: 600;
}

/* How many wait for a decision, on the menu button for a phone */
.manage__badge {
  flex: none;
  min-width: 18px;
  padding-inline: var(--space-2xs);
  border-radius: 9px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--step--1);
  font-weight: 600;
  text-align: center;
}

/* ---- The section on the right ---- */

.manage__main {
  display: grid;
  min-width: 0;
  min-height: 0;
}

/* Positioned, so that what is absolute inside it (every .visually-hidden label of a table
   row) scrolls and clips with it: unpositioned, those escape to the page, make the document
   taller than the window, and a scrollIntoView then scrolls the whole page up as well. */
.manage__section {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  grid-area: 1 / 1;
  padding: var(--manage-section-padding);
  overflow-y: auto;
}

/* A section that brings its own layout and scrolling: the style manager, the content panel */
.manage__section--flush {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.manage__status {
  margin: 0;
  min-height: 1lh;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* ---- Forms inside a section ---- */

.manage__label {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.manage__input {
  width: 100%;
  max-width: 320px;
  height: var(--size-control-m);
  padding-inline: var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--step-0);
}

/* A field the core or the form refused: the words stand below it */
.manage__input--invalid,
.manage__input--invalid:focus-visible {
  border-color: var(--color-danger);
  outline-color: var(--color-danger);
}

.manage__input--short {
  max-width: 160px;
}

.manage__input--code {
  font-family: var(--font-code);
}

.manage__input--lines {
  height: auto;
  padding-block: var(--space-2xs);
  resize: vertical;
}

.manage__input:disabled {
  color: var(--color-text-muted);
  background: var(--color-surface-raised);
}

.manage__hint {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The settings cards of a section, one under the other at a width a form reads well at */
.manage__cards {
  display: grid;
  gap: var(--space-m);
  max-width: 640px;
}

/* Cards that hold a table of several columns, the matrix of roles: as wide as a list reads */
.manage__cards--wide {
  max-width: 960px;
}

.manage__url {
  color: var(--color-accent-text);
  font-size: var(--step-0);
  word-break: break-all;
}

/* The one-time setup: shown above the form until the website has its domain. */
.manage__notice {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  max-width: 560px;
  padding: var(--space-s);
  border: 1px solid var(--color-accent-line);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.manage__notice-title {
  margin: 0;
  font-size: var(--step-0);
  font-weight: 600;
}

.manage__notice-text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/*
 * The phone's layout of the manage panel and the console, its one breakpoint (decided
 * 2026-10-11 for the console, #73; the builder's panel since #101, M8, so comments are
 * approved and orders read on the road): below 600 px the nav folds away behind the menu
 * button in the header and opens above the sections, which take the whole width.
 */
@media (width < 600px) {
  .manage__menu {
    display: inline-flex;
  }

  /*
   * One column: the product's name, then the menu button, which names the section, and the
   * theme's switch; the bar takes a row of its own below them. The section's name stays the
   * heading for a screen reader, the menu button saying it on the screen.
   */
  .manage {
    --manage-section-padding: var(--space-m);

    grid-template-columns: minmax(0, 1fr);
  }

  .manage__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding-block: var(--space-xs);
  }

  .manage__header .manage__home {
    align-self: flex-start;
    width: auto;
    min-width: 0;
    min-height: var(--size-control-l);
    border-inline-end: 0;
  }

  .manage__header .manage__head {
    flex: 1;
    flex-wrap: wrap;
    row-gap: var(--space-xs);
    padding-inline: 0 var(--space-s);
  }

  .manage__header .manage__title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .manage__header .manage__about {
    display: none;
  }

  /* The name is for a screen reader alone here, so its box, and the line after it, go */
  .manage__header .manage__name {
    display: contents;
  }

  /* The menu button and the theme's switch share the product's row, without the line before them */
  .manage__header .manage__end {
    flex: 1 1 auto;
    justify-content: flex-end;
    padding-inline-start: 0;
    border-inline-start: 0;
  }

  /* The bar takes a row of its own below them */
  .manage__header .manage__bars {
    order: 1;
    flex-basis: 100%;
  }

  .manage__body {
    position: relative;
    grid-template-rows: auto minmax(0, 1fr);
  }

  /* Two classes, as the block side-nav, which comes later, says display too */
  .manage__body .manage__nav {
    display: none;
    border-inline-end: 0;
    border-bottom: 1px solid var(--color-border);
  }

  /*
   * Open, the nav is a sheet over the sections from the header's foot down to a dimmed strip
   * at the bottom, scrolling inside on its own ground; a press on the strip closes it as
   * Escape does (phone-menu.ts), so the last category never hides behind a scroll of the page.
   */
  .manage__body .manage__nav--open {
    position: absolute;
    inset: 0 0 3rem 0;
    z-index: 2;
    display: flex;
    overflow-y: auto;
    background: var(--color-surface);
  }

  .manage__body:has(> .manage__nav--open)::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--color-backdrop);
  }

  /* The sections stand below the nav whether it is open or not */
  .manage__main {
    grid-row: 2;
  }
}
/*
 * The nav of the builder's manage panel and of the console (#103, quiet since 2026-10-22): on
 * the header's ground, categories framed in grey, each with a pill in its colour that folds
 * it, the sections below with a grey icon and a grey hover, the open one on a fill of the
 * category's colour with its icon in it. An edge on its right, seen only under the pointer or
 * the focus, folds the nav to its icons with its capsule and changes its width when dragged.
 * nav.ts sets --side-nav-width and --side-nav-scrollbar; the colours are --color-category-*.
 */
.side-nav {
  --side-nav-width: 240px;
  /* The room the scrollbar takes beside the categories, which nav.ts measures: 8 to 11 px, none where it lies over the content */
  --side-nav-scrollbar: 0px;

  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--side-nav-width);
  min-width: 0;
  min-height: 0;
  border-inline-end: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* A fold by the capsule or Ctrl+B glides; a drag and the arrow keys follow at once. */
.side-nav--folding {
  transition: width var(--duration-fold) ease-out;
}

/* The console on a phone: the nav takes the width its place gives it, with no edge to drag */
.side-nav--fixed {
  width: auto;
}

.side-nav__groups {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-xs);
  min-height: 0;
  /*
   * The categories stand as far from the nav's sides as the first one from the header: the
   * scrollbar's room is kept whether the nav scrolls or not, and taken off the end's padding,
   * so nothing moves when a category unfolds and the nav begins to scroll.
   */
  padding: var(--space-s) max(0px, calc(var(--space-s) - var(--side-nav-scrollbar))) var(--space-s) var(--space-s);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  /* Quiet until the pointer or the focus is in the nav: a thumb without a track, only then */
  scrollbar-color: transparent transparent;
}

.side-nav__groups:hover,
.side-nav__groups:focus-within {
  scrollbar-color: var(--color-border-strong) transparent;
}

/* Folded, a scrollbar would take a third of the width: the wheel and the focus still scroll */
.side-nav--rail .side-nav__groups {
  padding-inline: var(--space-xs);
  scrollbar-width: none;
}

/* ---- A category: its frame in grey on the page's ground, its colour for the pill and the open section ---- */

.side-nav__group {
  --side-nav-color: var(--color-category-blue);
  --side-nav-color-text: var(--color-category-blue-text);

  flex: none;
  padding: var(--space-2xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background: var(--color-bg);
}

.side-nav__group--violet {
  --side-nav-color: var(--color-category-violet);
  --side-nav-color-text: var(--color-category-violet-text);
}

.side-nav__group--green {
  --side-nav-color: var(--color-category-green);
  --side-nav-color-text: var(--color-category-green-text);
}

.side-nav__group--orange {
  --side-nav-color: var(--color-category-orange);
  --side-nav-color-text: var(--color-category-orange-text);
}

.side-nav__group--yellow {
  --side-nav-color: var(--color-category-yellow);
  --side-nav-color-text: var(--color-category-yellow-text);
}

.side-nav__group--pink {
  --side-nav-color: var(--color-category-pink);
  --side-nav-color-text: var(--color-category-pink-text);
}

.side-nav__heading {
  margin: 0;
  font: inherit;
}

/* The whole row folds the category; its pill names it */
.side-nav__toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  width: 100%;
  min-height: var(--size-control-l);
  padding-inline: var(--space-2xs);
  border: 0;
  border-radius: var(--radius-m);
  background: none;
  color: var(--color-icon);
  font: inherit;
  cursor: pointer;
}

.side-nav__toggle:hover {
  background: var(--color-surface-hover);
}

.side-nav__toggle:focus-visible {
  outline-offset: -2px;
}

/* The pill keeps to the start; a folded category's count and the chevron stand at the end */
.side-nav__pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-width: 0;
  margin-inline-end: auto;
  height: var(--size-control-s);
  padding-inline: var(--space-xs);
  border-radius: 999px;
  background: color-mix(in srgb, var(--side-nav-color) 15%, transparent);
  color: var(--side-nav-color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The pill's icon and, while the nav shows icons alone and something waits in a folded category, a dot on it */
.side-nav__glyph {
  position: relative;
  display: inline-flex;
  flex: none;
}

.side-nav__pill-icon {
  width: 13px;
  height: 13px;
}

.side-nav__mark {
  position: absolute;
  inset-block-start: -3px;
  inset-inline-end: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent-line);
}

.side-nav__pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Points right while the category is folded, down while it is open */
.side-nav__chevron {
  flex: none;
  width: 15px;
  height: 15px;
  transition: rotate var(--duration-fast);
}

.side-nav__toggle[aria-expanded="true"] .side-nav__chevron {
  rotate: 90deg;
}

.side-nav__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  padding-block-start: var(--space-3xs);
}

.side-nav__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
}

/* ---- A section, or a link to another place ---- */

/* Positioned, so its words hidden while folded and its dot stay inside it */
.side-nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  min-height: var(--size-control-l);
  padding-inline: var(--space-xs);
  /* Transparent until forced colours draw it, where the fill of the open one is lost */
  border: 1px solid transparent;
  border-radius: var(--radius-m);
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: var(--step-0);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.side-nav__item:hover {
  background: var(--color-surface-hover);
}

.side-nav__item:focus-visible {
  outline-offset: -2px;
}

.side-nav__item--active,
.side-nav__item--active:hover {
  background: color-mix(in srgb, var(--side-nav-color) 10%, transparent);
  font-weight: 600;
}

/* Folded to its icons, the open section is its icon in the category's colour alone, without a fill around it */
.side-nav--rail .side-nav__item--active {
  background: none;
}

.side-nav--rail .side-nav__item--active:hover {
  background: var(--color-surface-hover);
}

/* Grey on every section, in the category's colour on the open one */
.side-nav__icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--color-icon);
}

.side-nav__item:hover .side-nav__icon {
  color: var(--color-text-muted);
}

.side-nav__item--active .side-nav__icon,
.side-nav__item--active:hover .side-nav__icon {
  color: var(--side-nav-color-text);
}

.side-nav__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* How many wait for a decision: the comments to approve, a machine's alerts */
.side-nav__count {
  flex: none;
  min-width: 18px;
  padding-inline: var(--space-2xs);
  border-radius: 9px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* A link leads to another place in a new tab, which its arrow out of a box says */
.side-nav__external {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--color-icon);
}

/* ---- Folded to the icons: the words stay for screen readers and come back as tooltips ---- */

.side-nav--rail .side-nav__label,
.side-nav--rail .side-nav__pill-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.side-nav--rail .side-nav__toggle,
.side-nav--rail .side-nav__item {
  justify-content: center;
  padding-inline: 0;
}

.side-nav--rail .side-nav__pill {
  margin-inline-end: 0;
}

.side-nav--rail .side-nav__chevron,
.side-nav--rail .side-nav__external {
  display: none;
}

/* The count becomes a dot on the icon's corner; its number is still read out */
.side-nav--rail .side-nav__count {
  position: absolute;
  inset-block-start: var(--space-2xs);
  inset-inline-end: var(--space-2xs);
  width: 8px;
  min-width: 0;
  height: 8px;
  padding: 0;
  overflow: hidden;
  color: transparent;
}

/* ---- The edge: a line and a capsule, seen only under the pointer or the focus ---- */

/* Mostly beyond the nav's line, so it covers no more than the scrollbar's empty end: a drag of the thumb is no drag of the edge */
.side-nav__edge {
  position: absolute;
  z-index: var(--z-resizer);
  inset-block: 0;
  inset-inline-end: -10px;
  width: 12px;
}

.side-nav--fixed .side-nav__edge {
  display: none;
}

.side-nav__resize {
  position: absolute;
  inset: 0;
  cursor: col-resize;
  touch-action: none;
}

/* The ring hugs the line; the outline itself comes from base.css */
.side-nav__resize:focus-visible {
  outline-offset: -4px;
}

/* On the nav's line, 2 px into the edge */
.side-nav__resize::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 1px;
  width: 2px;
  background: transparent;
  transition: background-color var(--duration-fast);
}

.side-nav__edge:hover .side-nav__resize::before {
  background: color-mix(in srgb, var(--color-accent-line) 55%, transparent);
}

.side-nav__resize--active::before,
.side-nav__resize:focus-visible::before,
.side-nav__edge:hover .side-nav__resize--active::before {
  background: var(--color-accent-line);
}

/* Larger than the capsule it shows, so it is easy to hit */
.side-nav__fold {
  position: absolute;
  z-index: var(--z-resizer);
  inset-block-start: var(--space-s);
  inset-inline-start: 2px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0;
  translate: -50% 0;
  transition: opacity var(--duration-fast);
}

.side-nav__edge:hover .side-nav__fold,
.side-nav__edge:focus-within .side-nav__fold {
  opacity: 1;
}

/* The capsule carries the focus ring; the larger button around it stays invisible */
.side-nav__fold:focus-visible {
  outline: none;
}

.side-nav__capsule {
  display: grid;
  place-items: center;
  width: 14px;
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--color-accent-line) 70%, transparent);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-accent-text);
}

.side-nav__fold:hover .side-nav__capsule {
  border-color: var(--color-accent-line);
}

.side-nav__fold:focus-visible .side-nav__capsule {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

/* Points left to fold the nav, right to open it again */
.side-nav__fold-icon {
  width: 12px;
  height: 12px;
  rotate: 180deg;
}

.side-nav--rail .side-nav__fold-icon {
  rotate: 0deg;
}

/* The console of elmachine: the manage panel as the whole page instead of an overlay. */

/* Nothing shows until the login is known, so the console never flashes before a redirect. */
.console--starting {
  visibility: hidden;
}

/* A quiet mark and a word in the middle of the page while the hidden console starts, gone with its class */
.console-loading {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  color: var(--color-text-muted);
}

.console--starting + .console-loading {
  display: flex;
}

.console-loading__text {
  margin: 0;
  font-size: var(--step-0);
}

.console {
  display: grid;
  height: 100dvh;
}

/* .manage sizes itself to its parent, which the app grid gives it in the builder. */
.console__panel {
  min-height: 0;
}

/* Where the sections would stand: the start failed, so none of them shows. */
.console__failed {
  grid-area: 1 / 1;
  align-self: start;
  margin: var(--space-l);
}

/* One number of the machine at a glance: its label, the value, what it is out of, and a sparkline of the chosen range. */
.stat-tile {
  --stat-tile-share: 0;

  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.stat-tile__label {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Proportional figures: a lone large number looks loose in tabular ones */
.stat-tile__value {
  margin: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-tile__detail {
  margin: 0;
  overflow: hidden;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* What asks to be noticed, a disk full in a few days; the pending colour on the surface reads at 8.5:1 */
.stat-tile__note {
  margin: 0;
  color: var(--color-pending);
  font-size: var(--step--1);
}

/* A share of a limit; the track is the hairline colour, so the fill reads across the whole bar */
.stat-tile__meter {
  height: 4px;
  margin-block: var(--space-3xs);
  overflow: hidden;
  border-radius: 2px;
  background: var(--color-border);
}

.stat-tile__meter-fill {
  display: block;
  width: calc(var(--stat-tile-share) * 100%);
  height: 100%;
  border-radius: inherit;
  background: var(--color-accent-line);
}

/* Three quarters used is worth a look, nine tenths worth acting on; the percentage says it in words */
.stat-tile__meter-fill--high {
  background: var(--color-pending);
}

.stat-tile__meter-fill--full {
  background: var(--color-danger);
}

/* Stretched to the tile's width; the stroke keeps its thickness however wide that is */
.stat-tile__spark {
  display: block;
  width: 100%;
  height: 32px;
  margin-top: auto;
  overflow: visible;
}

.stat-tile__spark-base {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.stat-tile__spark-line {
  fill: none;
  stroke: var(--color-accent-line);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* The machine's overview around its stat tiles: the grid of tiles and the strip of cards. */
.overview__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-s);
}

/*
 * One card per part of the server, the four of them across the whole width or two by two,
 * never three and one. The track's least width is the card's, 190px, while four fit; below
 * that it is half the row, which no length can be "negative" of: the second term of min()
 * is hugely positive under the width four cards need and negative above it, so it switches
 * without a container query, and the 1px keeps two tracks from rounding out of the row.
 */
.overview__cards {
  --overview-card-min: 190px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(max(var(--overview-card-min), min(calc(50% - var(--space-s) / 2 - 1px), calc((4 * var(--overview-card-min) + 3 * var(--space-s) - 100%) * 1000))), 100%), 1fr));
  gap: var(--space-s);
}

/* Two charts side by side where they still read, one under the other where not */
/* Two by two: four charts never leave one alone on a row */
.overview__charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-s);
}

/* The server in the machine's overview, under the cards of its parts: its name and clock, then four groups of facts side by side. */
.host-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background: var(--color-surface-raised);
}

/* The name on the left, the server's clock across from it */
.host-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-m);
  padding: var(--space-l) var(--space-l) var(--space-m);
  border-block-end: 1px solid var(--color-border);
}

.host-card__identity {
  display: grid;
  gap: var(--space-2xs);
  min-width: 0;
}

/* A small heading in capitals over the name */
.host-card__label {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* A group's heading in capitals, in the text's own colour so it reads as one over the quieter terms */
.host-card__group-title {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-0);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.host-card__name {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-2-5);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.host-card__line,
.host-card__date {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Across from the name, and at the end of its own line where the two do not fit side by side */
.host-card__clock {
  display: grid;
  margin-inline-start: auto;
  justify-items: end;
  gap: var(--space-2xs);
  text-align: end;
}

/* Tabular figures, so the seconds tick without the time moving */
.host-card__time {
  color: var(--color-text);
  font-size: var(--step-2-5);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/*
 * As many groups in a row as fit. Each draws a line on its top and its start and stands a
 * pixel up and in, so the card clips the lines of the first row and the first column and
 * lines stand only between groups, however they wrap.
 */
.host-card__groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  overflow: hidden;
}

.host-card__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  min-width: 0;
  margin: -1px 0 0 -1px;
  padding: var(--space-m) var(--space-l) var(--space-l);
  border-block-start: 1px solid var(--color-border);
  border-inline-start: 1px solid var(--color-border);
}

.host-card__facts {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
}

.host-card__fact {
  display: grid;
  gap: var(--space-3xs);
  min-width: 0;
}

.host-card__term {
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

.host-card__detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-xs);
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-0);
  overflow-wrap: anywhere;
}

/* An address, the kernel, a build: one a line where there are several */
.host-card__detail--code {
  font-family: var(--font-code);
  white-space: pre-line;
}

/* Values one a line, each with its copy button: the addresses */
.host-card__detail--lines {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3xs);
}

/* One value of several and the button that copies it, right after its last character */
.host-card__entry {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  max-width: 100%;
}

/* One line of a value of several: the time servers, one of them asked now */
.host-card__item {
  display: block;
}

/* What a line is beside its value, in the text's type: "asked now" */
.host-card__note {
  color: var(--color-text-subtle);
  font-family: var(--font-ui);
  font-size: var(--step--1);
}

.host-card__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.host-card__dot--live {
  background: var(--color-live);
}

.host-card__dot--pending {
  background: var(--color-pending);
}

.host-card__value--live {
  color: var(--color-live);
}

.host-card__value--pending {
  color: var(--color-pending);
}

.host-card__separator {
  color: var(--color-text-subtle);
}

/* The way to the section that acts on a fact, a link in the look of the text it stands in */
.host-card__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.host-card__link:hover {
  text-decoration-thickness: 2px;
}

/* A service's journal: monospace lines that scroll inside the section, so the controls above them stay in view. */
.log-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-workspace);
}

.log-view:focus-visible {
  outline-offset: -2px;
}

.log-view__text {
  margin: 0;
  padding: var(--space-s);
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--code-font-size);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* One line per element, so an error can carry its colour */
.log-view__line {
  display: block;
}

/* Priority err and worse; the "!" before the message says it without the colour */
.log-view__line--error {
  color: var(--color-danger);
}

/* The day a stretch of lines is from, quiet, where the day changes between two lines */
.log-view__day {
  display: block;
  margin-block: var(--space-xs);
  padding-block: var(--space-3xs);
  border-block-end: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: var(--step--1);
}

/* What stands where there are no lines: a unit that is not installed, a log still empty */
.log-view__empty {
  display: block;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: var(--step-0);
}

/* A steady least width for the cells of Activity's short columns, so a filter that leaves other rows does not make them jump */
.actions-cell {
  display: inline-block;
}

.actions-cell--kind {
  min-inline-size: 6.5rem;
}

.actions-cell--outcome {
  min-inline-size: 6.5rem;
}

.actions-cell--took {
  min-inline-size: 5rem;
}

.actions-cell--when {
  min-inline-size: 7.5rem;
}

/* What an action of the Machine console printed, in a dialog that grows while it runs: the log scrolls, the lines above it stay in view. */
.job-output {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  /* Tall enough to read apt-get, short enough that the dialog never leaves the window */
  height: min(36rem, calc(100dvh - 8rem));
}

.job-output__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* What went wrong, over the output that shows where */
.job-output__message {
  margin: 0;
  color: var(--color-danger);
  font-size: var(--step--1);
  overflow-wrap: anywhere;
}

.job-output__log {
  min-height: 0;
}

/* One part of the server at a glance on the Machine overview, a button that opens its section; the edge's colour repeats what the words say. */
.summary-card {
  display: grid;
  gap: var(--space-3xs);
  min-width: 0;
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--color-border);
  border-inline-start-width: 4px;
  border-radius: var(--radius-m);
  background: var(--color-surface);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.summary-card:hover {
  background: var(--color-surface-hover);
}

.summary-card:focus-visible {
  outline-offset: 2px;
}

.summary-card__label {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The part's icon before its name, the one its card carries */
.summary-card__icon {
  flex: none;
  width: 13px;
  height: 13px;
  color: var(--color-text-subtle);
}

.summary-card__value {
  color: var(--color-text);
  font-size: var(--step-1);
  font-weight: 600;
}

.summary-card__detail {
  overflow: hidden;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-card--ok {
  border-inline-start-color: var(--color-live);
}

.summary-card--warning {
  border-inline-start-color: var(--color-pending);
}

.summary-card--critical {
  border-inline-start-color: var(--color-danger);
}

/* What needs a look on the website's overview: one row a thing, its icon in the colour of how pressing it is, each a button to the section that shows it */
.look-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.look-list__item + .look-list__item {
  border-top: 1px solid var(--color-border);
}

.look-list__row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  padding: var(--space-xs) var(--space-2xs);
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--color-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.look-list__row:hover {
  background: var(--color-surface-hover);
}

.look-list__row:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -2px;
}

.look-list__icon {
  width: 16px;
  height: 16px;
  color: var(--color-info);
}

.look-list__row--warning .look-list__icon {
  color: var(--color-pending);
}

.look-list__row--critical .look-list__icon {
  color: var(--color-danger);
}

.look-list__where {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.look-list__arrow {
  width: 14px;
  height: 14px;
  color: var(--color-icon);
}

.look-list__empty {
  margin: 0;
  padding: var(--space-xs) 0;
  color: var(--color-text-muted);
}

/* A line chart of the Machine console: one SVG as wide in units as in pixels, so its labels keep their size, a hairline grid, thin lines, and a readout beside the crosshair. */
.chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
  margin: 0;
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.chart__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-s);
}

.chart__title {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-0);
  font-weight: 600;
}

.chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  margin: 0;
  padding: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  list-style: none;
}

.chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}

/* A short stroke of the line's colour, never a filled box: it keys a line */
.chart__key {
  flex: none;
  width: 12px;
  height: 2px;
  border-radius: 1px;
}

.chart__key--1 {
  background: var(--color-chart-1);
}

.chart__key--2 {
  background: var(--color-chart-2);
}

/* The plot takes the focus for the arrow keys; the ring sits inside, clear of the next card */
.chart__plot {
  --chart-tip-x: 1;

  position: relative;
  border-radius: var(--radius-s);
}

.chart__plot:focus-visible {
  outline-offset: 2px;
}

.chart__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart__gridline {
  stroke: var(--color-border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* Tabular figures, so the numbers of one axis line up */
.chart__label {
  fill: var(--color-text-subtle);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.chart__label--y {
  text-anchor: end;
  dominant-baseline: middle;
}

.chart__label--x {
  text-anchor: middle;
}

.chart__area {
  fill: var(--color-chart-1-wash);
}

.chart__line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart__line--1 {
  stroke: var(--color-chart-1);
}

.chart__line--2 {
  stroke: var(--color-chart-2);
}

.chart__cursor {
  stroke: var(--color-border-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* A ring of the surface around each dot keeps it clear where it crosses a line */
.chart__dot {
  stroke: var(--color-surface);
  stroke-width: 2;
}

.chart__dot--1 {
  fill: var(--color-chart-1);
}

.chart__dot--2 {
  fill: var(--color-chart-2);
}

/* Beside the crosshair, on the side with more room; it never takes the pointer */
.chart__tip {
  position: absolute;
  top: 0;
  left: calc(var(--chart-tip-x) * 100%);
  translate: var(--space-s) 0;
  display: grid;
  gap: var(--space-3xs);
  min-width: max-content;
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-raised);
  pointer-events: none;
}

.chart__tip--left {
  translate: calc(-100% - var(--space-s)) 0;
}

.chart__tip-time {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.chart__tip-row {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  margin: 0;
  font-size: var(--step--1);
}

/* The value leads, the line's name follows */
.chart__tip-value {
  color: var(--color-text);
  font-weight: 600;
}

.chart__tip-label {
  color: var(--color-text-muted);
}

/* Over the empty axes of a range the machine has no samples of yet */
/* What the time axis is in, the server's zone: under the axis, at its end */
.chart__axis-title {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  text-align: end;
}

.chart__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  pointer-events: none;
}

/* A section's bar, in the header of the manage panel and the console while the section is open: its tabs, its own actions, then how fresh its data is and its Refresh in one group, always last. */
.section-bar {
  display: flex;
  /* The room between the section's name and the header's end, its actions and its Refresh at the end of it */
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-xs) var(--space-s);
  min-width: 0;
}

/*
 * A section with tabs: they stand at the bar's start, where the section's name ends, the
 * header's whole height with the active one's line on its lower edge, the rest at its end.
 * What does not fit is cut here rather than drawn under the header's end, where a press on it
 * met another button.
 */
.section-bar--tabs {
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: space-between;
  gap: var(--space-m);
  overflow: hidden;
}

.section-bar--tabs > .section-bar__group {
  align-self: center;
}

.section-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* How fresh the data is and the Refresh that renews it, in one frame, so the time plainly belongs to the button (decided 2026-10-22) */
.section-bar__group {
  display: inline-flex;
  align-items: stretch;
  height: var(--size-control-l);
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
}

/* "Refreshed 3 min ago": the moment, its zone and how the data comes about in its tooltip, which the focus reaches too */
.section-bar__fresh {
  display: flex;
  align-items: center;
  margin: 0;
  padding-inline: var(--space-s);
  border-inline-end: 1px solid var(--color-border-strong);
  background: var(--color-surface-hover);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  white-space: nowrap;
}

/* No time to tell: the Refresh stands alone in the frame */
.section-bar__fresh:has(> .section-bar__fresh-text:empty) {
  display: none;
}

.section-bar__fresh--failed {
  color: var(--color-danger);
}

/* The Refresh takes the frame's height and shape: no border or corners of its own inside it */
.section-bar__refresh {
  height: auto;
  border: 0;
  border-radius: 0;
}

/* While it works its arrow turns; the reduced-motion rule of base.css stills it */
.section-bar__refresh[aria-busy="true"] {
  cursor: progress;
}

.section-bar__refresh[aria-busy="true"] .button__icon {
  animation: section-bar-turn 1s linear infinite;
}

@keyframes section-bar-turn {
  to {
    rotate: 1turn;
  }
}

/* On a phone (manage.css's breakpoint) the tabs and the Refresh do not fit one row: the Refresh goes below, at the end */
@media (width < 600px) {
  .section-bar--tabs {
    flex-wrap: wrap;
    row-gap: var(--space-xs);
  }

  .section-bar--tabs > .section-bar__group {
    margin-inline-start: auto;
  }
}

/* What waits for a decision before anything else on the page, across its width: the firewall's change that wants its confirmation. */
.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--color-border-strong);
  border-inline-start-width: 4px;
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
}

/*
 * What a section says above its content, only while it has something to say: what went wrong
 * while its data was read, what it waits for, why it has little to show ("Root's part is not
 * set up"). One line of words without a title or actions; the section-note of the console and
 * the builder's status lines before #101 (M5).
 */
.banner--note {
  display: block;
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-0);
}

.banner--note:empty {
  display: none;
}

/* Waits for the operator, in the colour of what waits */
.banner--pending {
  border-color: var(--color-pending);
  background: var(--color-pending-muted);
}

.banner__icon {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--color-pending);
}

.banner__text {
  display: grid;
  flex: 1 1 20rem;
  gap: var(--space-3xs);
}

.banner__title {
  margin: 0;
  font-size: var(--step-0);
  font-weight: 600;
}

.banner__line {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.banner__countdown {
  display: grid;
  justify-items: end;
  margin: 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  line-height: 1.2;
}

/* Tabular figures, so the seconds do not make the line jump */
.banner__count {
  color: var(--color-pending);
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* Something is wrong until somebody acts: a reboot the server needs */
.banner--danger {
  border-color: var(--color-danger);
  background: var(--color-danger-muted);
}

.banner--danger > .banner__icon {
  color: var(--color-danger);
}

/* Something goes on now: the action that runs */
.banner--running {
  border-color: var(--color-pending);
  background: var(--color-pending-muted);
}

/* Cards of one kind side by side in equal columns, as many as fit, so a short card does not stretch across a whole row. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: var(--space-m);
}

/* Two wide cards side by side, such as two tables; one under the other where there is no room */
.card-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr));
}

/* Summary cards are small: more of them to a row, closer together */
.card-grid--summary {
  --summary-card-min: 10rem;
  grid-template-columns: repeat(auto-fit, minmax(min(var(--summary-card-min), 100%), 1fr));
  gap: var(--space-s);
}

/*
 * Four cards stand across or two by two, five across or three and two, never one alone on
 * a second row. The track's least width switches on the row's width without a container
 * query: the second term of min() is hugely positive below the width all the cards need
 * and negative above it, and the 1px keeps the shared tracks from rounding out of the row.
 */
.card-grid--summary:has(> :nth-child(4):last-child) {
  grid-template-columns: repeat(auto-fit, minmax(min(max(var(--summary-card-min), min(calc(50% - var(--space-s) / 2 - 1px), calc((4 * var(--summary-card-min) + 3 * var(--space-s) - 100%) * 1000))), 100%), 1fr));
}

.card-grid--summary:has(> :nth-child(5):last-child) {
  grid-template-columns: repeat(auto-fit, minmax(min(max(var(--summary-card-min), min(calc(100% / 3 - var(--space-s) * 2 / 3 - 1px), calc((5 * var(--summary-card-min) + 4 * var(--space-s) - 100%) * 1000))), 100%), 1fr));
}

/* Settings cards in rows of two, each as tall as the one beside it, at a width a form reads well at; one under the other where there is no room */
.card-grid--pairs {
  grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr));
  max-width: 1040px;
}

/* A build of elpresso by its commit, its full name and when it was built in the tooltip; the new one in the colour of what waits. */
.build {
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
  white-space: nowrap;
}

/* The build an update would install */
.build--new {
  color: var(--color-pending);
  font-weight: 600;
}

/* The arrow from the build that runs to the one that would come */
.build__arrow {
  width: 14px;
  height: 14px;
  color: var(--color-text-subtle);
  vertical-align: middle;
}

/* A card of settings in four parts, head, description, body and the foot, the only place it saves: the Machine console's parts and the manage panel's settings. */
.guard-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  min-width: 0;
  padding: var(--space-m);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
}

/* The icon, the name and the standing; the switch across at the end */
.guard-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.guard-card__icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

.guard-card__title {
  margin: 0;
  font-size: var(--step-0);
  font-weight: 600;
  /* A summary card focuses the heading; the scroll stops short of the section's edge */
  scroll-margin-block-start: var(--space-l);
}

.guard-card__title:focus {
  outline: none;
}

.guard-card__title:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

/* The part's switch stands at the end of its head, across from the name. */
.guard-card__switch {
  margin-inline-start: auto;
}

/* Who manages the part, across from its name and before its switch */
.guard-card__manager {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-inline-start: auto;
}

.guard-card__manager-label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.guard-card__manager + .guard-card__switch {
  margin-inline-start: var(--space-s);
}

/* A fact about the part across from its name: "Next run tomorrow at 03:00" */
.guard-card__fact {
  margin-inline-start: auto;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* A control across from the name that picks what the card shows: the history's range, the processes' measure */
.guard-card__aside {
  margin-inline-start: auto;
}

/* A row above what the body shows, as a table's toolbar: what to show on the left, how much on the right (a fact) */
.guard-card__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

/* Where a table's search field stands, as wide as it */
.guard-card__select {
  flex: 1 1 12rem;
  width: auto;
  max-width: 20rem;
}

.guard-card__fact + .guard-card__switch,
.guard-card__fact:not(:empty) + .guard-card__aside {
  margin-inline-start: var(--space-s);
}

/* One line about the part */
.guard-card__description {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Settings, tables and tabs; it takes the card's height so the foot stands at the bottom of a row of cards */
.guard-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-s);
  min-width: 0;
}

/* A card that takes the height the section has left, its body scrolling inside: the log of the Logs section */
.guard-card--fill {
  flex: 1;
  min-height: 0;
}

.guard-card--fill .guard-card__body {
  min-height: 0;
}

.guard-card__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-s);
}

.guard-card__field {
  display: grid;
  gap: var(--space-2xs);
}

/* Fields of one setting in a row, far enough apart to read as several */
.guard-card__fields--wide {
  align-items: start;
  gap: var(--space-s) var(--space-l);
}

/* Numbers with their unit side by side: 7 days 4 weeks 3 months */
.guard-card__units {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.guard-card__unit {
  margin-inline-end: var(--space-xs);
  color: var(--color-text);
  font-size: var(--step-0);
}

/* A value that is no field, as tall as the fields beside it */
.guard-card__value {
  display: flex;
  align-items: center;
  min-height: var(--size-control-m);
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-0);
}

.guard-card__label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* A field's name with its ⓘ, and a fact about it across at the end ("6 of 8") */
.guard-card__label-row {
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
  min-height: 18px;
}

/* The ⓘ after a name, whose tooltip says what the name leaves out (addCardTips) */
.guard-card__info {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-subtle);
  cursor: help;
}

.guard-card__info:hover,
.guard-card__info:focus-visible {
  color: var(--color-accent-text);
}

.guard-card__info-icon {
  width: 15px;
  height: 15px;
}

.guard-card__input {
  max-width: 220px;
}

.guard-card__input--number {
  max-width: 96px;
}

/* A count of two digits */
.guard-card__input--count {
  width: 64px;
}

.guard-card__input--code {
  font-family: var(--font-code);
}

/* A box and its words, the whole of it the click target */
.guard-card__check {
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: var(--space-xs);
  color: var(--color-text);
  font-size: var(--step-0);
  cursor: pointer;
}

.guard-card__box {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-accent-line);
}

.guard-card__box:focus-visible {
  outline-offset: 2px;
}

/* A fact the settings rest on, framed in the body: who has a key, when the updates last ran */
.guard-card__note {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.guard-card__note-icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--color-text-subtle);
}

/* What a switch turns on, one effect a line */
.guard-card__list {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.guard-card__item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--step-0);
}

.guard-card__item-icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--color-live);
}

/* What is not in force: plain bullets, since a green tick would read as on */
.guard-card__list--off {
  padding-inline-start: var(--space-m);
  color: var(--color-text-muted);
  list-style: disc;
}

.guard-card__list--off .guard-card__item {
  display: list-item;
}

.guard-card__list--off .guard-card__item-icon {
  display: none;
}

.guard-card__problem {
  margin: 0;
  color: var(--color-danger);
  font-size: var(--step--1);
}

.guard-card__problem:empty {
  display: none;
}

/* A table inside a card takes the card's width */
.guard-card__table {
  min-width: 0;
}

/* The settings few people change, folded away under the table */
.guard-card__more-title {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--size-control-l);
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
}

/* What the folded settings are now, so they need not be opened to be read */
.guard-card__more-summary {
  color: var(--color-text-subtle);
  font-weight: 400;
}

.guard-card__more > .guard-card__fields {
  padding-block: var(--space-xs) var(--space-s);
}

/* A switch with its words, as tall as the selects beside it */
.guard-card__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  height: var(--size-control-m);
  color: var(--color-text);
  font-size: var(--step--1);
}

/* The figures of a part beside a tool that asks about one address */
.guard-card__overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 26rem);
  gap: var(--space-s);
}

/* Four figures in one framed row, the number large */
.guard-card__figures {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.guard-card__figure {
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
  padding: var(--space-xs) var(--space-m);
}

.guard-card__figure + .guard-card__figure {
  border-inline-start: 1px solid var(--color-border);
}

.guard-card__figure-value {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  /* A long value, an email address, wraps inside its column instead of running into the next */
  overflow-wrap: anywhere;
}

.guard-card__figure-words {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* One address asked about, and what the server does with it */
.guard-card__lookup {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.guard-card__lookup-row {
  display: flex;
  gap: var(--space-xs);
}

.guard-card__lookup-row > .guard-card__input {
  flex: 1;
  max-width: none;
}

.guard-card__lookup-answer {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* An address the browser's own check refuses */
.guard-card__lookup-answer--bad {
  color: var(--color-danger);
}

.guard-card__lookup-answer:empty {
  display: none;
}

/* The parts of a card with many, under its figures */
.guard-card__tabs {
  border-bottom: 1px solid var(--color-border);
}

.guard-card__tab {
  height: var(--size-control-l);
}

.guard-card__panel {
  display: grid;
  gap: var(--space-s);
  min-width: 0;
}

/* The foot: what waits on the left, Install, Discard and Save on the right */
.guard-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
  padding-block-start: var(--space-s);
  border-top: 1px solid var(--color-border);
}

/* Something waits to be saved: the foot takes the colour of what waits */
.guard-card__foot--changed {
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-s);
  border: 1px solid var(--color-pending);
  border-radius: var(--radius-m);
  background: var(--color-pending-muted);
}

.guard-card__foot-words {
  display: grid;
  flex: 1 1 14rem;
  align-content: center;
  gap: var(--space-3xs);
  /* As tall as a button, so a foot without one lines up with its neighbours */
  min-height: var(--size-control-l);
}

.guard-card__foot-text {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

.guard-card__foot--changed .guard-card__foot-text {
  color: var(--color-text);
  font-weight: 600;
}

/* A dot before what waits, so the state is not told by the colour alone */
.guard-card__foot--changed .guard-card__foot-text::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: var(--space-xs);
  border-radius: 50%;
  background: var(--color-pending);
}

.guard-card__foot-detail {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.guard-card__foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-inline-start: auto;
}

.guard-card__installs {
  display: contents;
}

/* A heading inside a card's body, above a table of its own */
.guard-card__subtitle {
  margin: 0;
  font-size: var(--step-0);
  font-weight: 600;
}

/* A figure that is a word rather than a count: a version, a name */
.guard-card__figure-value--small {
  font-size: var(--step-0);
}

/* A field with the arrow that shows every suggestion inside its end, a zone's (#101, B3): the arrow is placed against it */
.guard-card__combo {
  position: relative;
  max-width: 320px;
}

/* The widths every picture is made in: one chip a width with its ✕, sorted by themselves, and Add width, which becomes a field while a width is typed */
.width-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
}

.width-chips__list {
  display: contents;
  margin: 0;
  padding: 0;
  list-style: none;
}

.width-chips__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  height: var(--size-control-m);
  padding-inline: var(--space-xs) var(--space-3xs);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
  font-family: var(--font-code);
  font-size: var(--step-0);
}

/* A width not saved yet, in the colour of what waits */
.width-chips__chip--new {
  border-color: var(--color-pending);
  background: var(--color-pending-muted);
}

.width-chips__remove {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.width-chips__remove:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.width-chips__remove[aria-disabled="true"] {
  color: var(--color-text-subtle);
  cursor: not-allowed;
}

.width-chips__remove:focus-visible,
.width-chips__add:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 1px;
}

.width-chips__icon {
  width: 12px;
  height: 12px;
}

.width-chips__add {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  height: var(--size-control-m);
  padding-inline: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--step-0);
  font-weight: 600;
  cursor: pointer;
}

.width-chips__add:hover {
  background: var(--color-surface-hover);
}

.width-chips__add[aria-disabled="true"] {
  color: var(--color-text-subtle);
  cursor: not-allowed;
}

.width-chips__add-icon {
  width: 14px;
  height: 14px;
}

/* The width being typed, as wide as four digits and a little */
.width-chips__input {
  width: 7rem;
  height: var(--size-control-m);
  font-family: var(--font-code);
}

/* Entries typed as chips, each with its ✕, and the input for the next after them, all in one framed field: the console's time servers. */
.chip-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--size-control-l);
  padding: var(--space-3xs) var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-surface);
}

.chip-field:focus-within {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -1px;
}

.chip-field__list {
  display: contents;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-field__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  min-height: var(--size-control-s);
  padding-inline: var(--space-xs) var(--space-3xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.chip-field__value {
  overflow-wrap: anywhere;
}

.chip-field__remove {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--color-text-subtle);
  cursor: pointer;
}

.chip-field__remove:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.chip-field__remove:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -2px;
}

.chip-field__icon {
  width: 12px;
  height: 12px;
}

/* The input takes the rest of the line, its own frame the field's */
.chip-field__input {
  flex: 1 1 8rem;
  min-width: 8rem;
  height: var(--size-control-s);
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step-0);
}

.chip-field__input:focus-visible {
  outline: none;
}

/* A number on a slider, the slider for the pointer and the field beside it for the keys and the exact value */
.range-field {
  display: flex;
  align-items: start;
  gap: var(--space-s);
}

.range-field__slider {
  display: grid;
  flex: 1;
  gap: var(--space-3xs);
  min-width: 0;
}

.range-field__range {
  width: 100%;
  height: var(--size-control-m);
  margin: 0;
  accent-color: var(--color-accent-line);
  cursor: pointer;
}

/* What each end of the slider means */
.range-field__ends {
  display: flex;
  justify-content: space-between;
  gap: var(--space-s);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

.range-field__number {
  flex: none;
  width: 4.5rem;
  font-family: var(--font-code);
}

/* The formats a picture is made in: a row each with its switch, its name and what it does, and on the right who shows it and what makes it */
.format-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.format-list__row {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  padding-block: var(--space-xs);
  border-top: 1px solid var(--color-border);
}

.format-list__row:first-child {
  border-top: 0;
  padding-block-start: 0;
}

/* As wide as the badge Always, so the names stand under each other */
.format-list__control {
  display: flex;
  flex: none;
  width: 4.25rem;
}

.format-list__text {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.format-list__name {
  font-size: var(--step-0);
  font-weight: 600;
}

.format-list__what {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* A format whose encoder the server lacks: why, in the colour of what waits */
.format-list__what--missing {
  color: var(--color-pending);
}

.format-list__facts {
  display: grid;
  flex: none;
  gap: 2px;
  justify-items: end;
  text-align: end;
}

.format-list__browsers {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.format-list__encoder {
  color: var(--color-text-subtle);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.format-list__encoder--missing {
  color: var(--color-pending);
}

/* What one kind of files takes against its quota: the figure, one bar of its parts in their tones, a legend naming each, and a note once it is nearly full */
.storage-meter {
  display: grid;
  gap: var(--space-2xs);
}

.storage-meter__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-s);
}

.storage-meter__label {
  font-size: var(--step-0);
  font-weight: 600;
}

.storage-meter__value {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Three quarters used is worth a look, nine tenths worth acting on, as the stat tiles say */
.storage-meter__value--high {
  color: var(--color-pending);
}

.storage-meter__value--full {
  color: var(--color-danger);
}

/* The track is the hairline colour, so the parts read across the whole quota */
.storage-meter__bar {
  display: flex;
  gap: 1px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-border);
}

.storage-meter__part {
  flex: none;
  width: var(--storage-meter-share, 0%);
  min-width: 2px;
  height: 100%;
}

.storage-meter__part--1,
.storage-meter__dot--1 {
  background: var(--color-category-blue);
}

.storage-meter__part--2,
.storage-meter__dot--2 {
  background: var(--color-category-violet);
}

.storage-meter__part--3,
.storage-meter__dot--3 {
  background: var(--color-category-green);
}

.storage-meter__part--4,
.storage-meter__dot--4 {
  background: var(--color-category-orange);
}

.storage-meter__part--5,
.storage-meter__dot--5 {
  background: var(--color-text-subtle);
}

.storage-meter__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs) var(--space-s);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.storage-meter__key {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}

.storage-meter__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.storage-meter__bytes {
  color: var(--color-text);
}

.storage-meter__note {
  margin: 0;
  color: var(--color-pending);
  font-size: var(--step--1);
}

/* Where the pictures' sizes stand, with Make all again beside it, and a bar while the worker makes them; at the card's foot, level with the Save of the card beside it */
.remake {
  display: grid;
  gap: var(--space-xs);
  margin-block-start: auto;
  padding-block-start: var(--space-s);
  border-top: 1px solid var(--color-border);
}

.remake__row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.remake__icon {
  display: grid;
  flex: none;
  place-items: center;
  color: var(--color-text-subtle);
}

.remake__glyph {
  width: 16px;
  height: 16px;
}

.remake--ready .remake__icon {
  color: var(--color-live);
}

.remake--working .remake__icon {
  color: var(--color-accent-text);
}

.remake--failed .remake__icon {
  color: var(--color-danger);
}

.remake__words {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.remake__title {
  margin: 0;
  font-size: var(--step-0);
}

.remake__detail {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

.remake__detail:empty {
  display: none;
}

/* An on/off setting with a value of its own: the switch and its name on the left, the value it takes on the right, quiet while the switch is off */
.setting-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-s);
}

.setting-row__name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--step-0);
}

.setting-row__label {
  cursor: pointer;
}

.setting-row__value {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.setting-row__value:has(:disabled) {
  opacity: 0.55;
}

.setting-row__input {
  width: 5.5rem;
  font-family: var(--font-code);
}

/* The open ports of the machine's overview inside its table: the counts in the card's head, the port, from where it answers, and how fail2ban guards SSH. */

/* The counts across from the card's name: the public ones in the accent, since they are what a look is for */
.port-list__counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-inline-start: auto;
}

.port-list__count {
  padding: var(--space-3xs) var(--space-xs);
  border-radius: 999px;
  background: var(--color-surface-hover);
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 600;
}

.port-list__count--open {
  background: var(--color-accent-muted);
  color: var(--color-accent-text);
}

/* The number in code type, as large as the names beside it */
.port-list__port {
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step-0);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.port-list__reach {
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  white-space: nowrap;
}

.port-list__reach--open {
  color: var(--color-accent-text);
}

/* The guard's line stands at the foot of the card, whatever the ports above take */
.port-list__guard {
  margin-block-start: auto;
}

.port-list__icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--color-live);
}

.port-list__guard--off .port-list__icon {
  color: var(--color-pending);
}

.port-list__guard-text {
  flex: 1;
  min-width: 0;
}

/* The way to Protection where SSH is not guarded, a link in the look of the text */
.port-list__guard-link {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* The Heartbeat and Paired servers cards of the console's Mail alerts: the call's status lines, this server's addresses to copy and a paired server's warnings. */

.heartbeat__status {
  display: grid;
  gap: var(--space-3xs);
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.heartbeat__status--problem {
  color: var(--color-danger);
}

.heartbeat__facts {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
  font-size: var(--step--1);
}

.heartbeat__facts-title {
  margin: 0;
  color: var(--color-text);
  font-weight: 600;
}

.heartbeat__facts-note {
  margin: 0;
  color: var(--color-text-muted);
}

/* One grid for every fact, so the values stand in a column whatever the widest term is */
.heartbeat__list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2xs) var(--space-s);
  margin: 0;
}

.heartbeat__fact {
  display: contents;
}

.heartbeat__fact-term {
  color: var(--color-text-muted);
}

.heartbeat__fact-value {
  font-family: var(--font-code);
  overflow-wrap: anywhere;
}

.data-table__meta.heartbeat__call--failed {
  color: var(--color-danger);
}

.heartbeat__warning {
  display: block;
  margin-block-start: var(--space-3xs);
  color: var(--color-danger);
  font-size: var(--step--1);
}

/* The busiest processes of the machine's overview inside their table: elpresso's mark beside a name, and the measure the switch picked as a bar beside its value. */

/* elpresso's own, the website a builder serves: a mark in the accent beside the name */
.process-list__tag {
  flex: none;
  padding: 0 var(--space-xs);
  border-radius: 999px;
  background: var(--color-accent-muted);
  color: var(--color-accent-text);
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1.4;
}

/* The bar takes the room the column has, the value keeps its own */
.process-list__measure {
  display: grid;
  grid-template-columns: minmax(4rem, 1fr) 5.5rem;
  align-items: center;
  gap: var(--space-s);
  min-width: 12rem;
}

/* The memory and, quiet under it, its share of all the server has, both at the column's end */
.process-list__memory {
  display: grid;
  justify-items: end;
  white-space: nowrap;
}

.process-list__share {
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

/* A share of the most any process holds, in the history's first colour on the hairline track, as the tiles' meters are */
.process-list__bar {
  --process-list-share: 0;

  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--color-border);
}

.process-list__fill {
  display: block;
  width: calc(var(--process-list-share) * 100%);
  height: 100%;
  border-radius: inherit;
  background: var(--color-chart-1);
}

.process-list__value {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  text-align: end;
  white-space: nowrap;
}

/* The rows of Website → Consent's cards: a service or a category, its head line and its fields. */
.service-rows {
  display: grid;
  gap: var(--space-s);
}

.service-rows__row {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

/* A service found on the pages and not set up: one line, the way to set it up at its end */
.service-rows__row--found {
  border-style: dashed;
}

.service-rows__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
}

.service-rows__name {
  color: var(--color-text);
  font-weight: 600;
}

.service-rows__meta {
  flex: 1 1 12rem;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.service-rows__title {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-0);
  font-weight: 600;
}

.service-rows__empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Add a service: the catalogue and the button, side by side */
.service-rows__add {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}

.service-rows__pick {
  flex: 1 1 14rem;
  min-width: 0;
}

/* The security score: the number large with how it moved, the checks counted, and the score of the last days as bars. */
.score {
  --score-bar: 0;

  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-m) var(--space-xl);
}

.score__value {
  display: grid;
  gap: var(--space-3xs);
}

.score__number {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-3);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1;
}

.score__of {
  margin-inline-start: var(--space-2xs);
  color: var(--color-text-muted);
  font-size: var(--step-1);
  font-weight: 400;
}

.score__trend {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.score__trend--up {
  color: var(--color-live);
}

.score__trend--down {
  color: var(--color-danger);
}

.score__figures {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-l);
  margin: 0;
}

.score__figure {
  display: flex;
  flex-direction: column-reverse;
}

.score__figure-value {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.score__figure-value--bad {
  color: var(--color-danger);
}

.score__figure-words {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.score__history {
  display: grid;
  gap: var(--space-2xs);
  margin-inline-start: auto;
}

.score__bars {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Its height is the day's score above 50, set as --score-bar from the script */
.score__bar {
  width: 12px;
  height: max(2px, calc(var(--score-bar) * 1%));
  border-radius: 2px;
  background: var(--color-border-strong);
}

.score__bar--today {
  background: var(--color-accent-line);
}

.score__caption {
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

/* The way to what the score rests on, in the card's head */
.score__about {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  margin-inline-start: auto;
  padding: var(--space-3xs) var(--space-2xs);
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--step--1);
  cursor: help;
}

.score__about:hover {
  color: var(--color-text);
}

.score__about-icon {
  width: 14px;
  height: 14px;
}

/* One choice out of a few as a row of buttons, a radio group in the look of the list filters. */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-3xs);
  justify-self: start;
  padding: var(--space-3xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-workspace);
}

.segmented__option {
  height: var(--size-control-s);
  padding-inline: var(--space-s);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 500;
  cursor: pointer;
}

/* The hover brightens what is not chosen; a chosen option keeps its colour under the pointer */
.segmented__option:hover:not(:disabled, [aria-checked="true"], [aria-pressed="true"]) {
  color: var(--color-text);
}

.segmented__option[aria-checked="true"] {
  background: var(--color-surface-raised);
  color: var(--color-text);
}

/* Checked in the colour of its badge: Draft in the draft colour, Public in the live one */
.segmented__option--draft[aria-checked="true"] {
  background: var(--color-draft-muted);
  color: var(--color-draft);
}

.segmented__option--live[aria-checked="true"] {
  background: var(--color-live-muted);
  color: var(--color-live);
}

/* A small group in a card's head, as tall as a badge beside it */
.segmented--s {
  padding: 2px;
  gap: 2px;
}

.segmented--s .segmented__option {
  height: 20px;
  padding-inline: var(--space-xs);
}

/* A toggle of several that may each be on, the days of a schedule: on is green, off stays plain */
.segmented__option[aria-pressed="true"] {
  border-color: var(--color-live);
  background: var(--color-live-muted);
  color: var(--color-live);
}

/* The focus ring inside the group, so it is not cut off by the neighbour */
.segmented__option:focus-visible {
  outline-offset: -1px;
}

.segmented__option:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}


/* A field that chooses a picture: a tile with a pencil, the picture's facts beside it, and a small switch in the head where a place allows an address or an entry's field too */

.picture-field {
  display: grid;
  gap: var(--space-2xs);
  min-width: 0;
}

/* The name and the switch on one line, the switch on a line of its own where the sidebar is too narrow */
.picture-field__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3xs) var(--space-xs);
  min-height: 24px;
}

.picture-field__label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.picture-field__ways {
  flex: none;
}

.picture-field__row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: var(--space-xs);
  align-items: center;
  border-radius: var(--radius-m);
}

/* Empty, the words beside the tile open the picker as the tile does */
.picture-field__row--empty {
  cursor: pointer;
}

/* A file dragged over the row: where it goes when dropped */
.picture-field__row--dropping {
  outline: 2px dashed var(--color-accent-line);
  outline-offset: 3px;
}

/* The tile: dashed with a pencil while it waits for a picture, the picture once it has one */
.picture-field__tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  overflow: hidden;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-surface);
  color: var(--color-text-subtle);
  font: inherit;
}

/* The tile that opens the picker */
.picture-field__tile--pick {
  cursor: pointer;
}

.picture-field__tile--pick:hover:not(:disabled) {
  border-color: var(--color-accent-line);
  color: var(--color-text);
}

.picture-field__tile:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.picture-field__tile:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.picture-field__tile--filled {
  border-style: solid;
  border-color: var(--color-border);
}

/* An entry's field: the braces in the colour of templates */
.picture-field__tile--entry {
  color: var(--color-template);
}

.picture-field__tile-icon {
  width: 18px;
  height: 18px;
}

.picture-field__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The pencil over a chosen picture, on hover and on focus */
.picture-field__pen {
  position: absolute;
  inset-block-end: 3px;
  inset-inline-end: 3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-s);
  background: var(--color-surface);
  color: var(--color-text);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.picture-field__tile:hover .picture-field__pen,
.picture-field__tile:focus-visible .picture-field__pen {
  opacity: 1;
}

.picture-field__pen-icon {
  width: 12px;
  height: 12px;
}

.picture-field__facts {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.picture-field__name {
  overflow: hidden;
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picture-field__name--empty {
  color: var(--color-text-muted);
  font-family: inherit;
}

.picture-field__name--gone,
.picture-field__meta--gone {
  color: var(--color-pending);
}

/* The facts wrap rather than being cut, since the sidebar is narrow */
.picture-field__meta {
  color: var(--color-text-muted);
  font-size: var(--step--1);
  overflow-wrap: anywhere;
}

.picture-field__input,
.picture-field__select {
  width: 100%;
  min-width: 0;
  height: var(--size-control-s);
  padding-inline: var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-workspace);
  color: var(--color-text);
  font: inherit;
  font-size: var(--step--1);
}

.picture-field__input {
  font-family: var(--font-code);
}

.picture-field__input:focus-visible,
.picture-field__select:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: -1px;
}

/* The address the pages name a picture by, as code */
.picture-field__meta--address {
  font-family: var(--font-code);
}

/* The bar above the canvas in the consent mode: the element edited, the page behind it, and a word while it holds nothing. Named neutrally, since content blockers hide an element of the class consent-bar (Fanboy Annoyances, which Brave applies) */
.layer-bar {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

.layer-bar[hidden] {
  display: none;
}

/* The cookie in the switcher's button says the consent mode, in its colour */
.layer-bar__icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--color-consent);
}

/* The element deleted in the structure: where to get it back */
.layer-bar__hint {
  color: var(--color-consent);
  font-size: var(--step--1);
  white-space: nowrap;
}

/* What a backup schedule keeps: one line, and folded open a timeline of the copies kept with a lane per day, week and month, and their list. */
.retention {
  display: grid;
  gap: var(--space-s);
  min-width: 0;
}

.retention__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-m);
}

.retention__summary {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-0);
  font-variant-numeric: tabular-nums;
}

.retention__detail {
  display: grid;
  gap: var(--space-s);
  min-width: 0;
}

.retention__note {
  max-width: 70ch;
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.retention__chart {
  overflow-x: auto;
}

.retention__timeline {
  display: block;
  width: 100%;
  min-width: 480px;
  height: auto;
}

.retention__grid {
  stroke: var(--color-border);
}

.retention__tick {
  stroke: var(--color-border);
  stroke-dasharray: 2 3;
}

.retention__lane,
.retention__axis {
  fill: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: var(--step--1);
}

.retention__lane {
  fill: var(--color-text);
  font-weight: 600;
}

.retention__dot--made {
  fill: var(--color-text-faint);
}

.retention__dot--day {
  fill: var(--color-accent-line);
}

.retention__dot--week {
  fill: var(--color-info);
}

.retention__dot--month {
  fill: var(--color-live);
}

.retention__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-m);
  margin: 0;
  padding: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  list-style: none;
}

.retention__key {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.retention__swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.retention__swatch--made {
  background: var(--color-text-faint);
}

.retention__swatch--day {
  background: var(--color-accent-line);
}

.retention__swatch--week {
  background: var(--color-info);
}

.retention__swatch--month {
  background: var(--color-live);
}

.retention__scroll {
  max-height: 16rem;
  overflow: auto;
}

.retention__list {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.retention__head {
  position: sticky;
  inset-block-start: 0;
  padding: var(--space-2xs) var(--space-xs);
  border-block-end: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  font-weight: 600;
  text-align: start;
}

.retention__cell {
  padding: var(--space-2xs) var(--space-xs);
  border-block-end: 1px solid var(--color-border);
  color: var(--color-text);
}

.retention__cell--number {
  font-variant-numeric: tabular-nums;
}

/* What the SMTP servers' list says of a server that failed: the server's own words, in the danger colour. */
.mail-servers__problem {
  color: var(--color-danger);
}

/* Steps one a line: a mark for how each went, what it was, its own words under it and the time it took; a test message's and a job's (#101, B4). */
.step-list {
  display: grid;
  gap: var(--space-xs);
  min-width: 0;
}

.step-list__summary {
  margin: 0;
  color: var(--color-text-strong);
  font-size: var(--step-0);
  font-weight: 600;
}

.step-list__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list__step {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) auto;
  gap: var(--space-xs);
  align-items: baseline;
  padding: var(--space-2xs) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--step-0);
}

.step-list__step:last-child {
  border-bottom: 0;
}

.step-list__mark {
  align-self: center;
  width: 1rem;
  height: 1rem;
  color: var(--color-text-faint);
}

.step-list__step--ok .step-list__mark {
  color: var(--color-live);
}

.step-list__step--failed .step-list__mark {
  color: var(--color-danger);
}

/* The step a job is at now: its mark in the accent, its words strong */
.step-list__step--now .step-list__mark {
  color: var(--color-accent-line);
}

.step-list__step--now .step-list__title {
  font-weight: 600;
}

.step-list__step--waiting .step-list__title {
  color: var(--color-text-muted);
}

.step-list__detail {
  display: block;
  overflow-wrap: anywhere;
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.step-list__time {
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

/* One server's part of a test message that went through several, or one website's of a job. */
.step-list__attempt {
  display: grid;
  gap: var(--space-xs);
  min-width: 0;
}

/* A message as it arrives, subject over its text, with every placeholder filled in: the mail catalogue's preview. */
.mail-preview {
  display: grid;
  gap: var(--space-xs);
  min-width: 0;
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
}

.mail-preview__subject {
  margin: 0;
  color: var(--color-text-strong);
  font-size: var(--step-0);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.mail-preview__text {
  margin: 0;
  padding-top: var(--space-xs);
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mail-preview__places {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-2xs) var(--space-s);
  margin: 0;
  font-size: var(--step--1);
}

.mail-preview__place {
  font-family: var(--font-code);
  color: var(--color-text-strong);
}

.mail-preview__place-words {
  margin: 0;
  color: var(--color-text-muted);
}

/* A list of mail addresses, a row each: the address, what the row chooses beside it, and the way to take it away. */
.address-list {
  display: grid;
  gap: var(--space-xs);
  min-width: 0;
}

.address-list__rows {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.address-list__row {
  display: grid;
  gap: var(--space-3xs);
  min-width: 0;
}

.address-list__line {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

.address-list__input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-code);
}

.address-list__level {
  flex: none;
}

/* What the row is about, a select beside the address */
.address-list__about {
  flex: 0 1 12rem;
  min-width: 6rem;
}

.address-list__problem {
  margin: 0;
  color: var(--color-danger);
  font-size: var(--step--1);
}

.address-list__problem:empty {
  display: none;
}

.address-list__add {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  justify-self: start;
  height: var(--size-control-s);
  padding-inline: var(--space-s);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
}

.address-list__add:hover {
  color: var(--color-text);
}

.address-list__add-icon {
  width: 14px;
  height: 14px;
}

.address-list__room {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The website's security headers: templates and services above the text, its problems by line, the browsers' reports and the versions before. */
.headers-card__start {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: var(--space-m);
}

.headers-card__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.headers-card__services {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

/* The box the code editor fills, absolutely positioned inside it */
.headers-card__editor {
  position: relative;
  height: 20rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.headers-card__problems {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.headers-card__problem {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  font-size: var(--step--1);
  color: var(--color-text);
}

.headers-card__line {
  flex: none;
  color: var(--color-text-muted);
  font-family: var(--font-code);
}

.headers-card__part {
  display: grid;
  gap: var(--space-xs);
  padding-block-start: var(--space-s);
  border-block-start: 1px solid var(--color-border);
}

.headers-card__part-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
}

.headers-card__part-title {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-0);
  font-weight: 600;
  cursor: default;
}

summary.headers-card__part-title {
  cursor: pointer;
}

.headers-card__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.headers-card__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
  padding-block: var(--space-xs);
  border-block-end: 1px solid var(--color-border);
  font-size: var(--step--1);
}

.headers-card__origin {
  font-family: var(--font-code);
  overflow-wrap: anywhere;
}

.headers-card__meta {
  color: var(--color-text-muted);
}

.headers-card__actions {
  display: flex;
  gap: var(--space-2xs);
  margin-inline-start: auto;
}

/* The dialog for one rule of the firewall: what it does, which traffic it fits, and the ufw command it becomes. */
.rule-form {
  display: grid;
  gap: var(--space-m);
}

/* Two fields side by side where there is room, one above the other where there is not */
.rule-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-m);
}

.rule-form__field {
  display: grid;
  align-content: start;
  gap: var(--space-2xs);
  min-width: 0;
}

/* What a field understood, or why it cannot be */
.rule-form__note {
  min-height: 1lh;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

.rule-form__note--ok {
  color: var(--color-live);
}

.rule-form__note--bad {
  color: var(--color-danger);
}

/* One port, two for a range, or a wider one for several */
.rule-form__ports {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.rule-form__port {
  width: 8rem;
}

.rule-form__wide {
  width: 18rem;
  max-width: 100%;
}

.rule-form__dash {
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

/* The interface and the place, folded away: few rules need them */
.rule-form__more {
  display: grid;
  gap: var(--space-m);
  padding-block-start: var(--space-s);
  border-top: 1px solid var(--color-border);
}

.rule-form__summary {
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
}

/* The command root runs, one line that scrolls rather than wraps */
.rule-form__command {
  display: block;
  overflow-x: auto;
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-s);
  background: var(--color-workspace);
  color: var(--code-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
  white-space: pre;
}

/* A rule that may never be reached where it stands */
.rule-form__warn {
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-s);
  background: var(--color-pending-muted);
  color: var(--color-text);
  font-size: var(--step--1);
}

/* Terms and what they say, one under the other: a security check's why, its fix and where its setting lives. */
.fact-list {
  display: grid;
  gap: var(--space-s);
  margin: 0;
}

/* Side by side, where the list folds open under a row of a table */
.fact-list--row {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-s) var(--space-l);
}

/* Side by side, each item's words start at its top, however long its neighbours are */
.fact-list--row > .fact-list__item {
  align-content: start;
}

.fact-list__item {
  display: grid;
  gap: var(--space-3xs);
}

.fact-list__term {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.fact-list__detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

/* Every list of the manage panel as one table: a toolbar, sortable headings, rows with their icon actions. */
.data-table {
  --data-table-menu-top: 0;
  --data-table-menu-left: 0;

  display: grid;
  gap: var(--space-s);
  min-width: 0;
}

/* New on the left, then search and filters, the count, and what a section adds at the end */
.data-table__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.data-table__hint {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.data-table__search {
  position: relative;
  flex: 1 1 12rem;
  max-width: 20rem;
}

.data-table__search-icon {
  position: absolute;
  inset-block: 0;
  inset-inline-start: var(--space-xs);
  width: 16px;
  height: 16px;
  margin-block: auto;
  color: var(--color-text-subtle);
  pointer-events: none;
}

.data-table__search-input {
  width: 100%;
  height: var(--size-control-l);
  padding-inline: calc(var(--space-xs) + 16px + var(--space-2xs)) var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-workspace);
  color: var(--color-text);
  font: inherit;
  font-size: var(--step-0);
}

.data-table__search-input:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

/* A segmented group of filters: the pressed one is filled, each with how many it keeps */
.data-table__filters {
  display: inline-flex;
  flex: none;
  flex-wrap: wrap;
  max-width: 100%;
  gap: var(--space-3xs);
  padding: var(--space-3xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-workspace);
}

.data-table__filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  height: var(--size-control-s);
  padding-inline: var(--space-xs);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 500;
  cursor: pointer;
}

.data-table__filter:hover {
  color: var(--color-text);
}

.data-table__filter[aria-pressed="true"] {
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.data-table__filter:focus-visible {
  outline-offset: -1px;
}

.data-table__filter-count {
  color: var(--color-text-subtle);
  font-variant-numeric: tabular-nums;
}

/* The count ends the free space, so what a section adds sits at the far end */
.data-table__count {
  margin-inline-start: auto;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Many columns scroll sideways instead of squeezing every value into a narrow stack */
/* Positioned, so the visually hidden labels of its cells scroll and clip with it rather than widen the section */
.data-table__scroll {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.data-table__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-0);
}

/* The heading row on the raised surface, set apart from the section behind and the rows below */
.data-table__head {
  padding: var(--space-xs) var(--space-s);
  border-bottom: 1px solid var(--color-border-strong);
  background: var(--color-surface-raised);
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: start;
  text-transform: uppercase;
  white-space: nowrap;
}

/* A heading that sorts the table: the whole label is the button */
.data-table__sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.data-table__sort:hover {
  color: var(--color-text);
}

.data-table__sort-mark {
  color: var(--color-accent-text);
}

.data-table__row:hover > .data-table__cell {
  background: var(--color-surface-hover);
}

.data-table__row:last-child > .data-table__cell {
  border-bottom: 0;
}

.data-table__cell {
  padding: var(--space-xs) var(--space-s);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

/*
 * A text column gives way before the table scrolls: one line while there is room, two in
 * a narrow panel, then cut short, so a row stays at most two lines high and the actions at
 * the end stay in view. Words stay whole, so the longest one is as narrow as it gets.
 */
.data-table__cell--clip {
  max-width: 18rem;
}

.data-table__clip {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Numbers as narrow as their digits, lined up at the end */
.data-table__head--number,
.data-table__cell--number {
  width: 1%;
  font-variant-numeric: tabular-nums;
  text-align: end;
  white-space: nowrap;
}

.data-table__cell--number {
  color: var(--color-text-muted);
}

.data-table__cell--code {
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

/* As narrow as what it holds: a date, a badge, a thumbnail */
.data-table__head--shrink,
.data-table__cell--shrink {
  width: 1%;
  white-space: nowrap;
}

.data-table__cell--actions {
  width: 1%;
  white-space: nowrap;
}

.data-table__actions {
  justify-content: flex-end;
}

/*
 * The column a row is read by stays at the start while the others scroll past, so a value
 * far to the right still says whose it is. Opaque, or the scrolled columns would show through.
 */
.data-table__head--sticky,
.data-table__cell--sticky {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
}

.data-table__cell--sticky {
  max-width: 22rem;
  background: var(--color-surface);
}

/* The dividing line only while the table scrolls: without columns passing beneath, it marks nothing */
.data-table__scroll--overflowing .data-table__head--sticky,
.data-table__scroll--overflowing .data-table__cell--sticky {
  box-shadow: inset -1px 0 0 var(--color-border);
}

/*
 * A row's actions stay at the end while the table scrolls sideways, so the way to act on a
 * row is never out of sight; not on a phone, where the name and the actions would leave no
 * room between them for the columns passing beneath.
 */
@media (min-width: 600px) {
  .data-table__scroll--overflowing .data-table__cell--actions {
    position: sticky;
    inset-inline-end: 0;
    z-index: 1;
    background: var(--color-surface);
    box-shadow: inset 1px 0 0 var(--color-border);
  }
}

/* A name with its badges on one line and its address or kind below */
.data-table__name {
  display: grid;
  gap: var(--space-3xs);
  min-width: 0;
}

.data-table__name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-xs);
}

.data-table__name-text {
  color: var(--color-text);
  font-weight: 600;
}

/*
 * A long name without spaces breaks anywhere and stops at two lines, so it never widens the
 * table until the row's actions scroll away. Breaking anywhere lets a table shrink the
 * column to a letter while the others keep their words, so the name keeps a width a word
 * can be read at and the table scrolls sideways instead; the width is the name's with its
 * badges, so a badge still stands beside a short name.
 */
.data-table__name,
.data-table__cell > .data-table__name-text,
.data-table__cell > .data-table__name-button {
  min-width: 10rem;
}

.data-table__name-text,
.data-table__name-button {
  display: -webkit-box;
  max-width: min(100%, 24rem);
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* The name as the row's main action: it does what the pencil does */
.data-table__name-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}

.data-table__name-button:hover {
  color: var(--color-accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.data-table__sub {
  overflow: hidden;
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* An address in a text column breaks at its slashes rather than holding the column wide */
.data-table__sub--wrap {
  white-space: normal;
}

/* A placeholder of an address pattern: filled per entry, in the colour of templates */
.data-table__token {
  color: var(--color-template);
}

/* A fact in a cell, quieter than the name: "13 pages", "No frame" */
.data-table__meta {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* A badge and the control that acts on what it names, side by side: the maintenance page's role and its switch */
.data-table__pair {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Two badges that belong together, where something stands and what waits: Live and Changes */
.data-table__badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3xs);
}

/* Longer text, a comment, cut after two lines; the whole text opens on demand */
.data-table__text {
  display: -webkit-box;
  max-width: 40rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: pre-line;
}

.data-table__thumb {
  display: grid;
  /* One track of the tile's own size: in a track sized by its content the picture's height of 100 % would be its own, taller than the tile */
  grid-template: 100% / 100%;
  place-items: center;
  width: 44px;
  height: 32px;
  overflow: hidden;
  border-radius: var(--radius-s);
  background: var(--color-bg);
  color: var(--color-text-subtle);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-transform: uppercase;
}

.data-table__thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A drawing is shown whole: a mark cut at its edges reads as broken */
.data-table__thumb-image--whole,
.data-table__card-image--whole {
  object-fit: contain;
}

.data-table__empty {
  margin: 0;
  padding: var(--space-l);
  color: var(--color-text-muted);
  text-align: center;
}

.data-table__pager {
  display: flex;
  align-items: center;
  gap: var(--space-m);
}

.data-table__pager-label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* Table or grid, at the end of the toolbar */
.data-table__views {
  display: inline-flex;
  flex: none;
  gap: var(--space-3xs);
}

.data-table__views > [aria-pressed="true"] {
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.data-table__checkbox {
  width: var(--space-m);
  height: var(--space-m);
  margin: 0;
  accent-color: var(--color-accent-line);
  cursor: pointer;
}

/* The row its section's inspector shows beside the table, in the colour of the open tab */
/* A row that opens in the inspector wherever it is clicked, not only on its name */
.data-table__row--opens {
  cursor: pointer;
}

.data-table__row--picked > .data-table__cell {
  background: var(--color-surface-hover);
}

/*
 * The row the inspector shows: a line at its start in the accent, short of the row's edges
 * so the table's rounded corner never cuts it, drawn as a picture so it moves no content.
 * The page open in the canvas says so in a badge of its own, so it needs no second line.
 */
.data-table__row--picked > .data-table__cell:first-child {
  background-image: linear-gradient(var(--color-accent-line), var(--color-accent-line));
  background-position: left center;
  background-repeat: no-repeat;
  background-size: 3px calc(100% - var(--space-xs));
}

.data-table__row--selected > .data-table__cell {
  background: var(--color-accent-muted);
}

/*
 * The selected tint is see-through, so the cells that stay put while the others scroll
 * beneath them lay it over the table's surface: the same colour, but opaque.
 */
.data-table__row--selected > .data-table__cell--sticky,
.data-table__row--selected > .data-table__cell--actions {
  background: linear-gradient(var(--color-accent-muted), var(--color-accent-muted)) var(--color-surface);
}

/* What is selected and what can be done to it, between the toolbar and the rows */
/*
 * The toolbar and the selection share one place above the table: both stand in the same cell,
 * so it keeps the height of the higher one and ticking a row moves nothing. The one not in use
 * keeps its room but is invisible (and inert, set by the script).
 */
.data-table__bar {
  display: grid;
}

.data-table__bar > * {
  grid-area: 1 / 1;
  min-width: 0;
}

.data-table__toolbar--covered,
.data-table__selection--away {
  visibility: hidden;
}

/* The selection in the toolbar's place: the count and what can be done to the rows */
.data-table__selection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--size-control-l);
  padding-block: var(--space-3xs);
  padding-inline: var(--space-s) var(--space-3xs);
  border-radius: var(--radius-m);
  background: var(--color-accent-muted);
  box-shadow: inset 0 0 0 1px var(--color-accent-line);
}

/*
 * An action of the selection: lower than the bar, so it sits inside the frame instead of on
 * it, and raised off the tint on the surface of a card, the one thing to press. One that
 * fits none of the selected rows stays flat and recedes.
 */
.data-table__selection-action {
  height: var(--size-control-m);
  padding-inline: var(--space-s);
  border-color: var(--color-border);
  background: var(--color-surface-lifted);
  box-shadow: var(--shadow-button);
}

.data-table__selection-action:hover:not(:disabled, [aria-disabled="true"]) {
  background: var(--color-surface-lifted-hover);
}

.data-table__selection-action.button--danger:hover:not(:disabled) {
  background: var(--color-danger);
}

.data-table__selection-action:disabled {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

/* Clear selection: a way back, not an action on the rows, so it stays quiet */
.data-table__selection-clear {
  height: var(--size-control-m);
  padding-inline: var(--space-s);
  border-color: transparent;
  color: var(--color-text-muted);
}

.data-table__selection-count {
  margin-inline-end: auto;
  color: var(--color-text);
  font-size: var(--step--1);
  font-weight: 600;
}

/* Cards for rows best told apart by eye, as many as fit in a row */
.data-table__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: var(--space-s);
}

.data-table__card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: var(--space-2xs);
  padding-block-end: var(--space-2xs);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

/* A card that opens in the inspector wherever it is clicked, its picture too */
.data-table__card--opens {
  cursor: pointer;
}

.data-table__card:hover {
  border-color: var(--color-border-strong);
}

.data-table__card--selected {
  border-color: var(--color-accent-line);
  background: var(--color-accent-muted);
}

.data-table__card-actions {
  justify-self: end;
  padding-inline: var(--space-2xs);
}

/* The checkbox stands on the picture, where it is found without reading */
.data-table__card-check {
  position: absolute;
  inset-block-start: var(--space-xs);
  inset-inline-start: var(--space-xs);
  z-index: 1;
}

/* Hidden overflow keeps the 4:3: without it a tall picture stretches the box to its own height */
.data-table__card-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text-subtle);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-transform: uppercase;
}

.data-table__card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.data-table__card-text {
  display: grid;
  gap: var(--space-3xs);
  min-width: 0;
  padding-inline: var(--space-xs);
}

.data-table__card-body {
  display: grid;
  gap: var(--space-xs);
  min-width: 0;
}

/* A badge in a card is as wide as its words, not the card */
.data-table__card-badge {
  justify-self: start;
}


/* The Columns button: icon and word, like the one of the entries table */
.data-table__columns {
  flex: none;
}

.data-table__columns-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}

.data-table__columns-icon {
  width: 16px;
  height: 16px;
}

/* The Columns menu, in the top layer under its button; data-table.ts places it */
.data-table__menu {
  position: fixed;
  inset: var(--data-table-menu-top) auto auto var(--data-table-menu-left);
  min-width: 12rem;
  margin: 0;
  padding: var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-raised);
  color: var(--color-text);
}

.data-table__menu-group {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  border: 0;
}

.data-table__menu-title {
  margin-block-end: var(--space-2xs);
  padding: 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-table__menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--step-0);
  cursor: pointer;
}

/* A comment's whole text, once opened */
.data-table__text--full {
  display: block;
  -webkit-line-clamp: none;
}

/* Opens or closes a long text in place */
.data-table__more {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
}

.data-table__more:hover {
  text-decoration: underline;
}

/* ---- An ordered list, the firewall's rules: the place of a row, how it changed, and what no row fits ---- */

/* The place in the order with the grip that moves it */
.data-table__order {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  color: var(--color-text-subtle);
  font-family: var(--font-code);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

/* Dragged with the pointer, moved with the arrow keys while it has the focus */
.data-table__grip {
  cursor: grab;
}

.data-table__row--dragging > .data-table__cell {
  opacity: 0.5;
}

/* Where a dragged row lands: a line above the row under the pointer */
.data-table__row--drop > .data-table__cell {
  box-shadow: inset 0 2px 0 var(--color-accent-line);
}

/* Not saved yet: a line at its start in the colour of what waits */
.data-table__row--new > .data-table__cell:first-child {
  box-shadow: inset 3px 0 0 var(--color-pending);
}

/* Taken away, until the save: faded and struck through, Keep brings it back */
.data-table__row--removed > .data-table__cell {
  opacity: 0.55;
}

.data-table__row--removed .data-table__name-text {
  text-decoration: line-through;
}

/* What no rule fits: the last rows, on the raised surface, set apart by a dashed line */
.data-table__row--rest > .data-table__cell {
  border-top: 1px dashed var(--color-border-strong);
  background: var(--color-surface-raised);
}

.data-table__row--rest + .data-table__row--rest > .data-table__cell {
  border-top: 0;
}

/* A select in a cell, as low as the row's badges */
.data-table__select {
  width: auto;
  min-width: 6.5rem;
  height: var(--size-control-s);
  font-size: var(--step--1);
}

/* Which way a rule works: an arrow and the word */
.data-table__direction {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
  white-space: nowrap;
}

/* An address and what it is, below it */
.data-table__where {
  display: grid;
  gap: var(--space-3xs);
  font-size: var(--step--1);
}

.data-table__where-main {
  color: var(--color-text);
  font-family: var(--font-code);
}

/* Anywhere, this server: a word, not an address */
.data-table__where-word {
  color: var(--color-text);
}

.data-table__where-sub {
  color: var(--color-text-subtle);
}

/* Lower rows for a list of one line a row: less room above and below, the actions smaller */
.data-table--compact .data-table__cell {
  padding-block: var(--space-3xs);
}

/* The first rows of a longer list and Show all, under the table: what is left out on the left, the button on the right */
.data-table__fold {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
}

.data-table__fold-rest {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* What is wrong with a row, under its name */
.data-table__problem {
  color: var(--color-danger);
  font-size: var(--step--1);
}

/* An address in its own column that opens in a new tab, with its arrow */
.data-table__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-decoration: underline;
  text-decoration-color: var(--color-border-strong);
  text-underline-offset: 3px;
}

.data-table__link:hover {
  color: var(--color-accent-text);
  text-decoration-color: currentColor;
}

.data-table__link-icon {
  flex: none;
  width: 12px;
  height: 12px;
  color: var(--color-text-subtle);
}

/* A group of rows, the hosts of one website: its own row above them, folding them away */
.data-table__group-cell {
  padding: var(--space-xs) var(--space-s);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.data-table__group-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
}

/* The group's name, the button that folds it; its own name, so the fold bar under a list (data-table__fold) takes nothing of it */
.data-table__group-fold {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-3xs) var(--space-2xs);
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
}

.data-table__group-fold:hover {
  background: var(--color-surface-hover);
}

.data-table__group-fold-icon {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  transition: rotate var(--duration-fast);
}

.data-table__group-fold[aria-expanded="true"] > .data-table__group-fold-icon {
  rotate: 90deg;
}

.data-table__group-name {
  font-size: var(--step-0);
  font-weight: 600;
}

.data-table__group-space {
  flex: 1;
}

/* A group's own switch and actions at the end of its row, wrapping together */
.data-table__group-end {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-inline-start: auto;
}

/* The way from a group to where its website is looked after */
.data-table__group-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-3xs) var(--space-2xs);
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
}

.data-table__group-link:hover {
  color: var(--color-text);
}

.data-table__group-link-icon {
  width: 12px;
  height: 12px;
}

/* A row folded open shows what it would say in a dialog right under it */
.data-table__row--open > .data-table__cell {
  border-bottom-color: transparent;
  background: var(--color-surface-hover);
}

.data-table__detail-cell {
  padding: var(--space-3xs) var(--space-s) var(--space-m) calc(var(--space-s) + var(--space-l));
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-hover);
}

/* The rest of a group behind a link: "Show 5 more" */
.data-table__rest-cell {
  padding: var(--space-xs) var(--space-s) var(--space-xs) calc(var(--space-s) + var(--space-l));
  border-bottom: 1px solid var(--color-border);
}

/* A row inside a group stands in from its group's row */
.data-table__name-line--indent {
  padding-inline-start: var(--space-l);
}

/* A host's name, in code type as an address is */
.data-table__host {
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
}


/* Inspector: the row a list picked, shown and edited beside the list; it folds to a rail and opens wide in a dialog. */

.inspector {
  --inspector-width: 380px;

  display: flex;
  width: var(--inspector-width);
  min-width: 0;
  min-height: 0;
  border-inline-start: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* Folded, or wide in its dialog: only the rail stands beside the list */
.inspector--folded {
  width: auto;
}

.inspector--folded > .inspector__frame {
  display: none;
}

.inspector__frame {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* The title, what stands beside it, then widen, fold and close */
.inspector__head {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-xs);
  min-height: calc(var(--panel-header-height) + var(--space-xs));
  padding: var(--space-2xs) var(--space-xs) var(--space-2xs) var(--space-m);
  border-bottom: 1px solid var(--color-border);
}

.inspector__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: var(--step-0);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector__extra {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-2xs);
}

.inspector__extra:empty {
  display: none;
}

.inspector__tools {
  display: flex;
  flex: none;
  gap: var(--space-3xs);
}

.inspector__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

/* The form an inspector usually holds: its body scrolls, its foot stays in view */
.inspector__form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

/* It scrolls, so no part is squeezed: an auto row would shrink to its part's least height once the
   parts overflow, and a picture whose width is a share of its box has none of its own. */
.inspector__body {
  display: grid;
  flex: 1;
  grid-auto-rows: max-content;
  align-content: start;
  gap: var(--space-s);
  min-height: 0;
  padding: var(--space-m);
  overflow-y: auto;
}

/* Something to read where nothing is picked yet */
.inspector__note {
  margin: 0;
  color: var(--color-text-muted);
}

/* Delete on the left, what waits, then Discard and Save on the right (layout rule R11) */
.inspector__foot {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-s) var(--space-m);
  border-top: 1px solid var(--color-border);
}

/* Something waits to be saved: the foot takes the colour of what waits */
.inspector__foot--changed {
  background: var(--color-pending-muted);
}

.inspector__foot-text {
  flex: 1 1 6rem;
  margin: 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

.inspector__foot--changed .inspector__foot-text {
  color: var(--color-text);
  font-weight: 600;
}

/* A dot before what waits, so the state is not told by the colour alone */
.inspector__foot--changed .inspector__foot-text::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: var(--space-xs);
  border-radius: 50%;
  background: var(--color-pending);
}

/* Folded: a narrow button down the side that shows the inspector again and names what is in it */
.inspector__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  width: 40px;
  padding: var(--space-s) 0;
  border: 0;
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  cursor: pointer;
}

.inspector__rail:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.inspector__rail:focus-visible {
  outline-offset: -2px;
}

.inspector__rail-icon {
  flex: none;
  width: 16px;
  height: 16px;
}

.inspector__rail-text {
  max-height: 24rem;
  overflow: hidden;
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
  writing-mode: vertical-rl;
}

/* Changes wait in the folded inspector: the rail says so with a dot as well as in its name */
.inspector--waiting .inspector__rail-icon {
  color: var(--color-pending);
}

.inspector--waiting .inspector__rail::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-pending);
}

/* Wide: the same frame in a dialog as wide as the window allows, for long texts and many fields */
.inspector__dialog {
  width: min(64rem, calc(100vw - 2 * var(--space-l)));
  height: calc(100dvh - 2 * var(--space-xl));
}

/* A picture large, or the kind of a file that has none */
.inspector__media {
  display: grid;
  place-items: center;
  min-height: 8rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-workspace);
  color: var(--color-text-subtle);
  font-family: var(--font-code);
  font-size: var(--step-1);
  text-transform: uppercase;
}

.inspector__image {
  max-width: 100%;
  max-height: 16rem;
  object-fit: contain;
}

/*
 * An SVG that names only its viewBox has no size of its own and would be zero wide here, so
 * a drawing takes the width there is and the height its proportions give, up to the most a
 * picture gets.
 */
.inspector__image--vector {
  width: 100%;
  height: auto;
}

/* What the row is, term and value a line each */
.inspector__facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2xs) var(--space-s);
  margin: 0;
  font-size: var(--step--1);
}

.inspector__fact-term {
  color: var(--color-text-subtle);
}

.inspector__fact-detail {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

/* A heading inside the body, above a group such as "Used by" */
.inspector__group-title {
  margin: var(--space-xs) 0 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.inspector__list {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
  padding-inline-start: var(--space-m);
}

/* A text somebody wrote, whole, with its line breaks */
.inspector__text {
  margin: 0;
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface-raised);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* A field of the body: label, control and what it says */
.inspector__field {
  display: grid;
  gap: var(--space-3xs);
}

.inspector__label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.inspector__input {
  width: 100%;
  min-width: 0;
  height: var(--size-control-l);
  padding-inline: var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  font-size: var(--step-0);
}

.inspector__input:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

/* An address is code, written in its type */
.inspector__input--code {
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.inspector__input[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.inspector__hint {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.inspector__hint--problem {
  color: var(--color-danger);
}

/* A field with its own action beside it, such as a new password and Set password */
.inspector__inline {
  display: flex;
  gap: var(--space-xs);
}

/* What the foot does besides saving, pushed to the right after what waits */
.inspector__spacer {
  flex: 1;
}

/* A field's name with the button whose tooltip says more about it, as in the page settings (decided 2026-10-17) */
.inspector__label-row {
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
  min-width: 0;
}

.inspector__info {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-subtle);
  cursor: help;
}

.inspector__info:hover,
.inspector__info:focus-visible {
  color: var(--color-accent-text);
}

.inspector__info-icon {
  width: 15px;
  height: 15px;
}

/* An on/off setting: its name and its ⓘ, the switch at the end of the line */
.inspector__switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
}

/* A small fact in the head beside the title: a component's element */
.inspector__code {
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

/* A section of the manage panel that is a list with its inspector: the table scrolls on the left, the inspector stands on the right. */

.list-view {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
}

/* The section's padding, which a flush section leaves to what it holds */
.list-view__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  min-width: 0;
  min-height: 0;
  padding: var(--space-l);
  overflow-y: auto;
}

/* With a side list on the left that picks what the rest shows, the forms of Forms */
.list-view--with-side {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

/* Too narrow for the side list beside the rest: it is a bar above (side-list--compact) */
.list-view--compact {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
}

/*
 * Side list: the column on the left of a section that picks what the rest of it shows, the
 * collections of Content, the forms of Forms, the folders of Uploads and the fonts of Fonts. A title in the words
 * of the nav's categories with its + beside it, then one line an item: icon, name and what it
 * is, indented by its depth where the items are a tree. A narrow section turns it into a bar
 * above with a select (side-list--compact, set by the script, since a block holds no media
 * query).
 */
.side-list {
  --side-list-width: 232px;
  --side-list-depth: 0;

  display: flex;
  width: var(--side-list-width);
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-s) var(--space-xs);
  border-inline-end: 1px solid var(--color-border);
  overflow-y: auto;
}

.side-list--compact {
  grid-column: 1 / -1;
  width: auto;
  flex-direction: row;
  align-items: center;
  padding: var(--space-s) var(--space-l);
  border-inline-end: 0;
  border-block-end: 1px solid var(--color-border);
  overflow: visible;
}

.side-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  padding-inline: var(--space-xs) 0;
}

.side-list__title {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.side-list__pick {
  max-width: 24rem;
}

/* More than one button beside the title: new, settings and delete of the open folder */
.side-list__tools {
  display: flex;
  gap: var(--space-3xs);
}

.side-list__items {
  display: grid;
  gap: var(--space-3xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* One line an item: icon, name, what it is; the open one as the nav marks its open tab */
.side-list__button {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  min-height: var(--size-control-l);
  padding-inline: calc(var(--space-xs) + var(--side-list-depth) * var(--space-m)) var(--space-xs);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.side-list__button:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.side-list__button[aria-current="true"] {
  background: var(--color-accent-muted);
  color: var(--color-text);
  font-weight: 600;
}

.side-list__icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--color-text-subtle);
}

.side-list__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A letter or two in place of the icon, set in the item's own typeface: a font of Fonts */
.side-list__glyph {
  flex: none;
  width: 28px;
  color: var(--color-text);
  font-size: var(--step-2);
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

/* The name over a quiet line saying what the item is for, where one line is not enough */
.side-list__text {
  display: grid;
  flex: 1;
  min-width: 0;
  padding-block: var(--space-2xs);
}

.side-list__line {
  overflow: hidden;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* How many an item holds, quiet at the end of its line */
.side-list__count {
  flex: none;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

/* The arrow that folds an item of a tree; as wide where an item has nothing to fold, so names line up */
.side-list__fold {
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-inline-end: calc(-1 * var(--space-2xs));
  border-radius: var(--radius-s);
  color: var(--color-text-subtle);
}

/* Only an arrow that folds lights up; the room of a line without one stays empty */
.side-list__fold--toggle:hover {
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.side-list__fold-icon {
  width: 12px;
  height: 12px;
  transition: rotate var(--duration-fast);
}

.side-list__fold--open .side-list__fold-icon {
  rotate: 90deg;
}

/* A folder being dragged, and the line it would go into once dropped */
.side-list__button--dragging {
  opacity: 0.5;
}

.side-list__button--drop {
  outline: 2px dashed var(--color-accent-line);
  outline-offset: -2px;
  background: var(--color-accent-muted);
  color: var(--color-text);
}

/* Dropped above or below the line, beside it in its place: a line where the folder would land */
.side-list__button--drop-before {
  box-shadow: inset 0 2px 0 var(--color-accent-line);
}

.side-list__button--drop-after {
  box-shadow: inset 0 -2px 0 var(--color-accent-line);
}

/* Between the lines that are always there, All and Not in a folder, and the folders */
.side-list__rule {
  height: 1px;
  margin: var(--space-2xs) var(--space-xs);
  background: var(--color-border);
}

/* Forms: the section of the website's forms, a form picked on the left, its settings above its messages. */

/* The picked form's name in its card, in the code font as the markup names it */
.forms__name {
  font-family: var(--font-code);
}

.forms__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-s) var(--space-m);
}

.forms__field {
  display: grid;
  gap: var(--space-3xs);
}

.forms__switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--size-control-l);
}

/* Where the form stands, on a line of its own under the settings */
.forms__where {
  flex-basis: 100%;
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.forms__blank {
  margin: 0;
  color: var(--color-text-muted);
}

/* Fonts: the website's typefaces, Roles or a font picked on the left; every sample is set in the font itself, loaded from the uploads. */
.fonts {
  --fonts-control-width: 19rem;
  /* The typeface a sample is set in, which the script sets on every sample, the list's glyphs included */
  --fonts-family: var(--font-ui);
  --fonts-weight: 400;
  --fonts-style: normal;
  --fonts-stretch: 100%;
  /* Where a file stands along the weights of a style row, in percent of the row */
  --fonts-from: 0%;
  --fonts-to: 0%;
}

/* The letters of a font in the list on the left, set in the font itself */
.fonts__glyph {
  font-family: var(--fonts-family);
  font-style: var(--fonts-style);
  font-weight: var(--fonts-weight);
  font-stretch: var(--fonts-stretch);
}

.fonts__view {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

/* Headings, Text and Code side by side, each with its select and a line in its font */
.fonts__roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: var(--space-s);
}

.fonts__role {
  display: grid;
  align-content: start;
  gap: var(--space-2xs);
  min-width: 0;
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.fonts__role-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs);
}

.fonts__role-name {
  color: var(--color-text);
  font-size: var(--step-0);
  font-weight: 600;
}

.fonts__role-variable {
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.fonts__role-sample {
  font-family: var(--fonts-family);
  font-style: var(--fonts-style);
  font-weight: var(--fonts-weight);
  font-stretch: var(--fonts-stretch);
  margin: var(--space-2xs) 0 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--step-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A piece of a page set in the roles as they stand in the selects */
.fonts__preview {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-m) var(--space-l);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
  color: var(--color-text);
}

.fonts__preview-heading {
  font-family: var(--fonts-family);
  font-style: var(--fonts-style);
  font-weight: var(--fonts-weight);
  font-stretch: var(--fonts-stretch);
  margin: 0;
  font-size: var(--step-3);
  line-height: 1.15;
  text-wrap: balance;
}

.fonts__preview-text {
  font-family: var(--fonts-family);
  font-style: var(--fonts-style);
  font-weight: var(--fonts-weight);
  font-stretch: var(--fonts-stretch);
  max-width: 65ch;
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.55;
}

.fonts__preview-code {
  font-family: var(--fonts-family);
  font-style: var(--fonts-style);
  font-weight: var(--fonts-weight);
  font-stretch: var(--fonts-stretch);
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-s);
  background: var(--color-surface-hover);
  font-size: var(--step-0);
}

/* The frame of the read-only CSS: the editor fills it, a website of many fonts scrolls inside */
.fonts__css {
  position: relative;
  block-size: 18rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
}

.fonts__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

.fonts__actions {
  display: flex;
  gap: var(--space-xs);
}

/* The line a class takes over, with its copy button */
.fonts__snippet {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--size-control-m);
  padding-inline: var(--space-s) var(--space-2xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.fonts__snippet-code {
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.fonts__sample-input {
  max-width: 32rem;
}

/* Every file of the font at reading size, its weight and style beside it */
.fonts__faces {
  display: grid;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.fonts__face {
  display: grid;
  grid-template-columns: minmax(0, var(--fonts-control-width)) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-m);
  padding: var(--space-s) var(--space-m);
  border-block-end: 1px solid var(--color-border);
}

.fonts__face:last-child {
  border-block-end: 0;
}

.fonts__face-controls {
  display: grid;
  gap: var(--space-2xs);
  min-width: 0;
}

/* A file's name with Correct, Move and Remove at its end */
.fonts__face-head {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-width: 0;
}

.fonts__face-actions {
  display: flex;
  flex: none;
  gap: var(--space-3xs);
  margin-inline-start: auto;
}

.fonts__face-file {
  overflow: hidden;
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fonts__face-select {
  flex: none;
  width: auto;
  min-width: 0;
}

/* What the font states of a file: its weight, style and width */
.fonts__face-facts {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step--1);
}

/* Whether the file itself says the same, read from its tables */
.fonts__face-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.fonts__face-check:empty {
  display: none;
}

.fonts__face-check--ok {
  color: var(--color-text-muted);
}

.fonts__face-check--differs {
  color: var(--color-pending);
}

.fonts__face-check-icon {
  flex: none;
  inline-size: 1em;
  block-size: 1em;
}

/* Weight, style and width to correct, where a file says something wrong or could not be read */
.fonts__correct {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-xs);
  padding: var(--space-xs);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-m);
}

.fonts__correct-field {
  display: grid;
  gap: var(--space-3xs);
}

.fonts__correct-label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.fonts__correct-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* A button of a line of text: Take the file's, Correct */
.fonts__inline-button {
  height: var(--size-control-m);
  padding-inline: var(--space-s);
}

.fonts__face-problem {
  margin: 0;
  color: var(--color-danger);
  font-size: var(--step--1);
}

.fonts__face-show {
  display: grid;
  gap: var(--space-2xs);
  min-width: 0;
}

.fonts__face-sample {
  font-family: var(--fonts-family);
  font-style: var(--fonts-style);
  font-weight: var(--fonts-weight);
  font-stretch: var(--fonts-stretch);
  margin: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--step-3);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fonts__ranges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-m);
}

/* A variable font's weight or width, tried across its range */
.fonts__range {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.fonts__range-input {
  width: 10rem;
  accent-color: var(--color-accent-line);
}

.fonts__range-value {
  min-width: 3ch;
  font-family: var(--font-code);
  font-variant-numeric: tabular-nums;
}

.fonts__blank {
  margin: 0;
  color: var(--color-text-muted);
}

/* What the font covers: a row for upright and one for italic, every file a bar over its weights */
.fonts__cover {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
}

.fonts__styles {
  display: grid;
  gap: var(--space-2xs);
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.fonts__style,
.fonts__scale {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-s);
}

.fonts__style-name {
  color: var(--color-text);
  font-size: var(--step--1);
  font-weight: 600;
}

.fonts__track {
  position: relative;
  min-block-size: 1.5rem;
  border-radius: var(--radius-s);
  background: var(--color-surface-hover);
}

/* One file over the weights it holds; a single weight is a point */
.fonts__span {
  position: absolute;
  inset-block: 0.25rem;
  inset-inline-start: var(--fonts-from);
  inline-size: calc(var(--fonts-to) - var(--fonts-from));
  min-inline-size: 0.75rem;
  border-radius: var(--radius-s);
  background: var(--color-accent-line);
}

.fonts__span--point {
  inline-size: 0.75rem;
  translate: -50% 0;
}

.fonts__style-missing {
  display: block;
  padding: 0.2rem var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The weights under the rows, each mark at its place along the track */
.fonts__scale-marks {
  position: relative;
  block-size: 1.25rem;
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.fonts__scale-mark {
  position: absolute;
  inset-inline-start: var(--fonts-from);
  translate: -50% 0;
}

/* A sentence in the font as a page sets it, its italic and bold picked by the browser */
.fonts__running {
  font-family: var(--fonts-family);
  font-style: var(--fonts-style);
  font-weight: var(--fonts-weight);
  font-stretch: var(--fonts-stretch);
  max-width: 65ch;
  margin: 0;
  color: var(--color-text);
  font-size: var(--step-1);
  line-height: 1.55;
}

/* The dialog of a new font: its name and fallback, then the files, each read from its own tables */
.fonts__pick {
  display: grid;
  gap: var(--space-s);
  inline-size: min(40rem, 100%);
  max-block-size: 60vh;
  overflow-y: auto;
}

.fonts__pick-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: var(--space-s);
}

.fonts__pick-field {
  display: grid;
  align-content: start;
  gap: var(--space-3xs);
}

/* Where files are dropped, with Choose files for the keyboard */
.fonts__drop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs) var(--space-s);
  padding: var(--space-m);
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-m);
  color: var(--color-text-muted);
  text-align: center;
}

.fonts__drop--over {
  border-color: var(--color-accent-line);
  background: var(--color-accent-muted);
}

.fonts__drop-icon {
  inline-size: 1.5rem;
  block-size: 1.5rem;
}

.fonts__drop-text {
  margin: 0;
  font-size: var(--step--1);
}

.fonts__pick-list {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.fonts__pick-item {
  display: grid;
  justify-items: start;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.fonts__pick-top {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  justify-self: stretch;
  min-width: 0;
}

.fonts__pick-file {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.fonts__pick-size {
  margin-inline-start: auto;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  white-space: nowrap;
}

/* The file in its own letters, loaded from the bytes picked before anything is uploaded */
.fonts__pick-sample {
  font-family: var(--fonts-family);
  font-style: var(--fonts-style);
  font-weight: var(--fonts-weight);
  font-stretch: var(--fonts-stretch);
  justify-self: stretch;
  margin: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--step-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fonts__pick-facts {
  margin: 0;
  color: var(--color-text);
  font-size: var(--step--1);
}

.fonts__pick-notes {
  display: grid;
  gap: var(--space-2xs);
}

.fonts__pick-notes:empty {
  display: none;
}

.fonts__pick-note {
  margin: 0;
  color: var(--color-pending);
  font-size: var(--step--1);
}

/* beanCSS: the website's framework, its colours with their steps, the roles, both schemes side by side and the type scale; every colour and size comes from the core, set through the block's custom properties. */
.beancss {
  --beancss-swatch-bg: transparent;
  --beancss-swatch-text: inherit;
  --beancss-bg: transparent;
  --beancss-surface: transparent;
  --beancss-text: inherit;
  --beancss-muted: inherit;
  --beancss-border: transparent;
  --beancss-link: inherit;
  --beancss-fill: transparent;
  --beancss-ink: inherit;
  --beancss-family: inherit;
  --beancss-size: inherit;
  --beancss-weight: inherit;
  --beancss-bar: 0%;
  --beancss-radius: 0;
  --beancss-shadow: none;
  --beancss-tile-bg: transparent;
  --beancss-tile-ground: transparent;
  --beancss-tile-text: inherit;
}

.beancss__view {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

/* The on switch in the head of the Overview card, across from its name */
.beancss__switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-inline-start: auto;
  color: var(--color-text);
  font-size: var(--step--1);
  cursor: pointer;
}

.beancss__check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  max-width: 70ch;
  color: var(--color-text);
  font-size: var(--step-0);
  cursor: pointer;
}

.beancss__facts {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The frame of the read-only CSS: the editor fills it */
.beancss__css {
  position: relative;
  block-size: 22rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
}

/* One line a colour: its switch, its name and what it is for, its picker */
.beancss__rows {
  display: grid;
  gap: var(--space-2xs);
}

.beancss__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.beancss__row--off {
  border-style: dashed;
  background: transparent;
}

.beancss__row-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2xs) var(--space-xs);
  min-width: 0;
  cursor: pointer;
}

.beancss__row-title {
  color: var(--color-text);
  font-weight: 600;
}

.beancss__row--off .beancss__row-title {
  color: var(--color-text-muted);
}

.beancss__row-hint {
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

.beancss__row-pick {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.beancss__row--off .beancss__row-pick {
  opacity: 0.55;
}

.beancss__row-problem {
  grid-column: 2 / -1;
}

.beancss__color {
  flex: none;
  width: var(--size-control-l);
  height: var(--size-control-m);
  padding: var(--space-3xs);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-surface-raised);
  cursor: pointer;
}

.beancss__hex {
  width: 7.5rem;
  font-family: var(--font-code);
}

.beancss__number {
  width: 6rem;
}

.beancss__group {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  border: 0;
}

.beancss__legend {
  padding: 0;
}

/* The steps of every colour that is on, thirteen to a row */
.beancss__scales {
  display: grid;
  gap: var(--space-m);
}

.beancss__scale {
  display: grid;
  gap: var(--space-2xs);
}

.beancss__scale-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.beancss__scale-name {
  color: var(--color-text);
  font-weight: 600;
}

.beancss__swatches {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: var(--space-3xs);
}

.beancss__swatch {
  display: grid;
  align-content: space-between;
  justify-items: center;
  min-height: 52px;
  padding: var(--space-2xs) var(--space-3xs);
  border: 0;
  border-radius: var(--radius-s);
  background: var(--beancss-swatch-bg);
  color: var(--beancss-swatch-text);
  font: inherit;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

/* The step nearest to the colour set */
.beancss__swatch--value {
  box-shadow: inset 0 0 0 2px var(--beancss-swatch-text);
}

.beancss__swatch:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.beancss__swatch-tone {
  font-weight: 700;
}

.beancss__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  white-space: nowrap;
}

.beancss__chip-dot {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--beancss-swatch-bg);
}

.beancss__token {
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.beancss__value {
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: var(--step--1);
  white-space: nowrap;
}

.beancss__notes {
  display: grid;
  gap: var(--space-2xs);
}

.beancss__note {
  margin: 0;
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-m);
  font-size: var(--step--1);
}

.beancss__note--ok {
  background: var(--color-live-muted);
  color: var(--color-text);
}

.beancss__note--warning {
  background: var(--color-pending-muted);
  color: var(--color-text);
}

/* The roles and the sizes, one table each */
.beancss__scroll {
  overflow-x: auto;
}

.beancss__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.beancss__th {
  padding: var(--space-2xs) var(--space-s);
  border-block-end: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-weight: 600;
  text-align: start;
  white-space: nowrap;
}

.beancss__td {
  padding: var(--space-2xs) var(--space-s);
  border-block-end: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}

.beancss__td--muted {
  color: var(--color-text-muted);
}

.beancss__num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.beancss__group-row {
  background: var(--color-surface);
}

/* Both schemes side by side, each set in its own resolved colours */
.beancss__specimens {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  gap: var(--space-s);
}

.beancss__specimen {
  display: grid;
  align-content: start;
  gap: var(--space-xs);
  padding: var(--space-l);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--beancss-bg);
  color: var(--beancss-text);
}

.beancss__specimen-label {
  color: var(--beancss-muted);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.beancss__specimen-title {
  margin: 0;
  font-size: var(--step-2);
  font-weight: 700;
}

.beancss__specimen-text {
  margin: 0;
  font-size: var(--step-0);
  line-height: 1.55;
}

.beancss__specimen-link {
  color: var(--beancss-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.beancss__specimen-muted {
  margin: 0;
  color: var(--beancss-muted);
  font-size: var(--step--1);
}

.beancss__specimen-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.beancss__specimen-button,
.beancss__specimen-tag,
.beancss__specimen-band,
.beancss__specimen-alert {
  background: var(--beancss-fill);
  color: var(--beancss-ink);
}

.beancss__specimen-button {
  padding: var(--space-xs) var(--space-m);
  border-radius: var(--radius-m);
  font-size: var(--step--1);
  font-weight: 600;
}

.beancss__specimen-tag {
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-l);
  font-size: var(--step--1);
  vertical-align: middle;
}

.beancss__specimen-card {
  display: grid;
  gap: var(--space-3xs);
  padding: var(--space-s);
  border: 1px solid var(--beancss-border);
  border-radius: var(--radius-m);
  background: var(--beancss-surface);
}

.beancss__specimen-band {
  padding: var(--space-s);
  border-radius: var(--radius-m);
  font-weight: 600;
}

.beancss__specimen-alert {
  margin: 0;
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-m);
  font-size: var(--step--1);
}

/* The width the sizes are shown at */
.beancss__width {
  display: grid;
  gap: var(--space-2xs);
}

.beancss__width-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-s);
}

.beancss__width-value {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.beancss__range {
  width: 100%;
  accent-color: var(--color-accent-line);
}

/* Every size at the chosen width, in the fonts of the Fonts page */
.beancss__waterfall {
  display: grid;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
  overflow: hidden;
}

.beancss__sample-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-s);
  padding: var(--space-xs) var(--space-s);
  border-block-end: 1px solid var(--color-border);
}

.beancss__sample-row:last-child {
  border-block-end: 0;
}

.beancss__sample-label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.beancss__sample {
  overflow: hidden;
  color: var(--color-text);
  font-family: var(--beancss-family);
  font-size: var(--beancss-size);
  font-weight: var(--beancss-weight);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Spacing and shape: a part of the card with its switch and its settings */
.beancss__shape-part {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-surface);
}

.beancss__part {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text);
  font-weight: 600;
  cursor: pointer;
}

.beancss__part-name {
  min-width: 0;
}

/* How much room a space takes at the chosen width, against the widest */
.beancss__bar-cell {
  width: 40%;
}

.beancss__bar {
  display: block;
  width: var(--beancss-bar);
  height: var(--space-xs);
  border-radius: var(--radius-s);
  background: var(--color-accent-line);
}

/* The corners and the shadows, one tile each */
.beancss__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--space-s);
}

.beancss__tile {
  display: grid;
  align-content: end;
  gap: var(--space-3xs);
  min-height: 5.5rem;
  padding: var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--beancss-radius);
  background: var(--beancss-tile-bg);
  color: var(--beancss-tile-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.beancss__tile:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

/* A shadow is seen on the page background of its scheme, around a card of the surface */
.beancss__tile--shadow {
  align-content: center;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--beancss-tile-ground);
  color: var(--beancss-tile-text);
}

.beancss__tile-card {
  display: grid;
  gap: var(--space-3xs);
  padding: var(--space-s);
  border-radius: var(--beancss-radius);
  background: var(--beancss-tile-bg);
  box-shadow: var(--beancss-shadow);
}

.beancss__tile-name {
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.beancss__tile-value {
  color: inherit;
  font-size: var(--step--1);
  opacity: 0.75;
}

/* Rich editor: a rich text field's bar of formats over its editable area. */

.rich-editor {
  display: grid;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-bg);
}

.rich-editor:focus-within {
  border-color: var(--color-accent-line);
}

.rich-editor__bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs);
  padding: var(--space-3xs);
  border-bottom: 1px solid var(--color-border);
}

.rich-editor__button {
  display: grid;
  place-items: center;
  min-width: var(--size-control-s);
  height: var(--size-control-s);
  padding: 0 var(--space-3xs);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.rich-editor__button:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.rich-editor__button[aria-pressed="true"] {
  background: var(--color-accent-muted);
  color: var(--color-accent-text);
}

.rich-editor__button--italic {
  font-family: Georgia, serif;
  font-style: italic;
}

.rich-editor__icon {
  width: 16px;
  height: 16px;
}

.rich-editor__area {
  min-height: 8rem;
  max-height: 32rem;
  overflow: auto;
  padding: var(--space-xs) var(--space-s);
  color: var(--color-text);
  font-size: var(--step-0);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* The focus shows on the editor's border, which turns accent around bar and area alike */
.rich-editor__area:focus-visible {
  outline: none;
}

.rich-editor__area:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-muted);
}

/*
 * What the text holds is the person's markup, elements without classes, so it is reached by
 * its tags: spacing that shows a paragraph, a heading and a quote for what they are.
 */
.rich-editor__area > :first-child {
  margin-top: 0;
}

.rich-editor__area :is(p, ul, ol, blockquote) {
  margin: 0 0 var(--space-xs);
}

.rich-editor__area :is(h2, h3, h4) {
  margin: var(--space-s) 0 var(--space-2xs);
  line-height: 1.25;
}

.rich-editor__area h2 {
  font-size: var(--step-2);
}

.rich-editor__area h3 {
  font-size: var(--step-1);
}

.rich-editor__area h4 {
  font-size: var(--step-0);
}

.rich-editor__area :is(ul, ol) {
  padding-left: var(--space-l);
}

.rich-editor__area blockquote {
  padding-left: var(--space-s);
  border-left: 3px solid var(--color-border-strong);
  color: var(--color-text-muted);
}

.rich-editor__area a {
  color: var(--color-accent-text);
  text-decoration: underline;
}

/* The list and quote marks are small glyphs: a step larger, so they read like the letters */
.rich-editor__button--ul,
.rich-editor__button--quote {
  font-size: var(--step-1);
}

/* Where a crop keeps a picture in view: the picture with a ring over its focal point, set by a click, the arrow keys or the two sliders */
.focus-picker {
  --focus-picker-x: 50%;
  --focus-picker-y: 50%;
  display: grid;
  gap: var(--space-s);
}

.focus-picker__frame {
  position: relative;
  justify-self: center;
  max-width: 100%;
  border-radius: var(--radius-s);
  overflow: hidden;
  cursor: crosshair;
}

.focus-picker__frame:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.focus-picker__image {
  display: block;
  max-width: 100%;
  max-height: 50vh;
}

.focus-picker__marker {
  position: absolute;
  inset-inline-start: var(--focus-picker-x);
  inset-block-start: var(--focus-picker-y);
  width: 28px;
  height: 28px;
  translate: -50% -50%;
  border: 2px solid var(--color-on-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--color-accent);
  pointer-events: none;
}

.focus-picker__sliders {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
  font-size: var(--step--1);
}

.focus-picker__value {
  min-width: 3.5em;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

/* A picture's sizes in the uploads' inspector: the original and the sizes as two tables of the same columns, growing by the pixels and the original's "as uploaded" once the inspector is wide (--wide, set by its width); the boxes that choose the sizes show only in the edit mode behind the pencil */

.size-matrix {
  /* How many characters the longest number of the sizes has, set by the matrix: every number is as wide, so a box stands right before its own and under the others of its column */
  --size-matrix-digits: 4;

  display: grid;
  gap: var(--space-xs);
  min-width: 0;
}

/* Both tables share their column widths, so the original's bytes stand over its format's. */
.size-matrix__table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.size-matrix__head {
  padding: var(--space-2xs) 6px;
  border-bottom: 1px solid var(--color-border-strong);
  color: var(--color-text-subtle);
  font-weight: 600;
  text-align: end;
  white-space: nowrap;
}

.size-matrix__head:first-child {
  width: 28%;
  text-align: start;
}

.size-matrix__row + .size-matrix__row > * {
  border-top: 1px solid var(--color-border);
}

.size-matrix__table td {
  padding: 1px 0;
  text-align: end;
  white-space: nowrap;
}

.size-matrix__width {
  padding-inline-start: 6px;
  font-weight: 600;
  text-align: start;
  white-space: nowrap;
}

.size-matrix__height,
.size-matrix__note {
  display: none;
}

.size-matrix__height {
  color: var(--color-text-muted);
  font-weight: 400;
}

.size-matrix__cell {
  display: inline-grid;
  justify-items: end;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.size-matrix__cell:hover {
  background: var(--color-surface-hover);
}

.size-matrix__cell--smallest {
  font-weight: 700;
}

.size-matrix__note {
  color: var(--color-text-muted);
  font-size: 0.9em;
  font-weight: 400;
}

/* A box and its number or format name at the column's end; the head's gap is the number's padding in a cell, so the boxes stand under each other */
.size-matrix__lane {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.size-matrix__lane--cell {
  gap: 0;
}

.size-matrix__lane-name,
.size-matrix__lane--cell .size-matrix__bytes {
  min-inline-size: calc((var(--size-matrix-digits) + 0.5) * 1ch);
  text-align: end;
}

/* A size's, a width's or a format's box, in the edit mode only: unticked, Save leaves it out */
.size-matrix__keep {
  width: 13px;
  height: 13px;
  margin: 0 4px 0 0;
  vertical-align: -2px;
  accent-color: var(--color-accent-line);
  cursor: pointer;
}

.size-matrix__keep--lane {
  margin: 0;
}

.size-matrix__keep[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* A size the picture leaves out: a quiet dash, its bytes in its tooltip */
.size-matrix__cell--off .size-matrix__bytes {
  color: var(--color-text-subtle);
}

/* What Save would change, in the pending colour of what waits */
.size-matrix__cell--changed .size-matrix__bytes {
  color: var(--color-pending);
  font-weight: 600;
}

/* Left out while the worker still deletes its file: it pulses until the file is gone */
@media (prefers-reduced-motion: no-preference) {
  .size-matrix__cell--going .size-matrix__bytes {
    animation: size-matrix-going 1.2s ease-in-out infinite;
  }
}

.size-matrix__cell--going .size-matrix__bytes {
  color: var(--color-pending);
}

@keyframes size-matrix-going {
  50% {
    opacity: 0.35;
  }
}

/* The edit mode's foot: what Save does, Discard and Save on the right; amber with a dot while something waits */
.size-matrix__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
}

.size-matrix__foot--changed {
  border-color: var(--color-pending);
  background: var(--color-pending-muted);
}

.size-matrix__foot-text {
  flex: 1 1 10rem;
  margin: 0;
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

/* Discard and Save stay together, on the right, below the words where the inspector is narrow */
.size-matrix__foot-actions {
  display: flex;
  gap: var(--space-xs);
  margin-inline-start: auto;
}

.size-matrix__foot--changed .size-matrix__foot-text {
  color: var(--color-text);
  font-weight: 600;
}

.size-matrix__foot--changed .size-matrix__foot-text::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: var(--space-xs);
  border-radius: 50%;
  background: var(--color-pending);
}

/* A size the server could not make: a quiet cross, the reason in its tooltip and below the table */
.size-matrix__table .size-matrix__none {
  padding-inline-end: 6px;
  color: var(--color-text-muted);
}

/* Wide, in the inspector's dialog: the pixels and the original's note show, and the number picked is the one the comparison shows. */
.size-matrix--wide .size-matrix__height {
  display: inline;
}

.size-matrix--wide .size-matrix__note {
  display: block;
}

.size-matrix--wide .size-matrix__head:first-child {
  width: 22%;
}

.size-matrix--wide .size-matrix__cell[aria-pressed="true"] {
  border-color: var(--color-accent-line);
  background: var(--color-accent-muted);
}

/* A table's title with what stands beside it: how far the sizes are. */
.size-matrix__group {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-s);
}

.size-matrix__aside {
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.size-matrix__holder {
  min-width: 0;
}

/* While the worker makes them: what it makes now and the time left under the bar, */
.size-matrix__step {
  display: flex;
  justify-content: space-between;
  gap: var(--space-s);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.size-matrix__step--waiting {
  color: var(--color-pending);
}

.size-matrix__left {
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* a number as its file is made, where a ready one stands, */
.size-matrix__number {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
}

.size-matrix__number--smallest {
  font-weight: 700;
}

.size-matrix__number--new {
  animation: size-matrix-arrive var(--duration-attention) ease-out;
}

@keyframes size-matrix-arrive {
  from {
    background: var(--color-accent-muted);
  }
}

/* and the place of each still to come, as large as a number with a bar where its digits will be, the one being made pulsing. */
.size-matrix__number--slot {
  color: transparent;
  background: linear-gradient(var(--color-surface-hover) 0 0) center / calc(100% - 12px) 0.75em no-repeat;
}

.size-matrix__number--now {
  background-image: linear-gradient(var(--color-accent-muted) 0 0);
  animation: size-matrix-pulse var(--duration-pulse) ease-in-out infinite;
}

@keyframes size-matrix-pulse {
  50% {
    opacity: 0.35;
  }
}

/* The size picked over the original as one whole picture, a divider dragged across it; where the uploads' inspector is wide, in place of its picture */

.size-compare {
  --size-compare-ratio: 1.5;
  --size-compare-split: 50%;

  display: grid;
  justify-items: center;
  padding: var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-workspace);
}

/* The bar and the picture, as wide as the picture, so the bar's two sides stand over its two edges. */
.size-compare__frame {
  display: grid;
  gap: var(--space-2xs);
  max-width: 100%;
}

.size-compare__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
}

.size-compare__side {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.size-compare__side--size {
  margin-inline-start: auto;
}

.size-compare__label {
  font-size: var(--step--1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* As tall as there is room for and as wide as the picture then is, so nothing of it is cut and the divider spans the picture alone. */
.size-compare__stage {
  position: relative;
  justify-self: center;
  height: 24rem;
  max-width: 100%;
  aspect-ratio: var(--size-compare-ratio);
  /* What a picture leaves transparent, as in the lightbox */
  background-color: var(--color-checker-light);
  background-image:
    linear-gradient(45deg, var(--color-checker-dark) 25%, transparent 25%),
    linear-gradient(-45deg, var(--color-checker-dark) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--color-checker-dark) 75%),
    linear-gradient(-45deg, transparent 75%, var(--color-checker-dark) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.size-compare__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Each half shows one picture alone: the original ends where the size begins, so a picture
   with partial transparency is not shown through the other one */
.size-compare__image {
  clip-path: inset(0 calc(100% - var(--size-compare-split)) 0 0);
}

.size-compare__image--size {
  clip-path: inset(0 0 0 var(--size-compare-split));
}

.size-compare__line {
  position: absolute;
  inset-block: 0;
  inset-inline-start: var(--size-compare-split);
  width: 2px;
  translate: -1px 0;
  background: var(--color-accent-line);
  pointer-events: none;
}

/* The handle: a quiet capsule on the line with two grip lines. */
.size-compare__line::after {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  width: 0.75rem;
  height: 2.25rem;
  translate: -50% -50%;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background:
    linear-gradient(var(--color-icon), var(--color-icon)) 35% 50% / 1px 0.875rem no-repeat,
    linear-gradient(var(--color-icon), var(--color-icon)) 65% 50% / 1px 0.875rem no-repeat,
    var(--color-surface-raised);
  box-shadow: var(--shadow-button);
  content: "";
}

.size-compare__unshown {
  position: absolute;
  inset-inline-end: var(--space-xs);
  inset-block-end: var(--space-xs);
  margin: 0;
  padding: var(--space-2xs) var(--space-xs);
  border-radius: var(--radius-s);
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  font-size: var(--step--1);
  pointer-events: none;
}

/* The range lies over the whole picture and draws nothing itself: its track and thumb are
   transparent in Chrome and Firefox alike, which style them through their own pseudo-elements,
   and its thumb is a line thin enough that the divider stands where the pointer is. */
.size-compare__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.size-compare__range:focus-visible {
  outline-offset: -2px;
}

.size-compare__range::-webkit-slider-runnable-track {
  height: 100%;
  background: transparent;
}

.size-compare__range::-webkit-slider-thumb {
  width: 2px;
  height: 100%;
  appearance: none;
  background: transparent;
}

.size-compare__range::-moz-range-track {
  background: transparent;
}

.size-compare__range::-moz-range-thumb {
  width: 2px;
  height: 100%;
  border: 0;
  background: transparent;
}

/* How far the server is with something it works at; it glides from one answer to the next over the time between them (--progress-bar-glide, set by its module), and is striped while it waits its turn */

.progress-bar {
  --progress-bar-share: 0%;
  --progress-bar-glide: 0ms;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-surface-hover);
}

.progress-bar--s {
  height: 4px;
}

.progress-bar__fill {
  width: var(--progress-bar-share);
  height: 100%;
  border-radius: inherit;
  background: var(--color-accent-line);
  transition: width var(--progress-bar-glide) linear;
}

.progress-bar--waiting .progress-bar__fill {
  width: 100%;
  background: repeating-linear-gradient(-45deg, var(--color-pending-muted) 0 6px, transparent 6px 12px);
}

/* Every address of the website in one table; a collection's pattern is indented under the page above it by --routes-depth. */
.routes {
  --routes-depth: 0;
  --routes-indent: 20px;
}

/* The table is the data-table block's; it keeps the addresses whole rather than squeezing them */
.routes__table {
  min-width: 920px;
}

/* The row of notes under a route belongs to it, so no line between them */
.routes__row:has(+ .routes__details:not([hidden])) .routes__cell {
  border-bottom-color: transparent;
}

.routes__where {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  padding-inline-start: calc(var(--routes-depth) * var(--routes-indent));
  white-space: nowrap;
}

/* A route without a toggle keeps its address in line with those that have one */
.routes__where:not(:has(.routes__toggle)) {
  padding-inline-start: calc(var(--routes-depth) * var(--routes-indent) + var(--size-control-s) + var(--space-2xs));
}

.routes__toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--size-control-s);
  height: var(--size-control-s);
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}

.routes__toggle:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

/* The chevron of every list that folds, as large as the grouped tables' */
.routes__chevron {
  width: 14px;
  height: 14px;
  transition: rotate var(--duration-fast);
}

.routes__toggle[aria-expanded="true"] .routes__chevron {
  rotate: 90deg;
}

.routes__address {
  color: var(--color-text);
  font-family: var(--font-code);
  font-size: var(--step--1);
}

.routes__shows {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs);
}

.routes__kind {
  color: var(--color-text-subtle);
  font-size: var(--step--1);
}

.routes__none-mark {
  color: var(--color-text-subtle);
}

/* Lined up under the address: past the indent and the toggle */
.routes__more {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding-inline-start: calc(var(--routes-depth) * var(--routes-indent) + var(--size-control-s) + var(--space-2xs));
}

.routes__note {
  margin: 0;
  font-size: var(--step--1);
}

.routes__note--problem {
  color: var(--color-danger);
}

.routes__note--warning {
  color: var(--color-condition);
}

.routes__note--info {
  color: var(--color-text-muted);
}

/* When a page last changed, in its row */
.routes__changed {
  color: var(--color-text-muted);
  font-size: var(--step--1);
  white-space: nowrap;
}

.routes__none-list {
  display: flex;
  flex-direction: column;
  margin: var(--space-xs) 0 0;
  padding: 0;
  list-style: none;
}

.routes__none-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

.routes__none-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs);
}

.routes__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: var(--space-s);
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* The drafts among a collection's entries, beside its count of pages, in the colour of drafts */
.routes__drafts {
  color: var(--color-draft);
}

/* An entry of an open collection, a row of the table in its columns, a shade apart from the routes */
.routes__row--entry > .routes__cell {
  background: color-mix(in srgb, var(--color-bg) 55%, var(--color-surface));
}

/* The line down the first cell of the rows under a collection, from its toggle */
.routes__cell--guide {
  --routes-guide: 0;

  position: relative;
}

.routes__cell--guide::before {
  position: absolute;
  inset-block: 0 -1px;
  inset-inline-start: calc(var(--space-s) + var(--routes-guide) * var(--routes-indent) + var(--size-control-s) / 2 - 1px);
  width: 2px;
  background: var(--color-border-strong);
  content: "";
}

/* An entry's title in the Shows column, in plain weight beside the bold names of pages and collections */
.routes__entry {
  color: var(--color-text);
}

/* The pager of a collection's entries, at the end of their last row */
.routes__pager {
  display: flex;
  justify-content: flex-end;
}

/* Login and registration: one card in the middle of the page */
.auth {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: var(--space-l);
}

.auth__card {
  display: grid;
  gap: var(--space-xs);
  width: min(24rem, 100%);
  padding: var(--space-xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
}

/* The form inside the card, its fields one under the other as the card's own (the console's login, drawn by the core, #101) */
.auth__form {
  display: grid;
  gap: var(--space-xs);
}

.auth__title {
  margin: 0;
  font-size: var(--step-2);
  font-weight: 600;
}

/* Whose product it is, small under its name and close to it */
.auth__by {
  margin: calc(-1 * var(--space-xs)) 0 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.auth__intro {
  margin: var(--space-2xs) 0 var(--space-m);
  color: var(--color-text-muted);
}

.auth__label {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.auth__input {
  height: var(--size-control-l);
  padding-inline: var(--space-s);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-s);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--step-0);
}

/* The focus ring sits on the border, which turns accent at the same time */
.auth__input:focus-visible {
  border-color: var(--color-accent-line);
  outline-offset: -1px;
}

/* The password rule, shown where a password is chosen */
.auth__hint {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.auth__error {
  margin: 0;
  color: var(--color-danger);
  font-size: var(--step--1);
}

/* The way to a link by mail, quieter than the buttons above it */
.auth__forgot {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--step--1);
  text-decoration: underline;
  cursor: pointer;
}

.auth__forgot:focus-visible {
  outline: 2px solid var(--color-accent-line);
  outline-offset: 2px;
}

.auth__actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-xs);
  margin-block-start: var(--space-m);
}
