/* docguys app. Rules live in /appdesignguidelines.md; tokens follow public/css/styles.css (same blue, inks, fonts).
   Fonts come from the Adobe Fonts kit, allowed on dashboard pages only by APP_CSP (SECURITY.md §6 exception); every
   stack falls back to system fonts. No monospace anywhere (including <code> and <kbd>). Mobile-first.
   Motion: every transition and one-shot animation is 0.2s (--t). The only loop is the skeleton pulse. */

/* ---------- tokens: light ---------- */
:root {
  color-scheme: light;
  --bg: oklch(100% 0 0);             /* main canvas */
  --chrome: oklch(97.6% 0.003 264.5);         /* top bar + rail: the grey frame around the canvas */
  --frame: oklch(94.9% 0.006 264.5);          /* dashboard, desktop: what shows around the page and its tab strip */
  --surface: oklch(100% 0 0);        /* cards, popovers, inspector */
  --surface-2: oklch(97.6% 0.003 264.5);      /* quiet fills: hovers, empty states, diagram background */
  --surface-3: oklch(94.9% 0.006 264.5);      /* skeletons, the panel bus, pressed */
  --ink: oklch(19% 0.009 255.6);
  --ink-2: oklch(44.22% 0.035 257.8);
  --muted: oklch(54.4% 0.035 265.1);          /* lightest grey allowed for text: 4.6:1 on --chrome, 5:1 on white */
  --line: oklch(21% 0.034 263.4 / .1);     /* borders are alpha (ink in light, white in dark), so they sit right on any surface */
  --line-2: oklch(21% 0.034 263.4 / .18);  /* input borders, dashed empties */
  --blue: oklch(57.36% 0.2114 260.1);           /* docguys blue: primary buttons, focus, current */
  --blue-ink: oklch(48.63% 0.1824 260.45);       /* blue text on light surfaces */
  --blue-soft: oklch(96.3% 0.016 262.8);
  --on-blue: oklch(100% 0 0);
  --good: oklch(49.87% 0.1168 157.07);  --good-soft: oklch(97.9% 0.022 160.2);
  --warn: oklch(53.9% 0.156 43);  --warn-soft: oklch(98.49% 0.02 91.6);
  --danger: oklch(50% 0.182 29.5); --danger-soft: oklch(97.2% 0.012 23.7);
  /* Announcements from docguys: grey notice, pastel yellow maintenance, pastel red issue (ink 7:1 or better). */
  --ann-notice: oklch(94.9% 0.006 264.5); --ann-notice-ink: oklch(19% 0.009 255.6);
  --ann-maintenance: oklch(95.6% 0.055 91.4); --ann-maintenance-ink: oklch(40.6% 0.114 40.6);
  --ann-issue: oklch(93.9% 0.029 23); --ann-issue-ink: oklch(43.2% 0.15 29);
  --scrim: 19% 0.009 255.6;
  --ticket-bg: var(--surface);  --ticket-edge: oklch(71% 0.027 261.1);   /* breaker popup: fill + outline (incl. its point) */
  --shadow-sm: 0 1px 2px oklch(21% 0.034 263.4 / .05);
  --shadow-md: 0 12px 32px -8px oklch(21% 0.034 263.4 / .14), 0 2px 6px oklch(21% 0.034 263.4 / .05);
  --shadow-lg: -24px 0 64px oklch(21% 0.034 263.4 / .16);

  --f-sys: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-display: "autarchist-vf", var(--f-sys);      /* headings, wordmark, big numbers */
  --f-body: "acumin-pro-condensed", var(--f-sys);  /* running text */
  --f-ui: "acumin-pro", var(--f-sys);              /* buttons, inputs, nav, labels, tables */
  --f-label: var(--f-ui);                          /* eyebrows, small uppercase labels (same as the marketing site) */

  --t: .2s;                  /* the one duration */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --rail: 64px;
  --rail-open: 240px;
  --topbar-h: 60px;          /* the top bar itself */
  --ann-h: 0px;              /* announcements above it (html[data-ann]): one 40px row each */
  --bar-h: calc(var(--topbar-h) + var(--ann-h));   /* everything fixed above the page */
  --tabbar: 0px;             /* the dashboard's bottom tab bar on phones (0 where there is none) */
  --r-lg: 16px;              /* cards */
  --r: 12px;                 /* rows, popovers */
  --r-sm: 10px;              /* inputs, icon tiles */
  --insp-w: min(480px, 100vw);
  --dg-dot: 29, 111, 242; --dg-hi: 29, 111, 242; --dg-alpha: .5;   /* dot grid texture (dotgrid.js): blue in light */
}

/* ---------- tokens: dark (explicit, or following the system) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(17.7% 0.007 258.4); --chrome: oklch(20.8% 0.009 255.6); --frame: oklch(13.5% 0.006 258.4); --surface: oklch(22.1% 0.011 260.7); --surface-2: oklch(24.6% 0.013 258.4); --surface-3: oklch(29.2% 0.016 259.8);
  --ink: oklch(96.05% 0.0046 258.32); --ink-2: oklch(80.5% 0.016 257.2); --muted: oklch(68.7% 0.018 259.4);
  --line: oklch(100% 0 0 / .08); --line-2: oklch(100% 0 0 / .16);
  --blue: oklch(57.36% 0.2114 260.1); --blue-ink: oklch(77.9% 0.113 259.7); --blue-soft: oklch(26.1% 0.051 261.3); --on-blue: oklch(100% 0 0);
  --good: oklch(82.7% 0.129 158.5); --good-soft: oklch(25.96% 0.0405 162.47);
  --warn: oklch(81.09% 0.1634 75.65); --warn-soft: oklch(26.1% 0.035 76.4);
  --danger: oklch(80.14% 0.109 24.6); --danger-soft: oklch(25% 0.045 16.3);
  --ann-notice: oklch(29.2% 0.016 259.8); --ann-notice-ink: oklch(96.05% 0.0046 258.32);
  --ann-maintenance: oklch(30.6% 0.054 81.1); --ann-maintenance-ink: oklch(91.1% 0.111 90.3);
  --ann-issue: oklch(29.5% 0.071 26.1); --ann-issue-ink: oklch(89% 0.056 22.3);
  --scrim: 0% 0 0;
  --ticket-bg: oklch(24.7% 0.016 264.2);  --ticket-edge: oklch(44.22% 0.035 257.8);
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / .4);
  --shadow-md: 0 16px 40px -8px oklch(0% 0 0 / .6), 0 0 0 1px var(--line);
  --shadow-lg: -24px 0 64px oklch(0% 0 0 / .5);
  --dg-dot: 148, 155, 166; --dg-hi: 208, 213, 221; --dg-alpha: .42;   /* dot grid: grey in dark */
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: oklch(17.7% 0.007 258.4); --chrome: oklch(20.8% 0.009 255.6); --frame: oklch(13.5% 0.006 258.4); --surface: oklch(22.1% 0.011 260.7); --surface-2: oklch(24.6% 0.013 258.4); --surface-3: oklch(29.2% 0.016 259.8);
    --ink: oklch(96.05% 0.0046 258.32); --ink-2: oklch(80.5% 0.016 257.2); --muted: oklch(68.7% 0.018 259.4);
    --line: oklch(100% 0 0 / .08); --line-2: oklch(100% 0 0 / .16);
    --blue: oklch(57.36% 0.2114 260.1); --blue-ink: oklch(77.9% 0.113 259.7); --blue-soft: oklch(26.1% 0.051 261.3); --on-blue: oklch(100% 0 0);
    --good: oklch(82.7% 0.129 158.5); --good-soft: oklch(25.96% 0.0405 162.47);
    --warn: oklch(81.09% 0.1634 75.65); --warn-soft: oklch(26.1% 0.035 76.4);
    --danger: oklch(80.14% 0.109 24.6); --danger-soft: oklch(25% 0.045 16.3);
  --ann-notice: oklch(29.2% 0.016 259.8); --ann-notice-ink: oklch(96.05% 0.0046 258.32);
  --ann-maintenance: oklch(30.6% 0.054 81.1); --ann-maintenance-ink: oklch(91.1% 0.111 90.3);
  --ann-issue: oklch(29.5% 0.071 26.1); --ann-issue-ink: oklch(89% 0.056 22.3);
    --scrim: 0% 0 0;
    --ticket-bg: oklch(24.7% 0.016 264.2);  --ticket-edge: oklch(44.22% 0.035 257.8);
    --shadow-sm: 0 1px 2px oklch(0% 0 0 / .4);
    --shadow-md: 0 16px 40px -8px oklch(0% 0 0 / .6), 0 0 0 1px var(--line);
    --shadow-lg: -24px 0 64px oklch(0% 0 0 / .5);
    --dg-dot: 148, 155, 166; --dg-hi: 208, 213, 221; --dg-alpha: .42;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-variation-settings: "SRIF" 100; background: var(--chrome); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; letter-spacing: -0.015em; margin: 0; font-weight: 400; }
h1 { font-size: clamp(30px, 4vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: inherit; }
code, kbd { font: inherit; }
code { background: var(--surface-2); padding: 0 .3em; border-radius: 4px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.icon { flex: none; }

/* ---------- accessibility basics ---------- */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; text-decoration: none;
  font-family: var(--f-ui); font-size: 15px;
}
.skip:focus { top: 12px; }
main:focus { outline: none; }
/* The page title takes focus after an in-place page change (app.js) only so screen readers announce it. */
h1[data-page-focus]:focus { outline: none; }

/* ---------- top bar: neutral grey, docguys blue only as an accent ---------- */
.topbar {
  position: sticky; top: var(--ann-h); z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: var(--chrome); color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.iconbtn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none;
  transition: background-color var(--t), color var(--t);
}
.iconbtn:hover, .iconbtn[aria-expanded="true"] { background: var(--surface-3); color: var(--ink); }
.iconbtn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.topbar__brand { display: flex; align-items: center; text-decoration: none; padding: 6px 8px; border-radius: var(--r-sm); }
.topbar__org {
  display: none; font-family: var(--f-ui); font-size: 14px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.topbar__org::before { content: "/" / ""; color: var(--line-2); margin: 0 10px 0 2px; }
.wordmark { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.025em; font-size: 20px; line-height: 1; }
.wordmark::after { content: "." / ""; color: var(--blue); }
.wordmark--lg { font-size: 24px; margin-bottom: 64px; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.avatar-btn { border: 0; background: none; padding: 4px; border-radius: 999px; cursor: pointer; margin-left: 4px; }
.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px;
  background: var(--blue); color: var(--on-blue); font: 600 13px/1 var(--f-ui); letter-spacing: .02em;
}
.avatar--lg { width: 40px; height: 40px; font-size: 15px; }

/* Search: a field in the top bar from tablet up; an icon linking to /search on phones. */
.search { display: none; position: relative; flex: 1; max-width: 560px; margin-left: 16px; }
.search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 40px 0 38px;
  font: 400 15px/1 var(--f-ui); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color var(--t), box-shadow var(--t);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.search input::-webkit-search-cancel-button { display: none; }
.search__key {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px;
  font: 500 12px/1 var(--f-ui); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2);
}
.search input:focus ~ .search__key { opacity: 0; }
.search__pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 60;
  max-height: min(70dvh, 560px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-md);
  --pad: 8px; padding: var(--pad); animation: pop-in var(--t) var(--ease);
}
.search__pop .results__group + .results__group { margin-top: 8px; }
.search__pop .eyebrow { padding: 8px 10px 4px; }
.search__pop .list__row { min-height: 52px; padding: 8px 10px; border-radius: max(4px, calc(var(--r) - var(--pad, 6px))); }
.search__pop .list__title { font-size: 16px; }
.search__pop .list__sub { font-size: 14px; }
.search__pop .list__row[aria-selected="true"] { background: var(--surface-2); }
.search__pop .results__none, .search__pop .results__hint { padding: 16px 10px; color: var(--ink-2); font-family: var(--f-ui); font-size: 14px; }
.search__foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 10px 4px; margin-top: 4px; border-top: 1px solid var(--line); font: 400 13px/1.3 var(--f-ui); color: var(--muted); }
.search__foot a { color: var(--blue-ink); }
/* Command rows (app.js): buttons that look like the result links. */
.list__row--cmd { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.list__row--cmd:hover { background: var(--surface-2); }
/* Shortcut hints: "G then S". Keys only work with JS, so the hints only show with it. */
.keys { display: none; flex: none; gap: 4px; margin-left: auto; }
.js .keys { display: inline-flex; }
.keys kbd {
  min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px;
  font: 500 12px/1 var(--f-ui); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2);
}
.keys + .list__chev { margin-left: 0; }
@media (max-width: 560px) { .js .keys { display: none; } }
/* On a button ("Back to the rack  Esc"): the key sits after the label, inside the pill. Keyboards only. */
.tool .keys { margin-left: 2px; margin-right: -4px; }
@media (hover: none) { .js .tool .keys { display: none; } }

@media (min-width: 720px) {
  .search { display: block; }
  .topbar__search-link { display: none; }
  .topbar__org { display: block; }
}

/* ---------- popovers (notifications, account): HTML popover, positioned under the top bar ---------- */
.pop {
  position: fixed; inset: calc(var(--bar-h) + 8px) 12px auto auto; margin: 0;
  width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - var(--bar-h) - 24px); overflow-y: auto;
  padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(-4px);
  transition: opacity var(--t), transform var(--t), overlay var(--t) allow-discrete, display var(--t) allow-discrete;
}
.pop:popover-open { opacity: 1; transform: none; }
@starting-style { .pop:popover-open { opacity: 0; transform: translateY(-4px); } }
.pop--account { width: min(300px, calc(100vw - 24px)); }
.pop__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.pop__head h2 { font-size: 20px; }
.pop__empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 20px 24px 24px; }
.pop__empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); margin-bottom: 6px; }
.pop__empty-title { font: 600 15px/1.3 var(--f-ui); }
.pop__section { padding: 16px 18px; border-top: 1px solid var(--line); }
.pop__foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pop__who { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.pop__name { display: block; font: 600 15px/1.3 var(--f-ui); }
.pop__who .hint { display: block; }
.pop__menu { --pad: 6px; list-style: none; margin: 0; padding: var(--pad); border-top: 1px solid var(--line); }
.pop__menu a, .pop__menu-off, .pop__menu-current, .pop__menu button {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: calc(var(--r) - var(--pad, 6px));
  font: 400 15px/1.2 var(--f-ui); text-decoration: none; color: var(--ink);
  transition: background-color var(--t);
}
.pop__menu form { margin: 0; }
.pop__menu button { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; }
.pop__menu a:hover, .pop__menu button:hover { background: var(--surface-2); }
.pop__menu .icon { color: var(--ink-2); }
.pop__menu-off { color: var(--muted); cursor: not-allowed; }
/* The org switcher: the team you're looking at, ticked; the others are one-click forms. */
.pop__menu-current { font-weight: 600; }
.pop__menu .pop__menu-current .icon { color: var(--blue); }
.pop__menu-current .hint, .pop__menu button .hint { font-weight: 400; }
.pop__section--teams .pop__menu { border-top: 0; padding: 0; }
.pop__menu-off .icon { color: var(--muted); }

/* Segmented control (theme). Only shown with JS: without it the theme simply follows the system. */
html:not(.js) .theme-switch { display: none; }
.seg { --pad: 4px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: var(--pad); margin-top: 8px; background: var(--surface-2); border-radius: var(--r-sm); }
.seg__btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 8px;
  border: 0; border-radius: calc(var(--r-sm) - var(--pad, 4px)); background: transparent; color: var(--ink-2); cursor: pointer;
  font: 500 13px/1 var(--f-ui); transition: background-color var(--t), color var(--t), box-shadow var(--t);
}
.seg__btn:hover { color: var(--ink); }
.seg__btn[aria-pressed="true"], .seg__btn[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
/* Two views of one page, as plain links ("By site | All equipment"). */
/* One selector, everywhere (founder, 2026-11-28): "By site | All equipment", filter chips and an editor's views are
   all the same pill: a 36px fully round track with one ring, its choices inside, the picked one a soft fill.
   --pill-h is the height; a search field beside them (.filters__search) is the same pill. */
:root { --pill-h: 36px; }
.seg--links, .chips ul, .filters__search {
  box-sizing: border-box; height: var(--pill-h); padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2);
}
.seg--links .seg__btn, .chip {
  min-height: 0; height: 100%; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
  font: 500 14px/1 var(--f-ui); color: var(--ink-2);
}
.seg--links .seg__btn:hover, .chip:hover { color: var(--ink); }
.seg--links .seg__btn[aria-current="page"], .chip[aria-current="page"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
/* The selectors of a page in one row that wraps (All equipment): view, type, what's left, search. */
/* The same row on "By site" and "All equipment", so switching between them never moves it. Whatever follows (a
   heading, a list, an empty state) starts 32px under it. */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: -16px 0 32px; }
.filters > * { margin: 0 !important; }
.filters > .chips { max-width: 100%; }
.filters__search { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--muted); flex: 0 1 260px; min-width: 180px; transition: box-shadow var(--t); }
.filters__search:focus-within { box-shadow: inset 0 0 0 2px var(--blue); color: var(--ink-2); }
.filters__search .icon { flex: none; }
.filters__search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--ink); font: 400 14px/1 var(--f-ui); }
.filters__search input::placeholder { color: var(--muted); }
/* Safari draws its own magnifier and a dark rounded field inside a search input: ours is the only one. */
.filters__search input { -webkit-appearance: none; appearance: none; border-radius: 0; box-shadow: none; }
.filters__search input::-webkit-search-decoration, .filters__search input::-webkit-search-results-button,
.filters__search input::-webkit-search-results-decoration { -webkit-appearance: none; display: none; }
.seg--links { display: inline-grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; margin: -16px 0 32px; }
.seg--links .seg__btn { padding-inline: 16px; text-decoration: none; white-space: nowrap; }
.seg--links + .chips { margin-top: -12px; }

/* A page head's "More" menu: a popover under its button (anchored where the browser can; under the top bar otherwise). */
.pop--more { width: min(240px, calc(100vw - 24px)); }
.pop--more .pop__menu { border-top: 0; }
.pop__menu-sep { margin-top: var(--pad); padding-top: var(--pad); border-top: 1px solid var(--line); }
.pop__menu a.pop__menu-danger, .pop__menu a.pop__menu-danger .icon { color: var(--danger); }
.more-btn .icon { margin-right: -4px; }
@supports (anchor-name: --more) {
  .more-btn { anchor-name: --more; }
  .pop.pop--more { position-anchor: --more; inset: calc(anchor(bottom) + 8px) anchor(right) auto auto; position-try-fallbacks: flip-inline; }
}

/* Switches (notification preferences). */
.switches { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; }
.switch-row__text { display: grid; gap: 2px; }
.switch-row__label { font: 500 15px/1.3 var(--f-ui); }
.switch {
  appearance: none; flex: none; position: relative; width: 36px; height: 20px; margin: 0; border-radius: 999px;
  background: var(--line-2); cursor: pointer; transition: background-color var(--t);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px;
  background: oklch(100% 0 0); box-shadow: 0 1px 2px oklch(21% 0.034 263.4 / .2); transition: transform var(--t) var(--ease);
}
.switch:checked { background: var(--blue); }
.switch:checked::after { transform: translateX(16px); }
.switch:disabled { cursor: not-allowed; opacity: .55; }

/* ---------- notifications: bell badge, inbox lines, Email / Push switches ---------- */
.bell { position: relative; }
.bell__count {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--blue); color: oklch(100% 0 0); font: 700 11px/18px var(--f-ui); text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.bell__count[hidden] { display: none; }
.notifs { list-style: none; margin: 0; padding: 0; }
.notifs > li + li { border-top: 1px solid var(--line); }
.notif__row {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 12px;
  padding: 14px 18px; color: inherit; text-decoration: none; transition: background-color var(--t);
}
a.notif__row:hover { background: var(--surface-2); }
.notif__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.notif--unread .notif__icon { background: var(--blue-soft); color: var(--blue-ink); }
.notif__main { display: grid; gap: 2px; min-width: 0; }
.notif__title { font: 600 15px/1.3 var(--f-ui); }
.notif__text { color: var(--ink-2); font-size: 15px; line-height: 1.4; }
.notif__time { color: var(--muted); font: 500 13px/1.3 var(--f-ui); white-space: nowrap; padding-top: 2px; }
.notif__dot { position: absolute; top: 20px; left: 8px; width: 6px; height: 6px; border-radius: 999px; background: var(--blue); }
.notifs--pop .notif__row { padding: 12px 18px; }
.pop__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); }
/* "Mark all as read" matches "See all" beside it: same size, weight, gap and no underline. */
.pop__actions .link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; text-decoration: none; }
.pop__actions .link-btn .icon { margin-right: 0; vertical-align: 0; }
.pop__actions .link-btn:hover { color: var(--ink); }
.inline-form { display: inline; margin: 0; }
.nprefs { display: grid; margin: 8px 0 16px; }
.nprefs__head, .nprefs__row { display: grid; grid-template-columns: 1fr 64px 64px; align-items: center; gap: 12px; }
.nprefs__head { padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--ink-2); font: 600 12px/1.3 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; }
.nprefs__row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.nprefs__text { display: grid; gap: 2px; }
.nprefs__ch { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; justify-self: center; }
.nprefs__head .nprefs__ch { flex-direction: row; gap: 4px; }
.nprefs__mobile { display: none; color: var(--ink-2); font: 500 12px/1 var(--f-ui); }
@media (max-width: 420px) {
  .nprefs__head { display: none; }
  .nprefs__row { grid-template-columns: 1fr 48px 48px; }
  .nprefs__mobile { display: block; }
}

