/* Unified Array Control, the new UI ("Calm", direction A). ONE stylesheet for /next/: tokens, base, components, shell, pages.
   Rules (docs/UI-NEXT.md): every colour, size and radius is a token below; no inline styles anywhere (the CSP for /next/ is style-src 'self');
   light is the default, dark follows the system unless the person picks one (data-theme on <html>); .theme-light / .theme-dark force a theme on one subtree (the gallery). */

/* ---------- fonts (self-hosted, SIL OFL 1.1, see fonts/OFL.txt) ---------- */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

/* ---------- tokens: light (default) ---------- */
:root, .theme-light {
  --ground: #F6F6F4;        /* page background */
  --surface: #FFFFFF;       /* cards, rail, top bar */
  --surface-2: #FAFAFA;     /* fields, quiet fills */
  --sunk: #ECEDEF;          /* segmented track, skeleton */
  --hover: #F3F6FD;         /* row and card hover */
  --selected: #EAF0FD;      /* current nav item, selected option */
  --selected-ink: #173E9E;
  --line: #E4E5E8;          /* hairline around surfaces */
  --line-soft: #ECEDEF;     /* separators inside a surface */
  --line-btn: #DADCE0;      /* secondary button outline (the label identifies it) */
  --control: #858A94;       /* outline of fields, boxes, switches: 3:1 on every surface */
  --ink: #16181D;
  --ink-2: #3B3F47;
  --muted: #5B606B;
  --accent: #2457D6;
  --accent-hover: #173E9E;
  --accent-fill: #2457D6;
  --accent-fill-hover: #1C47B5;
  --on-accent: #FFFFFF;
  --red: #C6283A;
  --amber: #A35200;
  --green: #1A7346;         /* #1E7F4F darkened a little: 4.5:1 on every surface */
  --grey: #61666F;          /* #6B7280 darkened a little: 4.5:1 on the ground */
  --red-bg: #FDEEEF;  --red-line: #F3C7CC;  --red-ink: #9F1D2D;
  --amber-bg: #FFF4E5; --amber-line: #F2D3A8;
  --green-bg: #E7F6EF; --green-line: #BFE3CF;
  --info-bg: #EAF0FD; --info-line: #C9D7F7;
  --danger-fill: #C6283A; --danger-fill-hover: #A81F30;
  --focus: #2457D6;
  --scrim: rgba(22, 24, 29, .38);
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .08);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .08);
  --scroll-thumb: #B9BDC5; --scroll-thumb-hover: #8F949D; --scroll-track: transparent;
  --skeleton-hi: #F6F7F8;
  /* logo chip fills for initials (white text passes 4.5:1 on each) */
  --chip-0: #0F766E; --chip-1: #6D28D9; --chip-2: #1D4ED8; --chip-3: #9A4A08; --chip-4: #BE185D; --chip-5: #4D5562; --chip-6: #15803D; --chip-7: #B42318;
  --chip-logo: #F1F2F4;     /* a customer logo's tile: a very light neutral, so a mostly white logo still sits visibly in its square */
  color-scheme: light;
}

/* ---------- tokens: dark ---------- */
:root[data-theme="dark"], .theme-dark {
  --ground: #0E1014; --surface: #16191F; --surface-2: #1B1F26; --sunk: #23272F; --hover: #1C2230; --selected: #1C2A47; --selected-ink: #B9CCFF;
  --line: #2A2E36; --line-soft: #23272E; --line-btn: #343944; --control: #6E7480;
  --ink: #ECEEF2; --ink-2: #C9CDD5; --muted: #A1A7B2;
  --accent: #86A9FF; --accent-hover: #B9CCFF; --accent-fill: #3263E6; --accent-fill-hover: #2753C8; --on-accent: #FFFFFF;
  --red: #FF7D89; --amber: #F0A456; --green: #55C892; --grey: #9CA3AE;
  --red-bg: #2B1519; --red-line: #5A2630; --red-ink: #FFB3BA;
  --amber-bg: #2A1F10; --amber-line: #5A4120;
  --green-bg: #11261C; --green-line: #24513A;
  --info-bg: #16233F; --info-line: #2C4377;
  --danger-fill: #C42E40; --danger-fill-hover: #A82536;
  --focus: #86A9FF; --scrim: rgba(0, 0, 0, .6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  --scroll-thumb: #3D434E; --scroll-thumb-hover: #59606C; --scroll-track: transparent;
  --skeleton-hi: #2B3039;
  --chip-0: #0F766E; --chip-1: #6D28D9; --chip-2: #1D4ED8; --chip-3: #9A4A08; --chip-4: #BE185D; --chip-5: #4D5562; --chip-6: #15803D; --chip-7: #B42318;
  --chip-logo: #D9DDE3;     /* a customer logo's tile (dark): light enough for dark logos, grey enough that a white logo shows */
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0E1014; --surface: #16191F; --surface-2: #1B1F26; --sunk: #23272F; --hover: #1C2230; --selected: #1C2A47; --selected-ink: #B9CCFF;
    --line: #2A2E36; --line-soft: #23272E; --line-btn: #343944; --control: #6E7480;
    --ink: #ECEEF2; --ink-2: #C9CDD5; --muted: #A1A7B2;
    --accent: #86A9FF; --accent-hover: #B9CCFF; --accent-fill: #3263E6; --accent-fill-hover: #2753C8; --on-accent: #FFFFFF;
    --red: #FF7D89; --amber: #F0A456; --green: #55C892; --grey: #9CA3AE;
    --red-bg: #2B1519; --red-line: #5A2630; --red-ink: #FFB3BA;
    --amber-bg: #2A1F10; --amber-line: #5A4120;
    --green-bg: #11261C; --green-line: #24513A;
    --info-bg: #16233F; --info-line: #2C4377;
    --danger-fill: #C42E40; --danger-fill-hover: #A82536;
    --focus: #86A9FF; --scrim: rgba(0, 0, 0, .6);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-pop: 0 16px 40px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
    --scroll-thumb: #3D434E; --scroll-thumb-hover: #59606C; --scroll-track: transparent;
    --skeleton-hi: #2B3039;
    --chip-logo: #D9DDE3;
    color-scheme: dark;
  }
}

/* ---------- scale tokens (same in both themes) ---------- */
:root {
  --font: "Geist", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", "Cascadia Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --t-12: 12px; --t-13: 13px; --t-14: 14px; --t-15: 15px; --t-17: 17px; --t-20: 20px; --t-28: 28px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;
  --r-sm: 6px; --r: 8px; --r-md: 10px; --r-lg: 12px;
  --h-sm: 36px; --h: 44px;
  --rail-w: 248px; --rail-w-compact: 76px; --top-h: 76px; --tab-h: 64px;
  --page-max: none;         /* pages use the whole window beside the menu; only prose and forms keep a reading width (.prose, .form-width) */
  --page-pad: 24px;         /* the side padding of a page (16 px on a phone) */
  --prose-max: 75ch; --form-max: 960px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
/* the Android app (native-shell.js adds .ua-native): the page never moves sideways as a whole; wide tables and tab rows keep their own sideways scroll */
html.ua-native, html.ua-native body { overflow-x: clip; overscroll-behavior-x: none; }
body { background: var(--ground); color: var(--ink); font: 400 var(--t-15)/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "ss01" 0; }
.theme-light, .theme-dark { background: var(--ground); color: var(--ink); }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: var(--t-28); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
h2 { font-size: var(--t-17); font-weight: 600; line-height: 1.3; }
h3 { font-size: var(--t-15); font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img, svg { display: block; }
svg { flex: none; }
[hidden] { display: none !important; }
.mono, code, kbd { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.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: var(--s-4); top: -60px; z-index: 50; background: var(--surface); color: var(--ink); padding: 0 var(--s-4); height: var(--h); display: inline-flex; align-items: center; border: 2px solid var(--focus); border-radius: var(--r-md); }
.skip:focus { top: var(--s-3); }

/* focus: one ring for everything, keyboard only */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.btn:focus-visible, .field__control:focus-visible { outline-offset: 2px; }

/* thick, styled scrollbars everywhere (Chromium and Safari: ::-webkit-scrollbar; Firefox: scrollbar-color) */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-color: var(--scroll-thumb) var(--scroll-track); scrollbar-width: auto; } }

/* reduced motion: no slides, no shimmer, no smooth scrolling */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- icons ---------- */
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico--sm { width: 16px; height: 16px; }
.ico--lg { width: 22px; height: 22px; }

/* ---------- buttons: primary, secondary, quiet, danger; 44 (default) and 36 (dense) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: var(--h); min-width: var(--h); padding: 0 var(--s-4); border: 1px solid var(--line-btn); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: var(--t-15); font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none; transition: background-color .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease); }
.btn:hover { background: var(--hover); border-color: var(--control); color: var(--ink); }
.btn--primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); font-weight: 600; }
.btn--primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); color: var(--on-accent); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--quiet:hover { background: var(--sunk); border-color: transparent; color: var(--ink); }
.btn--danger { background: var(--danger-fill); border-color: var(--danger-fill); color: #FFFFFF; font-weight: 600; }
.btn--danger:hover { background: var(--danger-fill-hover); border-color: var(--danger-fill-hover); color: #FFFFFF; }
.btn--sm { height: var(--h-sm); min-width: var(--h-sm); padding: 0 var(--s-3); border-radius: var(--r); font-size: var(--t-14); }
.btn--icon { padding: 0; width: var(--h); }
.btn--icon.btn--sm { width: var(--h-sm); }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn .kbd { margin-left: var(--s-1); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }

/* ---------- kbd hint, badge ---------- */
.kbd { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border: 1px solid var(--line-btn); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--muted); font: 500 var(--t-12)/1 var(--mono); white-space: nowrap; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--sunk); color: var(--ink-2); font-size: var(--t-12); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.badge--alert { background: var(--danger-fill); color: #FFFFFF; }
.badge--accent { background: var(--accent-fill); color: var(--on-accent); }
.badge--quiet { background: transparent; color: var(--muted); font-weight: 500; padding: 0; min-width: 0; }

/* ---------- status: light + word, sentence case ---------- */
.status { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-14); font-weight: 500; line-height: 1.2; white-space: nowrap; }
.status__light { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.status--ok { color: var(--green); }
.status--attention { color: var(--amber); }
.status--offline { color: var(--red); }
.status--unknown { color: var(--grey); }
.status--quiet { color: var(--grey); }
.status--quiet .status__light { background: transparent; border: 2px dashed currentColor; }
.status--info { color: var(--accent); }
.status--maintenance { color: var(--accent); }
.status--maintenance .status__light { background: transparent; border: 2px solid currentColor; box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 6px currentColor; }
.status--sm { font-size: var(--t-13); gap: 6px; }
.status--sm .status__light { width: 8px; height: 8px; }
.status--strong { font-weight: 600; }

/* ---------- logo chip: one fixed square, the picture contained, initials when there is none ---------- */
.chip { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: var(--r); overflow: hidden; background: var(--chip-5); color: #FFFFFF; font-weight: 700; font-size: 12px; letter-spacing: .02em; line-height: 1; user-select: none; }
.chip--20 { width: 20px; height: 20px; border-radius: 5px; font-size: 9px; }
.chip--32 { width: 32px; height: 32px; border-radius: var(--r); font-size: 12px; }
.chip--40 { width: 40px; height: 40px; border-radius: 9px; font-size: 13px; }
.chip--56 { width: 56px; height: 56px; border-radius: var(--r-lg); font-size: 18px; }
.chip__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--chip-logo); padding: 12%; }
/* a chip holding a logo: a hairline drawn OVER the picture (inset, so the square keeps its fixed size and nothing overflows), so a white logo on a white page still sits in a visible square */
.chip--logo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.chip--logo.is-broken::after { content: none; }
.chip.is-broken .chip__img { display: none; }
.chip--c0 { background: var(--chip-0); } .chip--c1 { background: var(--chip-1); } .chip--c2 { background: var(--chip-2); } .chip--c3 { background: var(--chip-3); }
.chip--c4 { background: var(--chip-4); } .chip--c5 { background: var(--chip-5); } .chip--c6 { background: var(--chip-6); } .chip--c7 { background: var(--chip-7); }
.chip--brand { background: var(--ink); color: var(--surface); }

/* ---------- page header ---------- */
.page { width: 100%; max-width: var(--page-max); padding: var(--s-7) var(--page-pad); display: flex; flex-direction: column; gap: var(--s-6); }
/* a reading width for text and forms only: tables, lists, grids and hubs use the full width */
.prose, .dk-md { max-width: var(--prose-max); }
.form-width, .fields:not(.ed-fields) { max-width: var(--form-max); }
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-4); }
.ph__text { flex: 1 1 320px; min-width: 0; }
.ph__title { outline: none; font-size: var(--t-28); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.ph__intro { margin-top: 6px; font-size: var(--t-15); color: var(--muted); max-width: 70ch; }
.ph__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.ph--lead { align-items: flex-start; }
.ph__lead { flex: none; padding-top: 30px; }
.ph__below { margin-top: var(--s-3); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: var(--s-3); font-size: var(--t-13); color: var(--muted); }
.crumbs a { color: var(--accent); }
.crumbs__sep { color: var(--muted); }

/* hub header (customer, device) */
.hub { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.hub__text { flex: 1 1 280px; min-width: 0; }
.hub__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 6px; font-size: var(--t-14); line-height: 21px; color: var(--ink-2); }
/* Every fact on the line is one centred row: an icon sits beside its words, never above them, and a long fact may still wrap on a phone */
.hub__meta > * { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; min-height: 21px; overflow-wrap: anywhere; }
.hub__meta > * > .ico { flex: none; color: var(--muted); }
.hub__meta a { color: var(--accent); }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--sunk); border-radius: var(--r-md); }
.seg__item { display: inline-flex; align-items: center; gap: 6px; height: var(--h-sm); padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: var(--t-14); font-weight: 500; text-decoration: none; white-space: nowrap; }
.seg__item:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.seg__item[aria-selected="true"], .seg__item[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.seg__count { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- tabs (underline) ---------- */
.tabs { display: flex; gap: var(--s-6); overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
/* a tab row wider than its box (the Devices views at 1366 px, most tab rows on a phone) fades out at the edge it scrolls toward, so a cut word reads as "more this way";
   driven by the row's own scroll position (no script), and a row that fits gets no fade at all (an inactive timeline leaves both fades at 0) */
@property --tabs-fl { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --tabs-fr { syntax: '<length>'; inherits: false; initial-value: 0px; }
@keyframes tabs-fade { 0% { --tabs-fl: 0px; --tabs-fr: 40px; } 8%, 92% { --tabs-fl: 40px; --tabs-fr: 40px; } 100% { --tabs-fl: 40px; --tabs-fr: 0px; } }
@supports (animation-timeline: scroll()) {
  .tabs { mask-image: linear-gradient(to right, transparent 0, #000 var(--tabs-fl), #000 calc(100% - var(--tabs-fr)), transparent 100%); animation: tabs-fade linear both; animation-timeline: scroll(self inline); }
}
.tabs--flush { border-bottom: 0; }
.tabs__item { display: inline-flex; align-items: center; gap: 6px; height: var(--h); padding: 0 4px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--ink-2); font-size: var(--t-15); white-space: nowrap; text-decoration: none; }
.tabs__item:hover { color: var(--ink); }
.tabs__item[aria-selected="true"], .tabs__item[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent-fill); }
.tabs__count { color: var(--muted); font-weight: 500; }
.tabpanel:focus-visible { outline-offset: 4px; }

/* ---------- stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stat { display: block; padding: 18px var(--s-5); border-right: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; min-width: 0; }
.stat:last-child { border-right: 0; }
a.stat:hover { background: var(--hover); color: var(--ink); }
.stat__label { font-size: var(--t-13); color: var(--muted); }
.stat__value { margin-top: 4px; font-size: var(--t-28); font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat--offline .stat__value { color: var(--red); }
.stat--attention .stat__value { color: var(--amber); }
.stat--ok .stat__value { color: var(--green); }
.stat--zero .stat__value { color: var(--muted); }

/* ---------- section (a card with a title) ---------- */
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.section__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); min-height: 56px; padding: var(--s-3) var(--s-5); }
.section__title { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; } /* the actions go under the title when both do not fit (a phone), never over it */
.section__body { padding: 0 var(--s-5) var(--s-5); }
.section__body--flush { padding: 0; }
.section__foot { padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line-soft); font-size: var(--t-13); color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: var(--s-6); }
.stack--sm { gap: var(--s-3); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s-5); }
.note { font-size: var(--t-13); color: var(--muted); }

/* ---------- small shared parts: ONE rule each. New markup uses the plain name; the page-prefixed names after it are the copies the
   page builds grew (same look), kept as aliases until those pages are next edited. Never add a page copy of one of these. ---------- */
