/* Warm Sage app layer. Tokens and ws-* components come from css/ws/ (copied from the design system, never edited).
   This file holds the shell, page furniture and every class the generator's role mapping uses that the DS lacks
   (index §3.2). Plans add sections; keep one section per concern. */

[hidden] { display: none !important; }
/* Long commands and paths scroll inside their block, or wrap inline, instead of pushing the page sideways on a phone. */
pre { max-width: 100%; overflow-x: auto; }
:where(p, li, td, dd) > code { overflow-wrap: anywhere; }
/* A long name (a registry's address, a domain) in a row breaks rather than widening the row past the screen. */
:is(.list-row__main, .row-link__main) { overflow-wrap: anywhere; }

body { margin: 0; background: var(--bg-page); color: var(--text-body); font-family: var(--font-body); }
a { color: var(--text-link); }
.mono { font-family: var(--font-mono); }
.meta { font: var(--type-body-sm); color: var(--text-secondary); }
/* Times and shas set in mono keep it inside .meta, whose font shorthand would reset the family. */
.meta.mono, .meta .mono { font-family: var(--font-mono); }

/* Accessibility */
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  background: var(--surface-card); color: var(--text-link); box-shadow: var(--shadow-md);
}
.skip-link:focus { top: var(--space-4); }
#page-title:focus { outline: none; }

/* Shell: sidebar + main (signed-in pages) */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width, 264px) minmax(0, 1fr); min-height: 100vh; }
.app-aside {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; box-sizing: border-box;
  padding: var(--space-6) var(--space-3); border-right: 1px solid var(--border-subtle); background: var(--surface-card);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.app-main { min-width: 0; }
.app-main__inner {
  display: flex; flex-direction: column; gap: 28px; box-sizing: border-box;
  max-width: var(--content-max, 1120px); margin: 0 auto; padding: 32px 40px 96px;
}

/* Card shell: sign-in, setup, errors */
.card-shell { min-height: 100vh; display: grid; place-items: center; box-sizing: border-box; padding: var(--space-8) var(--space-4); }
.card-shell__inner { width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-6); }
.wordmark { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-xl); color: var(--text-strong); text-decoration: none; }
.display-title { font: var(--type-display); color: var(--text-strong); margin: 0; }
.lede { font: var(--type-body); color: var(--text-secondary); margin: 0; }

@media (max-width: 860px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .app-aside { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .app-main__inner { padding: 24px 16px 64px; }
}

/* Small screens: a bar across the top, its button opening the sidebar as a drawer from the left (_NavBar, ui.js
   startNavDrawer, which sets data-nav-ready). Without JavaScript the bar stays hidden and the sidebar sits above the page. */
.app-navbar, .app-aside__close { display: none; }
.app-scrim { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 0.4); }
@media (max-width: 860px) {
  .app-shell[data-nav-ready] { grid-template-rows: auto 1fr; }
  .app-shell[data-nav-ready] .app-navbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--space-2);
    min-height: 56px; padding: 0 var(--space-3); box-sizing: border-box;
    background: var(--surface-card); border-bottom: 1px solid var(--border-subtle);
  }
  .app-navbar__brand { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-lg); color: var(--text-strong); text-decoration: none; }
  .app-shell[data-nav-ready] .app-aside {
    position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(304px, 86vw); height: 100dvh;
    border-right: 1px solid var(--border-subtle); border-bottom: 0; box-shadow: var(--shadow-md);
    transform: translateX(-100%); visibility: hidden;
  }
  /* Animated only once the page has drawn it closed (data-nav-animate), so loading a page doesn't slide it shut. */
  .app-shell[data-nav-animate] .app-aside { transition: transform 200ms ease, visibility 0s linear 200ms; }
  .app-shell[data-nav-open] .app-aside { transform: none; visibility: visible; }
  .app-shell[data-nav-animate][data-nav-open] .app-aside { transition: transform 200ms ease; }
  .app-shell[data-nav-ready] .app-aside__close { display: flex; justify-content: flex-end; margin: calc(-1 * var(--space-3)) 0 calc(-1 * var(--space-2)); }
  body:has(.app-shell[data-nav-open]) { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell[data-nav-animate] .app-aside { transition: none !important; }
}

/* Sidenav pieces the DS leaves to the app */
/* The generated sidenav is one div.ws-sidenav inside the aside: it fills the rail so the foot's margin-top: auto reaches
   the bottom, and spaces brand, switcher, nav and foot apart. Its nav inherits the gap, so the nav takes back the DS's 2px. */
.app-aside > .ws-sidenav { flex: 1 0 auto; gap: var(--space-4); }
.app-aside .gen-sidenav-nav { gap: 2px; }
/* The rail is the window's height: the brand and team stay at the top, the account and theme at the bottom, and only
   the menu between them scrolls when the window is too short for all of it. */
@media (min-width: 861px) {
  .app-aside { overflow: hidden; }
  .app-aside > .ws-sidenav { flex: 1 1 auto; min-height: 0; }
  .app-aside .gen-sidenav-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-inline: -4px; padding-inline: 4px; }
}
@media (min-width: 861px) and (max-height: 900px) {
  .app-aside { padding-block: var(--space-4); }
  .app-aside .ws-navitem { min-height: 38px; }
  .app-aside .sidenav-section-title { padding-top: 10px; }
}
.sidenav-brand { display: flex; align-items: center; gap: var(--space-2); padding: 4px 12px 0; font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-lg); color: var(--text-strong); text-decoration: none; }
.sidenav-section-title { font: var(--type-caption); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-secondary); padding: 16px 12px 6px; margin: 0; }
/* Avatar, name over role, sign-out button in a row (prototype aside foot). */
.sidenav-foot { margin-top: auto; display: flex; align-items: center; gap: var(--space-3); padding: 12px 12px 0; border-top: 1px solid var(--border-subtle); }
.sidenav-foot > div { flex: 1; min-width: 0; }
.sidenav-foot > div > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidenav-foot > div > div:first-child { font: var(--type-label); color: var(--text-strong); }
.sidenav-foot .meta { font: var(--type-caption); }
.sidenav-foot form { margin: 0; }
/* The generated switcher is the button itself: a "Team" caption over the team's name, the chevrons on the right. */
.team-switcher { position: relative; }
button.team-switcher {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3);
  width: 100%; min-height: 52px; padding: 8px 12px; box-sizing: border-box;
  border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--surface-card);
  color: var(--text-body); font: inherit; text-align: left; cursor: pointer;
}
button.team-switcher:hover { background: var(--surface-hover); }
button.team-switcher > .meta { grid-column: 1; font: var(--type-caption); }
button.team-switcher > strong { grid-column: 1; font: var(--type-label); font-size: 17px; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.team-switcher > .ws-icon { grid-column: 2; grid-row: 1 / span 2; color: var(--text-secondary); }
.team-switcher__trigger {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 44px; padding: 0 12px; box-sizing: border-box;
  border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--surface-card);
  color: var(--text-strong); font: inherit; font-weight: var(--weight-semibold); text-align: left; cursor: pointer;
}
.team-switcher__trigger:hover { background: var(--surface-muted); }

/* Menus (team switcher, account) */
.ws-menu {
  min-width: 220px; margin: 0; padding: var(--space-1); list-style: none;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-md);
}
.ws-menu__item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 40px; padding: 0 12px; box-sizing: border-box;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-body); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.ws-menu__item:hover, .ws-menu__item[aria-current="page"] { background: var(--surface-muted); color: var(--text-strong); }

/* Page head */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.page-head h1, .page-title { font: var(--type-h1); color: var(--text-strong); margin: 0; }
.page-head__sub { font: var(--type-body); color: var(--text-secondary); margin: 6px 0 0; }
/* The environment page's body adds its subtitle after the generated head, not inside it: pull it back up past the
   main column's 28px gap so it sits under the title as everywhere else. */
