/* ---- Display face (2026-09-03, catalog heroes) ----
   Barlow Condensed, self-hosted. Two static weights, 'latin' subset only
   (~22KB each), taken from Google's own woff2 builds — NOT linked from
   fonts.googleapis.com, which would be a third-party request on every page
   load for a UI that otherwise fetches nothing off-origin. Licence and
   copyright notice ship beside them in 'dist/fonts/OFL.txt' (SIL OFL 1.1),
   which is what redistributing the font requires.

   The 'unicode-range' is what makes the fallback stack in '--display' do
   the right thing per glyph: anything outside latin (a tenant name in
   Cyrillic, say) is drawn by the next family instead of by a tofu box.

   Adding a weight means a new file in 'dist/fonts', a new '@font-face'
   here, and a new COPY line in 'control-plane/frontend/Containerfile' —
   the image copies static assets one by one, so a font that is not listed
   there works locally and 404s in prod. */
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/barlow-condensed-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/barlow-condensed-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e3e6ee;
  --text: #1c2130;
  --text-muted: #6b7280;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-contrast: #ffffff;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --success: #067647;
  --success-bg: #ecfdf3;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #92400e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);

  /* The three type roles, named once so a component picks a role rather
     than restating a stack. '--sans' is what 'html, body' already set;
     '--display' is the condensed face the heroes are built on; '--mono'
     was open-coded in ~15 places before these existed. */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", var(--sans);
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* 'font-synthesis: none' matters more now there is a real display face:
     without it a browser lacking the 700 weight would smear the 600 rather
     than fall through to Arial Narrow. */
  font-synthesis: none;
}

/* (bh), feedback 439495f0: dark theme. Overrides the same token set every
   component is already built on ('--bg'/'--surface'/'--border'/'--text'/
   '--text-muted'/'--brand'/'--brand-dark'/'--danger'/'--danger-bg'/
   '--warn-*'/'--shadow'), so the vast majority of the UI (cards, buttons,
   inputs, tables, nav, kv-rows, pills) is dark-correct for free. Scoped to
   '.app-shell', same as the width classes below — the pre-auth screens have
   no preference to read yet, same reasoning as 'render_width_toggle'.

   Two tiers, same shape as WIDE UI MODE's Auto/explicit split: the
   'prefers-color-scheme' query drives 'ThemeAuto' (guarded so an explicit
   '.app-theme-light' choice can still opt back out of a dark OS), and
   '.app-shell.app-theme-dark' pins dark regardless of the system setting.

   The section-hero illustrations used to be the one hole in that: data URIs
   with hardcoded hex fills, which could not resolve these variables and
   stayed light-coloured here. The catalog treatment (2026-09-03) deleted
   them — a hero is type and token-coloured fills now, so there is no
   longer any hex in this stylesheet that a palette change can leave
   behind. */
@media (prefers-color-scheme: dark) {
  .app-shell:not(.app-theme-light) {
    --bg: #10121a;
    --surface: #1a1d29;
    --border: #2e3242;
    --text: #e6e8f0;
    --text-muted: #9aa0b4;
    --brand: #818cf8;
    --brand-dark: #a5b4fc;
    --brand-contrast: #0f1117;
    --danger: #f87171;
    --danger-bg: #3a1a1a;
    --success: #4ade80;
    --success-bg: #14291d;
    --warn-bg: #3a2c0f;
    --warn-border: #92400e;
    --warn-text: #fde68a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

.app-shell.app-theme-dark {
  --bg: #10121a;
  --surface: #1a1d29;
  --border: #2e3242;
  --text: #e6e8f0;
  --text-muted: #9aa0b4;
  --brand: #818cf8;
  --brand-dark: #a5b4fc;
  --brand-contrast: #0f1117;
  --danger: #f87171;
  --danger-bg: #3a1a1a;
  --success: #4ade80;
  --success-bg: #14291d;
  --warn-bg: #3a2c0f;
  --warn-border: #92400e;
  --warn-text: #fde68a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* A few literal (non-token) colours that would otherwise stay light-mode
   bright inside a dark '.app-shell': the status pills, the ones most likely
   to be seen often enough to jar.

   Two tiers, like the token block above, and the second one must stay
   inside the media query. It used to sit outside it (projectz feature
   bf0ccc65): '.app-shell:not(.app-theme-light)' alone is also true of
   ThemeAuto on a *light* system, so these dark colours were applied there.
   On '.btn-secondary:hover' that was a near-black fill under the light
   theme's near-black text: every secondary button unreadable under the
   pointer. That rule is gone from here altogether; the button's hover is
   built from tokens now (see '.btn-secondary:hover'), so it needs no
   override in either theme. */
.app-shell.app-theme-dark .status-pill-archived,
.app-shell.app-theme-dark .status-pill-other {
  background: #2e3242;
  color: #b8bed0;
}

@media (prefers-color-scheme: dark) {
  .app-shell:not(.app-theme-light) .status-pill-archived,
  .app-shell:not(.app-theme-light) .status-pill-other {
    background: #2e3242;
    color: #b8bed0;
  }
}

/* 'html, body' sit outside '.app-shell' and never receive the dark
   overrides above, so they always paint the light root '--bg'. Invisible
   normally because '.app-shell' covers the viewport at 100vh, but a capped
   width (Narrow, or Auto below the wide breakpoint) leaves left/right
   margins where 'body' shows through — light bars either side of a dark,
   narrow column (feedback 6ee4ff0b). ':has' lets 'body' react to the same
   theme state '.app-shell' carries without duplicating the width/theme
   logic up here. */
@media (prefers-color-scheme: dark) {
  body:has(.app-shell:not(.app-theme-light)) {
    background: #10121a;
  }
}

body:has(.app-shell.app-theme-dark) {
  background: #10121a;
}

/* ---- SEASONAL PALETTES (projectz feature 16573388) ----
   A seasonal palette is token overrides and nothing else: it re-values the
   same roles the dark theme does ('--bg' / '--surface' / '--border' /
   '--text' / '--text-muted' / '--brand' / '--brand-dark' /
   '--brand-contrast' / '--shadow') and leaves every component, and the
   status colours ('--danger' / '--success' / '--warn-*'), alone. No art,
   no font, no flooded block: the hero rules hold in every season.

   The class 'app-season-<slug>' is set on '.app-shell' by
   'Main.Types.uiSeasonClass' ('ControlPlane.Season' says when: a viewer's
   explicit choice, else the calendar). Each palette has a light and a dark
   variant on the same two tiers as the dark theme above, and the dark
   selectors carry one class more than the light one, so they win whatever
   the order: Auto on a dark system, or an explicit Dark, gets the dark
   variant; an explicit Light gets the light one on any system.

   A new season copies this block under its own slug. Check contrast in
   both variants: '--text-muted' on '--surface' and '--brand-contrast' on
   '--brand' are the two pairs that fail first (4.5:1 for body text). */

/* Halloween: pumpkin orange on parchment, and on a plum-black at night.
   Light: white text on brand #c2410c is 5.2:1, muted on surface 6.4:1.
   Dark: dark text on brand #fb923c is 8.2:1, muted on surface 8.0:1. */
.app-shell.app-season-halloween {
  --bg: #faf3e8;
  --surface: #fffcf7;
  --border: #eadbc8;
  --text: #1f1a24;
  --text-muted: #6b5a4e;
  --brand: #c2410c;
  --brand-dark: #9a3412;
  --brand-contrast: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .app-shell.app-season-halloween:not(.app-theme-light) {
    --bg: #130d1a;
    --surface: #1e1528;
    --border: #3b2a4d;
    --text: #f3ecf8;
    --text-muted: #b9a9c7;
    --brand: #fb923c;
    --brand-dark: #fdba74;
    --brand-contrast: #1c1007;
  }
}

.app-shell.app-season-halloween.app-theme-dark {
  --bg: #130d1a;
  --surface: #1e1528;
  --border: #3b2a4d;
  --text: #f3ecf8;
  --text-muted: #b9a9c7;
  --brand: #fb923c;
  --brand-dark: #fdba74;
  --brand-contrast: #1c1007;
}

/* The margins beside a capped shell, as 'body:has' does for the dark
   theme just above. */
body:has(.app-shell.app-season-halloween) {
  background: #faf3e8;
}

@media (prefers-color-scheme: dark) {
  body:has(.app-shell.app-season-halloween:not(.app-theme-light)) {
    background: #130d1a;
  }
}

body:has(.app-shell.app-season-halloween.app-theme-dark) {
  background: #130d1a;
}

/* Christmas (projectz feature ce608ea2): fir green on a snowy page, and
   candle gold on a pine-night at night. Not holly red: '--brand' paints
   every primary button, and a red one reads as '--danger' (the dark
   theme's '--danger' is #f87171 itself).
   Light: white text on brand #1f5f3f is 7.6:1, muted on surface 6.2:1.
   Dark: dark text on brand #f2c14e is 10.7:1, muted on surface 8.5:1. */
.app-shell.app-season-christmas {
  --bg: #f2f6f0;
  --surface: #fbfdf9;
  --border: #d6e2d3;
  --text: #14231a;
  --text-muted: #4f6457;
  --brand: #1f5f3f;
  --brand-dark: #16462e;
  --brand-contrast: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .app-shell.app-season-christmas:not(.app-theme-light) {
    --bg: #0b1712;
    --surface: #12241b;
    --border: #24412f;
    --text: #eef6f0;
    --text-muted: #a8c2b1;
    --brand: #f2c14e;
    --brand-dark: #f6d88a;
    --brand-contrast: #1c1606;
  }
}

.app-shell.app-season-christmas.app-theme-dark {
  --bg: #0b1712;
  --surface: #12241b;
  --border: #24412f;
  --text: #eef6f0;
  --text-muted: #a8c2b1;
  --brand: #f2c14e;
  --brand-dark: #f6d88a;
  --brand-contrast: #1c1606;
}

body:has(.app-shell.app-season-christmas) {
  background: #f2f6f0;
}

@media (prefers-color-scheme: dark) {
  body:has(.app-shell.app-season-christmas:not(.app-theme-light)) {
    background: #0b1712;
  }
}

body:has(.app-shell.app-season-christmas.app-theme-dark) {
  background: #0b1712;
}

/* ---- BACKGROUND PICTURES (projectz feature 386acc4d) ----
   A picture behind the Console, at the owner's request: the lavender
   λ-coin landscape with the standard palette, the Halloween landscape with
   the Halloween palette, and the Christmas snow scene (fir trees, a red
   sleigh, the mascot in a Santa hat; projectz feature 6721ded7) with the
   Christmas palette. It had none before that, because its fir green on the
   lavender picture read as two seasons at once. None of them is shown on
   the monitor wall, which is a display, not a page.

   It is the 'body' that paints it ('background-attachment: fixed', so it
   stays put while the page scrolls) and the shell lets it through
   ('.app-shell' is otherwise its own '--bg'). Over the picture lies a veil
   of the palette's own '--bg': light enough in the light variants that the
   picture shows, heavy in the dark ones so that a pastel picture does not
   light up a dark page. Every card, the rail and the topbar's pills keep
   their '--surface', so the content reads as it always does; what sits on
   the picture directly (the wordmark, a section title, a lede) sits on the
   veil.

   The veil was raised on 2026-10-22 at the owner's request (0.5 / 0.45 to
   0.8 in the light variants, 0.86-0.88 to 0.92 in the dark ones): on a
   large screen the picture made a section title outside a card hard to
   read. A title on the picture is the case to check when changing it.

   The files are the website image's, under www.buckette.co/seasonal/
   (Main's 'ControlPlane.Season.seasonalArtBase' says why): the Console
   image copies its static assets one by one and lists none of these. If
   they cannot be fetched, the page is its plain '--bg', as before. The
   colour layer stays with the 'body:has' rules above; only the image
   layers are set here, on custom properties: '--art' (the picture) and
   '--veil' (the palette's '--bg' with an alpha). */
body:has(.app-shell:not(.app-wall)) {
  --art: url("https://www.buckette.co/seasonal/standard-landscape-1672.webp");
  --veil: rgba(246, 247, 251, 0.8);
}

body:has(.app-shell.app-season-halloween:not(.app-wall)) {
  --art: url("https://www.buckette.co/seasonal/halloween-landscape-1672.webp");
  --veil: rgba(250, 243, 232, 0.8);
}

body:has(.app-shell.app-season-christmas:not(.app-wall)) {
  --art: url("https://www.buckette.co/seasonal/christmas-landscape-1672.webp");
  --veil: rgba(242, 246, 240, 0.8);
}

/* A narrow window gets the 960px cut: same picture, half the bytes. */
@media (max-width: 1000px) {
  body:has(.app-shell:not(.app-wall)) {
    --art: url("https://www.buckette.co/seasonal/standard-landscape-960.webp");
  }

  body:has(.app-shell.app-season-halloween:not(.app-wall)) {
    --art: url("https://www.buckette.co/seasonal/halloween-landscape-960.webp");
  }

  body:has(.app-shell.app-season-christmas:not(.app-wall)) {
    --art: url("https://www.buckette.co/seasonal/christmas-landscape-960.webp");
  }
}

/* The dark variants, on the same two tiers (and the same extra class) as
   the palettes above. */
@media (prefers-color-scheme: dark) {
  body:has(.app-shell:not(.app-wall):not(.app-theme-light)) {
    --veil: rgba(16, 18, 26, 0.92);
  }

  body:has(.app-shell.app-season-halloween:not(.app-wall):not(.app-theme-light)) {
    --veil: rgba(19, 13, 26, 0.92);
  }

  body:has(.app-shell.app-season-christmas:not(.app-wall):not(.app-theme-light)) {
    --veil: rgba(11, 23, 18, 0.92);
  }
}

body:has(.app-shell.app-theme-dark:not(.app-wall)) {
  --veil: rgba(16, 18, 26, 0.92);
}

body:has(.app-shell.app-season-halloween.app-theme-dark:not(.app-wall)) {
  --veil: rgba(19, 13, 26, 0.92);
}

body:has(.app-shell.app-season-christmas.app-theme-dark:not(.app-wall)) {
  --veil: rgba(11, 23, 18, 0.92);
}

body:has(.app-shell:not(.app-wall)) {
  background-image: linear-gradient(var(--veil), var(--veil)), var(--art);
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.app-shell:not(.app-wall) {
  background: transparent;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* Layout-neutral on purpose — see '.app-shell' below. '#app' is static
   markup in index.html and Halogen mounts *into* it, so any width cap here
   sits on an ancestor of everything the app renders and no class the app
   adds can widen it from below. Keep this rule empty of layout. */
#app {
  display: block;
}

/* Projectz feature d8d2d8d1: the static links index.html carries for a
   client the app never reaches. Hidden as soon as Halogen has mounted
   anything into #app; until then it stays invisible for its first four
   seconds (a normal start mounts well before), so a person never sees it
   flash on an ordinary load. A crawler reads it in the markup either way. */
.shell-fallback {
  max-width: 640px;
  margin: 48px auto;
  padding: 0 20px;
  font-family: var(--sans);
  color: var(--text);
  opacity: 0;
  animation: shell-fallback-appear 0s linear 4s forwards;
}
#app:not(:empty) + .shell-fallback {
  display: none;
}
@keyframes shell-fallback-appear {
  to { opacity: 1; }
}

/* The width-owning wrapper, rendered by Main.Render's root div. Widening
   happens here and only here — see the wide-mode section further down. */
.app-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  /* Custom properties cascade down, not up: overriding '--bg'/'--text' on
     this element (see the dark-mode block above) has no visual effect
     unless something *inside* that scope actually paints with them.
     'html, body' painting the root-level (light) '--bg' would otherwise
     leave the shell's own padding area and anything below its last card
     light in dark mode, even though every card inside is themed. */
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

/* The wordmark is set in the display face the section heroes use, which is
   what ties the shell to them — it is the only place outside a hero where
   '--display' appears at size. Condensed runs narrow, so 27px here is the
   optical match for the 22px sans it replaced, and the negative tracking
   that sans needed comes back off. */
.brand-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark,
.nav-brand {
  /* Both wordmarks are links to the Console's home; they keep the look of
     plain text (no underline, no link colour). */
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.login-logo {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-top: 24px;
}

/* Feedback b087a783: a widget card sits one level deeper than a normal
   '.card' already (list -> dashboard panel -> widget-grid -> widget), so
   the default 28px/24px meant for a page-level section reads as
   disproportionate padding at that depth. Smaller box, tighter stacking
   gap when '.widget-grid' isn't in its grid layout (narrow width, where
   cards stack via plain block flow instead of 'gap'). */
.widget-grid > .card {
  padding: 16px;
  margin-top: 12px;
}

/* ---- WIDGET GRID (projectz feature d224900d) ------------------------
   A monitor's widgets have a cell each, a place and a size on a grid of 12
   columns, set in the editor by dragging the '.widget-grid-handle' (move)
   or the '.widget-resize-handle' corner, or with the arrow keys on the
   handle. The Console renders the grid with the class '.widget-grid-cells'
   when every widget has a cell and puts each card in its cell with an
   inline 'grid-column' / 'grid-row'; this section is the geometry the
   cards are placed on.

   Three rules, and what each one keeps true:

   1. '--widget-row' is the ONE source of the row height. The drag reads it
      back off the element ('grid-auto-rows', ControlPlane.WidgetDragGeometry)
      together with the gap, so the pointer snaps to the cells as drawn.
      Change the number here and nothing else; never put a row height in
      PureScript.
   2. The 12-column template is set in each place '.widget-grid' becomes a
      grid (the LEFT RAIL media query, the explicit Wide/Full copy per rule
      9 of WIDE UI MODE, the wall, and the 641px block below for the
      middle widths), not here: below the phone breakpoint the grid is
      block flow and the cards stack in reading order (row, then column),
      which is what the server lists them in. A card's inline 'grid-*'
      does nothing in block flow, by design.
   3. A card in a cell is a column flexbox whose body takes what the title
      leaves and scrolls, so a widget's content never grows its card past
      its cell, and a chart ('.echarts-ref') fills the body: the inline
      340px the chart modules set is overridden here, and
      ControlPlane.ChartResize redraws it at the size it gets. The body is
      a size container and the chart is '100cqh' tall less the caption
      under it ('--widget-chart-reserve'), because the chart sits under
      wrapper divs of automatic height through which a percentage would
      resolve to nothing. A chart that shares its body with more than a
      caption (a treemap's legend, a breakdown's table) has a fixed height
      instead ('--widget-chart-fixed'), so that a taller card shows the
      rest. The 'min-height' keeps a chart legible in a short cell at the
      cost of a scrollbar, rather than a sliver. A new widget's size is its
      kind's (ControlPlane.WidgetGrid.defaultCellFor), so that this content
      fits it at 1400px (projectz feature efeeca3b). The body keeps the
      vertical scrollbar's gutter, so that a scrollbar appearing does not
      narrow a chart already drawn and add a horizontal one under it. */
:root {
  --widget-row: 90px;
  /* Projectz feature efeeca3b: what a chart leaves of its body for the
     caption under it, and the height of a chart that shares its body with
     more than a caption (a treemap's legend, a breakdown's table), which
     does not grow with the card: a card made taller then shows the rest
     instead of a taller chart and the same scrollbar. */
  --widget-chart-reserve: 64px;
  --widget-chart-fixed: 240px;
}

/* Middle widths (641px to the rail breakpoint): the Console stacks widget
   cards there by default, which leaves the editor nowhere to drag one to.
   With cells, it is the 12-column grid from the tablet up; the explicit
   Narrow mode keeps the stack. The wall and the explicit Wide/Full modes
   have their own copies above and below. */
@media (min-width: 641px) and (max-width: 1099px) {
  .app-shell:not(.app-narrow) .widget-grid.widget-grid-cells {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: var(--widget-row);
    gap: 16px;
    align-items: stretch;
  }
}

/* Projectz feature efeeca3b: at these widths a half-width cell is about
   260px, too narrow for a chart and its legend, so outside the editor
   (viewing, the wall, a snapshot) every card is drawn full width, in
   reading order (the order the widgets come in, row then column), at the
   height of its cell ('--widget-rows', written by
   ControlPlane.WidgetGrid.cellStyle). The editor
   ('.widget-grid-editing') keeps the cells, since it is where they are
   set. '!important' because the cell is an inline style. */
@media (min-width: 641px) and (max-width: 1099px) {
  .app-shell .widget-grid-cells:not(.widget-grid-editing) > .monitor-widget-card {
    grid-column: 1 / -1 !important;
    grid-row: auto / span var(--widget-rows, 4) !important;
  }
}
/* Below them the Console stacks the cards in block flow, where a cell does
   nothing; the wall is still a grid there (one auto-fit column), where a
   card's inline cell made columns of its own and the page scroll sideways.
   One card to a row, at its natural height. */
@media (max-width: 640px) {
  .app-shell .widget-grid-cells > .monitor-widget-card {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
}

/* Only in a grid is the stacking margin of '.widget-grid > .card' wrong (it
   pushes every card down inside its cell); in block flow it is the gap. */
@media (min-width: 641px) {
  .app-shell:not(.app-narrow) .widget-grid-cells > .card,
  .app-shell.app-wall .widget-grid-cells > .card {
    margin-top: 0;
  }
  .app-shell:not(.app-narrow) .widget-grid-cells > .monitor-widget-card,
  .app-shell.app-wall .widget-grid-cells > .monitor-widget-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
  }
  .app-shell:not(.app-narrow) .widget-grid-cells > .monitor-widget-card > .monitor-widget-body,
  .app-shell.app-wall .widget-grid-cells > .monitor-widget-card > .monitor-widget-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    container-type: size;
    scrollbar-gutter: stable;
  }
  .app-shell:not(.app-narrow) .widget-grid-cells .monitor-widget-body .echarts-ref,
  .app-shell.app-wall .widget-grid-cells .monitor-widget-body .echarts-ref {
    height: max(220px, calc(100cqh - var(--widget-chart-reserve))) !important;
    min-height: 220px !important;
  }
  .app-shell:not(.app-narrow) .widget-grid-cells .monitor-widget-body :is(.treemap-result, .series-breakdown) .echarts-ref,
  .app-shell.app-wall .widget-grid-cells .monitor-widget-body :is(.treemap-result, .series-breakdown) .echarts-ref {
    height: var(--widget-chart-fixed) !important;
  }
  .app-shell:not(.app-narrow) .widget-grid-cells .widget-grid-handle {
    display: inline-block;
  }
  .app-shell:not(.app-narrow) .widget-grid-cells .widget-resize-handle {
    display: block;
  }
}
:is(.app-shell.app-wide, .app-shell.app-full) .widget-grid-cells > .card {
  margin-top: 0;
}
:is(.app-shell.app-wide, .app-shell.app-full) .widget-grid-cells > .monitor-widget-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
:is(.app-shell.app-wide, .app-shell.app-full) .widget-grid-cells > .monitor-widget-card > .monitor-widget-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  container-type: size;
  scrollbar-gutter: stable;
}
:is(.app-shell.app-wide, .app-shell.app-full) .widget-grid-cells .monitor-widget-body .echarts-ref {
  height: max(220px, calc(100cqh - var(--widget-chart-reserve))) !important;
  min-height: 220px !important;
}
:is(.app-shell.app-wide, .app-shell.app-full) .widget-grid-cells .monitor-widget-body :is(.treemap-result, .series-breakdown) .echarts-ref {
  height: var(--widget-chart-fixed) !important;
}
:is(.app-shell.app-wide, .app-shell.app-full) .widget-grid-cells .widget-grid-handle {
  display: inline-block;
}
:is(.app-shell.app-wide, .app-shell.app-full) .widget-grid-cells .widget-resize-handle {
  display: block;
}

/* The move handle: a grip in the card's control row. 'touch-action: none'
   is what lets a finger drag it instead of scrolling the page. Both handles
   are hidden in block flow (the phone width, the explicit Narrow mode),
   where the cards stack in reading order and there is no place to drag one
   to; each grid regime above shows them again. The editor renders them
   whenever the widget has a cell, so this is the one place that decides. */
.widget-grid-handle,
.widget-resize-handle {
  display: none;
}
.widget-grid-handle {
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-size: 16px;
  line-height: 1;
  padding-left: 8px;
  padding-right: 8px;
}
.widget-grid-handle:active,
.widget-dragging .widget-grid-handle {
  cursor: grabbing;
}

/* The resize corner: bottom-right of the card, drawn as two short strokes,
   only on a card in a cell (the editor adds it there and nowhere else). */
.widget-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  touch-action: none;
  background:
    linear-gradient(135deg, transparent 0 50%, var(--text-muted) 50% 58%, transparent 58% 72%, var(--text-muted) 72% 80%, transparent 80%);
  opacity: 0.6;
  border-bottom-right-radius: var(--radius);
}
.widget-resize-handle:hover {
  opacity: 1;
}

/* The card being dragged sits above its neighbours and is lifted a little,
   so the eye follows it while the others move out of its way. */
.widget-dragging {
  z-index: 2;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  outline: 2px solid var(--brand);
}

/* Monitors (projectz d31b91b0): the "Add widget" placeholder card, the last
   cell of '.widget-grid' while editing. Dashed outline, the button centred
   and large. Tokens only. */
.widget-grid > .widget-add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  margin-top: 16px;
  margin-bottom: 8px;
  background: transparent;
  border: 2px dashed var(--border);
  box-shadow: none;
}
.widget-grid .widget-add-card .widget-add-button {
  font-size: 1.15rem;
  padding: 16px 32px;
  max-width: 100%;
}
@media (max-width: 640px) {
  .widget-grid > .widget-add-card {
    padding: 16px;
    border-radius: var(--radius);
  }
}

/* Login/join/device/bootstrap screens. Capped independently of the shell —
   a 1280px-wide login box is worse than the narrow one it replaced. Any new
   pre-auth screen should carry this class. */