/* an error line under a form (empty until a save fails) */
.form-err, .nw-err, .bill-err, .cu-err, .admin-err { margin: 0; min-height: 0; color: var(--red); font-size: var(--t-14); font-weight: 500; }
.form-err:empty, .nw-err:empty, .bill-err:empty, .cu-err:empty, .admin-err:empty { display: none; }
/* a sub-heading inside a section or a panel */
.subhead, .cu-h3, .nw-h3, .admin-h3 { font-size: var(--t-15); font-weight: 600; margin-top: var(--s-2); }
/* a plain bulleted list of short facts */
.list-plain, .cu-plain, .nw-plain { margin: 0; padding: 0 0 0 var(--s-5); display: flex; flex-direction: column; gap: 6px; font-size: var(--t-14); }
.list-plain--flat, .cu-plain--flat { list-style: none; }
/* numbered steps (how to set something up) */
.steps-list, .nw-steps, .admin-steps { margin: 0; padding-left: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); font-size: var(--t-14); color: var(--ink-2); }
.steps-list li, .nw-steps li, .admin-steps li { overflow-wrap: anywhere; }
.steps-list .btn, .nw-steps .btn { margin-top: var(--s-1); }
.steps-list--bullets, .admin-steps--bullets { list-style: disc; }
/* one quiet line where a list has nothing to show */
.none-note, .nw-none, .dhub__none { margin: 0; padding: var(--s-4) var(--s-5); color: var(--muted); font-size: var(--t-14); }
/* a quiet second line under a name (a table cell, a list row) */
.subline, .cu-cell-sub, .nw-sub, .bill-sub { display: block; font-size: var(--t-13); font-weight: 400; color: var(--muted); }
/* a warning said in words (never colour alone) */
.warn-word, .nw-warn, .bill-warn, .dk-warnword { color: var(--amber); font-weight: 500; }
/* a small tag (a kind, a label) and its two tones */
.tag, .bill-tag, .dk-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--sunk); color: var(--ink-2); font-size: var(--t-12); font-weight: 500; white-space: nowrap; }
.tag--crit, .dk-tag--crit { background: var(--red-bg); color: var(--red-ink); }
.tag--warn, .dk-tag--warn { background: var(--amber-bg); color: var(--amber); }
/* a block that should not stretch across a wide page (one field, one choice) */
.narrow, .cu-narrow, .admin-narrow { max-width: 420px; }
/* a row of things above a list: views, a search, buttons; --split pushes the last part to the right */
.bar, .dk-bar, .bill-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); min-width: 0; }
.bar--split, .nw-bar, .cu-bar, .admin-headrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); min-width: 0; }
.bar > .subhead, .bar--split > .subhead { margin-top: 0; }

/* ---------- grouped list: one surface per group, whole-row links ---------- */
.glist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; container-type: inline-size; }
.glist__head { display: flex; align-items: center; gap: var(--s-3); min-height: 60px; padding: 14px var(--s-5); color: var(--ink); text-decoration: none; }
a.glist__head:hover { background: var(--hover); color: var(--ink); }
.glist__name { font-size: var(--t-15); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.glist__meta { margin-left: auto; font-size: var(--t-13); color: var(--muted); text-align: right; }
.glist__row { display: grid; grid-template-columns: 132px minmax(170px, 1.1fr) minmax(200px, 2fr) 96px 88px; align-items: center; gap: var(--s-4); min-height: 56px; padding: 10px var(--s-5); border-top: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.glist__row:hover { background: var(--hover); color: var(--ink); }
.glist__row:hover .glist__open { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.glist__row:focus-visible { outline-offset: -2px; border-radius: 0; }
.glist__title { display: flex; flex-direction: column; min-width: 0; }
.glist__main { font-size: var(--t-14); font-weight: 500; overflow-wrap: anywhere; }
.glist__main.mono { font-size: var(--t-14); }
.glist__sub { font-size: var(--t-12); color: var(--muted); }
.glist__text { font-size: var(--t-14); color: var(--ink-2); overflow-wrap: anywhere; min-width: 0; }
.glist__when { font-size: var(--t-13); color: var(--muted); }
.glist__open { justify-self: end; display: inline-flex; align-items: center; height: var(--h-sm); padding: 0 14px; border: 1px solid var(--line-btn); border-radius: var(--r); font-size: var(--t-14); font-weight: 500; color: var(--ink); }
.glist--simple .glist__row { grid-template-columns: minmax(0, 1fr) auto; }
.glist__empty { padding: var(--s-5); border-top: 1px solid var(--line-soft); color: var(--muted); font-size: var(--t-14); }
/* the list follows the width it is given (a page, a half-width pane, a phone): two columns, then one */
@container (max-width: 820px) {
  .glist__row { grid-template-columns: 120px minmax(0, 1fr); row-gap: 4px; padding: var(--s-3) var(--s-5); }
  .glist__row > .glist__text { grid-column: 2; }
  .glist__hide { display: none; }
  .glist--simple .glist__row { grid-template-columns: minmax(0, 1fr) auto; }
}
@container (max-width: 520px) {
  .glist__head { padding: var(--s-3) var(--s-4); min-height: 56px; flex-wrap: wrap; row-gap: 2px; }
  .glist__meta { margin-left: 0; flex-basis: 100%; text-align: left; }
  .glist__head:has(.chip) .glist__meta { padding-left: 44px; }
  .glist__row { grid-template-columns: minmax(0, 1fr); padding: var(--s-3) var(--s-4); }
  .glist__row > .glist__text { grid-column: auto; }
  .glist--simple .glist__row { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ---------- form fields: 44 px, label above ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: var(--t-14); font-weight: 500; color: var(--ink); }
.field__hint { font-size: var(--t-13); color: var(--muted); }
.field__error { font-size: var(--t-13); color: var(--red); font-weight: 500; }
.field__control { width: 100%; height: var(--h); padding: 0 var(--s-3); border: 1px solid var(--control); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: var(--t-15); appearance: none; -webkit-appearance: none; }
.field__control::placeholder { color: var(--muted); opacity: 1; }
.field__control:hover { border-color: var(--ink-2); }
.field__control:focus-visible { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
.field--invalid .field__control { border-color: var(--red); }
textarea.field__control { height: auto; min-height: 96px; padding: 10px var(--s-3); line-height: 1.45; resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4); }
/* a date field: the browser's own calendar button is drawn as our line icon (the picker it opens is the system's) */
.field__control[type="date"] { min-width: 0; }
.field__control[type="date"]::-webkit-calendar-picker-indicator { width: 18px; height: 18px; margin: 0 -2px 0 var(--s-2); padding: 4px; border-radius: var(--r-sm); cursor: pointer; opacity: 1; color: var(--muted); background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") center / 18px 18px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") center / 18px 18px no-repeat; }
.field__control[type="date"]:hover::-webkit-calendar-picker-indicator { color: var(--ink); }

/* ---------- BIG checkbox, radio and switch (native inputs, drawn here) ---------- */
.check { display: inline-flex; align-items: flex-start; gap: var(--s-3); min-height: var(--h); padding: 10px 0; cursor: pointer; font-size: var(--t-15); line-height: 1.4; }
.check__box { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 2px solid var(--control); border-radius: 6px; background: var(--surface); display: grid; place-content: center; cursor: pointer; transition: background-color .12s var(--ease), border-color .12s var(--ease); }
.check__box::before { content: ""; width: 13px; height: 13px; transform: scale(0); transition: transform .12s var(--ease); background: var(--on-accent); clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.check__box:checked { background: var(--accent-fill); border-color: var(--accent-fill); }
.check__box:checked::before { transform: scale(1); }
.check__box:indeterminate { background: var(--accent-fill); border-color: var(--accent-fill); }
.check__box:indeterminate::before { transform: scale(1); clip-path: inset(40% 8% 40% 8%); }
.check__box:hover { border-color: var(--ink-2); }
.check__box:checked:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); }
.check__box:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.check__box:disabled { opacity: .5; cursor: not-allowed; }
.check__box[type="radio"] { border-radius: 50%; }
.check__box[type="radio"]::before { width: 10px; height: 10px; border-radius: 50%; clip-path: none; }
.check__text { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.check__hint { font-size: var(--t-13); color: var(--muted); }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 48px; height: 28px; margin: 0; border: 2px solid var(--control); border-radius: 14px; background: var(--surface); cursor: pointer; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--control); transition: transform .15s var(--ease), background-color .15s var(--ease); }
.switch:checked { background: var(--accent-fill); border-color: var(--accent-fill); }
.switch:checked::before { transform: translateX(20px); background: var(--on-accent); }
.switch:hover { border-color: var(--ink-2); }
.switch:checked:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.check--switch { align-items: center; }
.choices { display: flex; flex-direction: column; }
.choices--row { flex-direction: row; flex-wrap: wrap; gap: 0 var(--s-6); }
fieldset.choices { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.choices > legend { padding: 0; margin-bottom: 2px; font-size: var(--t-14); font-weight: 500; }

/* ---------- custom select and combobox (no native look) ---------- */
.select { position: relative; min-width: 0; }
.select__btn { display: flex; align-items: center; gap: var(--s-2); width: 100%; height: var(--h); padding: 0 var(--s-3); border: 1px solid var(--control); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: var(--t-15); text-align: left; }
.select__btn:hover { border-color: var(--ink-2); }
.select__btn[aria-expanded="true"] { border-color: var(--focus); }
.select__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select__value.is-placeholder { color: var(--muted); }
.select__caret { color: var(--muted); transition: transform .12s var(--ease); }
.select__btn[aria-expanded="true"] .select__caret, .select__input[aria-expanded="true"] ~ .select__caret { transform: rotate(180deg); }
.select__inputwrap { position: relative; display: flex; align-items: center; }
.select__input { padding-right: 40px; }
.select__inputwrap .select__caret { position: absolute; right: var(--s-3); pointer-events: none; }
.select__list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); max-height: 300px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); }
.select__list.is-up { top: auto; bottom: calc(100% + 6px); }
/* open: floats over the page (behave.js place()), so no card or table that clips its corners can cut it off */
.select__list.is-float { position: fixed; z-index: 60; left: var(--sl-x, 0px); right: auto; width: var(--sl-w, auto); top: var(--sl-y, 0px); bottom: auto; max-height: var(--sl-max, 300px); }
.select__list.is-float.is-up { top: auto; bottom: var(--sl-y, 0px); }
.select__option { display: flex; align-items: center; gap: var(--s-2); min-height: var(--h); padding: 0 var(--s-3); border-radius: var(--r); font-size: var(--t-15); cursor: pointer; }
.select__option.is-active { background: var(--hover); }
.select__option[aria-selected="true"] { color: var(--selected-ink); font-weight: 600; }
.select__option[aria-selected="true"]::after { content: ""; margin-left: auto; width: 14px; height: 14px; background: currentColor; clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.select__option-hint { color: var(--muted); font-size: var(--t-13); font-weight: 400; }
.select__none { padding: var(--s-3); color: var(--muted); font-size: var(--t-14); }

/* ---------- data table: sortable, pinned first column, movable columns, scroll box, whole-row click ---------- */
.tbl { display: flex; flex-direction: column; min-width: 0; }
.tbl__bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-2) var(--s-3); padding: var(--s-3) var(--s-4); min-height: 0; }
.tbl__tools { flex: 1 1 320px; min-width: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); }
.tbl__btns { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-2); margin-left: auto; }
.tbl__btns:empty { display: none; }
.tbl__scroll { overflow: auto; max-width: 100%; border-top: 1px solid var(--line-soft); }
/* Sideways-scrolling strips hold their own hidden labels and resize handles; without a position they escape and widen the whole page */
.tbl__scroll, .tabs, .nw-chips, .dk-md__tw, .pw-tablewrap, .cl-q__cards, .cl-q__pills, .dchips { position: relative; }
.tbl__scroll:focus-visible { outline-offset: -2px; }
.tbl__table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-14); }
.tbl__table th, .tbl__table td { padding: 0 var(--s-4); height: 52px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-soft); white-space: nowrap; background: var(--surface); }
.tbl__table thead th { height: 44px; padding: 0 var(--s-2); font-size: var(--t-13); font-weight: 500; color: var(--muted); position: sticky; top: 0; z-index: 2; }
.tbl__table tbody tr:last-child > * { border-bottom: 0; }
.tbl__table .is-pinned { position: sticky; left: 0; z-index: 1; }
.tbl__table thead .is-pinned { z-index: 3; }
.tbl.is-scrolled .is-pinned { box-shadow: 1px 0 0 var(--line), 6px 0 8px -6px rgba(0, 0, 0, .18); }
.tbl__table td.is-wrap { white-space: normal; min-width: 220px; max-width: 420px; overflow-wrap: anywhere; }
.tbl__table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl__table thead .is-num .tbl__th { justify-content: flex-end; }
.tbl__table .is-mono { font-family: var(--mono); font-size: var(--t-13); }
.tbl__th { display: flex; align-items: center; gap: 2px; }
.tbl__sort { display: inline-flex; align-items: center; gap: 4px; height: var(--h-sm); padding: 0 var(--s-2); border: 0; border-radius: var(--r-sm); background: none; color: inherit; font: inherit; white-space: nowrap; }
.tbl__sort:hover { color: var(--ink); background: var(--sunk); }
.tbl__sort .ico { opacity: 0; width: 14px; height: 14px; }
.tbl__sort:hover .ico, [aria-sort] .tbl__sort .ico { opacity: 1; }
[aria-sort="descending"] .tbl__sort .ico { transform: rotate(180deg); }
[aria-sort] .tbl__sort { color: var(--ink); font-weight: 600; }
/* the move grip sits in the header's left padding (it takes no width of its own) and shows while the pointer is on the header */
.tbl__grip { position: absolute; left: 0; top: 0; bottom: 0; display: inline-flex; align-items: center; justify-content: center; width: 14px; color: var(--muted); cursor: grab; opacity: 0; transition: opacity .12s var(--ease); }
.tbl__grip .ico { width: 14px; height: 14px; }
.tbl__table thead th:hover .tbl__grip, .tbl__table thead th:focus-within .tbl__grip { opacity: .7; }
.tbl__grip:hover { opacity: 1 !important; }
/* column widths (table.js): measured at content width (.is-measure), then fixed (.is-fixed) with each <col>'s width set through the CSSOM;
   text that does not fit ends in "..." (the whole text is the cell's tooltip). The width handle is the line at a header's right edge. */
.tbl__table.is-measure { table-layout: auto; width: max-content; }
.tbl__table.is-measure .tbl__th { width: max-content; }
.tbl__table.is-measure-min .tbl__th { width: min-content; }
.tbl__table.is-fixed { table-layout: fixed; }
/* a narrow column's header wraps between words, never cut */
.tbl__table.is-fixed .tbl__sort, .tbl__table.is-measure-min .tbl__sort { white-space: normal; height: auto; min-height: var(--h-sm); padding-top: 4px; padding-bottom: 4px; line-height: 1.25; text-align: left; }
.tbl__table.is-fixed thead .is-num .tbl__sort { text-align: right; }
.tbl__table.is-fixed td, .tbl__table.is-fixed tbody th { overflow: hidden; text-overflow: ellipsis; }
.tbl__table.is-fixed td.is-wrap { min-width: 0; max-width: none; }
.tbl__table.is-fixed .tbl__link { max-width: 100%; }
.tbl__rsz { position: absolute; top: 0; right: 0; bottom: 0; z-index: 1; display: flex; justify-content: center; width: 12px; cursor: col-resize; touch-action: none; border-radius: 0; }
.tbl__rsz::after { content: ""; width: 2px; margin: 12px 0; border-radius: 1px; background: var(--line-btn); transition: background-color .12s var(--ease); }
.tbl__rsz:hover::after, .tbl__rsz.is-active::after, .tbl__rsz:focus-visible::after { background: var(--accent-fill); margin: 4px 0; }
.tbl__rsz:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--r-sm); }
.tbl.is-resizing, .tbl.is-resizing * { cursor: col-resize !important; user-select: none; }
th.is-dragging { opacity: .45; }
th.is-drop-before { box-shadow: inset 3px 0 0 var(--accent-fill); }
th.is-drop-after { box-shadow: inset -3px 0 0 var(--accent-fill); }
.tbl__row { cursor: pointer; }
.tbl__row:hover > * { background: var(--hover); }
.tbl__link { color: var(--ink); font-weight: 500; display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--h-sm); }
.tbl__link:hover { color: var(--ink); }
/* a row that opens a panel: the first cell holds a real button (keyboard, screen readers), drawn as plain text */
button.tbl__link { padding: 0; border: 0; background: none; font: inherit; font-weight: 500; color: var(--ink); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
button.tbl__link:hover { color: var(--accent-hover); }
button.tbl__link.mono { font-family: var(--mono); }
.tbl__more { display: flex; justify-content: center; padding: var(--s-3); border-top: 1px solid var(--line-soft); }
.tbl__empty { padding: var(--s-6) var(--s-5); color: var(--muted); text-align: center; }
/* the selection column (BIG boxes, the whole cell ticks), rows being dragged and the rows or targets they are dropped on */
.tbl__table .tbl__check { width: 56px; min-width: 56px; max-width: 56px; padding: 0; position: sticky; left: 0; z-index: 1; }
.tbl__table thead .tbl__check { z-index: 3; }
.tbl--select .tbl__table .is-pinned { left: 56px; }
.tbl__checkcell { display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--h); cursor: pointer; }
.tbl__row.is-selected > * { background: var(--selected); }
.tbl__row.is-selected:hover > * { background: var(--selected); }
.tbl__row.is-dragging > * { opacity: .5; }
.tbl__row.is-drop-over > * { background: var(--selected); box-shadow: inset 0 2px 0 var(--accent-fill), inset 0 -2px 0 var(--accent-fill); }
.is-drop-over { outline: 2px dashed var(--accent-fill); outline-offset: -2px; }
/* cards: a table with cards: true becomes one card per row under 640 px of its own width; the "Sort by" picker stands in for the headers */
.tbl--cards { container: tbl / inline-size; }
.tbl__sortpick { display: none; }
@container tbl (max-width: 640px) {
  .tbl--cards .tbl__sortpick { display: block; flex: 1 1 100%; }
  .tbl--cards .tbl__btns { margin-left: 0; flex: 1 1 100%; }
  .tbl--cards .tbl__scroll { overflow: visible; }
  .tbl--cards .tbl__table, .tbl--cards .tbl__table tbody { display: block; width: 100%; }
  .tbl--cards .tbl__table { width: 100% !important; } /* a width fitted for the table layout never applies to the cards */
  .tbl--cards .tbl__table colgroup { display: none; }
  .tbl--cards .tbl__table thead { display: none; }
  .tbl--cards .tbl__row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s-4); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line-soft); background: var(--surface); }
  .tbl--cards .tbl__row:last-child { border-bottom: 0; }
  .tbl--cards .tbl__row > * { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; height: auto; min-width: 0; max-width: 100%; padding: 0; border: 0; background: transparent; position: static; white-space: normal; overflow-wrap: anywhere; font-size: var(--t-14); box-shadow: none; }
  .tbl--cards .tbl__row > .is-pinned { flex: 1 1 100%; font-size: var(--t-15); }
  .tbl--cards .tbl__row > td[data-label]:not([data-label=""])::before { content: attr(data-label); color: var(--muted); font-size: var(--t-13); white-space: nowrap; }
  .tbl--cards .tbl__row > .is-nocard, .tbl--cards .tbl__row > td:empty { display: none; }
  .tbl--cards.tbl--select .tbl__row { padding-left: 60px; }
  .tbl--cards .tbl__row > .tbl__check { position: absolute; left: 4px; top: 4px; width: 52px; max-width: none; }
  .tbl--cards .tbl__row:hover { background: var(--hover); }
  .tbl--cards .tbl__row.is-selected { background: var(--selected); }
  .tbl--cards .tbl__row:hover > *, .tbl--cards .tbl__row.is-selected > * { background: transparent; }
  .tbl--cards td.is-wrap { min-width: 0; max-width: none; }
  .tbl--cards .is-num { text-align: left; }
}