/* ---------- layout + rail (the rail is the admin site's; the dashboard's shell is "tabs", below) ---------- */
.app { display: block; }
main {
  padding: 40px max(var(--gutter), env(safe-area-inset-right)) calc(120px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  max-width: 1080px; margin-inline: auto;
}

.rail {
  position: fixed; z-index: 40; top: 0; bottom: 0; left: 0;
  width: min(84vw, 300px);
  display: flex; flex-direction: column;
  background: var(--chrome); border-right: 1px solid var(--line);
  padding: calc(var(--bar-h) + 12px) 10px 16px;
  transform: translateX(-100%);
  transition: transform var(--t) var(--ease);
  overflow-y: auto; overflow-x: hidden;
}
.rail.is-open { transform: none; box-shadow: 0 0 60px oklch(var(--scrim) / .2); }
.rail__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rail__foot { margin-top: auto; padding-top: 16px; }
.rail__heading {
  margin: 20px 12px 6px; height: 16px; white-space: nowrap;
  font: 500 11px/16px var(--f-ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.rail a {
  position: relative;
  font-family: var(--f-ui); font-size: 15px;
  display: flex; align-items: center; gap: 14px;
  min-height: 42px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: background-color var(--t), color var(--t);
}
.rail a .icon { width: 20px; height: 20px; }
.rail a:hover { background: var(--surface-3); color: var(--ink); }
.rail a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.rail a[aria-current="page"] .icon { color: var(--blue); }
.scrim { position: fixed; inset: 0; z-index: 35; background: oklch(var(--scrim) / .32); }

/* No JS: the drawer can't open, so show the rail as a strip under the bar instead. */
html:not(.js) .rail { position: static; transform: none; width: auto; padding: 8px var(--gutter); border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; }
html:not(.js) .rail__list { display: flex; overflow-x: auto; }
html:not(.js) .rail__heading { display: none; }
html:not(.js) .rail__foot { margin: 0; padding: 0; }
html:not(.js) .topbar__menu { display: none; }

/* Desktop with a real pointer: icon rail that expands on hover AND keyboard focus. */
@media (min-width: 900px) and (hover: hover) {
  .topbar__menu { display: none; }
  .topbar { padding-left: max(14px, env(safe-area-inset-left)); }
  .scrim { display: none !important; }
  .app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
  main { padding: 56px clamp(32px, 5vw, 80px) 160px; width: 100%; }
  .rail,
  html:not(.js) .rail {
    position: sticky; top: var(--bar-h); height: calc(100dvh - var(--bar-h)); transform: none; flex-direction: column;
    width: var(--rail); padding: 16px 10px; border-right: 1px solid var(--line); border-bottom: 0;
    overflow: hidden; transition: width var(--t) var(--ease), box-shadow var(--t);
  }
  html:not(.js) .rail__list { display: grid; }
  html:not(.js) .rail__foot { margin-top: auto; padding-top: 16px; }
  .rail:hover, .rail:focus-within, .rail.is-held { width: var(--rail-open); box-shadow: 12px 0 40px oklch(var(--scrim) / .08); }
  .rail__label { opacity: 0; transition: opacity var(--t); }
  .rail:hover .rail__label, .rail:focus-within .rail__label, .rail.is-held .rail__label { opacity: 1; }
  /* Collapsed: the group heading is a short rule, so the groups still read as groups. */
  .rail__heading { position: relative; margin-inline: 10px; }
  .rail__heading::before { content: ""; position: absolute; left: 0; top: 7px; width: 24px; height: 1px; background: var(--line-2); transition: opacity var(--t); }
  .rail:hover .rail__heading::before, .rail:focus-within .rail__heading::before, .rail.is-held .rail__heading::before { opacity: 0; }
  .rail.is-held.no-anim, .rail.is-held.no-anim .rail__label { transition: none; }
}
/* The rail overlays the page when it expands, so main never jumps. */
@media (min-width: 900px) and (hover: hover) {
  .rail { z-index: 25; }
}
/* ---------- dashboard shell: tabs (html[data-shell="tabs"]; founder's calls 2026-11-28) ----------
   No rail. One bar: the wordmark and org, the four places, search, then Get set up, help, the bell, the gear and
   the account. From 900px the page is a panel on a darker frame, and only two things in the bar are part of it:
   the tab you are on and the search bar, each page-coloured and curving out into the page's top edge (like a
   browser tab). Under 900px the bar is the plain grey one and the tabs are a bar along the bottom.
   The bar is fixed and the page doesn't rubber-band (overscroll-behavior): in Safari a fast scroll bouncing off
   either end dragged the bar, or pulled the page away from its tab.
   The admin site shares this file and still has the rail above. */
html[data-shell="tabs"], [data-shell="tabs"] body { overscroll-behavior: none; }
[data-shell="tabs"] .topbar { position: fixed; left: 0; right: 0; }
.nav__ind, .search__dots { display: none; }
[data-shell="tabs"] .app { margin-top: var(--topbar-h); }
.topbar__strip { display: contents; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: var(--chrome); border-top: 1px solid var(--line);
}
.nav__list { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.nav__tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 48px; padding: 4px 6px; border-radius: var(--r-sm);
  font: 500 12px/1.2 var(--f-ui); color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.nav__tab .icon { width: 22px; height: 22px; }
.nav__tab[aria-current="page"] { color: var(--ink); }
.nav__tab[aria-current="page"] .icon { color: var(--blue); }
.setup-slot { display: none; }   /* phones: Home, the first tab, has the list itself */
.setup {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font: 500 14px/1 var(--f-ui); text-decoration: none; white-space: nowrap;
}
.setup:hover { background: var(--bg); color: var(--ink); }
.setup .icon { color: var(--blue); }
.setup__count::before { content: "· " / ""; }
.pop--manage { width: min(220px, calc(100vw - 24px)); }
.pop--manage .pop__menu { border-top: 0; }
[data-shell="tabs"] .search__pop { left: auto; right: 0; width: max(100%, min(480px, calc(100vw - 32px))); }
@media (max-width: 899px) {
  [data-shell="tabs"] { --tabbar: calc(60px + max(6px, env(safe-area-inset-bottom))); }
  [data-shell="tabs"] main { padding-bottom: calc(var(--tabbar) + 96px); }
  [data-shell="tabs"] .app--editor main { padding-bottom: var(--tabbar); }
}
@media (max-width: 359px) { [data-shell="tabs"] .topbar__actions { gap: 0; } [data-shell="tabs"] .topbar__actions .iconbtn { width: 36px; } }

@media (min-width: 900px) {
  html[data-shell="tabs"], [data-shell="tabs"] body { background: var(--frame); }
  [data-shell="tabs"] .topbar {
    --gap: 8px; --join: 10px;
    align-items: stretch; gap: 0; border-bottom: 0; background: var(--frame);
    padding: var(--gap) max(var(--gap), env(safe-area-inset-right)) 0 max(var(--gap), env(safe-area-inset-left));
  }
  /* The page's two top corners, held under the bar so they stay put while the page scrolls. */
  [data-shell="tabs"] .topbar::before, [data-shell="tabs"] .topbar::after {
    content: ""; position: absolute; top: 100%; width: var(--r-lg); height: var(--r-lg); pointer-events: none;
  }
  [data-shell="tabs"] .topbar::before {
    left: max(var(--gap), env(safe-area-inset-left));
    background: radial-gradient(circle at 100% 100%, transparent calc(var(--r-lg) - .5px), var(--frame) var(--r-lg));
  }
  [data-shell="tabs"] .topbar::after {
    right: max(var(--gap), env(safe-area-inset-right));
    background: radial-gradient(circle at 0 100%, transparent calc(var(--r-lg) - .5px), var(--frame) var(--r-lg));
  }
  /* Even air: the wordmark and the avatar are both 20px in from the window; every glyph on the right is 24px from the next. */
  [data-shell="tabs"] .topbar__strip { flex: 1; min-width: 0; display: flex; align-items: stretch; padding-left: 6px; }
  [data-shell="tabs"] .topbar__brand { padding: 6px 4px 6px 6px; }
  [data-shell="tabs"] .avatar-btn { margin-left: 6px; }
  [data-shell="tabs"] .topbar__brand, [data-shell="tabs"] .topbar__org { align-self: center; }
  [data-shell="tabs"] .topbar__org { max-width: 180px; }
  [data-shell="tabs"] .topbar__actions { margin-left: calc(var(--join) + 4px); padding-right: 8px; }
  [data-shell="tabs"] .topbar__actions .iconbtn:hover, [data-shell="tabs"] .topbar__actions .iconbtn[aria-expanded="true"] { background: var(--bg); }
  [data-shell="tabs"] .bell__count { box-shadow: 0 0 0 2px var(--frame); }
  .setup-slot { display: flex; }

  /* Tabs sit on the frame. The one you are on is page-coloured and runs down into the page. */
  [data-shell="tabs"] .nav { position: relative; display: flex; margin-left: calc(var(--join) + 6px); padding: 0; background: none; border: 0; }
  [data-shell="tabs"] .nav__list { position: relative; display: flex; gap: 2px; }
  [data-shell="tabs"] .nav__list li { display: flex; }
  [data-shell="tabs"] .nav__tab {
    position: relative; flex-direction: row; gap: 8px; min-height: 0; padding: 0 16px;
    border-radius: var(--r) var(--r) 0 0; font: 500 15px/1 var(--f-ui); transform-origin: 50% 100%;
  }
  [data-shell="tabs"] .nav__tab .icon { width: 18px; height: 18px; }
  [data-shell="tabs"] .nav__tab:hover { background: color-mix(in oklch, var(--bg) 55%, transparent); color: var(--ink); }
  [data-shell="tabs"] .nav__tab[aria-current="page"] { background: var(--bg); color: var(--ink); }
  [data-shell="tabs"] .nav__tab[aria-current="page"]:active { scale: none; }
  /* With app.js one box slides behind the tabs to the one you pick, and the tabs themselves stay clear. */
  [data-shell="tabs"] .nav--ind .nav__ind {
    display: block; position: absolute; top: 0; bottom: 0; left: 0; width: var(--ind-w, 0px); translate: var(--ind-x, 0px) 0;
    background: var(--bg); border-radius: var(--r) var(--r) 0 0; pointer-events: none;
    transition: translate var(--t) var(--ease), width var(--t) var(--ease), opacity var(--t);
  }
  [data-shell="tabs"] .nav--ind.nav--none .nav__ind { opacity: 0; }
  [data-shell="tabs"] .nav--ind.no-anim .nav__ind { transition: none; }
  @media (prefers-reduced-motion: reduce) { [data-shell="tabs"] .nav--ind .nav__ind { transition: none; } }
  [data-shell="tabs"] .nav--ind .nav__tab[aria-current="page"] { background: none; }

  /* Search is the other piece of the page: the same shape, filling the bar up to the buttons. */
  [data-shell="tabs"] .search {
    flex: 1; min-width: 170px; max-width: none; margin-left: calc(var(--join) * 2);
    display: flex; align-items: center; padding: 0 6px; background: var(--bg); border-radius: var(--r) var(--r) 0 0;
  }
  [data-shell="tabs"] .search input { position: relative; padding-right: 60px; background: transparent; border-color: transparent; text-overflow: ellipsis; }
  [data-shell="tabs"] .search input:focus { border-color: var(--blue); }
  [data-shell="tabs"] .search__icon { left: 18px; }
  [data-shell="tabs"] .search__key { right: 16px; }
  /* The page's dot grid carries on up into the search bar: one pattern in two pieces. This canvas is laid exactly
     where the page's own texture would be if it kept going (same width, same right edge, 8 rows of 7px above the
     page's top edge) and dotgrid.js draws both from one clock (data-dotgrid-sync, data-dotgrid-row="-8"), so the
     dots and their swell run straight across the join; the search bar's shape clips it. Its fade is the page's,
     mirrored. Change the 56px and the row together. */
  [data-shell="tabs"] .search__dots {
    display: block; position: absolute; inset: 0; pointer-events: none;
    clip-path: inset(0 round var(--r) var(--r) 0 0);
  }
  [data-shell="tabs"] .search__dots > [data-dotgrid] {
    position: fixed; top: calc(var(--bar-h) - 56px); right: max(var(--gap), env(safe-area-inset-right)); height: 56px;
    width: min(calc((100% - max(var(--gap), env(safe-area-inset-left)) - max(var(--gap), env(safe-area-inset-right))) * .8), 1100px);
  }
  [data-shell="tabs"] .search__dots .dotgrid {
    -webkit-mask-image: radial-gradient(100% 380px at 100% 100%, oklch(0% 0 0), oklch(0% 0 0 / .6) 50%, transparent 90%);
            mask-image: radial-gradient(100% 380px at 100% 100%, oklch(0% 0 0), oklch(0% 0 0 / .6) 50%, transparent 90%);
  }
  html[data-shell="tabs"]:has(.app--editor) .search__dots { display: none; }   /* editors have no texture */

  /* The curves where those two meet the page's top edge. */
  [data-shell="tabs"] .nav:not(.nav--ind) .nav__tab[aria-current="page"]::before, [data-shell="tabs"] .nav:not(.nav--ind) .nav__tab[aria-current="page"]::after,
  [data-shell="tabs"] .nav__ind::before, [data-shell="tabs"] .nav__ind::after,
  [data-shell="tabs"] .search::before, [data-shell="tabs"] .search::after {
    content: ""; position: absolute; bottom: 0; width: var(--join); height: var(--join); pointer-events: none;
  }
  [data-shell="tabs"] .nav:not(.nav--ind) .nav__tab[aria-current="page"]::before, [data-shell="tabs"] .nav__ind::before, [data-shell="tabs"] .search::before {
    right: 100%; background: radial-gradient(circle at 0 0, transparent calc(var(--join) - .5px), var(--bg) var(--join));
  }
  [data-shell="tabs"] .nav:not(.nav--ind) .nav__tab[aria-current="page"]::after, [data-shell="tabs"] .nav__ind::after, [data-shell="tabs"] .search::after {
    left: 100%; background: radial-gradient(circle at 100% 0, transparent calc(var(--join) - .5px), var(--bg) var(--join));
  }

  [data-shell="tabs"] .app {
    display: block; min-height: calc(100dvh - var(--bar-h) - 8px); background: var(--bg);
    margin: var(--topbar-h) max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
    border-radius: var(--r-lg);
  }
  [data-shell="tabs"] .app--editor { min-height: 0; margin-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  [data-shell="tabs"] .app__texture { border-top-right-radius: var(--r-lg); overflow: hidden; }
  [data-shell="tabs"] main { padding: 56px clamp(32px, 5vw, 80px) 160px; width: 100%; }
  [data-shell="tabs"] .app--editor main { padding: 0; }
}
/* Tighter widths: the tabs lose their icons, then "Get set up" keeps only its count. */
@media (min-width: 900px) and (max-width: 1239px) {
  [data-shell="tabs"] .nav__tab .icon { display: none; }
  [data-shell="tabs"] .topbar__org { max-width: 120px; }
  .setup { gap: 6px; }
  .setup__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .setup__count::before { content: none; }
}
@media (forced-colors: active) {
  [data-shell="tabs"] :is(.topbar, .search, .nav__tab, .nav__ind)::before, [data-shell="tabs"] :is(.topbar, .search, .nav__tab, .nav__ind)::after { display: none; }
  [data-shell="tabs"] .nav__ind, [data-shell="tabs"] .search__dots { display: none; }
  .nav__tab[aria-current="page"] { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* The dashboard's pages use the whole panel (founder, 2026-11-28); running text keeps its own measure (.lede, forms).
   The admin site keeps 1080px on main, and 1240px for its Cockpit and Order pages. */
[data-shell="tabs"] main { max-width: none; }
.app--wide main { max-width: 1240px; }

/* ---------- page parts ---------- */
.page-head { margin-bottom: 40px; }
.page-head__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 24px; }
.page-head__titles { min-width: 0; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.lede { margin-top: 10px; color: var(--ink-2); font-size: 19px; max-width: 62ch; }
.crumbs { margin-bottom: 14px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.crumbs li { display: flex; align-items: center; gap: 4px; font: 400 14px/1.3 var(--f-ui); color: var(--muted); }
.crumbs a { color: var(--ink-2); text-decoration: none; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; transition: color var(--t), background-color var(--t); }
.crumbs a:hover { color: var(--ink); background: var(--surface-2); }
.section-title { margin: 56px 0 16px; }
.section-title--first { margin-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: 56px 0 16px; }
.section-head .section-title { margin: 0; }
.section-head--first { margin-top: 0; }
.private { color: var(--muted); }
.private::before { content: "Private · " / ""; }
.hint { font-family: var(--f-ui); color: var(--muted); font-size: 14px; font-weight: 400; }
.eyebrow { font: 500 12px/1.3 var(--f-ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; }

.card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; background: var(--surface); }
.card + .card { margin-top: 20px; }
.card h2 { margin-bottom: 16px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 12px; }
.card__head h2 { margin: 0; font-size: 20px; }
.card--flush .list { margin: 0; padding: 0 8px 8px; }
.card--flush .list__row { border-radius: calc(var(--r-lg) - 8px); }

/* Home. The guided start (no sites yet): one form, the page's only job. */
.form.start { margin-top: 32px; max-width: 760px; gap: 28px; }
.start > label { max-width: 520px; }
@media (min-width: 720px) {
  .radio-cards--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .radio-cards--three legend { grid-column: 1 / -1; }
}
.next + .stats { margin-top: 32px; }
/* Home from 1280px: sites on the left, Needs attention and Stickers in a column beside them, so a wide page is full
   and not one long stretched list. Narrower: the same three in reading order, one column. */
@media (min-width: 1280px) {
  .home-cols:not(.home-cols--one) {
    display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 30%, 480px); grid-template-rows: auto 1fr;
    column-gap: clamp(40px, 4vw, 72px); margin-top: 56px; align-items: start;
  }
  .home-cols:not(.home-cols--one) > .home-cols__sites { grid-column: 1; grid-row: 1 / span 2; }
  .home-cols:not(.home-cols--one) > :is(.home-cols__attention, .home-cols__stickers) { grid-column: 2; min-width: 0; }
  .home-cols:not(.home-cols--one) > * > :first-child { margin-top: 0; }
  .home-cols__attention + .home-cols__sites + .home-cols__stickers > :first-child { margin-top: 48px; }
  .home-cols__stickers .orders--wide > .order { grid-template-columns: minmax(0, 1fr); }
  .home-cols__stickers .orders--wide .order__detail { grid-column: auto; }
}
/* Orders on Home and on Stickers → Orders run the page's full width like rows; from 900px the bar sits beside the order's name. */
.orders.orders--wide { margin: 12px 0 0; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .orders--wide > .order { grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr); column-gap: 40px; align-items: center; }
  .orders--wide .order__detail { grid-column: 2; }
}
/* Next step: the one next setup step, large; every step is in the <details> under it. */
.next { padding: 28px 32px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); scroll-margin-top: 88px; }
.next__top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
.next__count { font: 400 14px/1.3 var(--f-ui); color: var(--muted); }
.next h2 { font-size: clamp(24px, 3vw, 30px); }
.next__hint { margin: 10px 0 0; max-width: 60ch; color: var(--ink-2); }
.next__action { margin: 24px 0 0; }
.next__order { margin: 20px 0 0; max-width: 520px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); }
.next__order-title { margin: 0 0 10px; font: 500 14px/1.3 var(--f-ui); }
.next__order .otrack__bar li span { display: none; }
.next__all { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--f-ui); }
.next__all summary { display: inline-block; padding: 6px 0; cursor: pointer; font-size: 14px; color: var(--blue-ink); }
.next__all summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
.next__steps { list-style: none; margin: 8px 0 8px; padding: 0; display: grid; gap: 12px; }
.next__step { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px 14px; font-size: 15px; }
.next__step .next__order { grid-column: 2; margin-top: 0; }
.next__mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font: 500 13px/1 var(--f-ui); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.next__step.is-next { font-weight: 500; }
.next__step.is-next .next__mark { background: var(--blue); color: var(--on-blue); box-shadow: none; }
.next__step.is-done { color: var(--muted); }
.next__step.is-done .next__mark { background: var(--blue-soft); color: var(--blue-ink); box-shadow: none; }
@media (max-width: 700px) { .next { padding: 22px 20px 14px; } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; margin: 0 0 20px; }
.tabs + .stats { margin-bottom: 40px; }
.stat--link:active { scale: .985; }
.stat {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: grid; gap: 6px; align-content: start;
  background: var(--surface); text-decoration: none; color: inherit;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.stat--link:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.stat__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); }
.stat__l { font: 500 14px/1.3 var(--f-ui); color: var(--ink-2); }
.stat__n { font-family: var(--f-display); font-size: 36px; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__note { font: 400 13px/1.3 var(--f-ui); color: var(--muted); }

/* Lists: the whole row is the link. */
.list { list-style: none; margin: 0 -10px; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.list--flush li + li, .list--results li + li { border-top: 0; }
.list__row {
  display: flex; align-items: center; gap: 12px 16px;
  min-height: 64px; padding: 12px 10px; border-radius: var(--r); text-decoration: none;
  transition: background-color var(--t);
}
.list__row:hover { background: var(--surface-2); }
/* A row that isn't a link (open invites on Team): its own small buttons on the right, no hover. */
.list__row--static:hover { background: none; }
.list__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.list__actions form { margin: 0; }
.list__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.list__title { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.list__sub { color: var(--ink-2); font-size: 16px; overflow-wrap: anywhere; }
.list__meta { font-family: var(--f-ui); color: var(--ink-2); font-size: 14px; text-align: right; }
.list__where { font-weight: 600; }
.list__chev { color: var(--muted); transition: transform var(--t), color var(--t); }
.list__row:hover .list__chev { color: var(--ink); transform: translateX(2px); }
.tile-icon {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}
.tile-icon--warn { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
@media (max-width: 560px) {
  .list__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; }
  .list__row > .tile-icon { grid-row: 1 / span 2; }
  .list__meta { grid-column: 2; grid-row: 2; text-align: left; }
  .list__main { grid-column: 2; }
  .list__row .list__chev { grid-column: 3; grid-row: 1 / span 2; }
}

/* Filter chips */
.chips { margin: -16px 0 24px; overflow-x: auto; }
.chips ul { list-style: none; margin: 0; display: inline-flex; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none;
  transition: background-color var(--t), color var(--t), box-shadow var(--t);
}
/* A second row of chips under the first (All equipment: by type, then by what's left), each with its count. */
.chips + .chips--needs { margin-top: -12px; }
.chip__n { margin-left: 2px; color: var(--muted); }
.chip[aria-current="page"] .chip__n { color: inherit; }

/* All equipment: a grid of cards, each with a picture of the panel or rack (the plugin's thumb(): shapes only). */
.eq-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.eq-card {
  position: relative; display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  transition: border-color var(--t), box-shadow var(--t);
}
.eq-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.eq-card__pic { display: grid; place-items: center; height: 200px; padding: 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); line-height: 0; color: var(--muted); }
/* Drawn at one scale per kind, so a short rack is a short rack (never blown up to fill the card). */
.eq-card__pic .thumb { display: block; height: auto; max-height: 100%; max-width: 100%; }
.eq-card__pic .thumb--rack { width: 52px; }
/* A panel's picture is the editor's own drawing (Plugin.thumb → the "preview" drawing, as in .ep-cmp), small: rows
   sized so the tallest panel still fits the card, numbers and handle text too small to read so not drawn. */
.eq-thumb.ep-cmp { display: block; margin: 0; width: 100%; line-height: normal; pointer-events: none; }
.eq-thumb.ep-cmp .ps { --rh: clamp(2px, calc(164px / (var(--rows, 20) + 3) - 1px), 9px); --nw: 4px; --can: 4px; --maingap: 3px; }
.eq-thumb.ep-cmp .ps * { font-size: 0 !important; }
.eq-thumb.ep-cmp .ps--short { min-height: 0; }
.eq-thumb.ep-cmp .ps__grid { row-gap: 1px; }
.eq-card__pic { overflow: hidden; }
.eq-card__body { display: grid; gap: 2px; align-content: start; padding: 14px 16px 16px; min-width: 0; }
.eq-card__title { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; color: inherit; text-decoration: none; outline: 0; }
/* The title's link covers the whole card; keyboard focus rings the card. */
.eq-card__title::after { content: ""; position: absolute; inset: 0; }
.eq-card:has(.eq-card__title:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.eq-card__sub { color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }
.eq-more { margin-top: 20px; }
.thumb__box { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.5; }
.thumb__slot { fill: var(--surface-3); }
.thumb__main { fill: var(--line-2); }
.thumb__on { fill: var(--ink-2); }
.thumb__on--rear { opacity: .45; }
.filters + .section-title, .filters + .section-head { margin-top: 0; }

/* Empty states say what goes here and offer the next step. */
.empty-state { padding: 48px 32px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); color: var(--ink-2); text-align: center; }
.empty-state__icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r); background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 16px; }
.empty-state h2 { color: var(--ink); margin-bottom: 8px; font-size: 20px; }
.empty-state p { max-width: 46ch; margin-inline: auto; }
.empty-state__action { margin-top: 24px; }

.table { font-family: var(--f-ui); width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.table th, .table td { padding: 12px 8px; border-bottom: 1px solid var(--line); }
.table a { color: var(--blue-ink); }

.facts { display: grid; grid-template-columns: minmax(0, 168px) minmax(0, 1fr); gap: 12px 24px; margin: 0; align-items: baseline; }
.facts dt { font-family: var(--f-ui); font-size: 14px; color: var(--ink-2); }
@media (max-width: 480px) {
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dt:not(:first-child) { margin-top: 14px; }
}
.facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.swatch { width: 18px; height: 18px; border-radius: 5px; background: var(--swatch); box-shadow: inset 0 0 0 1px oklch(0% 0 0 / .12); }

/* Settings: intro on the left, card on the right (stacked on small screens). */
.settings__section { display: grid; gap: 16px 48px; padding: 32px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--bar-h) + 72px); }
.settings__section:first-of-type { border-top: 0; padding-top: 0; }
.settings__intro h2 { font-size: 20px; margin-bottom: 6px; }
@media (min-width: 900px) { .settings__section { grid-template-columns: 260px minmax(0, 1fr); } }
.settings__section .card p + p { margin-top: 8px; }
/* The Settings page itself (founder, 2026-11-29): each section is a title and a line about it over its card, two
   to a row from 1280px. The rows are shared (subgrid), so two cards side by side start and end together whatever
   their titles wrap to. The tap page, the tall one with the phone, takes the right column beside Company and Plan. */
.settings { display: grid; gap: 40px 32px; }
.settings > .settings__section { grid-row: span 2; grid-template-columns: none; grid-template-rows: subgrid; row-gap: 14px; padding: 0; border: 0; min-width: 0; }
.settings > .settings__section > .card { min-width: 0; }
.settings .settings__intro { display: grid; gap: 4px; align-content: end; }
.settings .settings__intro h2 { margin: 0; }
@media (min-width: 1280px) {
  .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings > .settings__section:has(.tp) { grid-column: 2; grid-row: span 4; }
  .settings > .settings__section:has(.tp) > .card { grid-row: 2 / -1; }
}
/* The section just jumped to (a pill, or a search result) flashes: a blue ring on its card that holds, then fades.
   :target does it with no script; app.js adds .is-flash to do it again on a second click, and makes the jump glide
   (.is-jumping is on only while it happens). A fade, not movement, so it stays under reduced motion. */
@keyframes settings-flash { from, 35% { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in oklch, var(--blue) 26%, transparent); } }
.settings__section:target > .card, .settings__section.is-flash > .card { animation: settings-flash 1.4s ease-out; }
@media (prefers-reduced-motion: no-preference) { html.is-jumping { scroll-behavior: smooth; } }
/* Which build this is, under everything (routes/misc.ts versionLine()). */
.settings__version { margin: 56px 0 0; text-align: center; font: 400 13px/1.4 var(--f-ui); color: var(--muted); font-variant-numeric: tabular-nums; }

