/* Beekon console — the visual language (D176's rebuild).
 *
 * Poppins for every word, DM Sans for every figure (Poppins has no tabular
 * digits), the system monospace for ids. Graphite ink on a cool ground,
 * hairline dividers, and one signal colour — Beekon amber — for live state,
 * trend lines and the mark, never for text. Light and dark follow the OS
 * unless the operator picks one (html[data-theme], lib/theme.js).
 */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/dm-sans.woff2") format("woff2"); }

:root {
  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --line: #E3E6EC;
  --line-strong: #CBD1DA;
  --ink: #111827;
  --ink-2: #3F4A5A;
  --ink-3: #5B6676;
  --hover: #ECEFF4;
  --ok: #0F7A50; --ok-dot: #18A66A; --ok-bg: #E6F6EE;
  --warn: #9A4A00; --warn-dot: #E58A00; --warn-bg: #FFF2DF;
  --bad: #B42318; --bad-dot: #E5483B; --bad-bg: #FDECEA;
  --focus: #1D5FD1;
  --accent: #F59E0B;
  --shadow: 0 1px 2px rgba(17, 24, 39, .06), 0 1px 1px rgba(17, 24, 39, .04);
  --pop: 0 14px 36px rgba(17, 24, 39, .14), 0 2px 6px rgba(17, 24, 39, .06);
  --row: 36px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 120ms;
  --t-base: 180ms;
  --t-slow: 240ms;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "DM Sans", "Poppins", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0E12; --surface: #13171D; --line: #242A33; --line-strong: #333B46;
    --ink: #EAEDF2; --ink-2: #B4BCC8; --ink-3: #8F99A6; --hover: #1C222A;
    --ok: #5FE0A6; --ok-dot: #2FCB86; --ok-bg: #10291F;
    --warn: #F7B866; --warn-dot: #F59E0B; --warn-bg: #2B2012;
    --bad: #FF8F85; --bad-dot: #F2564A; --bad-bg: #2E1513;
    --focus: #7FAAFF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --pop: 0 16px 40px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0E12; --surface: #13171D; --line: #242A33; --line-strong: #333B46;
  --ink: #EAEDF2; --ink-2: #B4BCC8; --ink-3: #8F99A6; --hover: #1C222A;
  --ok: #5FE0A6; --ok-dot: #2FCB86; --ok-bg: #10291F;
  --warn: #F7B866; --warn-dot: #F59E0B; --warn-bg: #2B2012;
  --bad: #FF8F85; --bad-dot: #F2564A; --bad-bg: #2E1513;
  --focus: #7FAAFF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --pop: 0 16px 40px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; margin: 0; padding: 0; cursor: pointer; }
a { color: var(--focus); }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 6px; }
/* The router moves focus to the page heading for screen readers; no ring. */
h1[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }

.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; z-index: 50; padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--surface); }
.skip:focus { top: 8px; }
kbd { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }

/* ---- the shell ------------------------------------------------------------ */

.shell { display: flex; min-height: 100vh; }
.shell-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.outlet { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---- the task bar ---------------------------------------------------------- */

.taskbar {
  flex: 0 0 236px; width: 236px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
}
.taskbar.is-collapsed { flex-basis: 60px; width: 60px; }
.tb-brand { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.tb-brand svg { flex: none; }
.tb-brand b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.tb-brand span { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.taskbar.is-collapsed .tb-brand { justify-content: center; padding: 0; }
.tb-scroll { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.tb-foot { flex: none; padding: 8px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.tb-group { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 6px; }
.tb-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.tb-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: var(--row); padding: 0 10px;
  border-radius: 8px; border: 1px solid transparent;
  color: var(--ink-2); font-weight: 500; text-align: left; text-decoration: none;
}
.tb-item svg { flex: none; }
.tb-item:hover { background: var(--hover); color: var(--ink); }
.tb-item[aria-current="page"] { background: var(--bg); border-color: var(--line-strong); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.tb-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-meta { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.tb-alert { font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 1px 7px; }
.tb-meta:empty, .tb-alert:empty { display: none; }
.tb-dot { display: none; position: absolute; top: 7px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn-dot); box-shadow: 0 0 0 2px var(--surface); }
.taskbar.is-collapsed .tb-item { justify-content: center; padding: 0; }
.taskbar.is-collapsed .tb-label,
.taskbar.is-collapsed .tb-meta,
.taskbar.is-collapsed .tb-alert,
.taskbar.is-collapsed .tb-group,
.taskbar.is-collapsed .tb-brand-words,
.taskbar.is-collapsed .tb-kbd,
.taskbar.is-collapsed .meter-card { display: none; }
.taskbar:not(.is-collapsed) .tb-sep { display: none; }
.taskbar.is-collapsed .tb-alert:not(:empty) + .tb-dot { display: block; }

.meter-card { margin: 4px 2px 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; gap: 7px; }
.meter-card .meter-title { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.meter-card .meter-value { margin-top: -4px; font-size: 12px; color: var(--ink-3); }
.meter-card .meter-value b { font-size: 15px; font-weight: 600; color: var(--ink); }
.meter-card .meter-note { font-size: 11px; color: var(--ink-3); }
.meter { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.meter.is-warn > span { background: var(--warn-dot); }
.meter.is-bad > span { background: var(--bad-dot); }

/* ---- the global bar -------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 56px; flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px 0 10px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.scope { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 0 1 auto; }
.scope-sep { color: var(--line-strong); font-size: 18px; font-weight: 300; padding: 0 2px; }
.switch { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border-radius: 8px; min-width: 0; white-space: nowrap; }
.switch:hover, .switch[aria-expanded="true"] { background: var(--hover); }
.switch .name { overflow: hidden; text-overflow: ellipsis; }
.switch > svg { flex: none; }
.org-badge { width: 24px; height: 24px; flex: none; border-radius: 7px; background: var(--ink); color: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--ink-2); background: var(--bg); }
.chip-warn { border-color: transparent; color: var(--warn); background: var(--warn-bg); font-size: 11px; font-weight: 600; border-radius: 999px; padding: 0 7px; }

.search-wrap { position: relative; flex: 1 1 240px; max-width: 520px; margin: 0 auto; }
.search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink-3); }
.search:focus-within { border-color: var(--focus); background: var(--surface); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { display: none; }

.topbar-right { display: flex; align-items: center; gap: 4px; flex: none; }
.topbar-said { font-size: 12px; color: var(--bad); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vsep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.iconbtn { position: relative; width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-2); }
.iconbtn:hover, .iconbtn[aria-expanded="true"] { background: var(--hover); color: var(--ink); }
.badge { position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--warn-dot); color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center; }
.avatar[aria-expanded="true"] { border-color: var(--ink-3); background: var(--surface); }
.avatar:focus-visible { outline-offset: 2px; border-radius: 50%; }
.avatar { width: 34px; height: 34px; margin-left: 4px; flex: none; border-radius: 50%; background: var(--hover); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; color: var(--ink); }

/* A fixed width: its words change as figures land, and the search box beside
 * it must not move. */
.status { width: 284px; flex: none; overflow: hidden; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; font-weight: 500; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok-dot); }
.status .sub { color: var(--ink-3); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.status.is-warn { border-color: transparent; background: var(--warn-bg); color: var(--warn); }
.status.is-warn .dot { background: var(--warn-dot); }
.status.is-warn .sub, .status.is-bad .sub { color: inherit; }
.status.is-bad { border-color: transparent; background: var(--bad-bg); color: var(--bad); }
.status.is-bad .dot { background: var(--bad-dot); }
.status.is-idle { color: var(--ink-3); }
.status.is-idle .dot { background: transparent; border: 1.5px solid var(--ink-3); }
/* A narrower window (task bar open, under ~1100 px): the ingest pill keeps its
 * word and drops the detail (still in its label and on its page), so the
 * global bar fits without a sideways scroll. */
@media (max-width: 1100px) {
  .status { width: auto; }
  .status .sub { display: none; }
  .search-wrap { min-width: 0; }
}
/* Narrower still, under 1080 px (and on a phone, where the task bar does not show
 * Organisation): the organisation shows its badge only (its name is in the
 * button's label, tooltip and menu), and search is a button that lays the box
 * over the bar, so the project's name keeps its room. */
@media (max-width: 1080px) {
  .org-switch { padding: 0 5px; }
  .org-switch .name, .org-switch > svg { display: none; }
  .search-wrap { display: none; }
  .topbar .search-open { display: inline-flex; }
  .topbar.is-searching .search-wrap { display: block; position: absolute; top: 10px; left: 6px; right: 6px; max-width: none; margin: 0; z-index: 3; box-shadow: 0 0 0 10px var(--surface); }
}

/* ---- menus ----------------------------------------------------------------- */
/* One pattern for every menu that opens from the header: a title row, rows with
 * a 28 px lead, a label over a second line and a check on the current one, and
 * information as a muted footer rather than a row that looks clickable. */

.pop {
  position: fixed; z-index: 40;
  width: 300px; max-width: calc(100vw - 16px);
  max-height: min(70vh, 560px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop);
  padding: 6px;
}
.menu-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 8px 4px; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.menu-head .num { font-weight: 500; color: var(--ink-3); }
.menu-rows { display: flex; flex-direction: column; gap: 2px; }
.menu-filter { display: flex; align-items: center; gap: 8px; height: 34px; margin: 2px 4px 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink-3); }
.menu-filter:focus-within { border-color: var(--focus); background: var(--surface); }
.menu-filter input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); }
.menu-empty { padding: 14px 10px; color: var(--ink-3); font-size: 12.5px; }
.menu-empty.is-ok { display: flex; align-items: center; gap: 10px; color: var(--ok); font-weight: 500; }
.menu-id { display: flex; align-items: center; gap: 12px; padding: 10px; }
.menu-foot { display: flex; align-items: center; gap: 8px; padding: 6px 10px 8px; font-size: 12px; color: var(--ink-3); }
.menu-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.menu-foot .dot.is-ok { background: var(--ok-dot); }
.menu-foot .dot.is-warn { background: var(--warn-dot); }
.menu-foot .dot.is-bad { background: var(--bad-dot); }
.pop-sep { height: 1px; background: var(--line); margin: 6px -6px; }
.avatar-lg { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--hover); border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--ink); }

.mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border-radius: 8px; text-align: left; color: var(--ink); text-decoration: none; }
.mi:hover, .mi:focus-visible, .mi.is-hi { background: var(--hover); outline: none; }
.mi.is-on { background: var(--bg); }
.mi.is-on .mi-label { font-weight: 600; }
.mi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mi-label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-sub { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-sub.is-wrap { white-space: normal; }
.mi-warn { color: var(--warn); }
.mi.is-danger, .mi.is-danger .mi-label { color: var(--bad); }
.mi-check { flex: none; display: inline-flex; color: var(--ink); }
.mi-icon { width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); }
.mi-tile { width: 28px; height: 28px; flex: none; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--hover); color: var(--ink-2); border: 1px solid var(--line); }
.mi-tile.is-ink { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.mi-tile.is-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.mi-tile.is-bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.mi .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mi-empty { padding: 10px; color: var(--ink-3); }
/* Compact rows (the switchers): one line, a 20 px avatar, meta on the right,
 * a fixed check column so names line up, and no fill on the current row. */
.mi.is-compact { min-height: 34px; padding: 5px 8px; gap: 10px; }
.mi.is-compact.is-on { background: none; }
.mi.is-compact.is-on:hover, .mi.is-compact.is-on:focus-visible { background: var(--hover); }
.mi.is-compact .mi-label { font-weight: 500; }
.mi.is-compact.is-on .mi-label { font-weight: 600; }
.mi.is-compact .mi-check { width: 15px; justify-content: center; }
.mi-avatar { width: 20px; height: 20px; flex: none; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 600; background: var(--hover); color: var(--ink-2); border: 1px solid var(--line); }
.mi-avatar.is-ink { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.mi-icon-sm { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); }
.mi-meta { flex: none; font-size: 12px; color: var(--ink-3); }

/* The bell's alerts: each row a link to the page that lists the problem, with
 * a Clear (×) on its right; Clear all in the title row. */
.al-row { display: flex; align-items: center; gap: 2px; }
.al-row > .mi { flex: 1; min-width: 0; }
.al-row .mi-label { white-space: normal; }
.al-x { width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; color: var(--ink-3); }
.al-x:hover, .al-x:focus-visible { background: var(--hover); color: var(--ink); }
.al-head-end { display: inline-flex; align-items: baseline; gap: 8px; }
.al-all { padding: 1px 6px; margin: -1px -6px -1px 0; border-radius: 6px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.al-all:hover, .al-all:focus-visible { background: var(--hover); color: var(--ink); }
.menu-empty.is-quiet { color: var(--ink-2); font-weight: 400; }
.menu-empty.is-quiet svg { color: var(--ok); flex: none; }

/* The account menu's theme: System · Light · Dark. */
.menu-theme { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px 4px 10px; }
.menu-theme .mi-label { flex: 1; }
.menu-theme-segs .seg { height: 26px; padding: 0 8px; font-size: 12.5px; }

/* The phone's search button (the box itself has no room there). */
.search-open { display: none; }

/* ---- the page header -------------------------------------------------------- */

.page-head { padding: 12px 10px 10px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
/* A sticky page header (settings pages): pinned under the global bar at one
 * fixed size; once stuck it only gains a hairline shadow, instantly. (It
 * used to go compact, which shifted the page under the cursor by the
 * height it lost and could flicker at the threshold.) */
.page-head.is-sticky { position: sticky; top: 56px; z-index: 15; }
.page-head.is-sticky.is-stuck { box-shadow: 0 1px 0 var(--line), 0 6px 16px -10px rgba(17, 24, 39, .18); }
.page-head-sentinel { height: 1px; margin-bottom: -1px; }
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.page-title-block { flex: 1 1 260px; min-width: 0; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-3); }
.page-title-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.page-title-row .page-title { margin-top: 0; }
.page-title { margin-top: 2px; font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -.01em; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-2); }
.btn-block { width: 100%; justify-content: center; height: 40px; }

.segs { position: relative; display: inline-flex; gap: 2px; padding: 3px; background: var(--hover); border-radius: 9px; }
.seg { position: relative; z-index: 1; height: 28px; padding: 0 10px; border-radius: 6px; color: var(--ink-2); font-weight: 500; }
.seg:hover { color: var(--ink); }
.seg[aria-pressed="true"] { color: var(--ink); }
/* Without the thumb (before it is placed, or with no layout yet) the chosen
 * option carries the raised look itself. */
.segs:not(.has-thumb) .seg[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); }
.seg-thumb {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0;
  border-radius: 6px; background: var(--surface); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: transform var(--t-slow) var(--ease), width var(--t-slow) var(--ease);
}
.segs.is-instant .seg-thumb { transition: none; }