/* ---------- empty state, skeleton, banner ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-2); padding: var(--s-8) var(--s-5); }
.empty__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--sunk); color: var(--muted); margin-bottom: var(--s-2); }
.empty__icon--ok { background: var(--green-bg); color: var(--green); }
.empty__title { font-size: var(--t-17); font-weight: 600; }
.empty__text { color: var(--muted); max-width: 52ch; }
.empty .btn-row { justify-content: center; margin-top: var(--s-3); }
.sk { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--sunk) 0%, var(--skeleton-hi) 40%, var(--sunk) 80%); background-size: 300% 100%; animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.sk--line { height: 14px; width: 100%; }
.sk--title { height: 28px; width: 40%; }
.sk--chip { width: 32px; height: 32px; border-radius: var(--r); flex: none; }
.sk--w60 { width: 60%; } .sk--w30 { width: 30%; } .sk--w80 { width: 80%; } .sk--w20 { width: 20%; }
.sk-row { display: flex; align-items: center; gap: var(--s-4); padding: 14px var(--s-5); border-top: 1px solid var(--line-soft); }
.sk-row:first-child { border-top: 0; }
.sk-stack { display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.banner { display: flex; align-items: flex-start; gap: 14px; padding: var(--s-4) 18px; border-radius: var(--r-lg); border: 1px solid var(--info-line); background: var(--info-bg); color: var(--ink); font-size: var(--t-15); }
.banner__icon { margin-top: 2px; color: var(--accent); }
.banner__text { flex: 1; min-width: 0; }
.banner__text strong { font-weight: 600; }
.banner__action { flex: none; align-self: center; max-width: 100%; }
.banner--crit { background: var(--red-bg); border-color: var(--red-line); }
.banner--crit .banner__icon { color: var(--red); }
.banner--warn { background: var(--amber-bg); border-color: var(--amber-line); }
.banner--warn .banner__icon { color: var(--amber); }
.banner--ok { background: var(--green-bg); border-color: var(--green-line); }
.banner--ok .banner__icon { color: var(--green); }

/* ---------- definition list (facts) ---------- */
.facts { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 0; margin: 0; }
.facts dt, .facts dd { margin: 0; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: var(--t-14); min-width: 0; overflow-wrap: anywhere; }
.facts dt { color: var(--muted); padding-right: var(--s-4); }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }
.dev-sess { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 4px; }

/* ---------- finding list (a device's findings: state, what, the threshold behind it, the suggested step) ---------- */
.flist { list-style: none; margin: 0; padding: 0; container-type: inline-size; }
.flist__item { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(120px, auto); gap: var(--s-4); align-items: center; padding: 12px var(--s-5); border-top: 1px solid var(--line-soft); }
.flist__text { display: flex; flex-direction: column; min-width: 0; }
.flist__title { font-size: var(--t-14); font-weight: 500; overflow-wrap: anywhere; }
.flist__sub { font-size: var(--t-13); color: var(--muted); overflow-wrap: anywhere; }
.flist__act { font-size: var(--t-13); color: var(--ink-2); text-align: right; }
@container (max-width: 560px) { .flist__item { grid-template-columns: minmax(0, 1fr); row-gap: 4px; padding: var(--s-3) var(--s-4); } .flist__act { text-align: left; } }

/* ---------- drawer and dialog (native <dialog>, ONE of each) ---------- */
.sheet { padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); max-width: none; max-height: none; overflow: hidden; }
.sheet::backdrop { background: var(--scrim); }
.sheet[open] { display: flex; flex-direction: column; }
.sheet--drawer { margin: 0 0 0 auto; width: min(480px, 100vw); height: 100dvh; border-radius: var(--r-lg) 0 0 var(--r-lg); animation: drawer-in .2s var(--ease); }
.sheet--dialog { width: min(560px, calc(100vw - 32px)); max-height: min(720px, calc(100dvh - 48px)); border-radius: var(--r-lg); animation: dialog-in .16s var(--ease); }
.sheet--palette { width: min(680px, calc(100vw - 24px)); margin-top: 10vh; max-height: min(640px, 80dvh); }
.sheet--drawer.sheet--wide { width: min(960px, 100vw); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dialog-in { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-4) var(--s-3) var(--s-5); border-bottom: 1px solid var(--line-soft); }
.sheet__title { flex: 1; min-width: 0; font-size: var(--t-17); font-weight: 600; outline: none; }
.sheet__body { flex: 1; overflow-y: auto; padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.sheet__foot { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: flex-end; padding: var(--s-3) var(--s-5) var(--s-4); border-top: 1px solid var(--line-soft); }
.sheet__body > p { color: var(--ink-2); }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: var(--s-6); transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--s-2); align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: 6px 6px 6px var(--s-4); border-radius: var(--r-md); background: var(--ink); color: var(--ground); box-shadow: var(--shadow-pop); font-size: var(--t-14); animation: dialog-in .16s var(--ease); }
.toast__text { flex: 1; padding: 6px 0; }
.toast .btn { height: 36px; background: transparent; border-color: transparent; color: var(--ground); font-weight: 600; }
.toast .btn:hover { background: color-mix(in srgb, var(--ground) 16%, transparent); }
.toast--crit { background: var(--danger-fill); color: #FFFFFF; }
.toast--crit .btn { color: #FFFFFF; }
.toast.is-leaving { opacity: 0; transition: opacity .2s var(--ease); }

/* ---------- the app shell ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.rail { background: var(--surface); border-right: 1px solid var(--line); min-width: 0; }
.rail__inner { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: var(--s-5) 14px var(--s-3); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px var(--s-3) var(--s-5); color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brandlogo { background: #FFFFFF; border: 1px solid var(--line); overflow: hidden; }
.brandlogo img { display: block; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__name { font-weight: 600; font-size: var(--t-15); }
.brand__sub { font-size: var(--t-12); color: var(--muted); }
.nav__item { display: flex; align-items: center; gap: var(--s-3); min-height: var(--h); padding: 0 var(--s-3); border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-size: var(--t-15); }
.nav__item:hover { background: var(--sunk); color: var(--ink); }
.nav__item[aria-current="page"] { background: var(--selected); color: var(--selected-ink); font-weight: 600; }
.nav__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav__count { font-size: var(--t-13); color: var(--muted); font-variant-numeric: tabular-nums; }
.nav__item[aria-current="page"] .nav__count { color: var(--selected-ink); }
.rail__spacer { flex: 1; min-height: var(--s-6); }
.me { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; margin-top: var(--s-2); padding: var(--s-2) var(--s-3); border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; background: none; color: var(--ink); text-align: left; }
.me:hover { background: var(--sunk); border-radius: var(--r); }
.me__avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--selected); color: var(--selected-ink); font-size: var(--t-13); font-weight: 600; flex: none; }
.me__text { display: flex; flex-direction: column; min-width: 0; font-size: var(--t-13); line-height: 1.3; }
.me__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me__role { color: var(--muted); }
.frame { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); min-height: var(--top-h); padding: var(--s-4) var(--page-pad); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar__brand { display: none; }
.search { flex: 1 1 320px; min-width: 0; max-width: 560px; display: flex; align-items: center; gap: 10px; height: var(--h); padding: 0 6px 0 14px; border: 1px solid var(--line-btn); border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); font-size: var(--t-15); text-align: left; }
.search:hover { border-color: var(--control); color: var(--ink-2); }
.search__text { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__spacer { flex: 1; }
.topbar__nav { display: inline-flex; gap: 2px; }
.live { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-13); color: var(--muted); white-space: nowrap; }
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.live[data-s="busy"] .live__dot { background: var(--accent); }
.live[data-s="offline"] .live__dot, .live[data-s="saved"] .live__dot { background: var(--amber); }
.live[data-s="out"] .live__dot { background: var(--red); }
.main { flex: 1; min-width: 0; outline: none; }
.tabbar { display: none; }

/* compact rail between 720 and 1099 px: icons only */
@media (max-width: 1099px) and (min-width: 720px) {
  .app { grid-template-columns: var(--rail-w-compact) minmax(0, 1fr); }
  .rail__inner { padding: var(--s-4) 10px var(--s-3); }
  .brand { justify-content: center; padding: 4px 0 var(--s-5); }
  .brand__text, .nav__label, .nav__count, .me__text { display: none; }
  .nav__item { justify-content: center; padding: 0; position: relative; }
  .nav__item .badge { position: absolute; top: 2px; right: 2px; min-width: 20px; height: 18px; font-size: 11px; padding: 0 5px; }
  .me { justify-content: center; padding: var(--s-2) 0; }
  .topbar { padding: var(--s-3) var(--s-6); }
  .page { padding: var(--s-6); }
}

/* phone: bottom tab bar, no rail */
@media (max-width: 719px) {
  :root { --top-h: 64px; }
  .app { display: block; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); }
  .rail { display: none; }
  .topbar { padding: var(--s-3) var(--s-4); gap: var(--s-3); flex-wrap: nowrap; }
  .topbar__brand { display: inline-flex; }
  .search { flex: 1 1 auto; max-width: none; font-size: var(--t-15); }
  .search .kbd, .live__text, .topbar__refresh { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; padding: 4px 4px env(safe-area-inset-bottom, 0px); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar__item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 11px; font-weight: 500; text-decoration: none; }
  .tabbar__item[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .tabbar--n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tabbar--n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tabbar--n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tabbar__item .badge { position: absolute; top: 2px; left: calc(50% + 4px); min-width: 20px; height: 18px; font-size: 11px; padding: 0 5px; }
  .page { padding: var(--s-5) var(--s-4) var(--s-6); gap: var(--s-5); }
  h1, .ph__title { font-size: 22px; }
  .ph__intro { font-size: var(--t-14); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-bottom: 1px solid var(--line-soft); padding: 14px var(--s-4); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat__value { font-size: 24px; }
  .seg { display: flex; width: 100%; }
  .seg__item { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
  .sheet--drawer { margin: auto 0 0; width: 100vw; height: auto; max-height: 88dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; animation: sheet-up .2s var(--ease); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .sheet--palette { margin-top: var(--s-3); width: calc(100vw - 16px); max-height: calc(100dvh - 24px); }
  .toasts { bottom: calc(var(--tab-h) + var(--s-3) + env(safe-area-inset-bottom, 0px)); }
  /* the notch and rounded corners (viewport-fit=cover: an installed app, a phone held sideways); inside the Android app the window already sits clear of them, so these are 0 there */
  .topbar { min-height: calc(var(--top-h) + env(safe-area-inset-top, 0px)); padding-top: calc(var(--s-3) + env(safe-area-inset-top, 0px)); padding-left: calc(var(--s-4) + env(safe-area-inset-left, 0px)); padding-right: calc(var(--s-4) + env(safe-area-inset-right, 0px)); }
  .tabbar { padding-left: calc(4px + env(safe-area-inset-left, 0px)); padding-right: calc(4px + env(safe-area-inset-right, 0px)); }
  /* the keyboard is open (html.ua-kb, set by /native-shell.js in the Android app, whose window shrinks): the tab bar steps aside so the field being typed in keeps its room */
  .ua-kb .tabbar { display: none; }
  .ua-kb .app { padding-bottom: 0; }
  .ua-kb .toasts { bottom: var(--s-3); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { padding-bottom: 0; }
  .facts dd { border-top: 0; padding-top: 2px; }
  /* a banner's action goes under its words (lined up with them) instead of squeezing them into one word a line */
  .banner { flex-wrap: wrap; row-gap: var(--s-3); }
  .banner__text { flex: 1 1 calc(100% - 32px); }
  .banner__action { margin-left: 32px; }
  /* a hub header: the chip stays beside the title, the actions take the next line */
  .ph__lead .chip--56, .hub .chip--56 { width: 40px; height: 40px; border-radius: 9px; font-size: 13px; }
  .ph__lead { padding-top: 26px; }
  .ph--lead .ph__text { flex-basis: 0; }
  /* everything after the text (actions, the device's previous/next buttons) gets its own line: beside a zero-basis text it squeezed the title to one letter per line */
  .ph--lead > :not(.ph__lead):not(.ph__text) { flex: 1 1 100%; }
  /* a long button label wraps inside the button instead of running past the screen */
  .btn { max-width: 100%; height: auto; min-height: var(--h); white-space: normal; line-height: 1.2; padding-top: 6px; padding-bottom: 6px; text-align: center; }
  .btn--sm { min-height: var(--h-sm); padding-top: 4px; padding-bottom: 4px; }
  .btn--icon { padding-top: 0; padding-bottom: 0; height: var(--h); }
  .btn--icon.btn--sm { height: var(--h-sm); }
}

/* the pull-to-refresh pill that store.js draws (it sets only the transform) */
.ua-ptr { position: fixed; left: 50%; top: 0; z-index: 70; transform: translate(-50%, -40px); padding: 6px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font: 600 var(--t-12) var(--font); pointer-events: none; box-shadow: var(--shadow-1); }

/* ---------- menus inside the drawer (More, the person's menu) ---------- */
.menu { display: flex; flex-direction: column; margin: 0 calc(var(--s-5) * -1); }
.menu__item { display: flex; align-items: center; gap: var(--s-3); min-height: 52px; padding: 0 var(--s-5); color: var(--ink); text-decoration: none; border: 0; background: none; font-size: var(--t-15); text-align: left; width: 100%; }
.menu__item:hover { background: var(--hover); color: var(--ink); }
.menu__item .ico { color: var(--muted); }
.menu__label { flex: 1; }
.menu__sep { height: 1px; background: var(--line-soft); margin: var(--s-2) 0; }
.menu__group { padding: var(--s-3) var(--s-5) var(--s-1); font-size: var(--t-13); color: var(--muted); }

/* ---------- Ctrl K search ---------- */
.pal__field { display: flex; align-items: center; gap: 10px; padding: 0 var(--s-4); border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.pal__input { flex: 1; min-width: 0; height: 60px; border: 0; background: none; color: var(--ink); font-size: var(--t-17); }
.pal__input::placeholder { color: var(--muted); opacity: 1; }
.pal__input:focus-visible { outline: none; }
.pal__list { flex: 1; overflow-y: auto; margin: 0; padding: 6px; list-style: none; }
.pal__group { padding: var(--s-3) var(--s-3) 4px; font-size: var(--t-13); font-weight: 500; color: var(--muted); }
.pal__item { display: flex; align-items: center; gap: var(--s-3); min-height: 52px; padding: 6px var(--s-3); border-radius: var(--r); cursor: pointer; }
.pal__item.is-active { background: var(--selected); }
.pal__item.is-active .pal__title { color: var(--selected-ink); }
.pal__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pal__led { display: inline-flex; vertical-align: middle; margin-right: 8px; }
.pal__title { font-size: var(--t-15); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal__sub { font-size: var(--t-13); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal__kind { font-size: var(--t-12); color: var(--muted); white-space: nowrap; }
.pal__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); background: var(--sunk); color: var(--ink-2); flex: none; }
.pal__more { color: var(--accent); font-size: var(--t-14); }
.pal__foot { display: flex; flex-wrap: wrap; gap: var(--s-4); padding: 10px var(--s-4); border-top: 1px solid var(--line-soft); font-size: var(--t-12); color: var(--muted); }
.pal__foot span { display: inline-flex; align-items: center; gap: 6px; }
.pal__foot { column-gap: 14px; row-gap: 6px; }
.pal__foot [hidden] { display: none; }
.pal__foot:has(#pal-act-hint:not([hidden])) .pal__foot-tab { display: none; } /* one line: the row's own action is worth more than the Tab hint */
.pal__empty { padding: var(--s-6) var(--s-4); text-align: center; color: var(--muted); }
.pal__tip { display: block; margin-top: 6px; font-size: var(--t-13); }
/* a line above the results (a number being looked up, an address nothing has) and the group of exact matches */
.pal__note { padding: 8px var(--s-3) 2px; font-size: var(--t-13); color: var(--muted); }
.pal__group--best { color: var(--accent); }
/* the row's one other action (copy the IP, open the console, open the PDF): on the selected or hovered row; Shift+Enter does the same */
.pal__act { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; padding: 0 10px; border: 1px solid var(--line-btn); border-radius: var(--r); background: var(--surface); color: var(--ink-2); font: inherit; font-size: var(--t-13); cursor: pointer; white-space: nowrap; visibility: hidden; }
.pal__act:hover { background: var(--hover); color: var(--ink); }
.pal__act .ico { width: 16px; height: 16px; }
.pal__item.is-active .pal__act, .pal__item:hover .pal__act { visibility: visible; }
.pal__item.is-active .pal__kind { color: var(--selected-ink); }
/* Connect on a device row (palette.js): always visible, primary, where the type word would be; Alt+Enter on the selected row. Offline: dimmed, its title says why */
.pal__connect { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; padding: 0 12px; border: 1px solid var(--accent-fill); border-radius: var(--r); background: var(--accent-fill); color: var(--on-accent); font: inherit; font-size: var(--t-13); font-weight: 600; cursor: pointer; white-space: nowrap; }
.pal__connect:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); }
.pal__connect .ico { width: 16px; height: 16px; }
.pal__connect.is-off { background: var(--surface); border-color: var(--line-btn); color: var(--muted); font-weight: 500; cursor: not-allowed; }
@media (hover: none) {
  .pal__act { visibility: visible; width: 40px; height: 40px; padding: 0; justify-content: center; } /* touch: always there, a 40 px target */
  .pal__connect { height: 40px; } /* touch: a 40 px target; the word stays */
  .pal__actlabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pal__foot { display: none; } /* keyboard help, and no keyboard */
}
@media (max-width: 719px) {
  .pal__kind { display: none; } /* the icon says what it is; the room goes to the name */
  .pal__item { gap: 10px; padding-left: 8px; padding-right: 8px; }
}
/* Ctrl K Ask mode (ask.js): the Ask toggle in the field and the answer panel that replaces the results list */
.pal__askbtn { display: inline-flex; align-items: center; gap: 6px; height: var(--h-sm); padding: 0 12px; border: 1px solid var(--line-btn); border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font: inherit; font-size: var(--t-13); cursor: pointer; white-space: nowrap; }
.pal__askbtn:hover { background: var(--hover); }
.pal__askbtn svg { width: 16px; height: 16px; }
.pal__askbtn[aria-pressed="true"] { background: var(--selected); color: var(--selected-ink); border-color: transparent; }
.ask { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }
.ask__q { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-size: var(--t-15); font-weight: 600; }
.ask__qico { flex: none; color: var(--accent); display: inline-flex; }
.ask__qico svg { width: 18px; height: 18px; }
.ask__status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--t-14); }
.ask__spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: ask-spin 0.7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .ask__spin { animation: none; } }
@keyframes ask-spin { to { transform: rotate(360deg); } }
.ask__answer { color: var(--ink); font-size: var(--t-15); line-height: 1.55; white-space: pre-wrap; }
.ask__err { color: var(--red); font-size: var(--t-14); }
.ask__hint { color: var(--muted); font-size: var(--t-14); line-height: 1.5; }
.ask__srch { margin-top: var(--s-2); font-size: var(--t-12); color: var(--muted); text-transform: none; }
.ask__src { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ask__srcrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.ask__srcrow:hover { background: var(--hover); }
.ask__srcico { flex: none; color: var(--muted); display: inline-flex; }
.ask__srcico svg { width: 18px; height: 18px; }
.ask__note { margin-top: var(--s-2); font-size: var(--t-12); color: var(--muted); }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-4); align-items: center; font-size: var(--t-14); margin: 0; }
.shortcuts dt { display: flex; gap: 4px; flex-wrap: wrap; margin: 0; }
.shortcuts dd { margin: 0; color: var(--ink-2); }

/* ---------- Home ---------- */
.home-list { display: flex; flex-direction: column; gap: var(--s-4); }

/* ---------- search box, filter chips, bulk bar, bar list (ui.js) ---------- */
.searchbox { position: relative; flex: 1 1 260px; min-width: 0; max-width: 440px; }
.searchbox__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox__input { padding-left: 42px; }
.searchbox__input::-webkit-search-cancel-button, .searchbox__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.fchips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.fchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: var(--h-sm); padding: 4px 10px 4px 14px; border: 1px solid var(--info-line); border-radius: 18px; background: var(--info-bg); color: var(--ink); font-size: var(--t-14); font-weight: 500; text-decoration: none; text-align: left; overflow-wrap: anywhere; }
.fchip:hover { border-color: var(--accent); color: var(--ink); }
.fchip .ico { color: var(--muted); }
.bulkbar { position: sticky; bottom: var(--s-4); z-index: 15; container: bulkbar / inline-size; padding: 10px var(--s-3) 10px var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-pop); }
.bulkbar__in { display: flex; align-items: center; gap: var(--s-2) var(--s-3); }
.bulkbar__count { font-size: var(--t-15); font-weight: 600; white-space: nowrap; margin-right: var(--s-2); }
.bulkbar__actions { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.bulkbar__note { align-self: center; font-size: var(--t-13); color: var(--muted); }
/* narrower than one row of buttons: the count and Clear on top, the buttons below */
@container bulkbar (max-width: 900px) { .bulkbar__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; } .bulkbar__actions { grid-column: 1 / -1; grid-row: 2; } }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bars__row { display: grid; grid-template-columns: minmax(120px, 2fr) minmax(80px, 3fr) 56px; align-items: center; gap: var(--s-3); min-height: var(--h); padding: 4px var(--s-2); margin: 0 calc(var(--s-2) * -1); border-radius: var(--r); color: var(--ink); text-decoration: none; }
a.bars__row:hover { background: var(--hover); color: var(--ink); }
a.bars__row:focus-visible { outline-offset: 0; }
.bars__label { display: flex; flex-direction: column; min-width: 0; font-size: var(--t-14); line-height: 1.3; }
.bars__name { overflow-wrap: anywhere; }
.bars__word { font-size: var(--t-12); color: var(--muted); }
.bars__svg { display: block; width: 100%; height: 10px; overflow: visible; }
.bars__track { fill: var(--sunk); }
.bars__fill--accent { fill: var(--accent-fill); }
.bars__fill--ok { fill: var(--green); }
.bars__fill--attention { fill: var(--amber); }
.bars__fill--offline { fill: var(--red); }
.bars__fill--quiet { fill: var(--grey); }
.bars__value { text-align: right; font-size: var(--t-14); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 719px) {
  .bulkbar { bottom: calc(var(--tab-h) + var(--s-2) + env(safe-area-inset-bottom, 0px)); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); }
  .ua-kb .bulkbar { bottom: var(--s-2); }
  .bars__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; padding: 8px var(--s-2); }
  .bars__svg { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Customers and Devices lists (pages/customers.js, devices.js, customer-map.js, fleet-charts.js, device-bulk.js, customer-fill.js) ---------- */
.lst { gap: var(--s-5); }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); width: 100%; }
.toolbar__select { flex: 0 1 280px; min-width: 200px; }
.toolbar__select .field { gap: 0; }
.toolbar__select .field__label:not([hidden]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cellname { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ink); min-width: 0; }
.cellname:hover { color: var(--accent); }
.cellname__text { overflow-wrap: anywhere; }
.cellname__sub { font-size: var(--t-12); font-weight: 400; color: var(--muted); }
.btn-row--tight { flex-wrap: nowrap; gap: var(--s-1); }
@container tbl (max-width: 640px) {
  .tbl--cards .btn-row--tight { flex-wrap: wrap; }
  .tbl--cards .toolbar > .searchbox, .tbl--cards .toolbar__select { flex: 1 1 100%; max-width: none; }
}
.fchips__clear { font-size: var(--t-14); padding: 0 var(--s-2); }
/* the Customers list (pages/customers.js): the search and its "/" key, the row chosen with the arrow keys, the light beside a name, money and warnings
   in a row, the Actions column (the quick actions show on hover or focus beside the ... button, inside the column, never over another cell; a narrow
   table keeps ... alone), the pinned and recent customers, the phone cards */