/* The line under the tabs is drawn inside the bar (an inset shadow), so the links' own underline sits on it without
   hanging out of the bar: a link 1px taller than a bar that scrolls sideways made it scroll up and down too. */
.tabs { margin-bottom: 32px; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.tabs a {
  font-family: var(--f-ui); font-size: 15px;
  display: block; padding: 12px 14px; white-space: nowrap; text-decoration: none; color: var(--ink-2);
  border-bottom: 2px solid transparent; transition: color var(--t), border-color var(--t);
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--blue); }
/* Settings' sub-nav: links to the page's own sections, in the one selector look (a 36px pill, the section jumped
   to a soft fill, marked with no script by :target). It floats under the top bar while the page scrolls: the bar
   around the pill is empty and lets clicks through, and the pill is frosted, so the page shows through both.
   Too many sections for a phone scroll sideways inside the pill, and only sideways. */
.tabs--jump { position: sticky; top: calc(var(--bar-h) + 8px); z-index: 2; box-shadow: none; overflow: visible; pointer-events: none; }
.page-head + .tabs--jump { margin-top: -16px; }
.tabs--jump ul {
  pointer-events: auto; display: inline-flex; vertical-align: top; box-sizing: border-box; max-width: 100%; height: var(--pill-h); padding: 3px; gap: 2px;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: 999px;
  background: color-mix(in oklch, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.tabs--jump ul::-webkit-scrollbar { display: none; }
.tabs--jump li { flex: none; }
.tabs--jump a {
  display: inline-flex; align-items: center; height: 100%; padding: 0 14px; border: 0; border-radius: 999px;
  font: 500 14px/1 var(--f-ui); transition: background-color var(--t), color var(--t), box-shadow var(--t);
}
main:has(#company:target) .tabs--jump a[href="#company"],
main:has(#tap-page:target) .tabs--jump a[href="#tap-page"],
main:has(#plan:target) .tabs--jump a[href="#plan"],
main:has(#library:target) .tabs--jump a[href="#library"],
main:has(#notifications:target) .tabs--jump a[href="#notifications"],
main:has(#appearance:target) .tabs--jump a[href="#appearance"],
main:has(#activity:target) .tabs--jump a[href="#activity"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }

.notice, .status, .alert { border-radius: var(--r); padding: 12px 16px; font-family: var(--f-ui); font-size: 15px; }
.notice { background: var(--surface-2); color: var(--ink-2); margin-bottom: 28px; }
.status { background: var(--good-soft); color: var(--good); margin-bottom: 20px; }
.alert { background: var(--danger-soft); color: var(--danger); margin-bottom: 20px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px/1 var(--f-ui); padding: 5px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}
.badge--blue, .badge--public { background: var(--blue-soft); color: var(--blue-ink); box-shadow: none; }
.badge--good { background: var(--good-soft); color: var(--good); box-shadow: none; }
.badge--warn { background: var(--warn-soft); color: var(--warn); box-shadow: none; }

/* Search page */
.search-page { position: relative; display: flex; align-items: center; gap: 10px; max-width: 720px; margin-bottom: 32px; }
.search-page > .icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search-page input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px 0 44px; font: 400 17px/1 var(--f-ui); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
}
.search-page input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
#search-results .results__group + .results__group { margin-top: 28px; }
#search-results .eyebrow { margin-bottom: 8px; }
.results__none { color: var(--ink-2); }

/* ---------- forms + buttons ---------- */
.form { display: grid; gap: 18px; max-width: 520px; margin-top: 40px; }
.form label { font-family: var(--f-ui); display: grid; gap: 6px; font-weight: 500; font-size: 15px; }
.form input:not([type="checkbox"]):not([type="radio"]), .form select, .form textarea {
  font: 400 16px/1.3 var(--f-ui); padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  transition: border-color var(--t), box-shadow var(--t);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 15px/1.2 var(--f-ui); padding: 11px 20px; min-height: 44px;
  border: 0; border-radius: 999px; background: var(--blue); color: var(--on-blue); cursor: pointer; text-decoration: none;
  transition: background-color var(--t), box-shadow var(--t), color var(--t);
}
.btn:hover { background: var(--blue-ink); }
.btn[disabled] { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
.btn--ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { min-height: 36px; padding: 8px 16px; font-size: 14px; }
.btn--danger { background: var(--surface); color: var(--danger); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--danger-solid { background: var(--danger); color: var(--surface); box-shadow: none; }
.btn--danger-solid:hover { background: var(--danger); color: var(--surface); filter: brightness(.92); }
.form .btn { justify-self: start; }
.form__row { display: grid; gap: 18px; align-items: end; }
@media (min-width: 560px) {
  .form__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .form__row--3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
}
/* Every single-line control is one height (--ctl-h): text fields, selects, the type picker, spin boxes, and buttons
   that sit beside a field. Fields fill their column and may shrink (an input's default ~20-character width used to
   push one column wider than its neighbour). In a row, fields line up along the bottom, so a label whose hint wraps
   to two lines doesn't push its field below the others. Selects draw their own caret, so they're the same height in
   every browser. */
:root { --ctl-h: 44px; }
.form label { min-width: 0; }
.form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not(.pick__q), .form select {
  width: 100%; min-width: 0; height: var(--ctl-h); min-height: var(--ctl-h);
}
.form select {
  -webkit-appearance: none; appearance: none; padding-right: 36px; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.form .pick { min-height: var(--ctl-h); }
:is(.lib-pick__search, .type-find__box) .btn { min-height: var(--ctl-h); flex: none; }
.form textarea { resize: vertical; line-height: 1.45; }
.form .check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.form .check input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; padding: 0; accent-color: var(--blue); flex: none; }
.form .check .hint { display: block; margin-top: 2px; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 6px; }
.link { font-family: var(--f-ui); font-size: 15px; color: var(--blue-ink); text-underline-offset: 3px; }
.link:hover { color: var(--ink); }
.link--danger { color: var(--danger); }
.link--danger:hover { color: var(--danger); text-decoration-thickness: 2px; }
.link--arrow { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-size: 14px; }
.link--arrow .icon { transition: transform var(--t); }
.link--arrow:hover .icon { transform: translateX(2px); }
.link-btn { font: inherit; font-family: var(--f-ui); background: none; border: 0; padding: 0; color: var(--blue-ink); text-decoration: underline; cursor: pointer; }
.link-btn .icon { vertical-align: -3px; margin-right: 6px; }

/* Radio cards (trade picker) */
.radio-cards { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.radio-cards legend { font: 500 15px/1.3 var(--f-ui); padding: 0; margin-bottom: 4px; }
.radio-cards > .hint { margin-bottom: 8px; }
.form .radio-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color var(--t), background-color var(--t); }
.radio-card:hover { border-color: var(--line-2); }
.radio-card:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.radio-card input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.radio-card__body { display: grid; gap: 2px; }
.radio-card__title { font-weight: 500; }

/* ---------- skeletons (app.js shows them while a page or the inspector loads) ---------- */
.skel { display: block; border-radius: 8px; background: var(--surface-3); animation: skel 1.2s ease-in-out infinite; }
@keyframes skel { 50% { opacity: .45; } }
/* Each block is the size of the thing it stands for: an h1 is an h1's line (same clamp), a row is an icon tile with
   a title and a sub line, tiles are the real .stat boxes. The page lands on the same lines the skeleton drew. */
.skel--h1 { font-size: clamp(30px, 4vw, 40px); height: 1.15em; width: min(340px, 70%); }
.skel--h2 { height: 25px; width: min(180px, 50%); }
.skel--lede { height: 18px; width: min(300px, 60%); margin-top: 14px; }
.skel--kicker { height: 12px; width: 84px; margin: 2px 0 8px; }
.skel--line { height: 14px; width: 60%; margin-top: 10px; }
.skel--short { width: 32%; }
.skel--row { height: 56px; width: 100%; border-radius: var(--r); margin-top: 12px; }
.skel--field { height: 44px; width: 100%; border-radius: var(--r-sm); margin-top: 8px; }
.skel--label { height: 12px; width: 30%; margin-top: 22px; }
.skel--btn { height: 44px; width: 140px; border-radius: 999px; margin-top: 28px; }
.skel--tabs { height: 2px; width: 100%; margin: 39px 0 32px; border-radius: 0; background: var(--line); animation: none; }
.skel-page > .skel--h2 { margin: 56px 0 16px; }
.skel-page > .stats + .skel--h2 { margin-top: 36px; }
.skel--stat-l { height: 14px; width: 45%; margin: 2px 0; }
.skel--stat-n { height: 36px; width: 30%; }
.skel--stat-note { height: 12px; width: 60%; margin: 2px 0; }
.skel-row { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 12px 0; box-sizing: border-box; }
.skel-row + .skel-row { border-top: 1px solid var(--line); }
.skel-row__main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.skel--tile { flex: none; width: 40px; height: 40px; border-radius: var(--r-sm); }
.skel--title { height: 18px; width: min(240px, 46%); }
.skel--sub { height: 14px; width: min(170px, 32%); }
.skel-row:nth-child(3n + 2) .skel--title { width: min(190px, 38%); }
.skel-row:nth-child(3n) .skel--title { width: min(290px, 56%); }
.skel-row:nth-child(2n) .skel--sub { width: min(220px, 42%); }
.skel-list--results { padding: 0 10px; }
.skel-list--results .skel-row { min-height: 52px; padding: 8px 0; border-top: 0; }
.skel-list--results .skel--title { height: 16px; }
/* An editor on its way: the bar's breadcrumb and name, then the diagram's place in the middle of the work area. */
.skel-bar { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.skel--crumb { height: 13px; width: 150px; }
.skel--stage { height: min(60dvh, 640px); width: min(560px, 100%); margin: 40px auto 0; border-radius: var(--r); }
/* Leaving (app.js leaveSkeleton): lifted off the page where it was, fading over the content landing under it. */
.skel-page.is-leaving { position: fixed; z-index: 1; margin: 0; pointer-events: none; }
.skel-page.is-leaving .skel { animation: none; }
main[aria-busy="true"] > :not(.skel-page) { display: none; }

/* ---------- dot grid texture (assets/dotgrid.js, a copy of public/js/dotgrid.js) ----------
   Founder's call (2026-11-12): the one loop besides skeletons/spinners, like the iOS flow header. Headers and the
   signed-out backdrop only, never behind lists, forms or plugin diagrams. Frozen under reduced motion and by the
   pause controls ([data-dotgrid-pause]: account menu switch, corner button on signed-out pages). */
:where([data-dotgrid]) { position: relative; isolation: isolate; }
.dotgrid { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; display: block; }
/* .app is NOT a stacking context (the rail drawer, scrim and inspector must stay above the top bar): the texture is a
   positioned z-index: 0 layer and main, positioned later in the DOM with z-index auto, paints over it. */
.app { position: relative; }
.app__texture {   /* behind the page head, top right; titles on the left stay on a clean canvas */
  position: absolute; z-index: 0; top: 0; right: 0; width: min(80%, 1100px); height: 380px; pointer-events: none;
  isolation: isolate;
}
.app > main { position: relative; }
.app__texture > .dotgrid {
  -webkit-mask-image: radial-gradient(100% 100% at 100% 0, oklch(0% 0 0), oklch(0% 0 0 / .6) 50%, transparent 90%);
          mask-image: radial-gradient(100% 100% at 100% 0, oklch(0% 0 0), oklch(0% 0 0 / .6) 50%, transparent 90%);
}
.app--editor > .app__texture { display: none; }   /* the diagram starts right under the top bar */
@media (max-width: 720px) { .app__texture { width: 100%; height: 200px; } }

/* ---------- bare pages (login, errors) ---------- */
/* A centred card on the neutral chrome, filling the whole viewport (body, not html, carries the colour). */
.bare {
  min-height: 100dvh; box-sizing: border-box; background: var(--chrome);
  display: grid; place-items: center; padding: 48px var(--gutter);
}
.bare main {
  width: 100%; max-width: 440px; box-sizing: border-box; padding: 40px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
}
.bare > .dotgrid {   /* the field fills the backdrop, quieter right around the card */
  position: fixed;
  -webkit-mask-image: radial-gradient(ellipse at center, oklch(0% 0 0 / .3) 25%, oklch(0% 0 0) 85%);
          mask-image: radial-gradient(ellipse at center, oklch(0% 0 0 / .3) 25%, oklch(0% 0 0) 85%);
}
.bare__pause { position: fixed; right: 16px; bottom: 16px; z-index: 2; background: var(--surface); border: 1px solid var(--line); }
/* pause ⇄ play: both icons share one cell and trade places through a blur (the icon swap in "interface polish") */
.bare__pause > .icon { grid-area: 1 / 1; }
.bare__pause .bare__pause-on, .is-paused .bare__pause .bare__pause-off { opacity: 0; filter: blur(4px); scale: .5; }
.is-paused .bare__pause .bare__pause-on { opacity: 1; filter: none; scale: 1; }
.bare .wordmark--lg { margin-bottom: 32px; }
.bare h1 { margin: 0 0 12px; font-size: 30px; line-height: 1.15; }
.bare .lede { font-size: 17px; margin-top: 0; }
.bare p + p { margin-top: 16px; }
.bare .form { max-width: none; margin-top: 28px; }
.bare .form .btn { justify-self: stretch; }
.bare .form + .hint, .bare .form + form, .bare main > .hint { margin-top: 24px; }
.bare .alert { margin: 20px 0 0; }
.qr-wrap { display: grid; place-items: center; margin: 24px 0 8px; }
.qr { width: 216px; height: 216px; border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); }
.setup-key { margin-top: 16px; font-family: var(--f-ui); font-size: 15px; }
.setup-key summary { cursor: pointer; color: var(--blue-ink, var(--blue)); }
.secret-key { font-family: var(--f-ui); font-variant-numeric: tabular-nums; letter-spacing: .08em; word-spacing: .3em; font-size: 15px; background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; }
.backup-codes { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .bare { place-items: start stretch; padding: 16px; }
  .bare main { padding: 28px 20px; }
}

/* ---------- electrical panel editor (packages/plugins/src/electrical-panel.ts) ----------
   The panel is the page: drawn centred like the real thing, each breaker about 1 in × 3 in per pole (it never
   stretches to fill), with each circuit's details beside its breaker like the directory on the door. Rows shrink
   (24–34px) so a 40-space panel fits the screen; a short panel just sits in the middle with space around it.
   --rows is set inline by the plugin. */
/* ---------- plugin editors: toolbar, workspace, side pane (founder's spec 2026-11-15) ----------
   One toolbar under the top bar (who / what, switches, actions), then the workspace filling the window: the work
   area (the diagram, centred, or the sheet's grid edge to edge; each scrolls inside itself) and the side pane on the
   right (live drawing in Sheet mode, then the facts). The pane is resizable (--ed-pane-w, set on <html> by pane.js
   before the first paint) and collapsible (html.ed-pane-collapsed). Narrow screens stack the two and the page
   scrolls as usual. */
.app--editor main { max-width: none; padding: 0; }
.ed { --ed-tb: 64px; display: flex; flex-direction: column; }
.ed-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; min-height: var(--ed-tb); box-sizing: border-box;
  padding: 10px max(var(--gutter), env(safe-area-inset-right)) 10px max(var(--gutter), env(safe-area-inset-left));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
/* Who you're in, on one line on the bar's centre line with every other control: Sites › the site › the name and its
   badge. The name and its badge wrap under the breadcrumb together when the bar is tight. */
.ed-bar__id { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; flex: 1 1 280px; min-width: 0; }
.ed-bar__crumbs { margin: 0; }
.ed-bar__title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ed-bar__crumbs li { font-size: 13px; }
.ed-bar__name { margin: 0; font-size: clamp(19px, 1.6vw, 22px); line-height: 1.2; overflow-wrap: anywhere; }
.ed-bar__switches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ed-bar__tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; margin-left: auto; }
.ed-bar__count { margin-left: 2px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Every control in an editor's bar is the same pill (founder, 2026-11-28): 36px tall, fully round, the same ring
   and label, whether it is a button (.tool), a set of views (.modes) or a switch (.rk-toggle). */
.ed-bar :is(.tool, .modes, .rk-toggle) {
  box-sizing: border-box; height: var(--pill-h); min-height: 0; margin: 0; border-radius: 999px;
  font: 500 14px/1 var(--f-ui); color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2);
}
.ed-bar { --pill-h: 36px; }
.ed-bar .tool--primary { background: var(--blue); color: var(--on-blue); box-shadow: none; }
.ed-bar .tool[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--blue); }
.ed-bar .modes { --pad: 3px; gap: 2px; align-items: stretch; }
.ed-bar .modes__btn { min-height: 0; padding: 0 14px; border-radius: 999px; font-size: 14px; }
.ed-bar .modes__btn[aria-current="page"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.ed-bar .rk-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 0 10px 0 14px; white-space: nowrap; transition: background-color var(--t); }
.ed-bar .rk-toggle:hover { background: var(--surface-2); }
.ed-bar .rk-toggle:has(:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }
.ed-bar .rk-toggle .switch:focus-visible { outline: none; }
/* Toolbar motion (app.js): a control that just left, drawn once more where it was while it fades. A picture only. */
.ed-bar__ghost { position: fixed; z-index: 1; display: flex; margin: 0; pointer-events: none; }
.ed-bar__ghost > * { flex: 1; }
.ed-bar .sheet-status { min-width: 8.5em; }
.ep-info { display: grid; gap: 10px; }
.ep-info__name { font-size: 18px; }
.ep-info__facts { margin: 4px 0 0; display: grid; gap: 2px; font-family: var(--f-ui); }
.ep-info__facts dt { font-size: 13px; color: var(--muted); }
.ep-info__facts dt:not(:first-child) { margin-top: 10px; }
.ep-info__facts dd { margin: 0; font-size: 14px; line-height: 1.4; }
.ep-publish { margin: 0; display: inline-flex; }
/* A new panel / rack starts as a standard one: one quiet line under its name that points at setting the real make
   and model. A sentence with a link, never a card with a button (the pane can be 260px wide). */
.ep-std { margin: 0; font: 400 14px/1.45 var(--f-ui); color: var(--ink-2); text-wrap: pretty; }
.ep-std a { color: var(--blue-ink); text-underline-offset: 3px; white-space: nowrap; }
.ep-std a:hover { color: var(--ink); }
/* "New version available" in the facts pane. */
.ep-generic { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r); background: var(--blue-soft); color: var(--ink); font: 400 14px/1.45 var(--f-ui); }
.ep-generic p { margin: 0; }
/* "New version available": the panel now beside the panel after the update, as small pictures (no names, nothing
   to click). Each figure is a size container, so the panel scales to the room it has. */
.insp--dialog .insp__panel:has(.ep-cmp) { width: min(720px, calc(100vw - 32px)); }
.ep-cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 4px 0 8px; }
.ep-cmp__fig { margin: 0; min-width: 0; container-type: inline-size; padding: 12px 8px 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.ep-cmp__fig figcaption { margin: 0 0 4px; text-align: center; font: 500 12px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ep-cmp__fig:last-child figcaption { color: var(--blue); }
/* "New version available": one heading per breaker / device type that changed, its count beside it. */
.ep-upd__type { margin: 16px 0 4px; font: 600 15px/1.3 var(--f-ui); }
.ep-upd__n { margin-left: 6px; font-weight: 400; color: var(--muted); }
.ep-cmp .ps { --nw: 16px; --can: 8px; --rh: clamp(6px, calc((100cqw - 64px) / var(--wu, 7.1)), 13px); }
.ep-cmp .ps--short { min-height: 0; }
/* No names beside it, so the panel needn't sit dead centre: a side meter takes its own side's room. */
.ep-cmp :is(.ps__grid, .ps__top) { grid-template-columns: minmax(calc(var(--e-l, 0px) + var(--can) + 1px), 1fr) var(--nw) var(--bw) var(--busw) var(--bw) var(--nw) minmax(calc(var(--e-r, 0px) + var(--can) + 1px), 1fr); }
.ep-cmp .ps--one :is(.ps__grid, .ps__top) { grid-template-columns: minmax(calc(var(--e-l, 0px) + var(--can) + 1px), 1fr) var(--nw) var(--bw) var(--busw) minmax(calc(var(--e-r, 0px) + var(--can) + 1px), 1fr); }
.ep-cmp__fig { overflow: hidden; }
.ep-cmp .ps :is(.ps__d, .ps__main-cap) { visibility: hidden; }
.ep-cmp .ps :is(.ps__label, .ps__meta, .ps__feeds, .ps__add, .ps__main-cap) { display: none; }
.ep-cmp .ps__n { font-size: 8px; }
.ep-cmp .ps__h { font-size: 8px; }
/* Toolbar actions: labelled buttons, the plugin's first (Add is the blue one), then Details and Files. */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tool {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px 0 10px; border: 0; border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 500 14px/1 var(--f-ui); color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background-color var(--t), box-shadow var(--t);
}
.tool:hover { background: var(--surface-2); }
.tool--primary { background: var(--blue); color: var(--on-blue); box-shadow: none; }
.tool--primary:hover { background: var(--blue); } /* blue-ink is a light text blue in dark mode: keep white on blue */
.tool[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--blue); }
.tool .icon { flex: none; width: 18px; height: 18px; }
.tool:focus-visible { outline-offset: 3px; }
.ep-count { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font: 400 14px/1.4 var(--f-ui); color: var(--ink-2); }
.ep-count strong { color: var(--ink); font-weight: 600; }
.ep-tip { margin-top: 6px; font: 400 13px/1.4 var(--f-ui); color: var(--muted); }
/* Linked equipment (views/power.ts), under the facts in a panel / rack editor's side pane: what feeds it, what it
   feeds, what powers a rack. Each link's tap page switch is a submit button dressed as the .switch (no script). */
.pl { display: grid; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.pl__head { font-size: 15px; }
.pl__sec { display: grid; gap: 6px; }
.pl__title { margin: 0; font: 500 13px/1.3 var(--f-ui); color: var(--muted); }
.pl__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pl__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.pl__what { display: grid; gap: 1px; min-width: 0; font: 400 14px/1.35 var(--f-ui); overflow-wrap: anywhere; }
.pl__sub { font-size: 13px; color: var(--muted); }
.pl__ctl { display: flex; align-items: center; gap: 14px; flex: none; }
.pl__ctl form { margin: 0; display: inline-flex; }
.pl__tap { align-items: center; gap: 8px; }
.pl__tapword { font: 400 13px/1 var(--f-ui); color: var(--muted); }
.pl__ctl .link-btn { font-size: 13px; color: var(--muted); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.pl__ctl .link-btn:hover { color: var(--danger); text-decoration-color: currentColor; }
.pl__state { flex: none; font: 400 13px/1.3 var(--f-ui); color: var(--muted); }
.pl__add { margin: 0; display: grid; gap: 8px; justify-items: start; }
.pl__label { display: grid; gap: 4px; width: 100%; font: 500 13px/1.3 var(--f-ui); }
.pl__label select { width: 100%; }
.pl__hint { margin: 0; font: 400 13px/1.4 var(--f-ui); color: var(--muted); text-wrap: pretty; }
button.switch { border: 0; padding: 0; }
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"]::after { transform: translateX(16px); transform-origin: 100% 50%; }

/* Mode (Diagram | Sheet) and the plugin's switches (a rack's Front | Rear): segmented, plain links. */
.modes { --pad: 4px; display: inline-grid; grid-auto-flow: column; gap: 4px; padding: var(--pad); background: var(--surface-2); border-radius: var(--r-sm); }
.modes__btn {
  display: inline-flex; align-items: center; min-height: 28px; padding: 4px 14px; border-radius: calc(var(--r-sm) - var(--pad, 4px));
  font: 500 13px/1 var(--f-ui); color: var(--ink-2); text-decoration: none; transition: background-color var(--t), color var(--t), box-shadow var(--t);
}
.modes__btn:hover { color: var(--ink); }
.modes__btn[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.sheet-status { margin: 0; min-height: 1em; font: 400 13px/1.3 var(--f-ui); color: var(--muted); }
.sheet-status.is-bad { color: var(--danger); font-weight: 500; }

/* The workspace. Narrow: stacked, the page scrolls. */
.ed-work { min-width: 0; padding: 24px var(--gutter) 32px; }
.ed--sheet .ed-work { padding: 16px var(--gutter); }
.ed-work > .alert { margin: 0 0 16px; }
.ed-pane { position: relative; min-width: 0; background: var(--surface); border-top: 1px solid var(--line); }
.ed-pane__body { display: grid; gap: 24px; align-content: start; padding: 24px var(--gutter) 48px; }
.ed-pane__body > .notice { margin: 0; font-size: 14px; }
.ed-pane__handle, .ed-pane__toggle { display: none; }
@media (min-width: 1024px) {
  .app--editor main { height: calc(100dvh - var(--bar-h)); overflow: hidden; display: flex; flex-direction: column; }
  .ed { flex: 1; min-height: 0; }
  .ed-bar { padding-inline: 24px; }
  .ed-ws {
    flex: 1; min-height: 0; display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(260px, var(--ed-pane-w, 360px), 60%);
    transition: grid-template-columns var(--t) var(--ease);
  }
  .ed-ws--solo { grid-template-columns: minmax(0, 1fr); }   /* nothing to show beside it yet (e.g. "Add the panel") */
  .is-resizing-pane .ed-ws { transition: none; }
  .is-resizing-pane, .is-resizing-pane * { cursor: col-resize !important; user-select: none; }
  .ed-work { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 24px 32px 32px; }
  .ed--sheet .ed-work { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
  .ed--sheet .ed-work > .alert { margin: 12px 16px; }
  .ed-pane { min-height: 0; display: flex; flex-direction: column; border-top: 0; border-left: 1px solid var(--line); }
  /* A size container: the live drawing scales to the pane's width and height (cqw / cqh). */
  .ed-pane__body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; container: edpane / size; padding: 24px 24px 40px; }
  /* The resize handle: the pane's left edge (a wider hit area than the 2px line it lights up). */
  .has-pane-js .ed-pane__handle { display: block; position: absolute; z-index: 3; top: 0; bottom: 0; left: -6px; width: 12px; cursor: col-resize; touch-action: none; }
  .ed-pane__handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 2px; background: transparent; transition: background-color var(--t); }
  .ed-pane__handle:hover::after, .ed-pane__handle:focus-visible::after, .is-resizing-pane .ed-pane__handle::after { background: var(--blue); }
  .ed-pane__handle:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
  /* Collapse / expand: a round button in the pane's top corner, the toolbar's own pill (same ring, fully round).
     Collapsed, the pane is a strip just wide enough to hold it, so the button stays exactly where it was: whole,
     inside the strip, never hanging over the diagram. */
  .has-pane-js .ed-pane__toggle {
    display: inline-grid; position: absolute; z-index: 4; top: 8px; left: 8px; width: 28px; height: 28px; min-width: 0; padding: 0;
    border-radius: 999px; corner-shape: round; background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2);
  }
  .has-pane-js .ed-pane__toggle:hover { background: var(--surface-2); color: var(--ink); }
  .has-pane-js .ed-pane__body { padding-top: 44px; }
  .ed-pane__toggle .icon { width: 16px; height: 16px; transition: transform var(--t) var(--ease); }
  .ed-pane-collapsed .ed-ws:not(.ed-ws--solo) { grid-template-columns: minmax(0, 1fr) 44px; }
  .ed-pane-collapsed .ed-pane { background: var(--surface); }
  .ed-pane-collapsed .ed-pane__body, .ed-pane-collapsed .ed-pane__handle { display: none !important; }
  .ed-pane-collapsed .ed-pane__toggle .icon { transform: rotate(180deg); }
  /* The diagram fills the work area's height (the toolbar takes --ed-tb). */
  .ed-work .ps { --rh: clamp(22px, calc((100dvh - var(--bar-h) - var(--ed-tb) - 112px) / var(--rows, 20) - 3px), 52px); }
  .ed-work .ps--short { min-height: calc(100dvh - var(--bar-h) - var(--ed-tb) - 96px); }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) { .ed-ws, .ed-pane__toggle .icon { transition: none; } }

/* ---------- Sheet mode (packages/plugins/src/sheet.ts, assets/sheet.js; founder's call 2026-11-15) ----------
   A spreadsheet grid: it fills the work area edge to edge and scrolls inside itself, with the header row and the
   first column (Space / U) frozen, cell gridlines and compact rows; the fields look like cells. Rows save themselves
   with JS; without it each row has a Save button. */
.sheet { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ed-work .sheet { flex: 1; }
.sheet__hint { margin: 0; font: 400 14px/1.45 var(--f-ui); color: var(--ink-2); }
.js .sheet__nojs { display: none; }
.sheet__scroll { scroll-padding: 32px 0 0 48px; overflow: auto; max-height: 75dvh; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overscroll-behavior: contain; }
@media (min-width: 1024px) {
  .ed-work .sheet__scroll { flex: 1; min-height: 0; max-height: none; border: 0; border-radius: 0; }
}
.sheet__table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font: 400 13px/1.3 var(--f-ui); font-variant-numeric: tabular-nums; }
.sheet__table th, .sheet__table td { padding: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; }
.sheet__table thead th {
  position: sticky; top: 0; z-index: 2; padding: 7px 8px; text-align: left; white-space: nowrap;
  font: 600 11px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  background: var(--surface-2); border-bottom-color: var(--line-2);
}
.sheet__table thead th:first-child { left: 0; z-index: 3; }
.sheet__table tbody th { position: sticky; left: 0; z-index: 1; background: var(--surface-2); }
.sheet__table thead th:first-child, .sheet__table tbody th { border-right-color: var(--line-2); }
.sheet__private { font-weight: 400; letter-spacing: .04em; text-transform: none; }
.sheet__space { width: 48px; min-width: 48px; padding: 0 8px !important; text-align: right; font: 600 12px/1 var(--f-ui); color: var(--ink-2); }
.sheet__h--space { text-align: right !important; }
.sheet__cell input, .sheet__cell select, .sheet__cell textarea, .sheet__cell .pick {
  display: block; width: 100%; min-width: 0; min-height: 30px; box-sizing: border-box; margin: 0; padding: 5px 8px; border: 0; border-radius: 0;
  background: transparent; color: var(--ink); font: inherit; box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow var(--t), background-color var(--t);
}
/* Notes read as one clipped line at rest and open to their full text while being edited. */
.sheet__cell textarea { resize: none; height: 30px; min-height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet__cell textarea:focus { height: auto; white-space: pre-wrap; overflow: auto; field-sizing: content; max-height: 160px; }
.sheet__cell input:hover, .sheet__cell select:hover, .sheet__cell textarea:hover { background: var(--surface-2); }
/* The active cell: a clear blue ring, like a spreadsheet's selected cell. */
.sheet__cell input:focus, .sheet__cell select:focus, .sheet__cell textarea:focus, .sheet__cell .pick:focus-within {
  outline: none; background: var(--surface); box-shadow: inset 0 0 0 2px var(--blue);
}
.sheet__cell input[readonly] { color: var(--ink-2); background: transparent; box-shadow: none; }
.sheet__cell input[readonly]:focus { box-shadow: inset 0 0 0 2px var(--line-2); }
.sheet__cell .pick { padding: 0 26px 0 0; }
.sheet__cell .pick::after { right: 10px; width: 6px; height: 6px; }
.sheet__cell .pick__q { min-height: 30px; padding: 5px 8px; }
.sheet__cell--label { min-width: 200px; }
.sheet__cell--type { min-width: 180px; }
.sheet__cell--amps, .sheet__cell--poles { width: 64px; }
.sheet__cell--kind { width: 124px; }
.sheet__cell--feeds { min-width: 160px; }
.sheet__cell--notes { min-width: 180px; }
.sheet__num input { text-align: right; }
.sheet__muted { padding: 0 8px !important; color: var(--muted); }
.sheet__row--covered > td { height: 30px; font-size: 12px; background: var(--surface-2); }
.sheet__row--empty input::placeholder { color: var(--muted); }
.sheet__row.is-current > th { color: var(--blue-ink); box-shadow: inset 3px 0 0 var(--blue); }
.sheet__row.is-invalid > th, .sheet__row.is-unsaved > th { color: var(--danger); box-shadow: inset 3px 0 0 var(--danger); }
.sheet__row.is-invalid .sheet__cell input, .sheet__row.is-invalid .sheet__cell select { background: var(--danger-soft); }
.sheet__row[data-sheet-inert]:not(.sheet__row--covered) td { padding: 6px 8px; }
.sheet__act { width: 1%; padding: 0 4px !important; white-space: nowrap; }
.sheet__form, .sheet__remove { display: inline-flex; margin: 0; vertical-align: middle; }
.js .sheet__save { display: none; }
.sheet__x {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--muted); transition: background-color var(--t), color var(--t);
}
.sheet__x:hover, .sheet__x:focus-visible { background: var(--danger-soft); color: var(--danger); }
/* A row's error line spans the grid; its words stay in view while the grid scrolls sideways. */
.sheet__msg td { padding: 6px 8px 8px !important; background: var(--surface); }
.sheet__msg .alert { position: sticky; left: 56px; display: inline-block; margin: 0 10px 0 0; padding: 6px 10px; border-radius: 8px; font: 500 13px/1.4 var(--f-ui); }
.sheet__msg-btn { vertical-align: middle; }
.sheet__cell--name { min-width: 170px; }
.sheet__cell--role { min-width: 140px; }
.sheet__cell--ip { min-width: 130px; }
.sheet__cell--height, .sheet__cell--tag { width: 80px; }
.sheet__cell--face { width: 92px; }

/* The live drawing (Sheet mode, top of the side pane): the editor's own panel / rack with nothing to drag. The panel
   is scaled to fit the pane's width and height (the pane body is a size container); the rack takes the full width. */
.ed-live { min-width: 0; }
.ed-live .ps {
  --nw: 22px;
  --rh: clamp(10px, min(calc((100cqh - 170px) / var(--rows, 20) - 3px), calc((100cqw - 200px) / var(--wu, 7.1))), 30px);
}
.ed-live .ps--short { min-height: 0; }
/* A narrow pane has no room for the circuit names beside the panel, and the grid already has them (founder request
   2026-11-15): drop the words and let the panel take the width. They come back once the pane is dragged wider. */
@container edpane (max-width: 479px) {
  .ed-live .ps { --rh: clamp(10px, min(calc((100cqh - 170px) / var(--rows, 20) - 3px), calc((100cqw - 76px) / var(--wu, 7.1))), 30px); }
  .ed-live .ps :is(.ps__label, .ps__meta, .ps__feeds, .ps__add, .ps__main-cap) { display: none; }
}
.ed-live .ps__label { font-size: 12px; }
.ed-live .ps__meta, .ed-live .ps__feeds { font-size: 11px; }
.ed-live .is-sheet-current { background: var(--blue-soft); }
.ed-live .ps__b.is-sheet-current, .ed-live .ps__bh.is-sheet-current { box-shadow: inset 0 0 0 2px var(--blue); }
/* The rack is drawn as wide as the pane (founder's call 2026-11-15), growing and shrinking with it; the pane scrolls
   for the rest of a tall rack (sheet.js brings the focused row's device into view). The panel fits the pane instead. */
.ed-live .rk__elev { grid-template-columns: minmax(0, 1fr); padding: 28px 0 16px; }
.ed-live .rk__frame { width: 100%; }
.ed-live .rk__dev.is-sheet-current { --dev-bg: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
.ed-live .rk__slot a.is-sheet-current { box-shadow: inset 0 0 0 1px var(--blue); }

.ps {
  /* One space: as tall as fills the screen (minus the gaps), within readable bounds. */
  --rh: clamp(22px, calc((100dvh - var(--bar-h) - 88px) / var(--rows, 20) - 3px), 52px);
  --slot: 3;                    /* a breaker pole: about 1 in × 3 in (a panel's face can say otherwise) */
  --bw: calc(var(--rh) * var(--slot));
  --nw: 26px;                   /* space numbers stamped on the deadfront */
  --busw: calc(var(--rh) * 1.1);
  --can: 14px;                  /* enclosure margin around the breakers */
  display: grid; align-content: start; padding: calc(var(--can) + 2px) 0 calc(var(--can) + 2px);
}
/* A very short panel (a few spaces) sits in the middle of the screen instead of hugging the top. */
.ps--short { align-content: center; min-height: calc(100dvh - var(--bar-h) - 72px); }
.ps__grid {
  list-style: none; margin: 0; padding: 0; position: relative;
  display: grid; row-gap: 3px;
  grid-template-rows: repeat(var(--rows, 20), var(--rh));
  grid-template-columns: minmax(0, 1fr) var(--nw) var(--bw) var(--busw) var(--bw) var(--nw) minmax(0, 1fr);
}
.ps--one .ps__grid { grid-template-columns: minmax(0, 1fr) var(--nw) var(--bw) var(--busw) minmax(0, 1fr); }
/* The enclosure (deadfront) behind the breakers. */
.ps__grid::before {
  content: ""; grid-column: 2 / 7; grid-row: 1 / -1;
  /* The deadfront grows to take in the main and a meter socket (--e-*, set below). */
  margin: calc(-1 * var(--can) - var(--e-t, 0px)) calc(-1 * var(--can) - var(--e-r, 0px)) calc(-1 * var(--can) - var(--e-b, 0px)) calc(-1 * var(--can) - var(--e-l, 0px));
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px;
}
.ps--one .ps__grid::before { grid-column: 2 / 5; }
.ps__bus {
  grid-column: 4; grid-row: 1 / -1; margin-inline: 5px;
  display: grid; grid-template-rows: subgrid; background: var(--surface-3); border-radius: 3px;
}
.ps__bus span { display: grid; place-items: center; font: 600 10px/1 var(--f-ui); letter-spacing: .04em; color: var(--ink-2); }

.ps__slot { display: grid; grid-template-columns: subgrid; min-width: 0; }
.ps__slot > * { grid-row: 1; min-width: 0; }
.ps__slot--l { grid-column: 1 / 4; }
.ps__slot--r { grid-column: 5 / 8; }
.ps__slot--l .ps__d { grid-column: 1; }
.ps__slot--l .ps__n { grid-column: 2; }
.ps__slot--l .ps__b { grid-column: 3; }
.ps__slot--r .ps__b { grid-column: 1; }
.ps__slot--r .ps__n { grid-column: 2; }
.ps__slot--r .ps__d { grid-column: 3; }

/* Each circuit's details, beside its breaker. Left side mirrors: the label sits next to the panel. */
.ps__d {
  display: flex; align-items: center; gap: 8px; padding: 0 calc(var(--can) + 10px) 0 12px; margin-right: 0;
  border-radius: 8px; text-decoration: none; color: var(--ink); font-family: var(--f-ui); line-height: 1.2;
  transition: background-color var(--t), color var(--t);
}
.ps__slot--l .ps__d { flex-direction: row-reverse; text-align: right; }
.ps__slot--r .ps__d { padding: 0 12px 0 calc(var(--can) + 10px); }
.ps__label { flex: 0 1 auto; min-width: 2.5em; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps__meta { flex: none; font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ps__feeds { flex: 0 3 auto; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps__private { color: var(--warn); }
/* Narrow lines drop what matters least first (feeds, then ratings), never cutting the label to a stub. */
.ps__d { container-type: inline-size; }
@container (max-width: 300px) { .ps__feeds { display: none; } }
@container (max-width: 190px) { .ps__meta { display: none; } }
a.ps__d:hover { background: var(--surface-2); }
a.ps__d[aria-current="true"] { background: var(--blue-soft); }
.ps__add { font-size: 13px; color: var(--blue-ink); opacity: 0; transition: opacity var(--t); }
.ps__slot--empty:hover .ps__add, a.ps__d:focus-visible .ps__add, a.ps__d[aria-current="true"] .ps__add { opacity: 1; }

.ps__n {
  position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-around; align-items: center;
  font: 500 11px/1 var(--f-ui); color: var(--muted); font-variant-numeric: tabular-nums;
}

/* Breakers: one grey, a handle carrying the amp rating, a test button on AFCI / GFCI. Multi-pole = one body, tied handle. */
.ps__b {
  position: relative; z-index: 1; display: block; margin: 1px 0; border-radius: 4px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 0 oklch(var(--scrim) / .06);
  transition: box-shadow var(--t), background-color var(--t), translate var(--t) var(--ease);
}
.ps__h {
  position: absolute; inset: 16% 33%; display: grid; place-items: center; border-radius: 3px;
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line);
  font: 600 10px/1 var(--f-ui); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.ps__t {
  position: absolute; top: calc(var(--rh) / 2); width: calc(var(--rh) * .34); aspect-ratio: 1; translate: 0 -50%;
  border-radius: 2px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2);
}
.ps__slot--l .ps__t { left: 9%; }
.ps__slot--r .ps__t { right: 9%; }
.ps__b--empty { background: none; box-shadow: none; outline: 1px dashed var(--line-2); outline-offset: -1px; }
.ps__slot:hover .ps__b { box-shadow: inset 0 0 0 1px var(--blue); }
.ps__slot--empty:hover .ps__b { box-shadow: none; outline-color: var(--blue); }
.ps__slot:has([aria-current="true"]) .ps__b { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.ps__slot--empty:has([aria-current="true"]) .ps__b { outline: 2px solid var(--blue); }

/* A tandem: two 1-pole circuits in one space. One body, two half-height handles (A on top), and their details stacked. */
.ps__b--tandem { display: grid; grid-template-rows: 1fr 1fr; gap: 2px; padding: 2px; }
.ps__bh { position: relative; display: block; border-radius: 3px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; transition: box-shadow var(--t), background-color var(--t); }
.ps__bh .ps__h { inset: 10% 33%; font-size: 9px; }
/* A handle tie: two 1-pole breakers next to each other, tied so they switch together. The bar is drawn up from the
   lower of the two (it comes later, so it paints over what's between): tandem halves that touch (inner), the
   outside two of a quad (outer), or two full-size breakers. A quad circuit's two handles are joined by the same
   bar (its outside pair outer, its inside pair inner). */
.ps__bh--tie::after, .ps__b--tie::after {
  content: ""; position: absolute; z-index: 2; left: 16%; width: 7%; min-width: 4px; bottom: 50%; height: calc(var(--rh) / 2 + 3px);
  border-radius: 2px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2);
}
.ps__bh--tie-outer::after { left: 5%; height: calc(var(--rh) * 1.5 + 3px); }
.ps__b--tie-full::after { height: calc(var(--rh) + 3px); }
.ps__bh--empty { background: none; box-shadow: none; outline: 1px dashed var(--line-2); outline-offset: -1px; }
/* The wrapper never pads: each half (.ps__dh) carries the inset, so its names line up with full-width circuits.
   !important because the side, meter and phone rules pad .ps__d with higher specificity (that doubled the indent). */
.ps__d--tandem { display: grid; grid-template-rows: 1fr 1fr; align-items: stretch; gap: 0; padding: 0 !important; }
.ps__dh {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 calc(var(--can) + 10px) 0 12px; border-radius: 6px;
  text-decoration: none; color: var(--ink); font-family: var(--f-ui); line-height: 1.1; transition: background-color var(--t);
}
.ps__slot--l .ps__dh { flex-direction: row-reverse; text-align: right; }
.ps__slot--r .ps__dh { padding: 0 12px 0 calc(var(--can) + 10px); }
.ps__dh .ps__label { font-size: 13px; }
.ps__dh .ps__meta { font-size: 11px; }
a.ps__dh:hover { background: var(--surface-2); }
a.ps__dh[aria-current="true"] { background: var(--blue-soft); }
.ps__dh--add:hover .ps__add, .ps__dh--add:focus-visible .ps__add { opacity: 1; }
.ps__slot--tandem:hover .ps__b { box-shadow: none; }
.ps__slot--tandem .ps__bh:hover { box-shadow: inset 0 0 0 1px var(--blue); }
.ps__slot--tandem:has(.ps__dh[aria-current="true"]) .ps__b { box-shadow: none; background: var(--surface); }

/* The main, at the top: one short breaker as wide as the breaker columns, outside edge to outside edge (founder's call
   2026-11-15), amps on its handle; or the lugs, centred. The deadfront grows up to take it in. */
.ps { --maingap: 14px; --e-t: calc(var(--main-t, 0px) + var(--meter-t, 0px)); --e-b: calc(var(--main-b, 0px) + var(--meter-b, 0px)); }
.ps--main { --mainh: calc(var(--rh) * 1.5); --main-t: calc(var(--mainh) + var(--maingap)); }
.ps__top {
  position: relative; z-index: 1; display: grid; height: var(--mainh); margin-bottom: var(--maingap);
  grid-template-columns: minmax(0, 1fr) var(--nw) var(--bw) var(--busw) var(--bw) var(--nw) minmax(0, 1fr);
}
.ps--one .ps__top { grid-template-columns: minmax(0, 1fr) var(--nw) var(--bw) var(--busw) minmax(0, 1fr); }
.ps__main {
  position: relative; grid-column: 3 / 6; display: flex; align-items: center; justify-content: center; height: 100%;
  border-radius: 8px; text-decoration: none; color: var(--ink-2); font: 500 12px/1.2 var(--f-ui);
}
.ps--one .ps__main { grid-column: 3 / 5; }
.ps__main-b {
  position: relative; display: block; height: 100%; flex: 1;
  border-radius: 4px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 0 oklch(var(--scrim) / .06);
  transition: box-shadow var(--t);
}
.ps__main-h {
  position: absolute; inset: 22% 0; width: calc(var(--rh) * 2.4); margin-inline: auto; display: grid; place-items: center; border-radius: 3px;
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line);
  font: 600 11px/1 var(--f-ui); color: var(--ink); font-variant-numeric: tabular-nums;
}
.ps__lugs {
  display: flex; align-items: center; justify-content: space-around; height: calc(var(--rh) * 1.2); width: calc(var(--poles, 2) * var(--rh));
  border-radius: 4px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2);
}
.ps__lugs span { width: calc(var(--rh) * .42); aspect-ratio: 1; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
/* The words sit beside the main, lined up with the right-hand circuit names. */
.ps__main-cap { position: absolute; left: calc(100% + var(--nw) + var(--can) + var(--e-r, 0px) + 10px); top: 50%; translate: 0 -50%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ps--one .ps__main-cap { left: calc(100% + var(--can) + var(--e-r, 0px) + 10px); }

/* A panel's face (PanelFace in @docguys/shared; classes and custom properties from faceLook() in the plugin): the
   main at the bottom, a main breaker with its own proportions, and a meter socket in the same enclosure. The socket
   is one grey ring like everything else. Side meters sit beside the breakers, --mup percent down from the top. */
.ps--main.ps--main-bottom { --main-t: 0px; --main-b: calc(var(--mainh) + var(--maingap)); }
.ps__top--bottom { margin: var(--maingap) 0 0; }
.ps--mainr { --mainh: calc((var(--bw) * 2 + var(--busw)) / var(--mainr)); }
.ps--one.ps--mainr { --mainh: calc((var(--bw) + var(--busw)) / var(--mainr)); }
.ps:is(.ps--meter-left, .ps--meter-right, .ps--meter-above, .ps--meter-below) { --mw: calc(var(--rh) * 7.5); --md: calc(var(--rh) * 6); }
.ps--meter-left { --e-l: var(--mw); }
.ps--meter-right { --e-r: var(--mw); }
.ps--meter-above { --meter-t: calc(var(--md) + var(--maingap)); }
.ps--meter-below { --meter-b: calc(var(--md) + var(--maingap)); }
.ps__meter { position: relative; z-index: 1; grid-row: 1 / -1; grid-column: 1; justify-self: end; width: var(--mw); margin-right: var(--can); pointer-events: none; }
.ps--meter-right .ps__meter { grid-column: 7; justify-self: start; margin: 0 0 0 var(--can); }
.ps--one.ps--meter-right .ps__meter { grid-column: 5; }
.ps__meter .ps__socket { position: absolute; left: 50%; translate: -50% 0; top: clamp(0px, calc(var(--mup, 50) * 1% - var(--md) / 2), calc(100% - var(--md))); }
.ps__socket { display: grid; place-items: center; width: var(--md); aspect-ratio: 1; border-radius: 50%; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.ps__socket span { width: 74%; aspect-ratio: 1; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.ps__mrow { position: relative; z-index: 1; display: grid; place-items: center; height: var(--md); margin-bottom: var(--maingap); }
.ps__mrow--below { margin: var(--maingap) 0 0; }
/* Circuit names step out past a side meter. */
.ps--meter-left .ps__slot--l :is(.ps__d, .ps__dh) { margin-right: var(--mw); }
.ps--meter-right .ps__slot--r :is(.ps__d, .ps__dh) { margin-left: var(--mw); }
/* One column with the meter on its left: the names go on the right, beside the breakers, not out past the meter. */
.ps--one.ps--meter-left .ps__slot--l { grid-column: 1 / 6; }
.ps--one.ps--meter-left .ps__slot--l .ps__d { grid-column: 5; margin-right: 0; flex-direction: row; text-align: left; padding: 0 12px 0 calc(var(--can) + 10px); }
.ps--one.ps--meter-left .ps__slot--l .ps__dh { margin-right: 0; flex-direction: row; text-align: left; padding: 0 12px 0 calc(var(--can) + 10px); }
a.ps__main:hover .ps__main-b, a.ps__main:focus-visible .ps__main-b { box-shadow: inset 0 0 0 1px var(--blue); }
a.ps__main[aria-current="true"] .ps__main-b { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }

/* The popup beside a breaker: a rectangle whose panel-facing side comes to a point at the breaker (a ticket). */
.ps__pop { position: relative; z-index: 20; grid-column: 1; min-width: 0; pointer-events: none; }
.ps--two .ps__pop--r { grid-column: 7; }
.ticket {
  --tip: 13px;     /* the pointer: an even triangle, 16px tall, 13px deep */
  --tiph: 8px;
  --at: 30px;      /* the pointer's centre, from the ticket's top (bottom when it grows upwards) */
  position: absolute; top: calc(var(--rh) / 2 - var(--at)); width: clamp(320px, 100% + 40px, 420px);
  pointer-events: auto; outline: none;
  /* The outline follows the pointer too: two hairline shadows, then the lift. */
  filter: drop-shadow(0 0 .5px var(--ticket-edge)) drop-shadow(0 0 .5px var(--ticket-edge)) drop-shadow(0 14px 28px oklch(var(--scrim) / .18));
}
.ps__pop--l .ticket { right: var(--can); }
.ps__pop--r .ticket { left: var(--can); }
.ps__pop--up .ticket { top: auto; bottom: calc(var(--rh) / 2 - var(--at)); }
.ticket__in {
  background: var(--ticket-bg); border-radius: 14px; padding: 18px 20px 20px;
  /* Never taller than the work area it sits in (under the top bar and the editor's toolbar): a long form scrolls
     inside the popup, so opening one never scrolls the page. app.js sets the exact room once it's placed. */
  max-height: calc(100dvh - var(--bar-h) - var(--ed-tb, 0px) - 24px); overflow-y: auto; overscroll-behavior: contain;
}
.ps__pop--l .ticket__in { margin-right: var(--tip); }
.ps__pop--r .ticket__in { margin-left: var(--tip); }
.ticket::after {
  content: ""; position: absolute; top: calc(var(--at) - var(--tiph));
  width: calc(var(--tip) + 1px); height: calc(var(--tiph) * 2); background: var(--ticket-bg);
}
.ps__pop--l .ticket::after { right: 0; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.ps__pop--r .ticket::after { left: 0; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.ps__pop--up .ticket::after { top: auto; bottom: calc(var(--at) - var(--tiph)); }
/* No room on its own side (a narrow work area): app.js opens it on the breaker's other side, its point turned
   round, or, when neither side fits, slides it into view with no point (fitSideways). */
.ps__pop .ticket.is-flip-r .ticket__in { margin: 0 0 0 var(--tip); }
.ps__pop .ticket.is-flip-l .ticket__in { margin: 0 var(--tip) 0 0; }
.ps__pop .ticket.is-flip-r::after { left: 0; right: auto; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.ps__pop .ticket.is-flip-l::after { right: 0; left: auto; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.ps__pop .ticket.is-loose .ticket__in { margin: 0; }
.ps__pop .ticket.is-loose::after { display: none; }
.ticket__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ticket__titles { min-width: 0; }
.ticket__kicker { font: 500 12px/1.3 var(--f-ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.ticket__head h2 { font-size: 20px; overflow-wrap: anywhere; }
.ticket__close {
  flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; margin: -6px -8px 0 0; border-radius: var(--r-sm);
  color: var(--ink-2); transition: background-color var(--t), color var(--t);
}
.ticket__close:hover { background: var(--surface-2); color: var(--ink); }
.ticket .form { gap: 14px; }
.ticket .form__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ticket .form__row--space { grid-template-columns: 84px minmax(0, 1fr); }
.form__inline { display: flex; gap: 8px; align-items: center; min-width: 0; }
.form .form__inline input { flex: 1 1 auto; width: 100%; min-width: 0; }
.ticket .form__actions { gap: 10px 16px; margin-top: 2px; }
.ticket__danger { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.link-btn--danger { color: var(--danger); font-size: 14px; }
.ticket__sub { margin: 14px 0 6px; font: 600 14px/1.3 var(--f-ui); }
.ticket__sub:first-child { margin-top: 0; }

/* A popup's quiet rows (founder's call 2026-11-21: the form stays short): Notes and the handle tie fold away
   behind one line each (a <details>, so they work with no script). */
.fold { margin: 0; min-width: 0; }
.fold__row {
  display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 28px; cursor: pointer; list-style: none;
  font: 500 14px/1.3 var(--f-ui); color: var(--blue-ink); border-radius: 6px; transition: scale var(--t);
}
.fold__row::-webkit-details-marker { display: none; }
.fold__row::before {
  content: ""; flex: none; width: 6px; height: 6px; margin: 0 4px 0 2px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  rotate: -45deg; transition: rotate var(--t);
}
.fold[open] > .fold__row::before { rotate: 45deg; }
.fold__row:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.fold__row:active { scale: .97; }
.fold__row .hint { font-size: 13px; }
.notes-fold[open] > .fold__row { margin-bottom: 8px; }
.notes-fold__f + .notes-fold__f { margin-top: 10px; }
/* The handle tie: its row sits under the form. Open, the card takes the popup and the row reads "Back to the
   breaker" (its arrow points back). */
.tie-fold { margin-top: 12px; }
.tie-fold + .tie-fold { margin-top: 4px; }
.tie-fold__open, .tie-fold[open] .tie-fold__closed { display: none; }
.tie-fold[open] .tie-fold__open { display: inline; }
.tie-fold[open] > .fold__row { margin-bottom: 14px; }
.tie-fold[open] > .fold__row::before { rotate: 135deg; margin: 0 2px 0 4px; }
.tie-fold[open] { margin-top: 0; }
.tie-fold .tieview { margin: 0; }
.ticket__body:has(> .tie-fold[open]) > :not(.tie-fold[open]) { display: none; }

/* Add a breaker: the names follow the picked type (data-size on the picked option, from the server): one label,
   or one per circuit of a tandem, a quad, or a quad with 1-pole outside handles ("split"). CSS only. */
.nm__t, .nm-hint { display: none; }
.form--add:not(:has(option[data-size]:checked)) .nm__t--full,
.form--add:has(option[data-size="tandem"]:checked) .nm__t--tandem,
.form--add:has(option[data-size="quad"]:checked) .nm__t--quad,
.form--add:has(option[data-size="split"]:checked) .nm__t--split { display: inline; }
.form--add:not(:has(option[data-size]:checked)) :is(.nm--b, .nm--c),
.form--add:not(:has(option[data-size="split"]:checked)) .nm--c,
.form--add:has(option[data-size]:checked) .nm--feeds { display: none; }
.form--add:has(option[data-size="tandem"]:checked) .nm-hint--tandem,
.form--add:has(option[data-size="quad"]:checked) .nm-hint--quad,
.form--add:has(option[data-size="split"]:checked) .nm-hint--split { display: block; margin: -4px 0 0; font-size: 13px; line-height: 1.4; }

/* A tandem or quad edited as the one breaker it is: a row per circuit (its spot and rating, its name, its feeds). */
.circuits { display: grid; gap: 12px; }
.circuit { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 6px 8px; align-items: center; }
.circuit__n { grid-column: 1 / -1; font: 600 13px/1.3 var(--f-ui); color: var(--ink); font-variant-numeric: tabular-nums; }
.circuit__a { margin-left: 4px; font-weight: 400; color: var(--muted); }
.circuit--add {
  display: flex; gap: 10px; align-items: center; min-height: 36px; width: fit-content; padding: 0 10px 0 0;
  border-radius: 6px; text-decoration: none; transition: background-color var(--t), scale var(--t);
}
.circuit--add .circuit__n { color: var(--muted); }
.circuit--add .ps__add { opacity: 1; display: inline; font-size: 14px; }
/* A tandem's or quad's Space moves the whole breaker: a small field and its Move button. */
.form .form__move .form__inline input { flex: 0 0 84px; width: 84px; }
.circuit--add:is(:hover, :focus-visible) { background: var(--surface-2); }
.circuit--add:active { scale: .98; }
.ps__pop.is-entering .ticket { animation: swap-in var(--t) var(--ease); }

/* Dragging a breaker to another space (app.js). The Space field in its popup does the same by keyboard. */
@media (pointer: fine) { .ps__b[data-drag] { cursor: grab; touch-action: none; } }
.ps__b.is-dragging { opacity: .35; }
/* Hovering one of the same size: it slides into the dragged breaker's spot (app.js previewSwap), which empties. */
.ps__slot.is-swap { z-index: 2; }
.ps__slot.is-vacated .ps__b.is-dragging { opacity: 0; }
.ps__slot.is-nodrop .ps__b { outline: 2px solid var(--danger); outline-offset: -1px; }
/* The drop lands with a short settle, so the move reads as done the moment the mouse is released. */
@keyframes ps-drop { from { transform: scale(1.04); box-shadow: inset 0 0 0 2px var(--blue), 0 10px 24px oklch(var(--scrim) / .22); } }
.ps__slot.is-dropped .ps__b { animation: ps-drop var(--t) var(--ease); }
.ps-ghost { position: fixed; z-index: 60; margin: 0; pointer-events: none; box-shadow: inset 0 0 0 2px var(--blue), 0 12px 28px oklch(var(--scrim) / .25); }
.ps__slot.is-drop .ps__b { outline: 2px solid var(--blue); outline-offset: -1px; background: var(--blue-soft); }
html.is-dragging, html.is-dragging * { cursor: grabbing !important; user-select: none; }

/* ---------- rack editor (packages/plugins/src/rack.ts, geometry in rack-layout.ts) ----------
   Drawn to scale: 1U = 1.75 in, a 19 in face. The plugin places everything in percentages of the frame (measured in
   inches, --fw wide), so it all scales with the frame's width; --in is one inch at that scale. One grey; ports are
   dark when patched and outlined when free; blue only for what's open. */
.rk__elev { display: grid; grid-template-columns: minmax(0, max-content); justify-content: center; align-items: stretch; gap: 0 18px; padding: 34px 0 24px; } /* room above for cables that leave the rack out of the top */
.rk__elev--details { grid-template-columns: minmax(0, max-content) minmax(150px, 240px); }
.rk__frame {
  --in: calc(100cqw / var(--fw));
  position: relative; container-type: inline-size; width: calc(var(--fw) * 27px); max-width: 100%;
}
.rk__rack {
  position: absolute; top: calc(var(--in) * -.5); bottom: calc(var(--in) * -.5); border-radius: 6px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
/* The mounting rails (ears), with their holes: three per unit. */
.rk__rack::before, .rk__rack::after {
  content: ""; position: absolute; top: calc(var(--in) * .5); bottom: calc(var(--in) * .5); width: calc(var(--in) * .62);
  background:
    radial-gradient(circle, var(--line-2) 0 calc(var(--in) * .09), transparent calc(var(--in) * .1)) center top / 100% calc(100% / var(--u) / 3) repeat-y,
    var(--surface-3);
}
.rk__rack::before { left: 0; }
.rk__rack::after { right: 0; }
.rk__rail { position: absolute; left: 0; top: 0; bottom: 0; width: var(--rail); }
.rk__rail span {
  position: absolute; left: 0; right: calc(var(--in) * .25); display: grid; place-items: center end;
  font: 500 clamp(9px, calc(var(--in) * .42), 13px)/1 var(--f-ui); color: var(--muted); font-variant-numeric: tabular-nums;
}
.rk__units { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
/* Devices mounted on the other face: a faint dashed outline behind this face's devices (the rear view shows what's
   on the front, and the other way round). Never clickable: a unit there can still take a device on this side. */
.rk__ghosts { position: absolute; inset: 0; pointer-events: none; }
.rk__ghost { position: absolute; border-radius: 3px; outline: 1px dashed color-mix(in srgb, var(--line-2) 70%, transparent); outline-offset: -2px; background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
/* It can't fit behind (or in front of) what's here: the two depths add up to more than the rack's. */
.rk__ghost--clash { outline: 1.5px dashed var(--danger); background: color-mix(in srgb, var(--danger-soft) 60%, transparent); }

/* Empty units: an "Add" target under everything (devices sit on top of theirs). */
.rk__slot { position: absolute; left: var(--rail); width: var(--face); }
.rk__slot a {
  position: absolute; inset: 1px calc(var(--in) * .7); display: grid; place-items: center; border-radius: 3px; text-decoration: none;
  transition: background-color var(--t), box-shadow var(--t);
}
.rk__add { font: 500 clamp(11px, calc(var(--in) * .5), 14px)/1 var(--f-ui); color: var(--blue-ink); opacity: 0; transition: opacity var(--t); }
.rk__slot a:hover, .rk__slot a:focus-visible, .rk__slot a[aria-current="true"] { box-shadow: inset 0 0 0 1px var(--blue); background: var(--blue-soft); }
.rk__slot a:hover .rk__add, .rk__slot a:focus-visible .rk__add, .rk__slot a[aria-current="true"] .rk__add { opacity: 1; }

/* Devices: one grey plate between the rails, the rail tag on its left end. No z-index of their own (DOM order already
   puts them over the empty units), so their port numbers can sit above the cables, which are drawn over the rack. */
.rk__dev {
  --dev-bg: var(--surface);
  position: absolute; border-radius: 3px; background: var(--dev-bg);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 0 oklch(var(--scrim) / .05);
  transition: box-shadow var(--t), background-color var(--t), translate var(--t) var(--ease);
}
.rk__body { position: absolute; inset: 0; display: flex; align-items: center; color: var(--ink); text-decoration: none; border-radius: inherit; overflow: hidden; }
.rk__tag {
  flex: none; align-self: stretch; display: grid; place-items: center; width: calc(var(--in) * .85); margin-left: calc(var(--in) * .62);
  writing-mode: vertical-rl; rotate: 180deg; overflow: hidden; white-space: nowrap;
  font: 600 clamp(8px, calc(var(--in) * .32), 12px)/1 var(--f-ui); letter-spacing: .02em; color: var(--ink-2);
  border-left: 1px solid var(--line);
}
.rk__face-name { min-width: 0; margin-left: calc(var(--in) * .5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 clamp(11px, calc(var(--in) * .55), 15px)/1.2 var(--f-ui); }
.rk__dev:hover { box-shadow: inset 0 0 0 1px var(--blue); }
.rk__dev.is-current, .rk__dev:has(> .rk__body[aria-current="true"]) { --dev-bg: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
.rk__dev.is-current .rk__tag, .rk__dev:has(> .rk__body[aria-current="true"]) .rk__tag { color: var(--blue-ink); }
.rk__dev--blank { --dev-bg: var(--surface-2); }
.rk__dev--blank .rk__tag { color: var(--muted); }
.rk__dev--shelf { background: transparent; box-shadow: inset 0 calc(var(--in) * -.22) 0 var(--surface-3), inset 0 0 0 1px var(--line-2); }
.rk__fingers, .rk__outlets { position: absolute; top: 22%; bottom: 22%; left: calc(var(--in) * 2.4); right: calc(var(--in) * 1.4); border-radius: 2px; }
/* Cable manager: a row of fingers. PDU: a row of outlets. Real boxes would be overkill: a repeating fill. */
.rk__fingers { background: repeating-linear-gradient(90deg, var(--surface-3) 0 calc(var(--in) * .5), transparent 0 calc(var(--in) * .78)); }
.rk__outlets {
  left: calc(var(--in) * 4); top: 30%; bottom: 30%;
  background: repeating-linear-gradient(90deg, var(--surface-3) 0 calc(var(--in) * .7), transparent 0 calc(var(--in) * 1.05));
}

/* Ports: an SVG silhouette per connector (RJ45 with its key tab down; the lower row of a switch is flipped), number
   above or below. The shape is stroked, so outlines follow the whole silhouette and stay crisp at any size. */
.rk__port { position: absolute; display: block; color: var(--muted); text-decoration: none; }
.rk__jack {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  fill: var(--surface-3); stroke: var(--line-2); stroke-width: 1; transition: fill var(--t), stroke var(--t);
}
.rk__port--lo .rk__jack { scale: 1 -1; }
.rk__port.is-patched .rk__jack { fill: var(--ink-2); stroke: var(--ink-2); }
a.rk__port:hover .rk__jack { stroke: var(--blue); stroke-width: 1.5; }
.rk__port.is-lit .rk__jack, .rk__port[aria-current="true"] .rk__jack { fill: var(--blue); stroke: var(--blue); stroke-width: 1.5; }
a.rk__port:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
.rk__pn {
  position: absolute; z-index: 5; left: 50%; bottom: 100%; translate: -50% -1px;
  font: 500 calc(var(--in) * .19)/1 var(--f-ui); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rk__port--lo .rk__pn { top: 100%; bottom: auto; translate: -50% 1px; }
/* A cable plugs into its jack through where the number is: the number stays, on a patch of the device's own colour
   over the cable (z-index above the cable layers), like a label on the lead. The open port's number goes blue. */
.rk__port.is-patched .rk__pn, .rk__port.is-lit .rk__pn, .rk__port.is-drop .rk__pn { padding: 0 .25em; border-radius: 2px; background: var(--dev-bg); }
.rk__port.is-lit .rk__pn, .rk__port[aria-current="true"] .rk__pn { color: var(--blue-ink); font-weight: 700; }
/* Too small to read: leave the numbers to the popup. */
@container (max-width: 420px) { .rk__pn { display: none; } }

/* Patch cables: every one, under a "Show patch cables" switch; and the open port's one, lit, always. */
.rk__cables, .rk__patch, .rk__patch svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rk__cables { z-index: 3; overflow: visible; }
.rk__cables path { fill: none; stroke: color-mix(in srgb, var(--ink-2) 55%, var(--surface-2)); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rk__patch { z-index: 4; display: none; }
.rk__patch.is-lit, .rk__patch:target { display: block; }
.rk__patch svg { overflow: visible; }
.rk__patch path { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rk__caption { display: none; }
/* A patch panel seen from its other face: its backs (punch-down), on a plate that reads as the back of something. */
.rk__dev--back { --dev-bg: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.rk__port--back .rk__jack { fill: var(--surface); }
/* Hover targets for cables and gutters (editor): a wide invisible stroke per cable, a strip per gutter. Under the
   devices, so ports and faces keep their own hovers and clicks. The cable under the pointer lights. */
.rk__hits { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; overflow: visible; }
.rk__hits path { fill: none; stroke: transparent; stroke-width: 12; vector-effect: non-scaling-stroke; pointer-events: stroke; cursor: pointer; }
.rk__hits rect { fill: transparent; pointer-events: all; cursor: default; }
body:has(.rk-toggle__box:not(:checked)) .rk__hits { display: none; }
.rk__cables path.is-hot { stroke: var(--blue); stroke-width: 2.5; }
/* The hover card for ports, cables and gutters (app.js, from data-tip). */
.rk-tip {
  position: fixed; z-index: 70; max-width: 320px; padding: 8px 10px; border-radius: var(--r-sm); pointer-events: none;
  background: var(--ink); color: var(--surface); box-shadow: 0 8px 24px oklch(var(--scrim) / .22);
  font: 400 13px/1.4 var(--f-ui); font-variant-numeric: tabular-nums; white-space: pre-line;
}
.rk-tip[hidden] { display: none; }
.rk-tip__first { font-weight: 600; }
body:has(.rk-toggle__box:not(:checked)) .rk__cables { display: none; }

/* Each device's name and details beside it, like a rack's printed elevation. */
.rk__beside { list-style: none; margin: 0; padding: 0; position: relative; }
.rk__beside li { position: absolute; left: 0; right: 0; display: flex; }
.rk__beside a {
  flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 10px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-family: var(--f-ui); line-height: 1.2; transition: background-color var(--t);
}
.rk__beside a:hover { background: var(--surface-2); }
.rk__beside a[aria-current="true"] { background: var(--blue-soft); }
.rk__name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk__sub { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The popup beside a device, unit or port: right of the rack, its point at what was clicked. */
.rk__pop { --rh: 100%; position: absolute; z-index: 30; left: calc(var(--rail) + var(--face)); width: 0; pointer-events: none; }
.rk__pop .ticket { left: calc(var(--in) * .2); width: clamp(320px, 30vw, 420px); }
.rk__pop .ticket__in { margin-left: var(--tip); }
.rk__pop .ticket::after { left: 0; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.rk__pop--up .ticket { top: auto; bottom: calc(50% - var(--at)); }
.rk__pop--up .ticket::after { top: auto; bottom: calc(var(--at) - var(--tiph)); }
.rk__pop.is-entering .ticket { animation: swap-in var(--t) var(--ease); }
/* Port blocks (a grouped device: an amplifier's Euroblock inputs, speakON outputs…): jacks at their real shape, never
   flipped, the number in the jack, and the block's name above it. */
.rk__port--g.rk__port--lo .rk__jack { scale: none; }
.rk__port--g .rk__pn, .rk__port--g.rk__port--lo .rk__pn { top: 50%; bottom: auto; translate: -50% -50%; }
.rk__grp { position: absolute; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 calc(var(--in) * .15)/1 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rk-groups { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.rk-groups summary { cursor: pointer; font: 500 14px/1.3 var(--f-ui); }
.rk-groups[open] summary { margin-bottom: 8px; }
.rk-groups > .hint { margin: 0 0 10px; }
.rk-groups__grid { display: grid; grid-template-columns: minmax(64px, .8fr) minmax(110px, 1.4fr) minmax(52px, .6fr) minmax(48px, .5fr) minmax(80px, 1fr); gap: 6px; align-items: center; }
.rk-groups__grid > * { min-width: 0; }
.rk-groups__h { font: 500 12px/1.2 var(--f-ui); color: var(--muted); }
@media (max-width: 520px) { .rk-groups__grid { grid-template-columns: 1fr 1fr; } .rk-groups__h { display: none; } }
.rk-byhand { margin: 0; padding: 12px 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); display: grid; gap: 10px; }
.rk-byhand legend { padding: 0 6px; font: 500 14px/1.3 var(--f-ui); }
.rk-patched { font: 400 15px/1.45 var(--f-ui); }
.rk-go { margin-top: 8px; font: 400 14px/1.4 var(--f-ui); }
/* A patch panel port: its other side (front ↔ back), and the whole run through it. */
.rk-other { margin-top: 10px; font: 400 14px/1.4 var(--f-ui); color: var(--ink-2); }
.rk-path { margin: 0 0 16px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font: 400 14px/1.45 var(--f-ui); color: var(--ink); overflow-wrap: anywhere; }
.rk-path__l { display: block; margin-bottom: 2px; font: 600 11px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
/* A port's popup: "Cable" then "Label and VLAN", each with its own button. */
.rk-sec + .rk-sec { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.rk-sec__title { margin-bottom: 10px; font: 500 12px/1.3 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
/* The port number is for a device, the jack fields for "New wall jack…": each shows only for its choice (no JS). */
@supports selector(:has(a)) {
  .rk-patch__jack { display: none; }
  .rk-patch:has(option[value="new-jack"]:checked) .rk-patch__jack { display: grid; }
  .rk-patch:has(.rk-patch__jacks option:checked) .rk-patch__port { visibility: hidden; }
}
.rk-jacks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font: 400 14px/1.4 var(--f-ui); }
.rk-jacks a[aria-current="true"] { font-weight: 600; }
.ticket .rk-patch-row { grid-template-columns: minmax(0, 1fr) 84px; }
/* Fields in the rack popups shrink with it (inputs and selects default to an intrinsic min width). */
.rk__pop .form__row > *, .rk__pop .rk-byhand { min-width: 0; }
.rk__pop .form__row input, .rk__pop .form__row select { width: 100%; min-width: 0; box-sizing: border-box; }

/* The cable switch, in the editor toolbar. */
.rk-toggle { display: flex; align-items: center; gap: 8px; margin-top: 12px; font: 400 14px/1.3 var(--f-ui); color: var(--ink-2); cursor: pointer; }
.rk-toggle__box:not(.switch) { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }

/* Dragging a device to another unit, or onto one of the same height to swap (app.js). The U field in its popup does
   the same by keyboard. On touch a press and hold picks it up, so the long-press menu and text selection stay off. */
@media (pointer: fine) { .rk__body[data-drag], a.rk__port[data-port]:not([data-patched]) { cursor: grab; touch-action: none; } }
.rk__body[data-drag], a.rk__port[data-port], .ps__b[data-drag] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.rk__dev.is-swap, .ps__slot.is-swap .ps__b { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.rk__dev.is-held, .ps-ghost.is-held { scale: 1.02; }
/* A cable being dragged from a port: it follows the pointer and snaps to the free port under it. */
.rk__wire { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.rk__wire path { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rk__frame.is-patching .rk__port.is-drop .rk__jack { fill: var(--blue-soft); stroke: var(--blue); stroke-width: 2; }
.rk__frame.is-patching .rk__port.is-nodrop .rk__jack { stroke: var(--danger); stroke-width: 2; }
.rk__dev.is-dragging { z-index: 6; box-shadow: inset 0 0 0 2px var(--blue), 0 12px 28px oklch(var(--scrim) / .25); transition: none; }
.rk__dev.is-nodrop { box-shadow: inset 0 0 0 2px var(--danger), 0 12px 28px oklch(var(--scrim) / .25); }
.rk__dev.is-dragging ~ .rk__dev, .rk__dev.is-dragging ~ .rk__slot { pointer-events: none; }
html.is-dragging .rk__cables, html.is-dragging .rk__patch { opacity: .25; }
.rk__dev.is-dropped { animation: ps-drop var(--t) var(--ease); }
/* A device of the same height being hovered slides into the dragged one's units (app.js), above its neighbours. */
.rk__dev.is-swap { z-index: 5; }

@media (max-width: 899px) {
  .rk__elev--details { grid-template-columns: minmax(0, max-content); }
  .rk__beside { display: none; }
  .rk__pop .ticket__in { margin: 0; }
  .rk__pop .ticket { width: auto; left: 8px; right: 8px; top: auto; bottom: 8px; }
}

/* ---------- rack: motion (founder request 2026-11-17; appdesignguidelines.md "Motion" lists these as the exception) ----
   Cables draw out of their ports, along the gutters and into the far port when the rack opens, when "Show patch
   cables" is switched on (and pull back in when it's switched off), and when the patch panel view closes. app.js
   measures each path and animates its dash offset; while it does, strokes are in the drawing's own units (--sw), so
   the dash lengths are exact. Without JS, and under reduced motion, cables are simply there. */
.rk__cables.is-drawing path { vector-effect: none; stroke-width: var(--sw, .06); }
/* Switched off: the cables stay for the moment it takes them to pull back in. */
body .rk__frame.is-cables-leaving .rk__cables { display: block; }
/* pane.js sets this before first paint (and takes it off again by itself), so cables don't flash before they draw. */
html.ed-intro .rk__cables { visibility: hidden; }
/* A patch panel is being opened: everything else in the rack fades away (app.js, at the click)… */
.rk__elev.is-soloing :is(.rk__rack, .rk__rail, .rk__ghosts, .rk__hits, .rk__cables, .rk__patch, .rk__slot, .rk__pop, .rk__beside, .rk__dev:not(.is-solo)) {
  opacity: 0; pointer-events: none; transition: opacity var(--t) var(--ease);
}
/* …and comes back when its view closes, while the panel flips back into its place. */
@keyframes rk-return { from { opacity: 0; } }
.rk__elev.is-returning :is(.rk__rack, .rk__rail, .rk__ghosts, .rk__slot, .rk__beside, .rk__dev:not(.is-solo)) { animation: rk-return calc(var(--t) * 2) var(--ease) both; }
.rk__elev.is-returning :is(.rk__dev.is-solo, .rk__cables, .rk__patch, .rk__hits) { visibility: hidden; }

/* ---------- rack: the patch panel view (rack.ts panelView) ----------
   One patch panel on its own, seen from above: the back (runs in from the building) at the top, the front (patch
   cords) at the bottom, a column per port placed where the port is across the 19 in face. --zone is the room for a
   cable's name on each side, --slab the panel's depth as drawn. */
.pp { --zone: 136px; --slab: 52px; --stub: 12px; container: pp / inline-size; max-width: 1120px; margin: 0 auto; }
.pp__head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
/* Where the work area scrolls inside itself, the head stays at its top: opening a port brings its forms into view,
   and "Back to the rack" used to slide under the toolbar with the rest. Its background runs the work area's full
   width (the shadow, clipped to the head's own height), so nothing shows beside it as the drawing scrolls under. */
@media (min-width: 1024px) {
  .ed-work .pp__head {
    position: sticky; top: -24px; z-index: 6; margin: -24px 0 16px; padding: 20px 0 12px; /* -24px: the work area's own top padding */
    background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax);
  }
}
.pp__titles { flex: 1; min-width: 0; }
.pp__kicker { font: 500 12px/1.3 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.pp__name { margin-top: 2px; font-size: 24px; overflow-wrap: anywhere; }
.pp__facts { margin-top: 2px; font: 400 14px/1.4 var(--f-ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pp__scroll { overflow-x: auto; overscroll-behavior-x: contain; padding: 4px; margin: -4px; }
.pp__view { --in: calc(100cqw / 19); container-type: inline-size; min-width: 640px; display: grid; gap: 32px; }
.pp__side { margin: 0 0 6px; font: 600 11px/1.3 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.pp__side span { margin-left: 6px; font: 400 13px/1.3 var(--f-ui); letter-spacing: 0; text-transform: none; color: var(--muted); }
.pp__deck + .pp__side { margin: 6px 0 0; }
.pp__deck { position: relative; height: calc(var(--zone) * 2 + var(--slab)); }
.pp__ports { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.pp__port { position: absolute; top: 0; bottom: 0; border-radius: 6px; transition: background-color var(--t); }
.pp__port.is-current { background: var(--blue-soft); }
/* The two halves of a column: the back (top) and the front (bottom). Each reaches the middle of the panel, so the
   whole column is a target. */
.pp__end { position: absolute; left: 0; right: 0; height: calc(var(--zone) + var(--slab) / 2); display: flex; flex-direction: column; align-items: center; color: var(--ink); text-decoration: none; border-radius: 6px; }
.pp__end--in { top: 0; justify-content: flex-end; padding-bottom: calc(var(--slab) / 2); transform-origin: 50% calc(100% - var(--slab) / 2); }
.pp__end--out { bottom: 0; justify-content: flex-start; padding-top: calc(var(--slab) / 2); transform-origin: 50% calc(var(--slab) / 2); }
.pp__end:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
/* The cable itself: a short lead between the panel and its name (the same grey as a cable in the rack). */
.pp__end--in::after, .pp__end--out::before { content: ""; flex: none; width: 2px; height: var(--stub); border-radius: 1px; background: var(--line-2); }
.pp__end.is-set::after, .pp__end.is-set::before { background: color-mix(in srgb, var(--ink-2) 55%, var(--surface-2)); }
/* What's on the far end, read bottom to top like a rail tag: a jack's label and its room, or a device and its port. */
.pp__chip {
  flex: 0 1 auto; min-height: 0; writing-mode: vertical-rl; rotate: 180deg; padding: 6px 2px; border-radius: 5px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow var(--t), background-color var(--t);
}
.pp__t, .pp__s { display: block; max-inline-size: calc(var(--zone) - var(--stub) - 18px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp__t { font: 600 12px/15px var(--f-ui); font-variant-numeric: tabular-nums; }
.pp__s { font: 400 11px/13px var(--f-ui); color: var(--ink-2); }
.pp__end:hover .pp__chip { box-shadow: inset 0 0 0 1px var(--blue); }
.pp__end[aria-current="true"] .pp__chip { background: var(--surface); box-shadow: inset 0 0 0 2px var(--blue); }
/* Nothing there yet: a plus at the end of the lead, on hover (always on touch) and on the open end. */
.pp__plus { flex: none; position: relative; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--blue); opacity: 0; transition: opacity var(--t); }
.pp__plus::before, .pp__plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px; border-radius: 1px; background: var(--blue-ink); }
.pp__plus::after { rotate: 90deg; }
.pp__end:hover .pp__plus, .pp__end:focus-visible .pp__plus, .pp__end[aria-current="true"] .pp__plus { opacity: 1; }
@media (hover: none) { .pp__plus { opacity: 1; } }
.pp--ro .pp__plus { display: none; }
/* The panel from above: its body, with the faceplate and ears edge on along the front. One grey, like the rack. */
.pp__slab { position: absolute; left: 0; right: 0; top: var(--zone); height: var(--slab); z-index: 1; pointer-events: none; }
.pp__slab::before { content: ""; position: absolute; inset: 0 calc(var(--in) * .62) 5px; border-radius: 3px 3px 0 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.pp__slab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; border-radius: 2px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.pp__k { position: absolute; top: 8px; bottom: 14px; z-index: 1; display: grid; place-items: center; font: 600 12px/1 var(--f-ui); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pp__k::before { content: ""; position: absolute; inset: 0 2px; z-index: -1; border-radius: 3px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.pp__k.is-current { color: var(--on-blue); }
.pp__k.is-current::before { background: var(--blue); box-shadow: none; }
@container (max-width: 760px) { .pp__s { display: none; } .pp__t, .pp__k { font-size: 11px; } }

/* The open port's forms, under the drawing: coming in, patch cord, label and VLAN, side by side when there's room. */
.pp__edit { margin-top: 28px; padding: 20px 24px 24px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.pp__edit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.pp__edit-titles { min-width: 0; }
.pp__edit-head h3 { font-size: 20px; }
.pp__label { margin-left: 6px; font: 400 15px/1.3 var(--f-ui); color: var(--ink-2); }
.pp__path { margin-top: 4px; font: 400 14px/1.45 var(--f-ui); color: var(--ink-2); overflow-wrap: anywhere; }
.pp__cols { display: grid; gap: 0; }
.pp__cols .rk-sec__title span { margin-left: 4px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.pp__cols .form__row > *, .pp__cols input, .pp__cols select { min-width: 0; }
.pp__cols .form__row input, .pp__cols .form__row select { width: 100%; box-sizing: border-box; }
.pp__cols .rk-patch-row { grid-template-columns: minmax(0, 1fr) 84px; }
@container pp (min-width: 900px) {
  .pp__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pp__cols > .rk-sec + .rk-sec { margin-top: 0; padding-top: 0; border-top: 0; margin-left: 24px; padding-left: 24px; border-left: 1px solid var(--line); }
}
.pp__hint { margin-top: 28px; max-width: 64ch; font: 400 15px/1.5 var(--f-ui); color: var(--ink-2); }
/* A wall jack that's already here, or a tie line: the exception, folded away under the new jack's two fields. */
.pp-more { margin: 2px 0; }
.pp-more summary { cursor: pointer; font: 400 14px/1.4 var(--f-ui); color: var(--blue-ink); }
.pp-more[open] summary { margin-bottom: 10px; }
@supports selector(:has(a)) { .rk-patch--run:has(select[name="to"] > option:checked) .rk-patch__port { visibility: hidden; } }

/* Opening and closing (app.js): the panel flips between its face in the rack and this view as a real box (.pp-fly,
   its two faces are copies), then each port's leads grow out of the panel. Fades are on flat elements only, never on
   the 3D box. */
.pp.is-flying .pp__slab { visibility: hidden; }
.pp.is-flying :is(.pp__head, .pp__side, .pp__ports, .pp__edit, .pp__hint) { opacity: 0; }
@keyframes pp-grow { from { opacity: 0; transform: scaleY(0); } }
.pp.is-landed .pp__end { animation: pp-grow var(--t) var(--ease) both; }
.pp.is-landed :is(.pp__head, .pp__side, .pp__edit, .pp__hint) { animation: swap-in var(--t) var(--ease) both; }
.pp.is-leaving .pp__end { opacity: 0; transform: scaleY(0); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.pp.is-leaving :is(.pp__head, .pp__side, .pp__edit, .pp__hint) { opacity: 0; transition: opacity var(--t) var(--ease); }
.pp-fly { position: fixed; inset: 0; z-index: 45; overflow: hidden; pointer-events: none; perspective: 1600px; }
.pp-fly__box { position: absolute; transform-style: preserve-3d; will-change: transform; }
.pp-fly__face { position: absolute; left: 0; width: 100%; overflow: hidden; }
.pp-fly__face > * { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.pp-fly .rk__dev { inset: 0; width: 100%; height: 100%; transition: none; }
.pp-fly .pp__slab { top: 0; height: 100%; }

/* Hardware type picker ("Panel type", "Breaker type") with "New … type" */
.type-pick { display: grid; gap: 6px; min-width: 0; }
.type-pick select { min-width: 0; width: 100%; }
.type-pick__new { justify-self: start; font-size: 14px; }
/* "Put it in anyway": only while a type from the "Not listed for this panel" group is picked. */
.form .unlisted-ok { display: none; }
.form:has(option[data-unlisted]:checked) .unlisted-ok,
.form:has(input[data-unlisted]:checked) .unlisted-ok { display: flex; }
/* Handle ties, made on the drawing (tieView() in the panel plugin): at the top of a 1-pole breaker's popup, it and
   its neighbours blown up. Itself lit; a breaker it could be tied to is a button; a tied partner is lit too, with
   the tie drawn between them. It grows out of the side the breaker is on. */
.tieview { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.tieview__title { margin: 0; font: 400 13px/1.3 var(--f-ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tieview__title strong { font-weight: 600; color: var(--ink); margin-right: 6px; }
.tieview .hint, .tieview__untie { margin: 0; }
.tieview__pic { position: relative; display: grid; gap: 3px; padding: 4px; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.tieview__h {
  display: grid; grid-template-columns: 30px 96px minmax(0, 1fr) auto; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 0; border: 0;
  border-radius: 5px; background: none; text-align: left; font: 500 13px/1.2 var(--f-ui); color: var(--ink-2);
}
.tieview__n { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tieview__t { position: relative; align-self: stretch; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color var(--t), box-shadow var(--t); }
.tieview__t:empty { background: none; box-shadow: none; outline: 1px dashed var(--line-2); outline-offset: -1px; }
.tieview__hd { position: absolute; inset: 18% 30%; display: grid; place-items: center; border-radius: 3px; background: var(--surface-3); font: 600 11px/1 var(--f-ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tieview__who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tieview__h.is-on { color: var(--ink); font-weight: 600; }
.tieview__h.is-on .tieview__t { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
.tieview__h--free { cursor: pointer; color: var(--ink); transition: background-color var(--t), scale var(--t); }
.tieview__do { padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 600; }
.tieview__h--free:is(:hover, :focus-visible) { background: var(--blue-soft); outline: none; }
.tieview__h--free:is(:hover, :focus-visible) .tieview__t { box-shadow: inset 0 0 0 2px var(--blue); }
.tieview__h--free:active { scale: .98; }
/* The tie, from the upper tied breaker's row (--from) to the lower one's (--to): rows are 34px, 3px apart. */
.tieview__bar {
  position: absolute; left: 56px; width: 8px; border-radius: 4px; background: var(--blue); pointer-events: none;
  top: calc(4px + var(--from) * 37px + 17px); height: calc((var(--to) - var(--from)) * 37px);
}
@media (prefers-reduced-motion: no-preference) {
  .tieview { animation: tieview-in var(--t) var(--ease) backwards; transform-origin: 0 0; }
  .ps__pop--l .tieview { transform-origin: 100% 0; }
}
@keyframes tieview-in { from { opacity: 0; transform: scale(.7); } }
/* A quad: one body over two spaces, its four handles evenly spaced (5A, 5B, 7A, 7B). */
.ps__slot--quad :is(.ps__b--tandem, .ps__d--tandem) { grid-template-rows: repeat(4, 1fr); }
/* "New breaker type": what its outside handles are only matters for a quad. */
.form:not(:has(select[name="size"] option[value="quad"]:checked)) .quad-only { display: none; }
/* "New breaker type": the second rating only matters for a tandem or a quad. */
.form:not(:has(select[name="size"] :is(option[value="tandem"], option[value="quad"]):checked)) .tandem-b { display: none; }
/* The type search box: a search first, then a few one-tap results (radios of the form). */
.type-find { display: grid; gap: 8px; min-width: 0; }
.type-find__label, .form .type-find__label { display: block; font: 500 15px/1.3 var(--f-ui); color: var(--ink); }
.type-find__box { display: flex; gap: 8px; align-items: center; }
.type-find__box input { flex: 1; min-width: 0; }
.type-find__results { display: grid; gap: 10px; max-height: 280px; overflow: auto; }
.type-find__results[aria-busy="true"] { opacity: .6; transition: opacity var(--t); }
.type-find__group { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.type-find__group legend, .form .type-find__group legend { padding: 0; margin-bottom: 4px; font: 600 11px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.type-opt, .form .type-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; font: 400 14px/1.35 var(--f-ui); color: var(--ink); transition: background-color var(--t), box-shadow var(--t); }
.type-opt:hover { background: var(--surface-3); }
.type-opt:has(input:checked) { background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.type-opt input { margin: 0; flex: none; accent-color: var(--blue); }
.type-opt__text { min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.type-find__none { margin: 0; }
.type-find__hint { margin: 0; }
.type-find__new { margin: 0; font: 400 14px/1.3 var(--f-ui); }
.type-find__form { display: none; }
.type-list, .form .type-list { width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
/* With JS, "New … type…" is the last item in the dropdown itself; the link under it is only for pages without JS
   (hidden from the start, not just once the dropdown is built, so instant-open popups never show it). */
.type-find:has(select[data-enhanced]) .type-find__new, .js .type-find:has(select[data-new-type]) .type-find__new { display: none; }
/* The type picker with JS (app.js): a button in the input style plus a listbox popover in the app's own style; the
   real select stays in the form, hidden. Without JS the select shows as normal. */
.pick__native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pick {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 44px; padding: 10px 38px 10px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  font: 400 16px/1.3 var(--f-ui); text-align: left; cursor: pointer; position: relative;
  transition: border-color var(--t), box-shadow var(--t);
}
.pick::after {
  content: "" / ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border: solid var(--ink-2); border-width: 0 2px 2px 0; rotate: 45deg; transition: rotate var(--t);
}
.pick[aria-expanded="true"]::after { rotate: 225deg; margin-top: -2px; }
.pick:hover { border-color: var(--ink-2); }
.pick:focus-visible, .pick[aria-expanded="true"] { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.pick__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__list {
  --pad: 6px; position: fixed; inset: auto; margin: 0; padding: var(--pad); list-style: none; overflow-y: auto; overscroll-behavior: contain;
  border: 0; border-radius: var(--r); background: var(--surface); color: var(--ink);
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px oklch(var(--scrim) / .22);
  font: 400 15px/1.35 var(--f-ui);
}
.pick__list:not(:popover-open):not(.is-open) { display: none; }
.pick__opt { padding: 9px 12px; border-radius: calc(var(--r) - var(--pad, 6px)); cursor: pointer; }
.pick__opt.is-active { background: var(--surface-2); }
.pick__opt[aria-selected="true"] { color: var(--blue-ink); font-weight: 500; }
.pick__opt--grouped { color: var(--ink-2); }
.pick__opt[data-group] { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 calc(var(--r) - var(--pad, 6px)) calc(var(--r) - var(--pad, 6px)); }
.pick__opt[data-group]::before { content: attr(data-group) / ""; display: block; margin: 0 0 8px; font: 600 11px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pick__opt--new { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 calc(var(--r) - var(--pad, 6px)) calc(var(--r) - var(--pad, 6px)); color: var(--blue-ink); font-weight: 500; }
/* The searchable picker (select[data-search]): the same box, holding a text field. */
.pick--search { padding: 0 38px 0 0; cursor: text; }
.pick--search:hover { border-color: var(--ink-2); }
.pick--search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
/* Asking the server for more matches (app.js searchPick): a small spinner where the chevron is, until it answers.
   Reduced motion: a still ring, and the list says "Searching…" in words either way. */
.pick--search.is-busy::after {
  content: "" / ""; right: 12px; width: 14px; height: 14px; margin-top: -9px; border-radius: 50%;
  border: 2px solid var(--muted); border-right-color: transparent; rotate: none; transition: none; animation: spin .6s linear infinite;
}
.sheet__cell .pick--search.is-busy::after { right: 8px; width: 10px; height: 10px; margin-top: -7px; }
@media (prefers-reduced-motion: reduce) { .pick--search.is-busy::after { animation: none; } }
.pick__q, .form .pick__q:not([type="checkbox"]):not([type="radio"]) {
  flex: 1; min-width: 0; min-height: 42px; margin: 0; padding: 10px 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; box-shadow: none; color: inherit; font: inherit; outline: none;
}
.pick__q::placeholder { color: var(--muted); }
.pick__none { padding: 9px 12px; color: var(--ink-2); font: 400 14px/1.35 var(--f-ui); }
@starting-style { .pick__list:popover-open { opacity: 0; transform: translateY(-4px); } }
.pick__list:popover-open { transition: opacity var(--t), transform var(--t); }
.dialog__lede { margin-bottom: 22px; font: 400 16px/1.45 var(--f-body); color: var(--ink-2); }
/* "Find in the library" at the top of a "New … type" popup. */
.lib-pick { display: grid; gap: 12px; margin-bottom: 8px; }
.lib-pick__title { margin: 0; font: 600 15px/1.3 var(--f-ui); color: var(--ink); }
.lib-pick__search { display: flex; gap: 8px; align-items: center; }
.lib-pick__q { flex: 1; min-width: 0; }
.lib-pick__q input { width: 100%; }
.lib-pick__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.lib-pick__item { display: grid; gap: 2px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r); background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; font: inherit; transition: background-color .2s ease; }
.lib-pick__item:hover, .lib-pick__item:focus-visible { background: var(--surface-3); }
.lib-pick__name { font: 500 15px/1.3 var(--f-ui); }
.lib-pick__specs { font: 400 13px/1.3 var(--f-ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lib-pick__or { margin: 16px 0 6px; padding-top: 16px; border-top: 1px solid var(--line); font: 600 11px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lib-pick__off { margin: 0 0 14px; }
/* The Library page. */
/* Same box as the Search page's (.search-page): the dashboard's surface, thin border, blue focus ring. */
.lib-search { position: relative; display: flex; align-items: center; margin: 8px 0 16px; }
.lib-search__icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.lib-search__input {
  flex: 1; min-width: 0; height: 48px; padding: 0 48px 0 44px; font: 400 17px/1 var(--f-ui); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  transition: border-color var(--t), box-shadow var(--t);
}
.lib-search__input::placeholder { color: var(--muted); }
.lib-search__input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.lib-search__clear { position: absolute; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); color: var(--ink-2); transition: background-color var(--t), color var(--t); }
.lib-search__clear:hover { background: var(--surface-2); color: var(--ink); }
.lib-filters { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-bottom: 20px; }
.lib-filters .chips { margin: 0; }
.lib-browse__note { margin: 0 0 12px; }
.lib-row { display: flex; align-items: center; gap: 16px; }
.lib-row form { margin: 0; flex: none; }
.lib-row__have { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }

@media (max-width: 899px) {
  /* No room beside the panel: the popup becomes a sheet at the bottom of the screen. */
  .ticket {
    position: fixed; top: auto; left: 8px; right: 8px; bottom: calc(var(--tabbar) + 8px); width: auto; max-height: 78dvh; overflow-y: auto;
    border-radius: 14px; filter: none; box-shadow: 0 0 0 1px var(--line), 0 -12px 40px oklch(var(--scrim) / .2);
  }
  .ps__pop--l .ticket, .ps__pop--r .ticket, .ps__pop--up .ticket { left: 8px; right: 8px; top: auto; bottom: calc(var(--tabbar) + 8px); }
  .ps__pop--l .ticket__in, .ps__pop--r .ticket__in { margin: 0; }
  .ticket::after { display: none; }
}
@media (max-width: 640px) {
  .ps { --rh: 26px; --nw: 18px; --can: 8px; padding-top: 24px; }
  .ps__meta, .ps__feeds { display: none; }
  .ps__label { font-size: 12px; }
  .ps__d, .ps__slot--r .ps__d { padding-inline: 4px; }
  .ps__slot--l .ps__d { padding-right: calc(var(--can) + 4px); }
  .ps__slot--r .ps__d { padding-left: calc(var(--can) + 4px); }
  .ps__add { display: none; }
}

.lede-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }

/* Files (views/files.ts): a site's documents, a piece of equipment's files, and the upload form */
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.file { display: flex; align-items: center; gap: 4px; min-width: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); transition: border-color var(--t), box-shadow var(--t); }
.file:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.file__open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-decoration: none; color: inherit; border-radius: calc(var(--r) - 1px); }
.file__text { min-width: 0; display: grid; gap: 2px; }
.file__name { font: 500 15px/1.3 var(--f-ui); }
.file__meta { font: 400 13px/1.3 var(--f-ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.file__remove { margin: 0 6px 0 0; flex: none; }
.files__add { margin-top: 14px; }
.card .files, .card .files__add { margin-top: 16px; }
.filepick {
  padding: 18px 14px !important; min-height: 0 !important; border-style: dashed !important; cursor: pointer;
  font: 400 14px/1.4 var(--f-ui) !important; color: var(--ink-2) !important; background: var(--surface-2) !important;
}
.filepick::file-selector-button {
  margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 999px; cursor: pointer;
  font: 500 14px/1.2 var(--f-ui); background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2);
}
.filepick:hover { border-color: var(--blue) !important; }

/* Tags */
.tagline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 500 13px/1 var(--f-ui); color: var(--ink-2); }
.tagline .icon { color: var(--muted); }
.tagline--none { color: var(--muted); font-weight: 400; }
.tagchip {
  display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 6px;
  font: 600 12px/1 var(--f-ui); letter-spacing: .06em; font-variant-numeric: tabular-nums;
  background: var(--blue-soft); color: var(--blue-ink);
}
/* Site page: equipment as full-width rows, each with its steps and one next-step button. */
.steps { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font: 500 13px/1.3 var(--f-ui); --icon-w: 2; }
.steps__s { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.steps__s--done { color: var(--good); }
.steps__s--next { color: var(--ink); }
.steps__dot { width: 8px; height: 8px; margin: 0 3px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px currentColor; }
.steps__s--next .steps__dot { background: var(--blue); box-shadow: none; }
.list__item--action { display: flex; align-items: center; gap: 4px 12px; }
.list__item--action > .list__row { flex: 1; min-width: 0; }
.list__action { flex: none; padding-right: 10px; }
.list__row .tagline { justify-content: flex-end; }
/* A row's right side with two facts (Site page: tap-page opens, then the stickers on it). */
.metastack { display: grid; gap: 8px; justify-items: end; }
@media (max-width: 700px) {
  .list__item--action { flex-wrap: wrap; }
  .list__item--action > .list__row { flex-basis: 100%; }
  .list__action { padding: 0 10px 14px 62px; margin-top: -4px; }
  .list__row .tagline { justify-content: flex-start; }
  .metastack { justify-items: start; }
}
.howto { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.card__foot { margin-top: 16px; }

.card__foot { margin-top: 16px; }
/* A submit button that's waiting on the server. */
.btn[aria-busy="true"] { cursor: progress; position: relative; color: transparent !important; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--on-blue); border-right-color: transparent; animation: spin .6s linear infinite;
}
.btn[aria-busy="true"][disabled] { background: var(--blue); }
.btn--ghost[aria-busy="true"][disabled] { background: var(--surface); }
.btn--ghost[aria-busy="true"]::after { border-color: var(--ink-2); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }


/* ---------- inspector (views/components.ts `inspector`, app.js) ----------
   overlay: every view / add / edit on ordinary pages slides in on the right over a scrim. dialog: plugin editors'
   centred popup (the panel's details, "New … type"). Animations only run when app.js adds is-entering / is-leaving
   / is-swapping, so a plain page load never slides. */
.insp-slot { display: contents; }
.insp__scrim { position: fixed; inset: 0; z-index: 45; background: oklch(var(--scrim) / .36); cursor: default; }
.insp__panel {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0;
  width: var(--insp-w);
  display: flex; flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.insp__panel:focus { outline: none; }
.insp__head {
  flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 16px 16px 24px; border-bottom: 1px solid var(--line);
}
.insp__titles { min-width: 0; padding-top: 4px; }
.insp__kicker { font: 500 12px/1.3 var(--f-ui); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; overflow-wrap: anywhere; }
.insp__head h2 { font-size: 24px; overflow-wrap: anywhere; }
.insp__close {
  flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm);
  color: var(--ink-2); transition: background-color var(--t), color var(--t);
}
.insp__close:hover { background: var(--surface-2); color: var(--ink); }
.insp__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 24px 24px 48px; }
.insp__body[aria-busy="true"] { pointer-events: none; }
.inspector__hint { color: var(--ink-2); margin-bottom: 24px; }
.inspector__actions { margin-top: 28px; }
.inspector__danger { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }

.form--inspector { margin: 0; max-width: none; }
.insp__body .form__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.insp__body .form__row--3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 420px) { .insp__body .form__row, .insp__body .form__row--3 { grid-template-columns: 1fr; } }

.facts--stack { grid-template-columns: 1fr; gap: 4px; }
.facts--stack dt { font-family: var(--f-ui); font-size: 13px; color: var(--muted); }
.facts--stack dt:not(:first-child) { margin-top: 14px; }
.facts__multi { white-space: pre-line; }

/* ---------- one sticker in the Tags inspector: what's printed, where it is, where it's been ---------- */
.tag-print { display: grid; gap: 10px; margin-bottom: 28px; }
.tag-print .sticker { width: 100%; margin: 0; }
.insp__sub { font: 600 15px/1.3 var(--f-ui); color: var(--ink); margin: 32px 0 12px; }
.tag-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tag-history li { display: grid; gap: 2px; }
.tag-history__what { color: var(--ink); }
.tag-history__when { font-family: var(--f-ui); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.insp__body > .form__actions, .insp__body > .form--inspector { margin-top: 28px; }

.insp--dialog .insp__panel {
  top: 50%; left: 50%; right: auto; bottom: auto; translate: -50% -50%;
  width: min(560px, calc(100vw - 32px)); max-height: min(88dvh, 780px);
  border-radius: var(--r-lg); box-shadow: 0 24px 64px oklch(var(--scrim) / .24);
}
.insp--dialog .insp__head { padding: 22px 16px 16px 28px; }
.insp--dialog .insp__body { padding: 24px 28px 28px; }
/* Fullscreen: the device editor (a form beside a drawing of the device's faces). Edge to edge on small screens, a
   large card with a margin of the page showing around it on big ones. */
.insp--full .insp__panel { inset: 0; width: auto; }
.insp--full .insp__body { padding: 0; }
@media (min-width: 900px) {
  .insp--full .insp__panel { inset: 16px; border-radius: var(--r-lg); box-shadow: 0 24px 64px oklch(var(--scrim) / .24); }
  .insp--full .insp__head { padding: 18px 16px 14px 28px; }
}
.insp--full.is-entering .insp__panel { animation: dialog-in var(--t) var(--ease); }
.insp--full.is-leaving .insp__panel { animation: dialog-out var(--t) ease-in forwards; }

/* ---------- the device editor (packages/plugins/src/device-editor.ts, assets/device-editor.js) ----------
   Left: the type's fields and its ports. Right: both faces drawn to scale (the rack's own port shapes), blocks
   draggable. The form is display: contents, so its two columns sit in this grid. */
.dte { --dte-side: 440px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "lead" "stage" "side"; min-height: 100%; }
.dte__form { display: contents; }
.dte__lead { grid-area: lead; padding: 20px 20px 0; }
.dte__lead > :last-child { margin-bottom: 0; }
.dte__side { grid-area: side; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-content: start; padding: 20px 20px 40px; min-width: 0; }
/* Fields fill their column and may shrink: an input's default width (about 20 characters) otherwise pushed two side by
   side past the column, under the drawing. */
.dte__side .form__row, .dte__side .admin-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.dte__side .form__row--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
/* Spin boxes (spin() in device-editor.ts): the site's round − / + inside the field's right end, in place of the
   browser's arrows. Without JS the buttons are hidden and the browser's arrows stay. */
.spin { position: relative; display: block; min-width: 0; }
.spin__bs { display: none; }
.js .spin__bs { position: absolute; top: 50%; right: 6px; translate: 0 -50%; display: flex; gap: 2px; }
.js .spin input { width: 100%; padding-right: 74px; -moz-appearance: textfield; appearance: textfield; }
.js .spin input::-webkit-inner-spin-button, .js .spin input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.spin__b {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); cursor: pointer; transition: background-color var(--t), color var(--t);
}
.spin__b svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.spin__b:hover { background: var(--blue-soft); color: var(--blue-ink); }
.spin__b:active { background: var(--blue); color: var(--on-blue); }
/* "Find in the library": the site's own field (it sits outside the form in the device editor), a magnifier inside. */
.lib-pick__q { position: relative; display: block; }
.lib-pick__icon { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.lib-pick__q input {
  width: 100%; min-height: 44px; padding: 10px 12px 10px 38px; font: 400 16px/1.3 var(--f-ui);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  -webkit-appearance: none; appearance: none; transition: border-color var(--t), box-shadow var(--t);
}
.lib-pick__q input::placeholder { color: var(--muted); }
.lib-pick__q input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.lib-pick__q input::-webkit-search-cancel-button { display: none; }
.dte__side label { min-width: 0; }
.dte__side input:not([type="radio"]):not([type="checkbox"]), .dte__side select { width: 100%; min-width: 0; }
.dte__side .form__actions { margin-top: 4px; }
.dte__stage { grid-area: stage; display: grid; gap: 16px; align-content: start; padding: 24px 20px; background: var(--surface-2); min-width: 0; }
@media (min-width: 900px) {
  .dte {
    grid-template-columns: var(--dte-side) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "lead stage" "side stage";
    background: linear-gradient(to right, var(--surface) var(--dte-side), var(--surface-2) var(--dte-side));
  }
  .dte__lead, .dte__side { padding-left: 28px; padding-right: 28px; box-shadow: inset -1px 0 0 var(--line); }
  .dte__lead { padding-top: 24px; }
  /* The drawing stays in view while the fields scroll. */
  .dte__stage { position: sticky; top: 0; align-self: start; padding: 32px clamp(24px, 4vw, 64px) 40px; max-height: calc(100dvh - 120px); overflow: auto; }
}
.dte__h { padding: 0; margin-bottom: 4px; font: 600 15px/1.3 var(--f-ui); color: var(--ink); }
.dte__hint { margin: 0; max-width: 64ch; }
.dte__faces { display: grid; gap: 28px; justify-items: center; }
/* Each face as wide as fits, but never so tall that front and rear don't both fit on screen. */
.dte-face { width: 100%; max-width: min(1100px, calc((100dvh - 320px) / 2 * 19 / var(--dte-h, 1.75))); min-width: min(100%, 480px); }
.dte-face__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.dte-face__head h3 { font: 600 11px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dte-face__lineup { font-size: 14px; }
.dte-plate {
  --dev-bg: var(--surface);
  position: relative; container-type: inline-size; border-radius: 4px; background: var(--dev-bg);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 2px oklch(var(--scrim) / .06);
}
.dte-plate > * { --in: calc(100cqw / 19); }
/* The rack ears and the rail tag strip: ports never go there (same insets as the rack drawing). */
.dte-plate::before, .dte-plate::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: calc(100cqw / 19 * .62);
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2);
}
.dte-plate::before { left: 0; border-radius: 4px 0 0 4px; }
.dte-plate::after { right: 0; border-radius: 0 4px 4px 0; }
.dte-plate__tag { position: absolute; top: 0; bottom: 0; left: calc(var(--in) * .62); width: calc(var(--in) * .85); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.dte-plate__none { position: absolute; inset: 0; display: none; place-items: center; font: 500 14px/1.2 var(--f-ui); color: var(--muted); }
.dte-plate.is-empty .dte-plate__none { display: grid; }
.dte-art {
  position: absolute; display: block; margin: 0; padding: 0; border: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit;
  cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none;
  outline: 1px dashed transparent; outline-offset: 2px; transition: outline-color var(--t), background-color var(--t), box-shadow var(--t);
}
.dte-art .rk__port { pointer-events: none; }
.dte-art:hover { outline-color: var(--line-2); }
.dte-art:focus-visible, .dte-art.is-sel { outline: 2px solid var(--blue); background: color-mix(in srgb, var(--blue-soft) 70%, transparent); }
.dte-art.is-dragging { z-index: 2; cursor: grabbing; background: var(--surface); box-shadow: 0 8px 24px oklch(var(--scrim) / .18); }
.dte-art.is-clash { outline: 2px solid var(--danger); background: color-mix(in srgb, var(--danger-soft) 70%, transparent); }
.dte.is-dragging { cursor: grabbing; }
.dte-art__name {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 600 calc(var(--in) * .15)/1 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left;
}
/* Ports: none, one row, or blocks. The fields for the other two stay out of the way (CSS only, no JS needed). */
.dte-ports { display: grid; gap: 14px; min-width: 0; margin: 0; padding: 0; border: 0; }
.dte-modes { display: grid; gap: 8px; }
.form .dte-mode {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow var(--t), background-color var(--t);
}
.form .dte-mode input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.dte-mode > span { display: grid; gap: 2px; }
.dte-mode strong { font-weight: 600; }
.form .dte-mode:has(input:checked) { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.dte-ports:not(:has(input[name="portMode"][value="row"]:checked)) .dte-row,
.dte-ports:not(:has(input[name="portMode"][value="blocks"]:checked)) .dte-blocks { display: none; }
.dte-row, .dte-blocks { display: grid; gap: 12px; }
.dte-row .hint, .dte-blocks > .hint { margin: 0; }
.dte-blks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dte-blk { padding: 12px 14px 14px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 1px transparent; transition: box-shadow var(--t), background-color var(--t); }
.dte-blk.is-sel { box-shadow: inset 0 0 0 2px var(--blue); }
.dte-blk__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font: 600 14px/1.3 var(--f-ui); color: var(--ink); }
.dte-blk__range { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.dte-blk__rm { margin-left: auto; }
.dte-blk__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 10px 12px; }
.dte-blk__grid .dte-blk__name { grid-column: 1 / -1; }
.dte-blk__grid label { font-size: 14px; }
/* Filled blocks, then one empty row that reads "Add a block"; the rest wait until that one is used. */
.dte-blk__new { display: none; }
.dte-blk:has(.dte-blk__count:placeholder-shown) { background: transparent; box-shadow: none; outline: 1px dashed var(--line-2); outline-offset: -1px; }
.dte-blk:has(.dte-blk__count:placeholder-shown) :is(.dte-blk__n, .dte-blk__range, .dte-blk__rm) { display: none; }
.dte-blk:has(.dte-blk__count:placeholder-shown) .dte-blk__new { display: inline; color: var(--blue-ink); }
.dte-blk:has(.dte-blk__count:placeholder-shown) ~ .dte-blk:has(.dte-blk__count:placeholder-shown) { display: none; }
/* With JS the empty rows wait behind a real "Add a block" button; the one it opens looks like any other block. */
.dte-add { justify-self: start; }
.dte-add svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
html:not(.js) .dte-add { display: none; }
.js .dte-blk:has(.dte-blk__count:placeholder-shown):not(.is-open) { display: none; }
.js .dte-blk.is-open { background: var(--surface-2); outline: 0; }
.js .dte-blk.is-open .dte-blk__n { display: inline; }
.js .dte-blk.is-open .dte-blk__rm { display: inline-block; }
.js .dte-blk.is-open .dte-blk__new { display: none; }

/* ---------- deleting: the server-drawn confirmation (sites, equipment) and app.js's small confirm dialog ---------- */
.confirm > p { color: var(--ink-2); }
.confirm > p + p, .confirm > ul + p { margin-top: 12px; }
.confirm__list { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink); }
.confirm__tags { list-style: none; margin: 14px 0 16px; padding: 0; display: grid; gap: 8px; }
.confirm__tags li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.confirm__on { font-family: var(--f-ui); font-size: 14px; color: var(--ink-2); }
.confirm__warn { font-family: var(--f-ui); font-size: 14px; color: var(--danger); margin-top: 16px; }
.confirm .form__actions { margin-top: 24px; }
.confirm-dialog {
  width: min(420px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px oklch(var(--scrim) / .24);
}
.confirm-dialog::backdrop { background: oklch(var(--scrim) / .36); }
.confirm-dialog[open] { animation: dialog-in var(--t) var(--ease); }
.confirm-dialog__msg { font: 400 17px/1.45 var(--f-body); }
.confirm-dialog__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- motion (all 0.2s) ---------- */
@keyframes insp-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes insp-out { to { transform: translateX(24px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes swap-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.insp.is-entering .insp__panel { animation: insp-in var(--t) var(--ease); }
.insp.is-entering .insp__scrim { animation: fade-in var(--t) ease; }
.insp.is-leaving .insp__panel { animation: insp-out var(--t) ease-in forwards; }
.insp.is-leaving .insp__scrim { animation: fade-out var(--t) ease-in forwards; }
.insp.is-swapping .insp__head, .insp.is-swapping .insp__body { animation: swap-in var(--t) ease-out; }
main.is-arriving { animation: swap-in var(--t) ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.insp--dialog.is-entering .insp__panel { animation: dialog-in var(--t) var(--ease); }
.insp--dialog.is-leaving .insp__panel { animation: dialog-out var(--t) ease-in forwards; }

/* ---------- Help and feedback (views/feedback.ts, app.js) ----------
   One native popover on every page, dressed as the right-side inspector (it reuses .insp__panel / __head / __body):
   the same width, slide-in and scrim (::backdrop), so it opens over whatever page you are on with no navigation.
   The kind is a radio group in a segmented control; the title and the label follow the checked kind in CSS only (the
   unchecked ones are display: none, so screen readers skip them). The thank-you's check draws itself once. */
.fb {
  margin: 0; padding: 0; border: 0; left: auto; height: auto; color: var(--ink);
  opacity: 0; transform: translateX(24px);
  transition: opacity var(--t), transform var(--t) var(--ease), overlay var(--t) allow-discrete, display var(--t) allow-discrete;
}
.fb:not(:popover-open) { display: none; }
.fb:popover-open { opacity: 1; transform: none; }
@starting-style { .fb:popover-open { opacity: 0; transform: translateX(24px); } }
.fb::backdrop {
  background: oklch(var(--scrim) / .36); opacity: 0;
  transition: opacity var(--t), overlay var(--t) allow-discrete, display var(--t) allow-discrete;
}
.fb:popover-open::backdrop { opacity: 1; }
@starting-style { .fb:popover-open::backdrop { opacity: 0; } }
.fb .insp__close { border: 0; background: none; cursor: pointer; }
.fb .link-btn { font-size: 15px; }
.fb-kinds { border: 0; padding: 0; margin: 0 0 4px; min-width: 0; }
.fb-kinds legend { padding: 0; font: 500 15px/1.3 var(--f-ui); }
.form .seg__opt { position: relative; display: block; gap: 0; font-weight: 500; }
.seg__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg__opt span {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 8px;
  border-radius: calc(var(--r-sm) - var(--pad, 4px)); color: var(--ink-2); font: 500 13px/1 var(--f-ui);
  transition: background-color var(--t), color var(--t), box-shadow var(--t);
}
.seg__opt:hover span { color: var(--ink); }
.seg__opt input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg__opt input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.fb-t { display: none; }
.fb-t--feature { display: inline; }
:is(.fb, .fb-form):has(input[value="bug"]:checked) .fb-t--feature,
:is(.fb, .fb-form):has(input[value="question"]:checked) .fb-t--feature { display: none; }
:is(.fb, .fb-form):has(input[value="bug"]:checked) .fb-t--bug,
:is(.fb, .fb-form):has(input[value="question"]:checked) .fb-t--question { display: inline; }
.fb-done { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 32px 0 8px; }
.fb-done__mark { color: var(--blue); margin-bottom: 12px; }
.fb-done__mark circle, .fb-done__mark path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.fb-done__mark circle { animation: fb-draw .5s var(--ease) both; }
.fb-done__mark path { animation: fb-draw .3s var(--ease) .35s both; }
@keyframes fb-draw { from { stroke-dashoffset: 1; } }
.fb-done__title { font: 600 20px/1.3 var(--f-display); }
.fb-done__sub { font: 400 15px/1.4 var(--f-ui); color: var(--ink-2); }
.fb-done__actions { justify-content: center; margin-top: 20px; }

/* ---------- sticker design (Tags → Sticker design) ----------
 * The sticker is drawn to its real geometry (@docguys/shared STICKER): 3:2, corners 1.5 mm on 60 mm. Its colours are
 * print colours (--stk-bg / --stk-ink from the server), the same in light and dark. Boxes are placed in % by the view.
 */
.design { display: grid; gap: 24px; margin-bottom: 40px; }
@media (min-width: 1000px) { .design { grid-template-columns: minmax(0, 1fr) 360px; align-items: stretch; } }
.design__stage {
  display: grid; justify-items: center; align-content: center; gap: 20px;
  padding: 48px 24px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line);
}
.design__stage .sticker { width: min(100%, 480px); }
.design__note { text-align: center; max-width: 60ch; text-wrap: balance; }
.design__side { display: grid; gap: 16px; align-content: start; }
.design__side .card + .card { margin-top: 0; }

/* The two ways to print a sticker, side by side with the preview. The one in use carries the blue edge + "In use". */
.stk-opt { display: grid; gap: 12px; padding: 20px 24px; }
.stk-opt.is-on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.stk-opt__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stk-opt .card__title { font-size: 20px; margin: 0; }
.stk-opt .facts--stack dt:not(:first-child) { margin-top: 10px; }
.stk-opt__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }

/* The editor: only the picked layout's fields show (no JS needed). */
.stk-pane { display: none; gap: 18px; min-width: 0; }
.stk-form:has(input[name="layout"][value="default"]:checked) .stk-pane--default,
.stk-form:has(input[name="layout"][value="custom"]:checked) .stk-pane--custom { display: grid; }
.stk-field { display: grid; gap: 10px; min-width: 0; }
.stk-field .downloads { margin: 0; }
.radio-cards--row { grid-template-columns: 1fr 1fr; }
.radio-cards--row legend { grid-column: 1 / -1; }
.stk-file {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm); font: 400 14px/1.3 var(--f-ui);
}
.stk-file > .icon { color: var(--muted); flex: none; }
.stk-file__text { display: grid; gap: 2px; min-width: 0; flex: 1 1 140px; }
.stk-file__name { font-weight: 500; }
.stk-file .hint { font-size: 13px; font-variant-numeric: tabular-nums; }

/* Settings → Tap page: the settings down the left, and the real tap page (an iframe of our own preview route) in an
   iPhone's outline on its own stage. */
.tp { display: grid; gap: 28px; }
@media (min-width: 720px) { .tp { grid-template-columns: minmax(0, 1fr) 264px; gap: 40px; align-items: start; } }
.tp__side { display: grid; gap: 20px; align-content: start; min-width: 0; }
.tp__colour { flex-wrap: nowrap; }
.tp__actions { margin: 4px 0 0; }
.settings__section .card .tp__side p + p { margin-top: 0; }
.tp__stage { display: grid; place-items: center; padding: 24px 20px 16px; border-radius: var(--r); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.tp-preview { display: grid; gap: 12px; justify-items: center; width: 100%; min-width: 0; margin: 0; }
.tp-preview figcaption { font-size: 13px; text-align: center; }
/* An iPhone as an outline only (founder's call 2026-11-21: no island): a thin line, the screen a hair inside it,
   corners concentric (32 = 26 + the 6px gap; founder's call 2026-11-21: 40 was too round). The page inside is a real 390 × 844 phone page scaled to the 212px
   screen (--tp-scale), so it lays out exactly as it does on a phone. */
.tp-phone { --tp-scale: calc(212 / 390); flex: none; width: 224px; padding: 6px; border-radius: 32px; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.tp-phone__screen { width: 212px; height: calc(844px * var(--tp-scale)); overflow: hidden; border-radius: 26px; background: var(--surface); }
.tp-phone__frame { display: block; width: 390px; height: 844px; border: 0; transform: scale(var(--tp-scale)); transform-origin: 0 0; pointer-events: none; }
.tp-form .tp-own { display: none; }
.tp-form:has(input[name="bar"][value="own"]:checked) .tp-own { display: grid; }

/* Make your own design: three numbered steps. */
.stk-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: stk; }
.stk-steps > li { counter-increment: stk; position: relative; padding-left: 48px; display: grid; gap: 8px; justify-items: start; }
.stk-steps > li::before {
  content: counter(stk) / ""; position: absolute; left: 0; top: -3px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font: 600 14px/1 var(--f-ui); font-variant-numeric: tabular-nums;
  background: var(--blue-soft); color: var(--blue-ink);
}
.stk-steps h3 { font: 600 17px/1.3 var(--f-display); margin: 0; }
.stk-steps p { margin: 0; color: var(--ink-2); }
.stk-steps .downloads { margin: 4px 0 0; }
.card > h3.card__title { font-size: 17px; margin-bottom: 16px; }

.sticker { margin: 0; container-type: inline-size; }
.sticker__trim {
  position: relative; aspect-ratio: 3 / 2; overflow: hidden;
  border-radius: var(--stk-r); background: var(--stk-bg); color: var(--stk-ink);
  box-shadow: 0 1px 2px oklch(21% 0.034 263.4 / .12), 0 10px 28px -10px oklch(21% 0.034 263.4 / .28), inset 0 0 0 1px oklch(0% 0 0 / .06);
}
.sticker__trim > * { position: absolute; margin: 0; }
/* Hover (fine pointers, motion allowed; app.js sets --rx / --ry / --sx): the sticker tilts toward the pointer and a
   light sheen crosses it, like the marketing site's stickers. The sheen is a 260% band slid with transform, parked
   off the sticker at rest, so the still picture is unchanged. */
.sticker { perspective: 1100px; }
.sticker__trim { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.sticker.is-tilt .sticker__trim { box-shadow: 0 1px 2px oklch(21% 0.034 263.4 / .12), 0 22px 40px -14px oklch(21% 0.034 263.4 / .42), inset 0 0 0 1px oklch(0% 0 0 / .06); }
.sticker__trim::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 260%; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, oklch(100% 0 0 / .26) 48%, oklch(100% 0 0 / .06) 56%, transparent 70%);
  transform: translateX(calc(var(--sx, 120%) * -0.6154));
  transition: transform var(--t) var(--ease);
}
@media (prefers-reduced-motion: reduce) { .sticker__trim, .sticker__trim::after { transition: none; } }
.sticker__logo { display: flex; align-items: center; }
.sticker__logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; object-position: left center; }
.sticker__name { font: 600 6.4cqw/1 var(--f-display); letter-spacing: -.015em; overflow-wrap: anywhere; }
.sticker__qr { background: oklch(100% 0 0); border-radius: 2.6cqw; overflow: hidden; }
/* the SVG carries the code's own quiet zone; drop the 2FA page's .qr frame */
.sticker__qr svg { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
/* condensed bold caps read like a printed equipment label (same as the marketing sticker) */
.sticker__tap { display: flex; align-items: flex-end; font: 700 14cqw/.84 var(--f-body); letter-spacing: -.005em; text-transform: uppercase; }
.sticker--guides .sticker__safe {
  /* safe area: 3 mm in from each edge = 5% across, 7.5% down */
  inset: 7.5% 5%; border: 1px dashed currentColor; opacity: .35; border-radius: calc(var(--stk-r) / 2); pointer-events: none;
}
.sticker__art {
  display: grid; align-content: center; gap: 1.5cqw; padding: 3cqw;
  border: 1px dashed var(--line-2); border-radius: 2cqw; color: var(--ink-2);
  font: 600 5cqw/1.1 var(--f-display);
}
.sticker__file { font: 400 3.4cqw/1.3 var(--f-ui); color: var(--muted); overflow-wrap: anywhere; }
.form--inspector .sticker { width: 100%; margin-bottom: 8px; }

.downloads { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.downloads li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.facts--spec { grid-template-columns: minmax(0, 120px) minmax(0, 1fr); }
input.color { width: 72px; height: 44px; padding: 4px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }
.form__danger { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- polish: type, corners, safe areas, hit areas ---------- */

/* Headings break into even lines instead of leaving one word alone; running text avoids short last lines. */
h1, h2, h3, .card__title, .empty-state strong { text-wrap: balance; }
p, li, dd, .lede { text-wrap: pretty; }

/* Numbers that change or sit in columns keep one width per digit, so counts don't jiggle and columns line up. */
.table td, .badge, .bell__count, .next__count, .ep-count, .notif__time, .facts dd, .list__sub, .crumbs,
.chip, .stat__note, .pick__opt, time, input[type="number"], kbd { font-variant-numeric: tabular-nums; }

/* Continuous (squircle) corners where the browser has them; elsewhere the plain radius stays. The squircle reads
   tighter than a circular arc of the same size, so the tokens grow to keep the same softness. Only components on the
   radius tokens: pills stay pills, and the sticker keeps its real 1.5 mm round corners (--stk-r). */
@supports (corner-shape: squircle) {
  :root { --r-lg: 22px; --r: 17px; --r-sm: 14px; }
  .card, .stat, .eq-card, .empty-state, .empty-state__icon, .list__row, .tile-icon, .file, .file__open,
  .notice, .status, .alert, .iconbtn, .topbar__brand, .rail a, .setup, .pop, .pop__menu a, .pop__menu button,
  .search input, .search__pop, .search-page input, .form input, .form select, .form textarea, .form .radio-card,
  .pick, .pick__list, .ticket, .insp__close, .insp--dialog .insp__panel, .confirm-dialog, .bare main,
  .design__stage, .keys kbd, .search__key { corner-shape: squircle; }
}

/* ---------- announcements from docguys (founder request 2026-11-15) ----------
   Rows above the top bar on every signed-in page: grey notice, pastel yellow maintenance, pastel red issue, always
   with the word too. One 40px line each (the layout under it is fixed-height: --ann-h feeds --bar-h); the row is a
   button that opens the whole announcement in a popover. app.js adds "Dismiss" to grey and yellow ones. The admin
   site previews them with the same .announce row. */
html[data-ann="1"] { --ann-h: 40px; }
html[data-ann="2"] { --ann-h: 80px; }
.announce-bar { position: sticky; top: 0; z-index: 31; }
.announce {
  display: flex; align-items: center; gap: 10px; height: 40px; width: 100%; min-width: 0;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: var(--ann-notice); color: var(--ann-notice-ink); font: 400 14px/1.2 var(--f-ui);
}
.announce--maintenance { background: var(--ann-maintenance); color: var(--ann-maintenance-ink); }
.announce--issue { background: var(--ann-issue); color: var(--ann-issue-ink); }
.announce[hidden] { display: none; }
.announce__open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 100%; padding: 0; border: 0;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.announce__open .icon { flex: none; }
.announce__tone { flex: none; font-weight: 700; }
.announce__text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.announce__text b { font-weight: 600; }
.announce__more { flex: none; text-decoration: underline; text-underline-offset: 3px; }
.announce__open:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; border-radius: 8px; }
.announce__x {
  flex: none; display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border: 0; border-radius: 999px;
  background: none; color: inherit; font: 500 13px/1 var(--f-ui); cursor: pointer; box-shadow: inset 0 0 0 1px currentColor;
  transition: opacity var(--t);
}
.announce__x:hover { opacity: .7; }
html:not(.js) .announce__x { display: none; }
.announce--static { border-radius: var(--r-sm); padding: 0 14px; }
.announce-pop { width: min(460px, calc(100vw - 24px)); padding: 20px; inset: calc(var(--bar-h) + 8px) auto auto 50%; translate: -50% 0; }
.announce-pop h2 { margin: 8px 0 0; font-size: 20px; }
.announce-pop p { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--f-body); font-size: 17px; line-height: 1.45; }
.announce-pop .hint { font-family: var(--f-ui); font-size: 13px; }
@media (max-width: 560px) { .announce__more { display: none; } }

/* Safe areas (notch, rounded screen corners, home indicator): the viewport is viewport-fit=cover. */
.rail { padding-left: max(10px, env(safe-area-inset-left)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.insp__body { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
.insp__head { padding-right: max(16px, env(safe-area-inset-right)); }
.pop { right: max(12px, env(safe-area-inset-right)); }
.bare__pause { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
@media (max-width: 899px) {
  .ticket, .ps__pop--l .ticket, .ps__pop--r .ticket, .ps__pop--up .ticket {
    left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); bottom: calc(var(--tabbar) + max(8px, env(safe-area-inset-bottom)));
  }
}
@media (min-width: 900px) and (hover: hover) {
  .rail, html:not(.js) .rail { padding-left: 10px; }
}

/* Hit slop: small controls answer to a bigger invisible area (at least 24×24, WCAG 2.2 2.5.8) without changing the
   layout. Kept small enough that neighbours never overlap. Not on rack ports: they sit edge to edge. */
.crumbs a, .link-btn, .search__foot a, .table a, .switch { position: relative; }
.crumbs a::before, .link-btn::before, .search__foot a::before, .table a::before {
  content: ""; position: absolute; inset: -8px -4px;
}
.switch::before { content: ""; position: absolute; inset: -12px -6px; border-radius: 999px; }
.ticket__close::before, .avatar-btn::before { content: ""; position: absolute; inset: -4px; }
.ticket__close, .avatar-btn { position: relative; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* A second line inside a table cell (an order's tracking number, "In your account since…"). */
.table .list__sub { display: block; font-size: 14px; }

/* Sticker orders (Tags, and the first one on Home's checklist): a card per order with a four-step progress bar.
   The step is always named in words under the bar; the bar itself is decoration (aria-hidden). */
.orders { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 12px; }
@media (min-width: 900px) { .orders { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.orders > .order { display: grid; gap: 14px; align-content: start; padding: 20px 24px; margin: 0; }
.order__head h3 { font-size: 20px; }
.order__meta, .order__detail { margin: 4px 0 0; font-family: var(--f-ui); font-size: 14px; color: var(--ink-2); }
.order__detail { margin: 0; }
.otrack__bar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.otrack__bar li { display: grid; gap: 6px; font: 500 12px/1.3 var(--f-ui); color: var(--muted); }
.otrack__bar li::before { content: ""; height: 6px; border-radius: 999px; background: var(--surface-3); transition: background var(--t); }
.otrack__bar li.is-done::before { background: var(--blue); }
.otrack__bar li.is-now { color: var(--ink); }
.otrack__now { margin: 10px 0 0; font-family: var(--f-ui); font-size: 15px; }
.otrack__of { color: var(--muted); font-size: 13px; margin-left: 6px; }
@media (max-width: 520px) { .otrack__bar li span { display: none; } }

/* ---------- Billing (routes/billing.ts) ---------- */
.nudge { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; border-color: var(--blue); background: var(--blue-soft); margin-bottom: 20px; }
.nudge__text { flex: 1 1 320px; }
.nudge .nudge__text h2 { margin-bottom: 6px; font-size: 20px; }
.nudge p { color: var(--ink-2); max-width: 64ch; }
.billing__note { margin-top: 20px; }
.plans { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan { display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; background: var(--surface); }
.plan--pick { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.plan__name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 20px; margin: 0; }
.plan__price { font-family: var(--f-ui); color: var(--ink-2); }
.plan__price b { font-size: 32px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-family: var(--f-ui); font-size: 15px; color: var(--ink-2); }
.plan__lines li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start; }
.plan__lines svg { margin-top: 3px; color: var(--blue); }
.plan__buy { display: grid; gap: 8px; margin-top: auto; padding-top: 8px; }
.plan__buy .btn { justify-content: center; }
@media (min-width: 900px) {
  .plans--one .plan { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; align-items: center; gap: 12px 32px; }
  .plans--one .plan__name, .plans--one .plan__price { grid-column: 1; }
  .plans--one .plan__lines { grid-column: 2; grid-row: 1 / span 2; }
  .plans--one .plan__buy { grid-column: 3; grid-row: 1 / span 2; margin: 0; padding: 0; }
}

/* ---------- change requests + audit log (routes/review.ts) ---------- */
/* What the person typed on the tap page: their words, kept as they wrote them. */
.req__body {
  margin: 0 0 28px; padding: 16px 18px; border-radius: var(--r); background: var(--surface-2);
  font-size: 18px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.list__meta time { font-variant-numeric: tabular-nums; }
/* The audit table scrolls sideways inside itself on a phone; the page never does. */
.table-wrap { overflow-x: auto; }
.audit { min-width: 560px; }
.audit td { vertical-align: top; }
.audit__when { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.audit a[aria-current="true"] { font-weight: 600; }
.audit__ua { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.audit-diff { table-layout: fixed; }
.audit-diff th[scope="row"] { width: 34%; font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-2); vertical-align: top; }
.audit-diff td { vertical-align: top; overflow-wrap: anywhere; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-top: 24px; }
.pager > :last-child { justify-self: end; }
.pager > :first-child { justify-self: start; }
.pager__at { font: 500 14px/1 var(--f-ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- interface polish (founder's list 2026-11-18; appdesignguidelines.md "Interface polish") ---------- */
:root {
  --spring: cubic-bezier(.34, 1.56, .64, 1);   /* overshoots a little: only for feedback (a press let go, a check landing) */
  --icon-w: 1.75;                              /* icon stroke on the 24 grid, matched to the text beside it (below) */
}

/* Icon weight follows the text it sits beside. Untitled UI icons are drawn with a 2px stroke on a 24 grid; at 16 to
   20px beside regular (400) Acumin that reads heavier than the letters, so regular text gets 1.75, medium and
   semibold labels 2, bold 2.25. The custom property inherits, so a component only has to say how heavy its text is. */
.icon { stroke-width: var(--icon-w); }
.btn, .tool, .chip, .badge, .tabs, .seg, .modes, .link-btn, .tagline, .tile-icon, .announce__x, .plan__lines, .status, .alert,
h1, h2, h3, strong, b, th, legend, .form label { --icon-w: 2; }
.announce__tone, .bell__count { --icon-w: 2.25; }
.form label :is(input, select, textarea), .form label .hint, .form label .pick { --icon-w: 1.75; }

/* A box that only holds an icon has no line of text in it: line-height 0, so the icon is centred on the box itself
   and never on a phantom text line (which sits a pixel or two low). */
.iconbtn, .tile-icon, .notif__icon, .pop__empty-icon, .empty-state__icon, .swap { line-height: 0; }

/* Two icons that trade places (pause ⇄ play, copy ⇄ copied): stacked in one cell, the one leaving blurs and shrinks
   away while the other sharpens in. Mark the pair .swap and put .is-on on it (or aria-pressed="true" on its button). */
.swap { display: inline-grid; place-items: center; }
.swap > * { grid-area: 1 / 1; }
.swap > *, .bare__pause > .icon { transition: opacity var(--t) var(--ease), filter var(--t) var(--ease), scale var(--t) var(--ease); }
.swap > :last-child, .swap.is-on > :first-child, [aria-pressed="true"] > .swap > :first-child { opacity: 0; filter: blur(4px); scale: .5; }
.swap.is-on > :last-child, [aria-pressed="true"] > .swap > :last-child { opacity: 1; filter: none; scale: 1; }

/* Reserve the bold width. Text that gets heavier when it's current or picked (an audit row, a wall jack, a picker
   option) would change width and nudge its neighbours. data-bw repeats the label; an invisible copy at the heavier
   weight holds the space from the start. --bw is the weight it will grow to. */
[data-bw] { display: inline-flex; flex-direction: column; }
[data-bw]::after {
  content: attr(data-bw) / ""; height: 0; overflow: hidden; visibility: hidden; font-weight: var(--bw, 600);
  pointer-events: none; user-select: none;
}
.pick__opt { --bw: 500; }
.pick__opt[data-bw] { display: flex; }

/* File names are cut in the middle, so the extension (and a "-rev3" before it) always shows. fileName() in
   views/components.ts splits the name; the first part gives way, the tail never does. */
.fname { display: flex; min-width: 0; max-width: 100%; white-space: nowrap; }
.fname__a { flex: 0 1 auto; min-width: 2ch; overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.fname__b { flex: none; white-space: pre; }

/* Checkboxes and radios in the app's own style (every one of them: forms, type results, import, the editors).
   :where() keeps the base at zero specificity, so a component's own size and margin still win. The mark lands with a
   small overshoot. Windows high contrast gets the system control back. */
:where(input[type="checkbox"]:not(.switch), input[type="radio"]) {
  -webkit-appearance: none; appearance: none; flex: none; box-sizing: border-box;
  display: inline-grid; place-content: center; width: 20px; height: 20px; margin: 0; padding: 0; vertical-align: -4px;
  border: 1.5px solid var(--muted); border-radius: 6px; background: var(--surface); color: var(--on-blue); cursor: pointer;
  transition: background-color var(--t), border-color var(--t), box-shadow var(--t), scale var(--t) var(--spring);
}
:where(input[type="radio"]) { border-radius: 50%; }
:where(input[type="checkbox"]:not(.switch), input[type="radio"])::after { content: ""; scale: 0; transition: scale var(--t) var(--spring); }
:where(input[type="checkbox"]:not(.switch))::after {
  width: 10px; height: 6px; margin-top: -2px; border: solid currentColor; border-width: 0 0 2px 2px; border-radius: 1px; rotate: -45deg;
}
:where(input[type="radio"])::after { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
input[type="checkbox"]:not(.switch):hover, input[type="radio"]:hover { border-color: var(--ink-2); }
input[type="checkbox"]:not(.switch):is(:checked, :indeterminate), input[type="radio"]:checked { background: var(--blue); border-color: var(--blue); }
input[type="checkbox"]:not(.switch):is(:checked, :indeterminate)::after, input[type="radio"]:checked::after { scale: 1; }
input[type="checkbox"]:not(.switch):indeterminate::after { width: 10px; height: 0; margin: 0; border-width: 0 0 2px; rotate: none; }
input[type="checkbox"]:not(.switch):focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; box-shadow: none; }
input[type="checkbox"]:not(.switch):active, input[type="radio"]:active { scale: .88; }
input[type="checkbox"]:not(.switch):disabled, input[type="radio"]:disabled { opacity: .5; cursor: not-allowed; }
.seg__opt input { border: 0; }   /* the segmented control's radio is an invisible cover, not a box */
/* Round things stay round: the squircle corners above (".form input") would square off a radio or a switch. */
input[type="radio"], input[type="radio"]::after, .switch, .switch::after { corner-shape: round; }
@media (forced-colors: active) {
  input[type="checkbox"]:not(.switch), input[type="radio"] { -webkit-appearance: auto; appearance: auto; }
  input[type="checkbox"]:not(.switch)::after, input[type="radio"]::after { content: none; }
}

/* Dropdowns: pick.js dresses every <select> as a .pick button + listbox. One that couldn't be dressed (no JS) still
   draws as our field with our caret wherever it sits, not only inside .form (zero specificity: components still win). */
:where(select:not([multiple])) {
  -webkit-appearance: none; appearance: none; min-height: 36px; padding: 6px 36px 6px 12px; text-overflow: ellipsis;
  font: 400 15px/1.3 var(--f-ui); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background-color: var(--surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
/* Sheet cells: the caret for a dropdown not yet dressed, and a dressed one keeps the cell's padding. */
.sheet__cell select, .sheet__cell select:hover, .sheet__cell select:focus {
  padding-right: 24px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 13px) 52%, calc(100% - 8px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.sheet__cell button.pick { display: flex; padding: 5px 26px 5px 8px; text-align: left; }
.sheet__cell button.pick::after { right: 9px; }
.pick.is-placeholder .pick__text { color: var(--muted); }
.pick[disabled] { opacity: .55; cursor: not-allowed; }
.pick.is-invalid { border-color: var(--danger); }
.pick__opt[aria-disabled="true"] { color: var(--muted); cursor: default; }
.pick--inline { width: auto; display: inline-flex; }

/* Exaggerated feedback: whatever you press visibly gives, more than a real button would, and springs back when let
   go. Small things give most (icon buttons), rows least. The press is quick; the release is the 0.2s spring. */
.btn, .tool, .chip, .iconbtn, .seg__btn, .modes__btn, .avatar-btn, .pick, .announce__x, .insp__close, .ticket__close,
.rail a, .nav__tab, .setup, .pop__menu a, .pop__menu button, .list__row, .file, .eq-card, .form .radio-card, .type-opt, .form .type-opt,
.lib-pick__item, .spin__b, .seg__opt span, a.notif__row, .tabs a {
  transition: background-color var(--t), color var(--t), border-color var(--t), box-shadow var(--t), opacity var(--t),
    filter var(--t), transform var(--t) var(--ease), scale var(--t) var(--spring);
}
:is(.btn, .tool, .chip, .seg__btn, .modes__btn, .announce__x, .tabs a):active, .seg__opt:active span { scale: .95; }
:is(.iconbtn, .insp__close, .ticket__close, .avatar-btn, .spin__b):active { scale: .86; }
:is(.rail a, .nav__tab, .setup, .pop__menu a, .pop__menu button, .pick, .form .radio-card, .type-opt, .lib-pick__item):active { scale: .97; }
:is(.list__row, .file, .eq-card, a.notif__row):active { scale: .985; }
:is(.btn, .tool, .chip, .iconbtn, .seg__btn, .modes__btn, .avatar-btn, .pick, .announce__x, .insp__close, .ticket__close,
  .rail a, .nav__tab, .setup, .pop__menu a, .pop__menu button, .list__row, .file, .eq-card, .form .radio-card, .type-opt, .lib-pick__item,
  .spin__b, a.notif__row, .tabs a):active { transition-duration: .08s; }
:is(.btn, .tool, .pick)[disabled]:active, .btn[aria-busy="true"]:active { scale: none; }
/* a row doesn't give when the press is on a button inside it */
:is(.file, .list__row, .eq-card):has(:is(button, .iconbtn):active):active { scale: none; }
/* The switch: its thumb stretches toward where it's going while held, then lands with the spring. */
.switch::after { transform-origin: 0 50%; transition: transform var(--t) var(--spring), scale var(--t) var(--ease); }
.switch:checked::after { transform-origin: 100% 50%; }
.switch:active::after { scale: 1.25 1; }
/* An error arrives with a short shake, a saved / done message with a small bounce: you can't miss either. */
@media (prefers-reduced-motion: no-preference) {
  .alert { animation: alert-in var(--t) var(--ease); }
  .status { animation: status-in var(--t) var(--spring); }
}
@keyframes alert-in { 0% { translate: 0; } 30% { translate: -6px 0; } 65% { translate: 4px 0; } 100% { translate: 0; } }
@keyframes status-in { from { scale: .94; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .swap > *, .bare__pause > .icon { filter: none !important; } }

/* ---------- the links view (views/links.ts): the power map and the racks' graph ---------- */
/* The power map: boxes on rows joined by lines, like the admin Cockpit's. Drawn at its own size (never stretched to
   the page); a site with a wide fan-out scrolls sideways inside its card. */
.lm { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: clip; }
.lm__scroll { overflow-x: auto; overscroll-behavior-x: contain; padding: 20px; }
.lm__scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 14px 14px 0 0; }
.lm__svg { display: block; max-width: none; margin-inline: auto; }
.lm-link { stroke-width: 2; stroke-linecap: round; }
.lm-link--on { stroke: var(--blue); }
.lm-link--off { stroke: var(--muted); stroke-dasharray: 2 7; }
.lm-node { cursor: pointer; outline: none; text-decoration: none; }
.lm-node rect { fill: var(--surface); stroke: var(--line-2); stroke-width: 1; transition: stroke var(--t), fill var(--t); }
.lm-node--top rect { fill: var(--surface-2); }
.lm-node:hover rect { stroke: var(--ink-2); }
.lm-node:active rect { fill: var(--surface-2); }
.lm-node:focus-visible rect, .lm-node[aria-current="true"] rect { stroke: var(--blue); stroke-width: 2; }
.lm-node__name { font: 600 14px/1 var(--f-ui); fill: var(--ink); }
.lm-node__sub { font: 400 12px/1 var(--f-ui); fill: var(--muted); font-variant-numeric: tabular-nums; }
.lm-node__dot { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.lm-node--on .lm-node__dot { fill: var(--blue); stroke: var(--blue); }
.lm__key { list-style: none; margin: 0; padding: 12px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; font: 400 13px/1.4 var(--f-ui); color: var(--muted); }
.lm__key li { display: inline-flex; align-items: center; gap: 8px; }
.lm__how { margin-left: auto; }
.lm__swatch { width: 24px; height: 0; border-top: 2px solid var(--blue); border-radius: 2px; }
.lm__swatch--off { border-top: 2px dotted var(--muted); }
@media (max-width: 640px) { .lm__how { margin-left: 0; flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { .lm-node rect { transition: none; } }
.lk-start__lead { margin: 0 0 12px; }

/* Linked equipment where it is edited (views/power.ts): the inspector on the links view, a breaker's popup, and the
   prompt right after a link is made. */
.pl--insp { margin-top: 0; padding-top: 0; border-top: 0; gap: 20px; }
.pl--insp .pl__title { font-size: 14px; }
.pl--insp .alert { margin: 0; }
.pl__open { justify-self: start; }
.pl__new { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--line); animation: status-in var(--t) both; }
.pl__new p { margin: 0; font: 400 14px/1.4 var(--f-ui); color: var(--ink); }
.pl__new form { margin: 0; }
.pl__fold > .fold__row { margin-bottom: 8px; }
.pl__add .pl__label + .pl__label { margin-top: 2px; }
.pl__ro { margin: 12px 0 0; font: 400 14px/1.4 var(--f-ui); color: var(--ink-2); overflow-wrap: anywhere; }
.pwr-fold { margin-top: 12px; }
.tie-fold + .pwr-fold, .pwr-fold + .pwr-fold { margin-top: 4px; }
.pwr-fold__in { display: grid; gap: 12px; margin-top: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
@media (prefers-reduced-motion: reduce) { .pl__new { animation: none; } }
.rg { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rg__svg { display: block; width: 100%; height: auto; max-height: 360px; }
.rg__edge line { stroke: var(--muted); stroke-width: 2; }
.rg__count { fill: var(--muted); font: 400 13px var(--f-ui); }
.rg__count, .rg__node text { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.rg__node circle { fill: var(--blue); }
.rg__node text { fill: var(--ink); font: 500 14px var(--f-ui); }
.rg__list { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; font: 400 14px/1.4 var(--f-ui); }
.lw { display: grid; gap: 8px; margin-bottom: 12px; }
.lw__row { display: flex; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font: 400 14px/1.4 var(--f-ui); }
.lw__row svg { flex: none; margin-top: 1px; color: var(--warn); }
.pl__all { font-size: 13px; }