.live { gap: 8px; }
.live svg { color: var(--ink-3); }
.live[aria-pressed="true"] svg { color: var(--accent); }
.live .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); animation: bk-pulse 1.8s ease-in-out infinite; }
.live .paused { width: 8px; height: 8px; border-radius: 2px; background: var(--ink-3); }
.live .sub { color: var(--ink-3); font-weight: 400; }
@keyframes bk-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); } }

.schips { display: flex; flex-wrap: wrap; gap: 8px; }
.schip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; white-space: nowrap; color: var(--ink); text-decoration: none; }
.schip:hover { background: var(--hover); }
.schip[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.schip .dot { width: 8px; height: 8px; border-radius: 50%; }
.schip .count { color: var(--ink-3); font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters .note { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* ---- the number strip --------------------------------------------------------- */

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.kpi { padding: 12px 14px 11px; display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); color: inherit; text-decoration: none; }
.kpi:first-child { border-left: 0; }
a.kpi:hover { background: var(--bg); }
.kpi-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; height: 18px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.kpi-head > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.kpi-win { flex: none; font-size: 11px; font-weight: 500; }
.kpi-val { display: flex; align-items: baseline; gap: 8px; height: 34px; white-space: nowrap; overflow: hidden; }
.kpi-n { font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 34px; }
.kpi-ctx { font-size: 12px; color: var(--ink-3); }
.kpi-vis { height: 28px; display: flex; align-items: flex-end; margin-top: 2px; }
.kpi-vis > * { width: 100%; }
.kpi-foot { height: 18px; margin-top: 6px; font-size: 11px; line-height: 18px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 5px; }
.delta { font-size: 12px; font-weight: 600; border-radius: 4px; padding: 0 5px; }
.delta.is-ok { color: var(--ok); background: var(--ok-bg); }
.delta.is-bad { color: var(--bad); background: var(--bad-bg); }
.delta.is-flat { color: var(--ink-3); background: var(--hover); }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); }
.bar > span { display: block; height: 100%; }
.spark { display: block; width: 100%; height: 28px; }
.kpi-attn.has-items { background: var(--warn-bg); }
.kpi-attn.has-items .kpi-head { color: var(--warn); }
.kpi-attn.has-items .kpi-head > span:first-child { font-weight: 600; }
.kpi-foot.is-warn { color: var(--warn); }
.attn-list { display: flex; flex-direction: column; justify-content: space-between; flex: 1; margin-top: 4px; }
.attn-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; height: 20px; font-size: 12px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.attn-list a:hover span { text-decoration: underline; }
.attn-list b { font-weight: 600; }
.attn-clear { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 500; }
.kpi.is-loading .kpi-n, .kpi.is-loading .kpi-foot { color: transparent; background: var(--hover); border-radius: 4px; }

@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(3n + 1) { border-left: 0; }
  .kpi:nth-child(n + 4) { border-top: 1px solid var(--line); }
}

/* ---- page bodies -------------------------------------------------------------- */

/* Tight outer spacing (developer, 2026-10-29): the cards sit 8–10 px from the shell, 10 px apart, the header aligned with them. */
.content { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 10px; }
.empty { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--ink-3); background: var(--surface); }
.empty b { color: var(--ink); font-weight: 600; font-size: 14px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); }

/* ---- buttons, pills, cards (shared) ----------------------------------------- */

.btn-sm { height: 30px; padding: 0 10px; }
.btn-danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 85%, #000); }
/* Dark: --bad is a light red there, so white on it is ~2.2:1; dark ink is ~8.7:1. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger { color: #1B0A08; } }
:root[data-theme="dark"] .btn-danger { color: #1B0A08; }
.btn-light { background: var(--surface); color: var(--ink); border-color: var(--surface); }
.btn-light:hover { background: var(--hover); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill-live { background: var(--ok-bg); color: var(--ok); }
.pill-custom { background: var(--hover); color: var(--ink-2); }
.pill-edit { background: var(--edit-bg); color: var(--edit); border: 1px solid color-mix(in srgb, var(--edit) 30%, transparent); }
.grow { flex: 1; min-width: 0; }
.sw-empty { background: var(--hover); border: 1px solid var(--line-strong); }

/* ---- modal ------------------------------------------------------------------- */

.modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(17, 24, 39, .38); animation: bk-fade var(--t-base) var(--ease); overflow: auto; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--pop); overflow: hidden; animation: bk-pop var(--t-base) var(--ease); }
/* The side sheet: full height on the right, sliding in. */
.modal-wrap.is-sheet { padding: 0; justify-content: flex-end; align-items: stretch; overflow: hidden; }
.modal.is-sheet { height: 100vh; border-radius: 0; border-width: 0 0 0 1px; display: flex; flex-direction: column; animation: bk-sheet var(--t-slow) var(--ease); }
@keyframes bk-sheet { from { transform: translateX(24px); opacity: 0; } }
.sheet-head { display: flex; align-items: flex-start; gap: 8px; padding: 20px 20px 16px 24px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 16px; font-weight: 600; }
.sheet-head p { margin-top: 4px; color: var(--ink-3); font-size: 12.5px; }
.sheet-code { flex: 1; margin: 0; padding: 20px 24px; overflow: auto; background: var(--bg); line-height: 1.65; color: var(--ink-2); }
.modal-head { padding: 22px 24px 14px; }
.modal-head h2 { font-size: 18px; font-weight: 600; }
.modal-head p { margin-top: 4px; color: var(--ink-3); }
.modal-body { padding: 0 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 18px 24px 20px; }
.modal-foot .muted { font-size: 12px; }

/* ---- settings pages (Remote config) ------------------------------------------
 * The settings layout the common dashboards share (Vercel, GitHub; shadcn/ui's
 * Card and Form): a sticky section nav, one column of cards no wider than a
 * form wants, each card a header, its fields (label, control, description,
 * message) and a muted footer with a hint and that card's Save. */

:root { --edit: #1D5FD1; --edit-bg: #EAF1FD; }
/* Fences on a map: honey (D73), darkened in light mode so the edge holds 3:1 on the basemap. */
:root { --fence: #B26B0F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --fence: #F0B04A; } }
:root[data-theme="dark"] { --fence: #F0B04A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --edit: #8DB4FF; --edit-bg: #16233A; } }
:root[data-theme="dark"] { --edit: #8DB4FF; --edit-bg: #16233A; }

/* Nav, the settings, and on wide screens a sticky rail with rollout and
 * history, together filling the width; below 1,440 px the rail drops under
 * the settings. */
.set-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(320px, 420px); gap: 16px; padding: 8px 10px 16px; align-items: start; }
.set-rail { position: sticky; top: calc(56px + var(--page-head-h, 64px) + 24px); display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.set-rail .set-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.set-rail .set-card-footer { flex-wrap: wrap; }
@media (max-width: 1440px) {
  .set-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .set-rail { grid-column: 2; position: static; }
  .set-rail .set-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.set-aside { position: sticky; top: calc(56px + var(--page-head-h, 64px) + 24px); }
.set-nav { display: flex; flex-direction: column; gap: 2px; }
.set-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 34px; padding: 0 12px; border-radius: 8px; color: var(--ink-3); text-decoration: none; font-weight: 500; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.set-nav a:hover { color: var(--ink); background: var(--hover); }
.set-nav a.is-on { color: var(--ink); background: var(--hover); }
@media (min-width: 1441px) { .set-nav .set-nav-rail { display: none; } }
.set-nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--edit); }
.set-column { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.set-loading { padding: 40px; text-align: center; color: var(--ink-3); }

.set-card { container-type: inline-size; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; scroll-margin-top: calc(56px + var(--page-head-h, 64px) + 16px); transition: border-color var(--t-base) var(--ease); }
.set-card.is-dirty { border-color: color-mix(in srgb, var(--edit) 45%, var(--line)); }
.set-card-head { padding: 20px 24px 0; }
.set-card-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -.005em; }
.set-card-head p { margin-top: 4px; color: var(--ink-3); }
.set-card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.set-card-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 22px; }
.set-card-body-flush { padding: 16px 0 0; gap: 0; }
.set-card-body-flush .set-empty { padding: 0 24px 24px; }
.set-card-footer { display: flex; align-items: center; gap: 10px; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--bg); }
.set-footer-hint { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-3); }
.set-footer-hint.is-dirty { color: var(--edit); font-weight: 500; }
.set-footer-hint.is-error { color: var(--bad); font-weight: 500; }

.set-field { display: flex; flex-direction: column; gap: 8px; }
.set-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.set-label { font-weight: 500; color: var(--ink); }
/* The control, and beside it a quiet Reset (a ghost text button) when the
 * value is not the default. */
.set-control { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.set-reset { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); background: none; border: 0; cursor: pointer; white-space: nowrap; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.set-reset:hover { color: var(--ink); background: var(--hover); }
.set-reset[hidden] { display: none; }
.set-desc { font-size: 12.5px; color: var(--ink-3); }
.set-message { font-size: 12.5px; font-weight: 500; color: var(--bad); }
.set-input { display: flex; align-items: center; width: 240px; max-width: 100%; height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); overflow: hidden; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.set-input:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.set-input.is-invalid { border-color: var(--bad-dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad-dot) 15%, transparent); }
.set-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; padding: 0 12px; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 14px; }
.set-input input[type="text"] { font-family: var(--font-mono); font-size: 13px; }
.set-input input:disabled { color: var(--ink-2); }
.set-unit { padding: 0 12px; height: 100%; display: flex; align-items: center; border-left: 1px solid var(--line); background: var(--bg); color: var(--ink-3); font-size: 12px; }
.set-inline { display: flex; gap: 8px; align-items: center; }
/* A wide card lays each setting out as a row: what it is on the left, the
 * control on the right (the GitHub / Stripe settings row). */
@container (min-width: 720px) {
  .set-field:not(.set-switch-row) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 40px; row-gap: 6px;
    grid-template-areas: "label control" "desc control" "desc msg";
    align-items: start;
  }
  .set-field:not(.set-switch-row) > .set-label-row { grid-area: label; }
  /* Every control ends at the card's right edge, as the switches do; Reset
   * sits to its left so the controls line up. */
  .set-field:not(.set-switch-row) > :nth-child(2) { grid-area: control; justify-self: end; flex-wrap: nowrap; }
  .set-field:not(.set-switch-row) > .set-desc { grid-area: desc; max-width: 640px; }
  .set-field:not(.set-switch-row) > .set-message { grid-area: msg; justify-self: end; }
  .set-card-body { gap: 0; padding-top: 8px; padding-bottom: 8px; }
  .set-card-body > .set-field, .set-flags > .set-field { padding: 16px 0; border-top: 1px solid var(--line); }
  .set-card-body > .set-field:first-child { border-top: 0; }
  .set-card-body > .set-switch-row, .set-flags > .set-switch-row { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 16px 0; }
  .set-card-body > .set-switch-row:first-child { border-top: 0; }
  .set-flags { gap: 0; border-top: 1px solid var(--line); }
}
.set-switch-row { flex-direction: row; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; }
.set-switch-row .set-desc { margin-top: 2px; }
.set-flags { display: flex; flex-direction: column; gap: 12px; }
.set-empty { color: var(--ink-3); }
/* A card's explainer, above its settings: what they mean in words (Filters:
 * what a gated location is; Trips: when a trip ends, quoting the values). */
.set-explain { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.set-explain h3 { font-size: 13px; font-weight: 600; color: var(--ink); }
.set-explain dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.set-explain dt { font-weight: 500; color: var(--ink); }
.set-explain dd { margin: 0; }
@container (max-width: 520px) {
  .set-explain dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .set-explain dd { margin-bottom: 8px; }
  .set-explain dd:last-child { margin-bottom: 0; }
}
@container (min-width: 720px) {
  .set-card-body > .set-explain { margin: 12px 0 8px; }
  .set-card-body > .set-explain + .set-field { border-top: 0; }
}

.cfg-select {
  appearance: none; -webkit-appearance: none;
  width: 240px; max-width: 100%; height: 36px; padding: 0 36px 0 12px;
  border: 1px solid var(--line-strong); border-radius: 8px; background-color: var(--surface); color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B6676' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  cursor: pointer; outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.cfg-select:hover { border-color: var(--ink-3); }
.cfg-select:focus-visible { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.cfg-select:disabled { background-color: var(--bg); color: var(--ink-2); cursor: default; }
.cfg-segs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--hover); border-radius: 9px; align-self: flex-start; }
.cfg-segs .seg { height: 30px; padding: 0 12px; }
.cfg-segs .seg[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.cfg-segs .seg:disabled { cursor: default; }
.cfg-switch { position: relative; width: 40px; height: 24px; flex: none; border-radius: 12px; background: var(--line-strong); transition: background-color var(--t-base) var(--ease); }
.cfg-switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform var(--t-base) var(--ease); }
.cfg-switch[aria-checked="true"] { background: var(--ink); }
/* On, the track is ink, so the knob takes the surface colour: white on a dark
 * track in the light theme, dark on a light track in the dark theme. */
.cfg-switch[aria-checked="true"] span { transform: translateX(16px); background: var(--surface); box-shadow: none; }
.cfg-switch:disabled { opacity: .6; cursor: default; }

.set-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.set-alert b { display: block; color: var(--ink); font-weight: 600; }
.set-alert svg { flex: none; margin-top: 2px; }
.set-alert.is-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn-dot) 35%, transparent); color: var(--warn); }
.set-alert.is-warn b { color: inherit; }
.set-banners { scroll-margin-top: calc(56px + var(--page-head-h, 64px) + 16px); display: flex; flex-direction: column; gap: 12px; }
.set-banners:empty { display: none; }