.cl-find { position: relative; flex: 1 1 320px; min-width: 0; max-width: 520px; display: flex; }
.cl-find .searchbox { max-width: none; }
.cl-find .searchbox__input { padding-right: 44px; }
.cl-find__key { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.cl-find:focus-within .cl-find__key, .cl-find:has(.searchbox__input:not(:placeholder-shown)) .cl-find__key { display: none; }
@media (hover: none) { .cl-find__key { display: none; } }
.cl .tbl__row.is-kbd > * { background: var(--selected); }
.cl .tbl__row.is-kbd > .is-pinned { box-shadow: inset 3px 0 0 var(--accent-fill); }
.cl-star { width: 16px; height: 16px; }
.cl-star.is-on { fill: currentColor; }
.cl-pin.is-on, .cl-pinned, .cl-q__title .cl-star { color: var(--accent); }
.cl-pinned { display: inline-flex; align-items: center; }
.cl-pinned .cl-star { width: 14px; height: 14px; }
.cl-late { color: var(--red); font-weight: 600; }
.cl-warn { color: var(--amber); font-weight: 600; }
.cl-sum { display: none; }
.cl-fact { color: var(--muted); }
.cl-fact::before { content: "·"; padding: 0 6px; color: var(--muted); }
.cl-fact--attention { color: var(--amber); }
.cl-fact--offline { color: var(--red); }
.menu__item .cl-star { width: 18px; height: 18px; }
.cl-msub { display: block; font-size: var(--t-13); color: var(--muted); overflow-wrap: anywhere; }
.cl-inl { display: inline-flex; align-items: center; }
.cl-inl .status { font-size: var(--t-13); }
.cl-inl--dot .status { gap: 0; }
.cl-inl--dot .status__word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cl-inl--dot .status__light { width: 8px; height: 8px; }
/* the name cell: measured at 240 px at most (a longer name ends in "..." and says itself whole in its tooltip), so the default columns fit 1280 px;
   a wider window gives the room back; the light and the pin never shrink */
.cl .tbl__table tbody th .tbl__link { min-width: 0; }
.cl .tbl__table.is-measure tbody th .tbl__link { max-width: 240px; }
.cl .tbl__table tbody th .cellname__text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl .tbl__table tbody th .cellname__sub { flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-inl, .cl-pinned { flex: none; }
.cl-acts { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.cl-acts__row { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .12s var(--ease); }
.cl-acts__row .btn--icon.btn--sm { width: 32px; min-width: 32px; }
.cl-acts__gap { flex: none; width: 32px; height: var(--h-sm); }
.cl .tbl__row:hover .cl-acts__row, .cl .tbl__row.is-kbd .cl-acts__row, .cl-acts:focus-within .cl-acts__row { opacity: 1; }
@media (hover: none) { .cl-acts__row { opacity: 1; } }
.cl .tbl__table td:has(> .cl-acts) { padding: 0 var(--s-2); }
.cl .tbl__table thead th[data-col="actions"] .tbl__th { justify-content: flex-end; }
@container tbl (max-width: 899px) { .cl .cl-acts__row { display: none; } }
@container tbl (max-width: 640px) {
  .cl .cl-find { flex: 1 1 100%; max-width: none; }
  .cl .tbl--cards .tbl__row { padding-right: 56px; }
  .cl .tbl--cards .tbl__row > td:has(> .cl-acts) { position: absolute; right: var(--s-2); top: var(--s-2); }
  .cl .cl-find__key { display: none; }
  .cl .cl-find .searchbox__input { padding-right: var(--s-3); }
  .cl .tbl--cards .cl-inl { display: none; }
  .cl .tbl--cards .tbl__table tbody th .cellname__text, .cl .tbl--cards .tbl__table tbody th .cellname__sub { white-space: normal; overflow: visible; }
  .cl .tbl--cards .tbl__link { flex-wrap: wrap; row-gap: 2px; }
  .cl .cl-sum { display: flex; flex-wrap: wrap; align-items: center; flex: 1 1 calc(100% - 15px); margin-left: 15px; font-size: var(--t-13); font-weight: 400; clip-path: inset(-4px -4px -4px 13px); }
  /* The dot between facts sits in each fact's left margin; a fact that wraps to a new line has its dot in the clipped strip, so no line starts with a dot */
  .cl .cl-sum > * { margin-left: 13px; }
  .cl .cl-sum .cl-fact { position: relative; }
  .cl .cl-sum .cl-fact::before { position: absolute; left: -13px; width: 13px; padding: 0; text-align: center; }
  .cl .cl-sum .status { font-size: var(--t-13); }
  .cl .tbl--cards .tbl__row.is-kbd { background: var(--selected); box-shadow: inset 3px 0 0 var(--accent-fill); }
  .cl .tbl--cards .tbl__row.is-kbd > * { background: transparent; box-shadow: none; }
}
.cl-quick { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.cl-q__group { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.cl-q__title { display: flex; align-items: center; gap: 6px; font-size: var(--t-13); font-weight: 500; color: var(--muted); }
.cl-q__title .ico { width: 14px; height: 14px; }
.cl-q__cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--s-3); }
.cl-q__item { position: relative; min-width: 0; }
.cl-q__card { display: flex; align-items: center; gap: var(--s-3); min-height: 72px; height: 100%; padding: var(--s-3) 52px var(--s-3) var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); transition: background-color .12s var(--ease), border-color .12s var(--ease); }
.cl-q__card:hover { color: var(--ink); background: var(--hover); border-color: var(--line-btn); }
.cl-q__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cl-q__name { font-size: var(--t-15); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-q__sub { display: flex; flex-wrap: wrap; align-items: center; font-size: var(--t-13); }
.cl-q__sub .status { font-size: var(--t-13); }
.cl-q__item .cl-pin { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); }
.cl-q__pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.cl-q__pill { display: inline-flex; align-items: center; gap: var(--s-2); height: 36px; padding: 0 14px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: var(--t-14); font-weight: 500; white-space: nowrap; }
.cl-q__pill:hover { color: var(--ink); background: var(--hover); border-color: var(--line-btn); }
@media (max-width: 719px) {
  .cl-q__cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: var(--s-2); padding-bottom: 2px; scrollbar-width: none; }
  .cl-q__cards::-webkit-scrollbar, .cl-q__pills::-webkit-scrollbar { display: none; }
  .cl-q__item { flex: 0 0 min(80%, 280px); scroll-snap-align: start; }
  .cl-q__pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
}
/* the uptime overview (pages/uptime.js) and every customer's services (pages/services-list.js) */
.up-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--s-6); align-items: start; }
.up-pct { font-variant-numeric: tabular-nums; } .up-pct--warn { color: var(--amber); } .up-pct--crit { color: var(--red); } .up-pct--none { color: var(--muted); }
.svc-link { overflow-wrap: anywhere; }
.lst-bulk:empty { display: none; }
/* The bar's own sticky could only move inside its wrapper, which is exactly its height, so it sat after the last row: far off screen on a long list
   (the owner, 2026-11-03: "you're never gonna see that bar"). The wrapper sticks instead, so the bar stays at the bottom of the window while you scroll. */