.page-head:not(:has(.page-head__sub)) + .page-head__sub { margin-top: calc(6px - 28px); }
.page-head__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* Crumbs */
/* The generated crumbs are nav.crumbs > ol > li, each li after the first opening with its "/" separator. */
.crumbs { font: var(--type-body-sm); }
.crumbs > ol { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.crumbs__link { color: var(--text-secondary); text-decoration: none; }
a.crumbs__link:hover { color: var(--text-link); text-decoration: underline; }
.crumbs__current { color: var(--text-strong); font-weight: var(--weight-semibold); }
.crumbs__sep { color: var(--text-muted); }

/* Whole-row links (index lists) */
.row-link {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-6);
  color: inherit; text-decoration: none; border-top: 1px solid var(--border-subtle);
}
.row-link:first-child { border-top: 0; }
.row-link:hover { background: var(--surface-muted); }
.row-link:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; }
/* On a narrow screen the title keeps a usable width and the row's meta wraps beneath it. */
.row-link { flex-wrap: wrap; }
.row-link__main { flex: 1; min-width: min(12rem, 100%); display: flex; flex-direction: column; gap: 2px; }
.row-link__title { font-weight: var(--weight-semibold); color: var(--text-strong); }
.row-link__meta { font: var(--type-body-sm); color: var(--text-secondary); }
.row-link__chevron { color: var(--text-muted); font-size: 20px; }

/* Rows with their own actions */
.list-rows { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.list-row:first-child { border-top: 0; }
/* A row that stacks its content (a heading over a form field) fills its width instead of centring it. */
.list-row.stack { align-items: stretch; }
/* On a narrow screen the row's text keeps a usable width and its actions wrap beneath it. */
.list-row__main { flex: 1; min-width: min(12rem, 100%); display: flex; flex-direction: column; gap: 2px; }
.list-row__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }

/* A list's head: its title and intro on the left, the Add button on the right (prototype variables head) */
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.list-head > div { display: flex; flex-direction: column; gap: 4px; max-width: 66ch; }
.list-head h2 { font: var(--type-h3); margin: 0; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-8) var(--space-6); text-align: center; color: var(--text-secondary); }
.empty-state h2 { font: var(--type-h3); color: var(--text-strong); margin: 0; }

/* Getting started: the steps to a first deploy, one row each, the next one to do with the primary button. */
.getting-started { margin-bottom: var(--space-6); }
.getting-started__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.getting-started__step { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
.getting-started__mark { flex: none; display: inline-flex; font-size: 22px; color: var(--text-secondary); }
.getting-started__step--done .getting-started__mark { color: var(--success-fg, var(--sage-700)); }
.getting-started__step--next .getting-started__body > strong { color: var(--text-strong); }
.getting-started__step--done .getting-started__body > strong { color: var(--text-secondary); text-decoration: line-through; }
.getting-started__body { flex: 1; min-width: 0; }
.getting-started__body .meta { margin: 2px 0 0; }

/* A card's title and its actions: on a narrow screen the actions wrap under the title instead of running off the edge. */
.ws-card__head { flex-wrap: wrap; row-gap: var(--space-3); }
.ws-card__head > :first-child { min-width: 0; flex: 1 1 12rem; }

/* Cards. The DS pads only .ws-card__head/__body/__foot, but most cards here (and every generated one) put their content
   straight in the card. Such a card gets a body's padding and stacks its children. :where keeps it at the specificity of
   .ws-card alone, so a card's own layout class (.stack, .summary-grid, .stage) still decides its display and gap. A card
   that is all rows (.list-rows, .row-link) stays flush, and so does one that is its own body (class="ws-card ws-card__body"). */
.ws-card:where(:not(.ws-card__body):not(:has(> .ws-card__head, > .ws-card__body, > .ws-card__foot, > .list-rows, > .row-link))) {
  display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6);
}
.ws-card--compact:where(:not(.ws-card__body):not(:has(> .ws-card__head, > .ws-card__body, > .ws-card__foot))) { gap: var(--space-2); padding: 16px 18px; }
/* Rows and tables inside a padded card run to its edges, as they do in a flush one. */
.ws-card:where(:not(.ws-card__body):not(:has(> .ws-card__head, > .ws-card__body, > .ws-card__foot, > .list-rows, > .row-link))) > :is(.list-rows, .data-table) {
  margin-inline: calc(-1 * var(--space-6)); width: calc(100% + 2 * var(--space-6)); max-width: none;
}
.ws-card:where(:not(.ws-card__body):not(:has(> .ws-card__head, > .ws-card__body, > .ws-card__foot, > .list-rows, > .row-link))) > :is(.list-rows, .data-table):last-child { margin-bottom: calc(-1 * var(--space-6)); }
.ws-card > .data-table :is(th, td):first-child { padding-left: var(--space-6); }
.ws-card > .data-table :is(th, td):last-child { padding-right: var(--space-6); }
.ws-card > .data-table tr:last-child td { border-bottom: 0; }
/* Generated cards use .empty-state for a heading's subtitle; there it is plain secondary text, not a centred empty message. */
.ws-card > :is(h1, h2) + p.empty-state { display: block; padding: 0; text-align: left; font: var(--type-body); }
/* A stacked card stretches its children; a lone button keeps its own width. */
.ws-card > .ws-btn { align-self: flex-start; }
.ws-card > :is(h1, h2, h3, p) { margin: 0; }
/* Generated create forms (new project, new environment) are a bare form holding the card and then its button, as the
   hand-written ones are a form.stack: space them the same, and keep the button its own width. */
form:has(> .ws-card) { display: flex; flex-direction: column; gap: var(--space-4); }
form:has(> .ws-card) > .ws-btn { align-self: flex-start; }
/* A card inside a card (a generated list inside a section that already has a title) draws no second frame. */
.ws-card .ws-card:not(.ws-card--compact, .ws-card--muted) { border: 0; box-shadow: none; background: transparent; padding: 0; }
/* Long words (an invite's email address) wrap rather than run out of a signed-out card. */
.card-shell .ws-card :is(p, h1) { overflow-wrap: anywhere; }
/* A table wider than a phone scrolls inside its card rather than out of it. */
/* position: relative keeps the header's absolutely placed screen-reader labels inside the scroll, not widening the page. */
.ws-card:has(> .data-table) { overflow-x: auto; position: relative; }
/* Buttons written side by side in a paragraph (the invite's Sign in / Create an account) keep a gap when they wrap. */
p:has(> .ws-btn + .ws-btn) { display: flex; flex-wrap: wrap; gap: var(--space-3); }
/* Generated forms put .ws-control on the input or select itself, not on a wrapper: it is then the whole control, as wide
   as the form and in body type, and the form's button keeps its own width. */
:is(input, select).ws-control { display: block; width: 100%; box-sizing: border-box; font: var(--type-body); color: var(--text-body); }
form:has(> :is(input, select).ws-control) > .ws-btn { align-self: flex-start; }
/* A status pill fits its text in a column (stack, grid cell) rather than stretching across it. */
.ws-badge { justify-self: start; }
:is(.stack, .ws-field) > .ws-badge { align-self: flex-start; }

/* Layout primitives */
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.cluster { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
/* A labelled field beside its button (What each app gets: App + Show): line the button up with the control, not the label. */
.cluster:has(> .ws-field) { align-items: flex-end; }
.cluster--between { justify-content: space-between; }
.cluster--end { align-items: flex-end; }
/* A list laid out as a cluster: its items carry their own labels, so no markers. */
:is(ol, ul).cluster { list-style: none; margin: 0; padding: 0; }
/* A filter box beside the select it narrows (Import: a repository for each container). */
.filter-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-3); }
@media (max-width: 640px) { .filter-pick { grid-template-columns: minmax(0, 1fr); } }
/* The columns are a default (:where, no specificity), so a generated page's own `grid cols N` / `md N` classes win. */
.grid { display: grid; gap: var(--space-4); }
:where(.grid) { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid__cell { min-width: 0; }

/* Progress bar: style="--p:42" (percent). Inline style is why style-src keeps 'unsafe-inline'. */
.progress { height: 8px; border-radius: var(--radius-pill); background: var(--surface-muted); overflow: hidden; }
.progress::after { content: ""; display: block; height: 100%; width: calc(var(--p, 0) * 1%); background: var(--action-primary); transition: width var(--duration-slow) var(--ease-standard); }

/* Toasts stack */
.ws-toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(480px, calc(100vw - 32px)); } /* the prototype's toast region; info has no DS modifier, so ws-toast--info falls back to the default sage tone */