.set-stat { font-size: 28px; font-weight: 700; letter-spacing: -.01em; line-height: 1; }
.set-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.set-stats div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.set-stats dt { font-size: 12px; color: var(--ink-3); }
.set-stats dd { margin: 4px 0 0; font-size: 18px; font-weight: 600; }

.set-table-wrap { overflow-x: auto; }
.set-table-boxed { border: 1px solid var(--line); border-radius: 10px; }
.set-table { width: 100%; border-collapse: collapse; }
.set-table th { text-align: left; padding: 10px 16px; font-size: 12px; font-weight: 500; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.set-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.set-table tbody tr:last-child td { border-bottom: 0; }
.set-table tbody tr:hover { background: var(--bg); }
.set-card .set-table th:first-child, .set-card .set-table td:first-child { padding-left: 24px; }
.set-card .set-table th:last-child, .set-card .set-table td:last-child { padding-right: 24px; }
.set-table .is-right { text-align: right; }
/* Revision history: an activity timeline made of the console's own pieces
 * (.mi-avatar, .cfg-rev, .pill-live); a hairline joins the avatars. */
.tl { list-style: none; margin: 0; padding: 4px 24px 16px; }
.tl-item { position: relative; display: flex; gap: 12px; padding: 10px 0; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 34px; bottom: -6px; width: 1px; background: var(--line); }
.tl-avatar { margin-top: 1px; }
.tl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-line { display: flex; align-items: center; gap: 10px; }
.tl-text { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.tl-text b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tl-time { flex: none; font-size: 12px; color: var(--ink-3); }
.tl-sections { font-size: 12.5px; color: var(--ink-3); }
.tl-devices { color: var(--ink-2); }
.cfg-rev { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--hover); font-size: 12px; font-weight: 600; }
.cfg-rev.is-live { background: var(--ok-bg); color: var(--ok); }
.cfg-old { color: var(--ink-3); text-decoration: line-through; }
.cfg-new { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--edit-bg); color: var(--edit); font-weight: 600; }
.set-code-unused { margin: 16px 0 0; padding: 16px 24px 20px; max-height: 420px; overflow: auto; border-top: 1px solid var(--line); background: var(--bg); line-height: 1.6; color: var(--ink-2); }

.btn-ghost { border-color: transparent; background: none; }
.btn-ghost:hover { background: var(--hover); }
/* A quiet destructive action (Delete… beside a form's or a panel's buttons). */
.btn-danger-text, .btn-danger-text:hover { color: var(--bad); }
/* The smallest button: inline with a meta line (Copy beside an id). */
.btn-xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 6px; gap: 5px; }

/* A toast, bottom right (Sonner's place). */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 70; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--pop); font-weight: 500; animation: bk-rise var(--t-slow) var(--ease); }
.toast svg { color: var(--ok-dot); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
@keyframes bk-rise { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 960px) {
  .set-aside { display: none; }
  .set-layout { grid-template-columns: minmax(0, 1fr); padding: 6px 6px 16px; }
  .set-rail { grid-column: 1; }
  .set-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- sign-in, invitation, boot ----------------------------------------------
 * One card centred both ways on the page ground (SI-1): 400 px (the invitation
 * 440), 16 px radius, a hairline border and no shadow, like every card. The
 * theme button sits top right. boot.js's own failure uses a bare main.auth, so
 * .auth also stands alone. */

.auth-page { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 72px 16px 48px; }
.auth-top { position: absolute; top: 12px; right: 12px; }
.auth { width: min(400px, calc(100vw - 32px)); margin: 12vh auto 40px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.auth-page > .auth { width: 100%; max-width: 400px; margin: 0; }
.auth-page > .auth.is-wide { max-width: 440px; }
.auth h1 { font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -.01em; }
.auth h1[tabindex="-1"]:focus { outline: none; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
/* boot.js's Reload, a bare button. */
.auth > button:not([class]) { height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 500; align-self: flex-start; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.auth-brand b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.auth-brand span { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.auth-alert { display: flex; flex-direction: column; gap: 8px; }
.auth-alert p { color: var(--ink-2); }
.auth-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.auth-muted { color: var(--ink-3); }
.auth-foot { font-size: 12px; color: var(--ink-3); }
.auth-foot a, .auth-note a { font-weight: 500; text-decoration: none; }
.auth-foot a:hover, .auth-note a:hover { text-decoration: underline; }
/* Why you're here (SI-2): neutral, or warn. */
.auth-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.auth-note > svg { flex: none; margin-top: 1px; color: var(--ink-3); }
.auth-note b { display: block; color: var(--ink); font-weight: 600; font-size: 13px; }
.auth-note p + p { margin-top: 2px; }
.auth-note .sub { color: var(--ink-3); }
.auth-note.is-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn-dot) 35%, transparent); color: var(--warn); }
.auth-note.is-warn > svg, .auth-note.is-warn b, .auth-note.is-warn .sub { color: var(--warn); }
/* A form's band (role=alert): a refusal, or an info switch on the invitation. */
.band { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--bad-bg); color: var(--bad); font-size: 13px; overflow-wrap: anywhere; }
.band[hidden] { display: none; }
.band > svg { flex: none; margin-top: 1px; }
.band.is-info { background: var(--edit-bg); color: var(--edit); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field-opt { color: var(--ink-3); font-weight: 400; }
.field input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); outline: none; }
.field input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--bad-dot); }
form[aria-busy="true"] .field input { background: var(--bg); color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--ink-3); }
.field-error { font-size: 12px; color: var(--bad); }
/* Show password (SI-5): a 32 px button inside the input's box. */
.pw { position: relative; }
.pw input { padding-right: 44px; }
.reveal { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); }
.reveal:hover { background: var(--hover); color: var(--ink); }
.reveal[aria-pressed="true"] { color: var(--ink); }
.reveal:disabled { opacity: .5; cursor: default; background: none; }
/* Caps Lock (SI-6): warn ink, no icon, gone while empty. */
.caps { font-size: 12px; color: var(--warn); font-weight: 500; }
.caps:empty { display: none; }
/* "Join <org>" carries the organisation's name, which can be long: the block
 * button wraps rather than spilling out of the card (.btn is nowrap). */
.auth .btn-block { font-weight: 600; white-space: normal; height: auto; min-height: 40px; padding-block: 8px; text-align: center; overflow-wrap: anywhere; }
.auth .btn-block:disabled { opacity: .7; }
.spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 35%, transparent); border-top-color: currentColor; animation: bk-spin .8s linear infinite; }
@keyframes bk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
.linkbtn { align-self: flex-start; color: var(--edit); font-weight: 500; font-size: 12.5px; text-align: left; border-radius: 4px; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn:disabled { opacity: .55; cursor: default; text-decoration: none; }
/* The invitation's summary (IN-2). */
.inv { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); min-width: 0; }
.inv-org { display: flex; align-items: center; gap: 12px; min-width: 0; }
.inv-org > div { min-width: 0; overflow-wrap: anywhere; }
.inv-org b { display: block; font-size: 15px; font-weight: 600; }
.inv-org p { font-size: 12.5px; color: var(--ink-2); }
.org-badge.is-lg { width: 36px; height: 36px; border-radius: 9px; font-size: 15px; }
.inv-dl { margin: 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.inv-dl > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.inv-dl dt { font-size: 12px; color: var(--ink-3); }
.inv-dl dd { margin: 0; font-size: 12.5px; color: var(--ink); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; overflow-wrap: anywhere; }
.inv-desc { flex-basis: 100%; color: var(--ink-3); font-size: 12px; }
.inv-fields { display: flex; flex-direction: column; gap: 14px; }
.inv-checking { display: flex; flex-direction: column; gap: 14px; }
.inv-skel-badge { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.inv-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.pill-warn { gap: 6px; background: var(--warn-bg); color: var(--warn); }
.pill-warn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn-dot); }
/* Phone (SI-10): the card near the top, so a keyboard doesn't cover the first
 * field; 44 px inputs and buttons. */
@media (max-width: 520px) {
  .auth-page { justify-content: flex-start; padding: 64px 16px 32px; }
  .auth-page > .auth { padding: 24px; gap: 18px; }
  .auth-top { top: 10px; right: 10px; }
  .field input { height: 44px; }
  .auth .btn-block { min-height: 44px; }
  .reveal { top: 6px; }
}
.boot-frame { min-height: 100vh; display: flex; }
.boot-frame .taskbar { position: static; }

/* ---- small screens: the task bar becomes a bottom tab bar -------------------- */

/* ---- the devices list (views/devices.js) ---- */
.dvl-segs { flex-wrap: wrap; }
.dvl-segs .seg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dvl-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dvl-count { color: var(--ink-3); font-weight: 600; font-size: 12px; }
/* The search is a toolbar control like .facet and .lx-sel: 32 px, 8 px radius, 12.5 px. */
.dvl-search { width: 320px; max-width: 100%; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; }
.dvl-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); background: var(--surface); }
.dvl-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font-size: 12.5px; font-weight: 500; }
.dvl-table td { vertical-align: top; }
.dvl-table .dv-status + .lx-sub { margin-top: 3px; }