:where(*):has(> .bulkbar) { position: sticky; bottom: var(--s-4); z-index: 15; }
@media (max-width: 719px) { :where(*):has(> .bulkbar) { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + var(--s-2)); } }
/* the Devices list (pages/devices.js): the find bar (search, customer, status and type chips with counts) and a row's actions */
.dfind { display: flex; flex-direction: column; gap: var(--s-3); width: 100%; min-width: 0; }
.dfind__q { position: relative; display: flex; flex: 1 1 320px; min-width: 0; max-width: 560px; }
.dfind__q .searchbox { flex: 1 1 auto; max-width: none; }
.dfind__q > .kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.dfind__q:focus-within > .kbd, .dfind__q:has(.searchbox__input:not(:placeholder-shown)) > .kbd { display: none; }
@media (pointer: coarse) { .dfind__q > .kbd { display: none; } }
.dchips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); min-width: 0; }
.dchips__group { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.dchip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--line-btn); border-radius: 16px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: var(--t-13); font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color .12s var(--ease), border-color .12s var(--ease); }
.dchip:hover { border-color: var(--control); color: var(--ink); }
.dchip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dchip[aria-pressed="true"] { background: var(--selected); border-color: var(--accent); color: var(--selected-ink); }
.dchip__n { color: var(--muted); font-variant-numeric: tabular-nums; }
.dchip[aria-pressed="true"] .dchip__n { color: inherit; }
.dchip.is-zero:not([aria-pressed="true"]) { color: var(--muted); border-style: dashed; }
.dchip__light { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--grey); }
.dchip__light--attention { background: var(--amber); } .dchip__light--offline { background: var(--red); } .dchip__light--ok { background: var(--green); }
.dchip__light--quiet { background: transparent; border: 1.5px dashed var(--grey); }
.dchips__clear { height: 32px; padding: 0 var(--s-2); border: 0; background: none; color: var(--accent); font: inherit; font-size: var(--t-13); font-weight: 500; cursor: pointer; border-radius: var(--r-sm); }
.dchips__clear:hover { color: var(--accent-hover); text-decoration: underline; }
.dchips__end { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.dchips__count { color: var(--muted); font-size: var(--t-13); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (pointer: coarse) { .dchip, .dchips__clear { height: 36px; } }
@container tbl (max-width: 640px) {
  /* a phone: the chips are one line that scrolls sideways inside the bar, never the page */
  .dfind__q { flex-basis: 100%; max-width: none; }
  .dchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--s-4) * -1); padding: 2px 40px 2px var(--s-4); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
  .dchips::-webkit-scrollbar { display: none; }
  .dchips__group { flex: none; flex-wrap: nowrap; }
  .dchips__end { margin-left: 0; }
  .dchips__count { display: none; }
}
/* a row's actions: the "..." sticks to the right edge; the quick buttons beside it show while the pointer or the focus is on the row */
.tbl__table thead th[data-col="act"] { right: 0; z-index: 3; box-shadow: -1px 0 0 var(--line-soft); }
.tbl__table thead th[data-col="act"] .tbl__sort { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tbl__table thead th[data-col="act"] .tbl__grip, .tbl__table thead th[data-col="act"] .tbl__rsz { display: none; }
.tbl__table td:has(> .devact) { position: sticky; right: 0; z-index: 1; overflow: visible; padding: 0 var(--s-2); box-shadow: -1px 0 0 var(--line-soft); }
.devname { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.devname__user { font-size: var(--t-12); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.devact { position: relative; display: flex; align-items: center; justify-content: flex-end; }
.devact__menu { color: var(--muted); }
.devreview { flex-wrap: nowrap; white-space: nowrap; }
/* Rename the computer itself (docs/RENAME-COMPUTER.md): its fields show once the box is ticked */
.dev-pcrename { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.dev-pcrename:not(:has(#dev-pcname-on:checked)) > :not(.check) { display: none; }
.dhub__pcrename { margin-left: var(--s-1); color: var(--muted); }
.dev-pcrename__intro { margin: 0 0 var(--s-4); }
.devact__quick { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); display: none; align-items: center; gap: 2px; padding: 0 4px 0 28px; background: linear-gradient(to right, transparent, var(--hover) 24px); }
.devact__quick:empty { display: none !important; }
.devact__quick .btn { white-space: nowrap; }
.tbl__row:hover .devact__quick, .tbl__row:focus-within .devact__quick { display: flex; }
.tbl__row.is-selected .devact__quick { background: linear-gradient(to right, transparent, var(--selected) 24px); }
[data-table="devices"] .tbl__row:focus-within > * { background: var(--hover); }
[data-table="devices"] .tbl__row.is-selected:focus-within > * { background: var(--selected); }
@media (hover: none) { .devact__quick { display: none !important; } }
@container tbl (max-width: 640px) {
  /* a card: the "..." in its top right corner, the name never under it; the quick buttons are in the menu */
  [data-table="devices"].tbl--cards .tbl__row { padding-right: 52px; column-gap: var(--s-3); }
  .tbl--cards .tbl__row > td:has(> .devact) { position: absolute; top: 6px; right: 4px; box-shadow: none; padding: 0; }
  .tbl--cards .devact__quick { display: none !important; }
  /* Phone: one short row per device, name and Connect first (owner, 2026-11-08: "mostly I'm doing it for remote access"). The rest is one tap away on the device page. */
  [data-table="devices"].tbl--cards .tbl__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "name name connect" "status customer connect"; gap: 2px var(--s-3); padding: var(--s-2) var(--s-3); align-items: center; }
  [data-table="devices"].tbl--cards.tbl--select .tbl__row { padding-left: 44px; }
  [data-table="devices"].tbl--cards .tbl__row > .tbl__check { top: 50%; transform: translateY(-50%); left: 0; width: 44px; }
  [data-table="devices"].tbl--cards .col-name { grid-area: name; }
  [data-table="devices"].tbl--cards .col-status { grid-area: status; font-size: var(--t-12); }
  [data-table="devices"].tbl--cards .col-customer { grid-area: customer; font-size: var(--t-12); color: var(--muted); flex-wrap: nowrap; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  [data-table="devices"].tbl--cards .col-connect { grid-area: connect; }
  [data-table="devices"].tbl--cards .col-act, [data-table="devices"].tbl--cards .col-name .cv__btn, [data-table="devices"].tbl--cards .devname__user, [data-table="devices"].tbl--cards .tbl__btns { display: none; }
}
/* New devices (#/devices/new): when it was added, in words and as a day and time; Accept and Remove on the row */
.devadded { display: flex; flex-direction: column; line-height: 1.3; white-space: nowrap; }
.devadded__at { font-size: var(--t-12); }
/* New devices: a row just accepted stays 20 s under a blue bar that drains from right to left, like a progress bar running out; when it
   is empty the row leaves (the owner, 2026-11-27). The bar lies over the whole row, sticky cells too, and never takes a click: multiply lets
   the text show through as if the row itself were blue. It spans the part of the row in view (--bar-x, --bar-w), so the drain is seen from the first second. pages/devices.js paintAccepted runs it (Web Animations, no inline style). */
[data-accepted] { position: relative; }
[data-accepted]::after { content: ''; position: absolute; top: 0; bottom: 0; left: var(--bar-x, 0px); width: var(--bar-w, 100%); z-index: 3; pointer-events: none; transform-origin: left center;
  background: color-mix(in srgb, var(--accent) 24%, transparent); mix-blend-mode: multiply; border-radius: inherit; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [data-accepted]::after { mix-blend-mode: normal; background: color-mix(in srgb, var(--accent) 18%, transparent); } }
:root[data-theme="dark"] [data-accepted]::after { mix-blend-mode: normal; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.devaccepted { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent, #2563eb); min-height: 36px; }
[data-table="devices-new"] .devname__user { white-space: normal; }
@container tbl (max-width: 640px) {
  /* Phone: name with who and what it is, then when it was added and its customer, then Accept and Remove as big buttons */
  [data-table="devices-new"].tbl--cards .tbl__row { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "name name" "status customer" "connect connect"; gap: 4px var(--s-3); padding: var(--s-2) 52px var(--s-2) var(--s-3); align-items: center; }
  [data-table="devices-new"].tbl--cards.tbl--select .tbl__row { padding-left: 44px; }
  [data-table="devices-new"].tbl--cards .col-name { grid-area: name; }
  [data-table="devices-new"].tbl--cards .col-status { grid-area: status; }
  [data-table="devices-new"].tbl--cards .col-customer { grid-area: customer; font-size: var(--t-12); color: var(--muted); overflow: hidden; }
  [data-table="devices-new"].tbl--cards .col-connect { grid-area: connect; }
  [data-table="devices-new"].tbl--cards .col-connect .btn { flex: 1; }
  [data-table="devices-new"].tbl--cards .col-connect .btn-row { display: flex; width: 100%; }
  [data-table="devices-new"].tbl--cards .col-name .cv__btn, [data-table="devices-new"].tbl--cards .tbl__btns { display: none; }
}
.devmenu__who { margin: 0 0 var(--s-2); overflow-wrap: anywhere; }
.devmenu__sub { font-size: var(--t-13); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the Unassigned inbox: the new devices beside the customers they can be dropped on */
.inbox { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-5); align-items: start; }
.inbox--read { grid-template-columns: minmax(0, 1fr); }
.inbox__main { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.inbox__drop { position: sticky; top: calc(var(--top-h) + var(--s-4)); min-width: 0; }
.inbox__drop .section__body { max-height: calc(100dvh - var(--top-h) - 160px); overflow-y: auto; }
.inbox__find { padding: 0 var(--s-4) var(--s-2); }
.inbox__find .searchbox { max-width: none; }
.inbox__hint { padding: 0 var(--s-4) var(--s-3); font-size: var(--t-13); }
.inbox__hint.is-flash { animation: hint-flash 1.2s var(--ease); }
@keyframes hint-flash { 0%, 60% { color: var(--accent); } }
.droplist { list-style: none; margin: 0; padding: 0; }
.droplist__item { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 48px; padding: 6px var(--s-4); border: 0; border-top: 1px solid var(--line-soft); background: none; color: var(--ink); font-size: var(--t-14); text-align: left; cursor: pointer; }
.droplist__item:hover { background: var(--hover); }
.droplist__item.is-drop-over { background: var(--selected); color: var(--selected-ink); }
.droplist__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.droplist__count { color: var(--muted); font-size: var(--t-13); font-variant-numeric: tabular-nums; }
.droplist__icon { display: grid; place-items: center; width: 20px; height: 20px; color: var(--muted); }
.droprail { position: fixed; z-index: 40; top: calc(var(--top-h) + var(--s-4)); right: var(--s-4); bottom: var(--s-4); width: 300px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden; animation: drawer-in .16s var(--ease); }
.droprail__head { display: flex; flex-direction: column; gap: 2px; padding: var(--s-4); font-size: var(--t-14); }
.droprail .droplist { flex: 1; overflow-y: auto; }
.dragghost { position: fixed; top: -200px; left: 0; display: inline-flex; align-items: center; gap: var(--s-2); padding: 8px 14px; border-radius: var(--r); background: var(--ink); color: var(--ground); font-size: var(--t-14); font-weight: 600; }
@media (max-width: 959px) { .inbox { grid-template-columns: minmax(0, 1fr); } .inbox__drop { position: static; } .inbox__drop .section__body { max-height: 360px; } }
/* the customer map */
.mapview { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-5); align-items: start; }
.mapview__main, .mapview__side { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.mapview__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); font-size: var(--t-14); }
.mapbox { position: relative; height: min(68vh, 640px); min-height: 360px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--sunk); touch-action: none; cursor: grab; user-select: none; }
.mapbox:focus-visible { outline-offset: 2px; }
.mapbox.is-dragging { cursor: grabbing; }
.mapbox__tiles, .mapbox__pins { position: absolute; inset: 0; }
.mapbox__tiles img { position: absolute; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.mapbox__tiles img.is-broken { visibility: hidden; }
.mappin { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; padding: 3px; border: 2px solid var(--surface); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); cursor: pointer; }
.mappin--ok { border-color: var(--green); }
.mappin--attention { border-color: var(--amber); }
.mappin--offline { border-color: var(--red); }
.mappin.is-chosen { outline: 3px solid var(--accent-fill); outline-offset: 2px; }
.mappin__badge { position: absolute; top: -10px; right: -10px; }
.mappin--group { width: 40px; height: 40px; border-radius: 50%; border-color: var(--surface); background: var(--accent-fill); color: var(--on-accent); font-size: var(--t-14); font-weight: 600; }
.mapbox__ctl { position: absolute; top: var(--s-3); right: var(--s-3); display: flex; flex-direction: column; gap: 6px; }
.mapbox__ctl .btn { box-shadow: var(--shadow-1); }
.mapbox__attr { position: absolute; right: 6px; bottom: 6px; padding: 2px 8px; border-radius: var(--r-sm); background: var(--surface); color: var(--muted); font-size: var(--t-12); }
.mapbox__msg { position: absolute; left: var(--s-3); right: var(--s-3); bottom: 40px; padding: var(--s-3) var(--s-4); border: 1px solid var(--amber-line); border-radius: var(--r-md); background: var(--amber-bg); color: var(--ink); font-size: var(--t-14); }
.mapcard { display: flex; flex-direction: column; gap: var(--s-3); }
.mapcard__head { display: flex; align-items: flex-start; gap: var(--s-3); }
.mapcard__addr { margin-top: 4px; font-size: var(--t-14); color: var(--ink-2); }
.maplist { list-style: none; margin: 0; padding: 0; }
.maplist__row { display: flex; align-items: center; gap: var(--s-3); min-height: 52px; padding: 6px var(--s-3) 6px var(--s-5); border-top: 1px solid var(--line-soft); }
.maplist__name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: var(--t-14); overflow-wrap: anywhere; }
.maplist__name .muted { font-size: var(--t-13); }
@media (max-width: 959px) { .mapview { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 719px) { .mapbox { height: 56vh; min-height: 300px; } }
/* the address fill-in's suggestions */
.addr { position: relative; }
.addr__list { list-style: none; margin: 4px 0 0; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-pop); max-height: 260px; overflow-y: auto; }
.addr__opt { display: flex; flex-direction: column; justify-content: center; min-height: var(--h); padding: 4px var(--s-3); border-radius: var(--r); font-size: var(--t-15); cursor: pointer; }
.addr__opt:hover, .addr__opt.is-active { background: var(--hover); }
.addr__sub { font-size: var(--t-13); color: var(--muted); }
/* the fleet charts */
.fleet { display: flex; flex-direction: column; gap: var(--s-5); }
.fleet__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); font-size: var(--t-14); }
.fleet__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--s-5); align-items: start; }
/* the quick fix panel of the bulk bar */
.qfgroup { display: flex; flex-direction: column; }
.qfgroup__title { font-size: var(--t-14); font-weight: 600; color: var(--ink-2); padding: var(--s-2) 0 2px; }
.qfres { list-style: none; margin: 0; padding: 0; }
.qfres__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s-3); padding: 10px 0; border-top: 1px solid var(--line-soft); }
.qfres__host { font-size: var(--t-14); overflow-wrap: anywhere; }
.qfres__msg { grid-column: 1 / -1; font-size: var(--t-13); color: var(--muted); }

/* ---------- status: the Atera snapshot marker (a ring around the light, a quiet word after it) ---------- */
.status--snap .status__light { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px currentColor; }
.status__snap { font-size: var(--t-12); font-weight: 500; color: var(--muted); }
.status--snap.status--quiet .status__light { box-shadow: none; }

/* ---------- icon chip (the logo chip's square, with a line icon) ---------- */
.chip--icon { background: var(--sunk); color: var(--ink-2); }
.chip--icon.chip--20 .ico { width: 12px; height: 12px; } .chip--icon.chip--32 .ico { width: 18px; height: 18px; }
.chip--icon.chip--40 .ico { width: 22px; height: 22px; } .chip--icon.chip--56 .ico { width: 28px; height: 28px; }
.chip--t-accent { background: var(--selected); color: var(--selected-ink); }
.chip--t-ok { background: var(--green-bg); color: var(--green); }
.chip--t-attention { background: var(--amber-bg); color: var(--amber); }
.chip--t-offline { background: var(--red-bg); color: var(--red); }
.chip--t-quiet { background: var(--sunk); color: var(--muted); }

/* ---------- action bar: a row of buttons; on a phone a grid of icon tiles (same actions, same order) ---------- */
.actionbar { display: flex; flex-wrap: wrap; gap: var(--s-2); }
@media (max-width: 719px) {
  .actionbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .actionbar__btn { flex-direction: column; height: 64px; min-width: 0; padding: 6px 4px; gap: 4px; font-size: var(--t-13); line-height: 1.15; white-space: normal; text-align: center; }
  .actionbar__btn span { overflow-wrap: anywhere; }
}

/* ---------- link cards: everything related, one whole-card click each; a dashed card fills a gap ---------- */
.lcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: var(--s-3); }
.lcards__item { display: flex; min-width: 0; }
/* the chip on the left, the words beside it, the light and its word under the words; every word wraps (the owner's no-cut-off-text rule) */
.lcard { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: center; gap: 2px var(--s-3); width: 100%; min-height: 76px; padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); text-align: left; font: inherit; text-decoration: none; cursor: pointer; }
.lcard > .chip { grid-row: span 2; }
.lcard > .status { grid-column: 2; }
.lcard:hover { border-color: var(--accent); background: var(--hover); color: var(--ink); }
.lcard--dashed { border-style: dashed; border-color: var(--control); background: transparent; }
.lcard__text { display: flex; flex-direction: column; min-width: 0; }
.lcard__title { font-size: var(--t-15); font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.lcard__sub { font-size: var(--t-13); color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
@media (max-width: 719px) {
  .lcards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
  .lcard { gap: 4px 10px; min-height: 60px; padding: 10px; }
  .lcard__title { font-size: var(--t-14); line-height: 1.25; }
}
@media (max-width: 359px) { .lcards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- meter (a disk): the fill carries the severity, the track is a light step of the same colour ---------- */
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px var(--s-3); font-size: var(--t-14); }
.meter__label { font-weight: 500; }
.disk-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 6px 0 0; font-size: var(--t-13); }
.disk-kind .ico { flex: none; }
.disk-kind .mono { overflow-wrap: anywhere; }
.part-search { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 2px; vertical-align: middle; color: var(--muted); border-radius: var(--r-sm); }
.part-search:hover { color: var(--accent); }
.atera-move__sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; cursor: pointer; padding: 4px 0; }
.atera-move__body { margin-top: 12px; }
.atera-move__steps { margin: 0; padding-left: 20px; }
.atera-move__list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.atera-move__row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.atera-move__name { flex: 1 1 180px; font-weight: 500; }
.atera-move__more > summary { cursor: pointer; padding: 8px 0; }
.exp-list { list-style: none; margin: 0; padding: 0; }
.exp-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.exp-row:first-child { border-top: 0; }
.exp-fix { flex: 1 1 260px; }
.add-dev__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.add-dev__title { font-weight: 600; }
.meter__text { color: var(--muted); font-size: var(--t-13); font-variant-numeric: tabular-nums; }
.meter__bar { display: block; width: 100%; height: 8px; }
.meter--ok .meter__track { fill: var(--info-bg); } .meter--ok .meter__fill { fill: var(--accent-fill); }
.meter--warn .meter__track { fill: var(--amber-bg); } .meter--warn .meter__fill { fill: var(--amber); }
.meter--crit .meter__track { fill: var(--red-bg); } .meter--crit .meter__fill { fill: var(--red); }