/* DS shims */
.ws-tab[aria-current="page"] { color: var(--sage-800); border-bottom-color: var(--action-primary); font-weight: var(--weight-bold); }
.ws-tab[aria-current="page"] .ws-tab__count { background: var(--sage-100); color: var(--sage-800); }
a.ws-btn, a.ws-tab, a.ws-navitem { text-decoration: none; }
dialog.ws-dialog { padding: 0; border: 0; }
dialog.ws-dialog:not([open]) { display: none; }
dialog.ws-dialog::backdrop { background: var(--overlay-scrim); }
/* Dialog sizes (inventory §5.3) as classes, not an inline --dialog-width. md is 580px, wider than the DS default (520px). */
.ws-dialog--sm { --dialog-width: 440px; }
.ws-dialog--md { --dialog-width: 580px; }
.ws-dialog--lg { --dialog-width: 640px; }
/* A danger-zone heading (the environment page's "Delete this environment"): the DS has no text-colour utility, and the CSP refuses inline style. */
.heading-danger { color: var(--error-fg); }
/* .ws-sidenav__section is the DS caption label (uppercase, letter-spaced, padded). The generated sidenav uses it to
   wrap a group of items (nav.gen-sidenav-nav > section > ul.gen-navlist > li > a.ws-navitem), so there it is a plain
   group and its label is .sidenav-section-title. */
.gen-sidenav-nav .ws-sidenav__section { font: inherit; letter-spacing: normal; text-transform: none; color: inherit; padding: 0; }
.gen-navlist { display: flex; flex-direction: column; gap: 2px; }

/* Shell (plan 05): focus targets, the signed-out card's padding and the sign-in button (inventory §1.1, §2). */
.app-main:focus:not(:focus-visible),
.card-shell:focus:not(:focus-visible) { outline: none; }

/* The generated Members page's tables (class role "table"). */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }

/* Visually hidden, still read by screen readers (the generated Members page maps its "srOnly" role here). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* New app wizard (plan 11): numbered cards, the open step outlined. */
.wizard { list-style: none; margin: 0; padding: 0; }
.wizard__step h2 { display: flex; align-items: center; gap: var(--space-3); }
.wizard__step[aria-current="step"] { border-color: var(--border-selected); }
.wizard__dot { inline-size: 24px; block-size: 24px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: var(--text-sm); font-weight: var(--weight-semibold); background: var(--surface-muted); color: var(--text-muted); }
.wizard__step[aria-current="step"] .wizard__dot { background: var(--action-primary); color: var(--text-on-primary); }

/* Run progress (plan 07): numbered dots, done steps filled, the current one tinted. */
.run-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.run-step { display: grid; grid-template-columns: 28px 1fr; gap: var(--space-3); align-items: start; }
.run-step__dot { inline-size: 28px; block-size: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: var(--text-sm); font-weight: var(--weight-semibold); background: var(--surface-muted); color: var(--text-muted); }
.run-step--done .run-step__dot { background: var(--action-primary); color: var(--text-on-primary); }
.run-step[aria-current="step"] .run-step__dot { background: var(--sage-100); color: var(--text-strong); }
.run-step__body { min-inline-size: 0; }
.run-step__body code { overflow-wrap: anywhere; }
.run-step__log summary { cursor: pointer; color: var(--text-strong); }
.run-step__log .log-box { margin-block-start: var(--space-2); font-size: 14px; max-height: 320px; }