/* ---- geofences (views/geofences.js) ---- */
.gf-page .page-head { gap: 10px; }
.gf-page .segs .seg { display: inline-flex; align-items: center; gap: 6px; }
.gf-about { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.gf-card { flex: 1; min-height: 520px; display: flex; flex-wrap: wrap; overflow: hidden; }
.gf-map { position: relative; flex: 999 1 560px; min-width: 0; min-height: 420px; background: var(--bg); }
.gf-map > .gf-map-canvas { position: absolute; inset: 0; }
.gf-sketch { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.gf-sketch svg { width: 100%; height: 100%; }
.gf-sketch-empty { color: var(--ink-3); }
.gf-sk-shape { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: var(--fence); stroke-width: 2.5; cursor: pointer; vector-effect: non-scaling-stroke; }
.gf-sk-shape.is-sel { stroke: var(--ink); stroke-width: 3; }
.gf-sk-label { font-size: 12px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; cursor: pointer; }
.gf-hint { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); z-index: 3; max-width: calc(100% - 120px); padding: 7px 12px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 12.5px; font-weight: 500; box-shadow: var(--pop); text-align: center; }
.gf-find { position: absolute; left: 12px; top: 12px; z-index: 4; width: 320px; max-width: calc(100% - 72px); }
.gf-find-input { height: 36px; border-radius: 8px; border-color: var(--line-strong); background: var(--surface); box-shadow: var(--shadow); font-size: 12.5px; }
.gf-find-list { margin-top: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--pop); max-height: 320px; overflow-y: auto; }
.gf-find-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 8px 10px; border-radius: 6px; text-align: left; }
.gf-find-item b { font-weight: 600; font-size: 12.5px; }
.gf-find-item span { font-size: 11.5px; color: var(--ink-3); }
.gf-find-item:hover, .gf-find-item[aria-selected="true"] { background: var(--hover); }
.gf-find-msg { margin: 0; padding: 8px 10px; font-size: 12px; color: var(--ink-3); }
.gf-legend { position: absolute; left: 12px; bottom: 28px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px 14px; max-width: calc(100% - 24px); padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-2); }
.gf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gf-swatch, .gf-mark { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--fence); background: color-mix(in srgb, var(--accent) 16%, transparent); flex: none; }
.gf-swatch.is-sel { border-color: var(--ink); }
.gf-mark.is-poly { border-radius: 3px; }
.gf-map-note { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 2; padding: 8px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.gf-panel { flex: 0 1 380px; min-width: 300px; display: flex; flex-direction: column; min-height: 0; max-height: 100%; border-left: 1px solid var(--line); background: var(--surface); }
.gf-panel-head { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.gf-panel-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.gf-back { color: var(--edit); font-weight: 500; font-size: 12.5px; }
.gf-back:hover { text-decoration: underline; }
.gf-search { margin: 12px 16px 4px; height: 32px; border-radius: 8px; border-color: var(--line-strong); background: var(--surface); font-size: 12.5px; }
.gf-rows { flex: 1; min-height: 0; overflow-y: auto; }
.gf-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; align-items: center; width: 100%; padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.gf-row:hover { background: var(--hover); }
.gf-row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-row-day { font-size: 11.5px; }
.gf-row-sub { grid-column: 1 / 3; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 11.5px; color: var(--ink-3); }
.gf-row.is-skel span { display: block; height: 10px; border-radius: 5px; background: var(--hover); }
.gf-row.is-skel span:first-child { width: 60%; }
.gf-row.is-skel span:last-child { width: 30px; }
.gf-empty { padding: 32px 20px; }
.gf-note { margin: 12px 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 12px; color: var(--ink-3); }
.gf-note[hidden] { display: none; }
.gf-ed .gf-note { margin: 0; }
.gf-ed { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; }
.gf-ed-title { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.gf-panel h2[tabindex="-1"]:focus { outline: none; }
.gf-id { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.gf-id .mono { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-id .btn { flex: none; }
.gf-field { display: flex; flex-direction: column; gap: 6px; }
.gf-label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.gf-field > input, .gf-select { height: 36px; width: 100%; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.gf-field > input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.gf-field > input:disabled { color: var(--ink-2); background: var(--bg); }
.gf-input { width: 100%; }
.gf-hint-text { margin: 0; font-size: 12px; color: var(--ink-3); }
.gf-err { margin: -8px 0 0; font-size: 12px; color: var(--bad); }
.gf-err:empty { display: none; }
.gf-shape { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.gf-shape .gf-mark { margin-top: 3px; width: 14px; height: 14px; }
.gf-shape b { font-weight: 600; }
.gf-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.gf-switch b { display: block; font-weight: 600; }
.gf-switch span:not(.cfg-switch span) { font-size: 12px; color: var(--ink-3); }
.gf-sec { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gf-sec-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); font-weight: 600; font-size: 12.5px; }
.gf-sec-head svg { color: var(--ink-3); }
.gf-sec-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.gf-sec-body[hidden] { display: none; }
.gf-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.gf-foot-note { font-size: 12px; }
.toast.is-bad svg { color: var(--bad-dot); }
@media (max-width: 900px) {
  .gf-panel { flex-basis: 100%; max-height: none; border-left: 0; border-top: 1px solid var(--line); }
  .gf-map { min-height: 360px; }
  .gf-page { height: auto; }
}

/* ---- list pages: the card meets the shell (developer, 2026-10-29) ----
   On a one-card page (lists, the Geofences map) the card fills the area with
   no outer space, border or corner radius against the shell; banners keep a
   little room. Pages that stack cards (device, trip, overview) keep the
   small .content spacing so the cards stay apart. */
.lx-page:not(.tp-page) > .content { padding: 0; gap: 0; }
.lx-page:not(.tp-page) > .content > .card { border-width: 0; border-radius: 0; }
.lx-page:not(.tp-page) > .content > .lx-banners:not(:empty) { padding: 8px 10px; }
.lx-page:not(.tp-page) > .content > .tp-note:not([hidden]) { margin: 8px 10px; }

/* ---- tables fit their card (developer, 2026-10-29) ----
   Text wraps; numbers, times, ids, pills and tags stay whole. A table sizes to
   its CARD (container queries), not the window, so a collapsed task bar or a
   side panel counts: under ~1180 px of card the lx-p3 columns step aside,
   under ~900 px the lx-p2 ones too. Every hidden value is on the item's page. */
.lx-card, .tp-card { container: lxcard / inline-size; }
.lx-table th, .lx-table td { padding-left: 10px; padding-right: 10px; }
.lx-table th:first-child, .lx-table td:first-child { padding-left: 14px; }
.lx-table th:last-child, .lx-table td:last-child { padding-right: 14px; }
.lx-table th { white-space: normal; line-height: 1.3; }
.lx-table td { white-space: normal; }
.lx-table td.num, .lx-table td.r, .lx-table .mono, .lx-table .num, .lx-table .lx-main, .lx-table .dv-status, .lx-table .tp-status,
.lx-table .tag, .lx-table .pill, .lx-table .lx-batt, .lx-table .lx-ic, .lx-table .lx-pin { white-space: nowrap; }
.lx-table .lx-sub { white-space: normal; overflow-wrap: anywhere; }
@container lxcard (max-width: 1180px) { .lx-table .lx-p3 { display: none; } }
/* Locations carries the most columns: it gives way a little earlier. */
@container lxcard (max-width: 1240px) { .lx-table.is-wide .lx-p3 { display: none; } }
@container lxcard (max-width: 900px) {
  .lx-table .lx-p2 { display: none; }
  .lx-table th, .lx-table td { padding-left: 8px; padding-right: 8px; }
  .lx-table th:first-child, .lx-table td:first-child { padding-left: 12px; }
  .lx-table th:last-child, .lx-table td:last-child { padding-right: 12px; }
}

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .taskbar, .taskbar.is-collapsed {
    order: 2; position: sticky; bottom: 0; top: auto; z-index: 30;
    width: 100%; height: auto; flex-basis: auto;
    border-right: 0; border-top: 1px solid var(--line);
  }
  .tb-brand, .tb-group, .tb-sep, .tb-foot, .tb-hide-phone { display: none !important; }
  .tb-scroll { flex-direction: row; overflow-x: auto; padding: 4px 6px 10px; gap: 0; }
  .tb-item, .taskbar.is-collapsed .tb-item { flex: 1 0 64px; flex-direction: column; justify-content: center; height: 56px; padding: 0 4px; gap: 3px; font-size: 11px; border: 0; box-shadow: none; }
  .tb-item[aria-current="page"] { background: var(--hover); }
  .taskbar .tb-label { display: block !important; flex: none; }
  .tb-meta, .tb-alert { display: none !important; }
  .tb-alert:not(:empty) + .tb-dot { display: block !important; top: 8px; right: calc(50% - 16px); }
  .topbar { gap: 4px; padding: 0 4px 0 6px; }
  .scope-sep, .search-wrap, .vsep, .status .label, .status .sub, .topbar-right .hide-phone { display: none; }
  .topbar .search kbd { display: none; }
  .status { width: auto; padding: 0 12px; height: 34px; border: 0; background: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(n) { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(-n + 2) { border-top: 0; }
  .page-head { padding: 10px 8px 8px; }
  .content { padding: 6px 6px 8px; gap: 8px; }
}

/* ---- motion -------------------------------------------------------------------
 * Short, quiet, one curve: colours ease on hover, things that appear fade and
 * lift 4 px, the task bar's width glides. Nothing bounces; only live state
 * (the pulse) and loading (the shimmer) repeat. Reduced motion turns it off. */

.btn, .iconbtn, .switch, .seg, .schip, .mi, .avatar, .search, .menu-filter, a.kpi, .attn-list a {
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn:active, .iconbtn:active, .seg:active, .schip:active { transform: translateY(.5px); }

/* Menus and the search list: fade in and settle from 4 px above. */
.pop { transform-origin: top center; animation: bk-pop var(--t-base) var(--ease); }
@keyframes bk-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* Opening a page is instant: no page, figure, label or banner animates in.
 * Motion is kept for what the operator does (hover, menus, dialogs, the
 * time range, collapsing the task bar). */
@keyframes bk-fade { from { opacity: 0; } }

/* The task bar collapses and expands by gliding its width. */
.taskbar { transition: flex-basis var(--t-slow) var(--ease), width var(--t-slow) var(--ease); }

/* ---- the time range (lib/range.js) ------------------------------------------
 * Presets in a segmented control, then Custom…, which opens a From / To form
 * in the operator's time zone. */

.seg-custom { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg-custom svg { color: var(--ink-3); }
.range-form { display: flex; flex-direction: column; gap: 14px; padding: 10px 10px 8px; }
.range-head { display: flex; flex-direction: column; gap: 2px; }
.range-head b { font-weight: 600; }
.range-head .muted, .range-note { font-size: 12px; }
/* The console's date picker (lib/datepick.js): a month of day buttons, the
 * chosen span shaded between its two ends, and HH:MM times. */
.dp { display: flex; flex-direction: column; gap: 10px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-title { font-weight: 600; font-size: 13px; }
.dp-nav { width: 30px; height: 30px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); }
.dp-nav:hover { background: var(--hover); color: var(--ink); }
.dp-nav:disabled { opacity: .35; cursor: default; background: none; }
.dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; }
.dp-wd { height: 26px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.dp-cell { position: relative; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; color: var(--ink); border-radius: 8px; }
.dp-cell:hover:not(:disabled) { background: var(--hover); }
.dp-cell:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.dp-cell.is-out { color: var(--ink-3); }
.dp-cell:disabled { color: var(--line-strong); cursor: default; }
.dp-cell.is-today::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.dp-cell.is-in { background: var(--hover); border-radius: 0; }
.dp-cell.is-start, .dp-cell.is-end { background: var(--ink); color: var(--surface); font-weight: 600; }
.dp-cell.is-start:not(.is-end) { border-radius: 8px 0 0 8px; }
.dp-cell.is-end:not(.is-start) { border-radius: 0 8px 8px 0; }
.dp-cell.is-start:hover, .dp-cell.is-end:hover { background: var(--ink-2); }
.dp-hint { font-size: 12px; color: var(--ink-3); }
.dp-ends { display: flex; flex-direction: column; gap: 6px; }
.dp-end { display: grid; grid-template-columns: 44px minmax(0, 1fr) 72px; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border: 1px solid var(--line); border-radius: 9px; }
.dp-end.is-next { border-color: var(--ink-3); }
.dp-end-label { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.dp-day { font-size: 12.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-time { width: 72px; height: 32px; padding: 0 8px; text-align: center; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 13px; outline: none; }
.dp-time:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.dp-time.is-invalid { border-color: var(--bad-dot); }
.range-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.range-chip { height: 28px; padding: 0 6px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.range-chip:hover { background: var(--hover); color: var(--ink); }
.range-chip.is-on { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.range-cap { margin-bottom: -8px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.range-msg { font-size: 12.5px; font-weight: 500; color: var(--bad); }
.range-foot { display: flex; justify-content: flex-end; gap: 8px; }
.pop:has(.range-form) { width: 332px; overflow-x: hidden; }

/* ---- Locations (views/locations.js) ------------------------------------------ */

/* One scrollbar: the page fits the window under the global bar, and only the
 * table scrolls (both ways), its header row pinned. On a window too short for
 * that, the table keeps 320 px and the page scrolls instead. */
.lx-page { height: calc(100dvh - 56px); min-height: 560px; display: flex; flex-direction: column; }
.lx-page > .content { flex: 1; min-height: 0; }
/* On a phone the task bar sits under the page (--tb-phone: its 56 px items,
 * 4 + 10 px padding and the hairline), so a page that fits the window fits
 * above it too: a list's paging footer is never under the task bar. */
:root { --tb-phone: 71px; }
@media (max-width: 760px) {
  .lx-page { height: calc(100dvh - 56px - var(--tb-phone)); }
}
.lx-window { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.lx-window b { color: var(--ink); font-weight: 600; }
.lx-retention { font-size: 12.5px; }
.lx-banners { display: flex; flex-direction: column; gap: 12px; }
.lx-banners:empty { display: none; }

.lx-volume { overflow: hidden; }
.lx-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.lx-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; min-width: 0; border-left: 1px solid var(--line); text-align: left; background: none; color: inherit; }
.lx-tile:first-child { border-left: 0; }
.lx-tile.is-action { cursor: pointer; }
.lx-tile.is-action:hover { background: var(--bg); }
.lx-tile-label { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-tile-n { font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 28px; }
.lx-tile-sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-tile.is-action .lx-tile-sub::after { content: " · show"; color: var(--edit); }
.lx-strip-note { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.lx-days { display: flex; gap: 4px; align-items: flex-end; padding: 10px 16px 8px; border-top: 1px solid var(--line); overflow-x: auto; }
.lx-day { flex: 1 0 34px; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 4px; height: 60px; padding: 0 2px; border-radius: 4px; }
.lx-day:hover { background: var(--hover); }
.lx-day i { display: block; background: var(--ink-3); border-radius: 2px 2px 0 0; }
.lx-day:hover i { background: var(--ink); }
.lx-day span { font-size: 10.5px; color: var(--ink-3); text-align: center; white-space: nowrap; }

.lx-card { position: relative; min-width: 0; overflow: hidden; flex: 1; min-height: 320px; display: flex; flex-direction: column; }
.lx-card.is-loading .lx-scroll { opacity: .55; pointer-events: none; }
.lx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.facet { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px dashed var(--line-strong); color: var(--ink-2); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.facet:hover, .facet[aria-expanded="true"] { background: var(--hover); color: var(--ink); }
.facet.is-set { border-style: solid; background: var(--bg); color: var(--ink); }
.facet-sep { width: 1px; height: 16px; background: var(--line-strong); }
.facet-val { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.lx-sel { appearance: none; -webkit-appearance: none; height: 32px; padding: 0 30px 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background-color: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 500; cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235B6676' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
.lx-sel:focus-visible { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.lx-pick { max-height: 340px; overflow: auto; }
.lx-check-sm { width: 15px; flex: none; display: inline-flex; justify-content: center; color: var(--ink); }
.lx-mi { min-height: 34px; }
.lx-mi.is-fixed { display: flex; align-items: center; gap: 10px; padding: 6px 10px; color: var(--ink-3); }
.lx-check { width: 16px; height: 16px; flex: none; border-radius: 4px; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.lx-check.is-on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.lx-mi .mono { font-size: 11px; }
.pop:has(.lx-mi) { width: 320px; }
.pop:has(.lx-pick) { width: 360px; }

.lx-fresh { display: block; width: 100%; padding: 8px; border-bottom: 1px solid var(--line); background: var(--edit-bg); color: var(--edit); font-weight: 500; font-size: 12.5px; }
.lx-fresh:hover { text-decoration: underline; }
.lx-scroll { overflow: auto; flex: 1; min-height: 0; }
.lx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.lx-table th { position: sticky; top: 0; z-index: 2; background: var(--bg); text-align: left; font-weight: 500; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lx-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; background: var(--surface); }
.lx-table .r { text-align: right; }
.lx-table th:first-child, .lx-table td:first-child { padding-left: 16px; }
.lx-table th:last-child, .lx-table td:last-child { padding-right: 16px; }
.lx-table .lx-pin { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.lx-table th.lx-pin { z-index: 3; color: var(--ink); }
.lx-table tbody tr { cursor: pointer; }
.lx-table tbody tr:hover td { background: var(--bg); }
.lx-table tbody tr:focus-visible { outline: none; }
.lx-table tbody tr:focus-visible td { background: var(--hover); }
.lx-table tbody tr.is-open td { background: var(--edit-bg); }
.lx-table tbody tr.is-gated td { color: var(--ink-3); }
.lx-main { color: var(--ink); font-weight: 500; }
.lx-sub { font-size: 11.5px; color: var(--ink-3); }
.lx-ink { color: var(--ink); }
.lx-skel td span { display: block; height: 10px; border-radius: 4px; background: var(--hover); }
.lx-skel td { cursor: default; }
.lx-tags-inline { display: inline-flex; gap: 4px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); }
.tag-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tag-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn-dot) 35%, transparent); }
.tag-bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad-dot) 35%, transparent); }
.lx-ic { display: inline-flex; align-items: center; gap: 6px; }
.lx-ic svg { flex: none; color: var(--ink-3); }
.lx-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.lx-bars i { width: 3px; border-radius: 1px; background: var(--line-strong); }
.lx-bars i:nth-child(1) { height: 5px; }
.lx-bars i:nth-child(2) { height: 8px; }
.lx-bars i:nth-child(3) { height: 12px; }
.lx-acc.is-good .lx-bars i.is-on { background: var(--ok-dot); }
.lx-acc.is-fair .lx-bars i.is-on { background: var(--ink-2); }
.lx-acc.is-poor .lx-bars i.is-on { background: var(--warn-dot); }
.lx-acc.is-poor { color: var(--warn); }
.tag svg { flex: none; }
.lx-batt { display: inline-flex; align-items: center; gap: 6px; }
.lx-batt i { position: relative; display: inline-block; width: 22px; height: 9px; border-radius: 2px; border: 1px solid var(--line-strong); overflow: hidden; }
.lx-batt i span { position: absolute; inset: 0 auto 0 0; background: var(--ink-3); }
.lx-batt i span.is-low { background: var(--bad-dot); }
.lx-skew { color: var(--warn); }
.lx-state { flex: 1; justify-content: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 24px; text-align: center; color: var(--ink-3); }
.lx-state h2 { font-size: 16px; font-weight: 600; color: var(--ink); }
.lx-state p { max-width: 560px; }
.lx-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.lx-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.lx-foot b { color: var(--ink); font-weight: 600; }
.lx-foot-size { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); }
/* The footer's note keeps a line's room: on a narrow card the paging buttons
 * wrap under it rather than squeezing it to a word a line. */
.lx-foot > .grow { flex: 1 1 160px; }
.lx-keys { font-size: 12px; }

.lx-panel { position: fixed; top: calc(56px + var(--page-head-h, 120px)); right: 0; bottom: 0; z-index: 30; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--pop); animation: bk-sheet var(--t-slow) var(--ease); }
.lx-panel[hidden] { display: none; }
.lx-panel-head { display: flex; align-items: flex-start; gap: 4px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.lx-panel-head h2 { font-size: 18px; font-weight: 600; }
.lx-panel-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.lx-panel-head .iconbtn:disabled { opacity: .4; cursor: default; }
.lx-panel-body { flex: 1; overflow: auto; padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 4px; }
.lx-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lx-group h3 { font-size: 12px; font-weight: 600; color: var(--ink); padding: 14px 0 6px; }
.lx-kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); margin: 0; font-size: 12.5px; }
.lx-kv dt { color: var(--ink-3); padding: 7px 0; border-top: 1px solid var(--line); }
.lx-kv dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.lx-id { font-size: 12px; overflow-wrap: anywhere; }
.lx-link { display: inline-flex; align-items: center; gap: 4px; color: var(--edit); text-decoration: none; }
.lx-link:hover { text-decoration: underline; }
.lx-panel-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--bg); }

@media (max-width: 1100px) {
  .lx-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lx-tile:nth-child(4) { border-left: 0; }
  .lx-tile:nth-child(n+4) { border-top: 1px solid var(--line); }
}


/* ---- Trips (views/trips.js, views/trip.js) ------------------------------------ */

.tp-status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tp-status i { width: 7px; height: 7px; border-radius: 50%; }
.tp-status.is-open { background: var(--edit-bg); color: var(--edit); }
.tp-status.is-open i { background: var(--edit); box-shadow: 0 0 0 0 color-mix(in srgb, var(--edit) 40%, transparent); animation: tp-pulse 2.4s ease-out infinite; }
.tp-status.is-stale { background: var(--warn-bg); color: var(--warn); }
.tp-status.is-stale i { background: var(--warn-dot); animation: none; }
.tp-status.is-closed { background: var(--hover); color: var(--ink-2); }
.tp-status.is-closed i { background: var(--ink-3); }
@keyframes tp-pulse { 70%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--edit) 0%, transparent); } }
.tp-quiet, .tp-why-inline { display: block; margin-top: 2px; }
.tp-link { color: var(--ink); text-decoration: none; }
.tp-link:hover { text-decoration: underline; }
.tp-go-cell { width: 44px; }
.tp-go { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 7px; color: var(--ink-3); }
.tp-go:hover { background: var(--hover); color: var(--ink); }
.tp-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.tp-note[hidden] { display: none; }
.tp-note svg { flex: none; margin-top: 1px; color: var(--ink-3); }

.lx-page.tp-page { height: auto; min-height: 0; }
.tp-crumb { color: inherit; text-decoration: none; }
.tp-crumb:hover { color: var(--ink); text-decoration: underline; }
.tp-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 12.5px; color: var(--ink-3); }
.tp-head-meta b { color: var(--ink); font-weight: 500; }
.tp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 10px; align-items: start; }
.tp-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (max-width: 1100px) { .tp-grid { grid-template-columns: minmax(0, 1fr); } }
.tp-card { overflow: hidden; min-width: 0; }
.tp-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tp-card-head h2 { font-size: 14px; font-weight: 600; }
.tp-card-head p { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tp-route { position: relative; height: 440px; background-color: var(--bg); }
/* Parent-qualified so they outrank mapbox-gl.css, which loads after this file and
   sets .mapboxgl-map { position: relative } on the same element (0 px tall map). */
.tp-route > .tp-map-canvas { position: absolute; inset: 0; }
.tp-map-canvas[hidden] { display: none; }
.tp-sketch { position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 40px 40px; }
.tp-sketch svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tp-legend { z-index: 2; }
.tp-legend[hidden] { display: none; }
.lx-map { position: relative; height: 210px; margin: 2px 0 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.lx-map[hidden] { display: none; }
.lx-map > .lx-map-canvas { position: absolute; inset: 0; }
.lx-map-canvas[hidden] { display: none; }
.lx-map-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.lx-map-note[hidden] { display: none; }
.tp-route-empty { display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.tp-legend { position: absolute; left: 14px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-2); }
.tp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tp-dot { display: inline-block; width: 10px; height: 10px; }
.tp-dot.is-start { border-radius: 50%; background: var(--ok-dot); }
.tp-dot.is-end { border-radius: 2px; background: var(--ink); }
.tp-dot.is-latest { border-radius: 50%; border: 2px solid var(--ink); }
.tp-dot.is-sel { border-radius: 50%; border: 2px solid var(--edit); }
.tp-scale { position: absolute; right: 14px; bottom: 12px; padding: 4px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-size: 11px; color: var(--ink-3); }
.tp-chart { height: 150px; padding: 12px 18px 4px; }
.tp-chart svg { width: 100%; height: 100%; }
.tp-axis { display: flex; justify-content: space-between; padding: 0 18px; font-size: 11px; color: var(--ink-3); }
.tp-chart-foot { padding: 6px 18px 14px; font-size: 12px; color: var(--ink-3); }
.tp-chart-empty { padding: 28px 18px; color: var(--ink-3); }
.tp-kv { display: grid; grid-template-columns: 136px minmax(0, 1fr); margin: 0; padding: 4px 18px 10px; font-size: 12.5px; }
.tp-kv dt { color: var(--ink-3); padding: 9px 0; border-top: 1px solid var(--line); }
.tp-kv dd { margin: 0; padding: 9px 0; border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.tp-kv dt:first-of-type, .tp-kv dt:first-of-type + dd { border-top: 0; }
.tp-why { display: block; margin-top: 3px; font-size: 11.5px; color: var(--ink-3); }
.tp-id { font-size: 11.5px; }
.tp-modes-body { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 16px; }
.tp-modebar { display: flex; height: 10px; gap: 2px; border-radius: 5px; overflow: hidden; background: var(--hover); }
.tp-modebar span { display: block; height: 100%; }
.tp-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: 12px; color: var(--ink-2); }
/* the route by travel mode (views/trip.js) */
.tp-msw { display: inline-block; width: 16px; height: 4px; border-radius: 2px; flex: none; }
.tp-msw.is-dash { background: repeating-linear-gradient(90deg, var(--ink-3) 0 4px, transparent 4px 7px) !important; }
.tp-ring { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-2); flex: none; }
.tp-mode { display: inline-flex; align-items: center; gap: 8px; }
.tp-legbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); background: var(--bg); }
.tp-legbar[hidden] { display: none; }
.tp-legbar b { color: var(--ink); font-weight: 600; }
.tp-band { display: flex; height: 8px; margin: 4px 18px 0; border-radius: 3px; overflow: hidden; background: var(--hover); }
.tp-band span { display: block; height: 100%; }
.tp-legs-scroll { max-height: 360px; }
.tp-legs td, .tp-legs th { white-space: nowrap; }
.tp-legs tbody tr { cursor: pointer; }
.tp-legs-foot, .tp-modes-foot { margin: 0; font-size: 12px; color: var(--ink-3); }
.tp-legs-foot { padding: 10px 18px; border-top: 1px solid var(--line); }
.tp-mrows { display: flex; flex-direction: column; margin: 0 -18px; }
.tp-mrow { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 9px 18px; text-align: left; border-top: 1px solid var(--line); }
.tp-mrow:hover:not(:disabled) { background: var(--hover); }
.tp-mrow[aria-pressed="true"] { background: var(--edit-bg); }
.tp-mrow:disabled { cursor: default; }
.tp-mrow b { font-weight: 600; }
.tp-mrow-sub { grid-column: 2 / 4; font-size: 12px; color: var(--ink-3); }
.tp-card-head .segs { flex: none; }
.tp-sketch-leg { cursor: pointer; }
.tp-modes span { display: inline-flex; align-items: center; }
.tp-table-title { font-size: 14px; font-weight: 600; }
.tp-points { min-height: 0; flex: none; }
.tp-points-scroll { max-height: 520px; flex: none; }
.tp-missing { padding: 64px 24px; }

/* ---- a device (views/device.js) ----------------------------------------------- */

.set-alert.is-bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad-dot) 35%, transparent); color: var(--bad); }
.set-alert.is-bad b { color: inherit; }
.dv-badges { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.dv-status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.dv-status i { width: 7px; height: 7px; border-radius: 50%; }
.dv-status.is-ok { background: var(--ok-bg); color: var(--ok); }
.dv-status.is-ok i { background: var(--ok-dot); }
.dv-status.is-warn { background: var(--warn-bg); color: var(--warn); }
.dv-status.is-warn i { background: var(--warn-dot); }
.dv-status.is-bad { background: var(--bad-bg); color: var(--bad); }
.dv-status.is-bad i { background: var(--bad-dot); }
.dv-status.is-new { background: var(--edit-bg); color: var(--edit); }
.dv-status.is-new i { background: var(--edit); }
.dv-status.is-mute { background: var(--hover); color: var(--ink-2); }
.dv-status.is-mute i { background: var(--ink-3); }
.tp-route.dv-where { height: 360px; }
.dv-pad { padding: 14px 18px; }
.dv-pad .empty { padding: 24px 16px; }
.dv-note { padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.dv-q, .dv-cfg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dv-q > div { padding: 14px 18px; border-left: 1px solid var(--line); min-width: 0; }
.dv-q > div:first-child { border-left: 0; }
.dv-cfg { gap: 8px; padding: 14px 18px; }
.dv-q-n { font-size: 20px; font-weight: 600; line-height: 28px; }
.dv-cfg-word { display: block; padding-top: 4px; font-size: 13.5px; font-weight: 500; line-height: 20px; font-family: var(--font); }
.dv-q-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.dv-chip { margin-left: 8px; font-size: 11px; }
.dv-kv dd { display: flex; align-items: flex-start; gap: 8px; }
.dv-dot { flex: none; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; }
.dv-dot.is-ok { background: var(--ok-dot); }
.dv-dot.is-warn { background: var(--warn-dot); }
.dv-dot.is-bad { background: var(--bad-dot); }
.dv-dot.is-mute { background: var(--line-strong); }
.dv-err { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 11.5px; }
.dv-cmds { list-style: none; margin: 0; padding: 0; }
.dv-cmd { display: flex; align-items: flex-start; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); }
.dv-cmd:first-child { border-top: 0; }
.dv-cmd-t { font-weight: 500; }
.dv-cmd-s { font-size: 12px; color: var(--ink-3); }
.dv-cmd-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.dv-id { display: flex; align-items: center; gap: 8px; }
.dv-input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.dv-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.dv-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.dv-hint { display: block; font-size: 12px; color: var(--ink-3); }
.dv-choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.dv-choice.is-on { border-color: var(--edit); background: var(--edit-bg); }
.dv-choice input { margin-top: 3px; accent-color: var(--edit); }
.dv-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dv-range[hidden] { display: none; }
.dv-span { grid-column: 1 / -1; }
.dv-form-err { font-size: 12.5px; color: var(--bad); }
.dv-form-err[hidden] { display: none; }
.dv-x { display: inline-flex; width: 34px; height: 34px; flex: none; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-2); }
.dv-x:hover { background: var(--hover); }
.dv-log-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dv-log-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 2px; }
.dv-log-title h2 { font-size: 16px; font-weight: 600; }
.dv-small { font-size: 12px; }
.dv-log-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.dv-log-facts > div { padding: 12px 20px; border-left: 1px solid var(--line); min-width: 0; }
.dv-log-facts > div:first-child { border-left: 0; }
.dv-fact { font-size: 13.5px; font-weight: 500; margin-top: 1px; }
.dv-log-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.dv-log-bar[hidden] { display: none; }
.dv-log-body { flex: 1; min-height: 0; overflow: auto; }
.dv-log-body .dv-note { border-top: 0; border-bottom: 1px solid var(--line); }
.dv-ln { display: grid; grid-template-columns: 104px 64px 110px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 7px 20px; border-bottom: 1px solid var(--line); font-size: 12px; }
.dv-ln:hover { background: var(--hover); }
.dv-ln-h { position: sticky; top: 0; z-index: 1; background: var(--surface); color: var(--ink-3); font-weight: 500; font-size: 11.5px; }
.dv-lv { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.dv-lv.is-error { color: var(--bad); }
.dv-lv.is-warn { color: var(--warn); }
.dv-lv.is-info { color: var(--ink-2); }
.dv-cat { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-msg { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dv-log-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.dv-log-foot:empty { display: none; }
@media (max-width: 760px) {
  .dv-q, .dv-cfg, .dv-log-facts { grid-template-columns: minmax(0, 1fr); }
  .dv-q > div, .dv-log-facts > div { border-left: 0; border-top: 1px solid var(--line); }
  .dv-ln { grid-template-columns: 1fr; gap: 2px; }
}

/* Loading: a soft shimmer over the placeholders. */
.kpi.is-loading .kpi-n, .kpi.is-loading .kpi-foot {
  background: linear-gradient(90deg, var(--hover) 25%, var(--line) 50%, var(--hover) 75%);
  background-size: 200% 100%;
  animation: bk-shimmer 1.2s linear infinite;
}
@keyframes bk-shimmer { to { background-position: -200% 0; } }

/* A count that appears (an alert, a task bar issue) pops in once. */
.badge:not([hidden]), .tb-alert:not(:empty) { animation: bk-pop var(--t-base) var(--ease); }

/* The Live pill breathes while locations arrive. */
.status.is-ok .dot { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok-dot) 45%, transparent); animation: bk-breathe 2.4s ease-out infinite; }
@keyframes bk-breathe { 70%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok-dot) 0%, transparent); } }