/* ---------- charts (chart.js): one measure per chart, thin line, a 10% wash, hairline grid, a crosshair and one readout ---------- */
.chart { margin: 0; display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.chart__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s-3); }
.chart__title { font-size: var(--t-15); font-weight: 600; }
.chart__nums { display: flex; flex-wrap: wrap; gap: 2px var(--s-3); font-size: var(--t-13); color: var(--muted); }
.chart__nums b { color: var(--ink); font-weight: 600; }
.chart__body { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s-2); }
.chart__y { display: flex; flex-direction: column; justify-content: space-between; height: 120px; font-size: var(--t-12); line-height: 1; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.chart__plot { position: relative; height: 120px; border-radius: var(--r-sm); cursor: crosshair; touch-action: pan-y; }
.chart__plot:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.chart__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__thr { stroke: var(--control); stroke-width: 1; stroke-dasharray: 4 3; }
.chart__line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__area { fill: var(--accent); opacity: .1; }
.chart__cross { stroke: var(--ink-2); stroke-width: 1; }
.chart__tip { position: absolute; z-index: 5; top: -6px; left: var(--x, 50%); transform: translate(-50%, -100%); padding: 6px 10px; border-radius: var(--r); background: var(--ink); color: var(--ground); font-size: var(--t-13); font-weight: 500; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-pop); }
.chart__tip.is-left { transform: translate(0, -100%); } .chart__tip.is-right { transform: translate(-100%, -100%); }
.chart__x { display: flex; justify-content: space-between; gap: var(--s-3); margin-left: calc(40px + var(--s-2)); font-size: var(--t-12); color: var(--muted); }
.chart__empty { margin: 0; padding: var(--s-4) 0; color: var(--muted); font-size: var(--t-14); }
.chart--empty .chart__empty { padding: var(--s-6) 0; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-md); }
.ustrip { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s-4); }
.ustrip__plot { height: 28px; cursor: default; }
.ustrip__svg { display: block; width: 100%; height: 100%; }
.ustrip .chart__x { margin-left: 0; }
.ustrip__cell--ok { fill: var(--green); } .ustrip__cell--warn { fill: var(--amber); } .ustrip__cell--crit { fill: var(--red); } .ustrip__cell--none { fill: var(--sunk); }
.ustrip__hl { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
/* a strip of state codes (chart.js codeStrip): the Last 24 h column of the Devices list, a site's last 7 days. Shape and colour, the uptime in words beside it */
.cstrip { display: inline-flex; align-items: center; gap: var(--s-2); white-space: nowrap; vertical-align: middle; }
.cstrip__svg { display: block; flex: none; overflow: visible; }
.cstrip__c--ok { fill: var(--green); } .cstrip__c--warn { fill: var(--amber); } .cstrip__c--crit { fill: var(--red); }
.cstrip__c--none { fill: none; stroke: var(--control); stroke-width: .75; stroke-dasharray: 1.5 1; }
.cstrip__pct { font-size: var(--t-13); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cstrip__pct--warn { color: var(--amber); } .cstrip__pct--crit { color: var(--red); }
.cstrip--none, .cstrip--wait { font-size: var(--t-13); }
.cstrip--wait { display: inline-block; width: 96px; height: 14px; border-radius: 3px; background: var(--sunk); vertical-align: middle; }
/* state bars (chart.js stateBars): one stacked column per period, the legend is status words with their lights */
.sbars__legend { display: flex; flex-wrap: wrap; gap: 4px var(--s-4); }
.sbars__plot { height: 64px; cursor: default; }
.sbars__svg { display: block; width: 100%; height: 100%; }
.sbars .chart__x { margin-left: 0; }
.sbars__c--ok { fill: var(--green); } .sbars__c--warn { fill: var(--amber); } .sbars__c--crit { fill: var(--red); } .sbars__c--quiet { fill: var(--grey); opacity: .55; } .sbars__c--none { fill: var(--sunk); }

/* ---------- a list of things that happened (commands, quick fixes, remote sessions): the state, what, who and when, its output ---------- */
.alist { list-style: none; margin: 0; padding: 0; container-type: inline-size; }
/* the text keeps at least 14rem and the buttons at most half the row (they wrap): with "auto" a row of buttons left the text 0px, one letter per line */
.alist__row { display: grid; grid-template-columns: 170px minmax(min(14rem, 100%), 1fr) fit-content(50%); gap: var(--s-2) var(--s-4); align-items: center; padding: 12px var(--s-5); border-top: 1px solid var(--line-soft); }
.alist__text { display: flex; flex-direction: column; min-width: 0; }
.alist__title { font-size: var(--t-14); font-weight: 500; overflow-wrap: anywhere; }
.alist__sub { font-size: var(--t-13); color: var(--muted); overflow-wrap: anywhere; }
@container (max-width: 560px) { .alist__row { grid-template-columns: minmax(0, 1fr) auto; } .alist__row > .status { grid-column: 1 / -1; } }
pre.code { margin: 0; padding: var(--s-3) var(--s-4); max-height: 60vh; overflow: auto; border-radius: var(--r); background: var(--sunk); color: var(--ink); font: var(--t-13)/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.menu__item--danger, .menu__item--danger .ico { color: var(--red); }

/* ---------- the device hub (#/devices/<id>/<tab>) ---------- */
.dhub__band { background: var(--surface); border-bottom: 1px solid var(--line); }
.dhub__bandin { max-width: var(--page-max); padding: var(--s-6) var(--page-pad) 0; display: flex; flex-direction: column; gap: var(--s-5); }
.dhub__page { padding-top: var(--s-6); }
.dhub__user { display: inline-flex; align-items: center; gap: 6px; }
.dhub__user .ico { color: var(--muted); }
.dhub__rename { margin-left: 8px; vertical-align: middle; }
.dhub__own { font-size: 0.55em; font-weight: 400; vertical-align: middle; }
.dhub__field { display: flex; flex-direction: column; gap: 6px; max-width: 440px; margin-bottom: var(--s-3); }
.dhub__row { margin-top: var(--s-2); }
.dhub__sub { margin: var(--s-4) 0 var(--s-1); font-size: var(--t-14); font-weight: 600; }
.glist--flat { border: 0; border-radius: 0; background: transparent; }
.dfind .dfind__item { grid-template-columns: 120px minmax(0, 1fr); align-items: start; }
.dfind__item > .status { margin-top: 2px; }
.dfind__acts { margin-top: var(--s-2); }
/* copy a value (ui.js copyValue, copy.js): the value is selectable text, the quiet button after it copies it. Desktop (a fine pointer that hovers): the button
   shows while the pointer or the focus is on the value or its row, and keeps its room when hidden, so nothing moves. Touch: always shown, a 36 px target. */
.cv { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-width: 0; vertical-align: middle; }
.cv__v { min-width: 0; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; cursor: text; }
.cv__btn { position: relative; flex: none; margin: -8px 0; color: var(--muted); } /* relative: its hidden name (.sr-only) stays inside a table's scroll box */
.cv__btn:hover, .cv__btn:focus-visible { color: var(--ink); }
.cv-list { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-3); max-width: 100%; min-width: 0; vertical-align: middle; }
.cv__scratch { position: fixed; top: 0; left: -10000px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* inside a table cell the value ends in "..." (the cell's tooltip shows it whole) and the button stays in view; a wrapping column wraps instead */
.tbl__table .cv { display: flex; }
.tbl__table .cv__v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl__table td.is-wrap .cv__v, .cv--wrap .cv__v { white-space: normal; }
.tbl__table td.is-wrap .cv-list .cv { display: inline-flex; }
.cv--pin > .cv__v { cursor: auto; }
.cv--pin .tbl__link { max-width: 100%; }
.tbl__table .is-num .cv { justify-content: flex-end; }
@media (hover: hover) and (pointer: fine) {
  .cv__btn { --h-sm: 28px; opacity: 0; transition: opacity .12s var(--ease); }
  .cv:hover .cv__btn, .cv:focus-within .cv__btn, .tbl__row:hover .cv__btn, .glist__row:hover .cv__btn, .facts dd:hover .cv__btn, .cv-list:hover .cv__btn { opacity: 1; }
}
@media (pointer: coarse) { .cv__btn { opacity: 1; min-width: 36px; min-height: 36px; } }
@media (prefers-reduced-motion: reduce) { .cv__btn { transition: none; } }
@media print { .cv__btn { display: none; } }
.dcharts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-6) var(--s-5); }
.dcharts.is-loading { opacity: .55; }
.dsw__bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); padding: 0 var(--s-5) var(--s-4); }
.dsw__bar .field { flex: 1 1 260px; max-width: 440px; }
.dsw__bar > [role="status"] { padding-bottom: 12px; }
.dlist { list-style: none; margin: 0; padding: 0; }
.dlist li { padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: var(--t-14); overflow-wrap: anywhere; }
.dlist li:first-child { border-top: 0; }
/* Connect (device hub): the one obvious way in. A split button (Connect does the best thing now, the chevron lists the other ways), with RustDesk
   "Ask to connect" beside it (the person at the PC clicks Accept first), and one line saying what will happen; on a phone Connect is full width,
   Ask to connect full width under it, and the line under both. The chooser's rows have a second line (.menu__item--two). */
.dconnect { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3) var(--s-5); }
.dconnect__btns { display: inline-flex; flex: none; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.dconnect__note { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin: 0; }
.dconnect__why { color: var(--muted); font-size: var(--t-13); flex: 1 1 18rem; }
.dconnect__split { display: inline-flex; flex: none; }
.dconnect__ask, .dconnect__files { height: 48px; padding: 0 var(--s-5) 0 var(--s-4); font-size: var(--t-15); gap: 8px; }
.dconnect__go { height: 48px; padding: 0 var(--s-6) 0 var(--s-5); font-size: var(--t-17); gap: 10px; }
.dconnect__go .ico { width: 22px; height: 22px; }
.dconnect__split .dconnect__go:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.dconnect__ways { height: 48px; width: 44px; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid color-mix(in srgb, var(--on-accent) 35%, transparent); }
.dconnect__line { margin: 0; flex: 1 1 360px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: var(--t-14); line-height: 1.45; color: var(--ink-2); }
.dconnect__how { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.dconnect__how .ico { align-self: center; color: var(--accent); }
.dconnect__what { min-width: 0; overflow-wrap: anywhere; }
.menu__item--two { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.menu__item--two > .ico { margin-top: 2px; }
.menu__main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 500; }
.menu__sub { display: block; margin-top: 2px; font-size: var(--t-13); line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 1099px) and (min-width: 720px) { .dhub__bandin { padding: var(--s-5) var(--s-6) 0; } }
@media (max-width: 719px) {
  .dhub__bandin { padding: var(--s-4) var(--s-4) 0; gap: var(--s-4); }
  .dhub__page { padding-top: var(--s-5); }
  .dfind .dfind__item { grid-template-columns: minmax(0, 1fr); }
  .dsw__bar { padding: 0 var(--s-4) var(--s-3); }
  .dhub .section__head .seg { width: 100%; }
  .dconnect { flex-direction: column; align-items: stretch; gap: var(--s-2); }
  .dconnect__btns { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-2); }
  .dconnect__split { display: flex; }
  .dconnect__go { flex: 1; height: 52px; }
  .dconnect__ask, .dconnect__files { width: 100%; justify-content: center; height: 48px; }
  .dconnect__ways { height: 52px; width: 52px; }
  .dconnect__line { flex: none; font-size: var(--t-13); }
}

/* ---------- quick fixes (the panel in the drawer) ---------- */
.qf { display: flex; flex-direction: column; gap: var(--s-5); }
.qf__who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-3); font-size: var(--t-14); color: var(--ink-2); }
.qf__group { display: flex; flex-direction: column; gap: var(--s-2); }
.qf__gh { font-size: var(--t-14); font-weight: 600; color: var(--ink-2); }
.qf__grid { display: flex; flex-direction: column; gap: var(--s-2); }
.qf__item { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-1) var(--s-1) var(--s-1) var(--s-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.qf__item.is-off { background: var(--surface-2); }
.qf__row { display: flex; align-items: center; gap: var(--s-2); }
.qf__row > .qf__name { padding-left: var(--s-2); }
.qf__go { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s-3); min-height: var(--h); padding: 0 var(--s-2); border: 0; border-radius: var(--r); background: none; color: var(--ink); font: inherit; text-align: left; }
.qf__go:hover:not(:disabled) { background: var(--hover); }
.qf__go:disabled { color: var(--muted); cursor: not-allowed; }
.qf__name { flex: 1; min-width: 0; font-size: var(--t-15); font-weight: 500; overflow-wrap: anywhere; }
.qf__chips { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: 0 var(--s-2) var(--s-1); }
.qf__picks { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--s-2); padding: 0 var(--s-2) var(--s-1); }
.qf__why { padding: 0 var(--s-2) var(--s-1); font-size: var(--t-13); color: var(--muted); }
.qf__info { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-2); border-top: 1px solid var(--line-soft); font-size: var(--t-14); }
.qf__confirm { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--info-line); border-radius: var(--r-lg); background: var(--info-bg); }
.qf__confirm--danger { border-color: var(--red-line); background: var(--red-bg); }
.qf__suggs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.qf__sugg { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); font-size: var(--t-13); }
.qf .alist__row { padding: 10px 0; }

/* ---------- gallery ---------- */
.gal { display: flex; flex-direction: column; gap: var(--s-7); }
.gal__toc { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.gal__sec { display: flex; flex-direction: column; gap: var(--s-3); scroll-margin-top: calc(var(--top-h) + 16px); }
.gal__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.gal__pane { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.gal__tag { font-size: var(--t-12); color: var(--muted); }
.gal__row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.gal__col { display: flex; flex-direction: column; gap: var(--s-2); }
.gal__pair--stack { grid-template-columns: minmax(0, 1fr); } /* the data table: light above dark, each the full width, so its columns can be resized */
@media (max-width: 1279px) { .gal__pair { grid-template-columns: minmax(0, 1fr); } }

/* Software deployment (pages/software.js, pages/device-software.js) */
.swd-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); }
.section__body:not(.section__body--flush) > .swd-bar { padding: 0 0 var(--s-3); }
.swd-steps { margin: 0; padding: 0 0 0 var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); font-size: var(--t-14); }
.swd-steps .cv { margin-top: var(--s-2); }
.swd-group { padding: 0 var(--s-5); margin-top: var(--s-4); }
.swd-picks { list-style: none; max-height: 320px; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: 8px; padding: var(--s-2) var(--s-3); }
.swd-picks--short { max-height: 220px; }
.swd-picks > li[hidden] { display: none; }
.alist__row[hidden] { display: none; }
/* software logos (software-logos.js): a chip beside a row's text, and a small chip before a package's name in a line of packages, a picker option or a program */
.swl { display: flex; align-items: flex-start; gap: var(--s-3); min-width: 0; }
.swl > .chip { margin-top: 2px; }
.swl-item { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; max-width: 100%; }
.swl-item > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.select__option > .chip { order: -1; }

/* install help (pages/install-help.js): the phone app's steps with a QR code, and the sketches of Play Protect's and SmartScreen's warnings (our own
   look and colours, never a picture of Google's or Microsoft's screens); the numbered rings show where to tap, in order */
.ig { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-6); align-items: start; }
.sheet .ig { grid-template-columns: minmax(0, 1fr); }
.ig-steps { gap: var(--s-4); max-width: var(--prose-max); }
.ig-steps > li > strong { color: var(--ink); }
.ig-tap { font-weight: 600; color: var(--ink); white-space: nowrap; }
.ig-dl { display: block; margin-top: var(--s-2); }
.actionbar__btn[data-why] { opacity: .6; } /* a phone action Android does not allow here: still clickable, it says why (pages/device-mobile.js mob-why) */
.phone-code { margin: 0; font-size: 40px; font-weight: 650; letter-spacing: .08em; } /* the 6-digit join code for the phone support app (pages/customer/phones.js) */
.ig-qr { width: 184px; display: flex; flex-direction: column; gap: var(--s-2); }
.ig-qr__code { width: 168px; height: 168px; }
.ig-qr__code svg { display: block; width: 100%; height: 100%; border-radius: var(--r); border: 1px solid var(--line); }
.ig-qr__light { fill: #FFFFFF; }
.ig-qr__dark { fill: #000000; }
.ig-fig { margin: var(--s-3) 0 0; display: flex; flex-direction: column; gap: var(--s-2); max-width: 360px; }
.ig-mock { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); box-shadow: var(--shadow-1); font-size: var(--t-13); color: var(--ink-2); }
.ig-mock--phone { border-radius: 20px 20px var(--r-lg) var(--r-lg); padding-top: var(--s-5); position: relative; }
.ig-mock--phone::before { content: ""; position: absolute; top: var(--s-2); left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-btn); }
.ig-mock--pc { border-radius: var(--r-sm); }
.ig-mock__head { display: flex; align-items: center; gap: var(--s-2); }
.ig-mock__shield { display: inline-flex; color: var(--amber); }
.ig-mock__title { font-size: var(--t-15); font-weight: 600; color: var(--ink); }
.ig-mock__text { margin: 0; }
.ig-mock__more, .ig-mock__link { display: inline-flex; align-items: center; gap: var(--s-1); align-self: flex-start; color: var(--accent); font-weight: 600; }
.ig-mock__arrow { display: inline-flex; }
.ig-mock__row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-3); }
.ig-mock__btn { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--s-3); border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-weight: 600; }
.ig-mock--pc .ig-mock__btn { border-radius: var(--r-sm); }
.ig-mock__btn--ghost { background: transparent; color: var(--accent); }
.ig-hit { position: relative; outline: 2px solid var(--amber); outline-offset: 3px; border-radius: var(--r-sm); }
.ig-hit::after { content: attr(data-n); position: absolute; top: -13px; right: -13px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--amber); color: var(--surface); font-size: var(--t-12); font-weight: 700; line-height: 1; }
.ig-win > .btn { align-self: flex-start; }
.ig-win > .btn[aria-expanded="true"] .ico { transform: rotate(180deg); }
.ig-win__body > p { margin: 0; }
@media (max-width: 719px) {
  .ig { grid-template-columns: minmax(0, 1fr); }
  .ig-qr { display: none; } /* on the phone already: nothing to scan */
  .ig-qr.rd-qr { display: flex; } /* RustDesk's setup code: one phone can show it to another (pages/rustdesk.js) */
}