/* Project Apps tab (plan 08) */
.stages { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0; align-items: stretch; }
.stages__arrow { display: flex; align-items: center; color: var(--text-muted); }
.stage { display: grid; gap: var(--space-1); min-width: 13rem; text-decoration: none; color: inherit; }
.progress { appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--stone-200); overflow: hidden; color: var(--action-primary); }
.progress::-webkit-progress-bar { background: var(--stone-200); }
.progress::-webkit-progress-value { background: var(--action-primary); }
.progress::-moz-progress-bar { background: var(--action-primary); }
/* Variables lists (generated `views list dialog`): one line a variable — name, value, then what kind it is. */
.list-row__main:has(> strong) { flex-direction: row; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.list-row__main:has(> strong) > strong { font-family: var(--font-mono); font-size: var(--text-md); }
.list-row__main:has(> strong) code { display: inline-block; max-width: 32rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
/* "Build and runtime" is every variable's usual scope: only the narrower ones are worth saying. */
.list-row__main [data-scope="All"] { display: none; }
.list-row__main [data-scope] { padding: 1px var(--space-2); border-radius: var(--radius-pill); background: var(--surface-muted); font-size: var(--text-sm); }
.vars-how summary { cursor: pointer; color: var(--text-secondary); font: var(--type-body-sm); }
.vars-how p { margin: var(--space-2) 0 0; color: var(--text-secondary); font: var(--type-body-sm); }
.list-head > .list-row__actions { flex-direction: row; gap: var(--space-2); align-items: center; flex-wrap: wrap; max-width: none; }
.list-row:has(> .list-row__main > strong) { padding-block: var(--space-3); }
/* Edit as text: a wide dialog with a monospace editor, and its preview's changes. */
.vars-text { width: min(48rem, 94vw); }
.vars-text__control { padding: 0; }
.vars-text__control textarea { width: 100%; min-height: 18rem; padding: 10px 14px; border: 0; background: transparent; font-family: var(--font-mono); font-size: var(--text-md); line-height: 1.55; resize: vertical; }
.vars-text__problems { margin: 0; padding-left: var(--space-5); }
.vars-diff { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.vars-diff__row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.vars-diff__value { color: var(--text-secondary); overflow-wrap: anywhere; }
/* Import: the existing-project chooser above the form, and each container's variables. */
.import-into { padding: var(--space-4) var(--space-6); gap: var(--space-2); }
.import-vars { padding-top: var(--space-2); border-top: 1px dashed var(--border-subtle); }
.import-vars__table td { vertical-align: middle; }
.import-vars__value { display: inline-block; max-width: 28rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
/* Update from bunny.net: a variable's value beside its change. */
.sync-value { display: inline-block; max-width: 30rem; overflow-wrap: anywhere; color: var(--text-secondary); margin-left: var(--space-2); }
/* Usage: a card's headline figure, its number large and its words beside it. */
.usage-figure { margin: 0; color: var(--text-secondary); }
/* Sysadmin lists: a search box beside its button, above the table. */
.admin-filter { display: flex; gap: var(--space-3); max-width: 36rem; }
.admin-filter .ws-control { flex: 1; }
/* A generated page's own paragraph (`text "…"`): body copy at a readable measure. */
.page-text { margin: 0; color: var(--text-body); max-width: 72ch; }
.usage-figure strong { font: var(--type-h2); color: var(--text-strong); margin-right: var(--space-1); }
.app-rows { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.app-row { display: grid; grid-template-columns: 1.2fr 1.4fr 1.6fr auto; gap: var(--space-3); align-items: start; padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
.app-row > div { display: grid; gap: var(--space-1); }
/* A ghost button for the link, but its text lines up with the type line beneath it. */
.app-row__name { justify-self: start; font-weight: 600; padding-inline: 0; }
.error-link { color: var(--error-fg); }
.error-text { color: var(--error-fg); }
.warning-text { color: var(--warning-fg); }
@media (max-width: 720px) { .app-row { grid-template-columns: 1fr; } }
.activity { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.activity__item { display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-2); align-items: start; }
.activity__main { display: grid; gap: var(--space-1); }
.activity__title { font-size: var(--text-lg); font-weight: var(--weight-medium); }
.activity__children { list-style: none; margin: 0; padding-left: var(--space-3); border-left: 2px solid var(--border-subtle); }
.activity__age { text-align: right; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-4); }
.log-box { background: var(--stone-100); font-family: var(--font-mono); font-size: 15px; max-height: 440px; overflow: auto; white-space: pre-wrap; padding: var(--space-3); border-radius: var(--radius-md); }

/* Theme switch, under the side navigation: three icon buttons, the chosen one pressed. */
.theme-switch { display: flex; gap: 2px; padding: var(--space-2) var(--space-3); }
.theme-switch [aria-pressed="true"] { background: var(--surface-selected); color: var(--text-on-selected); }

/* Servers: what each server runs, under its status lines. */
.server-workloads { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.server-workloads > li { display: flex; flex-direction: column; gap: 2px; }
.server-workloads .cluster { gap: var(--space-2); }
.server-local-ports { margin-top: var(--space-2); }
.server-local-ports summary { cursor: pointer; color: var(--text-secondary); font: var(--type-body-sm); }
.server-hardening-more { margin-top: var(--space-2); }
.server-hardening-more summary { cursor: pointer; color: var(--text-secondary); font: var(--type-body-sm); }
.list-row__main > .ws-error { margin-top: var(--space-1); }
/* Servers: a status dot, used beside a server's name on the list and its page. */
.server-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--stone-300, var(--text-muted)); }
.server-dot--ok { background: var(--success-fg); }
.server-dot--warn { background: var(--warning-fg); }
.server-dot--bad { background: var(--error-fg); }
/* The list: one row a server, its name and state, then its figures. */
.server-row__title { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 0; }
.server-row__title a { color: var(--text-strong); text-decoration: none; }
.server-row__title a:hover strong { text-decoration: underline; }
.server-row__issues { text-decoration: none; }
.server-row .server-gauges { margin-top: var(--space-2); }
/* Disks, memory and load: a label, a short bar and the figure, side by side. */
.server-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-3) var(--space-5); margin: 0; }
.server-gauge { display: grid; gap: 4px; min-width: 0; }
.server-gauge dt { font: var(--type-body-sm); font-weight: var(--weight-semibold); color: var(--text-body); }
.server-gauge dd { margin: 0; display: grid; gap: 4px; }
.server-gauge .progress { max-width: 16rem; }
.server-gauge--warn .progress { color: var(--error-fg); }
.server-gauge--warn .progress::-webkit-progress-value { background: var(--error-fg); }
.server-gauge--warn .progress::-moz-progress-bar { background: var(--error-fg); }
/* The server page: its headline, what needs attention, then the tabs. */
.server-headline { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.server-headline strong { color: var(--text-strong); }
.server-attention { border-color: var(--error-border); }
.server-attention__list { list-style: none; margin: 0; padding: var(--space-3) var(--space-6) var(--space-5); display: grid; gap: var(--space-3); }
.server-attention__item { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: start; padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-muted); }
.server-attention__item > .ws-icon { font-size: 20px; margin-top: 2px; }
.server-attention__item--bad > .ws-icon { color: var(--error-fg); }
.server-attention__item--warn > .ws-icon { color: var(--warning-fg); }
.server-attention__main { display: grid; gap: 2px; min-width: 0; }
.server-attention__main p { margin: 0; }
.server-attention__title { font-weight: var(--weight-semibold); color: var(--text-strong); }
.server-attention__actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; justify-content: flex-end; }
.server-attention__actions form { margin: 0; }
@media (max-width: 720px) { .server-attention__item { grid-template-columns: auto 1fr; } .server-attention__actions { grid-column: 2; justify-content: flex-start; } }
.server-calm { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--success-fg); }
.server-tabs { display: grid; gap: var(--space-5); }
.ws-tab { text-decoration: none; }
.server-tab-count--bad { background: var(--error-bg) !important; color: var(--error-fg) !important; }
.server-tab-count--warn { background: var(--warning-bg) !important; color: var(--warning-fg) !important; }
.server-panel { display: grid; gap: var(--space-5); }
.server-panel[hidden] { display: none; }
.server-subhead { font: var(--type-body); font-weight: var(--weight-semibold); color: var(--text-strong); margin: 0; }
.server-capacity, .server-capacity + .stack { padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.server-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); margin: 0; }
.server-facts dt { color: var(--text-secondary); }
.server-facts dd { margin: 0; overflow-wrap: anywhere; }
.server-firewall { justify-content: space-between; padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.server-firewall p { margin: 0; }
.server-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.server-timeline > li { display: grid; gap: 2px; padding-left: var(--space-3); border-left: 2px solid var(--border-subtle); }
.server-timeline p { margin: 0; }
.server-apps { width: 100%; border-collapse: collapse; }
.server-apps th { text-align: left; font: var(--type-body-sm); font-weight: var(--weight-semibold); color: var(--text-secondary); padding: 0 var(--space-4) var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); }
.server-apps td { padding: var(--space-2) var(--space-4) var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.server-apps td p { margin: 4px 0 0; }
.server-apps tr:last-child td { border-bottom: 0; }
.server-steps { margin: 0; padding-left: var(--space-5); }
.link-button { padding: 0; border: 0; background: none; color: var(--text-link); font: inherit; cursor: pointer; text-decoration: underline; }
.ws-menu__sep { margin: var(--space-1) 0; border: 0; border-top: 1px solid var(--border-subtle); }
.ws-menu__item--danger { color: var(--error-fg); }

@media (max-width: 1100px) {
  .build-row { grid-template-columns: minmax(0, 1fr); }
}

/* "More" menu: a disclosure whose menu drops below its button. */
.menu-button { position: relative; }
.menu-button > summary { list-style: none; }
.menu-button > summary::-webkit-details-marker { display: none; }
.menu-button__menu { position: absolute; right: 0; top: calc(100% + var(--space-1)); z-index: 20; }
.menu-button__menu form { margin: 0; }

/* App page: the pipeline strip, one card per stage with arrows between, the card holding the next action outlined. */
.pipeline-strip { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.pipeline-strip__arrow { display: flex; align-items: center; align-self: stretch; max-height: 132px; color: var(--text-muted); }
.pipeline-strip__stage { display: flex; flex-direction: column; gap: var(--space-2); flex: 1 1 12rem; min-width: 12rem; max-width: 18rem; }
.pipeline-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); min-height: 132px; box-sizing: border-box; }
.pipeline-card > * { margin: 0; }
.pipeline-card__name { font: var(--type-label); color: var(--text-strong); }
.pipeline-card__status { gap: var(--space-2); }
/* The action sits at the foot of its card, whatever the context above it says. */
.pipeline-card > form, .pipeline-card > div.cluster, .pipeline-card > a.ws-btn { margin-top: auto; align-self: flex-start; }
.pipeline-card--next { border: 2px solid var(--sage-500); padding: calc(var(--space-4) - 1px); }
.pipeline-card--error { background: var(--error-bg); border-color: var(--error-border); }
.pipeline-card--error.pipeline-card--next { border-color: var(--error-fg); }
.pipeline-strip__under { margin: 0; padding: 0 var(--space-1); }
.pipeline-strip__under .ws-switch { white-space: nowrap; }

/* The project's board: an app per row, its latest build and each environment per column. Each cell is the same
   pipeline card the app page's strip uses. On a narrow screen each app becomes its own block, its cells labelled. */
.board-scroll { overflow-x: auto; overflow-y: hidden; }
.board { width: 100%; border-collapse: separate; border-spacing: var(--space-2); }
.board-envs { display: none; }
.board th, .board td { vertical-align: top; text-align: left; padding: 0; }
.board thead th { font: var(--type-label); padding: 0 var(--space-1) var(--space-1); }
.board thead th > * + * { margin-top: var(--space-1); }
.board thead th form { margin: var(--space-1) 0 0; }
.board__env { display: inline-flex; align-items: center; gap: var(--space-1); font: var(--type-label); color: var(--text-strong);
    background: none; border: 0; padding: 0; cursor: pointer; }