/* Switching theme: every colour eases over at once, only while it switches. */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after {
  transition: background-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease),
    border-color var(--t-slow) var(--ease), fill var(--t-slow) var(--ease) !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---- API keys (views/keys.js) ------------------------------------------------- */

.ky-about { font-size: 12.5px; color: var(--ink-3); }
.ky-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.ky-main { flex: 999 1 940px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ky-aside { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 12px; background: var(--hover); }
.ky-aside h2 { font-size: 14px; font-weight: 600; }
.ky-aside h3 { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.ky-aside h3 .mono { font-weight: 500; }
.ky-aside p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); }
/* A size container like .lx-card, so its tables fit it (lx-p2 / lx-p3). */
.ky-card { min-width: 0; overflow: hidden; container: lxcard / inline-size; }
.ky-card-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ky-card-head h2 { font-size: 14px; font-weight: 600; }
.ky-card-head p { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.ky-card-body:empty, .ky-onb-slot:empty { display: none; }
.ky-card-note { padding: 12px 16px 0; }
.ky-card-note + .lx-scroll, .ky-card-note + .lx-state { margin-top: 12px; border-top: 1px solid var(--line); }
.ky-table tbody tr { cursor: default; }
.ky-table td { vertical-align: middle; }
.ky-table tbody tr:last-child td { border-bottom: 0; }
.lx-table .ky-name { white-space: normal; overflow-wrap: anywhere; }
.ky-table .lx-pin { min-width: 100px; }
.ky-keycell { display: inline-flex; align-items: center; gap: 4px; }
.ky-copy { width: 26px; height: 26px; color: var(--ink-3); }
.ky-more { width: 30px; height: 30px; }
.ky-act { width: 46px; text-align: right; }
.ky-scopes { display: flex; flex-wrap: wrap; gap: 4px; min-width: 210px; max-width: 300px; white-space: normal; }
.ky-scopes.is-wide { max-width: none; }
@container lxcard (max-width: 900px) { .ky-table .ky-scopes { min-width: 0; } }
.ky-scopes .tag.mono { font-weight: 500; }
.ky-usage { display: inline-flex; align-items: center; gap: 8px; margin: -3px -6px; padding: 3px 6px; border-radius: 6px; text-align: left; }
.ky-usage:hover { background: var(--hover); }
.ky-spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.ky-spark i { display: block; width: 4px; border-radius: 1px; background: var(--edit); }
.ky-spark i.is-mute { background: var(--line-strong); }
.ky-block { display: block; }
.ky-rev-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; font-weight: 500; text-align: left; }
.ky-rev-toggle:hover { background: var(--bg); }
.ky-state { min-height: 0; padding: 36px 24px; }
.pop:has(.ky-menu) { width: 240px; }
.ky-onb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; }
.ky-onb-row h2 { font-size: 14px; font-weight: 600; }
.ky-onb-row p { font-size: 12.5px; color: var(--ink-3); }
.ky-onb-ok { display: inline-flex; color: var(--ok-dot); }
.ky-onb-code { padding: 0 16px 16px; }
.ky-pulse { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); animation: bk-breathe 2.4s ease-out infinite; }
.ky-pulse.is-off { background: var(--line-strong); box-shadow: none; animation: none; }
.ky-kinds-field, .ky-scopes-field { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ky-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ky-label { display: flex; justify-content: space-between; gap: 8px; }
.dv-input.is-bad { border-color: var(--bad-dot); }
.ky-legend { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 0; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.ky-legend-acts { display: inline-flex; gap: 6px; }
.ky-scope-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.ky-scope-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.ky-scope-table th { background: var(--bg); text-align: left; font-weight: 500; color: var(--ink-3); padding: 7px 10px; border-bottom: 1px solid var(--line); }
.ky-scope-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ky-scope-table tr:last-child td { border-bottom: 0; }
.ky-mod { font-weight: 500; white-space: nowrap; }
.ky-scope-opt { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.ky-scope-opt input { margin-top: 2px; accent-color: var(--ink); }
.ky-scope-opt small { display: block; font-size: 11.5px; color: var(--ink-3); }
.ky-warn-tag { margin-top: 4px; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); }
.secret-box code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 12.5px; }
.ky-code { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ky-code .dv-label { margin-bottom: 0; }
.ky-code-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ky-tabs .seg { height: 26px; font-size: 12px; }
.ky-tabs .seg[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.ky-install { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.ky-install code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.ky-pre { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); white-space: pre; overflow-x: auto; line-height: 1.6; }
.ky-caption { font-size: 11.5px; color: var(--ink-3); }
.ky-word { margin: 0 4px; }
.ky-body-text { color: var(--ink-2); }
.ky-dlg-head { display: flex; align-items: flex-start; gap: 8px; padding: 22px 16px 14px 24px; }
.ky-dlg-head h2 { font-size: 18px; font-weight: 600; }
.ky-dlg-head p { margin-top: 4px; color: var(--ink-3); }
.ky-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; }
.ky-chart { margin: 0; }
.ky-bars { display: block; }
.ky-legend-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; font-size: 11.5px; color: var(--ink-2); }
.ky-legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.ky-legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.modal .segs { align-self: flex-start; }
@media (max-width: 760px) {
  .ky-kinds, .ky-tiles { grid-template-columns: minmax(0, 1fr); }
  .ky-tiles .lx-tile { border-left: 0; border-top: 1px solid var(--line); }
  .ky-tiles .lx-tile:first-child { border-top: 0; }
  /* The scope string names its module, so a phone drops the Module column. */
  .ky-scope-table th:first-child, .ky-scope-table .ky-mod { display: none; }
  .ky-scope-table th, .ky-scope-table td { padding: 6px 8px; }
}

/* ---- Webhooks ----------------------------------------------------------------
 * Master–detail in one card: the endpoints on the left, the open one on the
 * right; on a phone the list, then the endpoint with "Endpoints" to go back. */

.wh-about { font-size: 12.5px; color: var(--ink-3); }
/* One card, like the lists (475a5585): it fills the area under the header and
 * meets the shell, with no outer space, border or radius; banners keep a little
 * room. Unlike a list it grows with the open endpoint and the page scrolls. */
.wh-page { min-height: calc(100dvh - 56px); display: flex; flex-direction: column; }
@media (max-width: 760px) { .wh-page { min-height: calc(100dvh - 56px - var(--tb-phone)); } }
.wh-page > .content { flex: 1; padding: 0; gap: 0; }
.wh-page > .content > .lx-banners:not(:empty) { padding: 8px 10px; }
.wh-slot { flex: 1; display: flex; flex-direction: column; }
.wh-slot > .card { flex: 1; border-width: 0; border-radius: 0; display: flex; flex-direction: column; }
/* The split answers to the card, not the window (a collapsed task bar counts):
 * side by side from 900 px of card, else the list, then the open endpoint. */
.wh-card { overflow: hidden; container: whcard / inline-size; }
.wh { flex: 1; display: flex; min-height: 560px; }
.wh-list { flex: 0 1 340px; min-width: 280px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.wh-list-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.wh-list-head h2 { font-size: 14px; font-weight: 600; }
.wh-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; align-items: center; width: 100%; padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.wh-row:hover { background: var(--bg); }
.wh-row.is-on { background: var(--edit-bg); }
.wh-host { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-path { grid-column: 1 / 3; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-sub, .wh-span { grid-column: 1 / 3; }
.wh-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.wh-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line-strong); }
.wh-dot.is-ok { background: var(--ok-dot); }
.wh-dot.is-bad { background: var(--bad-dot); }
.wh-dot.is-warn { background: var(--warn-dot); }
.wh-dot.is-new { background: var(--edit); }
.wh-skel { display: block; height: 10px; border-radius: 4px; background: var(--hover); }
.wh-more { margin: 12px 16px; }
.wh-detail { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; container: whdetail / inline-size; }
.wh-dhead { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.wh-durl-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.wh-durl { font-family: var(--font-mono); font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.wh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.wh-back { display: none; align-self: flex-start; }
.wh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.wh-dbody { display: flex; flex-direction: column; gap: 16px; padding: 16px 20px 20px; }
.wh-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wh-box { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.wh-box h3 { font-size: 12.5px; font-weight: 600; }
.wh-box-note { font-size: 12px; color: var(--ink-3); }
.wh-secret { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wh-secret code { font-size: 13px; padding: 3px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.wh-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wh-ping { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); }
.wh-ping svg { flex: none; margin-top: 2px; }
.wh-ping b { display: block; font-weight: 600; }
.wh-ping p { font-size: 12.5px; }
.wh-ping.is-ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.wh-ping.is-bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.wh-ping.is-run { background: var(--bg); color: var(--ink-2); }
.wh-x { width: 26px; height: 26px; margin: -3px -4px 0 0; color: inherit; }
.wh-sec-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.wh-sec-h h3 { font-size: 13px; font-weight: 600; }
.wh-sec-h > span { font-size: 12px; color: var(--ink-3); }
.lx-tiles.wh-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lx-tile-n.is-bad { color: var(--bad); }
.wh-tile-act { display: flex; align-items: center; padding: 12px 16px; border-left: 1px solid var(--line); }
.wh-tile-act .muted { font-size: 12px; max-width: 220px; }
.wh-foot-note { margin-top: -8px; font-size: 12px; color: var(--ink-3); }
.wh-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; container: whtable / inline-size; }
.wh-table tbody tr { cursor: default; }
.wh-table tbody tr:hover td { background: var(--surface); }
.wh-table tbody tr:last-child td { border-bottom: 0; }
.wh-table th { position: static; }
.wh-code-ok { color: var(--ok); font-weight: 600; }
.wh-code-bad { color: var(--bad); font-weight: 600; }
.wh-note, .us-keep { font-size: 12px; color: var(--ink-3); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.wh-lead-url { overflow-wrap: anywhere; }
.wh-err { margin-top: 6px; }
.wh-err[hidden], .wh-types[hidden] { display: none; }
.wh-help { margin-top: 6px; }
.wh-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.wh-fieldset legend { padding: 0; }
.wh-table td .lx-sub { white-space: nowrap; }
/* The deliveries table sits in the open endpoint, narrower than a card, so it
 * answers to its own box: Tries (lx-p3), then Device (lx-p2) step aside. */
@container whtable (max-width: 700px) { .wh-table .lx-p3 { display: none; } }
@container whtable (max-width: 580px) { .wh-table .lx-p2 { display: none; } }
.wh-choices { display: flex; flex-direction: column; gap: 8px; }
/* Columns as wide as the dialog allows (three on a wide one, else two, one on
 * a phone); every piece may shrink and the type tokens may break, so a long
 * token like billing.usage_threshold never pushes past the dialog's edge. */
.wh-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 14px; padding: 4px 0 0 30px; }
.wh-tgroup { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wh-tcheck > span { min-width: 0; }
.wh-tcheck small { overflow-wrap: anywhere; }
.wh-types-hint { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.wh-tgroup h4 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.wh-tcheck { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; cursor: pointer; }
.wh-tcheck input { margin-top: 2px; accent-color: var(--ink); }
.wh-tcheck small { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
@container whcard (max-width: 899px) {
  .wh-list { flex-basis: 100%; border-right: 0; }
  .wh.has-open .wh-list { display: none; }
  .wh:not(.has-open) .wh-detail { display: none; }
  .wh-back { display: inline-flex; }
}
@container whdetail (max-width: 640px) {
  .wh-boxes { grid-template-columns: minmax(0, 1fr); }
  .lx-tiles.wh-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wh-tile-act { grid-column: 1 / 4; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .wh-types { padding-left: 0; }
}
@media (max-width: 760px) {
  .wh { min-height: 0; }
  .wh-dhead, .wh-actions { padding: 12px; }
  .wh-dbody { padding: 12px; }
  .wh-tiles .lx-tile { padding: 10px 12px; }
}

/* ---- Users (views/users.js, views/user.js) ------------------------------------
   The list and the user page reuse the Devices and device-page pieces; what is
   new is the footer line about devices with no user id, the legend's line
   swatch, and the erase dialog's progress steps. */

.us-anon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.us-anon svg { flex: none; color: var(--ink-3); }
.us-anon b { color: var(--ink); font-weight: 600; }
.us-table tbody tr.us-noopen { cursor: default; }
.us-state h2 { max-width: 100%; overflow-wrap: anywhere; }
.us-state p { overflow-wrap: anywhere; }
.us-head-slot { display: contents; }
.us-role-note { margin: 0; }
.us-ln { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.us-note-top { border-top: 0; }
.us-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.us-modal-head h2 { overflow-wrap: anywhere; }
.us-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); }
.us-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.us-step { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.us-step:last-child { border-bottom: 0; }
.us-step b { font-weight: 600; color: var(--ink); }
.us-step.is-later b { font-weight: 500; color: var(--ink-3); }
.us-sub { grid-column: 2; font-size: 12px; color: var(--ink-3); }
.us-mk { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--line-strong); color: var(--ink-3); font-size: 11px; font-weight: 600; }
.us-step.is-done .us-mk { background: var(--ok-dot); border-color: var(--ok-dot); color: #fff; }
.us-step.is-now .us-mk { border-color: var(--edit); border-top-color: transparent; animation: us-spin 1s linear infinite; }
@keyframes us-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .us-step.is-now .us-mk { animation: none; border-top-color: var(--edit); } }
.us-bar { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.us-bar i { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--edit); transition: width 900ms linear; }
/* The user page's trips: Device and End reason matter more here than on the
   device page, so its lx-p2 columns stay down to a 600 px card. */
@container lxcard (max-width: 900px) { .lx-table.us-trips .lx-p2 { display: table-cell; } }
@container lxcard (max-width: 600px) { .lx-table.us-trips .lx-p2 { display: none; } }

/* ---- Project settings, New project ------------------------------------------------
   The page is config.js's settings layout (.set-layout, .set-card, .set-field);
   what is new is the danger card's border, a read-only input, the control-side
   messages, the retention headline, the erase dialog's boxes and its
   indeterminate bar (its steps are the Users erase's .us-steps), and the
   New project dialog's region cards (.dv-choice). */

.page-about { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.skel-bar { display: block; height: 10px; border-radius: 5px; background: var(--hover); }
.set-card.is-danger { border-color: color-mix(in srgb, var(--bad-dot) 35%, var(--line)); }
.set-input.is-ro { background: var(--bg); }
@media (min-width: 1441px) { .set-layout.is-norail { grid-template-columns: 200px minmax(0, 1fr); } }
.ps-name { width: 320px; }
.ps-name input[type="text"] { font-family: inherit; font-size: 13.5px; }
.ps-label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ps-idline { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.ps-id { font-size: 12.5px; color: var(--ink); word-break: break-all; }
.ps-msgs { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ps-msgs:empty { display: none; }
.ps-lock { display: inline-flex; align-items: center; gap: 6px; }
.ps-plain-body { padding: 16px 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.ps-ret { display: flex; flex-direction: column; gap: 10px; }
.ps-big { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.ps-facts { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ps-facts li { display: flex; gap: 8px; color: var(--ink-2); font-size: 12.5px; }
.ps-facts li::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); margin-top: 7px; }
.ps-ret .ps-facts { margin-top: 0; }
.set-desc > p { margin: 0; }
.set-desc > p + p { margin-top: 4px; }
.set-alert p + p { margin-top: 4px; }
@container (min-width: 720px) {
  .set-field:not(.set-switch-row) > .ps-msgs { grid-area: msg; justify-self: end; align-items: flex-end; text-align: right; max-width: 360px; }
}
@container (max-width: 719px) {
  .ps-name { width: 100%; }
  .ps-idline { justify-content: flex-start; }
}
.ps-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.ps-box h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.ps-box ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.ps-typed-name { color: var(--ink); overflow-wrap: anywhere; }
/* No door knows the total: an indeterminate bar, never a percentage. */
.ps-bar { position: relative; height: 4px; border-radius: 2px; background: var(--hover); overflow: hidden; }
.ps-bar i { position: absolute; top: 0; bottom: 0; left: -30%; width: 30%; border-radius: 2px; background: var(--edit); animation: ps-slide 1.4s ease-in-out infinite; }
@keyframes ps-slide { from { left: -30%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .ps-bar i { animation: none; left: 0; width: 100%; opacity: .45; } }
.modal-foot.ps-foot-start { justify-content: flex-start; }
.ps-elapsed { font-size: 12.5px; }
.toast { max-width: min(460px, calc(100vw - 32px)); }

.np-field { display: flex; flex-direction: column; gap: 6px; }
.np-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.np-fieldset legend { padding: 0; }
.np-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.np-label-row .dv-label { margin-bottom: 0; }
.np-count { font-size: 12px; }
.np-regions { display: flex; flex-direction: column; gap: 8px; }
.np-reg { align-items: center; }
.np-reg input { margin-top: 0; }
.np-reg-words { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.np-reg-name { font-weight: 600; }
.np-skel { display: block; height: 48px; border-radius: 10px; background: var(--hover); }

/* ---- Usage (views/usage.js) ----------------------------------------------------
 * Stacked cards like the device page (.tp-card / .tp-card-head), a four-tile
 * strip in the header, and day charts drawn as SVG at the plot's real width.
 * Accepted / Gated are D133's pair (slot 1 / slot 2), re-validated for both
 * themes (protan ΔE 24.8 light, 23.7 dark; ≥ 3:1 on the surface). */

:root { --ug-s1: #C27A1A; --ug-s2: #2F62A8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ug-s1: #BF8024; --ug-s2: #5B8FD6; } }
:root[data-theme="dark"] { --ug-s1: #BF8024; --ug-s2: #5B8FD6; }

.kpi-foot.is-bad { color: var(--bad); }
.kpis.ug-kpis, .kpis.ov-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1280px) {
  .kpis.ug-kpis, .kpis.ov-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ug-kpis .kpi:nth-child(n), .ov-kpis .kpi:nth-child(n) { border-left: 1px solid var(--line); border-top: 0; }
  .ug-kpis .kpi:first-child, .ov-kpis .kpi:first-child { border-left: 0; }
}
@media (max-width: 1100px) {
  .kpis.ug-kpis, .kpis.ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ug-kpis .kpi:nth-child(odd), .ov-kpis .kpi:nth-child(odd) { border-left: 0; }
  .ug-kpis .kpi:nth-child(n + 3), .ov-kpis .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
.ug-bg-s1 { background: var(--ug-s1); }
.ug-bg-s2 { background: var(--ug-s2); }
.ug-bg-acc { background: var(--accent); }
.ug-bg-warn { background: var(--warn-dot); }
.ug-bg-bad { background: var(--bad-dot); }

.ug-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.ug-grid.is-top { align-items: flex-start; }
.ug-grid > .ug-mau { flex: 999 1 560px; }
.ug-col { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ug-grid > .ug-wide { flex: 999 1 520px; }
.ug-grid > .ug-narrow { flex: 1 1 360px; }
.ug-card { display: flex; flex-direction: column; scroll-margin-top: 66px; }
.ug-card:focus { outline: none; }
.ug-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ug-card > .tp-card-head > .grow { flex: 1 1 260px; }
.ug-slot { display: flex; flex-direction: column; min-width: 0; }
.ug-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ug-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: auto; }
.ug-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ug-n { font-family: var(--font-num); font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; }
.ug-n.is-md { font-size: 24px; line-height: 30px; }
.ug-of { font-size: 13px; color: var(--ink-3); }
.ug-sub { margin: 0; font-size: 12px; color: var(--ink-3); }
.ug-proj { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.ug-empty { margin: 0; padding: 24px 18px; text-align: center; color: var(--ink-3); }
.ug-state { padding: 32px 20px; }
.ug-skel-n { width: 180px; }

.ug-meterwrap { display: flex; flex-direction: column; gap: 5px; }
.ug-meter { position: relative; height: 10px; border-radius: 5px; background: var(--line); }
.ug-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--accent); }
.ug-fill.is-warn { background: var(--warn-dot); }
.ug-fill.is-bad { background: var(--bad-dot); }
.ug-tick { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.ug-projmark { position: absolute; top: -5px; bottom: -5px; width: 2px; border-radius: 1px; background: var(--ink-2); }
.ug-scale { position: relative; height: 16px; font-size: 11px; color: var(--ink-3); }
.ug-scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.ug-scale .is-start { transform: none; }
.ug-scale .is-end { transform: translateX(-100%); }

.ug-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 12px; color: var(--ink-2); }
.ug-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ug-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.ug-sw.is-hatch { background: repeating-linear-gradient(135deg, var(--ug-s1) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--ug-s1); }
.ug-sw.is-hatch2 { background: repeating-linear-gradient(135deg, var(--ug-s2) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--ug-s2); }
.ug-sw-line { display: inline-block; width: 16px; height: 0; border-top: 2px dashed var(--ink-2); }
.ug-sw-line.is-cap { border-top-style: dotted; border-top-color: var(--bad-dot); }
.ug-sw-line.is-gap { border-top-color: var(--line-strong); }
.ug-sw-line.is-mau { border-top-style: solid; border-top-color: var(--ug-s1); }

.ug-chart { min-width: 0; border-radius: 8px; outline: none; }
.ug-chart:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.ug-plot { width: 100%; min-width: 0; touch-action: pan-y; }
.ug-svg { display: block; }
.ug-readout { margin: 2px 0 0; min-height: 20px; font-size: 12.5px; color: var(--ink-2); }
.ug-gl { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.ug-axis { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.ug-ylab, .ug-xlab { font-family: var(--font-num); font-size: 11px; fill: var(--ink-3); }
.ug-hi { fill: var(--hover); }
.ug-f-s1 { fill: var(--ug-s1); }
.ug-f-s2 { fill: var(--ug-s2); }
.ug-e-s1 { stroke: var(--ug-s1); stroke-width: 1; }
.ug-e-s2 { stroke: var(--ug-s2); stroke-width: 1; }
.ug-gap { stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 3 3; }
.ug-line { fill: none; stroke: var(--ug-s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ug-projline { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ug-capline { stroke: var(--bad-dot); stroke-width: 1.5; stroke-dasharray: 2 3; }
.ug-caplab { font-family: var(--font-num); font-size: 11px; font-weight: 600; fill: var(--ink-2); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.ug-dot { fill: var(--ug-s1); stroke: var(--surface); stroke-width: 2; }

.ug-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ug-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.ug-facts li { display: flex; gap: 8px; align-items: flex-start; }
.ug-facts li svg { flex: none; margin-top: 2px; color: var(--ink-3); }
.ug-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 12px; color: var(--ink-3); }
.ug-note svg { flex: none; margin-top: 1px; }
.ug-verdict { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; }
.ug-verdict svg { flex: none; margin-top: 1px; }
.ug-verdict.is-ok { background: var(--ok-bg); color: var(--ok); }
.ug-verdict.is-warn { background: var(--warn-bg); color: var(--warn); }
.ug-verdict.is-bad { background: var(--bad-bg); color: var(--bad); }
.ug-verdict.is-mute { background: var(--bg); color: var(--ink-3); }
.ug-capinput { width: 280px; max-width: 100%; }

.ug-rows { display: flex; flex-direction: column; gap: 7px; }
.ug-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 96px; gap: 10px; align-items: center; font-size: 12.5px; }
.ug-rows.is-reasons .ug-row { grid-template-columns: 124px minmax(0, 1fr) 108px; }
.ug-track { height: 8px; border-radius: 4px; background: var(--hover); overflow: hidden; }
.ug-track > span { display: block; height: 100%; border-radius: 4px; background: var(--ug-s1); }
.ug-track > span.ug-bg-s2 { background: var(--ug-s2); }
.ug-v { text-align: right; color: var(--ink-2); white-space: nowrap; }

.ug-tablewrap { max-height: 420px; }
.ug-tablewrap.is-api { max-height: none; border-top: 1px solid var(--line); }
.ug-table tbody tr { cursor: default; }
.ug-table.ug-keys tbody tr { cursor: pointer; }
.ug-table tbody tr:last-child td { border-bottom: 0; }
.ug-rowbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
.ug-keyname { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

@media (max-width: 760px) {
  .ug-last, .ug-page .live .sub, .ug-scale .is-80 { display: none; }
  .ug-body { padding: 12px 14px; }
  .ug-row { grid-template-columns: 96px minmax(0, 1fr) 84px; }
  .ug-rows.is-reasons .ug-row { grid-template-columns: 104px minmax(0, 1fr) 92px; }
  .ug-capinput input { font-size: 16px; }
}

/* ---- Events (views/events.js) -------------------------------------------------
 * The Devices list skeleton: family segments beside Auto-refresh, one card with
 * the toolbar, the table (oldest at the top) and the paging footer, and the
 * Locations side panel. Two additions: the JSON block and the new-row tint. */

.ev-segs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ev-segs::-webkit-scrollbar { display: none; }
.ev-segs .seg { flex: none; white-space: nowrap; }
.ev-about { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; font-size: 12.5px; color: var(--ink-3); }
.ev-about b { color: var(--ink); font-weight: 600; }
.ev-counts { white-space: nowrap; }
.ev-table td { vertical-align: top; }
.ev-table .ev-type { font-size: 11px; margin-top: 3px; }
.ev-table .tag + .tag { margin-left: 4px; }
/* A row Auto-refresh brought in: a tag plus a light honey tint (never the tint alone). */
.ev-table tbody tr.is-new td { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.ev-table tbody tr.is-new.is-open td { background: var(--edit-bg); }
.tag.ev-new { background: var(--edit-bg); color: var(--edit); border-color: color-mix(in srgb, var(--edit) 30%, transparent); }
.ev-newpill { cursor: pointer; }
.ev-newpill:hover { text-decoration: underline; }
.ev-panel .lx-kv { grid-template-columns: 150px minmax(0, 1fr); }
.ev-panel .tag.mono { font-weight: 500; }
.ev-hooks { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.ev-hooks li { display: flex; flex-direction: column; gap: 2px; padding: 7px 0; border-top: 1px solid var(--line); min-width: 0; }
.ev-hooks li .mono { overflow-wrap: anywhere; color: var(--ink); }
.ev-hooks li.is-muted .mono { color: var(--ink-3); }
.ev-note { font-size: 12px; color: var(--ink-3); padding: 8px 0 2px; }
.ev-note.ev-note-top { padding: 0 0 8px; }
.ev-json { margin: 0; padding: 10px 12px; max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; white-space: pre; }
.ev-json:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.ev-pager { display: inline-flex; flex-wrap: wrap; gap: 8px; }
@container lxcard (max-width: 900px) { .ev-keys { display: none; } }
@media (max-width: 760px) {
  .ev-about .ev-why { display: none; }
  .ev-page .page-actions { width: 100%; }
  .ev-page .lx-toolbar .ev-find { flex: 1 1 100%; width: auto; }
  .ev-page .lx-foot-size { order: 9; }
  .ev-page .lx-foot > .grow { flex: 1 1 100%; order: 1; }
  .ev-page .lx-foot > .ev-pager { order: 2; }
  .ev-panel .lx-kv { grid-template-columns: 120px minmax(0, 1fr); }
  .ev-panel .lx-panel-body { padding: 12px 14px 16px; }
}

/* ---- Organisation (views/organisation.js) -------------------------------------
 * Members · Invitations · Audit log as one list page each (the card meets the
 * shell). New here: the org id line, a member's avatar and row menu, the
 * audit row's details grid, the temporary password's spaced code, and dialogs
 * that open as bottom sheets on a phone (.is-phone-sheet, lib/modal.js cls). */

/* The tab's card sits in a slot; like a list page's card it fills the area
 * under the header and meets the shell. */
.og-slot { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.og-slot > .card { border-width: 0; border-radius: 0; }
.og-about { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: 0; font-size: 12.5px; color: var(--ink-3); }
.og-id { display: inline-flex; align-items: center; gap: 6px; }
.og-id .mono { color: var(--ink-2); }
.og-copy { width: 26px; height: 26px; color: var(--ink-3); }
.og-tabs { align-self: flex-start; max-width: 100%; overflow-x: auto; }
.og-tabs .seg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.og-search { width: min(320px, 100%); }
.og-count { font-size: 12.5px; color: var(--ink-3); }
.og-count b { color: var(--ink); font-weight: 600; }
.og-count a { color: var(--edit); }
.og-table tbody tr { cursor: default; }
.og-table td { vertical-align: middle; }
.og-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.og-who-text { min-width: 0; }
.og-who-label { overflow-wrap: anywhere; }
.og-av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; background: var(--hover); border: 1px solid var(--line); color: var(--ink-2); }
.og-av.is-sm { width: 24px; height: 24px; font-size: 10px; }
.og-av.is-key { border-radius: 7px; }
.og-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.og-name b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.og-email { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.lx-table .og-email { white-space: normal; }
.tag.og-owner { border-color: var(--line-strong); color: var(--ink); }
.og-act { width: 46px; text-align: right; }
.og-more { width: 30px; height: 30px; }
.og-empty-row td { padding: 24px 16px; color: var(--ink-3); text-align: center; }
.og-notes:empty { display: none; }
.og-note { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 12.5px; color: var(--ink-3); }
.og-note svg { flex: none; }
.og-link { padding: 0; color: var(--edit); font-weight: 500; }
.og-link:hover { text-decoration: underline; }
.og-narrow { display: none; }
.pop:has(.og-menu) { width: 290px; }
.og-menu .mi:disabled { cursor: not-allowed; }
.og-menu .mi:disabled:hover { background: none; }
.og-menu .mi:disabled .mi-label, .og-menu .mi:disabled .mi-icon { color: var(--ink-3); }
.og-intro { gap: 8px; font-size: 12.5px; color: var(--ink-3); flex-wrap: nowrap; align-items: flex-start; }
.og-intro svg { flex: none; margin-top: 2px; }
.og-field { display: flex; flex-direction: column; }
.og-field-err a, .og-field-err .og-link { color: var(--edit); }
.og-roles { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.og-roles legend { padding: 0; }
.dv-choice.is-off { cursor: not-allowed; opacity: .6; }
.og-choice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.og-choice-text b { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.og-secret code { white-space: normal; overflow-wrap: anywhere; overflow-x: visible; }
.og-temp { padding: 10px 10px 10px 14px; }
.og-temp-code { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 18px; letter-spacing: .06em; color: var(--ink); }
.og-head h2 { overflow-wrap: anywhere; }

/* The audit log: filters, a row that opens its details, the details grid. */
.og-audit-bar { gap: 8px 10px; }
.og-sel { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.og-actor { max-width: 240px; }
.og-range { max-width: 100%; overflow-x: auto; }
.og-range .seg { white-space: nowrap; }
.og-audit tbody tr { cursor: pointer; }
.og-audit tbody tr.og-det-row { cursor: default; }
.og-words { font-weight: 500; color: var(--ink); }
.og-tone-warn { font-weight: 600; color: var(--warn); }
.og-target { min-width: 180px; }
.og-chev { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; color: var(--ink-3); }
.og-chev svg { transition: transform var(--t-base) var(--ease); }
.og-audit tr.is-open .og-chev svg { transform: rotate(180deg); }
.lx-table tbody tr.og-det-row td, .lx-table tbody tr.og-det-row:hover td { background: var(--bg); white-space: normal; }
.og-det { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 24px; margin: 0; padding: 6px 4px 8px 34px; }
.og-det dt { font-size: 11.5px; color: var(--ink-3); }
.og-det dd { margin: 2px 0 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.og-det .og-copy { width: 22px; height: 22px; }

/* Narrow cards: one column of words per row; the hidden columns' values move
 * under the row's first cell. */
@container lxcard (max-width: 900px) {
  .lx-table .og-narrow { display: block; }
  .og-narrow-target { margin-top: 2px; color: var(--ink-2); white-space: normal; overflow-wrap: anywhere; }
  .lx-table .og-action-cell { white-space: normal; }
  .og-det { grid-template-columns: minmax(0, 1fr); padding-left: 0; }
}

@media (max-width: 760px) {
  /* The bottom tab bar has no Organisation: the organisation switcher (its
   * badge alone) stays in the global bar as the way in (D-O11). */
  .topbar .org-switch { display: inline-flex; padding: 0 6px; gap: 4px; }
  .topbar .org-switch .name { display: none; }
  .modal-wrap.is-phone-sheet { align-items: flex-end; padding: 0; }
  .modal.is-phone-sheet { width: 100% !important; max-height: 92dvh; overflow: auto; border-radius: 16px 16px 0 0; border-width: 1px 0 0; }
  .og-more { width: 36px; height: 36px; }
  .og-search { width: 100%; }
  .og-audit-bar .grow { display: none; }
  .og-actor { max-width: 180px; }
}

/* ---- Overview panels (views/overview.js) ------------------------------------------
 * Under the strip: "What needs you now" full width (or one calm line), then
 * Fleet beside Activity, the same height. The panels size to the content
 * area, not the window, so a collapsed task bar counts: under ~700 px the pair
 * stacks (the 820 px window and narrower). */
.ov-content { container: ovpage / inline-size; }
.ov-panels { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ov-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: stretch; }
.ov-card { display: flex; flex-direction: column; }
.ov-slot { display: flex; flex-direction: column; min-width: 0; }
.ov-slot:empty { display: none; }
.ov-calm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 13px; color: var(--ink-3); }
.ov-calm svg { color: var(--ok); flex: none; }
.ov-calm b { color: var(--ink); font-weight: 600; }
.ov-state { padding: 28px 18px; gap: 8px; }
.ov-state h2 { font-size: 14px; }
.ov-skel { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; }
.ov-skel.is-events { gap: 18px; }
.ov-dot { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.ov-label { padding: 10px 18px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ov-bad-text { color: var(--bad); font-weight: 600; }

/* Issues: red rows, then amber; each opens its page. */
.pill.ov-pill.is-bad { background: var(--bad-bg); color: var(--bad); }
.pill.ov-pill.is-warn { background: var(--warn-bg); color: var(--warn); }
.ov-issues { display: flex; flex-direction: column; }
.ov-issue { display: flex; gap: 10px; align-items: flex-start; padding: 11px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ov-issue:hover { background: var(--bg); }
.ov-issue:last-child { border-bottom: 0; }
.ov-issue .lead { flex: none; display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; margin-top: 2px; }
.ov-issue.is-bad .lead { color: var(--bad-dot); }
.ov-issue.is-warn .lead { color: var(--warn-dot); }
.ov-issue-title { color: var(--ink); font-weight: 600; text-decoration: none; }
.ov-issue-title:hover { text-decoration: underline; }
.ov-issue .d { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.ov-issue .d.ov-warn-text { color: var(--warn); }
.ov-err { margin-top: 4px; padding: 6px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.ov-fix { margin-top: 4px; font-size: 12px; color: var(--ink-2); }
.ov-who { display: flex; flex-direction: column; gap: 2px; margin-top: 5px; font-size: 12px; }
.ov-who > span { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; min-width: 0; }
.ov-issue .go { flex: none; color: var(--ink-3); margin-top: 1px; }

/* Fleet: a bar of the devices by status, a row per status (each opens its
 * Devices filter), then the config rollout. */
.ov-fl-top { display: flex; align-items: center; gap: 12px; }
.ov-fl-top .bar { flex: 1; min-width: 0; }
.ov-fl-share { flex: none; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.ov-card > .ov-slot > .ov-fl-top { padding: 14px 18px 8px; }
.ov-fls { display: flex; flex-direction: column; padding-bottom: 4px; }
.ov-fl { display: grid; grid-template-columns: 8px 64px minmax(0, 1fr) auto 14px; gap: 10px; align-items: center; padding: 8px 18px; color: var(--ink); text-decoration: none; }
.ov-fl:hover { background: var(--bg); }
.ov-fl-word { font-weight: 600; }
.ov-fl-d { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-fl b { font-size: 16px; font-weight: 700; text-align: right; }
.ov-fl.is-zero .ov-fl-word, .ov-fl.is-zero b { color: var(--ink-3); font-weight: 500; }
.ov-fl .go { display: inline-flex; color: var(--ink-3); }
.ov-cfg { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding: 12px 18px 14px; border-top: 1px solid var(--line); }
.ov-cfg-head { display: flex; align-items: center; gap: 8px; }
.ov-cfg-head h3 { font-size: 13px; font-weight: 600; }
.ov-cfg-head > a { margin-left: auto; font-size: 12px; }
.ov-cfg-d { font-size: 12px; color: var(--ink-3); }

/* Activity: the last 7 days per type, grouped by family, today's under each
 * figure; then the newest events, each a link to it on Events. */
.ov-acts { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.ov-actg { flex: 1 1 auto; min-width: 0; padding: 12px 18px 14px; }
.ov-actg + .ov-actg { border-left: 1px solid var(--line); }
.ov-actg h3 { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ov-actg-row { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.ov-actg-empty { font-size: 12.5px; color: var(--ink-3); padding-top: 6px; }
.ov-stat { display: flex; flex-direction: column; min-width: 56px; color: var(--ink); text-decoration: none; }
.ov-stat .l { font-size: 12px; color: var(--ink-3); }
.ov-stat .n { font-size: 22px; font-weight: 700; line-height: 30px; letter-spacing: -.01em; }
.ov-stat .t { font-size: 11.5px; color: var(--ink-3); }
.ov-stat:hover .n { color: var(--edit); }
.ov-stat.is-zero .n { color: var(--ink-3); font-weight: 600; }
.ov-none { padding: 4px 18px 16px; font-size: 12.5px; color: var(--ink-3); }
.ov-evs { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.ov-ev { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 18px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ov-ev:hover { background: var(--bg); }
.ov-ev:last-child { border-bottom: 0; }
.ov-ev .tag .ov-dot { width: 6px; height: 6px; }
.ov-evmain { min-width: 0; display: flex; flex-direction: column; }
.ov-evsubj { overflow-wrap: anywhere; }
.ov-evsubj.lx-main { font-weight: 500; }
.ov-ev .when { text-align: right; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
@container lxcard (max-width: 460px) {
  .ov-fl { grid-template-columns: 8px minmax(0, 1fr) auto 14px; }
  .ov-fl-d { display: none; }
  .ov-actg { flex-basis: 100%; }
  .ov-actg + .ov-actg { border-left: 0; border-top: 1px solid var(--line); }
}

/* Get started. */
.ov-steps { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ov-step { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ov-step:last-child { border-bottom: 0; }
.ov-step.is-current { background: color-mix(in srgb, var(--edit-bg) 55%, var(--surface)); }
.ov-num { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12.5px; border: 1.5px solid var(--line-strong); color: var(--ink-2); background: var(--surface); }
.ov-step.is-done .ov-num { border-color: transparent; background: var(--ok-bg); color: var(--ok); }
.ov-step.is-current .ov-num { border-color: var(--edit); color: var(--edit); }
.ov-steptext { min-width: 0; }
.ov-step h3 { font-size: 13.5px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ov-step.is-done h3 { color: var(--ink-2); }
.ov-step p { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; max-width: 640px; }
.ov-wait { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.ov-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); animation: ov-pl 1.8s ease-in-out infinite; }
@keyframes ov-pl { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); } }
.ov-stepact { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

@container ovpage (max-width: 700px) {
  .ov-pair { grid-template-columns: minmax(0, 1fr); }
  .ov-step { grid-template-columns: 32px minmax(0, 1fr); }
  .ov-stepact { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .ov-issue, .ov-ev, .ov-step, .ov-fl, .ov-actg, .ov-cfg, .ov-label, .ov-none { padding-left: 14px; padding-right: 14px; }
  .ov-card > .ov-slot > .ov-fl-top { padding-left: 14px; padding-right: 14px; }
  .ov-ev { grid-template-columns: minmax(0, 1fr) auto; }
  .ov-evtag { display: none; }
}