.center-card {
  text-align: center;
  padding: 48px 28px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.lede {
  color: var(--text-muted);
  font-size: 15px;
  margin: 8px 0 24px;
  max-width: 65ch;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* The strip owns the air below it, rather than borrowing it from
     whatever the page opens with. It used to borrow '.card''s
     'margin-top', which worked while every page opened with a card and
     stopped the moment they opened with a '.ruled-masthead' instead: a
     block owns no outer spacing, so the masthead's 2px rule came to rest
     directly against the topbar on every converted page (owner,
     2026-09-05).

     No doubling on a page that still opens with a card. '.dashboard' and
     '.dashboard-main' are plain blocks with no border or padding, so a
     first card's 24px top margin collapses up through both and then
     collapses again with this one — adjoining margins take the larger,
     not the sum. Below the breakpoint '.dashboard-nav''s 28px wins the
     same way, which is why this is written once rather than per regime
     (stylesheet rule 9 does not apply). */
  margin-bottom: 24px;
}

.topbar h1 {
  font-family: var(--display);
  font-size: 25px;
  margin: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Backlog (cw) — multi-account.

   '.account-switcher' lives in '.topbar-actions', which is a flex row, so
   it needs an explicit 'max-width' rather than relying on its container:
   an account name is user-supplied and unbounded, and per the WIDE UI MODE
   rules an unconstrained control in the topbar smears across a 1280px
   shell. It's a native <select> on purpose — a bespoke dropdown would need
   its own focus/keyboard/outside-click handling for no gain over the one
   the platform already ships.

   Rendered only for someone in two or more accounts, and never while
   impersonating (see 'Main.Render.render_account_switcher'). */
.account-switcher {
  max-width: 200px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.account-switcher:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* The Account tab's "Your accounts" list. A plain stacked list rather than
   a grid — it is short by construction ('maxAccountsPerPrincipal' is 10)
   and each row is name + role + one action. */
.account-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}

.account-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.account-list-item:last-child {
  border-bottom: none;
}

.account-list-item.current .account-list-name {
  font-weight: 600;
}

.account-list-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Backlog (dw): the first-run setup screen (see specs/account-setup.md).
   Carries '.center-card' for its auto margins, then widens and un-centers
   it: 420px of centered text is right for a login box but wrong for a
   panel holding an input beside a button, and centered left-aligned prose
   reads as a mistake. Still capped, per WIDE UI MODE maintenance rule —
   this is a full-width control and 1280px of it would be a smear.
   One field and one button since 2026-10-07; the progress row and the
   Back/Next/Skip footer ('.setup-steps', '.setup-footer') went with the
   steps. */
.setup-wizard {
  max-width: 560px;
  text-align: left;
  padding: 32px 28px;
}

/* Projectz feature eee44f71: the wizard's last step when the account
   already has a tenant (made by an assistant approved at /device). One row
   per tenant, its name then its Open button, inside the wizard's cap. */
.setup-existing-tenant {
  align-items: center;
  margin-bottom: 8px;
}

.setup-existing-tenant-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  color: var(--warn-text);
  font-size: 14px;
}

/* Backlog (au): one tenant's sub-DAG nested inside an account's teardown
   view. The indent and the left rule are the parent/child relationship —
   without them the child node lists run flush against the account's own and
   the nesting is invisible, which was the whole point of the view.

   Nothing here is width-dependent (block-level, inherits the card's width),
   so there is no wide-mode duplicate to write — see the WIDE UI MODE
   section's rule 9. */
.teardown-subdag {
  margin: 8px 0 8px 12px;
  padding: 8px 0 8px 14px;
  border-left: 2px solid var(--border);
}

.teardown-subdag:hover {
  border-left-color: var(--brand);
}

.teardown-subdag-toggle {
  padding: 2px 0;
  font-family: var(--mono);
  font-size: 13px;
}

/* The node lists themselves were never styled — readable enough as a bare
   <ul> at one level, but not once they are nested two deep. Monospace keeps
   the "id ← deps" lines aligned; the marker goes because the ← already
   reads as the edge. */
.teardown-node-list {
  list-style: none;
  margin: 6px 0;
  padding: 0;
}

.teardown-node-list > li {
  padding: 3px 0;
  font-size: 13px;
  line-height: 1.5;
}

.teardown-node-list > li + li {
  border-top: 1px solid var(--border-subtle, var(--border));
}

.teardown-status-legend {
  list-style: none;
  margin: 6px 0 14px;
  padding: 0;
  font-size: 12px;
}

.teardown-status-legend > li {
  padding: 2px 0;
}

/* Backlog (df), feedback 5ebcdc01: the teardown DAG drawn as a real
   node/edge graph (Main.Render.TeardownDag) rather than only as the flat
   "id <- deps" list above, which is now folded into the <details> below it.

   Inline SVG, not a graph library — see that module's header for why the
   ECharts route was rejected (its registration shim is one file applied to
   *both* bundles, so a graph series would land in the user Console too).
   The consequence for this stylesheet is the good one: 'fill' and 'stroke'
   resolve var(), so every colour below is a token and the graph is
   dark-correct without a single override. Do not reintroduce a hex here —
   the dark-theme block's own note about the deleted hero data-URIs is the
   claim this would break.

   The six status colours are finer-grained than the '.status-pill' family's
   three. That is deliberate: a pill sits next to its own word, so collapsing
   'failed' and 'redundant' into the same grey costs nothing; in a picture
   the colour *is* the word, and a failed node has to be findable at a
   glance. Hence the separate legend the module renders under the graph.

   Nothing here is width-dependent — the SVG has intrinsic width and scrolls
   inside '.table-scroll' like the execution-timeline chart above it — so
   there is no wide-mode duplicate to write; see WIDE UI MODE's rule 9. */
.teardown-dag {
  margin: 8px 0 6px;

  --dag-done: var(--success);
  --dag-evaluated: var(--brand);
  --dag-failed: var(--danger);
  --dag-blocked: var(--warn-text);
  --dag-idle: var(--text-muted);
  --dag-none: var(--border);
}

.teardown-dag-svg {
  display: block;
  /* The picture shrinks to its container (its natural width is an inline
     max-width) and never scrolls sideways: a wide tenant used to push the
     whole panel wider than the page. */
  width: 100%;
  height: auto;
}

/* The teardown panel: a progress card, then tables that are laid out to the
   width they are given. Nothing in it scrolls sideways. A cell wraps, and
   breaks inside a long id or a JSON detail when it has to. */
.teardown-detail {
  min-width: 0;
}
.teardown-verdict {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.45;
}
.teardown-verdict-ok { border-left-color: var(--success); }
.teardown-verdict-bad { border-left-color: var(--danger); }
.teardown-verdict-info { border-left-color: var(--text-muted); }
.teardown-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 0 0 14px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.teardown-figure {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  background: var(--surface);
}
.teardown-figure-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.teardown-figure-value {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.teardown-figure-note {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 1em;
}
.teardown-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0 0 14px;
  font-size: 13px;
}
.teardown-table th {
  padding: 6px 8px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.teardown-table td {
  padding: 6px 8px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.teardown-table td > p {
  margin: 0;
}
.teardown-table td > p + p {
  margin-top: 4px;
}
.teardown-run-row {
  cursor: pointer;
}
.teardown-run-row:hover td,
.teardown-run-selected td {
  background: var(--surface-alt, var(--bg));
}
.teardown-run-selected td:first-child {
  font-weight: 600;
}
.teardown-steps-table th:nth-child(1) { width: 19%; }
.teardown-steps-table th:nth-child(2) { width: 7%; }
.teardown-steps-table th:nth-child(3) { width: 13%; }
.teardown-steps-table th:nth-child(4) { width: 16%; }
.teardown-steps-table th:nth-child(5) { width: 14%; }
.teardown-events-table th:nth-child(1) { width: 12%; }
.teardown-events-table th:nth-child(2) { width: 26%; }
.teardown-events-table th:nth-child(3) { width: 11%; }
.teardown-events-table th:nth-child(4) { width: 9%; }
.teardown-step-name {
  font-weight: 600;
}
.teardown-step-qual {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}
.teardown-steps-table .status-pill {
  display: inline-block;
  margin: 0 4px 2px 0;
  white-space: nowrap;
}
.teardown-why {
  color: var(--text-muted);
  line-height: 1.4;
}
/* Where in the run a step ran: a bar on a track that is the whole run. */
.teardown-when {
  position: relative;
  height: 8px;
  margin: 4px 0;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.teardown-when-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 3px;
  background: var(--text-muted);
}
.teardown-when-done { background: var(--success); }
.teardown-when-evaluated { background: var(--brand); }
.teardown-when-failed { background: var(--danger); }
.teardown-when-blocked { background: var(--warn-text); }
.teardown-when-text {
  font-size: 11px;
  color: var(--text-muted);
}

.teardown-dag-svg .dag-edge {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.5;
}

/* A dependency that skips a column has to bow around the boxes it passes,
   so it is the one edge that can cross a node. Dashing it says "this one is
   passing through" rather than leaving the reader to guess. Same stroke is
   reused for the stub marking a dep that lives in another graph entirely. */
.teardown-dag-svg .dag-edge-skip {
  stroke-dasharray: 4 3;
}

.teardown-dag-svg .dag-node-box {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1.5;
}

.teardown-dag-svg .dag-node-name {
  fill: var(--text);
  font-family: var(--sans);
  font-size: 12px;
}

.teardown-dag-svg .dag-node-qual {
  fill: var(--text-muted);
  font-family: var(--mono);
  font-size: 10px;
}

.teardown-dag-svg .dag-col-mark {
  fill: var(--text-muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.teardown-dag-svg .dag-node-dot {
  fill: var(--dag-none);
}

.teardown-dag-svg .dag-status-done .dag-node-dot { fill: var(--dag-done); }
.teardown-dag-svg .dag-status-evaluated .dag-node-dot { fill: var(--dag-evaluated); }
.teardown-dag-svg .dag-status-failed .dag-node-dot { fill: var(--dag-failed); }
.teardown-dag-svg .dag-status-blocked .dag-node-dot { fill: var(--dag-blocked); }
.teardown-dag-svg .dag-status-idle .dag-node-dot { fill: var(--dag-idle); }

/* Only the two statuses worth interrupting a scan for get a coloured box.
   Ringing every 'done' node green turns the common case — a graph that
   converged — into a wall of colour, which is the same mistake the first
   catalog-hero cut made: loudest exactly where it is least needed. The dot
   carries the other four. */
.teardown-dag-svg .dag-status-failed .dag-node-box {
  stroke: var(--dag-failed);
}

.teardown-dag-svg .dag-status-evaluated .dag-node-box {
  stroke: var(--dag-evaluated);
}

.teardown-dag-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 2px 0 10px;
  padding: 0;
  font-size: 12px;
  color: var(--text-muted);

  --dag-done: var(--success);
  --dag-evaluated: var(--brand);
  --dag-failed: var(--danger);
  --dag-blocked: var(--warn-text);
  --dag-idle: var(--text-muted);
  --dag-none: var(--border);
}

.teardown-dag-legend > li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dag-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dag-none);
}

.dag-swatch.dag-status-done { background: var(--dag-done); }
.dag-swatch.dag-status-evaluated { background: var(--dag-evaluated); }
.dag-swatch.dag-status-failed { background: var(--dag-failed); }
.dag-swatch.dag-status-blocked { background: var(--dag-blocked); }
.dag-swatch.dag-status-idle { background: var(--dag-idle); }
.dag-swatch.dag-status-none { background: var(--dag-none); }

.teardown-dag-summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 0;
}

/* Backlog (au): the dates under a flagged account in the admin Accounts
   list. Two overrides of what it inherits, both deliberate:

   - '.tenant-sub' truncates with an ellipsis, which cut the date off — the
     one thing this line exists to show. It wraps instead.
   - it used '.error-text', whose filled danger block made a restorable
     account and one already being torn down look identical, drowning out
     the pill that carries the distinction. Muted text, no fill: the pill is
     the signal, this is the detail. */
.account-deletion-note {
  display: block;
  margin-top: 2px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  color: var(--text-muted);
}

/* Backlog (au): the admin Accounts list's pending-deletion flags. Two
   states, deliberately different colours rather than one badge with
   different text — an operator scanning the list should be able to see at a
   glance which accounts are still stoppable and which are already being
   torn down.

   Both are inline in the account-name line and size to their content, so
   there is nothing width-dependent here and nothing to duplicate under the
   wide-mode selectors (see the WIDE UI MODE section's rule 9). */
.deletion-pending-pill {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-text);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.deletion-pill {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Backlog (cl): the admin Accounts list's freeze flag. Same shape as
   .deletion-pill (danger-coloured — this is blocking a paying customer's
   operations) but its own class rather than reuse, since the two states
   are independent and could in principle both be true on one row. */
.frozen-pill {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Backlog (au): account-wide pending-deletion banner. Same shape and
   position as .impersonation-banner above (both are always-visible
   account-state strips) but danger-coloured rather than warn-coloured —
   impersonation is a mode you're in, this is a countdown. Like that one it
   needs no wide-mode duplicate: it's a flex row with no width of its own,
   so it inherits whatever .app-shell is currently capped at. */
.account-deletion-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 14px;
}

/* Backlog (ag1): the settlement gate's own line in the banner above, when
   there's an outstanding balance blocking teardown -- present regardless
   of adiCancellable, since a balance still owed after the grace period has
   elapsed is still not being torn down. font-weight only; it already
   shares the banner's danger coloring. */
.account-deletion-balance {
  font-weight: 600;
}

/* The "Delete this account" card at the foot of Account > Settings. A
   .card that reads as dangerous, not a new layout — no width rules here,
   so nothing to duplicate under the wide-mode selectors (rule 9). */
.danger-card {
  border-color: var(--danger);
}

.danger-card .section-title {
  color: var(--danger);
}

.tab-bar {
  display: flex;
  gap: 4px;
  margin-top: 28px;
  border-bottom: 1px solid var(--border);
}

.tab-button {
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 14px;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab-button:hover {
  color: var(--text);
}

.tab-button.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.sub-tab-bar {
  margin-top: 20px;
  margin-bottom: -4px;
}

/* ---- Two-level navigation -------------------------------------------------
   'Main.Render.render_dashboard_nav' emits one DOM shape for both layouts:

     .dashboard-nav > .nav-group > .nav-flyout-anchor > button.tab-button
                                 > .nav-sublist > button.tab-button

   with '.nav-sublist' present on the active group only. Here — the narrow
   layout — both '.nav-group' and '.nav-flyout-anchor' are
   'display: contents' (see (cv)'s note on the latter), so the tab buttons
   and that single sub-list collapse into direct children of one wrapping
   flex row, reproducing the historical "two stacked bars" look. 'order: 1'
   plus 'flex-basis: 100%' makes the sub-list wrap onto its own line below
   *every* tab button, whichever group it actually belongs to.

   The rule between the two levels is a 'border-top' on the sub-list, not a
   'border-bottom' on the row: a wrapping flex container has no way to draw a
   border under only its first line. What used to be the sub-bar's 20px
   margin-top is now its padding-top, which puts the rule flush under the tab
   buttons and keeps the 20px gap below it — geometrically identical, and it
   preserves the active button's 'margin-bottom: -1px' overlap onto a real
   border.

   '.tab-bar'/'.sub-tab-bar' are deliberately NOT reused. The tenant-details
   panel still uses them for its Monitors/Usage bar, and that is panel-local
   content rather than navigation — restyling '.tab-bar' for the sidebar would
   drag it along. See maintenance rule 8. */
.dashboard-nav {
  display: flex;
  flex-wrap: wrap;
  /* Column gap only. A shorthand 'gap' would also apply between the two
     wrapped lines, pushing the sub-list 4px off the rule it is supposed to
     sit against. */
  column-gap: 4px;
  row-gap: 0;
  margin-top: 28px;
  border-bottom: 1px solid var(--border);
}

/* Restores the 4px the old '.sub-tab-bar' pulled off the bottom, but only
   when a sub-list is actually present — otherwise a tab with no sub-tabs
   (Tenants) would sit 4px tighter than it used to. Where ':has()' is
   unsupported this degrades to a 4px gap, not a broken layout. */
.dashboard-nav:has(.nav-sublist) {
  margin-bottom: -4px;
}

.nav-group {
  display: contents;
}

/* (cv): a no-op wrapper here in the narrow layout, same reasoning as
   '.nav-group' above — 'display: contents' keeps 'button.tab-button' a
   direct child of '.nav-group' so it still flattens into the wrapping flex
   row. Only becomes a real (positioned) box under the wide layout's LEFT
   RAIL media query, where the flyout it anchors is actually reachable. */
.nav-flyout-anchor {
  display: contents;
}

/* (cv): hidden by default everywhere — including here, in the narrow
   layout, where 'display: contents' on the anchor above would otherwise
   flatten this in as a visible extra button next to every tab. Only the
   collapsed wide rail (see the LEFT RAIL media query) turns it on. Kept
   in the DOM at every width regardless (see that rule's own comment). */
.nav-flyout-trigger {
  display: none;
}

/* '.nav-items' has to flatten too, or the groups' 'display: contents' would
   still leave this wrapper as the flex row's only child. */
.nav-items {
  display: contents;
}

/* Rail-only furniture. The narrow layout's topbar already carries the brand,
   so these stay hidden here — 'display: none' also keeps the duplicated
   brand out of the tab order and the a11y tree. (The rail footer used to
   carry a second copy of the shell-width toggle for the same reason;
   feedback 338a4a02 moved that control to Account > Settings, so the footer
   is now the collapse button alone.) */
.nav-brand,
.nav-footer,
.dashboard-nav .nav-icon {
  display: none;
}

.nav-sublist {
  order: 1;
  flex-basis: 100%;
  /* Without this the sub-list is a flex item with an automatic minimum size,
     so the six Admin sub-tabs floor it at their min-content width and it
     overflows a narrow viewport. At 0 it honours flex-basis. */
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  /* The 20px the old '.sub-tab-bar' got from margin-top, measured below the
     border-top — which lands on the same y the old bar's border-bottom did,
     because '.tab-button' pulls the first line up 1px with its negative
     margin. Sub-tab buttons therefore keep their exact historical position. */
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* --- Feedback 6b35fa67: narrow-layout sub-tab overflow -------------------
   Below 1100px (or with the Narrow width preference forced — both are
   '.app-shell:not(.app-narrow)' NOT matching, same condition the LEFT RAIL
   media query below gates on), a sub-tab row used to just shrink its
   buttons and wrap their labels, which for Admin's six sub-tabs still
   overflowed a phone-width viewport with no way to reach whatever got
   clipped.

   First cut of the fix pinned the active tab and hid the rest behind a
   button-styled trigger; reporter feedback on that version (same report,
   after the first pass shipped) asked for something closer to GitHub's
   actual treatment: leave the button row exactly as it is and just *clip*
   whatever overflows, put "More" at the end styled as another tab (not a
   boxed button), and anchor its pop-up to the trigger itself — the first
   cut's pop-up spanned the whole row so it opened flush left under a
   trigger sitting at the right edge, a visible mismatch.

   '.nav-sublist-list' is the clipping box (flex:1 1 auto + overflow:
   hidden); its buttons get 'flex: none' so they keep their natural width
   and get cropped rather than squeezed. '.nav-sublist-more' sits beside it,
   *outside* the clip, so the trigger itself is never among what gets cut
   off. 'Main.Render.render_nav_sublist' (duplicated in
   'Main.Render.Console'/'Main.Render.Admin', see their own comments) emits
   this shape and renders the same button array a second time into
   '.nav-sublist-popover', only while '.sub-menu-open' is present — same
   idiom as 'render_nav_flyout'. None of this fires in the wide rail (see
   the LEFT RAIL media query), which was never the overflow surface to
   begin with — its sub-list already shows every button, always, in a
   vertical column. */
.nav-sublist-list {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  gap: 4px;
  overflow: hidden;
}

.nav-sublist-list .tab-button {
  flex: none;
  white-space: nowrap;
}

/* The active sub-tab goes first in the clipped row, so what the clip cuts is
   always a tab that is not the current one ("Tena" for Tenant slots at 500px
   was the active label). Only the visual order changes: the DOM order, tab
   order and the pop-up (outside '.nav-sublist-list') keep the menu order. In
   the rail the list is 'display: contents' inside a block, so 'order' does
   nothing there. */
.nav-sublist-list .tab-button.active {
  order: -1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-sublist-more {
  position: relative;
  flex: none;
}

/* Reuses '.tab-button' (via the extra class on the element itself, see
   'render_nav_sublist') so it reads as one more link in the row rather
   than a UI chrome button — the first cut's boxed/bordered look was the
   complaint. */
.nav-sublist-more-trigger {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.nav-sublist-more-chevron {
  font-size: 10px;
  transition: transform 0.15s ease;
}

.nav-sublist-more.sub-menu-open .nav-sublist-more-trigger {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.nav-sublist-more.sub-menu-open .nav-sublist-more-chevron {
  transform: rotate(180deg);
}

/* Right-anchored under the trigger (not the row — the row can be far wider
   than the pop-up) and stacked above the clipped list via z-index, per the
   "takes visual precedence" ask, rather than the list needing to make room
   for it. */
.nav-sublist-popover {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 200px;
  margin-top: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.nav-sublist-popover .tab-button {
  width: 100%;
  text-align: left;
  white-space: normal;
  margin-bottom: 0;
  border-bottom: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  padding-left: 12px;
}

.nav-sublist-popover .tab-button.active {
  border-left-color: var(--brand);
  background: var(--bg);
}

/* The app's panel header, used ~108 times across every tab — which is why
   it, and not any per-panel rule, is where the heroes' vocabulary reaches
   the rest of the UI. Same monospace micro-label as '.ruled-cell-slug' and
   '.ruled-aside': uppercase, widely tracked, quiet. It reads smaller than
   the 13px sans it replaced on purpose; a label that names a panel should
   not compete with the panel's own content. */
.section-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 16px 0 12px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title-row .section-title {
  margin: 16px 0;
}

/* Historical value indicator (see ControlPlane.Historical.dotColor) —
   background-color is set inline per call, this only handles shape. */
.history-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  vertical-align: middle;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-contrast);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-primary:disabled {
  background: #c7c9d9;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Hover and keyboard focus, from tokens only: a tint of the text colour
   over the surface, so the fill follows the theme and the label ('--text')
   keeps its contrast in both. Literal colours here were what needed a
   dark-theme override, and that override was what made the label
   unreadable (see the note above the status pills' dark colours). The
   plain declarations first are for a browser without 'color-mix'. */
.btn-secondary:hover,
.btn-secondary:focus-visible {
  color: var(--text);
  background: var(--surface);
  border-color: var(--text-muted);
  background: color-mix(in srgb, var(--text) 6%, var(--surface));
  border-color: color-mix(in srgb, var(--text) 30%, var(--border));
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* A disabled one does not answer the pointer. */
.btn-secondary:disabled:hover {
  background: var(--surface);
  border-color: var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 6px 10px;
  font-weight: 500;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: #93190f;
}

.btn-danger:disabled {
  background: #e2a29a;
  border-color: #e2a29a;
  cursor: not-allowed;
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #17181c;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 15px;
  transition: background-color 0.15s ease;
}

.btn-github:hover {
  background: #000;
}

/* 'width: 100%' plus a cap, not one or the other: the width keeps inputs
   filling a narrow column, the cap stops them smearing across a wide one.
   Any new full-width control needs the same treatment (or a grid cell). */
.text-input {
  width: 100%;
  max-width: 42ch;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.text-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Matches .text-input, minus the width — every .select-input sits in a
   .form-row flex row beside a text input or a label, so it sizes to its
   widest option rather than stretching. 'appearance: none' drops the
   platform chrome (which is what made these read as unstyled next to
   everything else), so the chevron has to be drawn back in as a
   background image; the right padding leaves room for it. */
.select-input {
  padding: 10px 32px 10px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236b7280' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

.select-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.select-input:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.form-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  margin-bottom: 12px;
}

.form-row .text-input {
  flex: 1;
}

.docs-links-row {
  flex-wrap: wrap;
}

/* The row a bucket action form ends with (projectz feature 5b4f3a67): its
   Save, then "Skip to"/"Done" and "Back" on a step of the set-up sequence,
   then a "Clear" where the form has one. A side panel is narrow and the
   labels are long ("‹ Back: name and labels"), so the row wraps and no
   button is squeezed below its label. */
.bucket-step-actions {
  flex-wrap: wrap;
  align-items: center;
}

.bucket-step-actions .btn {
  flex: none;
}

/* Consume classes ('Main.Render.Classes'): one block per class, both in the
   bucket detail (sentences) and in the side panel's form (fields). A block
   is marked by a rule on its left, not by a box: the panel is already a
   ruled block and the detail a card, and a box inside either is a third
   frame. Every colour is a token, so the dark theme follows.

   The floor line holds up to six controls (dimension, amount, release rule,
   lead and its unit, Remove) and the side panel is half the content column,
   so the line wraps and its inputs are capped: per WIDE UI MODE, a control
   that grows gets a max-width. */
.class-declaration {
  max-width: 80ch;
  margin-bottom: 16px;
}

.class-block {
  border-left: 2px solid var(--border);
  padding: 2px 0 2px 12px;
  margin: 0 0 14px;
}

.hint-text + .class-block {
  margin-top: 12px;
}

.class-block p {
  margin: 4px 0;
  font-size: 14px;
  max-width: 65ch;
}

.class-block .class-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.class-block .class-now {
  font-weight: 600;
}

.class-floor-row {
  flex-wrap: wrap;
  align-items: center;
}

.class-floor-row .text-input {
  flex: 1 1 12ch;
  min-width: 10ch;
  max-width: 22ch;
}

.class-floor-row .select-input {
  min-width: 0;
  max-width: 100%;
}

.class-floor-row .btn {
  flex: none;
}

.class-block .class-floor-reads {
  margin: -6px 0 12px;
  font-size: 12px;
}

/* The line at the top of a step that names the sequence and the step. */
.bucket-panel-steps {
  margin: 0 0 6px;
}

/* A sentence under one field of the name/description/labels form: pulled up
   against its input, since the row above ends in a 10px margin, and followed
   by a wider gap than the one between two fields, so that it reads as
   belonging to the field above and not to the next label. Two classes in
   the selector on purpose: '.hint-text' is declared further down with a
   margin of its own, and at equal specificity it won, so that this rule's
   margins never applied and the sentence touched the next label. */
.hint-text.metadata-field-hint {
  margin: -6px 0 18px;
}

/* (bf2), feedback 773ac036: the plan create/edit form's stacked label
   layout — label on its own line above its input, rather than "Label:
   [input]" run together in a '.form-row'. '.plan-form-row' pairs two
   fields side by side (bucket/webhook limits, rate-limit rpm/burst) so
   related numbers stay visually grouped without forcing every field in the
   form onto its own full-width row. */
.plan-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  flex: 1;
}

.plan-form-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.plan-form-row {
  display: flex;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-top: 12px;
  cursor: pointer;
}

/* (ce), feedback e79925b4: the Buckets panel's "Show parents" / "Show
   sub-buckets" context controls. Deliberately NOT '.checkbox-row' — that one
   is a stacked form row with a top margin, these sit inline in a '.form-row'
   beside the search input. Sized to match '.btn-sm' so the row still reads as
   one strip of controls. Inline-flex and content-width: it must never grow to
   the '.form-row' width (see the stylesheet's WIDE UI MODE section). */
.toggle-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.toggle-check:hover {
  background: var(--bg);
  color: var(--text);
}

.toggle-check input {
  accent-color: var(--brand);
  margin: 0;
  cursor: pointer;
}

/* The checked state is what (ce) was actually about — the old buttons
   appended an '.active' class the stylesheet never styled. The native
   checkbox carries it, and this makes it legible at a glance across the row. */
.toggle-check.checked {
  color: var(--text);
  border-color: var(--brand);
  background: var(--surface);
}

/* (cd), feedback a6fa8685: the structured bucket-metadata editor's field
   rows. Stacked label-over-input rather than a two-column grid — this form
   lives in the buckets side panel, which is narrow in every width mode, so a
   label column would leave the inputs unusably short. */
.metadata-field-row {
  display: block;
  margin-bottom: 10px;
}

.metadata-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  cursor: help; /* the raw budgetz/ key is in the title attribute */
}

.metadata-labels .form-row {
  gap: 8px;
}

/* Wraps, since labels are caller-defined text of any length and there can be
   any number of them. Empty when the bucket has none, hence no margin of its
   own — the ':not(:empty)' guard keeps the add-field from being pushed down
   by a gap that has nothing above it. */
.label-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.label-chip-row:not(:empty) {
  margin-bottom: 8px;
}

.label-chip-remove {
  background: none;
  border: none;
  padding: 0 0 0 5px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.label-chip-remove:hover {
  color: var(--danger);
}

.hint-text {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* Account > Tenant slots: the saved billing details, read back above the
   tenant types ('Main.Render.render_billing_readback'). The facts take the
   width, "Edit" sits at their top right and drops under them when the row
   is too narrow for both. While editing, the block holds the form, capped
   like any other stacked form so that its inputs do not run 1280px wide. */
.billing-readback {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
}

.billing-readback .success-text {
  margin: 0;
}

/* Account > Tenant slots, what "Cancel purchase" or "Close payment page"
   just did (Main.Render.render_basket_notice), in "Awaiting payment": the
   same box as "Billing details saved". A <p> directly in a '.ruled-panel',
   so the panel's gap spaces it and it has no margin of its own; as wide as
   its sentence (up to the box's 65ch), not stretched across the panel. */
.basket-notice {
  margin: 0;
  align-self: flex-start;
}

.billing-readback-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
}

.billing-readback-row .ruled-kv-list {
  flex: 1 1 280px;
  min-width: 0;
}

/* Projectz feature 5eaf42fc: Edit and "Preview an invoice" side by side,
   wrapping at phone width, the refusal under them. */
.billing-readback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 100%;
}

.billing-readback-editing {
  max-width: 640px;
}

.plan-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 12px 0 16px;
}

.plan-option-card {
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* A tenant type that is in the cart (projectz feature 0990a13f): the card
   says so, because the cart itself, drawn under the cards, can be out of
   view. */
.plan-option-in-cart {
  border-color: var(--brand);
}

/* The next tenant type up, marked by an Upgrade landing (projectz feature
   30260fce, Main.Render.Intent.upgradeMarkedType): the intent strip's accent
   edge, so the two read as one; marked, not in the cart, so the full brand
   border stays the cart's. Theme tokens only. */
.plan-option-next-up {
  border-left: 3px solid var(--brand);
}

.plan-option-mark {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.plan-option-actions {
  display: flex;
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.plan-option-in-cart-note {
  font-size: 13px;
  font-weight: 600;
}

/* Account > Tenant slots, a payment's receipt (Main.Render.render_receipt):
   the title and the amount on one line, then one fact per line on the
   '.ruled-kv' scale, then Dismiss. Inside the notices' '.ruled-panel', so it
   brings no border of its own; several receipts are separated by a hairline.
   Tokens only. The amount is the one large figure (tabular, so two receipts
   line up). Capped like the cart: a fact's value stays near its label on a
   1280px panel. */
.receipt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 560px;
  min-width: 0;
}
.receipt + .receipt,
.receipt + .form-row,
.form-row + .receipt {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.receipt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.receipt-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.receipt-amount {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.receipt .hint-text {
  margin: 0;
}
.receipt-actions {
  display: flex;
  justify-content: flex-start;
}
/* The invoice, as a link that opens it in the panel ('.invoice-panel'
   below): a button, since it goes nowhere, drawn as the text link it reads
   as. */
.receipt-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: var(--brand);
  text-decoration: underline;
}
.receipt-link:hover {
  text-decoration: none;
}
/* What "Buy more tenant slots" scrolls to
   (ControlPlane.Receipt.purchasePanelId): kept off the window's top edge. */
#buy-tenant-slots {
  scroll-margin-top: 16px;
}

/* An invoice opened over the page (Main.Render.render_invoice_panel,
   projectz feature 5f53924f), from a receipt, a slot row's warning, a line
   under "Awaiting payment", a row of the Invoices table or a notice.

   The feedback drawer's box ('.feedback-drawer'), at the top right where
   that one is at the bottom right: fixed to the window, so it is the same
   at every width and in both layout regimes and there is no '.app-wide' /
   '.app-full' copy to write (WIDE UI MODE rule 9). Above the drawer and its
   button (z-index 20), and it stops short of that button, so feedback stays
   reachable while an invoice is open.

   Not modal: there is no backdrop and the page behind scrolls and takes
   clicks. Its own content scrolls inside it ('max-height' + 'overflow-y'),
   so a short window never puts Close or Pay out of reach. Capped at 420px:
   a fact's value stays next to its label ('.receipt' is capped the same
   way). Below 520px it takes the window's width less a margin, as the
   feedback drawer does. Every colour is a token. */
/* A Copy button whose text did not reach the clipboard
   (Main.Render.render_copy_fallback, projectz feature 538c6d8d): the
   reason, then the text selected in a read-only field to copy by hand.
   The invoice panel's box, fixed to the window at the top centre so it is
   seen wherever the button was scrolled to, at every width and in both
   layout regimes (WIDE UI MODE rule 9), above the invoice panel and the
   feedback drawer. Not modal. Below 520px it takes the window's width less
   a margin. Every colour is a token. */
.copy-fallback {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  box-sizing: border-box;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  color: var(--text);
}

.copy-fallback-title {
  margin: 0;
  font-size: 16px;
}

.copy-fallback .error-text,
.copy-fallback .hint-text {
  margin: 0;
}

.copy-fallback-text {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: 5em;
  font-family: var(--mono);
  font-size: 13px;
  resize: vertical;
  overflow-wrap: anywhere;
}

.copy-fallback-actions {
  display: flex;
  justify-content: flex-end;
}

.invoice-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 30;
  box-sizing: border-box;
  width: min(420px, calc(100vw - 40px));
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  color: var(--text);
}
/* Projectz feature 19fed652: no child shrinks. The panel is a flex column
   that scrolls, and a child that clips its own overflow (the lines'
   '.table-scroll') has a minimum height of zero, so it shrank to make room
   and "What it bills" was hidden behind Pay and Download. The panel
   scrolls instead. */
.invoice-panel > * {
  flex-shrink: 0;
}
/* The panel is focused by the Console when it opens, so that Escape reaches
   it; it is not a control, and the controls inside keep their own ring. */
.invoice-panel:focus {
  outline: none;
}
/* The children are spaced by the panel's gap, not by their own margins. */
.invoice-panel > .ruled-panel-head-row,
.invoice-panel > .ruled-panel-head,
.invoice-panel > .ruled-kv-list,
.invoice-panel > .hint-text,
.invoice-panel > .error-text {
  margin: 0;
}
/* A second payment against one invoice is separated by a hairline. */
.invoice-panel-payment + .invoice-panel-payment {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.invoice-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
/* The link that opens the panel from a line under "Awaiting payment": the
   size of the dates beside it. */
.slot-invoice-link {
  font-size: 13px;
  text-align: left;
}
@media (max-width: 520px) {
  .invoice-panel {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 96px);
  }
}

/* The cart on Account > Tenant slots. Scrolled to when the first thing is
   added and from a card's "View cart" (Main.Types.purchaseCartPanelId):
   the margin keeps its title off the window's top edge. */
#purchase-cart {
  scroll-margin-top: 16px;
}

.purchase-cart {
  /* A direct child of a '.ruled-panel', whose gap spaces it. Capped: a
     line spanning a 1280px panel puts its price far from its name. */
  max-width: 760px;
  margin: 0;
}

.purchase-cart-line {
  justify-content: flex-start;
  font-size: 14px;
}

.purchase-cart-name {
  flex: 1 1 90px;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.purchase-cart-quantity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.purchase-cart-count {
  min-width: 2ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.purchase-cart-price {
  flex: 1 1 130px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 2px 12px;
  text-align: right;
}

.purchase-cart-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* "Remove" is a '.btn-ghost' (projectz feature c697e271). Its hover fill is
   '--bg', which is the row's own background, so here it takes the other
   surface token and the hover is visible in both themes. */
.purchase-cart-line .btn-ghost:hover {
  background: var(--surface);
}

.purchase-cart-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  margin: 10px 0 0;
  padding: 10px 14px 4px;
  font-size: 14px;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

/* Projectz feature 7bec39a2: with French VAT the total is three rows, before
   tax, the VAT and after tax; the first two are the lighter subtotals under
   one rule, the last carries the weight and the rule above it. */
.purchase-cart-total.purchase-cart-subtotal {
  font-weight: 400;
  color: var(--text-muted);
}
.purchase-cart-subtotal + .purchase-cart-subtotal {
  border-top: none;
  margin-top: 0;
  padding-top: 2px;
}

.plan-option-available {
  border-left-color: #16a34a;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.plan-option-available:hover {
  background: var(--bg);
  border-color: #16a34a;
}

.plan-option-depleted {
  border-left-color: var(--danger);
}

.plan-option-selected {
  border-color: var(--brand);
}

.plan-option-title {
  font-weight: 700;
  font-size: 14px;
}

/* Projectz feature 099ece34: a plan's description for buyers, one line of
   the admin's plain text under the plan's name (the purchase card, the
   switch dialog, the admin plan list). Wraps rather than truncates: it is
   at most 200 characters and is the point of the card. */
.plan-description {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  max-width: 60ch;
}

/* Backlog (bw1): the admin plan form's price editor -- one row per
   currency: a short code box, the amount, a remove button. Capped like
   every .text-input so it doesn't smear across a wide shell. */
.plan-price-editor {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.plan-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 42ch;
}

.plan-price-row .plan-price-currency {
  /* Wide enough for a 3-letter code *plus* the picker arrow Chrome draws
     inside any input with a datalist -- at 7ch the arrow left room for one
     letter. */
  flex: 0 0 11ch;
  width: 11ch;
  text-transform: uppercase;
}

.plan-price-row .plan-price-amount {
  flex: 1 1 auto;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

/* Backlog (bw1): the plan's price list, one line under the title. Muted
   and tabular so side-by-side cards line their amounts up; the currency
   list can wrap on a narrow card. */
.plan-option-price {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.plan-option-status-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-bg);
  padding: 1px 8px;
  border-radius: 999px;
}

/* PLAN FACTS -- what a tenant type grants, on Account > Tenant slots
   (projectz feature ea63d8b3): the two columns of a purchase card and the
   row headers of the "Compare plans" table under the cards.

   A card lists the headline values only ('-lead': buckets, webhook
   configs, history retention), in the text colour; every other value is in
   "Compare plans" alone (projectz feature f4e587b2).

   A fact explains itself in '.plan-fact-tip' while hovered or focused. It
   is an element and not a `title` because a `title` never shows on keyboard
   focus. In a card it takes the width of its column ('left'/'right' 0), so
   it cannot leave the card sideways. */
.plan-option-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px 24px;
  margin: 12px 0;
}

.plan-fact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.plan-fact-list-lead {
  font-size: 13px;
  color: var(--text);
}

.plan-fact {
  position: relative;
  cursor: help;
  border-radius: 3px;
}

.plan-fact-list > .plan-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.plan-fact:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.plan-fact-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.plan-fact-list-lead .plan-fact-value {
  font-weight: 700;
}

.plan-fact-tip {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  /* Never under the pointer's feet: a tip that could be hovered would hold
     itself open over the row below. */
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.plan-fact-tip-above {
  top: auto;
  bottom: calc(100% + 4px);
}

.plan-fact:hover > .plan-fact-tip,
.plan-fact:focus > .plan-fact-tip {
  visibility: visible;
  opacity: 1;
}

/* "Compare plans": one column per tenant type. The row headers are the
   same facts as the cards', so they are sentence case like the tenant
   row's details table, not the uppercase of a column header. A tip here
   has a width of its own (its anchor is only as wide as the label), and the
   lower rows' tips open upwards ('.plan-fact-tip-above') because
   '.table-scroll' clips whatever leaves it. */
.plan-compare {
  margin-top: 8px;
  min-width: 0;
}

/* Folded, closed by default (projectz feature f4e587b2), like
   '.ended-lines': a control-sized summary that keeps its default display,
   which is what draws the disclosure triangle. */
.plan-compare > .plan-compare-summary {
  cursor: pointer;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 600;
}

.plan-compare[open] > .plan-compare-summary {
  margin-bottom: 4px;
}

.plan-compare-table thead th {
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}

.plan-compare-table thead td {
  border-bottom: 1px solid var(--border);
}

.plan-compare-table th[scope="row"] {
  padding: 8px 10px 8px 0;
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.plan-compare-table tbody tr:last-child th {
  border-bottom: none;
}

.plan-compare-table td {
  font-variant-numeric: tabular-nums;
}

.plan-compare-table .plan-fact {
  display: inline-block;
}

.plan-compare-table .plan-fact-tip {
  right: auto;
  width: min(38ch, 60vw);
}

.plan-option-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-dark);
}

.tenant-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tenant-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.tenant-row-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tenant-row-clickable:hover {
  border-color: var(--brand);
  background: var(--surface);
}

.tenant-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 220px;
}

.tenant-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tenant-url {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tenant-id-pill {
  flex: 0 0 auto;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-muted);
  background: var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  cursor: default;
}

/* Both classes, so that it wins over '.tenant-sub' below (nowrap with an
   ellipsis): a prose line wraps instead of being cut (projectz feature
   0e2d0b15, the Elastic terms line ended "(with your spend cap you stay..."). */
.tenant-sub.tenant-sub-prose {
  font-family: inherit;
  white-space: normal;
}

/* Admin > Billing, failed card charges (projectz feature 47fa9654): a line
   carries a processor id or an idempotency key with no space to break at. */
.tenant-sub.failed-charge-line {
  overflow-wrap: anywhere;
}

/* Admin > Billing > Invoices (projectz feature 5eaf42fc): the filter row
   wraps at narrow widths instead of squashing its five inputs, and a
   credit note's line (number, amounts, the reason someone typed) wraps
   rather than widening the page. */
.admin-invoices-filters {
  flex-wrap: wrap;
}
.admin-invoices-filters .text-input {
  flex: 1 1 11ch;
  min-width: 11ch;
}
.tenant-sub.credit-note-line {
  white-space: normal;
  overflow-wrap: anywhere;
}
.credit-note-row {
  flex-wrap: wrap;
}

/* Admin > Billing > account, "Request a payment" (projectz feature
   28b9221f): one row per line, the description taking what the amount and
   Remove leave, wrapping under each other on a narrow window. */
.payment-request-card .form-row {
  flex-wrap: wrap;
}
.payment-request-line .payment-request-description {
  flex: 3 1 24ch;
  min-width: 0;
}
.payment-request-line .payment-request-amount {
  flex: 1 1 12ch;
  min-width: 0;
  max-width: 18ch;
}
.payment-request-card .payment-request-note {
  flex: 1 1 100%;
  max-width: 72ch;
}
.payment-request-field {
  align-self: center;
}
/* The note a payment request carries, in the customer's invoice panel. */
.payment-request-note {
  white-space: pre-wrap;
}

/* Admin > Billing, a payment owed back on an awaiting row (v21 walkthrough,
   projectz feature a246702f): a row of its own under the facts, the
   sentence wrapping (a processor reference has no space to break at) and
   the two buttons wrapping under it, rather than one unbreakable line that
   ran past the list. */
/* The invoice's number above its period in Account > Invoices (projectz
   feature a246702f), in the monospace the panel prints it in. */
.invoice-number-cell {
  font-family: var(--mono);
  font-size: 12px;
}
.admin-owed-back-list {
  flex: 1 1 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-owed-back {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.admin-owed-back > p {
  margin: 0;
}

.tenant-new-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.tenant-new-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  border: 1px solid var(--brand);
  padding: 0 6px;
  border-radius: 4px;
  margin-right: 4px;
}

.tenant-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.feedback-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-status-badge,
.feedback-category-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.feedback-status-badge {
  background: #000000;
  color: #ffffff;
}

.feedback-category-badge {
  background: #6b7280;
  color: #ffffff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}

/* Backlog item (bu), feedback 7765a123: 'budgetz/labels' chips, rendered
   before the status pill (see 'bucket-header-right' in
   Main.Render.Bucket.render_bucket_node) — theme-token-based rather than
   the '.status-pill' family's hardcoded per-status hexes, since a label is
   caller-defined text with no fixed palette to key off. Reused unstyled
   (border only) for the filter-row toggle chips below. */
.label-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  white-space: nowrap;
  vertical-align: middle;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.label-chip-filter {
  cursor: pointer;
  user-select: none;
}

.label-chip-filter.active {
  background: var(--brand, var(--border));
  color: #fff;
  border-color: transparent;
}

.status-pill-active {
  background: #dcfce7;
  color: #15803d;
}

.status-pill-frozen {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill-depleted {
  background: #fee2e2;
  color: #b91c1c;
}

.status-pill-archived {
  background: #e5e7eb;
  color: #4b5563;
}

.status-pill-other {
  background: #e5e7eb;
  color: #4b5563;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
}

.kv-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  align-items: center;
}

.kv-row .btn {
  margin-left: auto;
  white-space: nowrap;
}

/* (be), feedback dce28199: Console "Plan & usage" panel — labels left,
   values right, rather than the value trailing the label immediately. Scoped
   to this modifier rather than changing .kv-row itself, since most other
   kv-rows (instance-url, tenant-id, ...) are label-then-value prose, not a
   label/value table, and space-between would misalign those. */
.kv-list-columns .kv-row {
  justify-content: space-between;
}

.kv-list-columns .kv-value {
  text-align: right;
}

/* (eh), feedback c449d0c4: Console "Plan & usage" — the count/limit rows
   (buckets, webhook configs, pending claims) get a stats-tile treatment
   instead of disappearing into the kv-list below them; the rest of the
   panel's rows (rate limits, retention, ...) stay plain kv-rows, since
   those are settings a caller looks up, not headline figures.

   Reuses the hairline-grid convention rather than inventing one:
   '.kpi-grid' paints 'var(--border)', each '.kpi-tile' paints
   'var(--surface)', and the 1px gap between them is the only rule --
   no tile carries a border of its own (see the "Ruled index primitives"
   comment further down this file for why a per-cell border double-draws).

   Deliberately *not* '--display' (Barlow Condensed): CLAUDE.md is explicit
   that face reaches the UI in exactly two places, the wordmark and the
   heroes, and a KPI figure is a plausible third but not one to reach for
   without a decision. This stays inside the vocabulary panel headers
   already use -- '.kpi-tile-label' is the same mono micro-label as
   '.section-title'/'.ruled-cell-slug', just sized for a tile instead of a
   heading, and the number is '--sans' at display weight/size rather than a
   fourth type role. */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 10px 0;
}

.kpi-tile {
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.kpi-tile-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.kpi-tile-value {
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  white-space: nowrap;
}

.kpi-tile-limit {
  font-size: 12px;
  color: var(--text-muted);
}

.kv-key {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
  min-width: 110px;
  flex-shrink: 0;
}

.kv-value {
  overflow-wrap: anywhere;
}

.icon-btn {
  padding: 4px 8px;
  line-height: 1;
  font-size: 13px;
}

.feedback-comments-toggle {
  align-self: flex-start;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.feedback-description summary {
  cursor: pointer;
  list-style: none;
}

.feedback-description summary::-webkit-details-marker {
  display: none;
}

.feedback-description summary::before {
  content: "▸ ";
}

.feedback-description[open] summary::before {
  content: "▾ ";
}

.feedback-description-full {
  display: none;
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.feedback-description[open] .feedback-description-full {
  display: block;
}

.saved-keys-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.saved-keys-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 0 10px 6px;
  border-bottom: 1px solid var(--border);
}

.saved-keys-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.saved-keys-table tr:last-child td {
  border-bottom: none;
}

.saved-key-endpoint {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.saved-key-tenant-link {
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
  display: block;
}

.saved-key-tenant-link:hover {
  text-decoration: underline;
}

.saved-key-forget-cell {
  white-space: nowrap;
  text-align: right;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Paused is a state the *user* chose, not a condition the app is
   reporting, so it does not wear the warning treatment. The filled amber
   chip put an alert badge in the topbar beside two neutral controls and
   pulled the eye there on every page (owner, 2026-09-05). The mark is the
   glyph plus its colour now: no fill, no tinted border. */
.auto-refresh-toggle.paused {
  color: var(--warn-text);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

.bucket-tree,
.bucket-children {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bucket-children {
  margin: 8px 0 0 20px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.bucket-node {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 12px 14px;
}

.bucket-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  vertical-align: -3px;
  margin-right: 4px;
}

.bucket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
}

.bucket-header-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.bucket-header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.bucket-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
}

.bucket-link:hover {
  color: var(--text);
  border-color: var(--brand);
}

.bucket-description {
  margin-top: 2px;
}

/* A '.bucket-detail' panel is sometimes a flex item of a row-flex container
   (e.g. a webhook row's deliveries panel, a sibling of '.tenant-meta' and
   its buttons rather than nested inside it) — without an explicit width, a
   flex item won't shrink below its content's intrinsic size, so a long
   nowrap table row (e.g. a raw HttpExceptionRequest dump) pushes the whole
   row past the page instead of scrolling inside '.bucket-events-scroll'. */
.bucket-detail {
  width: 100%;
  align-self: stretch;
  min-width: 0;
}

/* The Info section's header: the title on the left, the Actions button at
   the right end (projectz feature 39d7e5f4). '.section-title-row' already
   centres and spaces its two children; wrapping lets a narrow card drop the
   button under the title instead of squeezing either. */
.bucket-info-header {
  flex-wrap: wrap;
}

.bucket-info-header .section-title {
  margin: 16px 0 12px;
}

.bucket-menu-anchor {
  position: relative;
}

.bucket-sprocket {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  line-height: 1;
}

/* Bucket card controls (projectz feature 572a46b5): no emoji glyph is a
   control. '.ui-icon' is drawn the way the left rail's icons are, a CSS mask
   filled with 'currentColor', so it follows the theme and looks the same on
   every machine; the visible text label sits beside it. */
.ui-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 6px;
  vertical-align: -0.125em;
  background: currentColor;
}

.ui-icon-gear {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ui-icon-fullscreen {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3'/%3E%3Cpath d='M21 8V5a2 2 0 0 0-2-2h-3'/%3E%3Cpath d='M3 16v3a2 2 0 0 0 2 2h3'/%3E%3Cpath d='M16 21h3a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3'/%3E%3Cpath d='M21 8V5a2 2 0 0 0-2-2h-3'/%3E%3Cpath d='M3 16v3a2 2 0 0 0 2 2h3'/%3E%3Cpath d='M16 21h3a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ui-icon-search {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ui-icon-chat {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ui-icon-refresh {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/%3E%3Cpath d='M21 3v5h-5'/%3E%3Cpath d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/%3E%3Cpath d='M8 16H3v5'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/%3E%3Cpath d='M21 3v5h-5'/%3E%3Cpath d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/%3E%3Cpath d='M8 16H3v5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* The header's controls (projectz feature 712592e8, feedback 7676de0b): the
   power, play and pause marks were U+23FB, U+25B6 and U+23F8, which an older
   font draws as a missing-glyph box. Masks draw the same on every machine. */
.ui-icon-power {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v10'/%3E%3Cpath d='M18.4 6.6a9 9 0 1 1-12.77.04'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v10'/%3E%3Cpath d='M18.4 6.6a9 9 0 1 1-12.77.04'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ui-icon-play {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3l14 9-14 9V3z' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3l14 9-14 9V3z' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ui-icon-pause {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='4' width='4' height='16' rx='1' fill='%23000'/%3E%3Crect x='14' y='4' width='4' height='16' rx='1' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='4' width='4' height='16' rx='1' fill='%23000'/%3E%3Crect x='14' y='4' width='4' height='16' rx='1' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ui-icon-alone {
  margin-right: 0;
}

/* The Info section: label, value (a button that copies it), hint. The value
   wraps rather than widening the card, a full address is long. */
.bucket-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.bucket-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  min-width: 0;
}

.bucket-info-label {
  flex: 0 0 5.5em;
  color: var(--text-muted);
  font-size: 0.85em;
}

.bucket-info-value {
  min-width: 0;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: copy;
  overflow-wrap: anywhere;
}

.bucket-info-value:hover {
  border-color: var(--brand);
}

.bucket-info-value code {
  font-family: var(--mono);
  font-size: 0.9em;
}

.bucket-info-hint {
  color: var(--text-muted);
  font-size: 0.8em;
}

.bucket-info-hint.copied {
  color: var(--success);
}

/* The bucket panel's "JSON" pills (projectz feature 712592e8): a '.pill'
   under the dimension table and under the cumulative totals that copies the
   table as JSON. A <button>, so the defaults '.pill' never met are undone,
   as '.disconnect-pill' does. */
.json-copy-row {
  margin: 6px 0 12px;
}

.json-copy-pill {
  appearance: none;
  font: inherit;
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 10px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.json-copy-pill:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.json-copy-pill.copied {
  color: var(--success);
  border-color: var(--success);
}

.bucket-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 4px;
  margin-top: 4px;
}

.bucket-menu-item {
  border: none;
  background: none;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: inherit;
}

.bucket-menu-item:hover {
  background: var(--border);
}

/* Delete is the one menu entry that can't be undone -- it shouldn't read as
   visually level with "Replenish". */
.bucket-menu-item-danger {
  color: var(--danger);
}

.bucket-menu-item-danger:hover {
  background: var(--danger-bg);
}

/* The four groups of the bucket actions menu (projectz feature e2c3d202):
   a monospace micro-label per group, the panel-header vocabulary. Danger is
   last and set apart by a rule and a tinted heading, so the irreversible
   entries never read as one more line under "Configure". */
.bucket-menu-group {
  display: flex;
  flex-direction: column;
}

.bucket-menu-group + .bucket-menu-group {
  margin-top: 4px;
}

.bucket-menu-heading {
  margin: 6px 10px 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.bucket-menu-group-danger {
  margin-top: 8px !important;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.bucket-menu-group-danger .bucket-menu-heading {
  color: var(--danger);
}

.bucket-detail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13px;
}

.widget-bucket-menu-cell {
  width: 1%;
  white-space: nowrap;
}

.bucket-detail-table th,
.bucket-detail-table td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}

.bucket-events-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.bucket-events-scroll .bucket-detail-table td {
  white-space: nowrap;
}

/* A bucket's Reservations section (projectz feature bd6d79f0,
   'Main.Render.Bucket.Holds'). Its metadata and its Cancel confirmation
   wrap inside their cells instead of pushing "Yes, cancel" past the
   scroll box's edge, where it was hidden even at 1400px. The question
   sits on its own line above the two buttons. */
.bucket-events-scroll .bucket-holds-table td.hold-meta {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 10em;
  max-width: 22em;
}

.bucket-events-scroll .bucket-holds-table td.hold-actions {
  white-space: normal;
  min-width: 9em;
}

.bucket-holds-table td.hold-actions .hold-question {
  display: block;
  margin-bottom: 4px;
}

.bucket-holds-table td.hold-actions .btn + .btn {
  margin-left: 6px;
}

/* Projectz feature 776edcd9: a status filter with its label in front
   ('Main.Render.Bucket.Holds', and the Claims page's), and the Claims
   page's pointer to bucket holds, whose sentence wraps beside its button
   and puts the button under it on a narrow screen. */
.bucket-events-scroll .bucket-holds-table td.hold-outcome {
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 16em;
}

.form-row.labelled-filter {
  align-items: center;
  flex-wrap: wrap;
}

.form-row.claims-holds-pointer {
  align-items: center;
  flex-wrap: wrap;
}

.form-row.claims-holds-pointer .hint-text {
  flex: 1 1 20em;
  margin: 0;
}

/* Multi-root API keys' bucket picker: a checkbox tree can run both deep
   (many nested levels) and long (many siblings), so this needs its own
   scroll box rather than growing the create-key form open-endedly — same
   "full-width control needs a max-width or a grid cell" reasoning as
   '.bucket-events-scroll' above. max-height is duplicated into the wide-UI
   blocks below per maintenance rule 9. */
.root-picker-scroll {
  max-width: 100%;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.root-picker-node {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Left-aligned, not centered: this cell's colSpan spans the whole
   (frequently very wide, horizontally-scrolling) events table, so a
   centered date would render far past the visible left edge of
   '.bucket-events-scroll' instead of lining up with the "time" column
   where a reader's eye already is. */
.timeline-separator-row td {
  background: var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 3px 8px;
  white-space: nowrap;
}

/* Feedback bb241970 (A): the "recovers on its own" marker, sitting beside
   the mode glyph. Deliberately dimmer than the glyph it trails — it
   qualifies the mode rather than competing with it — and cursor:help
   because the schedule itself only lives in the title attribute. */
.scheduled-refill-icon {
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.75;
  cursor: help;
}

/* Feedback bb241970: the per-dimension resources table, as distinct from
   the other two '.bucket-detail-table's in the same panel (cumulative
   totals, activity) — those legitimately want every pixel for long JSON
   details, this one holds five short columns.

   The cap is load-bearing in the wide layout, not cosmetic: an uncapped
   table stretches its columns across the full shell, which parks the
   refill button several hundred pixels from the amount bar it acts on and
   defeats the point of putting it on the row. See style.css's "WIDE UI
   MODE" section — same class of hazard, and the reason this was caught at
   1400px rather than at 640px where it looked fine. */
.bucket-resources-table {
  max-width: 640px;
}

/* Shrink-to-fit, so the slack goes to the dimension/amount columns rather
   than to a trailing column of empty space. Same 'width: 1%' trick as
   '.widget-bucket-menu-cell' above. */
.bucket-resources-table .refill-cell {
  width: 1%;
  white-space: nowrap;
}

/* Feedback bb241970 (B): the per-dimension "top this back up" button. The
   action column is the table's last and narrowest, so the button must not
   force the row wider than the amount bar it belongs to — hence the
   tightened padding and a nowrap label. Disabled means "already at
   maximum" (or a refill in flight), which is an ordinary resting state
   here rather than an error, so it fades rather than turning red. */
.refill-to-max {
  padding: 1px 6px;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}

.refill-to-max:disabled {
  opacity: 0.35;
  cursor: default;
}

.resource-blocks {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
  cursor: default;
}

.resource-amount {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  cursor: default;
}

.resource-figure {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* "N available" beside a held dimension's figure (bucket panel): current
   minus what reservations hold, as buckette-core's raAvailable says. */
.resource-available {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill + .resource-available {
  margin-left: 6px;
}

.resource-block {
  display: inline-block;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: transparent;
}

.resource-block.reserved {
  background: var(--warn-border);
  border-color: var(--warn-border);
}

.resource-block.used {
  background: var(--text-muted);
  border-color: var(--text-muted);
}

.resource-block.free {
  background: #dcfce7;
  border-color: #bbf7d0;
}

/* A Monitors dimension widget's row for a spend counter: a dimension with
   no maximum whose balance consumption has taken below zero (feedback
   b6252c92). The amount and a bar scaled against the widget's largest
   counter, since there is no maximum to fill toward. The track has a
   max-width for stylesheet rule "any new full-width control needs a
   max-width": the widget table is 100% wide, and an uncapped track would be
   a 1000px smear in the wide layout. */
.spend-counter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  cursor: default;
}

.spend-counter-amount {
  min-width: 11ch;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.spend-counter-track {
  flex: 1 1 80px;
  max-width: 240px;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
}

.spend-counter-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--text-muted);
}

@media (max-width: 520px) {
  /* The shell has no side padding here so that the cards and the ruled
     blocks run edge to edge, which is why the things that are not one of
     them (the top strip, the navigation, a page's masthead) need a gutter
     of their own: without it they touch the screen's edges and a long
     title is cut by it (projectz feature d3535ba1). Give a new block that
     is neither a card nor a ruled block the same. */
  .app-shell {
    padding: 0;
  }

  /* '.app-shell' in front: the masthead's own rule, far below this block,
     sets 'padding' whole at the same specificity and would win. */
  .app-shell .topbar,
  .app-shell .dashboard-nav,
  .app-shell .ruled-masthead {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card {
    padding: 10px;
    border-radius: 0;
    box-shadow: initial;
  }

  /* '.widget-grid > .card' (style.css:251) has the same specificity as the
     bare '.card' above but no media query, so it always wins on source
     order and the reduction above never reached widget boxes — feedback
     66fc076a. Repeating the override here, scoped to the same selector,
     is what actually beats it. */
  .widget-grid > .card {
    padding: 8px;
    margin-top: 8px;
    border-radius: 0;
  }

  .mode-col-label {
    display: none;
  }

  /* Nested indentation compounds with depth and eats phone-width screens. */
  .bucket-children {
    margin: 8px 0 0 0;
    padding-left: 0;
    border-left: none;
  }

  /* Visual truncation only — the underlying DOM text is untouched. */
  .bucket-node .tenant-url {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* Stack the docs/openapi links one per row and pare them down to
     link-like styling instead of full buttons, which don't fit three
     across on a phone-width screen. */
  .docs-links-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  /* Any .btn variant dropped in here needs re-colouring, not just
     de-backgrounding: '.btn-primary' carries white text to sit on its
     indigo fill, and stripping the fill alone leaves it white-on-white.
     Caught at 500px when Getting Started gained a primary "Create an API
     key" action beside the doc links (feedback 7126ec6f). */
  .docs-links-row .btn {
    background: transparent;
    border: none;
    padding: 6px 2px;
    text-decoration: underline;
    justify-content: flex-start;
    color: var(--text);
    /* 'justify-content' only bites while these are flex items; once the
       grid above lays them out as blocks, a <button> still centres its own
       text where an <a> does not, so the column came out ragged. */
    text-align: left;
  }

  /* ...but a primary action should still read as the emphasized one, even
     once it has been pared down to a text link. */
  .docs-links-row .btn-primary {
    color: var(--brand);
    font-weight: 700;
  }
}

/* Prose measure caps: readable line length is a property of the text, not
   of the container, so these apply at every width rather than only in wide
   mode. Cap any new prose/helper-text class the same way. */
.empty-state {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
}

.bucket-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0 0;
}

.bucket-pagination-label {
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-row {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 8px 0;
}

.error-text {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  max-width: 65ch;
}

/* A Connect/etc action inlined into an .error-text sentence (e.g. the
   Monitors notifier widget's "connect it" — feedback: let it connect
   directly rather than sending the user to the Notifiers tab). Styled as a
   link so it reads as part of the sentence, not a separate control. */
.widget-inline-action {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Monitors event-log widget (projectz feature 08534e4c).

   The body is its own scroll box in both directions: a widget is one card
   in a grid of them, and a few hundred event rows — or a template's output
   over the same — must not set the height of the whole dashboard, nor push
   a long unwrapped details cell out the side of the card. 'min-width: 0'
   on the wrapper is what lets the card's grid track shrink below the
   table's min-content so that the overflow lands here (same reasoning as
   the '.buckets-columns > *' rule in WIDE UI MODE).

   The max-height is deliberately written once, not per regime: it is a
   widget-card height, and a card is no taller in wide mode. That is also
   why the built-in table does not borrow '.bucket-events-scroll' — the
   WIDE UI MODE blocks raise that class to 520px — and restates its one
   useful rule (cells do not wrap) here instead. */
.event-log-widget {
  min-width: 0;
}

.event-log-widget-body {
  max-width: 100%;
  max-height: 360px;
  overflow: auto;
}

.event-log-widget-body .bucket-detail-table td {
  white-space: nowrap;
}

/* The search box shares the row with Reload and nothing else; capped so it
   does not become a 1280px smear when a widget card spans the full shell
   (WIDE UI MODE rule: any full-width control needs a max-width). */
.event-log-widget .bucket-search-input {
  max-width: 420px;
}

/* A truncation or partial-failure notice: what was cut matters more than
   the hint text around it, so it takes the body colour and a rule. */
.event-log-notice {
  color: var(--text);
  border-left: 2px solid var(--border);
  padding-left: 8px;
  margin: 6px 0;
}

/* Feedback 83c5a3ca (c): generic success flash for the bucket create/action
   panels — 'error-text''s twin, same shape, '--success'/'--success-bg'
   tokens defined alongside '--danger'/'--danger-bg' at the top of this
   file (both theme blocks). */
.success-text {
  color: var(--success);
  background: var(--success-bg);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  max-width: 65ch;
}

.warning-text {
  color: var(--warn-text);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  max-width: 65ch;
  margin-top: 8px;
}

.reveal-panel {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

/* A one-time key panel's notice at the top of every section other than
   Your tenants ('Main.Render.render_shown_key_notices', projectz feature
   1c8f18da). The warning box of the panel it stands for, without the key.
   The prose keeps its measure: the box is as wide as the content column,
   which is 1280px or more in the wide layout. */
.key-notice p {
  margin: 0 0 10px;
  max-width: 65ch;
}
.key-notice .form-row {
  flex-wrap: wrap;
  margin-bottom: 0;
}

.reveal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--warn-text);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}

/* Feedback fda61af6: same box (rounded, padded, stop-propagation-friendly
   container) as '.reveal-panel' but neutral-coloured, for call sites that
   only wanted that shape/animation and picked up '.reveal-panel' for its
   layout without meaning to also claim its warn-yellow "a secret was just
   revealed" styling — the tenant-details Monitors/Usage tab-bar and an
   open monitor's widget dashboard both did this. Use this instead of
   '.reveal-panel' whenever the content isn't actually a just-revealed
   secret. */
.inline-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.reveal-notes {
  margin: 8px 0 12px;
  padding-left: 18px;
  max-width: 70ch;
  font-size: 13px;
}

.reveal-notes li {
  margin-bottom: 4px;
}

.reveal-key-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.help-topic-item {
  display: flex;
  flex-direction: column;
}

/* ---- Ruled index primitives (2026-09-04, feedback 40e6b02c) ----
   Design rationale, the surface-selection table, and the decisions that
   were reversed: specs/visual-identity.md. This block is the
   implementation and the authority on values.

   The catalog vocabulary the section heroes introduced, lifted out of them
   so that a surface which is already a list of destinations becomes a class
   swap rather than a rewrite. The '.hero-*' section below now keeps only
   what is genuinely about a hero — the spine, the masthead variant, the
   outer column track; everything structural lives here.

   Extracted because the owner asked for this feel across the app (feedback
   40e6b02c). See backlog-todo.md's Console visual-language entry, which
   also records that the "index-shaped surfaces only" scoping this
   vocabulary originally shipped under was deliberately widened by the owner
   at that point — so a broad port is the decision, not an oversight.

   Two rules survive that widening unchanged, because they are about how the
   thing is drawn rather than where it is used:

   1. HAIRLINES ARE GAPS. '.ruled-block' and '.ruled-grid' are painted
      'var(--border)' and every child is painted 'var(--surface)' or
      'var(--bg)'; a 1px gap is what draws each rule. No child carries a
      border of its own — giving one a border double-draws every interior
      line.
   2. IT WEARS THE CARD'S EDGES, AND KEEPS ITS OWN INSIDES. The outer edge
      matches '.card' exactly (border, '--radius', '--shadow'), with
      'overflow: hidden' so children clip to the rounded corner. Ink at full
      strength belongs to nothing inside; a tint is a 'color-mix' of a
      token, never a fourth hardcoded hex. This was the 2026-09-03 same-day
      correction — the first cut flooded the block with '--brand' and
      dropped radius and shadow, and read as a poster from a different
      application. It is the part most likely to be undone by someone
      warming a page up.

   '.ruled-block' owns 'container-type', so every '@container' rule below
   works for any consumer without that consumer arranging it. It sets no
   'grid-template-columns' and no margin: tracks and outer spacing belong to
   whoever is using it. */

.ruled-block {
  container-type: inline-size;
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* A block that holds an open pop-over menu must not clip it. Tenants > Your
   tenants puts the row's "⋮" menu ('.bucket-menu', in the DOM only while
   open) inside this block, and with a single tenant the block is shorter
   than the menu, so 'overflow: hidden' cut off "Recover key" and "Delete"
   (projectz feature 661c9844). The clip is lifted only while a menu is
   open; the first and last children take the block's corner radius so the
   hairline-gap painting still ends on the rounded edge. */
.ruled-block:has(.bucket-menu) {
  overflow: visible;
}

.ruled-block:has(.bucket-menu) > :first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.ruled-block:has(.bucket-menu) > :last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

/* A block owns no outer spacing — its caller does, and on every page with
   one block that caller is '.ruled-masthead''s bottom margin. Tenants ▸
   Your tenants is the first page to stack several (queued requests, the
   list, then the two footnote panels), so the gaps between them are
   written here rather than as a margin on '.ruled-block' itself: a blanket
   'margin-top' would also push every block away from the masthead directly
   above it, and would offset the list block against the details card
   inside '.tenants-columns', which is a grid and already has a gap.

   24px matches '.card''s own 'margin-top' so a page mixing the two stacks
   evenly. */
.ruled-block + .ruled-block,
.ruled-block + .tenants-columns,
.tenants-columns + .ruled-block,
.ruled-block + .notifications-columns,
.notifications-columns + .ruled-block,
/* A tab-level notice above a page's own masthead — Tenants' one-time key
   reveal, which lives above the sub-tab switch so it survives the hop from
   "new" to "list" that a successful create performs. The masthead carries
   only a bottom margin, so without this the block's edge and the
   masthead's 2px rule touch. */
.ruled-block + .ruled-masthead {
  margin-top: 24px;
}

.ruled-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}

/* Reset-heavy because the hero's cells are real '<button>'s — navigation
   has to be keyboard-reachable — and a consumer using '<a>' or '<div>'
   inherits the same box for free. */
.ruled-cell {
  position: relative;
  background: var(--surface);
  border: 0;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s ease;
}

/* The hover mark is a printed tab, not a lift: nothing in a ruled block
   casts a shadow or moves, so an inset edge is what a pointer gets. */
.ruled-cell::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--brand);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.ruled-cell:hover,
.ruled-cell:focus-visible {
  background: var(--bg);
}

.ruled-cell:hover::before,
.ruled-cell:focus-visible::before {
  opacity: 1;
}

.ruled-cell:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* The cell's index mark. In a hero this is the sub-tab's real URL segment
   from 'Main.Route' — the catalog's page number, and the one piece of the
   cell that is machine-checked. A consumer with no URL to show should leave
   it out rather than invent a decorative number. */
.ruled-cell-slug {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brand);
}

.ruled-cell-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.15;
}

.ruled-cell-desc {
  font-size: 13px;
  color: var(--text-muted);
  /* Prose caps by character count, not by viewport. */
  max-width: 34ch;
}

/* Fills the hole an odd cell count leaves in the last row — see
   'Main.Render.Hero.render_hero''s 'colophon'. Hidden in the one-column
   regime, where there is no hole. Not interactive, so it deliberately does
   not take '.ruled-cell''s hover mark. */
.ruled-aside {
  background: var(--surface);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}


/* ---- Modular ruled field (PROPOSAL, 2026-09-04, feedback 40e6b02c) ----
   The half of the vocabulary the heroes did not need, and the half that
   makes the broad pass possible on pages whose content is not a list of
   equal things.

   '.ruled-grid' above is a uniform 2-up: every cell the same width, height
   set by the tallest in the row. That is right for an index and wrong for
   most of the app — a form, a table and a stat strip in the same field want
   different footprints, and forcing them into equal cells is what makes a
   card grid look padded and empty.

   A field is the newspaper answer: a fixed column count, hairline gaps, and
   each block declaring how many columns it occupies. 'grid-auto-flow: dense'
   is the load-bearing bit — a narrow block backfills the hole a wide one
   leaves, so a page of mixed sizes packs without hand-placing anything.

   Three rules:

   1. THE FIELD OWNS THE TRACKS, THE BLOCK OWNS ITS SPAN. Never set
      'grid-column' on a component's own class; add a span modifier. That
      keeps a block reusable in a field of a different width.
   1b. A FIELD TOLERATES HOLES; '.ruled-grid' ABOVE DOES NOT. This is the
      one place the primitives' "hairlines are gaps" rule is inverted, and
      it is deliberate. Mixed spans do not always tile — a 1-column block
      followed by a full-width one leaves a gap 'dense' cannot backfill,
      because by then every remaining candidate is too wide. Under
      gap-painting that hole renders as a slab of 'var(--border)', which
      reads as a rendering fault. So a field paints 'var(--surface)' and
      each block casts its own 1px 'box-shadow' into the gap instead:
      neighbours overlap in the same pixel and still draw one hairline, and
      a hole now reads as an empty cell in a ruled page, which is what it
      is. Do not "simplify" this back to a painted background.
   2. SPANS COLLAPSE, THEY DO NOT SCROLL. Every span drops to full width in
      the one-column regime. A block that only works at 3 columns is a block
      that breaks on a phone.
   3. '.ruled-panel' IS NOT '.ruled-cell'. A cell is a destination — it has
      a hover mark and a pointer because clicking it navigates. A panel is
      content that happens to live in the field; giving it hover affordance
      lies about what it does. */

.ruled-field {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 1px;
  /* Rule 1b: surface, not border — a hole must not read as painted ink. */
  background: var(--surface);
}

.ruled-span-2 { grid-column: span 2; }
.ruled-span-3 { grid-column: span 3; }
.ruled-span-full { grid-column: 1 / -1; }
.ruled-rows-2 { grid-row: span 2; }

/* Content, not a destination: '.ruled-cell' minus the hover tab, the
   pointer and the button reset. */
.ruled-panel {
  background: var(--surface);
  /* At rest only so the hover rule below has something to raise — see the
     hover block for why raising is necessary at all. */
  position: relative;
  transition: background 0.12s ease, box-shadow 0.12s ease;
  /* Rule 1b: the block draws its own hairline into the 1px gap. Two
     neighbours land in the same pixel, so the line stays 1px; '.ruled-block'
     clips the outermost ring at the rounded corner. */
  box-shadow: 0 0 0 1px var(--border);
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* A '.card' lays its children out as blocks, so a button sized to its own
   text. A panel is a flex column, which stretches every child to the full
   width — porting a card straight in turns an ordinary "Log out" into a
   full-bleed slab, and a destructive one into a very loud full-bleed slab.
   Buttons that sit *directly* in a panel opt back out; ones inside a
   '.form-row' were never stretched and are untouched. Found by eye on the
   first port (Account ▸ Settings); it is invisible in the markup, which
   is identical either way. */
.ruled-panel > .btn,
/* Console > Notifiers puts the feed's state on its own line under the
   head (see 'render_console_notifiers_tab' for why it is not *in* the
   head). A '.status-pill' is 'inline-flex', and a flex item stretches on
   the cross axis, so without this the pill paints the panel's full
   width. */
.ruled-panel > .status-pill {
  align-self: flex-start;
}

/* Panel-local metrics for two classes written for the stacked-card layout.
   Both carry vertical margins that a card needs (it lays children out as
   blocks with no gap of its own) and a panel does not — a panel is a flex
   column with an 8px gap, so the margin *adds* to it. '.lede''s 24px
   bottom margin is the loud one: in a card it separates the lede from the
   controls under it, in a panel it opens a 32px hole.

   '.lede' also drops a size, to 14px. At 15px it competes with a panel's
   own content for the eye while the '.ruled-panel-head' above it is 10px,
   and the field is a denser page than a column of cards was. The 60ch
   measure is kept — a panel spanning the full four columns is well over
   100ch wide, and prose that runs the whole width is unreadable no matter
   how well ruled the page is. */
.ruled-panel > .lede {
  margin: 0;
  font-size: 14px;
  max-width: 60ch;
}

.ruled-panel > .hint-text {
  /* Same reason as '.lede''s measure, and set so the two share a right
     edge: 70ch at 12px measures ~467px, which is what 60ch at 14px comes
     to. Measured, not derived — 'ch' is the "0" advance of whichever face
     is resolved, so the ratio is not the ratio of the font sizes. Without
     a cap the hint ran the whole panel, ~95ch in a four-column field. */
  max-width: 70ch;
  margin: 0;
}

.ruled-panel > .form-row,
.ruled-panel > .plan-options-grid,
/* The wizard's event checkboxes (Console > Integrations). */
.ruled-panel > .scope-row,
/* A bucket-action panel's subject line: the id the panel is acting on, as
   a <p>, so it arrives with the UA's 1em margins (Console > Buckets). */
.ruled-panel > .tenant-sub,
/* The bucket-action result flashes -- '.reveal-panel' carries a 20px
   bottom margin for the stacked-card layout it was written for, which in
   a panel adds to the gap instead of replacing it. */
.ruled-panel > .reveal-panel {
  margin: 0;
}

/* The wizard's event groups (Console > Integrations > New notification):
   a '.section-title' micro-label over each group's '.scope-row', set
   close to the row it names rather than '.section-title''s 16px/12px. */
.ruled-panel > .event-group-title {
  margin: 4px 0 -8px;
}

/* A chart is a fixed-px figure in a panel that is usually much wider (see
   the ECharts note in specs/visual-identity.md §8 — the vendored wrapper
   never calls 'resize', so the canvas cannot grow). Centred, because a
   420px canvas pinned to the left of a 1240px panel reads as a chart that
   failed to fill its box, while a centred one reads as a plate. This is
   the convention the spec already stated for chart panels; Console ▸
   Status' two charts were the ones not following it. */
.ruled-panel > .echarts-container {
  align-self: center;
}

/* A form row inside a panel wraps rather than squeezing every field to
   nothing, and this one is a descendant selector on purpose: the rows that
   need it come from form functions that wrap their own content in a plain
   div, so they are never the panel's direct children.

   The create-bucket row is six controls -- dimension, amount, unit, mode,
   max, Remove -- and in a half-width column each '.text-input' shrank to
   about 85px, narrow enough to truncate its own placeholder ("dimension"
   read as "dimensio", "max (optional)" as "max (optio"). A floor plus
   wrapping turns one unreadable line into two readable ones. A row that
   already fits is untouched: wrapping only happens when it cannot. */
.ruled-panel .form-row {
  flex-wrap: wrap;
}

.ruled-panel .form-row > .text-input {
  flex: 1 1 9rem;
  min-width: 9rem;
}

/* A textarea in a panel is the one control that wants the cell's full
   width. '.text-input''s 42ch cap exists for the wide-mode smear rule
   (style.css's WIDE UI MODE, rule: a full-width control needs a max-width
   *or a grid cell*) — a panel is a grid cell, so the cap is already paid
   for here, and keeping it leaves a description box visibly stunted under
   a title row twice its width. Height is set here too because a textarea's
   default two rows is not enough to write a bug report in. */
.ruled-panel .form-row > textarea.text-input {
  max-width: none;
  min-height: 104px;
  resize: vertical;
}

/* '.danger-card' marks the destructive panel, and porting a card into a
   field silently disarms it twice over: it sets 'border-color', but a panel
   has no border (rule 1b draws with 'box-shadow'), and it tints
   '.section-title', which a panel does not have. Both hooks are restored
   here rather than by giving the panel a border, which would double-draw
   against its neighbours' hairlines. Caught by eye on the first port; the
   markup looked correct and the delete panel simply stopped being red. */
.ruled-panel.danger-card {
  box-shadow: 0 0 0 1px var(--danger);
}

.ruled-panel.danger-card > .ruled-panel-head {
  color: var(--danger);
  border-bottom-color: var(--danger);
}

/* The boxed micro-heading each block in the reference carries. Same
   monospace label as '.section-title' and '.ruled-cell-slug', with a rule
   under it so a block reads as titled even when its neighbour is taller. */
.ruled-panel-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  /* Stated rather than inherited from the UA's <p> default, which is what
     it silently was. '.ruled-panel-head-row' below has to reproduce this
     box exactly to keep its rule level with a plain head's, and copying a
     number out of a browser default is how that quietly stops being
     true. */
  margin: 10px 0;
}

/* A panel head with a control on its right — Status' recency-window picker,
   Integrations' "+ New notification". The *row* carries the rule, not the
   label, or the hairline would stop at the end of the text and read as an
   underline rather than as the head's own border. */
/* Occupies exactly the box a plain '.ruled-panel-head' would, so a panel
   whose head carries a control keeps its rule level with every other
   panel's. The label's own margins move out to the row — left inside, they
   sat *within* the border and pushed this one rule 10px below its
   neighbours', which is what Console ▸ Integrations' "+ New notification"
   looked "out of grid" for (2026-09-05). Baseline alignment, so the action
   sits on the label's baseline rather than centring against it and growing
   the row. */
.ruled-panel-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}

.ruled-panel-head-row > .ruled-panel-head {
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* An action in a head strip wears the head's own type, not '.btn'.
   A '.btn' there is a 27px bordered box in a strip that is otherwise an
   11px mono label above a hairline: it makes that one panel's head 39px
   deep where every other head is 18px, so the row falls off the grid every
   other panel shares, and the hairline runs *behind* a floating box.
   Reported on Console ▸ Integrations' "+ New notification" (2026-09-05) as
   the button appearing "out of grid" — which it was, though not by
   overflowing anything.

   Still a real <button> and still obviously clickable: brand-coloured
   against the head's muted grey, underlined on hover. Use this for a
   single action. A segmented pick-one control stays '.width-toggle' (see
   'render_recency_window_picker') — that is the documented convention for
   one, and it has a selected state this cannot express. */
.ruled-panel-head-action {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
}

.ruled-panel-head-action:hover:not(:disabled) {
  text-decoration: underline;
}

.ruled-panel-head-action:disabled {
  color: var(--text-muted);
  cursor: default;
}

/* Two or more head actions on one panel (Buckets: "↓ CSV" and "+ Create").
   '.ruled-panel-head-row' is 'space-between', so two bare buttons there
   would push apart to opposite ends of the row and read as unrelated
   controls; they belong grouped at the right edge, beside each other. */
.ruled-panel-head-actions {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

/* A segmented pick-one control in a head strip — Console ▸ Status'
   recency-window picker. It stays '.width-toggle' (the documented
   convention, and it has a selected state '.ruled-panel-head-action'
   cannot express), but at head-strip scale: at its page size it made that
   one panel's rule sit 13px below its neighbours', the same defect the
   button did, just milder. Measured, not guessed — the target is the plain
   head's rule offset. */
.ruled-panel-head-row > .width-toggle {
  padding: 0;
  gap: 1px;
}

.ruled-panel-head-row > .width-toggle > .width-toggle-btn {
  padding: 1px 7px;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Hovering a block shows which block the pointer is on (feedback
   40e6b02c): its boundary takes the accent, and its ground shifts a few
   percent toward the same colour.

   Still no lift and no pointer, and the width never changes (1px at rest
   and hovered) so nothing reflows as the pointer crosses a page. The ring
   alone was the first cut and the owner asked for the fill as well; the
   cost is that a panel reads very slightly more interactive than it is,
   which is why the tint stays in single digits. 4% was the first
   try and is very nearly invisible on white — indigo at that strength
   reads far weaker than the destructive panel's 5% red does, which is why
   the two percentages differ rather than matching. Ring and fill are the same colour on purpose — one gesture, not
   two — which is also why the destructive panel tints red rather than
   brand.

   '.ruled-cell' is the opposite case and keeps its own brand tab and its
   larger '--bg' background change: it is an affordance for something that
   really does navigate, and it should stay louder than this.

   Two things that are easy to get wrong:

   - CARDS NEST. A monitor widget is a '.card' inside a dashboard panel
     '.card'. Without the ':has' rule both light up at once and the one the
     pointer is actually on stops being identifiable — the outer stands
     down while an inner one is hovered.
   - A PANEL'S RING IS A SHADOW IN A SHARED GAP. Neighbouring rings land in
     the same pixel and later siblings paint last, so a hovered panel has
     to be raised or its own ring is painted over on the sides it shares
     with whatever comes after it in the DOM. */
.card:hover {
  border-color: var(--brand);
}

.card:has(.card:hover) {
  border-color: var(--border);
}

.ruled-panel:hover {
  box-shadow: 0 0 0 1px var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  z-index: 1;
}

/* The destructive panel keeps its own colour: trading the red for the
   brand on hover would be the one place this effect makes the UI less
   safe. Raised at rest as well, so the one ring that must never be half
   painted over never is. */
.ruled-panel.danger-card {
  z-index: 1;
}

.ruled-panel.danger-card:hover {
  box-shadow: 0 0 0 1px var(--danger);
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
  z-index: 2;
}

/* Identity facts inside a panel. Exists because the first port put a raw
   uuid and a status word in body sans next to a switcher list drawn in
   large bold sans with pills — two panels about the same subject that
   looked unrelated (feedback 40e6b02c, second round).

   The vocabulary is the one the heroes already established: a mono
   micro-label for the key, and the value styled by what it *is* rather
   than uniformly. An identifier is mono, because a uuid set in a
   proportional face is unreadable and unscannable; a status or a role is
   a '.pill', which is the same component the switcher list beside it uses
   for exactly the same fact. That shared pill is what makes the two
   panels read as one pair. */
.ruled-kv-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 2px 0 0;
}

.ruled-kv {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}

.ruled-kv-key {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 96px;
  flex-shrink: 0;
}

.ruled-kv-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Identifiers only — a uuid, a login. Not names or prose. */
.ruled-kv-value-mono {
  font-family: var(--mono);
  font-size: 12px;
}

/* The switcher list on the same scale as the fact list beside it. Without
   this its names sit a size up and a weight heavier, which is most of what
   made the pair look mismatched. */
.ruled-panel .account-list {
  margin: 2px 0 0;
}

.ruled-panel .account-list-name {
  font-size: 13px;
}

/* A figure inside a panel: the one place display type is allowed below a
   hero, because a number is the content rather than a label for it. */
.ruled-figure {
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
}

/* The masthead strip. Heavier rules top and bottom than the field's own
   hairlines — in the reference this is the only place ink doubles up, and
   it is what separates the page's title from its contents.

   'margin-top: 4px' (backlog item (el), feedback c9621e18) exists only to
   cancel a collapse it never asked for: the narrow layout's
   '.dashboard-nav:has(.nav-sublist)' carries a deliberate
   'margin-bottom: -4px' (see that rule's own comment) that assumes the
   content after it owns at least 4px of top clearance to eat the overlap
   into. Every other page-opener does (a '.card''s 24px margin-top, a
   '.ruled-block' via the pair rule below); this one had none, so the
   active sub-tab's underline collided with this rule's own 2px top border
   on any page that opens with a masthead directly under a tab that has
   sub-tabs (reported from /tenants/new). Collapses to a net 0px gap
   against that -4px rather than a positive one, matching the flush look a
   sub-tab-less nav already produces here. The wide/rail layout's nav is
   'position: fixed' and never enters this collapse at all, so this is
   harmless there — just 4px of top air that collapses away against
   '.dashboard-main''s own zero margin. */
.ruled-masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0 9px;
  margin-top: 4px;
  border-top: 2px solid var(--text);
  border-bottom: 1px solid var(--text);
  margin-bottom: 16px;
}

.ruled-masthead-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 25px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Title on one side, everything else on the other — the strip stays
   two-part however many actions ride in it. Without the group, a masthead
   with a page-level action spreads title | meta | button evenly across the
   page and the kicker stops reading as a kicker. */
.ruled-masthead-side {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
}

.ruled-masthead-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@container (max-width: 900px) {
  .ruled-field {
    grid-template-columns: repeat(2, 1fr);
  }

  .ruled-span-3 {
    grid-column: span 2;
  }

  /* Row spans are a four-column idea. At two columns a tall block leaves a
     hole beside itself that 'dense' cannot backfill — the only candidates
     left are full-width by then — and the hole shows as a slab of
     'var(--border)', which reads as a rendering fault rather than a
     layout. Caught by eye at 800px; there is no way to see it from the
     markup. */
  .ruled-rows-2 {
    grid-row: auto;
  }
}

@container (max-width: 620px) {
  .ruled-field {
    grid-template-columns: 1fr;
  }

  /* Rule 2: everything is full width down here, spans included. */
  .ruled-span-2,
  .ruled-span-3,
  .ruled-span-full {
    grid-column: 1 / -1;
  }

  .ruled-rows-2 {
    grid-row: auto;
  }
}

/* A caption strip, not a flood. It sits on '--bg' so the 1px gap still
   rules it off from the cells, and it is the one place the block's own
   words get to be a sentence rather than a label. */
.ruled-foot {
  background: var(--bg);
  color: var(--text);
  padding: 13px 20px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
}

/* Keyed off '.ruled-block''s own width, not the viewport's, so a block
   reads the same in a 640px shell and a 1280px one. */
@container (max-width: 620px) {
  .ruled-grid {
    grid-template-columns: 1fr;
  }

  .ruled-aside {
    display: none;
  }

  .ruled-cell-name {
    font-size: 19px;
  }
}

/* ---- Section heroes (backlog item (av), feedback 9dcff490) ----
   Each top-level section's root landing view — a catalog page for that
   section's destinations. See 'Main.Render.Hero'.

   Everything structural moved to the RULED INDEX PRIMITIVES section above
   on 2026-09-04; what is left here is the spine, the masthead variant, and
   the outer column track, none of which a non-hero index wants. Two rules
   that used to live in this comment moved up with the code they describe
   (hairlines are gaps; it wears the card's edges) — read them there before
   editing anything below. Two more still belong to this feature:

   1. THE ART IS THE TYPE. This replaced four 'background-image' data URIs
      whose hexes were hardcoded copies of ':root' (and so stayed
      light-coloured in dark mode). Every colour here is a token; keep it
      that way and both themes stay correct for free.
   2. WIDTH-INDEPENDENT, so it is written ONCE. The narrow regime is a
      container query on '.hero-catalog' itself, not the app's width
      classes — which is why maintenance rule 9's write-it-twice
      obligation, and the '.hero-columns' overrides it used to apply to,
      are gone from this feature entirely. */

.hero-catalog {
  grid-template-columns: 64px 1fr;
  margin-top: 24px;
}

/* The spine spans the cells and the band. In the masthead variant (spine +
   band, no cells — the Console's disconnected branch) there is only one
   row to span, and the explicit span would conjure an empty second one. */
/* 'color-mix' keeps the tint derived from the token rather than being a
   fourth hardcoded indigo — the whole reason the illustrations went. The
   plain '--bg' declaration above it is the fallback for a browser without
   'color-mix'; it degrades to a quiet grey spine, not to a broken one. */
.hero-spine {
  grid-row: 1 / span 2;
  background: var(--bg);
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
  color: var(--brand);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

/* The masthead turns the spine on its side. With no cells to stand beside,
   a vertical title sets the row height to the length of the word — which
   is how "Console" alone made a ~470px slab of flat ink above the connect
   form. Horizontal, it is a ~70px page header, which is all this variant
   was ever meant to be. */
.hero-catalog-masthead {
  grid-template-columns: auto 1fr;
}

.hero-catalog-masthead .hero-spine {
  grid-row: auto;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 20px;
}

.hero-catalog-masthead .hero-spine-kicker,
.hero-catalog-masthead .hero-spine-path,
.hero-catalog-masthead .hero-spine-title {
  writing-mode: horizontal-tb;
}

.hero-catalog-masthead .hero-spine-title {
  font-size: 26px;
}

.hero-catalog-masthead .ruled-foot {
  display: flex;
  align-items: center;
}

/* The kicker is redundant once the title is inline beside it, and the two
   micro-labels either side of a 34px word read as clutter. */
.hero-catalog-masthead .hero-spine-kicker {
  display: none;
}

.hero-spine-kicker,
.hero-spine-path {
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  opacity: 0.6;
}

.hero-spine-kicker {
  text-transform: uppercase;
  letter-spacing: 0.3em;
}

/* 'cqw' is why '.ruled-block' carries 'container-type': the spine tracks
   the hero's own width, not the viewport's, so it reads the same in a
   640px shell and a 1280px one. */
.hero-spine-title {
  writing-mode: vertical-rl;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.4cqw, 40px);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* A page title in the hero's spine (Tenants, projectz feature 96b33cec): the
   spine as the hero draws it, one row tall, with the page's meta line in
   the band beside it. Nothing here restates a spine value. */
/* One line high (projectz feature 4fd0206a): the spine is turned on its
   side the way the masthead variant turns it, so the row is as tall as
   the title's one line instead of the length of the word. Same tint, same
   display face. '.hero-catalog.hero-catalog-titled' outweighs the
   narrow-container '.hero-catalog' column rule below. */
.hero-catalog.hero-catalog-titled {
  grid-template-columns: auto 1fr;
}

.hero-catalog-titled .hero-spine {
  grid-row: auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 20px;
}

.hero-catalog-titled .hero-spine-title {
  writing-mode: horizontal-tb;
  font-size: 26px;
}

.hero-catalog-titled .ruled-foot {
  display: flex;
  align-items: center;
}

@container (max-width: 620px) {
  .hero-catalog {
    grid-template-columns: 52px 1fr;
  }
}

/* An opened help topic sits inside a '.ruled-panel' > '.tenant-row', so it
   is already two boxes deep. It used to be a third and fourth: a
   '.reveal-panel' (yellow, 16px padding, 20px margin) wrapping a bordered
   '.help-content'. Now the row is the only box: the text hangs under it on
   a single hairline rule, with no fill, border box or margin of its own. */
.help-topic-detail {
  margin: 6px 0 0;
}

.help-content {
  font-family: inherit;
  font-size: 13px;
  white-space: pre-wrap;
  background: transparent;
  border: 0;
  border-left: 2px solid var(--border);
  border-radius: 0;
  padding: 2px 0 2px 14px;
  margin: 0 0 10px 6px;
  max-height: 320px;
  overflow-y: auto;
}

/* A help topic written in tramaj (Main.Render.Console.render_help_topic_body):
   a document, not a pre-formatted block, so undo the pre-wrap above. */
.help-content.help-tramaj { white-space: normal; line-height: 1.5; }
.help-tramaj h2, .help-tramaj h3 { font-size: 14px; margin: 12px 0 4px; }
.help-tramaj h2:first-child, .help-tramaj h3:first-child { margin-top: 0; }
.help-tramaj p { margin: 0 0 8px; }
.help-tramaj ul, .help-tramaj ol { margin: 0 0 8px; padding-left: 20px; }
.help-content a.help-link { color: var(--brand); text-decoration: underline; cursor: pointer; }

.metadata-content {
  font-family: inherit;
  font-size: 13px;
  white-space: pre-wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 10px;
  max-height: 320px;
  overflow-y: auto;
  color: var(--text-muted);
}

.reveal-key {
  flex: 1;
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  white-space: nowrap;
}

.pill input[type="checkbox"] {
  margin: 0;
}

/* projectz feature edb87636: an Unspent widget's dimension choice, one pill
   per dimension, wrapping rather than widening the form. */
.wk-unspent-dimension-pills {
  flex-wrap: wrap;
  gap: 8px;
}

.scope-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.fade-in {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

.feedback-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-contrast);
  background: var(--brand);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.feedback-fab:hover {
  background: var(--brand-dark);
}

.feedback-drawer {
  position: fixed;
  right: 20px;
  bottom: 76px;
  z-index: 20;
  width: min(360px, calc(100vw - 40px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* A "soon" mark's "I'm interested" fills the description with a few lines
   (projectz feature e62d0650), and the browser's default two-row textarea
   hid the question it ends on. About seven lines show it whole; the drawer's own
   max-height still scrolls on a short screen. */
.feedback-drawer textarea.text-input {
  min-height: 9em;
  resize: vertical;
}

.feedback-extra-details {
  margin: 8px 0;
}

.feedback-extra-details summary {
  cursor: pointer;
}

.feedback-extra-content {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .feedback-drawer {
    right: 10px;
    left: 10px;
    bottom: 70px;
    width: auto;
  }
}

/* ==========================================================================
   WIDE UI MODE
   ==========================================================================

   Feedback item 8865c538. The layout below 1100px is unchanged from the
   phone-first design this app started as; above it the shell widens to
   1280px so the dense Admin tables (up to 8 columns) stop scrolling inside
   their .table-scroll wrappers.

   Activation is four-state, owned by ControlPlane.UiPrefs' 'UiWidth':

     Auto (default)  no class    — follows the media query below
     Narrow          .app-narrow — stays 640px at any width
     Wide            .app-wide   — 1280px cap, even under the breakpoint
     Full            .app-full   — no cap at all, fills the viewport

   The explicit classes beat the media query by source order, not by
   specificity hacks: '.app-shell:not(.app-narrow)' and '.app-shell.app-wide'
   have identical specificity (0,2,0), so the one written last wins. Keep
   the explicit rules *after* the media block or the overrides silently stop
   working. This is also why the media query's cap is written as plain
   ':not(.app-narrow)' and not ':not(.app-narrow):not(.app-full)' — the
   latter is (0,3,0) and would outrank '.app-full' from anywhere in the file.

   A separate "LEFT RAIL" section further down turns the nav into full-height
   left chrome. It is gated on the breakpoint only, never on .app-wide /
   .app-full — see rule 9.

   --------------------------------------------------------------------------
   MAINTENANCE RULES — read before changing layout anywhere in this file
   --------------------------------------------------------------------------

   1. Never put a width cap back on '#app'. The shell owns width now.
      '#app' is static markup in index.html and Halogen mounts into it, so a
      cap there sits on an ancestor of every rendered node and nothing the
      app renders can widen it from below.

   2. Any new full-width control needs a max-width or a grid cell. A bare
      'width: 100%' that looks right at 640px becomes a 1280px smear. This
      is the most likely way this design regresses.

   3. Prose caps at ~65ch, form fields at ~42ch — at every width, not just
      here. Readable line length is a property of the text, not the viewport.

   4. New table? Keep the 'div.table-scroll' wrapper. Wide mode reduces
      horizontal scrolling, it does not remove the need for it: 1280px is
      still finite, and the wrapper is what stops a wide table breaking the
      page at 640px.

   5. Test at three widths: 500 / 800 / 1400. 500 exercises the mobile
      block, 800 the unwidened default, 1400 this block. Looking right at
      one of them is not done.

   6. Login, join, device and bootstrap screens stay narrow — they are
      '.center-card', capped independently above. Give any new pre-auth
      screen that class.

   7. Prefer widening a component over raising the 1280px cap. If something
      feels cramped, give that component room.

   8. Top-level navigation is '.dashboard-nav'/'.nav-group'/'.nav-sublist';
      '.tab-bar'/'.sub-tab-bar' are now *panel-local* tab strips only (the
      tenant-details Monitors/Usage bar). Adding a top-level tab means adding
      a '.nav-group' in 'render_dashboard_nav'; adding tabs inside a panel
      means '.tab-bar'. Restyling '.tab-bar' here would drag that panel bar
      into the sidebar's vertical layout, which compiles and bundles clean
      and simply looks wrong.

   9. Know which of the two blocks a new rule belongs in.

      *Component* rules (grids, caps, max-heights) exist TWICE — once under
      '.app-shell:not(.app-narrow)' in the media query, once under
      ':is(.app-shell.app-wide, .app-shell.app-full)' after it. Not
      redundancy to clean up: the app cannot know the viewport width, so
      "Auto above 1100px" and "explicitly Wide/Full" are genuinely different
      selectors. Change one, change the other.

      *Rail* rules exist ONCE, in the LEFT RAIL media query, with no explicit
      copy. A 210px rail needs a viewport that can spare it, so below 1100px
      every mode keeps the stacked bars and Wide/Full only change the cap.
      Adding an explicit copy would put a rail on an 800px window and triple
      the duplication. Don't.

  10. The rail is 'position: fixed', so it costs the content column exactly
      'var(--rail-w)' of left margin on '.app-shell' and nothing else — no
      grid, no columns. Collapsing changes that one custom property and both
      the margin and the rail's width follow. If you find yourself hardcoding
      210px or 56px anywhere, use the property instead.

  11. Collapsed means icons only, and sub-tabs are hidden outright. Any new
      top-level tab therefore needs an icon mask in the LEFT RAIL section and
      a 'title' on its button, or it becomes an unlabelled blank square that
      no tooltip explains.
   ========================================================================== */

@media (min-width: 1100px) {
  .app-shell:not(.app-narrow) {
    max-width: 1280px;
  }

  /* Single '1fr' column at any width otherwise — the cheapest visible win
     in this file. */
  .app-shell:not(.app-narrow) .plan-options-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
  }

  /* Endpoints were ellipsised at 220px on screens with room to spare. */
  .app-shell:not(.app-narrow) .saved-key-endpoint {
    max-width: 420px;
  }

  .app-shell:not(.app-narrow) .kv-key {
    min-width: 180px;
  }

  /* Vertical caps sized for a 640px column; the extra width means fewer
     wrapped lines, so more of these fit before scrolling. */
  .app-shell:not(.app-narrow) .bucket-events-scroll,
  .app-shell:not(.app-narrow) .help-content,
  .app-shell:not(.app-narrow) .metadata-content,
  .app-shell:not(.app-narrow) .root-picker-scroll {
    max-height: 520px;
  }

  /* Widget cards stack one-per-row by default; at width they pair up. */
  /* 'stretch': cards in a row share a height (projectz c6fdd777), where
     'start' left a blank block under the shorter one. */
  .app-shell:not(.app-narrow) .widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 16px;
    align-items: stretch;
  }

  /* Projectz feature d224900d: with every widget on a cell, the grid is the
     12-column one (see the WIDGET GRID section). Duplicated under the
     explicit modes per rule 9. */
  .app-shell:not(.app-narrow) .widget-grid.widget-grid-cells {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: var(--widget-row);
  }

  /* Feedback 7126ec6f. Equal halves: neither panel in these pairs is
     subordinate to the other (Getting started / Docs; Connect / Known
     instances). 'auto-fit' rather than a hard '1fr 1fr' so the row
     collapses to a single full-width column when only one child renders —
     which is exactly the first-run Console, where no saved keys exist and
     'render_console_known_instances' emits nothing. */
  .app-shell:not(.app-narrow) .side-by-side-columns,
  .app-shell:not(.app-narrow) .console-connect-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    align-items: start;
  }

  /* Unequal on purpose: the tenant list is a column of short rows, while
     the details panel holds a monitors dashboard and wants the room.
     Fixed tracks rather than 'auto-fit' precisely because the two columns
     are *not* interchangeable — and the "no details open" case is handled
     by the ':only-child' rule below rather than by track sizing, since
     'render_tenant_details_column' renders nothing at all when nothing is
     open.

     Backlog item (ay) added '.instances-columns' to the same rules rather
     than writing a third near-identical pair: Admin > Backends has the same
     shape (a list of short multi-line rows, and a detail panel that holds a
     diagnostics table) and wants the same ratio. */
  .app-shell:not(.app-narrow) .tenants-columns,
  .app-shell:not(.app-narrow) .instances-columns,
  .app-shell:not(.app-narrow) .monitors-columns,
  .app-shell:not(.app-narrow) .notifications-columns {
    display: grid;
    grid-template-columns: minmax(320px, 2fr) 3fr;
    gap: 16px;
    align-items: start;
  }

  /* ...but with one child that grid would leave a dead half-width gutter,
     so a lone list spans the whole row.

     '.ruled-block' is listed alongside '.card' because Tenants ▸ Your
     tenants' list half is a ruled block while its details half is still a
     card — the details panel draws ECharts canvases and cannot go in a
     field (see the MODULAR RULED FIELD block and specs/visual-identity.md
     §8). Without the extra selector the ':only-child' rule silently stops
     firing when the list is alone, and the list renders at two fifths of
     the page with an empty gutter beside it. */
  .app-shell:not(.app-narrow) .tenants-columns > .ruled-block:only-child,
  .app-shell:not(.app-narrow) .notifications-columns > .ruled-block:only-child,
  .app-shell:not(.app-narrow) .monitors-columns > .ruled-block:only-child,
  .app-shell:not(.app-narrow) .tenants-columns > .card:only-child,
  .app-shell:not(.app-narrow) .instances-columns > .card:only-child,
  .app-shell:not(.app-narrow) .monitors-columns > .card:only-child {
    grid-column: 1 / -1;
  }

  /* In these two the grid's own gap is the only spacing between the
     columns, so neither child brings a top margin of its own — the pair
     has to start on the same line or it doesn't read as a pair.

     These three, and only once they are a grid. They are the ones whose
     left half is a '.ruled-block', which owns no outer spacing, so the
     container's distance from what precedes it comes from the masthead
     above it (or from the '.ruled-block + .tenants-columns' rules near the
     top of the MODULAR RULED FIELD block) rather than from a child's
     margin. '.instances-columns' is still card-and-card — Admin is not
     converted — and there that child margin *is* what spaces the whole
     grid, so zeroing it would butt the grid against the panel above.
     Below the breakpoint every one of them is a plain block and the child
     margins are what stacks them, which is why this is inside the query.

     Both defects this fixes were the same 24px: '.card''s 'margin-top'
     dropped Tenants' details column a step below the list beside it, and
     '.ruled-block + .ruled-block' did the same to the notification wizard
     once it became a block. */
  .app-shell:not(.app-narrow) .tenants-columns > *,
  .app-shell:not(.app-narrow) .monitors-columns > *,
  .app-shell:not(.app-narrow) .notifications-columns > * {
    margin-top: 0;
  }

  /* The other half of rule 4c. Zeroing the margins put the two boxes on
     the same top line; this puts their *headings* on the same line too.
     A '.card' pads 28px and its first '.section-title' adds a 16px top
     margin, so its heading lands 45px down and 29px in, against a panel
     head's 27px and 19px — near enough to look like a mistake rather than
     a difference. Borrowing '.ruled-panel''s padding and head margin makes
     the pair read as one object.

     Scoped to a card that is actually *in* one of these grids: stacked
     below the breakpoint there is no neighbour to line up with, and a
     monitors dashboard is entitled to its own padding there. Only the two
     grids whose other half is a block — '.instances-columns' is still
     card-and-card. */
  .app-shell:not(.app-narrow) .tenants-columns > .card,
  .app-shell:not(.app-narrow) .monitors-columns > .card {
    padding: 16px 18px 18px;
  }

  .app-shell:not(.app-narrow) .tenants-columns > .card > .section-title-row:first-child > .section-title,
  .app-shell:not(.app-narrow) .monitors-columns > .card > .section-title-row:first-child > .section-title {
    margin: 10px 0;
  }

  /* Measured after: Tenants' details column lands exactly on the block's
     27px/19px. Monitors' dashboard head is 3px low, because
     '.section-title-row' centres its children and that one carries two
     '.btn-sm' controls -- a 27px box beside an 11px label centres low,
     which is rule 4a again in a box that is not a panel.
     'align-items: baseline' was tried and is *worse* (32px): a padded
     button needs more room above its baseline than the label does, so the
     label moves down rather than the button up. Closing the 3px for real
     means those controls stop being '.btn's, which is a change to a card
     this pass deliberately left as a card. 3px is where it stops. */

  /* (bg), feedback ec25eaef: the Buckets tab's action panel (Replenish,
     Reclaim, Delete, ...), as a column beside the list rather than stacked
     below it. Equal halves, unlike '.tenants-columns' — the report asked
     for 50/50 specifically, and neither the tree nor a bucket-scoped form
     is the clearly-larger content the way a monitors dashboard is next to
     a short tenant row. */
  .app-shell:not(.app-narrow) .buckets-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }

  /* Grid items default to 'min-width: auto', which ignores a descendant's
     own 'overflow-x: auto' (e.g. '.bucket-events-scroll') and sizes the
     track to its min-content instead — a long unwrapped activity-log JSON
     line then blows the track (and the page) out sideways rather than
     scrolling inside its own box. 'min-width: 0' lets the track shrink to
     the 1fr split and pushes the overflow back down into the descendant
     that already declared it. */
  .app-shell:not(.app-narrow) .buckets-columns > * {
    min-width: 0;
  }

  .app-shell:not(.app-narrow) .buckets-columns > :only-child {
    grid-column: 1 / -1;
  }

  /* Rule 4c, as on the two grids above: both halves of this one are ruled
     blocks (nothing here draws a chart), so neither brings a top margin
     and the pair starts on the same line. Written for every child rather
     than for '.card' because there is no card left in this grid — and the
     ':only-child' rule above became child-agnostic for the same reason. */
  .app-shell:not(.app-narrow) .buckets-columns > * {
    margin-top: 0;
  }

  /* (ay): the two Admin > Feedbacks charts, side by side.

     Its own class rather than '.side-by-side-columns' because that one's
     360px minimum is narrower than a card holding a 360px canvas, so the
     chart would overflow between 1100px and ~1360px — most of the range
     this layout is for. ECharts sizes its canvas once at first paint and
     this app's wrapper never calls 'resize', so an overflowing chart cannot
     recover by itself. Reduced padding buys the extra pixels.

     'min(400px, 100%)' rather than a bare 400px: the explicit Wide/Full
     modes apply at *any* viewport, 500px included, where a hard 400px
     minimum track would overflow the page. */
  .app-shell:not(.app-narrow) .chart-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    gap: 16px;
    align-items: start;
  }

  .app-shell:not(.app-narrow) .chart-columns > .card {
    padding: 16px;
  }

  .app-shell:not(.app-narrow) .chart-columns > .card:only-child {
    grid-column: 1 / -1;
  }

}

/* Explicit "wide"/"full" — must stay after the media block, see the note
   above. Only the caps differ between them; every component rule below is
   shared, which is why the selector is an :is() list. */
.app-shell.app-wide {
  max-width: 1280px;
}

.app-shell.app-full {
  max-width: none;
}

:is(.app-shell.app-wide, .app-shell.app-full) .plan-options-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
}

:is(.app-shell.app-wide, .app-shell.app-full) .saved-key-endpoint {
  max-width: 420px;
}

:is(.app-shell.app-wide, .app-shell.app-full) .kv-key {
  min-width: 180px;
}

:is(.app-shell.app-wide, .app-shell.app-full) .bucket-events-scroll,
:is(.app-shell.app-wide, .app-shell.app-full) .help-content,
:is(.app-shell.app-wide, .app-shell.app-full) .metadata-content,
:is(.app-shell.app-wide, .app-shell.app-full) .root-picker-scroll {
  max-height: 520px;
}

:is(.app-shell.app-wide, .app-shell.app-full) .widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
  align-items: stretch;
}

:is(.app-shell.app-wide, .app-shell.app-full) .widget-grid.widget-grid-cells {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: var(--widget-row);
}

/* Explicit-mode copies of the three feedback-7126ec6f pair layouts above.
   See maintenance rule 9 — these are not redundant with the media query. */
:is(.app-shell.app-wide, .app-shell.app-full) .side-by-side-columns,
:is(.app-shell.app-wide, .app-shell.app-full) .console-connect-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  align-items: start;
}

:is(.app-shell.app-wide, .app-shell.app-full) .tenants-columns,
:is(.app-shell.app-wide, .app-shell.app-full) .instances-columns,
:is(.app-shell.app-wide, .app-shell.app-full) .monitors-columns,
:is(.app-shell.app-wide, .app-shell.app-full) .notifications-columns {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) 3fr;
  gap: 16px;
  align-items: start;
}

/* Rule 9's copy of the ':only-child' rule above, '.ruled-block' included
   for the same reason. Omitting it here is invisible in Auto mode and
   shows up only for someone who has chosen Wide or Full. */
:is(.app-shell.app-wide, .app-shell.app-full) .tenants-columns > .ruled-block:only-child,
:is(.app-shell.app-wide, .app-shell.app-full) .notifications-columns > .ruled-block:only-child,
:is(.app-shell.app-wide, .app-shell.app-full) .monitors-columns > .ruled-block:only-child,
:is(.app-shell.app-wide, .app-shell.app-full) .tenants-columns > .card:only-child,
:is(.app-shell.app-wide, .app-shell.app-full) .instances-columns > .card:only-child,
:is(.app-shell.app-wide, .app-shell.app-full) .monitors-columns > .card:only-child {
  grid-column: 1 / -1;
}

/* Rule 9's copy of the no-top-margin rule above; see it for which
   containers get this and which deliberately do not. */
:is(.app-shell.app-wide, .app-shell.app-full) .tenants-columns > *,
:is(.app-shell.app-wide, .app-shell.app-full) .monitors-columns > *,
:is(.app-shell.app-wide, .app-shell.app-full) .notifications-columns > * {
  margin-top: 0;
}

/* Rule 9's copy of the paired-card head metrics above. */
:is(.app-shell.app-wide, .app-shell.app-full) .tenants-columns > .card,
:is(.app-shell.app-wide, .app-shell.app-full) .monitors-columns > .card {
  padding: 16px 18px 18px;
}

:is(.app-shell.app-wide, .app-shell.app-full) .tenants-columns > .card > .section-title-row:first-child > .section-title,
:is(.app-shell.app-wide, .app-shell.app-full) .monitors-columns > .card > .section-title-row:first-child > .section-title {
  margin: 10px 0;
}

/* Rule 9: the explicit-mode copy of '.buckets-columns' above. */
:is(.app-shell.app-wide, .app-shell.app-full) .buckets-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* See the media-query copy above for why this is needed. */
:is(.app-shell.app-wide, .app-shell.app-full) .buckets-columns > * {
  min-width: 0;
}

:is(.app-shell.app-wide, .app-shell.app-full) .buckets-columns > :only-child {
  grid-column: 1 / -1;
}

/* Rule 9's copy of the no-top-margin rule above. */
:is(.app-shell.app-wide, .app-shell.app-full) .buckets-columns > * {
  margin-top: 0;
}

/* Rule 9: the explicit-mode copy of '.chart-columns' above. */
:is(.app-shell.app-wide, .app-shell.app-full) .chart-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: 16px;
  align-items: start;
}

:is(.app-shell.app-wide, .app-shell.app-full) .chart-columns > .card {
  padding: 16px;
}

:is(.app-shell.app-wide, .app-shell.app-full) .chart-columns > .card:only-child {
  grid-column: 1 / -1;
}

/* Sticky, height-capped side panels (the tenant-details column that used to
   be first in this list is gone: usage expands in the tenant's row). */
:is(.app-shell.app-wide, .app-shell.app-full) .instance-details-column,
.app-shell:not(.app-narrow) .instance-details-column,
:is(.app-shell.app-wide, .app-shell.app-full) .bucket-action-panel,
.app-shell:not(.app-narrow) .bucket-action-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

/* Feedback 7126ec6f: the monitor dashboard, detached from the list row
   that opens it. Feedback b087a783 moved it from a sibling stacked below
   the list into its own column beside it (see '.monitors-columns' above),
   so the "indented, tinted ground" framing that made sense stacked under
   the list no longer applies at that breakpoint — kept only as the
   narrow/stacked fallback. */
.monitor-dashboard-panel {
  background: var(--bg);
  margin-top: 12px;
}

/* Feedback 7126ec6f: "Disconnect" as a pill beside "Log out". Reuses
   '.pill''s shape but has to undo the <button> defaults '.pill' never
   anticipated (it is a <span> everywhere else), and reads as the mildly
   destructive action it is on hover. */
.disconnect-pill {
  appearance: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.disconnect-pill .ui-icon {
  /* '.pill' already spaces its children with a gap. */
  margin-right: 0;
}

.disconnect-pill:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* The header's right-hand cluster. Was a bare div relying on inline-block
   children; adding the Disconnect pill made it wrap raggedly at narrow
   widths, where the brand still occupies the left half. */
.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Feedback 7126ec6f — side-by-side panel pairs.

   Three classes, one idea: panels that are *alternatives* or that are read
   together were stacked as if the shell were still 640px wide. Each is a
   plain block below the breakpoint (i.e. unchanged stacking) and becomes
   columns only where there's room, so nothing regresses on a phone.

   Per maintenance rule 9 these are component rules, so each appears TWICE
   — once in the media query above for "Auto on a wide screen", once under
   :is(.app-wide, .app-full) below for the explicit settings. Change one,
   change the other.

   The gap matches '.card''s own bottom margin so a two-column row doesn't
   read as more tightly packed than the stack it replaced. Every one of
   them uses 'align-items: start' so a short panel doesn't stretch to match
   a tall neighbour.
   -------------------------------------------------------------------------- */
.side-by-side-columns,
.console-connect-columns,
.tenants-columns,
.instances-columns,
.chart-columns {
  display: block;
}

/* Backlog item (ay): the app's first clickable table row. '.tenant-row-clickable'
   is <li>-only styling — its hover paints a border, and a <tr>'s borders live
   on the <td>s, so it would do nothing here. Paint the cells instead. */
.instance-row {
  cursor: pointer;
}

.instance-row:hover td {
  background: var(--bg);
}

.instance-row-selected td {
  background: var(--bg);
  box-shadow: inset 2px 0 0 var(--brand);
}

/* The segmented flipper shape — the documented convention for a pick-one
   button strip, deliberately shared by three controls: shell width and
   light/dark (both on Account > Settings' Appearance card since feedback
   338a4a02) and the Console's bucket-recency window picker. Reuses .pill's
   shape; the active segment reads as selected rather than clickable.

   Nothing here may assume a particular container: these rules carried a
   '.topbar'-scoped media query until 338a4a02 moved the last chrome copy
   out, and .width-toggle now appears only inside cards and panels. */
.width-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
}

.width-toggle-btn {
  appearance: none;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.width-toggle-btn:hover {
  color: var(--text);
}

.width-toggle-btn.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow);
}

/* Feedback 338a4a02: the Appearance card carries two flippers now. Without
   this the shell-width hint sits 4px under the theme flipper (.hint-text's
   own top margin) and the two rows read as one control with a stray caption
   in the middle. */
.appearance-width-hint {
  margin-top: 16px;
}

/* Feedback de624b83: iOS Safari's own compact top bar sits over the page's
   top edge on narrow screens, pushing '.topbar' (and the disconnect pill
   inside it) up under the browser chrome instead of below it. '.app-shell'
   isn't fixed/full-bleed, so this isn't a safe-area-inset case — just extra
   breathing room so the topbar clears the browser's own UI. */
@media (max-width: 520px) {
  .app-shell {
    padding-top: 64px;
  }
}

/* ==========================================================================
   LEFT RAIL (wide layouts only)
   ==========================================================================

   The nested sidebar, pinned to the viewport's left edge as full-height app
   chrome: brand at the top, the two-level nav in the middle, width toggle and
   collapse control at the bottom.

   Unlike the component rules above, this block is written ONCE and gated only
   on the media query — there is no '.app-wide'/'.app-full' copy. That is
   deliberate: a 210px rail needs a viewport wide enough to spare it, and
   below 1100px it would eat a fifth of the screen. So under the breakpoint
   every mode keeps the stacked bars and Wide/Full only change the cap. This
   is what keeps maintenance rule 9's duplication from tripling.

   The rail is 'position: fixed' and therefore out of flow, which is why
   '.dashboard' needs no grid: '.app-shell' simply gets a left margin of
   'var(--rail-w)' and the content flows normally beside it. Collapsing is
   one custom-property change — '--rail-w' is read by both the margin and the
   rail's own width, so they can never disagree. */
@media (min-width: 1100px) {
  .app-shell:not(.app-narrow) {
    --rail-w: 210px;
    margin-left: var(--rail-w);
    margin-right: auto;
  }

  .app-shell:not(.app-narrow).nav-is-collapsed {
    --rail-w: 56px;
  }

  .app-shell:not(.app-narrow) .dashboard-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--rail-w);
    z-index: 10;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    margin: 0;
    padding: 16px 10px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    border-bottom: none;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* (cv): overflow clipping follows DOM/paint containment, not the
     containing-block chain — '.nav-flyout' being 'position: absolute'
     relative to '.nav-flyout-anchor' does not let it escape THIS box's
     'overflow-x: hidden' just because it's positioned. Lifted only while a
     flyout is actually open (see 'Main.Render.render_dashboard_nav'), so
     the rail's own vertical scroll behavior is untouched the rest of the
     time. */
  .app-shell:not(.app-narrow) .dashboard-nav.nav-flyout-active {
    overflow: visible;
  }

  /* The ':has()' rule in the narrow block sets a negative bottom margin. */
  .app-shell:not(.app-narrow) .dashboard-nav:has(.nav-sublist) {
    margin-bottom: 0;
  }

  /* The rail's wordmark, and the one most people actually see — the
     topbar's '.brand-mark' copy is hidden in this regime (see the rule
     further down). Both are set in '--display' so the two regimes agree;
     condensed runs narrow, hence 21px against the 17px sans it replaced. */
  .app-shell:not(.app-narrow) .nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 18px;
    font-family: var(--display);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
  }

  /* Takes the slack so the footer sits at the bottom, and scrolls on its own
     if a tab's sub-list makes the list taller than the window. */
  .app-shell:not(.app-narrow) .nav-items {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  /* (cv): '.nav-items' is its own clipping ancestor, separate from
     '.dashboard-nav' above — both need their overflow lifted while a
     flyout is open, or this one alone still hard-clips it. */
  .app-shell:not(.app-narrow) .dashboard-nav.nav-flyout-active .nav-items {
    overflow: visible;
  }

  .app-shell:not(.app-narrow) .nav-group {
    display: block;
  }

  .app-shell:not(.app-narrow) .nav-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .app-shell:not(.app-narrow) .dashboard-nav .nav-icon {
    display: block;
    flex: none;
    width: 18px;
    height: 18px;
    background-color: currentColor;
  }

  .app-shell:not(.app-narrow) .dashboard-nav .tab-button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    text-align: left;
    white-space: nowrap;
    margin-bottom: 0;
    border-bottom: none;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
  }

  .app-shell:not(.app-narrow) .dashboard-nav .tab-button.active {
    border-left-color: var(--brand);
    background: var(--bg);
  }

  .app-shell:not(.app-narrow) .nav-sublist {
    display: block;
    padding-top: 2px;
    padding-bottom: 8px;
    border-top: none;
    /* Indents the sub-list as a block, not just its labels, so an active
       sub-item's left border sits inboard of its parent's instead of on the
       same x — which reads as a sibling rather than a child. */
    margin-left: 14px;
  }

  /* Lighter than their parents so the two levels read as a hierarchy rather
     than as eight equal entries. */
  .app-shell:not(.app-narrow) .nav-sublist .tab-button {
    padding-left: 12px;
    font-weight: 500;
    font-size: 13px;
  }

  /* Feedback 6b35fa67: the rail already lists every sub-tab, always, in a
     vertical column with no clipping — the narrow layout's clip-and-"More"
     treatment (see the "narrow-layout sub-tab overflow" block above) has
     nothing to do here, so unwind both its pieces. The extra
     '.app-shell:not(.app-narrow)' class over each narrow-block counterpart
     wins on specificity regardless of source order. */
  .app-shell:not(.app-narrow) .nav-sublist-list {
    display: contents;
  }

  .app-shell:not(.app-narrow) .nav-sublist-more {
    display: none;
  }

  /* The topbar's copy of the brand — the rail owns it here. See the note
     on '.nav-brand' in the narrow block. */
  .app-shell:not(.app-narrow) .topbar .brand {
    display: none;
  }

  /* With the brand gone, 'space-between' would strand the account pills on
     the left. */
  .app-shell:not(.app-narrow) .topbar {
    justify-content: flex-end;
  }

  /* No rail drawn (signed out, device approval, join, setup, loading):
     there is nothing to make room for, so the shell is centred like the
     narrow layout and the topbar keeps its wordmark, which otherwise lives
     only in the rail. Detected from the DOM ('.dashboard-nav' absent) so
     that it follows whichever page renders, with no list of pages here.
     The extra ':not(:has())' outranks the rail rules above regardless of
     source order. Feedback e383aa0e. */
  .app-shell:not(.app-narrow):not(:has(.dashboard-nav)) {
    margin-left: auto;
    margin-right: auto;
  }

  .app-shell:not(.app-narrow):not(:has(.dashboard-nav)) .topbar .brand {
    display: flex;
  }

  .app-shell:not(.app-narrow):not(:has(.dashboard-nav)) .topbar {
    justify-content: space-between;
  }

  .app-shell:not(.app-narrow) .nav-collapse-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    appearance: none;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
  }

  .app-shell:not(.app-narrow) .nav-collapse-btn:hover {
    color: var(--text);
    background: var(--bg);
  }

  .app-shell:not(.app-narrow) .nav-collapse-chevron {
    flex: none;
    width: 16px;
    height: 16px;
    background-color: currentColor;
  }

  /* --- Collapsed: icons only ---------------------------------------------
     Sub-tabs are hidden rather than abbreviated — there is no honest way to
     render "Control plane" in 36px. Clicking a top-level icon still switches
     tab and keeps whichever sub-tab was last active; reaching a *different*
     sub-tab means expanding first. Same trade-off as an editor's activity
     bar, and the reason every icon carries a 'title'. */
  .app-shell:not(.app-narrow).nav-is-collapsed .nav-label,
  .app-shell:not(.app-narrow).nav-is-collapsed .nav-sublist {
    display: none;
  }

  .app-shell:not(.app-narrow).nav-is-collapsed .dashboard-nav .tab-button,
  .app-shell:not(.app-narrow).nav-is-collapsed .nav-collapse-btn,
  .app-shell:not(.app-narrow).nav-is-collapsed .nav-brand {
    justify-content: center;
    padding-left: 4px;
    padding-right: 4px;
    gap: 0;
  }

  .app-shell:not(.app-narrow).nav-is-collapsed .nav-collapse-chevron {
    transform: rotate(180deg);
  }

  /* --- (cv), feedback 76744470: collapsed-rail sub-tab flyout -----------
     A transient popover off a collapsed icon, not a permanent
     '.nav-sublist' (that's what rule 11 above rules out — see this
     section's own header comment). '.nav-flyout-trigger' only exists
     visually here, under 'nav-is-collapsed': it's present in the DOM at
     every width so the click handler behind it is never conditional on
     viewport (a stale persisted 'navCollapsed' can't break narrow-layout
     navigation), but stays 'display: none' until this rule turns it on. */
  .app-shell:not(.app-narrow) .nav-flyout-anchor {
    display: block;
    position: relative;
  }

  .app-shell:not(.app-narrow).nav-is-collapsed .nav-flyout-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
  }

  .nav-flyout-trigger:hover {
    color: var(--text);
    border-color: var(--text);
  }

  .nav-flyout {
    position: absolute;
    left: 100%;
    top: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    min-width: 180px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px;
    margin-left: 6px;
  }

  .nav-flyout-item {
    border: none;
    background: none;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: inherit;
  }

  .nav-flyout-item:hover {
    background: var(--border);
  }
}

/* Icon glyphs. Masks rather than background-images so each one inherits its
   button's 'color' and follows the muted/active states with no second copy.
   Same inline-data-URI approach as '.select-input's chevron — no icon
   dependency, and Halogen can't emit namespaced SVG without one. */
.nav-icon-account {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.nav-icon-tenants {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 2 7l10 5 10-5-10-5Z'/%3E%3Cpath d='m2 17 10 5 10-5'/%3E%3Cpath d='m2 12 10 5 10-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 2 7l10 5 10-5-10-5Z'/%3E%3Cpath d='m2 17 10 5 10-5'/%3E%3Cpath d='m2 12 10 5 10-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.nav-icon-console {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 17 6-6-6-6'/%3E%3Cpath d='M12 19h8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 17 6-6-6-6'/%3E%3Cpath d='M12 19h8'/%3E%3C/svg%3E") center / contain no-repeat;
}

.nav-icon-admin {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.nav-collapse-chevron {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ==========================================================================
   WALL MODE — backlog (eb), feedback 3245bd2a

   A monitor dashboard on a display nobody sits at. 'Main.Render.render'
   branches above the header when 'consoleWallMode' is set and emits
   '.app-shell.app-wall' with only the theme class kept — no width class, no
   nav-collapsed class, and no '.dashboard-nav' in the DOM at all.

   '.app-shell' is kept rather than replaced because it is what carries
   '.app-theme-dark' / '.app-theme-light' (see the THEME block near the top).
   A bare wrapper would have lost dark mode on the screen most likely to be
   in a dim room. The cost of keeping it is that three of its rules now have
   to be undone here: the 640px cap, the 48/20/80 padding, and — above the
   breakpoint — the rail's left margin.

   The margin override is written as an explicit copy inside the same media
   query as the rule it beats, which maintenance rule 9 otherwise tells you
   not to do for rail rules. It is deliberate and it is not a rail rule:
   '.app-shell.app-wall' and '.app-shell:not(.app-narrow)' have identical
   specificity (two classes each — ':not()' counts its argument), so this
   only wins on source order. Writing it inside the matching query says that
   out loud instead of leaving a later reader to discover it by moving the
   block and breaking the layout.
   ========================================================================== */

.app-shell.app-wall {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

@media (min-width: 1100px) {
  .app-shell.app-wall {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
}

.wall {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sticky rather than fixed: the bar has to stay reachable on a monitor whose
   widgets are taller than the viewport, but a fixed bar would need the body
   padded to compensate and that padding would be wrong at every other
   height. */
.wall-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.wall-bar-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

/* The display face, at the one size in the app meant to be read from across
   a room. See the type-roles note in ':root' — this picks the role rather
   than restating a stack. */
.wall-monitor-name {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wall-position {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Wraps: the controls say what they do in words now, and on a narrow window
   they are wider than the bar. 'min-width: 0' lets the group shrink to the
   bar so that it wraps inside it and does not push the page sideways. */
.wall-bar-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.wall-rotate-select {
  font-size: 0.85rem;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.wall-body {
  flex: 1;
  padding: 20px;
  min-width: 0;
}

/* The wall's grid takes the display's whole width (projectz c6fdd777): as
   many columns of at least 440px as fit, sharing what is left over, with no
   cap. This is a screen on a wall, and a wider screen is there to show more
   or to show it larger.

   It used to be fixed tracks of 440 to 480px, centred, with wide margins
   either side. The reason was a hard constraint at the time: an ECharts
   canvas did not follow its container, so a stretched card kept a chart
   drawn at its old width with a blank block beside it. That constraint is
   gone: 'ControlPlane.ChartResize' redraws a chart when its box changes
   size, and the treemap and the flow chart are as wide as their card.

   'auto-fit', not 'auto-fill': with fewer widgets than columns the empty
   tracks collapse and the widgets share the row. Cards in a row share a
   height ('stretch'), so a short table beside a tall treemap is one row of
   two equal cards and not a card with a blank block under it.

   The selector has to out-specify '.app-shell:not(.app-narrow) .widget-grid'
   in the LEFT RAIL media query (three classes), which the wall element
   otherwise matches — it carries no '.app-narrow'. Hence the '.app-wall'
   ancestor here rather than a bare '.wall-body'. */
.app-shell.app-wall .wall-body .widget-grid {
  display: grid;
  /* 'min(100%, 440px)' rather than a bare 440px: the Console's own
     '.widget-grid' is only a grid above the breakpoint and stacks as block
     flow below it, so this rule — which applies at every width — is the one
     that has to survive a narrow window. Without the clamp a 440px minimum
     track in a 380px container overflows the page sideways. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 16px;
  align-items: stretch;
}

/* In a grid the gap spaces the cards; the stacking margin of
   '.widget-grid > .card' would push every card 12px down inside its cell. */
.app-shell.app-wall .wall-body .widget-grid > .card {
  margin-top: 0;
}

/* Projectz feature d224900d: the wall draws the stored cells on the same
   12-column grid as the Console, at every width above the phone's; the
   display is wide, so the row stays the Console's. */
@media (min-width: 641px) {
  .app-shell.app-wall .wall-body .widget-grid.widget-grid-cells {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: var(--widget-row);
  }
}

/* Whether the figures are being read again, in words, beside the button
   that changes it. */
.wall-refresh-state {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.wall-refresh-state.paused {
  color: var(--warn-text);
  font-weight: 600;
}

/* Wall mode had no narrow-width easing at all — feedback 66fc076a. The bar
   and body padding were fixed at every viewport, on top of the widget-box
   padding fix above, which compounds badly on a phone/tablet wall. */
@media (max-width: 520px) {
  .wall-bar {
    padding: 8px 12px;
    gap: 8px;
  }

  .wall-body {
    padding: 10px;
  }

  .app-shell.app-wall .wall-body .widget-grid {
    gap: 8px;
  }
}

/* Claims UI: the expanded row on the Console's Claims sub-tab. Three rules,
   all of them about an inline detail *inside* a '.tenant-row', which is why
   they hang off the row rather than being a panel of their own: a claim's
   targets are only interesting next to the claim, and a separate panel
   would put a scroll between the two.

   No width of its own — it fills the row, which the panel already caps. See
   the "WIDE UI MODE" section: a new full-width control needs a max-width or
   a grid cell, and inheriting the row's is how this one gets there. */
/* A claim row's status line and its "why it waits" sentence wrap instead
   of ending in an ellipsis (walkthrough 13: cut at 1400px as well as at
   500px). Both classes, to win over '.tenant-sub''s nowrap; the status line
   keeps its monospace, the sentence is prose ('.tenant-sub-prose'). */
.tenant-sub.claim-line {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* The Claims queue widget borrows '.shortfall-table''s fixed layout, which
   left its "#" column (a place, two or three digits) whatever the fixed
   columns did not take: some 40% of a narrow cell. A width of its own. */
.claims-queue-table th:first-child {
  width: 3.5em;
}

.claim-detail {
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* The monospace micro-label the rest of the app uses for this job (see
   '.section-title' in the type-roles note), not a third heading vocabulary. */
.claim-detail-head {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 10px 0 4px;
}

.claim-target-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Console ▸ Shortfalls ('Main.Render.Shortfalls'): one ranked table per
   dimension inside a full-span '.ruled-panel', on '.bucket-detail-table' in
   a '.bucket-events-scroll' so a narrow shell scrolls the table sideways
   rather than the page.

   Nothing here differs between the layout regimes, so there is no
   '.app-wide' / '.app-full' copy (WIDE UI MODE rule 9). Every colour is a
   token; the bar is '--brand', which both themes define. */

/* A dimension's sub-head: its name in the mono micro-label, its total
   beside it. Wraps, so a long dimension name pushes the total to its own
   line instead of off the panel. */
.shortfall-dimension {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 10px 0 0;
}

.shortfall-dimension-name {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.shortfall-dimension-total {
  font-size: 12px;
  color: var(--text-muted);
}

/* The base table sets 'margin: 8px 0'; the panel is a flex column with its
   own gap, so only the bottom is kept, to part one dimension from the
   next. */
/* Fixed layout with stated column widths, so the figures of two
   dimensions' tables sit under each other: with the automatic layout each
   table sized its columns to its own content and no two lined up. The
   'min-width' is what the four fixed columns plus a readable bucket
   column need; below it '.bucket-events-scroll' scrolls the table. */
.shortfall-table {
  margin: 0 0 6px;
  table-layout: fixed;
  min-width: 900px;
}

.shortfall-table td {
  vertical-align: middle;
}

/* The bucket column takes what is left, and wraps: a title, a uuid, a
   button and a status do not fit one line in a narrow shell, and in a
   fixed layout a cell that cannot wrap paints over its neighbour. Beats
   '.bucket-events-scroll .bucket-detail-table td' on specificity. */
.bucket-events-scroll .shortfall-table td:first-child {
  white-space: normal;
}

/* The id stays whole: a uuid broken over three lines cannot be read or
   selected, and the 'min-width' above leaves the column room for one. */
.shortfall-table td:first-child .ruled-kv-value-mono {
  white-space: nowrap;
}

.shortfall-table th:nth-child(2) { width: 130px; }
.shortfall-table th:nth-child(4) { width: 150px; }
.shortfall-table th:nth-child(5) { width: 210px; }

/* Figures line up on their right edge and on equal-width digits, which is
   what makes a ranked column readable as a column. Both selectors are
   needed: '.bucket-detail-table th, td' sets 'text-align: left' at the
   same specificity further up the file. */
.shortfall-table th.shortfall-num,
.shortfall-table td.shortfall-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Headers wrap: in a fixed layout a 'nowrap' header wider than its column
   is clipped by the next cell ("no key, all time (upper bound)" lost its
   tail at 210px). The words break at spaces, so the column keeps its width
   and the page does not grow. The dimension rides in the "shortfall" header
   on its own line, so the figures below are never read without their unit
   even when the sub-head above has scrolled out of view. */
.shortfall-table th.shortfall-num {
  white-space: normal;
  vertical-align: bottom;
}

.shortfall-th-dim {
  display: block;
  font-family: var(--mono);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The bar's track. A width with a floor: wide enough to compare two rows
   by eye, never so wide it starves the bucket column. */
.shortfall-table .shortfall-bar-cell {
  width: 14%;
}

.shortfall-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--brand);
}

/* An inline block, so a title moves to its own line as a whole when the
   column is narrow instead of leaving its last word beside the id. */
.shortfall-bucket-title {
  display: inline-block;
  max-width: 100%;
  margin-right: 8px;
  overflow-wrap: anywhere;
}

/* A status pill inside a table row: the page-scale '.pill' is 13px with
   12px of side padding, which is taller than the row's own text. */
.shortfall-table .pill {
  padding: 1px 8px;
  font-size: 11px;
  margin-left: 4px;
}

/* The "not counted" list. Capped at the measure '.ruled-panel > .hint-text'
   uses: the panel spans the whole field and prose that wide is unreadable. */
.shortfall-notes {
  margin: 0;
  padding: 0 0 0 18px;
  max-width: 78ch;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.shortfall-note-term {
  color: var(--text);
  font-weight: 600;
}

/* Console > Unspent ('Main.Render.Unspent'). Built on the Shortfalls
   vocabulary above ('.shortfall-table', '.shortfall-num', the bar, the
   notes), so only what differs is here: the column widths of its three
   tables, which a fixed layout needs stated, and the sizing panel. Unscoped
   like the block above: it sits in a '.ruled-panel.ruled-span-full', whose
   width is the field's in both regimes, and each table scrolls inside its
   '.bucket-events-scroll' below its 'min-width'. */
.unspent-table {
  min-width: 1080px;
}

.unspent-table th:nth-child(2) { width: 110px; }
.unspent-table th:nth-child(4) { width: 100px; }
.unspent-table th:nth-child(5) { width: 90px; }
.unspent-table th:nth-child(6),
.unspent-table th:nth-child(7) { width: 95px; }
.unspent-table th:nth-child(8) { width: 115px; }
.unspent-table th:nth-child(9) { width: 80px; }
.unspent-table .shortfall-bar-cell { width: 60px; }
.unspent-table .unspent-action-cell {
  width: 76px;
  text-align: right;
}

/* The row whose periods the sizing panel below is showing. */
.unspent-table tr.unspent-row-selected td {
  background: var(--bg);
}

/* Narrower than the table (projectz feature fca5d057, walkthrough 18): at
   800px the box showed the bucket and one figure, with the rest, "Size it"
   included, off to the right and nothing saying so (the box's scrollbar
   is under the last of 25 rows). So the bucket and the action column stay
   in place while the figures scroll between them, the action column's
   shadow marks the edge they pass under, and below the rail's breakpoint,
   where the table is always wider than the field, a line says it scrolls.
   The cells need a background to cover what scrolls under them; the
   selected row's rule above is more specific and keeps its own. Below
   641px the bucket column scrolls too: kept in place it would take most
   of the box. */
.unspent-table th.unspent-action-cell,
.unspent-table td.unspent-action-cell {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: -6px 0 6px -6px rgba(0, 0, 0, 0.35);
}

@media (min-width: 641px) {
  .unspent-table th:first-child,
  .unspent-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    box-shadow: 6px 0 6px -6px rgba(0, 0, 0, 0.35);
  }

  /* A cell that stays in place must hold its own text: the id, kept on
     one line in the Shortfalls table, would paint over the figures that
     scroll under it. */
  .unspent-table td:first-child .ruled-kv-value-mono {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Narrow enough for the table to scroll, the bucket column gives the
   figures room: in a fixed layout it otherwise takes what the stated
   widths leave of 1080px, about a third of the box at 800px. */
@media (min-width: 641px) and (max-width: 1099px) {
  .unspent-table th:first-child {
    width: 190px;
  }
}

.unspent-table tr.unspent-row-selected td.unspent-action-cell,
.unspent-table tr.unspent-row-selected td:first-child {
  background: var(--bg);
}

.unspent-scroll-hint {
  display: none;
  margin: 0 0 6px;
}

@media (max-width: 1099px) {
  .unspent-scroll-hint {
    display: block;
  }
}

.app-shell.app-narrow .unspent-scroll-hint {
  display: block;
}

/* The dimension list and the table's controls (projectz feature
   bbd51a71): one table at a time, picked from a list of dimensions that
   scrolls in its own box past about a dozen lines, so a tenant with many
   dimensions does not get a page of tables. The list is narrow on purpose
   (four short columns): at wide width it would otherwise stretch across
   the whole field. */
.unspent-dimensions {
  margin: 8px 0 12px;
  max-width: 640px;
}

.unspent-dimensions-head {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Both boxes are '.bucket-events-scroll', which WIDE UI MODE caps at 520px
   (rule written as '.app-shell:not(.app-narrow) ...' and
   ':is(.app-shell.app-wide, ...) ...', specificity 0,3,0): these rules
   match it and come later, so they win in every regime. The dimension list
   keeps a box of its own; a page of the table (25 rows) is the unit and
   grows with the page instead of scrolling inside a second box. */
.app-shell .bucket-events-scroll.unspent-dimensions-scroll {
  max-height: 22rem;
  overflow-y: auto;
}

.app-shell .bucket-events-scroll.unspent-page-scroll {
  max-height: none;
}

.unspent-dimensions-table {
  width: 100%;
}

.unspent-dimensions-table tr.unspent-row-selected td {
  background: var(--bg);
}

.unspent-dimension-pick {
  padding: 2px 6px;
  text-align: left;
  overflow-wrap: anywhere;
}

.unspent-dimension-pick:disabled {
  opacity: 1;
  font-weight: 600;
  cursor: default;
}

.unspent-table-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 4px 0 8px;
}

.unspent-filter {
  flex: 1 1 220px;
  max-width: 360px;
}

/* The parent and label narrowing beside the filter (projectz feature
   294f114a). Each keeps a max-width: the row is full-width in wide mode. */
.unspent-parent-filter {
  flex: 0 1 240px;
  max-width: 280px;
  min-width: 0;
}

.unspent-label-filter {
  flex: 0 1 160px;
  max-width: 200px;
  min-width: 0;
}

/* "Size all matching": the button over the table, then the panel in its
   place, set off like the switch confirmation. */
.unspent-bulk-open {
  margin: 0 0 8px;
}

.unspent-bulk {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unspent-bulk .lede {
  margin: 0;
  max-width: 78ch;
}

.unspent-bulk-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.unspent-bulk-controls .capacity-meter-range {
  flex: 0 1 200px;
  min-width: 120px;
}

.unspent-bulk-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.unspent-bulk-summary {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Every bucket of the run, its own scroll box so a run of hundreds keeps
   the page's length. Four classes, to beat the wide-mode 520px of
   '.app-shell:not(.app-narrow) .bucket-events-scroll' (three). */
.app-shell .unspent-bulk .bucket-events-scroll.unspent-bulk-scroll {
  max-height: 24rem;
  overflow-y: auto;
}

.unspent-bulk-table {
  width: 100%;
  min-width: 560px;
}

.unspent-bulk-table td {
  vertical-align: top;
}

.unspent-bulk-table .shortfall-bucket-title {
  display: block;
}

/* What a bucket gets and why it was refused are sentences: they wrap,
   unlike the figures of '.bucket-events-scroll' tables (two classes beat
   its 'nowrap'). The id stays on one line. */
.bucket-events-scroll .unspent-bulk-table td:nth-child(n + 2) {
  white-space: normal;
  min-width: 14rem;
}

.unspent-bulk-table tr.unspent-bulk-failed td {
  background: var(--bg);
}

/* Console ▸ Buckets' bulk freeze (projectz feature 10e1f439) is the same
   panel as "Size all matching" and takes the classes above; these are its
   own: the two openers side by side, and the list of what a freeze does. */
.status-bulk-open {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-bulk-effects p,
.status-bulk-effects ul {
  margin: 0;
  max-width: 78ch;
}

.status-bulk-effects ul {
  padding-left: 1.2em;
}

.unspent-pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unspent-pager-range {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The upper bound under the exact refused figure: a second line of the same
   cell, quieter, so the exact one stays the figure the column is read by. */
.unspent-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.unspent-sizing-bucket {
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}

/* The two sizing tables: a label column that wraps, then figures. */
.unspent-rules-table,
.unspent-periods-table {
  min-width: 720px;
}

.unspent-rules-table th:nth-child(n + 2),
.unspent-periods-table th:nth-child(n + 2) { width: 120px; }

/* A quarter of daily periods is ninety rows: the list scrolls inside its
   own box and the page keeps its length. */
.unspent-periods-scroll {
  max-height: 340px;
  overflow-y: auto;
}

/* The caution beside a suggested amount. Body text at the prose measure,
   set off by a rule on its left: it is part of the answer, not a footnote. */
.unspent-caution {
  margin: 0;
  max-width: 78ch;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

/* The child buckets a parent's sizing offers instead ('render_subtree_note'):
   one button each, wrapping, under the caution that names them. */
.unspent-subtree-children {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0 14px;
}

/* The capacity what-if in the sizing panel ('render_what_if', projectz
   feature c3305edd): a meter (range plus number, wrapping under each other
   at narrow widths), then a table whose bar column draws each period's
   demand on one scale with a line at the allowance tried. Colours are
   tokens only, so both themes read. */
.capacity-whatif {
  margin-top: 14px;
}

.capacity-meter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 720px;
  margin: 6px 0 10px;
}

.capacity-meter-range {
  flex: 1 1 260px;
  min-width: 0;
  accent-color: var(--brand);
}

.capacity-meter-number {
  width: 140px;
  font-family: var(--mono);
}

.capacity-table {
  min-width: 1080px;
}

/* The period never wraps: at 500 and 800 the table scrolls sideways
   inside its box. Scoped like '.bucket-events-scroll .shortfall-table
   td:first-child', which sets 'white-space: normal' and would win. */
.bucket-events-scroll .capacity-table td:first-child,
.bucket-events-scroll .capacity-table th:first-child {
  white-space: nowrap;
}

.capacity-table th.shortfall-num { width: 110px; }
.capacity-table .capacity-bar-cell { width: 18%; min-width: 120px; }

.capacity-bar {
  position: relative;
  height: 10px;
}

.capacity-bar-demand {
  position: absolute;
  left: 0;
  top: 2px;
  height: 6px;
  border-radius: 3px;
  background: var(--brand);
  opacity: 0.55;
}

.capacity-bar-demand.capacity-bar-short {
  background: var(--danger);
  opacity: 0.8;
}

.capacity-bar-allowance {
  position: absolute;
  top: 0;
  width: 2px;
  height: 10px;
  margin-left: -1px;
  background: var(--text);
}

.capacity-table td.capacity-short { color: var(--danger); font-weight: 600; }
.capacity-table td.capacity-waste { color: var(--warn-text); }

.capacity-table tr.capacity-total-row td {
  border-top: 2px solid var(--border);
  font-weight: 600;
}

/* The what-if's heading beside the pick between its two rules (projectz
   feature 3d5a54db), wrapping under it at narrow widths; the labels of the
   carry-over meters; and the chart, as wide as the panel up to the meters'
   width so it does not become a smear at 1400. */
.capacity-whatif-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.capacity-whatif-head .shortfall-dimension {
  margin: 0;
}

.capacity-meter-label {
  flex: 0 0 140px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.capacity-chart {
  max-width: 960px;
  margin: 8px 0 12px;
}

.capacity-carry-table {
  min-width: 760px;
}

/* The proposal (projectz feature dea59e94): the rules table keeps its
   figures at their width and scrolls sideways at 500; under it, one line
   per rule with its "Switch to locking with this policy", or the reason
   buckette-core gives for none; the confirmation is a card at the prose
   measure, saying what the two calls will do before they are sent. */
.unspent-rules-table {
  min-width: 1120px;
}

.unspent-rules-table th:first-child { width: 150px; }

/* Scoped like the capacity table's first column, which the shared
   '.bucket-events-scroll .shortfall-table td:first-child' would win. */
.bucket-events-scroll .unspent-rules-table td:first-child {
  white-space: nowrap;
}

.unspent-switches {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 10px;
  max-width: 78ch;
}

.unspent-switch-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.unspent-switch-rule {
  flex: 0 0 140px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.unspent-switch-figures {
  font-family: var(--mono);
  font-size: 12px;
}

.unspent-switch-blocked {
  flex: 1 1 260px;
  font-size: 13px;
}

.unspent-switch-row {
  margin: 4px 0 8px;
}

.unspent-switch-confirm {
  max-width: 78ch;
  margin: 6px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
}

.unspent-switch-confirm .lede {
  margin: 0;
}

.unspent-switch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.capacity-meter-spread {
  flex: 1 1 100%;
}

/* Postgres table usage ('Main.Render.PgTableUsage'): one row per table of a
   database, nine columns of which six are figures.

   The table is built on '.saved-keys-table' inside a '.table-scroll', so it
   inherits the app's table furniture and the WIDE UI MODE contract: it is
   the *wrapper* that scrolls, never the page. Every cell is 'nowrap' on
   purpose — a size broken over two lines ("24.1" / "MB") is unreadable and
   a wrapped date is worse — which means that in a narrow panel the table is
   wider than its card and scrolls sideways. That is the intended behaviour
   at 500 and 800, not an overflow to fix by letting cells wrap.

   No width rule of its own and no wide-mode duplicate: it fills the panel
   it is put in, which is already capped. */
.pg-usage-facts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0 4px;
}

.pg-usage-facts .kv-key {
  color: var(--text-muted);
  min-width: 130px;
}

.pg-usage-facts .kv-value {
  overflow-wrap: anywhere;
}

.pg-usage-table th,
.pg-usage-table td {
  white-space: nowrap;
}

/* Denser than '.saved-keys-table''s default: nine columns, and the panel
   this first shipped in (the instance detail column) is about 620px wide
   even on a 1400px window. */
.pg-usage-table td {
  padding: 6px 8px;
}

.pg-usage-table th {
  padding: 0 8px 6px;
}

/* The name stays put while the figures scroll under it, or a row scrolled
   to its dates no longer says which table it is. Needs an opaque
   background for that; '--surface' is what the cards it sits in use. */
.pg-usage-table .pg-name {
  position: sticky;
  left: 0;
  background: var(--surface);
}

/* Figures line up on the right edge and on their digits. */
.pg-usage-table .pg-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pg-usage-table .pg-table-name {
  font-family: var(--mono);
  font-size: 12px;
}

.pg-usage-table .pg-partitions {
  margin-left: 8px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  cursor: default;
}

.pg-usage-table .pg-absent {
  color: var(--text-muted);
}

.pg-usage-table .pg-when {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* The totals line. '.saved-keys-table tr:last-child td' strips the bottom
   border of the last *body* row as well as of this one, so the rule that
   separates the two is drawn here, on top. */
.pg-usage-table tfoot td {
  border-top: 1px solid var(--border);
  font-weight: 600;
}

/* A sortable column header: a button that looks like the header text it
   replaces, so the two sortable columns do not read as a different kind of
   thing from the seven that are not. */
.pg-sort {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.pg-sort:hover,
.pg-sort-active {
  color: var(--text);
}

.pg-sort-active {
  text-decoration: none;
}

.pg-sort:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Prose: capped at a readable measure at every width (WIDE UI MODE rule 3).
   The lead sentence needs it as much as the footnote: on the Control plane
   page the block has a card to itself, 1000px wide and more. */
.pg-usage-hint {
  max-width: 65ch;
}

.pg-usage-note {
  max-width: 65ch;
  margin-top: 10px;
}

/* ==========================================================================
   ADMIN ▸ MAILS (specs/email-templates.md, pieces 4a and 4b)
   ==========================================================================

   The page over the mails control-plane sends: a list by group, then one
   mail's detail: the editor of its templates, a preview the server
   rendered, and the box that sends that preview to one address. Markup is
   'Main.Render.AdminMails'; every class here starts with 'mails-' and is
   used by that module only.

   Layout, per WIDE UI MODE:

     * one column when the page is narrow, the editor first (subject, body,
       example context, history) and the preview under it; two when it has
       room — the editor on the left, the preview on the right at the
       width a mail is designed for. The reference material (default
       templates, library blocks) follows under both, full width. The
       editor's fields fill their grid cell and no more (rule on full-width
       controls): the cell is what bounds them, not a 'max-width'.
       The switch is a *container* query on the detail's own
       width, not one of rule 9's two selector copies. Rule 9 exists because
       "Auto above 1100px" and "explicitly Wide" are different selectors for
       the same intent; here the intent is "is there room for a 690px cell
       and a usable one beside it", which neither selector answers — Wide
       chosen on an 800px window says yes to the class and no to the room.
       Asking the container is right in all four width states and with the
       rail open or collapsed, and leaves nothing to keep in step;
     * every monospace block scrolls inside itself and wraps, so no long
       line can make the page scroll sideways (rule 4's concern, for 'pre');
     * prose is capped at 65ch and the picker at 42ch (rules 2 and 3).

   The frame is capped at 640px in every regime. That is not a layout
   convenience: a mail is designed for a column about 600px wide, and a
   preview that stretched with the window would show something no mail
   client shows. Its height is fixed, because the frame is sandboxed with an
   opaque origin and the page cannot measure the document inside it; the
   document scrolls within the frame.

   The frame draws no background of its own. A mail paints its own, and it
   is light in both themes — a mail does not follow the Console's theme, so
   a light sheet inside a dark page is the correct picture, not a gap in
   the dark theme.
   ========================================================================== */

.mails-prose {
  max-width: 65ch;
}

.mails-actions {
  margin-top: 12px;
}

/* ---- The list ---- */

.mails-group {
  margin-top: 18px;
}

.mails-group-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}

/* Hairlines are gaps, as in the heroes: the list is painted '--border' and
   its rows '--surface', so no row carries a border of its own. */
.mails-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.mails-row {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 0;
  padding: 10px 12px;
  cursor: pointer;
}

.mails-row:hover {
  background: var(--bg);
}

.mails-row:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.mails-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mails-row-key,
.mails-key,
.mails-field-path,
.mails-library-name {
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.mails-row-key {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}

.mails-row-desc {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 65ch;
}

/* The markers: "critical" on the sign-in mails, "override vN" on a mail
   sent with saved templates, "secret" on a context field. Small, lower-case, never the only carrier of the meaning — each
   has a 'title' saying what it means. */
.mails-mark {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg);
  white-space: nowrap;
}

.mails-mark-critical {
  border-color: var(--warn-border);
  color: var(--warn-text);
  background: var(--warn-bg);
}

.mails-mark-secret {
  margin-left: 6px;
}

/* "override vN" on a mail sent with an admin's saved templates (piece 3).
   Brand-coloured text on the neutral chip: a state, not a warning. */
.mails-mark-override {
  color: var(--brand);
  border-color: var(--brand);
}

/* ---- A mail's detail ---- */

.mails-detail {
  container: mails / inline-size;
}

.mails-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* A control in a flex row: capped, or it takes the whole card at 1280px. */
.mails-picker {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 42ch;
}

.mails-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0 6px;
}

.mails-key {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.mails-detail .mails-prose {
  font-size: 14px;
  margin: 0;
}

.mails-detail .hint-text.mails-prose {
  font-size: 12px;
  margin: 4px 0 0;
}

.mails-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 16px;
  align-items: start;
}

/* 'min-width: 0' is what lets a 'pre' or the fields table scroll inside its
   cell instead of widening the cell, and with it the page. */
.mails-column {
  min-width: 0;
}

/* A label over a block inside a card: quieter than '.section-title', which
   names the card. */
.mails-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 16px 0 6px;
}

.mails-subject {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  max-width: 640px;
  overflow-wrap: anywhere;
}

.mails-frame {
  display: block;
  width: 100%;
  max-width: 640px;
  height: 560px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mails-pre {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
  max-height: 360px;
  overflow: auto;
  color: var(--text);
}

/* The text part sits under the frame and takes the frame's width, so the
   two parts of one mail read as a pair. */
.mails-pre-text {
  max-width: 640px;
}

.mails-absent {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.mails-errors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.mails-error {
  max-width: 640px;
  overflow-wrap: anywhere;
}

.mails-error-part {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  margin-bottom: 2px;
}

.mails-fields td {
  vertical-align: top;
}

/* A path is one word: never broken, whatever the column is squeezed to.
   The table scrolls inside its '.table-scroll' instead. */
.mails-field-path {
  font-size: 12px;
  overflow-wrap: normal;
  white-space: nowrap;
}

.mails-field-type {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.mails-libraries {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.mails-library-name {
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
}

.mails-library-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.mails-library-source {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.mails-library-source summary {
  cursor: pointer;
}

.mails-library-source .mails-pre {
  margin-top: 6px;
}

/* ---- The editor (piece 4b) ---- */

/* The editor's fields take their grid cell: a template is code, and a body
   line is long. They are bounded by '.mails-column', never by the page. */
.mails-detail .text-input.mails-input,
.mails-detail .text-input.mails-textarea {
  display: block;
  max-width: none;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

.mails-detail .text-input.mails-textarea {
  min-height: 240px;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mails-detail .text-input.mails-textarea-context {
  min-height: 160px;
}

/* The note is a sentence, not code. */
.mails-detail .text-input.mails-input-note {
  font-family: var(--sans);
  font-size: 14px;
  max-width: 65ch;
}

label.mails-label {
  display: block;
}

.mails-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mails-detail .text-input.mails-textarea-context {
  margin-top: 10px;
}

/* "unsaved changes" beside the title, "out of date" over a stale preview:
   states that need acting on, so the warning colours, like "critical". */
.mails-mark-unsaved {
  border-color: var(--warn-border);
  color: var(--warn-text);
  background: var(--warn-bg);
}

.mails-detail .success-text,
.mails-detail .warning-text,
.mails-detail .error-text.mails-error {
  margin: 10px 0 0;
}

.mails-conflict-text {
  margin: 0 0 8px;
}

/* A preview that no longer shows the editor's draft stays on the page,
   dimmed, so the author keeps something to look at while typing. */
.mails-stale-line {
  font-size: 12px;
  color: var(--text-muted);
  margin: 10px 0 0;
}

.mails-preview-stale {
  opacity: 0.55;
}

/* "Send this preview to": under the preview it sends, set off by a rule.
   The address box is capped by '.text-input' (42ch) and may shrink; the
   button never wraps away from its label. */
.mails-test {
  margin-top: 18px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.mails-test-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mails-test-row .mails-test-input {
  flex: 1 1 220px;
  min-width: 0;
}

/* ---- The history ---- */

.mails-versions {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.mails-version {
  background: var(--surface);
  padding: 10px 12px;
  min-width: 0;
}

.mails-version-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.mails-version-number {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.mails-version-what {
  font-size: 13px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.mails-version-note {
  font-size: 13px;
  color: var(--text);
  margin: 4px 0 0;
  max-width: 65ch;
  overflow-wrap: anywhere;
}

.mails-version .mails-button-row {
  margin-top: 8px;
}

/* The two-column detail. The right cell is the frame's 640px plus the
   card's own padding and border; the left one, the editor, takes what is
   left and is never squeezed under 380px (the query's 1090px is 690 + 380
   + the gap, rounded up). Asked of the container, not of the viewport or
   the width classes: see this section's header for why. */
@container mails (min-width: 1090px) {
  .mails-columns {
    grid-template-columns: minmax(380px, 1fr) minmax(0, 690px);
  }
}

/* Buckets list: the facts line under each row (dimensions, created, tops up).
   Muted via .tenant-sub; keeps its own line so an untitled bucket is still
   recognisable by what it holds. */
.bucket-summary {
  margin-top: 2px;
  overflow-wrap: anywhere;
}

/* "Your tenants" rows: usage and headroom (merged in from the retired
   Account > Consumption table). The strip is a fixed four-column grid with a
   fixed row height, so skeleton bars and real values occupy the same box and
   nothing moves when the asynchronous usage fetch lands. */
.tenant-usage {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px 12px;
  margin-top: 6px;
  max-width: 700px;
}

.tenant-usage-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.tenant-usage-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenant-usage-value {
  font-size: 13px;
  line-height: 18px;
  height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenant-usage-expanded {
  margin-top: 8px;
  max-width: 480px;
}

/* Custom domains block (projectz feature cf1ee411), inside the expansion
   above. Record values are long (a TXT token, a host), so cells wrap anywhere
   rather than widening the 480px column. */
.custom-domains {
  margin-top: 16px;
}

.custom-domain {
  margin-top: 8px;
}

.custom-domain-record {
  margin-top: 8px;
}

.custom-domain-field {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-top: 4px;
}

.custom-domain-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 44px;
}

.custom-domain-value {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.custom-domain-checks {
  margin: 8px 0 0;
  padding-left: 16px;
}

/* The "soon" mark (projectz feature e62d0650, 'Main.Render.Soon'): a badge,
   one line on what is not there yet, and "I'm interested". Every colour is a
   token, so it follows the dark theme. It sits in narrow columns (the 480px
   tenant expansion), so the text wraps and the button goes under it rather
   than squeezing the line; 'max-width' keeps it from smearing in a wide
   shell when a future area puts it in a full-width panel. */
.soon-mark {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 640px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.soon-mark-text {
  flex: 1 1 240px;
  min-width: 0;
}

.soon-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  color: var(--brand);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: 1px;
}

.tenant-more-details {
  align-self: flex-start;
  margin-top: 4px;
}

/* The table under "+ more details": two groups, each a tbody with a heading
   row. Row labels are sentence case and aligned with their values (the
   uppercase micro-label of '.saved-keys-table th' is for column heads), and
   every row but a group's last has one rule across both columns: the base
   table strips the last row's rule from the td only, which left a stub
   under the last label. */
.tenant-details-table {
  margin-top: 0;
}

.tenant-details-table th[scope="row"] {
  padding: 8px 10px 8px 0;
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  cursor: help;
}

.tenant-details-table tbody tr:last-child th,
.tenant-details-table tbody tr:last-child td {
  border-bottom: none;
}

.tenant-details-table .tenant-details-group th {
  padding: 14px 0 4px;
  border-bottom: 1px solid var(--border);
}

.tenant-details-table tbody:first-child .tenant-details-group th {
  padding-top: 4px;
}

/* The row's "⋮" stays by the tenant's name. '.tenant-row' centres its
   children, so with the details open the button sat in the middle of the
   table. */
.tenant-actions-top {
  align-self: flex-start;
}

/* Your tenants: the row's "Open" button (projectz feature b3513acf). The
   whole row still opens the tenant on click; this is the control that says
   so, and the one the keyboard reaches. Secondary on an ordinary row. A
   tenant that is new or has no bucket carries a brand rule at its row's
   start (the same mark as '.tenant-welcome'); the first such row, while no
   slot is unused, has the page's one primary action: .btn-primary with a
   soft brand ring ('.tenant-open-nudge'). Tokens only. */
.tenant-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.tenant-open-nudge {
  font-weight: 600;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.tenant-row-nudge {
  border-left: 3px solid var(--brand);
}
/* The one line above the rows that says what opening does. It is as wide as
   the rows under it, so that it is one line where the panel has the room
   (about 1280px of viewport and up) and wraps to the panel below that. The
   sentence measures 138 to 143ch at this size, and at the usual 65ch prose
   cap it was a three-line column beside full-width rows (projectz feature
   200d6ad7). Still capped, per WIDE UI MODE rule 2: the cap is the
   sentence's own length plus a margin, so that longer copy here wraps
   in Full width instead of running the whole panel. */
.tenant-open-hint {
  max-width: 150ch;
  margin: 0 0 10px;
}

/* Projectz feature f2ec2d13: no slot of a plan's schedule is free, and when
   the next one arrives. A sentence above the list, capped like the hint
   above (WIDE UI MODE rule 2). */
.tenant-next-slot {
  max-width: 150ch;
  margin: 0 0 10px;
}

.tenant-usage-skeleton {
  display: block;
  width: 70%;
  background: var(--border);
  border-radius: 4px;
  opacity: 0.6;
}

@media (max-width: 520px) {
  .tenant-usage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Console > Buckets: the placeholder row in which a bucket is created
   (feature ee4cc721). One row in the list; collapsed it is a quiet dashed
   toggle, expanded it holds the labelled fields in place. Tokens only. */
.bucket-tree-new {
  margin-bottom: 8px;
}

.bucket-node-new {
  border-style: dashed;
  background: transparent;
}

.bucket-node-new-open {
  border-style: solid;
  background: var(--bg);
}

.bucket-new-toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.bucket-new-toggle:disabled {
  cursor: not-allowed;
  color: var(--text-muted);
}

.bucket-new-plus {
  font-weight: 600;
}

.bucket-new-hint {
  color: var(--text-muted);
  font-size: 13px;
}

.bucket-new-head,
.new-bucket-dimension-head,
.new-bucket-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.new-bucket-actions {
  justify-content: flex-start;
  margin: 12px 0;
}

.bucket-new-title,
.new-bucket-label {
  font-weight: 600;
  font-size: 13px;
}

.new-bucket-dimension {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}

.new-bucket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.new-bucket-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.new-bucket-field .text-input,
.new-bucket-field .select-input {
  max-width: 100%;
}

.new-bucket-field .form-row {
  margin: 0;
}

/* "Expires in" (projectz feature 785751c5): a number of a few digits and
   its days/minutes selector, directly beside it. The field is outside
   '.new-bucket-grid', so with the 'max-width: 100%' above its input ran the
   whole panel (about 1070px at a 1400px window) with the selector at the
   far edge. 260px is one column of the dimension row at that width; under
   it the row is the panel's width, as before. */
.new-bucket-field .expiry-row {
  max-width: 260px;
  flex-wrap: nowrap;
}

/* The pair stays on one line whatever the row is in: inside a panel,
   '.ruled-panel .form-row' wraps and gives the input a 9rem floor, which
   with the selector is within a few pixels of the 260px and would drop the
   selector under the number. The number takes what the selector leaves. */
.new-bucket-field .expiry-row .text-input {
  flex: 1 1 0;
  min-width: 0;
}

.new-bucket-field .expiry-row .select-input {
  flex: none;
}

.new-bucket-field > .hint-text {
  margin: 0;
}

/* The optional title (projectz feature 4dfc0e5a) sits above the first
   dimension, outside '.new-bucket-grid', so it gets a width of its own
   (about two columns of the dimension row at 1400px) rather than running
   the whole panel, and some air under the explanation link. */
.new-bucket-title-field {
  max-width: 440px;
  margin-top: 10px;
}

/* Its help line is not in a grid cell either, so it gets a reading measure
   (the 70ch of '.ruled-panel > .hint-text'). */
.new-bucket-field > .expiry-row + .hint-text {
  max-width: 70ch;
}

.new-bucket-missing {
  margin: 0;
}

/* The line under "Create bucket" saying what can be configured afterwards
   (projectz feature d0dc2078). A reading measure, not the form's width. */
.new-bucket-after {
  margin: 0 0 4px;
  max-width: 70ch;
}

/* "Read the full explanation" (render_human_topic_more; projectz feature
   ba437639). A real <button> drawn as a link: brand colour, underlined at
   rest, with an arrow that turns when the explanation is open. It was a
   '.btn-ghost' before, which is muted text with no border, and as a child
   of the column flex above it stretched to the full width with its label
   centred: a grey line that nobody read as something to click. Hence
   'align-self', which keeps it at the start of the text it follows. */
.topic-more {
  appearance: none;
  background: none;
  border: none;
  padding: 2px 0;
  align-self: flex-start;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topic-more::before {
  content: "\25B8";
  display: inline-block;
  width: 1em;
  text-decoration: none;
}

.topic-more[aria-expanded="true"]::before {
  content: "\25BE";
}

.topic-more:hover {
  text-decoration-thickness: 2px;
}

.topic-more:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Alerting thresholds rows (feature c2199fef): three selects and an input
   do not fit one line of a half-width panel, and the 9rem floor above cut
   "critical: amount left" short. A wider floor lets the row wrap instead. */
.ruled-panel .form-row.tc-row > select.text-input {
  flex: 1 1 13rem;
  min-width: 13rem;
}

/* One level of a thresholds row (warning, critical): its select and its
   value are one unit, so they wrap together and the value never lands on a
   line of its own away from the select that says which level it is
   (projectz feature f3b6edd4). */
.tc-row > .tc-level {
  display: flex;
  gap: 10px;
  flex: 1 1 22rem;
  min-width: 0;
}

.tc-row > .tc-level > select.text-input {
  flex: 1 1 13rem;
  min-width: 13rem;
}

.tc-row > .tc-level > input.text-input {
  flex: 1 1 7rem;
  min-width: 6rem;
}

/* Replenishment schedule rows (render_console_replenish_config_form;
   projectz feature bd9c7d7d). The schedule row (kind / how many / unit, or
   kind / hour / minute) and every dimension row (dimension / amount /
   Remove) are three controls each. As '.form-row' flex rows each one sized
   its own controls, so the second and third started at a different x in
   each row and the form read as jagged. Here every row is a grid on the
   same three tracks, and since all rows have the same width the tracks
   resolve to the same edges: two equal fields and a fixed third column
   wide enough for "minute (0-59)", the unit select and "Remove".

   Every control fills its cell ('max-width: none' lifts '.text-input''s
   42ch cap), so the cap is on the block instead: WIDE UI MODE rule 2, a
   full-width control needs a max-width or a grid cell, and this is both.

   '.rc-rows' is a container because the form is drawn in panels of very
   different widths and the app cannot tell which from the viewport. In a
   narrow one the first control takes a line of its own and the other two
   share the next, still on tracks common to every row, rather than three
   fields squeezed until their placeholders are cut. These rows are not
   '.form-row's on purpose: '.ruled-panel .form-row > .text-input' would
   give each field a 9rem floor that a grid track cannot honour. */
.rc-rows {
  container: rc-rows / inline-size;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 46rem;
  margin: 4px 0 12px;
}

.rc-rows > .rc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 8.5rem;
  gap: 10px;
}

.rc-rows > .rc-row > * {
  width: 100%;
  max-width: none;
  min-width: 0;
}

/* A captioned cell (the daily schedule's hour and minute): the caption sits
   above the field, and the row's other controls line up with the fields,
   not with the captions. Still one cell, so a row keeps its three children. */
.rc-rows > .rc-row-captioned {
  align-items: end;
}

.rc-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rc-field > .text-input {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.rc-field-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Core's reading of the schedule as typed (projectz feature f4d301da): the
   words and the next run, set apart from the hints around it. */
.rc-preview {
  max-width: 46rem;
  margin: 0 0 12px;
}

.rc-preview:not(.warning-text) {
  padding: 8px 12px;
  border-left: 3px solid var(--brand);
  background: var(--bg);
}

/* The schedule step's fold for what a first bucket has no reason to touch
   (projectz feature 4ea1cbdd). */
.rc-more-options {
  margin: 8px 0 12px;
}

.rc-more-options > summary {
  cursor: pointer;
}

@container rc-rows (max-width: 32rem) {
  .rc-rows > .rc-row {
    grid-template-columns: minmax(0, 1fr) 8.5rem;
  }

  .rc-rows > .rc-row > :first-child {
    grid-column: 1 / -1;
  }

  /* A row is two lines here: a little more air between rows than inside
     one, so that it stays legible which amount belongs to which dimension. */
  .rc-rows > .rc-row + .rc-row {
    margin-top: 8px;
  }
}

/* Two-choice panel (Main.Render.TwoPaths): the empty Buckets page now, the
   account wizard later. Hairline-bordered cells, tokens only; one column
   until there is room for two. */
.two-paths {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0;
  max-width: 880px;
}

@media (min-width: 720px) {
  .two-paths {
    grid-template-columns: 1fr 1fr;
  }
}

.two-paths-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.two-paths-title {
  margin: 0;
  font-weight: 600;
}

.two-paths-body {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 14px;
  flex: 1;
  /* A cell is half a panel, which Full width leaves uncapped (WIDE UI MODE
     rule 3: prose keeps a measure at every width). */
  max-width: 65ch;
}

/* In a panel (the empty Buckets page) the two cells share the panel's whole
   width: the 880px cap stopped them at about two thirds of a full-span panel
   at 1400px and left the rest empty (projectz feature 6e38172c). The grid is
   the "grid cell" of WIDE UI MODE rule 2, and nothing in a cell stretches:
   the button is 'align-items: flex-start', the text is capped above. Not
   gated on a width mode, so there is no rule 9 copy to write. Outside a
   panel (the account wizard, a '.center-card') the cap stays. */
.ruled-panel > .two-paths {
  max-width: none;
}

/* The introduction of a full-span panel that holds nothing else. The panel
   default ('.ruled-panel > .lede', 60ch) is sized for a lede above a
   panel's controls; alone in a panel some 1100px wide it wrapped a
   two-sentence paragraph over three lines in the left 40% (same feature).
   Still a measure, not the panel's width: about 700px at 14px. */
.ruled-panel > .lede.lede-wide {
  max-width: 90ch;
}

/* Projectz feature 7cc8bb21: the block beside a freshly shown key. */
.key-usage {
  margin: 12px 0;
}

.key-usage-snippet {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  overflow-x: auto;
  white-space: pre;
  max-width: 100%;
}

.key-usage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Projectz feature a4ceeadd: an admin key's block starts folded. The
   summary is the only thing drawn until it is opened, so it is sized as a
   control, not as a caption. It keeps its default display: that is what
   draws the disclosure triangle. */
.key-usage-fold > summary {
  cursor: pointer;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 600;
}

/* Account > Tenant slots: the ended lines, folded under the live ones
   (projectz feature 1f5aeed8). A quiet label; the rows inside are the
   usual slot rows. */
.ended-lines {
  margin-top: 12px;
}
.ended-lines > summary {
  cursor: pointer;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Your tenants: a placeholder row for a purchased-but-unused tenant slot.
   Calm on purpose: the plain 1px --border of every row, a faint brand tint,
   and one short line (limits left, action right). Several in a row must not
   read as an alarm. Tokens only. */
.tenant-slot-placeholder {
  background: color-mix(in srgb, var(--brand) 4%, var(--surface));
  padding: 8px 12px;
}
.tenant-slot-action {
  flex: 0 0 auto;
}
/* A tenant under deletion: a row of the list, muted, in the warning tokens,
   with no actions (it cannot be undone). Tokens only, so dark mode follows. */
.tenant-row-deleting {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--text-muted);
}
.tenant-row-deleting .tenant-url {
  color: var(--text-muted);
}
.tenant-row-deleting .tenant-teardown {
  color: var(--text);
}
.tenant-row-deleting .tenant-teardown-failed {
  border-left: 3px solid var(--warn-border);
  padding-left: 8px;
}
.tenant-deleting-pill {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--warn-border);
  color: var(--text-muted);
}

/* The unused slot's limits (projectz feature 6deb891d). The row gives its
   end to "Initialize tenant", so its strip is narrower than a tenant's and
   the equal quarters cut "Webhook configs" short. Here a column is never
   narrower than what it holds: with room to spare the columns are equal, as
   in a tenant's row, and when the row is tight the long label takes from the
   short ones. The second rule repeats the strip's own narrow-window layout,
   which the first would otherwise override.

   Two things since projectz feature c287f32e, which made the third figure
   "History retention" (a longer label than "Webhook configs"):

   - Three columns, one per figure. The strip used to keep a tenant row's
     fourth (headroom) column and leave it empty; at the longer label's
     width that empty column is what would push "Initialize tenant" onto a
     line of its own in a 640px shell.
   - The strip is as wide as its own content, not as its container.
     '.tenant-meta' is a flex item sized by what it holds, and opening the
     row's name field puts a form and a line of help in it: a strip that
     filled it grew toward its 560px cap and every column moved sideways.
     'max-width' keeps it inside a narrow row. */
.tenant-slot-placeholder .tenant-usage {
  width: max-content;
  max-width: 100%;
  margin: 2px 0 0;
  grid-template-columns: repeat(3, minmax(max-content, 1fr));
}
@media (max-width: 520px) {
  .tenant-slot-placeholder .tenant-usage {
    grid-template-columns: repeat(2, minmax(max-content, 1fr));
  }
}

/* A row of Your tenants: the purchase behind the slot or the tenant
   (payment, current period, the link to its line on Account > Tenant
   slots). .slot-sub lays it out; the link is .receipt-link at the size of
   the text beside it. */
.tenant-slot-purchase {
  margin-top: 2px;
}
.tenant-slot-purchase-link {
  font-size: 13px;
  text-align: left;
}
/* On that line, the sentence of a purchase that stops and is not renewed
   (projectz feature db21123e): a .warning-text on a line of its own, under
   the pills and the period and above the link, a little tighter than a
   panel's warning since it sits inside a row. */
.tenant-slot-ending {
  margin: 4px 0;
  padding: 6px 10px;
}
/* What that link scrolls to (Main.Types.slotLineId): kept off the window's
   top edge. */
.slot-row[id] {
  scroll-margin-top: 16px;
}

/* "Purchase more tenants": findable by its label, not by a slab. Start-aligned
   and content-wide, a larger semibold label with a leading "+", soft-filled in
   the success colour (tokens, so dark mode follows) and outlined 1px. Still the
   page's primary action, above the slots. */
.btn-cta {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}
.btn-cta:hover {
  filter: brightness(0.96);
}
.tenant-purchase-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 16px;
  font-size: 17px;
  font-weight: 600;
}
/* The same button while a row holds the page's primary action (the first
   unused slot's "Initialize tenant", or the "Open" of a tenant with no
   bucket; .btn-primary, in the row): this one steps back to an ordinary secondary button. Content-wide and
   start-aligned like the loud variant, so it does not move between the two. */
.tenant-purchase-quiet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.tenant-purchase-quiet .tenant-purchase-plus {
  font-size: 16px;
}
/* The button under the list instead of above it: only while the welcome
   message is shown, where the waiting slot's row comes first. The gap moves
   to the other side; still content-wide and start-aligned, so no cap is
   needed at any width. */
.tenant-purchase-after {
  margin-top: 12px;
  margin-bottom: 0;
}
/* Your tenants, before anything is initialized: a short welcome above the
   list. A card's edge with a brand rule at the start, prose capped to a
   readable measure (see "Prose measure caps"). Tokens only. */
.tenant-welcome {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 14px;
}
.tenant-welcome p {
  margin: 0 0 6px;
  max-width: 65ch;
}
.tenant-welcome p:last-child {
  margin-bottom: 0;
}
.tenant-welcome .tenant-welcome-title {
  font-weight: 600;
  font-size: 15px;
}
.tenant-purchase-plus {
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
}

/* Console Docs: the small group labels ("Guides" / "Reference") and the
   search box of the people path. Mono micro-label, like .ruled-panel-head's
   siblings; the box takes a max-width so it is no smear at 1400px. */
.docs-group-label {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.docs-search-input {
  width: 100%;
  max-width: 420px;
}

/* The suggested agent prompt: exactly the string the Copy button copies.
   Wraps (a URL is long) and never widens its grid cell. */
.docs-agent-prompt {
  margin: 12px 0;
  padding: 10px 12px;
  max-width: 62ch;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: var(--bg, var(--surface));
  border-left: 2px solid var(--border);
}

/* Integrations: a purpose heading between groups of cards. */
.integrations-group { margin: 20px 0 6px; }
.integrations-group .hint-text { margin: 2px 0 0; max-width: 70ch; }

/* Account > Tenant slots, "Your tenant slots": one row per slot. The plan is
   the primary text; the price, period and the tenant that sits in the slot
   are secondary (muted, smaller). No count on the row: the one figure is
   the summary line above the list. Tokens only; the row inherits
   '.tenant-row' (wraps, so at 500px the action drops under the text). */
.slots-summary {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.slot-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-width: 0;
}
.slot-plan {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.slot-price,
.slot-tenant,
/* "Awaiting payment" is scrolled to after a purchase and from an open
   invoice's row (ControlPlane.Basket.panelId). Without a margin its title
   would sit flush against the window's top edge. */
#basket {
  scroll-margin-top: 16px;
}
.slot-period {
  font-size: 13px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.slot-price {
  font-variant-numeric: tabular-nums;
}
.slot-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
/* A line's payment warning on its own row (projectz feature 8b99c9c7,
   Main.Render.render_slot_warning): the sentence, then the way out under
   it. The sentence is .warning-text / .error-text / .hint-text, each capped
   at a readable measure already (WIDE UI MODE rule 3), so the block needs
   no cap of its own; it only takes those classes' own top margins off and
   keeps the button from stretching to the column's width. The summary at
   the top of the page (.payment-warnings-summary) is the same shape. */
.slot-payment-warning,
.payment-warnings-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.slot-payment-warning {
  margin-top: 6px;
}
.slot-payment-warning > p,
.payment-warnings-summary > p {
  margin: 0;
}
.slot-payment-warning-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.payment-warnings-summary .receipt-link,
.slot-external-cancel .receipt-link,
.slot-payment-warning .receipt-link {
  font-size: 13px;
}
.slot-initialize {
  padding: 2px 8px;
}
/* Delete tenant on a slot row (projectz feature e78f0d04): folded behind a
   quiet "More" at the row's end, in the row's own muted text, not a red link
   beside the price. The confirmation it opens (.slot-delete-confirm) is
   where the danger is said. */
.slot-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.slot-more {
  position: relative;
}
.slot-more-toggle {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  list-style: none;
  padding: 2px 8px;
  border-radius: var(--radius);
}
.slot-more-toggle::-webkit-details-marker {
  display: none;
}
.slot-more-toggle::after {
  content: " \25BE";
}
.slot-more-toggle:hover,
.slot-more[open] > .slot-more-toggle {
  color: var(--text);
  background: var(--bg);
}
.slot-more[open] {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.slot-delete {
  padding: 2px 8px;
}
.slot-delete-confirm {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.slot-cancel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.slot-cancel .hint-text {
  margin: 0;
}

/* Account > Tenant slots, "Awaiting payment" (payments phase 3). The manual
   payment instructions are plain text set by the operator (a deployment
   setting and a per-account note): line breaks are kept, long references
   wrap, and the block never widens its cell. The tick box on a line is
   centred on the plan name's row. */
.payment-instructions {
  margin: 0 0 8px;
  max-width: 62ch;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 13px;
  color: var(--text);
}
.slot-line > input[type="checkbox"] {
  align-self: center;
  margin: 0;
}

/* The buckets-limit marker (projectz feature 48c21a19): at the top of
   Console > Buckets and Console > Monitors when the connected tenant is
   nearing (80%) or at its buckets limit. Deliberately larger than
   .warning-text, which is the one line Status shows. A block in the page
   column like the .ruled-block under it; the prose is capped so it does not
   smear in the wide regimes, and the actions wrap under it when narrow.
   Tokens only, so it follows the dark theme. */
.limit-marker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0 0 12px;
  padding: 14px 18px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left-width: 6px;
  border-radius: var(--radius);
  color: var(--warn-text);
}

.limit-marker-reached {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.limit-marker-text {
  flex: 1 1 320px;
  min-width: 0;
  max-width: 70ch;
}

.limit-marker-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.limit-marker-figure {
  margin: 2px 0 6px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
}

.limit-marker-body {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.limit-marker-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.limit-marker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Status at the buckets limit with archived buckets (projectz feature
   60177fb4): the deletion-policy form, drawn under the marker it answers. */
.status-archived-retention {
  margin: 0 0 12px;
}

/* The same fact on a "Your tenants" row, with "Upgrade" beside it. */
.tenant-limit-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text);
}

.tenant-limit-pill {
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.tenant-limit-pill-reached {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

.tenant-limit-figure {
  font-family: var(--mono);
  font-size: 12px;
}

/* ------------------------------------------------------------------
   Monitors: the "Add widget" gallery (projectz feature 965316f5).
   One card per widget kind with a schematic drawn in inline SVG. Every
   colour is a theme token, so the dark theme needs no rule of its own.
   The grid is auto-fill, so it is one column at 500px and three at 1400
   without a breakpoint; a card never exceeds its cell.
   ------------------------------------------------------------------ */
.wk-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  max-width: 900px;
}

.wk-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  text-align: left;
  padding: 10px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.wk-card:hover,
.wk-card:focus-visible {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  outline: none;
}

.wk-art {
  width: 100%;
}

.wk-svg {
  display: block;
  width: 100%;
  height: auto;
}

.wk-label {
  font-weight: 600;
}

.wk-advanced {
  margin-left: 6px;
  font-size: 0.75em;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
}

.wk-notifier-note {
  max-width: 720px;
  padding: 8px 12px;
  margin: 8px 0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
}

.wk-warning {
  max-width: 720px;
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.wk-blurb {
  font-size: 0.85em;
  color: var(--text-muted);
}

.wk-svg .wk-frame { fill: var(--bg); stroke: var(--border); stroke-width: 1; }
.wk-svg .wk-fill { fill: var(--brand); opacity: 0.85; }
.wk-svg .wk-mid { fill: var(--brand); opacity: 0.55; }
.wk-svg .wk-soft { fill: var(--brand); opacity: 0.25; }
.wk-svg .wk-ribbon { fill: var(--brand); opacity: 0.3; }
.wk-svg .wk-ink { fill: var(--text-muted); opacity: 0.45; }

.wk-kind-row {
  align-items: center;
}

.wk-dimension {
  max-width: 320px;
}

.wk-missing {
  margin: 4px 0;
}

/* Widget form parts (projectz 97f38ec6): "Which buckets" and "How to show
   them" are two bordered blocks of the same look for every kind. Tokens
   only, no width of their own beyond the cell they sit in. */
.wk-part {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0;
  min-width: 0;
}

.wk-part .section-title {
  margin-top: 0;
}

.wk-count {
  background: var(--surface);
  border-left: 3px solid var(--brand);
  padding: 6px 10px;
  margin: 8px 0;
  max-width: 720px;
}

.wk-count-line {
  margin: 0 0 4px;
  font-weight: 600;
}

.wk-chips {
  align-items: center;
  gap: 6px;
}

/* Event log uses (projectz 97cc8db1): a button and its sentence, wrapping
   under each other when narrow. Tokens only. */
.wk-use {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 6px 0;
  max-width: 900px;
}

.wk-use .hint-text {
  flex: 1 1 260px;
  min-width: 0;
  margin: 0;
}

/* Widget panel (projectz 3d37f50c): the widget form replaces the widget
   list while it is open. It is scrolled to on open, and the widget the
   reader came from on close, so both keep a margin above them. */
.widget-panel,
.monitor-widget-card,
#monitor-add-widget {
  scroll-margin-top: 16px;
}

.widget-panel-heading {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Monitors: looking at a monitor (projectz 6943d88a).

   One scrollbar: '.monitor-dashboard-panel' used to be sticky with
   'max-height: calc(100vh - 32px); overflow-y: auto' (the side-column recipe
   above), a second scrolling region inside the page that hid every widget
   below the fold. It is now ordinary flow, so only the page scrolls. What can
   be larger than its card is the widget's content, and that scrolls inside
   the card ('.monitor-widget-body').

   Page width: while a monitor is open ('.monitors-open', set in
   'render_console_monitors_tab') the list and the monitor stack in one column
   instead of 2fr / 3fr, so the monitor takes the whole content width and
   '.widget-grid' flows its cards across it. The selectors repeat the two
   regimes of the '.monitors-columns' rules above (WIDE UI MODE rule 9) and
   out-specify them with the second class. Below the breakpoint the container
   was never a grid. */
.app-shell:not(.app-narrow) .monitors-columns.monitors-open,
:is(.app-shell.app-wide, .app-shell.app-full) .monitors-columns.monitors-open {
  grid-template-columns: minmax(0, 1fr);
}

.monitor-widget-body {
  max-height: min(70vh, 560px);
  overflow: auto;
  min-width: 0;
}

/* Monitors: the three ledger widgets, Shortfalls, Unspent and Claims queue
   (projectz feature cdc5f157). They borrow the pages' tables
   ('.shortfall-table', '.unspent-table', '.claims-queue-table'), whose fixed
   layout, 'min-width' (900 / 1080px) and 'nth-child' widths are set for a
   full-span page panel. In a widget cell (514px in the two-column grid at
   1400px) that hid the figures the widgets exist for behind a sideways
   scroll, and the widgets' leading view-bucket column shifted every
   'nth-child' width by one, so the zoom button (a 1% column of a fixed
   layout) was painted over the start of each bucket name.

   So in a widget the tables size to their content and to the cell, and
   below a width of the widget's own (a container query, not the viewport:
   the same widget is 514px wide in the grid and the whole field alone)
   each row stacks: the button and the bucket name on one line, then one
   line per figure, labelled from the cell's 'data-label'. The header row
   is then visually hidden (still read by a screen reader). Nothing here
   differs between the layout regimes (WIDE UI MODE rule 9: the container,
   not '.app-wide', decides), and every colour is a token. */
.widget-ledger {
  container: widget-ledger / inline-size;
}

.widget-ledger .widget-ledger-table.shortfall-table {
  table-layout: auto;
  min-width: 0;
}

.widget-ledger .widget-ledger-table.shortfall-table th {
  width: auto;
}

.widget-ledger .widget-ledger-table .widget-bucket-menu-cell {
  width: 1%;
  white-space: nowrap;
}

.widget-ledger .widget-ledger-table .wl-name {
  overflow-wrap: anywhere;
}

.widget-ledger .widget-ledger-table .shortfall-bar-cell {
  width: 64px;
  min-width: 48px;
}

.widget-ledger .widget-ledger-table td.shortfall-num {
  white-space: nowrap;
}

.widget-ledger .claims-queue-table th:first-child {
  width: 3.5em;
}

.widget-ledger .claims-queue-table .wl-block {
  min-width: 10em;
}

/* Below 720px of widget the rows stack, all three alike so that the
   widgets of one grid read the same way. 720px is about what Unspent needs
   as a table (up to seven figures and the bar beside a bucket name);
   Shortfalls would fit narrower, but one rule keeps a grid of mixed
   widgets consistent. */
@container widget-ledger (max-width: 720px) {
  .widget-ledger-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .widget-ledger .widget-ledger-table,
  .widget-ledger .widget-ledger-table tbody {
    display: block;
    min-width: 0;
  }
  .widget-ledger .widget-ledger-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
    /* The right gap keeps the figures off the body's scrollbar. */
    padding: 8px 6px 8px 0;
    border-bottom: 1px solid var(--border);
  }
  .widget-ledger .widget-ledger-table td {
    display: block;
    border-bottom: 0;
    padding: 1px 0;
  }
  /* The head line: the view-bucket button (or a queue place) and the name. */
  .widget-ledger .widget-ledger-table .widget-bucket-menu-cell,
  .widget-ledger .widget-ledger-table .wl-lead {
    flex: 0 0 auto;
    width: auto;
  }
  .widget-ledger .widget-ledger-table .wl-name {
    flex: 1 1 0;
    min-width: 0;
    font-weight: 600;
  }
  .widget-ledger .widget-ledger-table .wl-name .unspent-sub {
    font-weight: normal;
  }
  .widget-ledger .claims-queue-table .wl-place::before {
    content: "#";
  }
  /* One line per figure: its label on the left, the figure on the right,
     a second line of the cell ('.unspent-sub') under the figure. */
  .widget-ledger .widget-ledger-table td[data-label] {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    text-align: right;
  }
  .widget-ledger .widget-ledger-table td[data-label]::before {
    content: attr(data-label);
    grid-row: 1 / span 4;
    text-align: left;
    color: var(--text-muted);
    overflow-wrap: anywhere;
  }
  /* Prose cells (the claims queue's targets and reason) read under their
     label, left-aligned, at the full width. */
  .widget-ledger .widget-ledger-table td.wl-block {
    display: block;
    text-align: left;
    min-width: 0;
  }
  .widget-ledger .widget-ledger-table td.wl-block::before {
    display: block;
    font-size: 11px;
    font-family: var(--mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  /* The bar spans the card under the figures it compares. */
  .widget-ledger .widget-ledger-table td.wl-bar {
    flex: 1 1 100%;
    width: auto;
    min-width: 0;
    padding-top: 4px;
  }
  .widget-ledger .widget-ledger-table td.wl-bar:empty {
    display: none;
  }
}

/* Treemap legend (projectz feature 97f33264). The chart is a canvas and
   takes its colours from these same tokens at render time; the swatches are
   the brand token at the opacities the tiles use, so legend and tiles agree
   in both themes. max-width keeps the sentences from smearing at 1400px. */
.treemap-legend {
  max-width: 420px;
  margin-top: 4px;
}
.treemap-legend p {
  margin: 2px 0;
  font-size: 12px;
}
.treemap-swatches {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.treemap-swatch {
  display: inline-block;
  width: 22px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: var(--brand);
}

/* Treemap status and navigation (projectz feature cac6fe5f). The chart is a
   canvas; these style what sits under it. max-width keeps the sentences and
   the list from smearing at 1400px. */
.treemap-gestures {
  max-width: 420px;
  margin: 4px 0;
  font-size: 12px;
}
.treemap-tiles {
  max-width: 420px;
  margin-top: 4px;
  font-size: 12px;
}
.treemap-tile-list {
  list-style: none;
  margin: 4px 0;
  padding: 0;
}
.treemap-tile-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border-top: 1px solid var(--border);
}
.treemap-status {
  border: 2px solid var(--text);
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 600;
}

/* Template box of the widget form (projectz feature a1f43de1): the example
   button, or its "replace what you typed?" question, sits under the box. */
.template-editor .template-example-row {
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}
.template-editor textarea.text-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Dimension table widget (projectz feature 185620f2): a total line, and
   a visually hidden label for a column that holds only icon buttons. */
.dimension-table tfoot td {
  font-weight: 600;
  border-top: 2px solid var(--border);
}
.dimension-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Monitors: a widget's delete is told apart from Edit and Duplicate, and its
   undo line sits above the widgets (projectz feature 84b22d57). */
.monitor-widget-card .widget-delete {
  margin-left: 6px;
  color: var(--danger);
}
/* Projectz feature efeeca3b: the editor's controls (move, Edit, Duplicate,
   Delete) keep to one row in a half-width card at the middle widths, where
   the card is about 260px: tighter buttons than '.btn-sm' and a smaller gap.
   The Move or copy select, when there is another monitor, takes the next
   row there. */
.monitor-widget-card > .form-row {
  flex-wrap: wrap;
  align-items: center;
  column-gap: 6px;
}
.monitor-widget-card > .form-row > .btn-sm {
  padding: 5px 6px;
}
.monitor-widget-card > .form-row .section-title {
  flex: 1 1 100%;
}
.monitor-widget-card .widget-transfer {
  /* After Delete, so that where the row wraps only the select goes down. */
  order: 1;
  max-width: 14em;
  margin-left: 4px;
  font-size: 13px;
}
.widget-deleted-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Elastic plan (projectz feature 4b8183b4). The upgrade panel replaces a free
   tenant's row, so it keeps the row's shell; its prose is capped like every
   other paragraph (WIDE UI MODE rule 3) and its form controls stay in the
   column. The terms of a metered tenant are one line of prose on its row, and
   a metered line on Account > Tenant slots lists its facts as .slot-period
   spans in a wrapping row. */
.upgrade-panel .tenant-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 72ch;
}
.upgrade-panel .ruled-kv-list {
  max-width: 48ch;
  width: 100%;
}
/* The currency picker only: a 12ch cap on every select of the panel cut the
   billing form's "Billed as" to "A comp". */
.upgrade-panel .upgrade-currency-select {
  max-width: 12ch;
}
.upgrade-lead {
  margin: 0;
  font-weight: 600;
}
.tenant-terms {
  color: var(--text-muted);
}
.slot-terms {
  margin-top: 4px;
}

/* Elastic plan, usage view: this period so far (Account > Tenant slots).
   The table scrolls inside its '.table-scroll' card at 500px; a bar never
   carries the figure alone, the text beside it does. */
.metered-usage {
  margin-top: 16px;
}
.metered-usage-table th,
.metered-usage-table td {
  white-space: nowrap;
}
.metered-usage-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.metered-usage-deleted td {
  color: var(--text-muted);
}
.metered-usage-total td {
  font-weight: 600;
}
.metered-cap {
  max-width: 480px;
  margin-top: 8px;
}
.metered-cap-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.metered-cap-fill {
  height: 100%;
  background: var(--brand);
}
.metered-cap-fill-projected {
  background: var(--text-muted);
}
/* Default monitor, "consumed this period" (projectz feature 07fd05c9): the
   headline over a '.metered-cap' bar, then one row per bucket, its name and
   a '.spend-counter' bar scaled to the allocation. The track keeps the
   spend counter's max-width, so a row does not smear in the wide layout. */
.default-period-headline {
  margin: 4px 0 0;
}
.default-period-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.default-period-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  padding: 2px 0;
}
.default-period-list .spend-counter {
  flex: 1 1 220px;
  flex-wrap: nowrap;
}
.default-period-name {
  min-width: 12ch;
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.metered-spend-cap {
  margin-top: 16px;
}
/* Intent links (projectz feature e233ab04, Main.Render.Intent): why the
   person was sent here, and the way back, at the top of the block the
   landing scrolls to. Accent edge like .wk-notifier-note; capped so it does
   not smear at the wide widths. Theme tokens only. */
.intent-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 720px;
  padding: 8px 12px;
  margin: 8px 0 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
}
.intent-strip-reason {
  margin: 0;
  flex: 1 1 24ch;
}
/* The tenant's line of the usage table a "See the usage table" link lands
   on (projectz feature 3070e70e): the strip's accent edge on its first
   cell, and a tint on the row. */
.metered-usage-table tr.metered-usage-landed > td {
  background: var(--bg);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}
.metered-usage-table tr.metered-usage-landed > td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}
/* A landing scrolls its block to the top: leave the strip some air. */
#metered-usage,
#firehose-landing {
  scroll-margin-top: 16px;
}
/* Console > Firehose's strip sits above the ruled block, as a block of
   its own under the masthead. */
.firehose-intent .intent-strip {
  margin: 0 0 12px;
}
/* Console > Buckets (and Monitors) at the buckets limit: the bucket
   deletion policy form under the marker, as on Status (projectz feature
   3070e70e). */
.buckets-archived-retention {
  max-width: 720px;
  margin: 0 0 16px;
}
.spend-cap-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}
/* Starter beside the spend cap control: a quiet block under the preview,
   hairline above, same text role as the hint lines. Theme tokens only. */
.spend-cap-flat {
  margin: 8px 0;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  max-width: 60ch;
}
.spend-cap-flat .hint-text {
  margin: 2px 0;
}
/* The button under a refused bucket create or split (raise the cap, pay the
   invoice). Sits in the error block; no width of its own. */
.bucket-refusal-action {
  margin-top: 6px;
}
/* The spend cap field in place (projectz feature 5998b10f,
   Main.Render.SpendCap): under a refused create or split, and under the
   buckets limit markers on Buckets, Monitors and Status. A quiet card in
   the page's own text colour (it may sit inside .error-text), capped so the
   row does not smear at the wide widths. Theme tokens only. */
.spend-cap-inline {
  max-width: 720px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: normal;
}
.bucket-refusal-action .spend-cap-inline {
  margin: 6px 0 0;
}
.spend-cap-inline-lede {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}
.spend-cap-inline .hint-text {
  margin: 4px 0;
}
.spend-cap-inline .text-input {
  min-width: 0;
  flex: 1 1 8rem;
}
.tenant-usage-line {
  color: var(--text-muted);
}

/* Elastic usage block: each cap label sits with its own bar, and the
   explanations are disclosures under the table and the panel's limits. */
.metered-cap-row {
  margin-top: 10px;
}
.metered-cap-row .hint-text {
  margin: 0 0 4px;
}
.metered-days-explained,
.upgrade-more {
  margin: 8px 0;
}
.metered-usage-table th[title],
.metered-usage-table td[title] {
  cursor: help;
}

/* Elastic usage block, growth chart: the daily bucket counts of the period.
   The drawing is strokes only, stretched to '.metered-growth-plot' (strokes
   are non-scaling), so the labels are page text around it and keep their
   size at every width. Width is capped: a chart is a full-width control
   (WIDE UI MODE). Theme tokens only; the tenants differ by dash, not hue. */
.metered-growth {
  max-width: 640px;
  margin: 12px 0;
}
/* The left gutter holds the two figures of the vertical axis, so that they
   never sit on the first day's point; the day axis below has the same. */
.metered-growth-plot {
  position: relative;
  height: 160px;
  margin-top: 18px;
  padding-left: 48px;
}
/* Sits on its line, at the right; the margin above the plot is its room
   when the cap is the top of the axis. */
.metered-growth-cap-label {
  position: absolute;
  right: 0;
  transform: translateY(-100%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--danger);
  white-space: nowrap;
}
.metered-growth-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.metered-growth-svg line,
.metered-growth-svg path,
.metered-growth-key line {
  vector-effect: non-scaling-stroke;
  fill: none;
}
.metered-growth-base {
  stroke: var(--border);
  stroke-width: 1;
}
.metered-growth-now {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.metered-growth-line {
  stroke-linecap: round;
  stroke-linejoin: round;
}
.metered-growth-total {
  stroke: var(--brand);
  stroke-width: 2.5;
}
.metered-growth-tenant {
  stroke: var(--text-muted);
  stroke-width: 1.5;
}
.metered-growth-tenant-0 {
  stroke-dasharray: 5 4;
}
.metered-growth-tenant-1 {
  stroke-dasharray: 1 4;
}
.metered-growth-tenant-2 {
  stroke-dasharray: 8 3 1 3;
}
.metered-growth-svg .metered-growth-dot {
  stroke-width: 6;
  stroke-dasharray: none;
}
.metered-growth-cap {
  stroke: var(--danger);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}
.metered-growth-top,
.metered-growth-zero {
  position: absolute;
  left: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  width: 42px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.metered-growth-top {
  top: 0;
}
.metered-growth-zero {
  bottom: 0;
}
.metered-growth-axis {
  position: relative;
  margin-left: 48px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.metered-growth-today {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}
.metered-growth-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: none;
  margin: 8px 0;
  padding: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.metered-growth-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.metered-growth-key {
  width: 24px;
  height: 8px;
  flex: none;
}

/* Your tenants: the filter field (projectz feature f54cfb07). Capped like
   .docs-search-input so it never smears across a 1280px column. */
.tenant-filter { margin: 12px 0; }
.tenant-filter-row { display: flex; gap: 8px; align-items: center; }
.tenant-filter-input { flex: 1 1 auto; width: 100%; max-width: 420px; min-width: 0; }
.tenant-filter-count, .tenant-filter-none { margin: 6px 0 0; }

/* A one-time key panel's "Dismiss anyway?" question
   ('Main.Render.render_key_dismiss', projectz feature 2457d19c). It sits
   under the panel, where the Dismiss button was; the prose keeps its
   measure in the wide layout. */
.key-dismiss-confirm p {
  margin: 0 0 10px;
  max-width: 65ch;
  font-weight: 600;
}
.key-dismiss-confirm .form-row {
  flex-wrap: wrap;
  margin-bottom: 0;
}

/* Firehose's "Listen from the CLI" (feature d7d83bd1): the command takes the
   whole row and scrolls inside itself; the buttons wrap under it, so a phone
   width never scrolls the page sideways. */
.firehose-cli {
  margin-top: 8px;
}
.firehose-cli > summary {
  cursor: pointer;
}
.firehose-cli .reveal-key-row {
  flex-wrap: wrap;
  margin: 8px 0;
}
.firehose-cli .reveal-key {
  flex: 1 1 100%;
  min-width: 0;
}

/* Forwarder message editor (projectz feature 3055cb84): the template box,
   the live likeness of the Slack / Discord / PagerDuty message, and the
   notifier's exact body. Capped like the rest of the form, so the wide
   layouts do not stretch a message across 1280px. */
.fwd-template,
.ruled-panel .integration-form .form-row > textarea.fwd-template {
  width: 100%;
  max-width: 760px;
  box-sizing: border-box;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
}
.fwd-likeness {
  max-width: 560px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  margin: 8px 0;
}
.fwd-likeness-caption {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}
.fwd-notif {
  margin: 0 0 8px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.fwd-dim {
  color: var(--text-muted);
}
.fwd-title {
  font-weight: 700;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}
.fwd-linked {
  color: var(--brand);
}
.fwd-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 6px;
}
.fwd-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px 12px;
  margin: 6px 0;
}
.fwd-field-name {
  font-weight: 600;
  font-size: 12px;
}
.fwd-field-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.fwd-links,
.fwd-link-list {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 0;
}
.fwd-link-list {
  padding-left: 18px;
}
.fwd-discord {
  border-left: 4px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  padding: 8px 12px;
}
.fwd-pagerduty .fwd-title {
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
}
.fwd-severity {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 1px 6px;
  border: 1px solid var(--border);
}
.fwd-severity-critical,
.fwd-severity-error {
  color: var(--danger);
  background: var(--danger-bg);
}
.fwd-severity-warning {
  color: var(--warn-text);
  background: var(--warn-bg);
}
.fwd-exact {
  max-width: 760px;
  max-height: 360px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 6px 0;
}
.fwd-preview-error {
  max-width: 760px;
}

/* ===== ATTRIBUTION MAPS (projectz feature 1ffed036) =====
   The Prices panel under Monitors (map list and editor) and a widget drawn
   in a map's unit. The rules table scrolls inside its '.table-scroll' at
   500px; its inputs keep a floor width so a rate stays readable. Every
   control here has a max-width or sits in a grid cell (WIDE UI MODE). */
.attribution-table td.num,
.attribution-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.attribution-rules { min-width: 900px; }
.attribution-rules td { padding: 4px 6px; }
.attribution-rules .text-input { width: 100%; min-width: 80px; }
.attribution-rules .attribution-cell-match { min-width: 160px; }
.attribution-rules .attribution-cell-dim { min-width: 140px; }
.attribution-rules .attribution-cell-day { min-width: 112px; }
.attribution-rule-flagged td { background: rgba(200, 40, 40, 0.10); }
.attribution-head-fields { flex-wrap: wrap; gap: 12px; }
.attribution-head-fields .form-field { flex: 1 1 160px; max-width: 320px; }
.attribution-errors { max-width: 720px; }
.attribution-actions { gap: 8px; flex-wrap: wrap; }
.attribution-row-actions { white-space: nowrap; text-align: right; }
.attribution-row-actions .btn + .btn { margin-left: 6px; }
.attribution-total { font-size: 1.05rem; margin: 6px 0; }
.attribution-amount { font-family: var(--display); font-size: 1.8rem; font-weight: 700; }
.attribution-total-row td { font-weight: 600; border-top: 1px solid var(--border); }
.attribution-unit-fields { margin-top: 8px; }
.attribution-unit-fields .form-row { flex-wrap: wrap; gap: 8px; align-items: center; }
.attribution-unit-fields select.text-input,
.attribution-unit-fields input.text-input { max-width: 280px; }

/* Monitor snapshots (projectz feature 597bae48, specs/monitor-snapshots.md).
   The drawer sits in the open monitor's card, under its header; a snapshot
   being viewed or compared replaces the widget grid in the same card. Every
   colour is a token. Full-width controls are capped (WIDE UI MODE rule):
   the label input stops at 32rem, and the two sides of a comparison are a
   grid that stacks by itself below two 280px columns, at any width. */
.snapshot-drawer {
  margin: 4px 0 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.snapshot-take-row {
  flex-wrap: wrap;
  gap: 8px;
}
.snapshot-label-input {
  flex: 1 1 16rem;
  min-width: 0;
  max-width: 32rem;
}
.snapshot-usage {
  margin: 4px 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.snapshot-usage-full {
  padding: 6px 10px;
  color: var(--warn-text);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
}
.snapshot-notice {
  margin: 6px 0;
  font-size: 0.9rem;
  color: var(--success);
}
.snapshot-list {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.snapshot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}
.snapshot-row:first-child {
  border-top: none;
}
.snapshot-row-shown {
  box-shadow: inset 3px 0 0 var(--brand);
}
.snapshot-pick {
  display: flex;
  align-items: center;
}
.snapshot-row-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 12rem;
  min-width: 0;
}
.snapshot-row-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.snapshot-row-text .tenant-sub,
.snapshot-banner .tenant-sub {
  white-space: normal;
  overflow-wrap: anywhere;
}
.snapshot-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.snapshot-confirm-text {
  font-size: 0.85rem;
  color: var(--danger);
}
.snapshot-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
}
.snapshot-banner-text {
  flex: 1 1 18rem;
  min-width: 0;
}
.snapshot-banner-text p {
  margin: 0 0 2px;
}
.snapshot-banner-title {
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.snapshot-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.snapshot-panes {
  margin-bottom: 12px;
}
.snapshot-pair {
  margin-bottom: 12px;
}
.snapshot-pair-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
}
.snapshot-change {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.snapshot-change-source,
.snapshot-change-both,
.snapshot-change-added {
  color: var(--brand-dark);
  border-color: var(--brand);
}
.snapshot-change-data {
  color: var(--warn-text);
  border-color: var(--warn-border);
  background: var(--warn-bg);
}
.snapshot-change-removed {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-bg);
}
.snapshot-sides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.snapshot-side {
  min-width: 0;
}
.snapshot-side-name {
  margin: 4px 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.snapshot-diff {
  margin: 0 0 8px;
  padding: 8px 10px;
  max-height: 24rem;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.45;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.snapshot-diff span {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.snapshot-diff .diff-del,
.snapshot-fields .diff-del {
  color: var(--danger);
  background: var(--danger-bg);
}
.snapshot-diff .diff-ins,
.snapshot-fields .diff-ins {
  color: var(--success);
  background: var(--success-bg);
}
.snapshot-diff .diff-gap {
  color: var(--text-muted);
}
.snapshot-fields {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 28rem;
  overflow: auto;
  font-size: 0.85rem;
}
.snapshot-field {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 3px 6px;
  border-bottom: 1px solid var(--border);
}
.snapshot-field-mark {
  font-family: var(--mono);
  width: 1em;
}
.snapshot-field-path {
  font-family: var(--mono);
  overflow-wrap: anywhere;
}
.snapshot-field-value {
  overflow-wrap: anywhere;
  color: var(--text);
}

/* ===== COLUMNS WIDGET (projectz feature cd60e9c4) =====
   A column family: its editor in the widget form ('Main.Render.Columns')
   and its drawing on a dashboard. The bars are plain boxes (no chart
   library). A tree column is indented by its depth through '--cf-indent',
   set inline on each row. Every control has a max-width or sits in a
   grid cell (WIDE UI MODE); the two tables scroll in their '.table-scroll'. */
.cf-editor .form-row { flex-wrap: wrap; align-items: flex-end; }
.cf-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; max-width: 320px; }
.cf-field-label { font-size: 12px; color: var(--text-muted); }
.cf-field .text-input { max-width: 100%; }
.cf-narrow { max-width: 110px; }
.cf-column-table { min-width: 0; }
.cf-column-table td { vertical-align: middle; }
.cf-column-table .cf-tick { width: 1%; }
.cf-label-input { min-width: 90px; max-width: 280px; padding: 6px 8px; }
.cf-row-buttons { text-align: right; }
.cf-group-row .text-input { max-width: 280px; }
.cf-picker { margin: 8px 0 12px; max-width: 760px; }
.cf-picker summary { cursor: pointer; font-size: 13px; }
.cf-picker-list { list-style: none; margin: 6px 0; padding: 0; max-height: 280px; overflow-y: auto; font-size: 13px; }
.cf-picker-list li { padding: 2px 0; overflow-wrap: anywhere; }
.cf-controls { flex-wrap: wrap; gap: 6px; }
.cf-caption { margin: 4px 0 8px; }
.cf-note { margin: 2px 0; }
.cf-bars { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.cf-bar-row {
  margin: 0 0 10px;
  padding-left: calc(var(--cf-indent, 0) * 16px);
}
.cf-bar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.cf-bar-label { font-family: var(--mono); overflow-wrap: anywhere; min-width: 0; }
.cf-bar-value { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.cf-bar-track { height: 8px; border-radius: 4px; background: var(--border); margin: 3px 0 2px; overflow: hidden; }
.cf-bar-fill { height: 100%; border-radius: 4px; background: var(--brand); }
.cf-bar-sub { font-size: 12px; margin: 0; }
.cf-table td, .cf-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* A series broken down by a key sent with each consume (projectz feature
   bf72f52a): a table whose last column is a share bar, made of the column
   family's track and fill. The value column wraps (a session id can be
   long); the bar keeps a usable width in a narrow widget cell. */
.consume-breakdown-table td.num, .consume-breakdown-table th.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.consume-breakdown-value { font-family: var(--mono); overflow-wrap: anywhere; }
.consume-breakdown-share { width: 40%; min-width: 96px; }
.consume-breakdown-bar { display: flex; align-items: center; gap: 8px; }
.consume-breakdown-bar .cf-bar-track { flex: 1; min-width: 48px; margin: 0; }
.consume-breakdown-pct { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; min-width: 3.5em; text-align: right; }
/* A family over time (projectz feature c9c6ca05): a line chart, then one
   toggle per column. The toggles are the legend: a drawn column's swatch
   has its line's colour (set inline), a hidden one is an empty ring. They
   wrap, so fifty columns are rows of chips, never a wide strip. */
.cf-chart { max-width: 1100px; }
.cf-chart-empty { margin: 24px 0; }
.cf-toggle-caption { margin: 6px 0 4px; }
.cf-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-toggle {
  display: inline-flex; align-items: center; gap: 6px; max-width: 260px;
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-muted); font: inherit; font-size: 12px;
  cursor: pointer;
}
.cf-toggle-on { color: var(--text); border-color: var(--text-muted); }
.cf-toggle:disabled { cursor: not-allowed; opacity: 0.5; }
.cf-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.cf-swatch {
  flex: none; width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--text-muted); box-sizing: border-box;
}
.cf-toggle-on .cf-swatch { border-color: transparent; }
.cf-toggle-label { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ── PACING (projectz feature fc78f497) ─────────────────────────────────
   The Monitors pacing widget, inline
   SVG drawn by Main.Render.Pacing. Every colour is a token, so both themes
   and every palette follow. Strokes do not scale with the viewBox
   (vector-effect on each polyline), so a chart drawn 300px or 1200px wide
   keeps its line weights. */
.wk-svg .wk-line { fill: none; stroke: var(--brand); stroke-width: 3; }
.wk-svg .wk-dash { fill: none; stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.wk-svg .wk-dash-warn { stroke: var(--danger); }

.pace-spark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  font-size: 0.8em;
  color: var(--text-muted);
}
.pace-spark-svg { flex: none; width: 120px; height: 28px; }
.pace-spark-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pace-spark-dry .pace-spark-label { color: var(--danger); font-weight: 600; }

.pace-remaining, .pace-even, .pace-projection, .pace-floor, .pace-class, .pace-reset,
.pace-grid, .pace-axis-line, .pace-previous { fill: none; }
/* projectz feature 7804ad3c: the period before, moved to start where this
   one starts; the same hue as remaining, faded, so it reads as "that line,
   last time". */
.pace-previous { stroke: var(--brand); stroke-width: 2; stroke-opacity: 0.35; stroke-dasharray: 10 3; }
.pace-remaining { stroke: var(--brand); stroke-width: 2; }
.pace-remaining-thick { stroke-width: 3; }
.pace-even { stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 6 4; }
.pace-projection { stroke: var(--danger); stroke-width: 2; stroke-dasharray: 6 4; }
.pace-floor { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 2 3; }
.pace-class { stroke-width: 1.25; }
.pace-class-0 { stroke: var(--success); }
.pace-class-1 { stroke: var(--warn-text); stroke-dasharray: 8 2; }
.pace-class-2 { stroke: var(--brand-dark); stroke-dasharray: 3 2; }
.pace-class-3 { stroke: var(--text-muted); stroke-dasharray: 1 2; }
.pace-reset { stroke: var(--success); stroke-width: 1.5; stroke-dasharray: 4 3; }
.pace-grid { stroke: var(--border); stroke-width: 1; }
.pace-axis-line { stroke: var(--text-muted); stroke-width: 1; }
.pace-axis, .pace-floor-label, .pace-reset-label { font-family: var(--sans); font-size: 12px; fill: var(--text-muted); }
.pace-floor-label { fill: var(--text); }
.pace-reset-label { fill: var(--success); }
.pace-dot-now { fill: var(--brand); }
.pace-dot-empty { fill: var(--danger); }
.pace-dot-floor { fill: var(--text); }

.pace-widget { display: flex; flex-direction: column; gap: 12px; }
.pace-chart { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pace-chart + .pace-chart { border-top: 1px solid var(--border); padding-top: 12px; }
/* Projectz feature efeeca3b: in a widget card wide enough (its body is a
   size container on the grid), the charts go two to a row, so that a
   full-width pacing widget shows four buckets in the height of two. */
@container (min-width: 760px) {
  .pace-widget { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .pace-widget > :not(.pace-chart) { grid-column: 1 / -1; }
  .pace-chart + .pace-chart { border-top: none; padding-top: 0; }
}
.pace-chart-title { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pace-chart-title .muted { font-weight: 400; }
.pace-chart-svg { width: 100%; max-width: 760px; height: auto; }
.pace-callout {
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}
.pace-callout-dry { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.pace-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85em;
  color: var(--text-muted);
}
.pace-legend li { display: inline-flex; align-items: center; gap: 6px; }
/* projectz feature 7804ad3c: the period controls above the charts; they
   wrap under each other at narrow widths. */
.pace-period-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pace-period-nav .pace-period-label { font-size: 0.9em; color: var(--text-muted); }
.pace-period-nav label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9em; }
.pace-compare { margin: 0; font-size: 0.9em; color: var(--text-muted); overflow-wrap: anywhere; }
.pace-key { width: 24px; height: 8px; flex: none; }

/* Projectz feature 51ced343: the credit notes under an invoice's download.
   Documents only; one short line each, wrapping at narrow widths. */
.credit-notes {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.credit-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  max-width: 100%;
}

/* Projectz feature 4cbd5dfb: an invoice's mentions (the no-tax reason, the
   late-payment terms) as the admin wrote them, line breaks kept. */
.invoice-mention {
  white-space: pre-line;
}

/* Projectz feature 4cbd5dfb: Admin ▸ Billing ▸ Invoice issuer, the status
   line apart from the first field. */
.invoice-issuer-card > .hint-text,
.invoice-issuer-card > .warning-text {
  margin-bottom: 0.75rem;
}

/* Projectz feature b0a8769c: Admin ▸ Billing ▸ Payment webhook. The event
   types fold under a summary; ids and URLs wrap inside the card rather
   than widen it. */
.payment-webhook-intro {
  margin-bottom: 0.75rem;
}

.payment-webhook-card .kv-value {
  overflow-wrap: anywhere;
}

.payment-webhook-events {
  margin: 0.5rem 0;
}

.payment-webhook-event-list {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
  font-family: var(--mono);
  font-size: 12px;
  columns: 2 16rem;
}

/* Admin > Audit trail (projectz feature b564fb1d). The filters keep a
   width of their own in the wide layouts; a row's details wrap inside a
   bounded cell rather than widening the table. */
.audit-filters select {
  max-width: 320px;
}

.audit-table td {
  vertical-align: top;
}

.audit-detail {
  font-size: 12px;
  min-width: 180px;
  max-width: 420px;
  overflow-wrap: anywhere;
}

.audit-key {
  color: var(--text-muted);
  font-family: var(--mono);
}

/* The account in a row is a filter link: no button padding, aligned with
   the cells' text. */
.audit-table .btn-ghost {
  padding: 0;
  text-align: left;
}

/* Monitors: a comment in words on a monitor and on a widget (projectz
   feature 6cfd970f, 'Main.Render.Monitors.Comment'). A tramaj template,
   drawn read-only under the widget's title, under the monitor's name in the
   open monitor's panel, and under the name in the wall bar. It wraps and
   never gets wider than what holds it ('min-width: 0' in a grid or flex
   cell, 'overflow-wrap: anywhere' for a long word or link); there is no
   'width: 100%' or fixed width anywhere here (WIDE UI MODE). */
.monitor-comment {
  min-width: 0;
  max-width: 72ch;
  margin: 2px 0 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.monitor-comment > div > :first-child { margin-top: 0; }
.monitor-comment > div > :last-child { margin-bottom: 0; }

/* Monitors: the up and down buttons that set the order of the monitor list
   (projectz feature c440a89d, 'Main.Render.Monitors.render_monitor_row').
   The pair stays together when the row wraps, and takes only its own
   width (WIDE UI MODE: no width set). */
.monitor-move {
  display: inline-flex;
  gap: 2px;
  flex: 0 0 auto;
}

.monitor-move .btn { min-width: 2rem; }

.monitor-comment .error-text {
  margin: 0;
}

.monitor-comment-add {
  align-self: flex-start;
  margin-bottom: 8px;
}

/* The wall bar's title is a baseline row (name, "3 / 7"); the comment takes
   a line of its own under them, and a long one scrolls inside a few lines
   rather than pushing the sticky bar over the widgets. */
.wall-bar-title {
  flex-wrap: wrap;
}

.wall-bar-title .monitor-comment {
  flex-basis: 100%;
  margin: 0;
  max-height: 4.5em;
  overflow-y: auto;
}

.comment-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin-top: 8px;
}

.comment-field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.comment-field textarea {
  max-width: 72ch;
  resize: vertical;
}

.comment-field-preview {
  min-width: 0;
  padding: 6px 10px;
  border-left: 2px solid var(--border);
}

.comment-field-preview .monitor-comment {
  margin: 4px 0 0;
}

/* ===== TRAMAJ LIBRARIES: bars, dots, reference (projectz feature be87e498) =====
   What buckette/consumption-bars and buckette/status-dot draw inside a
   Template widget, and the editor's "Libraries you can import" list. The
   libraries emit these class names only (and a bar's width as an inline
   style); the colours are tokens here, so they follow the theme. A row is
   a three-cell grid that drops the figure under the bar on a narrow
   column instead of squeezing the track to nothing. */
.tl-bars {
  display: grid;
  grid-template-columns: minmax(6em, 12em) minmax(80px, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  max-width: 720px;
}

/* The rows share the list's columns, so every track starts and ends at
   the same place whatever the length of a name or a figure. */
.tl-bars-row {
  display: contents;
}

.tl-bars-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-bar-track {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: var(--border);
  overflow: hidden;
}

.tl-bar-track-none {
  background: repeating-linear-gradient(135deg, var(--border) 0 4px, transparent 4px 8px);
}

.tl-bar-fill {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--success);
}

.tl-bar-fill.tl-bar-mid {
  background: #d97706;
}

.tl-bar-fill.tl-bar-high {
  background: var(--danger);
}

.tl-bars-figure {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.9em;
  white-space: nowrap;
}

.tl-bars-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  margin: 0;
}

@media (max-width: 560px) {
  .tl-bars {
    grid-template-columns: minmax(5em, 9em) 1fr;
    row-gap: 2px;
  }
  .tl-bars-figure {
    grid-column: 2;
    margin-bottom: 6px;
  }
}

.tl-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tl-dot-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--text-muted);
}

.tl-dot-green .tl-dot-mark { background: var(--success); }
.tl-dot-amber .tl-dot-mark { background: #d97706; }
.tl-dot-red .tl-dot-mark { background: var(--danger); }
.tl-dot-grey .tl-dot-mark { background: var(--text-muted); }

.tl-dot-unknown .tl-dot-mark {
  background: transparent;
  border: 2px dashed var(--danger);
  width: 8px;
  height: 8px;
}

.template-action-warning {
  margin: 6px 0;
}

.template-library-list {
  margin: 6px 0 0;
}

.template-library-list dt {
  margin-top: 10px;
}

.template-library-list dd {
  margin: 2px 0 0 0;
}

.template-library-list dd p,
.template-library-params {
  margin: 2px 0;
}

.template-library-params {
  padding-left: 1.2em;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== TRAMAJ LIBRARIES: garden (projectz feature f7885d88) =====
   What buckette/garden draws: a timeline of where time went, lanes by
   kind of work, a log time axis from ten years ago (left) to now (right),
   one glyph per bucket at its last activity, sized by hours, with a tail
   back to when it began. The library emits class names and, inline, a
   left position in percent, a tail's left and width, and a glyph's width,
   height and the negative margin (half its size) that centres it on its
   x, on the side its label is not. Colours are six lane
   tokens, assigned by the lane's rank; the glyph's shape follows the same
   rank (circle, diamond, square, then again). Items of a lane sit on
   three staggered rows, from the library, so neighbours overlap less.
   The body keeps a right margin wide enough for the glyph at "now" and a
   left one for the "10 years" tick. */
.tl-garden {
  display: block;
  max-width: 1100px;
  --tl-garden-look: #e3b22b;
}

.tl-garden-c0 { --lane: #d9487f; }
.tl-garden-c1 { --lane: #4a74d9; }
.tl-garden-c2 { --lane: #c0901a; }
.tl-garden-c3 { --lane: #2d9a6e; }
.tl-garden-c4 { --lane: #8a5ad6; }
.tl-garden-c5 { --lane: #df6b3c; }

.tl-garden-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0 0 10px;
}

.tl-garden-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  white-space: nowrap;
}

.tl-garden-chip-meta {
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tl-garden-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lane, var(--text-muted));
  flex: none;
}

/* The axis and every lane body share the same margins, so a tick and the
   grid line under it are the one vertical. */
.tl-garden-axis,
.tl-garden-lane-body {
  position: relative;
  margin: 0 30px 0 32px;
}

.tl-garden-axis {
  height: 1.6em;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.tl-garden-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.tl-garden-lane {
  display: grid;
  grid-template-columns: 7em minmax(0, 1fr);
  gap: 4px 8px;
  margin: 6px 0;
  padding: 8px 6px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.tl-garden-lane-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--lane);
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-garden-lane-body {
  height: 96px;
}

.tl-garden-grid {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed var(--border);
}

/* The three rows: an item and its tail carry the same row class. */
.tl-garden-row-0 { top: 18%; }
.tl-garden-row-1 { top: 50%; }
.tl-garden-row-2 { top: 82%; }

.tl-garden-tail {
  position: absolute;
  height: 3px;
  border-radius: 2px;
  background: var(--lane);
  opacity: 0.3;
  transform: translateY(-50%);
}

.tl-garden-item {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translateY(-50%);
  white-space: nowrap;
  line-height: 1;
}

/* Past 72 % of the axis the label goes to the glyph's left, so the names
   of this week's work do not run off the right edge. */
.tl-garden-item.tl-garden-flip {
  flex-direction: row-reverse;
  transform: translate(-100%, -50%);
}

.tl-garden-glyph {
  flex: none;
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--lane);
  box-shadow: 0 0 0 2px var(--surface);
  cursor: pointer;
}

.tl-garden-c1 .tl-garden-glyph,
.tl-garden-c4 .tl-garden-glyph {
  border-radius: 18%;
  transform: rotate(45deg) scale(0.85);
}

.tl-garden-c2 .tl-garden-glyph,
.tl-garden-c5 .tl-garden-glyph {
  border-radius: 22%;
}

/* Under an hour: hollow. To finish: an inner ring. Worth a look: a gold
   ring around, drawn by a pseudo-element so a rotated glyph keeps it. */
.tl-garden-glyph.tl-garden-hollow {
  background: var(--surface);
  box-shadow: inset 0 0 0 2.5px var(--lane), 0 0 0 2px var(--surface);
}

.tl-garden-glyph.tl-garden-finish {
  background-image: radial-gradient(circle, var(--surface) 0 26%, transparent 29%);
}

.tl-garden-glyph.tl-garden-look::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2.5px solid var(--tl-garden-look);
  border-radius: inherit;
  pointer-events: none;
}

.tl-garden-label {
  font-size: 12px;
  color: var(--text);
  text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface);
}

.tl-garden-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.tl-garden-legend-lane {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
}

.tl-garden-empty {
  color: var(--text-muted);
  margin: 0;
}

/* Under 900px the lane's name goes above its body: a 7em column would
   take a quarter of the axis away from the glyphs. */
@media (max-width: 900px) {
  .tl-garden-lane {
    grid-template-columns: minmax(0, 1fr);
    padding: 6px 4px 8px 8px;
  }
  .tl-garden-lane-name {
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  .tl-garden-axis,
  .tl-garden-lane-body {
    margin: 0 22px 0 18px;
  }
  .tl-garden-axis {
    font-size: 10px;
  }
  .tl-garden-label {
    font-size: 11px;
    max-width: 9em;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* projectz feature 1a79ad71: the control-plane URL under a new key. */
.reveal-endpoint {
  margin: 12px 0;
}
.reveal-endpoint .reveal-key-row {
  margin: 6px 0;
}
.reveal-endpoint .reveal-key {
  min-width: 0;
  max-width: 100%;
}
.reveal-endpoint .tenant-sub {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

/* Projectz feature f8cfcbf6: the terms of service and the payment terms
   (Main.Render.Legal). The page is a reading column, capped like prose
   rather than stretched to the shell's width (WIDE UI MODE). The accept box
   aligns its checkbox with the first line of a sentence that wraps. */
.legal-page {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}
.legal-page .legal-title { font-size: 26px; margin: 8px 0 12px; }
.legal-page .legal-heading { font-size: 18px; margin: 24px 0 8px; }
.legal-page ul { padding-left: 22px; }
.legal-links { margin-top: 20px; }
.checkbox-row.terms-accept {
  align-items: flex-start;
  text-align: left;
  max-width: 640px;
}
.checkbox-row.terms-accept input { margin-top: 3px; flex: none; }
.purchase-terms { margin: 12px 0; max-width: 640px; }
/* Projectz feature 9eb8a87f: an account set up before the current terms
   were published is asked to accept them above every page, like the
   impersonation banner (Main.Render.Legal.render_terms_banner). Reading
   width, not the shell's (WIDE UI MODE): the text is a sentence, and the
   box and its button sit under it. */
.terms-banner {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  color: var(--warn-text);
  font-size: 14px;
  line-height: 1.5;
}
.terms-banner > p { margin: 0 0 8px; max-width: 760px; }
.terms-banner .terms-banner-head { font-weight: 600; }
.terms-banner .checkbox-row.terms-accept { margin-bottom: 8px; }

/* Projectz feature a0d05d6b: Admin > Tax coverage (Main.Render.Admin.TaxCoverage).
   The tables sit in '.table-scroll', so a narrow window scrolls them
   sideways instead of squeezing the matrix's cells; the matrix's two kind
   columns share the width the country column leaves (WIDE UI MODE: a cell
   is a grid cell of the table, nothing in it is 'width: 100%'). Colours are
   tokens only, so the dark theme follows. */
.tax-rules ul { margin: 4px 0 0; padding-left: 20px; font-size: 13px; }
.tax-rules li { margin: 2px 0; }
.tax-table td { vertical-align: top; }
.tax-matrix th:first-child,
.tax-matrix td:first-child { width: 22%; min-width: 120px; }
.tax-matrix td.tax-cell { min-width: 200px; }
.tax-region-row td:first-child { padding-left: 24px; color: var(--text-muted); }
.tax-cell-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Projectz feature 58fcd496: the VIES failure mode card and the unconfirmed
   invoices, on Admin > Tax coverage. The radios stack; the table gets the
   data-table rules. */
.vies-mode-choices { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; max-width: 760px; }
.vies-mode-choice { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.vies-mode-choice input { margin-top: 4px; flex: 0 0 auto; }
.vat-unconfirmed-table { width: 100%; max-width: 100%; }
/* Projectz feature 082a3177: the "Billed as" select is a two-word choice,
   not a full-width field (WIDE UI MODE: a control gets a max-width), and
   the word on individuals sits right under it, with the interest request. */
.billing-kind-select, .billing-language-select { max-width: 260px; }
.billing-individual-choice { margin-top: 6px; max-width: 640px; }
.billing-individual-choice .warning-text { margin: 0 0 4px; }
.purchase-vat-refusal { margin: 8px 0; }
.purchase-cart-tax { margin-top: 4px; max-width: 640px; }
.tax-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg);
}
.tax-badge-ok { color: var(--success); background: var(--success-bg); border-color: transparent; }
.tax-cell-regime { font-size: 12px; margin-top: 4px; }
.tax-cell-invoice { font-size: 12px; margin-top: 2px; }
.tax-cell-mismatch { font-size: 12px; margin-top: 2px; color: var(--warn-text); }
.tax-cell .btn.active { border-color: var(--brand); color: var(--brand); }
.tax-vat-number { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.tax-drill-row > td { background: var(--bg); padding: 10px 12px; }
.tax-drill { width: 0; min-width: 100%; }
/* width 0 + min-width 100%: the drill-down takes the row's width without
   adding its own, so its table scrolls inside it instead of widening the
   outer table past the card. */
.tax-table .btn { white-space: nowrap; }
.tax-drill-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tax-drill-title { font-weight: 600; font-size: 13px; }
.tax-drill .saved-keys-table { margin-top: 6px; }

/* Admin > Accounts: the row an admin was sent to from a B2C interest record
   (projectz feature 9010c8a8). Tokens only, so dark mode follows. */
.account-row-pointed {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* The "I'd buy as an individual" request under a consumer's refusal. */
.purchase-b2c-interest {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 480px;
  margin-top: 12px;
}
.purchase-b2c-interest textarea {
  max-width: 100%;
}

/* The full account id beside an account name in the admin lists
   (projectz feature b4f077a3): page text, so find-in-page reaches it, and
   wrapped rather than cut at narrow widths. */
.account-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
  overflow-wrap: anywhere;
  user-select: all;
}

.account-id.account-id-block {
  display: block;
  margin-left: 0;
}

/* Auctions (projectz feature 5ae5aadb): the bid form on a bucket's Auction
   section and a round explained line by line, on the bucket page and in
   Claims > Bids. Lines are a list, not a table: each carries a sentence. */
.auction-bid-form {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 720px;
}
.auction-rounds {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 900px;
}
.auction-round-head {
  margin: 0 0 4px;
  font-size: 14px;
}
.auction-round-head strong {
  font-weight: 600;
}
.auction-round-lines {
  list-style: none;
  margin: 0;
  padding: 0;
}
.auction-line {
  padding: 6px 0 6px 10px;
  border-left: 3px solid var(--border);
  margin-bottom: 4px;
}
.auction-line p {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.auction-line-won,
.auction-line-partial {
  border-left-color: var(--brand);
}

/* Admin ▸ Buckettes ▸ an instance ▸ Usage: a tenant's moves (projectz
   feature c3651e2a), drawn under the tenants table. */
.tenant-moves {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Proposed monitors (projectz feature 8e8ad1f8, specs/monitor-proposals.md).
   A panel above the monitors, at the page's width: one row per proposal
   (its name, the reason given, who proposed it, three buttons), and under
   the row being previewed the proposal's widgets on the dashboard's own
   grid. Every colour is a token. The text column wraps under the buttons
   on a narrow page (the row is a wrapping flex), and the preview keeps the
   grid's own stacking below its breakpoint. */
.proposal-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.proposal-row {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.proposal-row:first-child {
  border-top: none;
}
.proposal-row-shown {
  box-shadow: inset 3px 0 0 var(--brand);
}
.proposal-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.proposal-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 18rem;
  min-width: 0;
}
.proposal-row-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.proposal-row-reason {
  overflow-wrap: anywhere;
}
.proposal-row-text .tenant-sub {
  white-space: normal;
  overflow-wrap: anywhere;
}
.proposal-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.proposal-preview {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

/* Monitors: export and import (projectz feature 56fcc19d). The import
   panel sits in the Monitors list's panel, under its lede; its preview is a
   box like the snapshot drawer, and its width is the panel's, which the
   Monitors column already caps (WIDE UI MODE rule: no bare width: 100%). */
.monitor-import {
  margin: 4px 0 12px;
}
.monitor-import .form-row {
  flex-wrap: wrap;
  align-items: center;
}
.monitor-import input[type="file"] {
  max-width: 100%;
}
.monitor-import-preview {
  margin: 8px 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.monitor-import-list,
.monitor-import-list ul {
  margin: 4px 0;
  padding-left: 18px;
}
.monitor-import-list p {
  margin: 2px 0;
}
.monitor-import-list .is-skipped > p:first-child,
.monitor-import-widget.is-skipped > span {
  color: var(--text-muted);
  text-decoration: line-through;
}
.monitor-import-outcome p {
  margin: 2px 0;
}
.local-monitors-notice {
  border-left: 3px solid var(--brand);
  padding-left: 8px;
}
.wk-unavailable {
  margin: 6px 0 0;
}

/* Console > Keys: a bucket a key is limited to, named by title and linked
   to the bucket (projectz feature 3d6548f5). A button, drawn as a link,
   inside the row's muted sub-line. */
.key-bucket-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.key-bucket-link:hover {
  color: var(--brand-dark);
}

/* Bucket Activity timeline: an activity's own blessed metadata (projectz
   feature 567268da). The icon takes the marker's place at a fixed size;
   the title and summary sit under the event's name. */
.activity-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: -3px;
}
.activity-title,
.activity-link {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.activity-summary {
  overflow-wrap: anywhere;
}

/* A bucket's own templates (projectz feature 3ff05b78): the panel's View
   and the Activity columns its metadata adds. What a template draws is
   the tenant's markup, so the box only bounds it. */
.bucket-template {
  margin: 12px 0;
}
.bucket-template-body {
  max-width: 100%;
  overflow-x: auto;
  overflow-wrap: anywhere;
}
.activity-template-cell {
  max-width: 18rem;
  overflow-wrap: anywhere;
}
.activity-template-error {
  font-size: 0.85em;
}
.metadata-template-input {
  font-family: var(--mono);
  max-width: 40rem;
}

/* Console > Buckets: the Find panel's status select, the count of the
   matching buckets and the action menu beside it (projectz features
   5b245de6, 027565d2). */
.bucket-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bucket-filter select {
  width: auto;
  max-width: 12rem;
}
.bucket-match-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 8px;
}
.bucket-match-count {
  font-weight: 600;
}
/* Console > Buckets over a single bucket: the filters and the bulk menu
   folded under the search box (projectz feature a198ad3a,
   'Main.Render.Console.Buckets.render_find_panel'). */
.bucket-find-fold {
  margin-top: 8px;
}
.bucket-find-fold > summary {
  cursor: pointer;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.bucket-find-fold[open] > summary {
  margin-bottom: 4px;
}
.bucket-match-action {
  width: auto;
  max-width: 100%;
}
.bulk-action-picker,
.bulk-param-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 6px 0;
}
.bulk-action-picker select,
.bulk-param-row select,
.bulk-param-row input.text-input {
  width: auto;
  max-width: 100%;
  min-width: 10rem;
}

/* Overview > Buckets by status: one button per status, the chart's bars
   for a keyboard (projectz feature 4f6e4bbf). */
.status-count-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* Console > Keys: a key's line wraps, so that the titles of the buckets it
   is limited to are read whole (projectz feature 3d6548f5). Both classes,
   to win over '.tenant-sub''s nowrap, as '.tenant-sub.claim-line' does. */
.tenant-sub.key-scope-line {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Console > Keys: the other Console keys, folded (projectz feature
   8e0f8322). */
.console-keys-others > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  margin: 6px 0;
}

/* Bucket > Automatic top-up (projectz feature da7ba174). The table's
   inputs are narrow numbers, so the four columns fit at 500px. */
.topup-how {
  margin: 0 0 10px;
  padding-left: 18px;
}
.topup-facts {
  margin: 4px 0 8px;
  padding-left: 18px;
}
.topup-table input.topup-num {
  width: 6.5rem;
  max-width: 100%;
}
.topup-table select.topup-unit {
  width: auto;
  margin-top: 4px;
}

/* Account > Status (projectz feature da0e8423): one panel per tenant, its
   name and its state on one line. The pills are built from the theme
   tokens, so they follow the dark theme with no override of their own. */
.tenant-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tenant-status-head .ruled-panel-head {
  margin: 0;
  overflow-wrap: anywhere;
}

.health-pill-ok {
  background: var(--success-bg);
  color: var(--success);
}

.health-pill-degraded {
  background: var(--warn-bg);
  color: var(--warn-text);
  box-shadow: inset 0 0 0 1px var(--warn-border);
}

.health-pill-down {
  background: var(--danger-bg);
  color: var(--danger);
}

.tenant-status-row .ruled-kv-value-mono {
  overflow-wrap: anywhere;
}

/* A bid's callback URL (Claims > Bids, a bid's detail), already shortened
   by core: a long host must break rather than widen the fact list. */
.bid-callback-url .ruled-kv-value-mono {
  overflow-wrap: anywhere;
}

/* Admin > Instances > Relief (projectz feature e358ba5f,
   Main.Render.Admin.InstanceRelief): a shared instance's occupancy as a
   bar with two marks (the relief line, the full line), then the proposed
   moves. The bar keeps a max-width so it does not smear in the wide
   layout; every colour is a token. */
/* The instance detail column's tab strip gained a sixth tab (Relief) for
   a shared instance with a bucket capacity; at phone width the strip
   wraps instead of clipping it. Scoped to this column, so the other panel
   tab strips are left as they are (WIDE UI MODE rule 8). */
.instance-details-column .sub-tab-bar {
  flex-wrap: wrap;
}
.relief-occupancy {
  margin: 4px 0 12px;
}
.relief-headline {
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.relief-meter {
  position: relative;
  max-width: 480px;
  height: 10px;
  margin: 10px 0 6px;
  border-radius: 5px;
  background: var(--border);
}
.relief-meter-fill {
  height: 100%;
  border-radius: 5px;
  background: var(--brand);
}
.relief-meter-fill.relief-meter-full {
  background: var(--danger);
}
.relief-meter-mark {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 16px;
  margin-left: -1px;
  background: var(--text);
}
.relief-feedback {
  margin: 8px 0;
}
.relief-code {
  font-family: var(--mono);
  overflow-wrap: anywhere;
}
.relief-confirm {
  margin: 0;
  max-width: 65ch;
}
.relief-confirm-row > td {
  border-top: none;
}

/* The metadata editor's Activity columns form (projectz feature 9205b68f):
   one block per column, stacked like the other fields, since the form sits
   in the narrow buckets side panel at every width. */
.activity-column-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 40rem;
}
.activity-column-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.activity-column-index {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: auto;
}
.activity-column-name {
  max-width: 20rem;
}
.activity-columns-actions {
  flex-wrap: wrap;
  gap: 8px;
}
.activity-columns-intro {
  margin: 0 0 8px;
  max-width: 40rem;
}

/* Admin ▸ Fleet (projectz feature ef4edb7a): the teardown tables' look,
   scrolled sideways inside .table-scroll on a narrow screen rather than
   wrapped a word per line. */
.fleet-table {
  min-width: 640px;
}
.fleet-table .hint-text {
  margin: 2px 0 0;
}
.fleet-gate-retired td {
  opacity: 0.6;
}
.fleet-request-runs {
  margin-top: 14px;
}
.fleet-error-row td {
  padding-top: 0;
}
/* Below the requests table, one per request that ran to an end: where its
   turn-down stands, with the button that drains its instance (projectz
   feature 673317cc). Outside the table, which scrolls sideways on a narrow
   screen, so it wraps to the card's width; the button drops under the text
   when there is no room. */
.fleet-turn-down {
  border-left: 3px solid var(--border);
  padding: 4px 0 4px 10px;
  margin: 8px 0 12px;
  max-width: 60rem;
}
.fleet-turn-down-title {
  margin: 0 0 4px;
}
.fleet-turn-down-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.fleet-turn-down-blockers {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--danger, inherit);
}
.fleet-turn-down code {
  word-break: break-all;
}