button.board__env:hover, button.board__env:focus-visible { color: var(--sage-700); text-decoration: underline; }
.board thead th .meta { display: block; font-weight: normal; }
.board__app { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); min-width: 9rem; padding: var(--space-4) var(--space-2) 0 0; }
.board td { min-width: 12rem; }
.board td .pipeline-card { min-height: 0; height: 100%; }
@media (max-width: 760px) {
    .board, .board tbody, .board tr, .board th, .board td { display: block; width: auto; margin: 0; }
    .board thead { display: none; }
    .board tr { padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
    .board__app { flex-direction: row; flex-wrap: wrap; padding: 0 0 var(--space-2); }
    .board td { margin-top: var(--space-2); }
    .board td::before { content: attr(data-label); display: block; font: var(--type-label); margin-bottom: var(--space-1); }
    .board-envs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
}

/* Recent builds: one row per build, its log opening underneath. */
.build-rows { list-style: none; margin: 0; padding: 0; }
.build-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-4); row-gap: var(--space-2);
  padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border-subtle); }
.build-row:first-child { border-top: 0; }
.build-row__line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-width: 0; }
.build-row__line > :not(.build-row__message) { flex: none; white-space: nowrap; }
.build-row__message { flex: 1 1 8rem; min-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.build-row__actions { display: flex; align-items: center; gap: var(--space-2); }
.build-row__actions form { margin: 0; }
.build-row__note, .build-row__log { grid-column: 1 / -1; margin: 0; }
.build-row__log { padding-bottom: var(--space-2); }
.build-row [data-log-toggle][aria-expanded="true"] { background: var(--surface-selected); }
.log-box { position: relative; }
.log-box mark[data-first-error] { background: var(--error-bg); color: var(--error-fg); font-weight: var(--weight-semibold); }

/* Setup: a plain list of rows, each opening its drawer. */
.setup-rows { list-style: none; margin: 0; padding: 0; }
.setup-rows > li + li { border-top: 1px solid var(--border-subtle); }
.setup-row {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); width: 100%; min-height: 56px;
  padding: var(--space-3) var(--space-6); box-sizing: border-box; border: 0; background: transparent; color: var(--text-body); font: inherit; text-align: left; cursor: pointer;
}
.setup-row:hover { background: var(--surface-hover); }
a.setup-row { text-decoration: none; }
.setup-rows > li:first-child .setup-row { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.setup-rows > li:last-child .setup-row { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.setup-row__label { font: var(--type-label); color: var(--text-strong); }
.setup-row__value { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-row > .ws-icon { color: var(--text-muted); }

/* Drawers: a dialog against the right edge, full height. */
dialog.ws-dialog--drawer[open] {
  margin: 0 0 0 auto; width: min(600px, 100vw); height: 100vh; max-height: 100vh; border-radius: 0;
  display: flex; flex-direction: column; animation: none;
}
.ws-dialog--drawer .ws-dialog__body { flex: 1; overflow-y: auto; }
.drawer-section { border-top: 1px solid var(--border-subtle); padding-top: var(--space-4); }
.drawer-section > summary { cursor: pointer; font: var(--type-label); color: var(--text-strong); }
.drawer-section > .stack { margin-top: var(--space-4); }
.ws-dialog--drawer h3 { font: var(--type-h4); color: var(--text-strong); margin: 0; }
/* Sections of a drawer sit further apart than the lines inside them. */
.ws-dialog--drawer .ws-dialog__body > .stack { gap: var(--space-8); }
/* Rows run to the drawer's text edge, not a card's: their headings and hints are not inset. */
.ws-dialog--drawer .list-row { padding-inline: 0; }
.ws-dialog--drawer h4 { font: var(--type-label); color: var(--text-strong); margin: 0; }
.build-rows.ws-card, .setup-rows.ws-card { display: block; }
.ws-dialog--drawer .ws-dialog__foot { border-top: 1px solid var(--border-subtle); padding-top: var(--space-4); }
/* A heading inside a card's section, a step below the card's own title. */
.subheading { font: var(--type-label); font-size: var(--text-md); color: var(--text-strong); margin: 0; }

/* An app's domains in one environment (Advanced → Where it runs): each with its status beside it. */
.domain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.domain-list > li { display: flex; flex-direction: column; gap: 2px; }
.domain-list .cluster { gap: var(--space-2); }

/* An app's last lines of output (LOG1): scrolls rather than stretching the drawer. */
.log-tail { max-height: 24rem; overflow: auto; white-space: pre-wrap; word-break: break-all; font-size: 0.8125rem;
  padding: 0.75rem; border-radius: 0.5rem; background: var(--ws-surface-muted, rgba(0, 0, 0, 0.04)); margin: 0; }

/* A build's Tests (BuildTests/Index): the verdict, a bar of passed / failed / skipped, the figures, the failures, then every test. */
.tests-summary { display: grid; gap: var(--space-3); padding: var(--space-5) var(--space-6); }
.tests-summary__verdict { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: 1.25rem; font-weight: var(--weight-semibold); }
.tests-summary__verdict--green { color: var(--success-fg); }
.tests-summary__verdict--red { color: var(--error-fg); }
.tests-bar { display: block; width: 100%; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-muted); }
.tests-bar__passed { fill: var(--success-border); }
.tests-bar__failed { fill: var(--error-border); }
.tests-bar__skipped { fill: var(--border-strong); }
.build-row__tests { text-decoration: none; }
.tests-figures { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-8); margin: 0; }
.tests-figures > div { display: grid; }
.tests-figures dt { color: var(--text-muted); font-size: 0.875rem; }
.tests-figures dd { margin: 0; font-family: var(--font-mono); font-size: 1.125rem; color: var(--text-strong); }
.tests-figures__bad { color: var(--error-fg) !important; }

.test-failure { display: grid; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-left: 4px solid var(--error-border); }
.test-failure__head { display: flex; justify-content: space-between; align-items: start; gap: var(--space-4); }
.test-failure__head p { margin: 0; }
.test-failure__name { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.test-failure__message { margin: 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--error-bg); color: var(--error-fg);
  font-family: var(--font-mono); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.test-failure__more > summary { cursor: pointer; color: var(--text-secondary); }
.test-failure__more > pre { margin: var(--space-2) 0 0; }
.test-stack { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.test-failure > * { min-width: 0; }
.test-class__ns { font-weight: normal; color: var(--text-muted); }
.test-stack mark { background: none; color: var(--text-strong); font-weight: var(--weight-semibold); }

.tests-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); }
.tests-search { margin: 0; min-width: min(20rem, 100%); }
.tests-filter { padding: 0 var(--space-6); }
.tests-filter__order { margin-left: auto; }
.tests-project { margin: var(--space-4) var(--space-6) var(--space-2); font-size: 0.9375rem; color: var(--text-secondary); }
.test-class { border-top: 1px solid var(--border-subtle); }
.test-class__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-6); cursor: pointer; }
.test-class__head:hover { background: var(--surface-hover); }
.test-class__name { font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.test-rows { list-style: none; margin: 0; padding: 0 0 var(--space-2); }
.test-row { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; align-items: start; gap: var(--space-2); padding: var(--space-1) var(--space-6) var(--space-1) var(--space-8); font-size: 14px; }
.test-row:hover { background: var(--surface-hover); }
.test-row__name { overflow-wrap: anywhere; }
.test-row__why { display: block; color: var(--text-muted); font-family: var(--font-body); overflow-wrap: anywhere; }
.test-row--passed .test-row__icon { color: var(--success-fg); }
.test-row--failed .test-row__icon, .test-row--failed .test-row__why { color: var(--error-fg); }
.test-row--skipped .test-row__icon { color: var(--text-muted); }
.test-row__time { white-space: nowrap; }

/* A database's page (DatabaseApps/Show): its databases beside its users, and its two add forms side by side. */
.db-columns { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); align-items: start; }
.db-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-4); margin: 0; }
.db-facts dd { margin: 0; }
/* Its tabs (Overview, Figures, Databases and users, Connected apps, Backups, its admin tool), a card for each part. */
.db-tabs { display: grid; gap: var(--space-5); }
.db-panel { display: grid; gap: var(--space-5); align-content: start; min-width: 0; }
.db-panel[hidden] { display: none; }
.db-panel > .db-columns { gap: var(--space-5); }
.db-env + .db-env { margin-top: var(--space-8); }
.db-danger { margin-top: var(--space-8); }
/* A closed <details> card: no gap left after its summary (Chrome lays out its hidden content box). Wide tables scroll
   inside their card on a narrow screen rather than widening the page. */