/* print: content only */
@media print { .rail, .topbar, .tabbar, .toasts { display: none !important; } .app { display: block; } body { background: #FFFFFF; } }

/* The Screen viewer (pages/device-screen.js): the whole window, the picture fitted inside it. */
.scrview { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #FFFFFF; }
.scrview[open] { display: flex; flex-direction: column; }
.scrview__bar { flex: none; display: flex; align-items: center; gap: var(--s-4); padding: var(--s-2) var(--s-4); background: #16181D; }
.scrview__name { font-weight: 600; white-space: nowrap; }
.scrview__state { flex: 1; min-width: 0; font-size: var(--t-14); overflow-wrap: anywhere; }
.scrview__end { flex: none; }
.scrview__key { flex: none; } /* Back, Home, Recents on a phone (pages/device-screen.js) */
.scrview__canvas { touch-action: none; }
.scrview__canvas { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; }

/* Phone, the Devices list: the search and the status chips, then the devices (owner, 2026-11-08). The title stays for screen readers; the other views are in the status and type chips. */
@media (max-width: 640px) {
  [data-devlist] > .ph { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  [data-devlist] > .tabs, [data-devlist] .toolbar__select, [data-devlist] .dfind .kbd { display: none; }
  [data-devlist].lst { gap: var(--s-2); }
}

/* the password vault (pages/passwords.js) */
.pw-search { max-width: 420px; }
.pw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pw-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
.pw-row:last-child { border-bottom: 0; }
.pw-row__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; background: none; border: 0; padding: var(--s-1) 0; text-align: left; color: inherit; font: inherit; }
button.pw-row__main { cursor: pointer; }
.pw-row__title { font-weight: 600; overflow-wrap: anywhere; }
.pw-row__sub { color: var(--muted); font-size: var(--t-14); overflow-wrap: anywhere; }
.pw-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.pw-recovery { font-family: var(--mono); font-size: 18px; letter-spacing: 0.04em; padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r); overflow-wrap: anywhere; user-select: text; }
.pw-secret { font-family: var(--mono); overflow-wrap: anywhere; padding: var(--s-2) 0; }
.pw-notes { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
/* the AI team (pages/team.js) */
.team-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.team-pad { padding: var(--s-4) var(--s-5); }
.pw-drop { display: flex; align-items: center; justify-content: center; min-height: 140px; padding: var(--s-5); border: 1px dashed var(--line); border-radius: var(--r); text-align: center; cursor: pointer; }
.pw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: var(--s-3) var(--s-5); }
.pw-tablewrap { overflow-x: auto; }
.pw-preview { width: 100%; border-collapse: collapse; font-size: var(--t-14); }
.pw-preview th, .pw-preview td { text-align: left; padding: var(--s-1) var(--s-2); border-bottom: 1px solid var(--line); }
.pw-steps { margin: 0 0 var(--s-4); padding-left: 20px; }
.team-av { position: relative; display: inline-flex; flex: none; justify-self: start; align-self: center; width: max-content; }
.team-av__ua { position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--bg, #fff); }
.team-av__ua img { display: block; width: 16px; height: 16px; }
.team-head { display: flex; align-items: center; gap: var(--s-3); }
.team-brief { margin: 0; white-space: pre-wrap; }
.team-steps { margin: var(--s-1) 0 var(--s-2); padding-left: var(--s-5); font-size: var(--t-13); color: var(--muted); }

/* #/customers/duplicates (pages/customer-dupes.js) */
.dup-list { list-style: none; margin: 0; padding: 0; }
.dup-group { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line-soft); }
.dup-group__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s-2) var(--s-5); }

/* AI team > Messages: a person name that opens their timeline (pages/team.js) */
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--link, var(--accent)); text-align: left; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