:is(.db-danger, .db-panel) details:not([open]) { gap: 0; }
.db-panel .ws-card__body, .db-panel .db-columns > .stack { min-width: 0; overflow-x: auto; }
.db-more > summary { cursor: pointer; font-weight: var(--weight-semibold); color: var(--text-strong); }
.db-more[open] > summary { margin-bottom: var(--space-4); }
.db-recent { list-style: none; margin: 0; display: grid; gap: var(--space-2); }
.db-recent li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-4); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-subtle); }
.db-recent li:last-child { border-bottom: 0; padding-bottom: 0; }
.db-setting + .db-setting { padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }

/* Charts (Ui/Sparkline): one line colour per mode, each checked against its card surface with the dataviz validator
   (lightness band, chroma floor, contrast >= 3:1). The brand's sage reads as grey for a data line, so this is a more
   saturated green from the same family. */
:root { --chart-line: #24845A; }
:root[data-theme="dark"] { --chart-line: #33A06F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-line: #33A06F; } }

.spark { margin: 0; display: grid; gap: var(--space-1); min-width: 0; }
.spark__head { display: flex; justify-content: space-between; gap: var(--space-2); align-items: baseline; }
.spark__title { color: var(--text-muted); font-size: 0.8125rem; }
.spark__now { color: var(--text-strong); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.spark__plot { width: 100%; height: 56px; display: block; overflow: visible; }
.spark__line { fill: none; stroke: var(--chart-line); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.spark__area { fill: var(--chart-line); opacity: 0.12; stroke: none; }
.spark__dot { fill: var(--chart-line); }
.spark__base { stroke: var(--border-subtle); stroke-width: 1px; }
.spark__hit rect { fill: transparent; }
.spark__cross { stroke: var(--text-muted); stroke-width: 1px; opacity: 0; }
.spark__hit:hover .spark__cross { opacity: 1; }
.spark__foot { display: flex; justify-content: space-between; font-size: 0.75rem; }
.spark__table summary { cursor: pointer; font-size: 0.75rem; }
.db-tiles { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); margin: 0; }
.db-tiles > div { display: grid; gap: 2px; }
.db-tiles dt { color: var(--text-muted); font-size: 0.8125rem; }
.db-tiles dd { margin: 0; color: var(--text-strong); font-size: 1.125rem; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.db-tiles dd small { display: block; color: var(--text-muted); font-size: 0.75rem; font-weight: normal; }
/* The project page's databases (ProjectDatabasesViewComponent): a card each, apart from the apps' pipeline. */
.project-dbs { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); list-style: none; margin: 0; padding: 0; }
.db-query { max-width: 40rem; white-space: pre-wrap; word-break: break-word; font-size: 0.8125rem; }

.inline-form { display: inline-flex; margin-left: var(--space-2); vertical-align: middle; }

/* Sign-in and security (generated Views/TwoStep, StepUp, LostPasskey, AccountSecurity, StaffNeedsTwoStep): their
   gen-auth* classes, in the card shell's terms. Their inputs carry ws-field, drawn here as a ws-control. */
.gen-authform { display: flex; flex-direction: column; gap: var(--space-5); }
.gen-authhead { display: flex; flex-direction: column; gap: var(--space-2); }
.gen-authtitle { font: var(--type-display); color: var(--text-strong); margin: 0; }
.gen-authsub { font: var(--type-body); color: var(--text-secondary); margin: 0; }
.gen-authfield { display: flex; flex-direction: column; gap: 6px; }
.gen-authform section { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }
.gen-authform h2 { font: var(--type-label); font-size: var(--text-lg); color: var(--text-strong); margin: 0; }
.gen-authform h3 { font: var(--type-label); color: var(--text-strong); margin: 0; }
.gen-authform p { margin: 0; }
.gen-authform ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.gen-authform form { display: flex; flex-direction: column; gap: var(--space-2); }
.gen-authform input.ws-field, .passkey-signin input.ws-field {
  min-height: var(--control-md); padding: 0 14px; box-sizing: border-box; background: var(--surface-card);
  border: 1px solid var(--border-control); border-radius: var(--radius-md); font: var(--type-body); color: var(--text-body);
}
.gen-authform input.ws-field:focus { outline: var(--focus-width) solid var(--focus-ring); outline-offset: 1px; border-color: var(--border-strong); }
.gen-authform button:not([class]) {
  align-self: flex-start; min-height: var(--control-md); padding: 0 14px; border: 1px solid var(--border-default);
  border-radius: var(--radius-md); background: var(--surface-card); color: var(--text-strong); font: inherit; cursor: pointer;
}
.gen-steps { margin: 0; padding-left: 1.25em; display: flex; flex-direction: column; gap: var(--space-1); }
.gen-qr { align-self: center; width: 200px; padding: var(--space-3); background: #fff; border-radius: var(--radius-md); }
.gen-qr svg { display: block; width: 100%; height: auto; }
.gen-key, .gen-codes { font-family: var(--font-mono); font-size: var(--text-lg); letter-spacing: 0.05em; color: var(--text-strong); }
.gen-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); list-style: none; padding: 0; margin: 0; }
.passkey-signin form { display: flex; flex-direction: column; }
.passkey-signin .ws-btn { width: 100%; }
/* The Security page's activity table scrolls inside its own region (the generator's class name for it). */
.aw-auth__scroll { overflow-x: auto; }
.gen-authform, .gen-authform section, .gen-authform form { min-width: 0; }
.aw-auth__scroll table { border-collapse: collapse; width: 100%; font: var(--type-body-sm); }
.aw-auth__scroll th, .aw-auth__scroll td { text-align: left; padding: var(--space-2); border-bottom: 1px solid var(--border-subtle); }
.aw-auth__scroll caption { text-align: left; color: var(--text-secondary); padding-bottom: var(--space-2); }

/* The variables table (Views/Shared/Variables/_Table): a row a name, a column a level. It scrolls sideways inside the
   card, its name column staying put; a blank cell's placeholder is what that level gets, and from where. */
.vars-table__scroll { overflow-x: auto; margin-inline: calc(-1 * var(--space-6)); padding-inline: var(--space-6); }
.vars-table__scroll:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: -2px; }
.vars-table { border-collapse: collapse; width: 100%; font: var(--type-body-sm); }
.vars-table :is(th, td) { padding: var(--space-2); border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: top; }
.vars-table thead th { font: var(--type-label); color: var(--text-strong); white-space: nowrap; }
.vars-table thead th .meta { display: block; font: var(--type-caption); font-weight: normal; }
.vars-table tbody th { position: sticky; left: 0; z-index: 1; background: var(--surface-card); min-width: 11rem; max-width: 16rem; overflow-wrap: anywhere; }
.vars-table tbody th .meta { display: block; font: var(--type-caption); }
.vars-table td { min-width: 12rem; }
.vars-table__input {
  width: 100%; min-height: 36px; padding: 0 10px; box-sizing: border-box; border: 1px solid var(--border-control);
  border-radius: var(--radius-sm); background: var(--surface-card); color: var(--text-body); font: var(--type-body-sm); font-family: var(--font-mono);
}
.vars-table__input::placeholder { color: var(--text-muted); font-style: italic; font-family: var(--font-body); }
.vars-table__input:focus { outline: var(--focus-width) solid var(--focus-ring); outline-offset: 1px; border-color: var(--border-strong); }
.vars-table__input[data-dirty] { border-color: var(--border-selected); background: var(--surface-selected); }
.vars-table__cell--invalid .vars-table__input { border-color: var(--error-fg); }
.vars-table .ws-error { margin: 4px 0 0; font: var(--type-caption); }
.vars-table__remove { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font: var(--type-caption); color: var(--text-secondary); }
.vars-table__new th { background: var(--surface-card); }
/* Where a blank cell's grey value comes from: shown only while the cell is blank. */
.vars-table__from { display: none; margin-top: 2px; font: var(--type-caption); color: var(--text-muted); }
.vars-table__input:placeholder-shown + .vars-table__from { display: block; }
@media (max-width: 640px) {
  .vars-table tbody th { min-width: 7.5rem; max-width: 9rem; }
  .vars-table td { min-width: 10rem; }
}
.vars-levels > summary { cursor: pointer; font: var(--type-label); color: var(--text-strong); padding: var(--space-2) 0; }
.vars-levels[open] > summary { margin-bottom: var(--space-4); }

/* A disabled app on the board: its badge says so, and its stages are dimmed (they offer nothing to do). */
.board__row--disabled td { opacity: 0.55; }

/* ── Consistency pass (the 2026-11-15 UI review) ──────────────────────────────────────────────────────────────────
   One rule each for what pages drew their own way. Later than the rules it refines, so it wins at equal specificity. */

/* Page heads: the title block takes the room it needs and the actions stay on its right, wrapping under it only on a
   narrow screen, whatever the subtitle's length. Subtitles keep a readable measure. */
.page-head > :first-child { flex: 1 1 28rem; min-width: 0; }
.page-head__sub { max-width: 72ch; }
.page-head__actions { flex: none; }
@media (max-width: 640px) {
  /* Stacked, a flex-basis would be a height: the title block takes only its own. */
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head > :first-child { flex: none; }
  .page-head__actions { flex-wrap: wrap; }
}

/* Every card's content starts 20px below its top edge, whichever way the card is built. */
.ws-card:where(:not(.ws-card__body):not(:has(> .ws-card__head, > .ws-card__body, > .ws-card__foot, > .list-rows, > .row-link))) { padding-top: 20px; }
.ws-card.ws-card__body { padding-top: 20px; }

/* A message that a card's list is empty: plain secondary text where the list would be, the same in every card. */
:is(.ws-card, .ws-card__body) > p.empty-state { display: block; padding: 0; text-align: left; font: var(--type-body-sm); color: var(--text-secondary); }

/* Tables in a card's body run to its edges as they do in a bare card, and scroll inside it rather than widen the page. */
:is(.ws-card, .ws-card__body):has(> .data-table) { overflow-x: auto; }
.ws-card__body > .data-table { margin-inline: calc(-1 * var(--space-6)); width: calc(100% + 2 * var(--space-6)); max-width: none; }
.ws-card__body > .data-table :is(th, td):first-child { padding-left: var(--space-6); }
.ws-card__body > .data-table :is(th, td):last-child { padding-right: var(--space-6); }
.data-table time { white-space: nowrap; }
/* A table whose cells carry data-label stacks on a phone: one block a row, each value under its column's name. */
@media (max-width: 640px) {
  /* A server's apps, as each data-labelled table: one block an app. */
  .server-apps thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .server-apps :is(tbody, tr, td) { display: block; }
  .server-apps tr { padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
  .server-apps td { padding: 2px 0; border: 0; }
  .server-apps td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font: var(--type-caption); color: var(--text-muted); }
  .data-table:has(td[data-label]) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .data-table:has(td[data-label]) :is(tbody, tr, td) { display: block; width: auto; }
  .data-table:has(td[data-label]) tr { padding: var(--space-3) var(--space-6); border-bottom: 1px solid var(--border-subtle); }
  .data-table:has(td[data-label]) td { padding: 2px 0; border: 0; }
  .data-table:has(td[data-label]) td:is(:first-child, :last-child) { padding-inline: 0; }
  .data-table:has(td[data-label]) td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font: var(--type-caption); color: var(--text-muted); }
}

/* A card's own section headings (Get set up, the wizard's steps) are card titles, not page sections. */
:is(.getting-started, .wizard__step) h2 { font: var(--type-h3); }
/* Get set up sits under the page's title, not above it, with the column's own gap. */
.getting-started { margin-bottom: 0; }
.app-main__inner:has(> .getting-started) > .crumbs { order: -2; }
.app-main__inner:has(> .getting-started) > .page-head { order: -1; }
@media (max-width: 640px) {
  .getting-started__step { flex-wrap: wrap; }
  .getting-started__step > .ws-btn, .getting-started__step > form { margin-left: calc(22px + var(--space-3)); }
}

/* The add-an-app wizard: a step not yet open is one line, not a full card. */
.wizard__step:not([aria-current="step"]) { padding-block: var(--space-4); gap: var(--space-1); }
.wizard__step:not([aria-current="step"]) h2 { font: var(--type-h4, var(--type-label)); }

/* Fieldsets group; they don't draw the browser's grooved frame. */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Activity: every row's badge and time line up in their own columns, and titles are body-sized. */
.activity { grid-template-columns: minmax(0, 1fr) auto auto; column-gap: var(--space-2); }
.activity > .activity__item { grid-column: 1 / -1; grid-template-columns: subgrid; }
.activity__age { grid-column: 3; }
.activity__title { font-size: var(--text-md); }
@media (max-width: 640px) {
  .activity { grid-template-columns: auto minmax(0, 1fr); }
  .activity__main { grid-column: 1 / -1; }
  .activity__age { grid-column: auto; text-align: left; }
}

/* On a phone: the pipeline strip runs down, its arrows pointing down; setup rows and build rows give their text a line
   of its own instead of cutting it off; whole-row links keep their chevron at the side. */
@media (max-width: 640px) {
  .pipeline-strip { flex-direction: column; align-items: stretch; }
  .pipeline-strip__stage { max-width: none; flex: none; min-width: 0; }
  .pipeline-strip__arrow { align-self: center; max-height: none; transform: rotate(90deg); }
  .setup-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .setup-row__value { grid-column: 1; white-space: normal; overflow-wrap: anywhere; }
  .setup-row > .ws-icon { grid-column: 2; grid-row: 1 / span 2; }
  .build-row__message { flex-basis: 100%; white-space: normal; }
  .row-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); }
  .row-link > :not(.row-link__chevron) { grid-column: 1; }
  .row-link__chevron { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}

/* Lists whose head holds only actions (generated lists without a title) put them at the start, as card heads do. */
.ws-card__body > .list-row, .ws-card__body > * > .list-row { padding-inline: 0; }

/* Server gauges: a figure without a bar (load) lines up with the figures under the bars beside it. */
.server-gauge dd { align-content: end; }

/* Sign-in and security pages (gen-auth*). In the sign-in shell (2-step setup, codes, step-up, lost passkey) the form is a
   card with its title inside, as Set up's is; in the app (Sign-in and security) it is a page, its head like any page's.
   Either way the title is a page title, not the display size that broke "2-step" over two lines. */
.gen-authtitle { font: var(--type-h1); text-wrap: pretty; }
.card-shell .gen-authform {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); padding: 20px var(--space-6) var(--space-6);
}
.app-main .gen-authform { max-width: 44rem; gap: var(--space-6); }
.app-main .gen-authhead { gap: 6px; }
.app-main .gen-authsub { max-width: 72ch; }
.app-main .gen-authform section { padding-top: var(--space-5); }
.app-main .aw-auth__scroll { margin-inline: 0; }

/* A long value in a variables list row is cut at the row's width, never past the screen's. */
.list-row__main:has(> strong) code { max-width: min(32rem, 100%); }
.list-row__main > * { min-width: 0; max-width: 100%; }

/* Touch screens: everything tappable is at least 40px tall, so a thumb hits what it aims at. Desktop keeps its density. */
@media (pointer: coarse) {
  .crumbs__link { display: inline-flex; align-items: center; min-height: 40px; }
  .ws-btn--sm { height: auto; min-height: 40px; }
  .ws-iconbtn { width: 40px; height: 40px; }
  details > summary:not(.ws-btn) { padding-block: 8px; }
  label:has(> input[type="checkbox"], > input[type="radio"]) { min-height: 40px; display: inline-flex; align-items: center; gap: var(--space-2); }
  .ws-switch { min-height: 40px; }
  .link-button { min-height: 40px; }
  .sidenav-foot .ws-iconbtn, .app-navbar .ws-iconbtn { width: 44px; height: 44px; }
}