/* AI team > Chats (pages/team-chat.js): WhatsApp-like, phone first */
.chat-list { list-style: none; margin: 0; padding: 0; background: var(--surface, #fff); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.chat-list li + li { border-top: 1px solid var(--line-soft); }
.chat-row { display: flex; gap: var(--s-3); align-items: center; padding: 12px var(--s-4); color: inherit; text-decoration: none; min-height: 64px; }
.chat-row:hover, .chat-row:focus-visible { background: var(--hover, rgba(0,0,0,.03)); }
.chat-row__text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.chat-row__top, .chat-row__bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
/* the worker's position beside the name, a quiet pill: the owner finds people by what they do (2026-11-29) */
.chat-row__who { display: flex; align-items: baseline; gap: var(--s-2); min-width: 0; }
.chat-row__who > strong { flex: none; }
.chat-row__pos { font-size: var(--t-12, 12px); color: var(--muted); padding: 1px 8px; border-radius: 999px; background: var(--surface-2, rgba(0,0,0,.05)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chat-row__last { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chat-row__time { font-size: var(--t-12, 12px); color: var(--muted); flex: none; }
.chat-row__time.is-unread { color: var(--ok, #1a7f37); font-weight: 600; }
.chat-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--ok, #1a7f37); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.chat-badge--card { background: var(--attention, #b35900); }
.chat-typing { color: var(--ok, #1a7f37); font-style: normal; }
.chat-group { background: var(--accent, #2563eb); color: #fff; font-weight: 700; }
.chat { display: flex; flex-direction: column; height: calc(100dvh - 120px); min-height: 420px; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; background: var(--surface, #fff); }
.chat-head { display: flex; align-items: center; gap: var(--s-3); padding: 10px var(--s-4); border-bottom: 1px solid var(--line-soft); }
.chat-head__text { display: flex; flex-direction: column; min-width: 0; }
.chat-back { font-size: 28px; line-height: 1; text-decoration: none; color: inherit; padding: 0 4px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: 6px; background: var(--ground); }
.chat-msg { display: flex; }
.chat-msg--mine { justify-content: flex-end; }
.chat-bubble { max-width: min(80%, 560px); padding: 8px 12px 6px; border-radius: 14px 14px 14px 4px; background: var(--surface, #fff); box-shadow: 0 1px 1px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 2px; }
.chat-msg--mine .chat-bubble { background: var(--chat-mine, #d9fdd3); border-radius: 14px 14px 4px 14px; }
.chat-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-body code, .team-text code, .act-why code { font: 0.92em var(--font-mono, ui-monospace, monospace); padding: 0 0.25em; border-radius: 4px; background: color-mix(in srgb, currentColor 10%, transparent); }
.md-h { display: inline-block; margin-top: 0.15em; }
.md-quote { display: inline-block; padding-left: 0.6em; border-left: 3px solid color-mix(in srgb, currentColor 25%, transparent); }
.chat-who { font-size: 12px; font-weight: 600; color: var(--accent, #2563eb); }
.chat-time { align-self: flex-end; font-size: 11px; color: var(--muted); }
.chat-bubble--typing { color: var(--muted); }
.chat-card { max-width: min(90%, 600px); padding: 10px 12px; border-radius: 14px; background: var(--surface, #fff); border: 1px solid var(--attention-line, #f0c36d); display: flex; flex-direction: column; gap: 6px; }
.chat-card__head { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.chat-card__body { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-empty { color: var(--muted); text-align: center; margin: auto; }
.chat-quick { display: flex; gap: 6px; padding: 6px var(--s-3) 0; overflow-x: auto; flex-wrap: nowrap; }
.chat-quick .btn { flex: none; border-radius: 18px; }
.chat-quick[hidden] { display: none; }
.chat-compose { display: flex; gap: var(--s-2); align-items: flex-end; padding: 8px var(--s-3); border-top: 1px solid var(--line-soft); }
.chat-compose textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px; font: inherit; max-height: 160px; background: var(--surface-2); color: var(--ink); caret-color: var(--ink); } /* the theme's own field colours: in dark mode the text was light on white (owner, 2026-11-22) */
.chat-compose textarea::placeholder { color: var(--muted); opacity: 1; }
.chat-compose .btn { border-radius: 50%; width: 42px; height: 42px; padding: 0; }
.chat-off { padding: var(--s-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chat-mine: #144d37; } }
:root[data-theme="dark"] { --chat-mine: #144d37; }
@media (max-width: 640px) { .chat { height: calc(100dvh - 150px - env(safe-area-inset-bottom, 0px)); min-height: 0; border-radius: 0; border-left: 0; border-right: 0; margin: calc(-1 * var(--s-3)) calc(-1 * var(--s-4)) 0; } }

/* AI team > Work (pages/team-work.js): the film strip */
.work-live { color: var(--ok, #1a7f37); }
.work-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--s-2) var(--s-3); align-items: end; }
.work-strip { list-style: none; margin: 0; padding: 4px 2px 12px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; }
.work-step { flex: none; width: 230px; scroll-snap-align: center; background: var(--surface, #fff); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.work-step.is-open { width: 360px; border-color: var(--accent, #2563eb); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #2563eb) 25%, transparent); }
.work-step--write { border-left: 4px solid var(--attention, #b35900); }
.work-step--bad { border-left: 4px solid var(--crit, #c62828); }
.work-step--next { justify-content: center; color: var(--muted); width: 120px; }
.work-step__head { display: flex; gap: 8px; align-items: baseline; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; flex-wrap: wrap; }
.work-step__n { font-size: 12px; color: var(--muted); }
.work-step__time { font-size: 12px; color: var(--muted); }
.work-step__links { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.work-step__text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; max-height: 240px; overflow: auto; }
.work-step__detail { display: flex; flex-direction: column; gap: 4px; }
.work-step__detail code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 160px; overflow: auto; background: var(--bg-soft, #f4f5f7); padding: 6px; border-radius: 6px; }

.work-shot img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line-soft); display: block; }
.work-step.is-open .work-shot img { max-height: 420px; object-fit: contain; }

/* the WhatsApp linking QR (team.js, Messages): a white quiet zone in both themes so any phone camera reads it */
.wa-qr { display: block; width: 264px; max-width: 100%; height: auto; padding: 12px; background: #fff; border-radius: 8px; image-rendering: pixelated; }

/* chat attachments (team-chat.js): photos, voice notes, files, the tray of picked files and the recording strip */
.chat-photo { display: block; margin: -2px -6px 4px; }
.chat-photo img { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; object-fit: cover; }
.chat-voice { display: flex; flex-direction: column; gap: 4px; min-width: min(260px, 60vw); }
.chat-voice audio { width: 100%; height: 36px; }
.chat-transcript { font-size: .875rem; font-style: italic; }
.chat-file { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; background: var(--surface-2, rgba(0,0,0,.04)); color: inherit; text-decoration: none; margin-bottom: 4px; }
.chat-file > span { display: flex; flex-direction: column; min-width: 0; }
.chat-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-tray { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--s-3); }
.chat-tray:empty { display: none; }
.chat-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 4px 6px 4px 4px; border: 1px solid var(--line); border-radius: 10px; font-size: .875rem; }
.chat-chip img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.chat-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-chip__x { border: 0; background: none; font-size: 1.1rem; line-height: 1; padding: 4px 6px; cursor: pointer; color: inherit; min-width: 32px; min-height: 32px; }
.chat-rec { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; padding: 6px 0; }
.chat-rec__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--crit, #d93025); animation: chat-rec 1s infinite alternate; }
@keyframes chat-rec { to { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .chat-rec__dot { animation: none; } }
.chat-compose .btn--quiet { width: 38px; height: 42px; flex: none; }
@media (max-width: 420px) { .chat-compose { gap: 4px; padding: 8px; } .chat-compose .btn--quiet { width: 34px; } }

/* The chats like WhatsApp (team-chat.js): a message's menu, replies, ticks, search, dropping files, the photo viewer, File in Documents */
.chat { position: relative; }
.chat-head__tools { margin-left: auto; display: flex; gap: 2px; }
.chat-searchbar { padding: 8px var(--s-3); border-bottom: 1px solid var(--line-soft); }
.chat-searchbar input { width: 100%; }
.chat-msg { align-items: center; gap: 2px; }
.chat-more { border: 0; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; opacity: 0; flex: none; }
.chat-msg--mine .chat-more { order: -1; }
.chat-msg:hover .chat-more, .chat-more:focus-visible { opacity: 1; }
@media (pointer: coarse) { .chat-more { opacity: .55; width: 28px; } }
.chat-quote { display: flex; flex-direction: column; text-align: left; border: 0; border-left: 3px solid var(--accent, #2563eb); background: rgba(127,127,127,.12); border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; font: inherit; font-size: .8125rem; color: inherit; cursor: pointer; max-width: 100%; }
.chat-quote strong { color: var(--accent, #2563eb); font-size: .75rem; }
.chat-quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.chat-replying { display: flex; align-items: center; gap: 8px; width: 100%; border-left: 3px solid var(--accent, #2563eb); background: var(--surface-2, rgba(0,0,0,.04)); border-radius: 6px; padding: 4px 4px 4px 8px; font-size: .875rem; margin-top: 6px; }
.chat-replying > span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-replying > span > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.chat-ticks { margin-left: 4px; letter-spacing: -2px; }
.chat-ticks.is-read { color: #34b7f1; }
.chat-bubble--gone { color: var(--muted); }
.chat-suggest { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); font-size: .875rem; }
.chat-suggest .btn { align-self: flex-start; }
.chat-filed { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--ok, #1a7f37); margin-bottom: 4px; }
.chat-filed .ico { width: 14px; height: 14px; }
.chat-menu { display: flex; flex-direction: column; gap: 8px; }
.chat-menu .btn { justify-content: flex-start; }
.chat-full { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; border-radius: 8px; }
.chat-hit { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--line-soft); background: var(--surface, #fff); color: inherit; font: inherit; border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.chat-hit__top { display: flex; justify-content: space-between; gap: 8px; font-size: .8125rem; }
.chat-msg.is-hit .chat-bubble { outline: 3px solid var(--accent, #2563eb); outline-offset: 2px; }
.chat-dots { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.chat-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: chat-dot 1.2s infinite ease-in-out; }
.chat-dots i:nth-child(2) { animation-delay: .2s; } .chat-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .chat-dots i { animation: none; } }
.chat-drop { display: none; position: absolute; inset: 0; z-index: 5; align-items: center; justify-content: center; flex-direction: column; gap: 8px; background: color-mix(in srgb, var(--surface, #fff) 88%, transparent); border: 3px dashed var(--accent, #2563eb); border-radius: 12px; font-weight: 600; pointer-events: none; }
.chat.is-drop .chat-drop { display: flex; }
.chat-rec .btn { margin-left: 4px; }
.doc-tools { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.doc-tools .searchbox { flex: 1; min-width: 220px; }

/* a worker's picture: the icon of their position in a coloured circle (team-avatar.js) */
.team-av__role { border-radius: 50%; display: grid; place-items: center; }
.team-av__role .ico { color: #fff; }
.team-av--20 .chip, .team-av--32 .chip { border-radius: 50%; }
.team-av--20 .ico { width: 12px; height: 12px; }
.team-who { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-who { display: inline-flex; align-items: center; gap: 6px; }

.chat-list li { display: flex; align-items: center; }
.chat-list li > .chat-row { flex: 1; min-width: 0; }
.chat-row__more { flex: none; margin-right: 6px; opacity: .6; }
.chat-row__badges { display: inline-flex; gap: 4px; flex: none; }
.chat-badge--card { width: auto; padding: 0 8px; }

/* phase 2 (team-chat.js): reactions, forwarded, pinned bar, forward targets */
.chat-reacts { display: flex; gap: 6px; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.chat-react { font-size: 1.5rem; line-height: 1; border: 0; background: none; border-radius: 50%; width: 44px; height: 44px; cursor: pointer; }
.chat-react:hover, .chat-react:focus-visible { background: var(--surface-2, rgba(0,0,0,.05)); }
.chat-react.is-on { background: var(--surface-2, rgba(0,0,0,.08)); outline: 2px solid var(--accent, #2563eb); }
.chat-bubble { position: relative; }
.chat-reaction { position: absolute; bottom: -12px; right: 8px; border: 1px solid var(--line-soft); background: var(--surface, #fff); border-radius: 12px; padding: 0 5px; font-size: .9rem; line-height: 1.4; cursor: pointer; }
.chat-msg:has(.chat-reaction) { margin-bottom: 10px; }
.chat-fwd { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-style: italic; color: var(--muted); }
.chat-fwd .ico { width: 12px; height: 12px; }
.chat-pinbar { display: flex; gap: 6px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-soft); background: var(--surface-2, rgba(0,0,0,.03)); padding: 6px var(--s-4); font: inherit; font-size: .875rem; color: inherit; cursor: pointer; }
.chat-pinbar > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-fwd-to { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-soft); background: none; color: inherit; font: inherit; text-align: left; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.chat-fwd-to > span:last-child { display: flex; flex-direction: column; }
.chat-push { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* rooms and link previews (team-chat.js) */
.chat-mentions { padding-top: 0; }
.chat-mentions .btn { color: var(--accent, #2563eb); }
.chat-preview { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 2px; padding: 6px 10px; border-left: 3px solid var(--accent, #2563eb); background: rgba(127,127,127,.1); border-radius: 6px; color: inherit; text-decoration: none; font-size: .875rem; max-width: 420px; }
.chat-preview strong { overflow-wrap: anywhere; }
.chat-preview span:last-child:not(.muted) { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* live cards in a worker's message (team-memory.js cardView) */
.chat-cards { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 2px; }
.chat-card-live { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 8px 10px; border: 1px solid var(--line-soft); border-left: 4px solid var(--accent, #2563eb); border-radius: 8px; background: var(--surface, #fff); color: inherit; text-decoration: none; font-size: .875rem; }
.chat-card-live.is-ok { border-left-color: var(--ok, #1a7f37); } .chat-card-live.is-off { border-left-color: var(--crit, #d93025); }
.chat-card-live__kind { grid-column: 1 / -1; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.chat-card-live strong, .chat-card-live .muted { grid-column: 1; }
.chat-card-live__open { grid-column: 2; grid-row: 2 / span 2; align-self: center; color: var(--accent, #2563eb); font-weight: 600; }

.scan-video { width: 100%; max-height: 50vh; background: #000; border-radius: 8px; object-fit: cover; }

.chat-voice-mode { color: var(--accent, #2563eb); font-weight: 600; }

/* WhatsApp-style voice and video notes (team-wa.js) */
.chat-compose:not(.has-text) [data-send] { display: none; }
/* the mic is always there on a computer (beside Send while there is text); on a phone the mic and Send take turns, like WhatsApp (owner, 2026-11-24: no mic in the desktop app) */
@media (pointer: coarse) { .chat-compose.has-text #chat-mic-btn { display: none; } }
#chat-mic-btn, #chat-cam-btn { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* while recording, the bar covers the box and the buttons beside it: they go fully out of sight (filmed on the Pixel: the box's blue edge showed round the bar) */
.chat-compose.is-recording textarea, .chat-compose.is-recording [data-action="chat-attach"], .chat-compose.is-recording #chat-cam-btn { opacity: 0; pointer-events: none; outline: none; }
.wa-rec { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 0; font-size: .9rem; }
.wa-time { font-variant-numeric: tabular-nums; min-width: 40px; color: var(--crit, #d93025); font-weight: 600; }
.wa-wave { flex: 1; min-width: 80px; height: 28px; color: var(--muted); }
.wa-hint { color: var(--muted); white-space: nowrap; transition: color .15s; }
.wa-hint.is-near { color: var(--crit, #d93025); }
.wa-rec .wa-btn { width: 38px; height: 38px; border-radius: 50%; }
.wa-preview { flex: 1; height: 36px; }
.wa-cam { position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%); z-index: 50; display: grid; place-items: center; }
.wa-cam__video { width: min(70vw, 300px); height: min(70vw, 300px); border-radius: 50%; object-fit: cover; border: 4px solid var(--crit, #d93025); background: #000; }
.wa-cam__video.is-mirror { transform: scaleX(-1); }
.wa-cam__limit { margin-top: 6px; background: rgba(0,0,0,.6); color: #fff; border-radius: 10px; padding: 2px 8px; font-size: .75rem; }
.vn { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; min-width: min(280px, 64vw); padding: 2px 0; }
.vn__play { grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent, #2563eb); color: #fff; font-size: .9rem; cursor: pointer; }
.vn__wave { display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; }
.vn__b { display: block; width: 3px; border-radius: 2px; background: var(--muted); opacity: .55; }
.vn__b.is-played { background: var(--accent, #2563eb); opacity: 1; }
.vn__b.h1 { height: 10%; } .vn__b.h2 { height: 20%; } .vn__b.h3 { height: 30%; } .vn__b.h4 { height: 40%; } .vn__b.h5 { height: 50%; } .vn__b.h6 { height: 60%; } .vn__b.h7 { height: 70%; } .vn__b.h8 { height: 80%; } .vn__b.h9 { height: 90%; }
.vn__meta { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--muted); }
.vn__rate { border: 0; border-radius: 10px; background: rgba(127,127,127,.2); color: inherit; font: inherit; font-weight: 700; padding: 0 6px; cursor: pointer; }
.vn__mic { display: inline-flex; color: var(--muted); } .vn__mic .ico { width: 14px; height: 14px; } .vn__mic.is-heard { color: #34b7f1; }
.chat-vid video { display: block; max-width: min(320px, 70vw); max-height: 360px; border-radius: 10px; background: #000; }
.chat-vid--note video { width: 220px; height: 220px; border-radius: 50%; object-fit: cover; }

/* the chat header on a phone (owner, 2026-11-24: the name wrapped, the position went one word per line, six icons were squeezed in) */
.chat-head { gap: 10px; padding: 8px 8px 8px 4px; min-height: 60px; }
.chat-head .team-av { flex: none; }
.chat-head__text { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.chat-head__text strong, .chat-head__text #chat-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head__text strong { font-size: 1rem; line-height: 1.3; }
.chat-head__text #chat-sub { font-size: .8125rem; line-height: 1.3; }
.chat-head__tools { flex: none; margin-left: 0; display: flex; gap: 0; }
.chat-head__tools .btn { width: 40px; height: 40px; }
.chat-back { flex: none; padding: 0 6px; }
/* the suggestion chips scroll sideways without a scrollbar */
.chat-quick { scrollbar-width: none; -ms-overflow-style: none; }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-menu__item { justify-content: flex-start; width: 100%; }
@media (max-width: 360px) { .chat-head .team-av .chip--40 { width: 36px; height: 36px; } .chat-compose .btn--quiet { width: 32px; } }

/* recording over the message box itself, so nothing above it moves (team-wa.js) */
.chat-compose { position: relative; }
/* where it sits is measured from the message box itself (team-wa.js fitBar): exactly over the box, from the left edge to just short of the mic */
#chat-tray .wa-rec { position: absolute; z-index: 4; left: var(--rec-x, 8px); top: var(--rec-y, auto); bottom: var(--rec-b, 8px); width: var(--rec-w, calc(100% - 72px)); height: var(--rec-h, 44px); margin: 0; padding: 0 14px; border-radius: 999px; background: var(--surface-2, #f1f3f4); box-sizing: border-box; overflow: visible; }
#chat-tray .wa-rec.is-locked, #chat-tray .wa-rec--done { padding: 0 4px 0 14px; }
.wa-slide { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; will-change: transform, opacity; }
.wa-slide .wa-wave { flex: 1; min-width: 40px; }
.wa-hint { flex: none; font-size: .875rem; }
.wa-lock { position: absolute; right: var(--lock-r, -52px); bottom: calc(100% + 16px); width: 40px; padding: 8px 0 6px; border-radius: 20px; background: var(--surface, #fff); box-shadow: 0 2px 8px rgba(0,0,0,.18); display: flex; flex-direction: column; align-items: center; font-size: 15px; line-height: 1.1; will-change: transform; }
.wa-lock span { font-size: 10px; color: var(--muted); }
.wa-lock.is-near { background: var(--accent, #2563eb); color: #fff; }
.chat-compose.is-recording #chat-mic-btn { transform: scale(1.2); transition: transform .12s ease-out; background: var(--crit, #d93025); border-color: var(--crit, #d93025); }
#chat-mic-btn { transition: transform .12s ease-out; }
.wa-holdtip { position: absolute; right: 8px; bottom: 58px; z-index: 5; background: #202124; color: #fff; font-size: .8125rem; padding: 6px 10px; border-radius: 8px; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none; white-space: nowrap; }
.wa-holdtip.is-on { opacity: 1; transform: none; }
.chat-upload { display: block; height: 3px; border-radius: 2px; background: rgba(127,127,127,.25); overflow: hidden; margin: 4px 0 2px; }
.chat-upload > i { display: block; height: 100%; width: 8%; background: var(--accent, #2563eb); transition: width .2s; }
.vn--local .vn__play { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .wa-slide, .wa-lock, #chat-mic-btn { transition: none; } }

.chat-card__more summary { cursor: pointer; color: var(--accent, #2563eb); font-size: .875rem; }
.chat-card__more .chat-card__body { display: block; margin-top: 6px; max-height: 320px; overflow: auto; }

/* a client request as one Approve card (pages/team-action-card.js): the client's words, what changes, on which devices, what is left out, Approve */
.chat-card--action { max-width: min(94%, 640px); gap: 10px; padding: 12px 14px; }
.act { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.act-label { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.act-quote { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--accent); }
.act-quote figcaption { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.act-quote figcaption .ico { width: 14px; height: 14px; flex: none; }
.act-quote blockquote { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-style: italic; line-height: 1.45; max-height: 9.5em; overflow: auto; }
.act-what { display: flex; flex-direction: column; gap: 2px; }
.act-what > span:not(.act-label) { overflow-wrap: anywhere; }
.act-devs { display: flex; flex-wrap: wrap; gap: 6px; }
.act-dev { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; border: 1px solid var(--line); font-size: .82rem; max-width: 100%; }
.act-dev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-dev .ico { width: 14px; height: 14px; flex: none; opacity: .75; }
.act-more summary, .act-out summary { cursor: pointer; color: var(--accent); font-size: .82rem; list-style: none; }
.act-more summary::-webkit-details-marker, .act-out summary::-webkit-details-marker { display: none; }
.act-more[open] summary { margin-bottom: 6px; }
.act-out summary .act-label { display: inline; margin: 0; color: var(--amber); }
.act-out summary .act-label::after { content: ' ▾'; }
.act-out:not([open]) summary .act-label::after { content: ' ▸'; }
.act-left { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.act-left li { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 8px; background: var(--amber-bg); }
.act-left__why { font-size: .82rem; font-weight: 600; }
.act-left__who { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.act-notes { margin: 0; padding-left: 18px; font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.act-why { margin: 0; font-size: .88rem; overflow-wrap: anywhere; }
.act-why .act-label { display: inline; margin-right: 4px; }
.act-result { margin: 0; display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: .88rem; }
.act-result .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.act-result--ok { background: var(--green-bg); }
.act-result--ok .ico { color: var(--green); }
.act-result--bad { background: var(--red-bg); }
.act-result--bad .ico { color: var(--red-ink); }
.act-buttons { flex-wrap: wrap; }
@media (max-width: 480px) { .act-buttons .btn { flex: 1 1 100%; justify-content: center; } .chat-card--action { max-width: 100%; } }
.alist__text .act { margin-top: 8px; }

.act-left__why::first-letter { text-transform: uppercase; }
/* the chat on a phone: fixed between the top bar and the tab bar, measured by team-chat.js fitChat (the owner: "a gap between the bottom of the chat and
   the bottom toolbar, just wasted space") */
@media (max-width: 640px) {
  .chat.chat--fit { position: fixed; left: 0; right: 0; height: auto; min-height: 0; margin: 0; border: 0; border-radius: 0; z-index: 5; }
  .ua-typing .tabbar { display: none; }
  .ua-typing .app { padding-bottom: 0; }
  .chat-compose { padding-bottom: 8px; }
  .chat-compose textarea { font-size: 16px; } /* 16 px: the phone does not zoom in when the box is tapped */
}
#chat-mic-btn, #chat-cam-btn, .wa-rec { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; -webkit-tap-highlight-color: transparent; }
.chat-compose .btn, .chat-head .btn, .chat-more, .vn__play, .vn__rate { min-width: 40px; min-height: 40px; }
@media (pointer: coarse) { .chat-compose .btn, .chat-head .btn { min-width: 44px; min-height: 44px; } .chat-more { opacity: .6; width: 36px; height: 36px; } .vn__rate { min-height: 28px; } }

/* the voice note's play button: the arrow centred in its circle (filmed off-centre on the Pixel) */
.vn__play { display: inline-grid; place-items: center; padding: 0; line-height: 1; }

/* an email the owner told a worker to send, waiting 10 seconds for Undo */
.chat-card--sending { border-color: var(--amber-line); }
.chat-card--sending .btn-row .btn { min-width: 120px; }
/* the chat on a phone, filmed on the Pixel: the mic grows while recording from its centre, a little, so it stays inside the box's padding (at 1.35 from the
   right edge it was cut off at the bottom and the screen edge) */
.chat-compose.is-recording #chat-mic-btn { transform-origin: center; }
/* locked or stopped: the bar has its own Send, so the mic steps out (its red edge showed behind Send) */
.chat-compose.is-rec-full #chat-mic-btn { visibility: hidden; }

/* ---------- the app installer (pages/app-installer.js): tiles in a grid, a sticky foot with the chosen count ---------- */
.aitools { display: flex; flex-direction: column; gap: var(--s-3); }
.aitools .searchbox { flex: none; max-width: none; }
.aigrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-2); }
.aitile { position: relative; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: border-color .12s var(--ease), background-color .12s var(--ease); }
.aitile { cursor: pointer; }
.aitile:hover { border-color: var(--line-btn); }
.aitile.is-picked { border-color: var(--accent); background: var(--selected); box-shadow: inset 0 0 0 1px var(--accent); }
.aitile.is-installed .aitile__name { color: var(--ink-2); }
.aitile__pick { display: flex; align-items: center; cursor: pointer; }
.aitile__pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.aitile__text { display: flex; flex-direction: column; min-width: 0; }
.aitile__name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; }
.aitile__pub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aitile__side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.aitile__badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.aitile__badge--ok { background: var(--green-bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--green-line); }
.aitile__badge--info { background: var(--info-bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--info-line); }
.aigroups { display: flex; flex-wrap: wrap; gap: 6px; }
.aigroup { font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.aigroup:hover { color: var(--ink); border-color: var(--muted); }
.aigroup.is-on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.aigroup:focus-visible, .aitile__pick input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.aibundles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-2); }
.aibundle { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line-soft); }
.aibundle__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.aibundle .btn { flex: none; }
.aibundle__name { font-weight: 600; }
.aibundle__sub { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aifoot { display: flex; align-items: center; gap: var(--s-2); width: 100%; }
.aifoot__count { margin-right: auto; color: var(--ink-2); font-size: 14px; }
.aifoot__count--bad { color: var(--red-ink); font-weight: 600; }
@media (max-width: 640px) { .aigroups { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s-5)); padding: 0 var(--s-5) 2px; } .aigroup { flex: none; } .aigrid { grid-template-columns: 1fr; } .aitile { grid-template-columns: auto auto 1fr; } .aitile__side { grid-column: 3; flex-direction: row; justify-content: flex-start; } }

/* ---------- New PC setup progress (pages/device-software.js): a bar, the steps in order, and the checklist when nothing is left to run ---------- */
.supanel { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); background: var(--surface); }
.supanel.is-live { border-color: var(--info-line); }
.supanel.is-done { border-color: var(--green-line); }
.supanel.is-bad { border-color: var(--red-line); }
.supanel__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2); }
.subar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--sunk); overflow: hidden; color: var(--accent); }
.subar::-webkit-progress-bar { background: var(--sunk); border-radius: 999px; }
.subar::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width .4s var(--ease); }
.subar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.supanel.is-done .subar::-webkit-progress-value { background: var(--green); }
.supanel.is-done .subar::-moz-progress-bar { background: var(--green); }
.susteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sustep { display: grid; grid-template-columns: 24px 1fr auto auto; align-items: center; gap: var(--s-3); padding: 8px 0; border-top: 1px solid var(--line-soft); }
.sustep:first-child { border-top: 0; }
.sustep__mark { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sunk); color: var(--muted); }
.sustep--done .sustep__mark { background: var(--green-bg); color: var(--green); box-shadow: inset 0 0 0 1px var(--green-line); }
.sustep--failed .sustep__mark { background: var(--red-bg); color: var(--red); box-shadow: inset 0 0 0 1px var(--red-line); }
.sustep__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.sustep__spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--info-line); border-top-color: var(--accent); animation: suspin .9s linear infinite; }
@keyframes suspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sustep__spin { animation: none; } .subar::-webkit-progress-value { transition: none; } }
.sustep__text { display: flex; flex-direction: column; min-width: 0; }
.sustep__name { font-weight: 600; }
.sustep--waiting .sustep__name { color: var(--ink-2); font-weight: 500; }
.sustep__msg { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sucheck { list-style: none; margin: 0; padding: var(--s-3) 0 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sucheck li { display: flex; align-items: flex-start; gap: 8px; }
.sucheck li .ico { color: var(--green); flex: none; margin-top: 2px; }
.sucheck--warn .ico { color: var(--amber) !important; }
@media (max-width: 640px) { .sustep { grid-template-columns: 24px 1fr; } .sustep > .status, .sustep > .btn { grid-column: 2; justify-self: start; } }
.sutbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.sutbl th, .sutbl td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.sutbl thead th { border-top: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.sutbl tbody th { font-weight: 600; }
.sutbl select { min-width: 200px; max-width: 280px; }
.sutbl .check--switch { margin: 0; }

.field__control--sm { height: 36px; padding-top: 0; padding-bottom: 0; font-size: 14px; }