/* A project's activity beyond its newest ten, behind "Show N more". */
.activity-more > summary { cursor: pointer; font: var(--type-label); color: var(--text-link); }
.activity-more[open] > summary { margin-bottom: var(--space-3); }

/* Adding a domain (Views/AppDomains/Add.cshtml): its three steps, the one it's at marked, those done ticked. */
.domain-steps { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); padding: 0; margin: 0 0 var(--space-5); }
.domain-steps__step { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-muted); font: var(--type-label); }
.domain-steps__n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 14px; }
.domain-steps__step--now { color: var(--text-strong); }
.domain-steps__step--now .domain-steps__n { background: var(--action-primary); border-color: transparent; color: var(--text-on-primary); }
.domain-steps__step--done { color: var(--success-fg); }

/* The DNS record to add: label and value side by side, stacked on a phone. */
.dns-record { display: grid; gap: var(--space-2); margin: 0; padding: var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.dns-record > div { display: grid; grid-template-columns: 8rem 1fr; gap: var(--space-3); align-items: center; }
.dns-record dt { font: var(--type-label); color: var(--text-muted); }
.dns-record dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); overflow-wrap: anywhere; }
@media (max-width: 480px) { .dns-record > div { grid-template-columns: 1fr; gap: 0; } }

/* A sysadmin's announcement (Views/Shared/_Announcement.cshtml), above every signed-in page. Hidden by ui.js once dismissed. */
.announcement { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-5); border-radius: var(--radius-md); border: 1px solid; }
.announcement--info { background: var(--note-bg); border-color: var(--note-border); color: var(--note-fg); }
.announcement--warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-fg); }
.announcement > .ws-icon { margin-top: 3px; flex: none; }
.announcement__text { flex: 1; margin: 0; }
.announcement__text a { color: inherit; font-weight: var(--weight-semibold); }
.announcement[hidden] { display: none; }

/* People and SSH keys (Views/Shared/_PeopleAccounts.cshtml): one card an account; its edit form and the add form fold. */
.people-list { list-style: none; padding: 0; margin: 0; }
.people-edit > summary, .people-add > summary { cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2); font: var(--type-label); color: var(--text-link); min-height: 40px; }
.people-edit[open], .people-add[open] { flex-basis: 100%; }
.people-edit[open] > summary, .people-add[open] > summary { margin-bottom: var(--space-3); }

/* ── Phones (the 2026-11-15 mobile run-through) ─────────────────────────────────────────────────────────────────── */

/* A drawer is the visible screen's height (dvh: iOS's 100vh runs under Safari's toolbar), and its footer clears the
   home indicator. */
dialog.ws-dialog--drawer[open] { height: 100dvh; max-height: 100dvh; }
.ws-dialog--drawer .ws-dialog__foot { padding-bottom: max(var(--space-6), env(safe-area-inset-bottom)); }

/* A dialog's fields are spaced as a form's are; its radios are full-height rows. */
dialog.ws-dialog:not(.ws-dialog--drawer) .ws-dialog__body { display: flex; flex-direction: column; gap: var(--space-4); }
.ws-radiogroup label { display: flex; align-items: center; gap: var(--space-2); min-height: 40px; }

/* An address or path beside other things in a row may break, rather than run out of its drawer. */
.cluster > .mono { min-width: 0; overflow-wrap: anywhere; }

/* The variables table: its name column casts an edge over the columns that scroll under it, and Save stays in reach at
   the bottom of the screen while there's a long table to edit. */
.vars-table tbody th { box-shadow: 1px 0 0 var(--border-subtle), 4px 0 6px -4px rgb(0 0 0 / 0.15); }
form[data-vars-table] > .cluster:has([data-vars-dirty]) {
  position: sticky; bottom: 0; z-index: 2; background: var(--surface-card);
  margin-inline: calc(-1 * var(--space-6)); padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border-subtle);
}

@media (max-width: 640px) {
  /* A menu opened from a button on the left of its row opens rightwards, onto the screen. */
  .page-head__actions .menu-button__menu { left: 0; right: auto; }
  /* Times in tables may wrap on a phone; the column they're in would otherwise take the row. */
  .data-table time { white-space: normal; }
  /* Row actions start at the row's left, under its text, instead of trailing raggedly at the right. */
  .list-row__actions { justify-content: flex-start; }
  .list-head + .empty-state { margin-top: var(--space-3); }
  /* A card's title keeps a short action beside it. */
  .ws-card__head > :first-child { flex-basis: 0; }
  /* Inside a drawer, cards don't add a second frame and padding to the drawer's own. */
  .ws-dialog--drawer .ws-dialog__body { padding-inline: var(--space-4); }
  .ws-dialog--drawer .ws-dialog__body .ws-card:not(.ws-card--muted) { border: 0; box-shadow: none; background: none; padding-inline: 0; }
  .ws-dialog--drawer .ws-dialog__body .ws-card--muted { padding: var(--space-4); }
  dialog.ws-dialog--drawer[open] { width: 100vw; max-width: 100vw; }
  /* The variables table shows about one environment at a time beside the names; the rest scroll under them. */
  .vars-table td { min-width: calc(100vw - 8rem - 4rem); }
  .vars-table tbody th { width: 8rem; min-width: 8rem; max-width: 8rem; overflow-wrap: normal; word-break: normal; }
  /* Tabs that don't fit snap as they scroll, and fade at the edge so it's plain there's more. */
  .ws-tabs { scroll-snap-type: x proximity; scrollbar-width: none; }
  .ws-tabs[data-overflows]:not([data-scrolled-end]) { mask-image: linear-gradient(to right, #000 85%, transparent); }
  .ws-tab { scroll-snap-align: start; flex: none; }
}

/* Inputs are at least 16px on touch screens: iOS zooms the page into any smaller one, and leaves it zoomed. */
@media (pointer: coarse) {
  :is(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea) { font-size: max(16px, 1em); }
}

/* The variables table's name column stays flush with the card's edge as the rest scrolls under it: the card's inset is
   the first and last cells' padding, not the scroll area's, which a sticky column would stop short of. */
.vars-table__scroll { padding-inline: 0; }
.vars-table :is(th, td):first-child { padding-left: var(--space-6); }
.vars-table :is(th, td):last-child { padding-right: var(--space-6); }
.vars-table thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface-card); }

/* The audit log's filters (generated details.audit-filters): folded away on a phone until wanted, open on a wide
   screen (ui.js opens [data-open-wide] there) and whenever one is set. */
.audit-filters > summary { cursor: pointer; font: var(--type-label); color: var(--text-strong); }
.audit-filters[open] > summary { margin-bottom: var(--space-3); }

/* A server's Installed tab (_ServerInstalled): long lists in columns on a wide screen, the packages' scrolling in place. */
.ledger-list { list-style: none; margin: 0; padding: 0; columns: 2 18rem; column-gap: var(--space-6); font: var(--type-body-sm); }
.ledger-list > li { break-inside: avoid; padding: 2px 0; overflow-wrap: anywhere; }
.ledger-list--packages { max-height: 24rem; overflow-y: auto; }
.ledger-filter { max-width: 20rem; min-height: 36px; padding: 0 12px; border: 1px solid var(--border-control); border-radius: var(--radius-md); font: var(--type-body-sm); }

/* A server's snapshot settings and restore notes (_ServerSnapshots), folded under their summaries. */
.snapshot-settings > summary { cursor: pointer; font: var(--type-label); color: var(--text-strong); }
.snapshot-settings[open] > summary { margin-bottom: var(--space-3); }

/* Restores onto a server (_ServerSnapshots): each one, and a rebuild's steps. */
.restore-item + .restore-item { padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }
.restore-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font: var(--type-body-sm); }
.restore-steps .ws-icon { vertical-align: -2px; }
