/* BesenPose app. Tokens and components from design/besenpose-app/rev-b.html: one chain of radii,
   each derived from the one inside it (inner radius + padding = outer radius), light and dark.
   The gap between two edges is padding + border (--bw), so the border is part of every derivation. */
/* registered so that JS reads it as plain px (app.js planRadius: plan.js draws the house's corner with it) */
@property --r-inplan { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --tab-inset { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --tab-bottom { syntax: "<length>"; inherits: true; initial-value: 0px; }
:root {
  --bw: 1px;
  /* spacing: inside a group, between the items of a screen, before a new section */
  --gap-xs: 4px; --gap-s: 8px; --gap: 14px; --gap-l: 24px;
  --r-ctl: 12px; --pad-card: 14px; --pad-btn-sm: 12px; --h-btn-sm: 36px; --seg-pad: 3px; --h-tap: 44px;
  --mk: 12px;    /* a device marker, centred in a list row's icon tile; the carried chip derives its radius from it */
  --r-card: calc(var(--r-ctl) + var(--pad-card) + var(--bw));
  --gutter: 16px; --form-w: 480px; --page-w: 720px;
  /* the floating tab bar, the same as the Besendorf app's (design/RULES.md): fully rounded ends (radius = half its
     height) and a fully rounded current tab concentric with it; at most 600 px wide; on the safe area or --tab-inset
     above the bottom, whichever is more */
  /* Rev C (design/besenvakt-redesign/rev-c.html): the bar is concentric with the display's corner (--r-screen, an
     iPhone's), so it sits r-screen - r-tabbar in from the sides and the bottom; a phone without a home indicator (no
     bottom safe area: the SE, a browser) has a square display, and the bar sits 8 px in. */
  --r-screen: 55px; --tab-h: 66px; --tab-pad: 6px;
  --r-tabbar: calc(var(--tab-h) / 2); --r-tabitem: calc(var(--r-tabbar) - var(--tab-pad) - var(--bw));
  --tab-inset: clamp(8px, calc(env(safe-area-inset-bottom, 0px) * 100), calc(var(--r-screen) - var(--r-tabbar)));
  --tab-w: min(calc(100vw - 2 * var(--tab-inset)), 600px);
  --tab-bottom: var(--tab-inset);
  --r-tab: 32px;   /* the bars and cards of the dock above it (recording, update, leave question) */
  --rec-pad: 8px; --r-recitem: calc(var(--r-tab) - var(--rec-pad));
  --dock-pad: 10px; --r-dockitem: calc(var(--r-tab) - var(--dock-pad));   /* the dock's card: its buttons and chips sit --dock-pad inside its corner */
  --plan-pad: 10px; --r-inplan: calc(var(--r-card) - var(--plan-pad) - var(--bw));
  --sheet-inset: 8px; --r-sheet: 34px; --pad-sheet: 14px; --r-insheet: calc(var(--r-sheet) - var(--pad-sheet) - var(--bw));
  --inblock-pad: 12px; --r-inblockctl: calc(var(--r-insheet) - var(--inblock-pad));
  --h-lrow: 52px; --ic: 30px;   /* a list row's least height, the icon tile at its start */
  --r-mk: calc(var(--r-ctl) - (var(--ic) - var(--mk)) / 2);
  --avatar: 34px; --pad-person: 8px; --r-person: calc(var(--avatar) / 2 + var(--pad-person));
  --bg: #F4F2EE; --surface: #FFFFFF; --surface-2: #F0EEE9; --ink: #16171A; --ink-2: #55534F; --ink-3: #75726C; --line: #E2DED6; --glass: rgba(255,255,255,.82);
  --wallc: #CFCAC0; --floor: #FFFFFF; --fixf: #ECE9E2; --hatchfill: url(#hatch-l);
  --accent: #F29A2E; --accent-ink: #8F4B05; --on-accent: #1E1405; --accent-wash: rgba(242,154,46,.16);
  --act: #2F66D0; --act-wash: rgba(47,102,208,.16); --on-act: #FFFFFF;
  --good: #1B7A4A; --good-wash: rgba(27,122,74,.12); --bad: #C0362F; --bad-wash: rgba(192,54,47,.10); --hatch: rgba(22,23,26,.10);
  /* BesenVakt (Rev C): blue watches, red is only the alarm, orange is you */
  --armed: #2F5BC8; --armed-2: #1D3F8F; --armed-ink: #2A4FAE; --armed-wash: rgba(47,91,200,.10); --on-armed: #FFFFFF;
  --good-dot: #2FB36D; --bad-fill: #D23A30; --on-bad: #FFFFFF; --scrim: rgba(22,23,26,.32);
  --ease: cubic-bezier(.2,.7,.2,1); --t: 240ms;
  --sans: "Hanken Grotesk", -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Hanken Grotesk", -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0E1014; --surface: #181B21; --surface-2: #20242B; --ink: #ECEEF2; --ink-2: #AAB0BA; --ink-3: #868D98; --line: #2A2F38; --glass: rgba(24,27,33,.82);
  --wallc: #3A414C; --floor: #20242B; --fixf: #2B313B; --hatchfill: url(#hatch-d);
  --accent: #FFA23C; --accent-ink: #FFB766; --on-accent: #1E1405; --accent-wash: rgba(255,162,60,.15);
  --act: #7FA8FF; --act-wash: rgba(127,168,255,.18); --on-act: #0B1430;
  --good: #4CD48D; --good-wash: rgba(76,212,141,.13); --bad: #FF6E64; --bad-wash: rgba(255,110,100,.13); --hatch: rgba(236,238,242,.10);
  --armed: #3563D6; --armed-ink: #9DB6F5; --armed-wash: rgba(90,130,235,.16);
  --good-dot: #4CD48D; --bad-fill: #D93A30; --scrim: rgba(0,0,0,.5);
  color-scheme: dark; } }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; height: 100%; }
/* springy scrolling everywhere (design/RULES.md): the page and every scroll view bounce; only chaining is stopped
   (overscroll-behavior: contain on the sheets), never the bounce itself */
button, input { font: inherit; color: inherit; }
/* The page never zooms, by pinch or by double tap: a pinch that touched a button, the sheet or the tab bar used to
   shrink the whole page (on House the map owns the gestures). touch-action narrows down the tree, so pan-x pan-y
   on the root leaves fingers only scrolling; app.js blocks Safari's gesture events too. */
html, body, a, button, input, select, textarea, label, .lrow, .sheet, .scr, .dock, .tabbar { touch-action: pan-x pan-y; }
/* a field under 16 px makes iPhone Safari zoom in when it takes focus: never on a touch screen, whatever a rule says */
@media (pointer: coarse) { input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: max(16px, 1em) !important; } }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
p { margin: 0; }   /* spacing comes from the grids' gaps, never from paragraph margins */
[data-err]:empty, [data-userdetail]:empty { display: none; }   /* an empty slot (no error, nobody picked) takes no row and no gap */
#app { max-width: var(--page-w); margin: 0 auto; min-height: 100dvh; position: relative; }
/* the bottom padding clears the floating tab bar, plus a section's breathing room */
.scr { padding: calc(env(safe-area-inset-top) + 10px) var(--gutter) calc(var(--tab-h) + var(--tab-bottom) + var(--gap-l) + var(--dock-h, 0px)); display: grid; align-content: start; gap: var(--gap); }
.scr.noTabs { padding-bottom: calc(var(--gap-l) + env(safe-area-inset-bottom)); max-width: var(--form-w); margin-inline: auto; }
/* a section title sits closer to what it names than to what came before */
.scr > .t-sec, .sec > .t-sec { margin-top: calc(var(--gap-l) - var(--gap)); margin-bottom: calc(var(--gap-s) - var(--gap)); }
.sec { display: grid; gap: var(--gap); }
/* from 900 px desk.js draws the app (desk.css); the screens before it (the signed-out page, an error) stay in a wider column */
@media (min-width: 900px) { #app { max-width: 1100px; } }

.t-large { font: 750 30px/1.08 var(--display); letter-spacing: -.02em; }
.t-title { font: 650 20px/1.2 var(--display); letter-spacing: -.01em; }
.t-sec { font: 700 12px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.t-small { font: 500 13px/1.35 var(--sans); color: var(--ink-2); }
.hint { font: 500 12.5px/1.35 var(--sans); color: var(--ink-3); } .hint.bad { color: var(--bad); } .hint.good { color: var(--good); }
.mono { font-family: var(--mono); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* a title row with its button stays on one line at every width and in every language */
.titlerow > .t-title, .titlerow > .btn { white-space: nowrap; }
.titlerow > .btn { flex: none; }

.btn { font: 650 16px/1.2 var(--sans); min-height: 50px; padding: var(--gap-xs) 18px; text-wrap: balance; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; transition: background .12s, transform .06s; }
.btn svg { width: 20px; height: 20px; }
.btn > span { min-width: 0; text-align: start; }   /* a label that wraps stays one group with its icon */
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.danger { color: var(--bad); }
.btn.quiet { border-color: transparent; background: none; color: var(--accent-ink); min-height: 40px; }
.row > .btn.quiet:last-child { margin-inline-end: calc(-1 * var(--pad-btn-sm)); }   /* its label, not its tap area, lines up with the edge */
.btn.sm { min-height: var(--h-btn-sm); font-size: 14px; padding: 0 var(--pad-btn-sm); width: auto; }
/* small controls keep their look; an invisible box makes the tap area at least --h-tap in both directions */
.btn.sm, .btn.quiet, .iconbtn, .chip { position: relative; }
.btn.sm::after, .btn.quiet::after, .iconbtn::after, .chip::after { content: ""; position: absolute; inset: min(0px, calc((100% - var(--h-tap)) / 2)); }
.btn:disabled { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); cursor: not-allowed; transform: none; }
/* a request on its way (app.js busyButton): the button keeps its look and size, its label gives way to a spinner */
[aria-busy="true"] { position: relative; color: transparent !important; cursor: progress; }
[aria-busy="true"].btn:disabled { background: var(--surface); border-color: var(--line); } [aria-busy="true"].btn.primary:disabled { background: var(--accent); border-color: transparent; }
[aria-busy="true"] > * { visibility: hidden; }
[aria-busy="true"]::before { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--spin, var(--ink-2)); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.primary { --spin: var(--on-accent); } .btn.danger, .iconbtn.danger { --spin: var(--bad); } .recbar, .reccard { --spin: var(--bg); }
@keyframes spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { [aria-busy="true"]::before { animation-duration: 1.6s; } }
.field { display: grid; gap: 6px; } .field label { font: 600 13px var(--sans); color: var(--ink-2); }
.input { height: 50px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 14px; font: 16px var(--sans); width: 100%; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-wash); }
.input.sm { height: 40px; font-size: 16px; }   /* 16px: smaller makes iPhone Safari zoom in on focus */
select.input { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; background: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%) calc(100% - 21px) 50% / 6px 6px no-repeat, linear-gradient(135deg, var(--ink-3) 50%, transparent 50%) calc(100% - 15px) 50% / 6px 6px no-repeat, var(--surface); }
.inblock .input { border-radius: var(--r-inblockctl); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: var(--r-ctl); padding: var(--seg-pad); gap: var(--seg-pad); }
.seg button { font: 600 14px/1 var(--sans); color: var(--ink-2); background: none; border: 0; height: var(--h-tap); border-radius: calc(var(--r-ctl) - var(--seg-pad)); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.seg .ct { font: 600 11px/1 var(--mono); background: var(--act); color: var(--on-act); border-radius: 99px; padding: 3px 6px; }
.card-p { background: var(--surface); border-radius: var(--r-card); padding: var(--pad-card); display: grid; gap: 12px; border: var(--bw) solid var(--line); }
/* the 30px icon tiles sit as far from the list's top and bottom as from its side (--pad-card inside the border),
   so the corner stays concentric with theirs: the row centres the tile, the list adds the rest */
.list { background: var(--surface); border-radius: var(--r-card); border: var(--bw) solid var(--line); padding: calc(var(--pad-card) - (var(--h-lrow) - var(--ic)) / 2) var(--pad-card); display: grid; }
/* the separator is drawn inside the row, so every row centres its icon in the full --h-lrow */
.lrow { display: flex; gap: 12px; align-items: center; min-height: var(--h-lrow); border: 0; box-shadow: inset 0 calc(-1 * var(--bw)) var(--line); background: none; color: inherit; text-align: left; width: 100%; padding: 6px 0; }
.lrow:last-child { box-shadow: none; } button.lrow, a.lrow { cursor: pointer; } a.lrow { text-decoration: none; }
/* the accounts list: its corners follow the first and last avatar, which sit as far from the top as from the side
   (the row's min-height already holds its padding, so only the centring gap comes off) */
.list[data-users] { --avatar: 38px; border-radius: calc(var(--avatar) / 2 + var(--pad-card) + var(--bw)); padding-block: calc(var(--pad-card) - (var(--h-lrow) - var(--avatar)) / 2); }
.lrow .ic { width: var(--ic); height: var(--ic); border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.lrow .ic svg { width: 18px; height: 18px; }
.lrow .tx { flex: 1; min-width: 0; display: grid; gap: 1px; }
.lrow .tx > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* rows of one list are one height: one line each, the rest an ellipsis */
.lrow.msg .tx > * { white-space: normal; }   /* an error or a notice is said in full (a list's only row) */
.lrow .tx b { font: 600 15px/1.25 var(--sans); } .lrow .tx span { font: 500 13px/1.3 var(--sans); color: var(--ink-3); }
.lrow .end { color: var(--ink-3); font: 500 14px var(--sans); display: flex; align-items: center; gap: 6px; flex: none; }
.live { display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px/1 var(--sans); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 7px 10px 7px 8px; border-radius: 99px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-wash); }
.live.off i { background: var(--ink-3); box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 600 13px/1 var(--sans); padding: 9px 12px; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--ink); border: 1px solid transparent; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-ink); }
.chip.add { background: none; border-color: var(--line); color: var(--ink-2); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--act); }
.pill { font: 650 12px/1 var(--sans); padding: 6px 9px; border-radius: 99px; display: inline-flex; gap: 5px; align-items: center; width: max-content; }
.pill.act { background: var(--act); color: var(--on-act); } .pill.recent { background: var(--act-wash); color: var(--ink); } .pill.quiet { background: var(--surface-2); color: var(--ink-2); } .pill.off { background: var(--hatch); color: var(--ink-2); }
.pill.home { background: var(--good-wash); color: var(--good); } .pill.away { background: var(--surface-2); color: var(--ink-3); } .pill.admin { background: var(--accent-wash); color: var(--accent-ink); } .pill.warn { background: var(--bad-wash); color: var(--bad); }
.people { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.person { display: grid; justify-items: start; gap: 8px; padding: var(--pad-person); border-radius: var(--r-person); background: var(--surface); border: 1px solid var(--line); }
.av { width: var(--avatar); height: var(--avatar); aspect-ratio: 1; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font: 700 15px/1 var(--display); color: #fff; position: relative; flex: none; }
.av.away { filter: grayscale(1); opacity: .55; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }   /* same box, same radius */
.person b { font: 650 14.5px/1.1 var(--sans); padding-inline: 2px; } .person span { font: 500 12.5px/1.2 var(--sans); color: var(--ink-3); padding: 0 2px 2px; }
/* who is home (House): avatars side by side in a pill whose corner is concentric with the avatars' circle */
.homerow { --avatar: 26px; --pad-home: 4px; display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%;
  padding: var(--pad-home) 12px var(--pad-home) var(--pad-home); border: var(--bw) solid var(--line); background: var(--surface);
  border-radius: calc(var(--avatar) / 2 + var(--pad-home) + var(--bw)); }
.homerow .avs { display: flex; flex: none; }
.homerow .av { font-size: 12px; box-shadow: 0 0 0 2px var(--surface); }
.homerow .av + .av { margin-left: -6px; }
.homerow .tx { font: 600 13.5px/1.2 var(--sans); color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm { cursor: pointer; } .rm > * { transition: fill .25s; }
.rm:focus-visible { outline: none; } .rm:focus-visible .zr { stroke: var(--accent); stroke-width: 8; }
.rm[aria-pressed="true"] .zr { stroke: var(--ink); stroke-width: 6; }
.spot { cursor: pointer; } .spot:focus-visible { outline: none; } .spot:focus-visible .sc, .spot[aria-pressed="true"] .sc { stroke: var(--accent); stroke-width: 9; }
.spot[data-draggable] { cursor: grab; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 2px 4px 2px; font: 500 12px/1 var(--sans); color: var(--ink-3); }
.legend span { display: inline-flex; gap: 6px; align-items: center; } .legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.legend i.hx { background: repeating-linear-gradient(45deg, var(--floor) 0 3px, var(--wallc) 3px 5px); box-shadow: inset 0 0 0 1px var(--line); }
/* the room model's "how sure" tint (plan.js fillOf: the "now" colour at up to 40 %) */
.legend i.pg { width: 22px; background: linear-gradient(90deg, var(--floor), color-mix(in oklab, var(--act) 40%, var(--floor))); box-shadow: inset 0 0 0 1px var(--line); }
.legend i.sp { border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink-2); }
.legend i.ly { width: 11px; height: 11px; border-radius: 3px; background: var(--ink); }
.legend i.dv { width: 10px; height: 10px; border-radius: 3px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink-2); }
.legend i.sn { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-ink); transform: rotate(45deg); margin: 0 2px; }
.chips.outside { align-items: center; padding: 0 4px; }
/* devices: the side panel next to the plan while placing (desktop only), the router's client list, and a
   device being carried onto the plan */
.devpanel { align-content: start; }
.devrow .tx { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.devrow .end { gap: var(--gap-xs); }
/* the row's buttons are icon tiles like the one at its start, so both share the list's corner centre */
.devrow .iconbtn { width: var(--ic); height: var(--ic); border-radius: var(--r-ctl); }
.devrow[data-carry] { cursor: grab; user-select: none; -webkit-user-select: none; }
.devrow[aria-selected="true"] .tx b { color: var(--accent-ink); }
.mk { width: var(--mk); height: var(--mk); border-radius: var(--r-mk); flex: none; display: inline-block; }
.mk.ly { background: var(--ink); } .mk.dv { background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink-2); }
.mk.sn { width: 9px; height: 9px; border-radius: 2px; background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-ink); transform: rotate(45deg); margin: 0 2px; }
.iconbtn.sm { width: 32px; height: 32px; } .iconbtn.sm svg { width: 16px; height: 16px; }
.iconbtn.danger { color: var(--bad); } .iconbtn.back svg { transform: scaleX(-1); }
.list.insheet { --pad-card: var(--inblock-pad); border-radius: var(--r-insheet); max-height: 50dvh; overflow: auto; }
.list.insheet .lrow .ic { border-radius: calc(var(--r-insheet) - var(--pad-card) - var(--bw)); }
button.lrow:disabled { cursor: default; } button.lrow:disabled .tx b { color: var(--ink-3); }
/* The ring is a shadow, not a border, and the 14px line box is 1px taller than the 12px marker on each side:
   so the marker sits --carry-pad in from every edge and the chip's corner shares the marker's centre. */
.carry { --carry-pad: 9px; position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; display: inline-flex; align-items: center; gap: 8px; padding: calc(var(--carry-pad) - 1px) 12px calc(var(--carry-pad) - 1px) var(--carry-pad); border-radius: calc(var(--r-mk) + var(--carry-pad)); background: var(--surface); font: 600 14px/1 var(--sans); box-shadow: inset 0 0 0 1px var(--accent), 0 8px 24px rgba(0,0,0,.18); white-space: nowrap; }
body.carrying, body.carrying * { cursor: grabbing !important; }
.now { display: flex; gap: 12px; align-items: center; }
.now .pulse { width: 42px; height: 42px; border-radius: var(--r-ctl); background: var(--act); color: var(--on-act); display: grid; place-items: center; flex: none; }
.now .pulse svg { width: 22px; height: 22px; }
.now .tx { display: grid; gap: 2px; min-width: 0; } .now .tx b { font: 650 16px/1.25 var(--sans); } .now .tx span { font: 500 13px/1.3 var(--sans); color: var(--ink-3); }
.surerow { display: flex; align-items: center; gap: 10px; } .surerow .sure { flex: 1; } .surerow .mono { font: 600 13px/1 var(--mono); color: var(--ink-2); min-width: 4.5ch; text-align: right; font-variant-numeric: tabular-nums; }
.inblock .sure { background: var(--surface); }
.qline { display: flex; gap: 8px; align-items: baseline; } .qdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); transform: translateY(-1px); }
.qdot.home { background: var(--good); } .qdot.admin { background: var(--accent); } .qdot.warn { background: var(--bad); }
/* the model card's room list and button sit in the card's padding: their corner is the card's minus that padding */
.card-p > .list.inside, .card-p > .btn.sm:last-child { border-radius: calc(var(--r-card) - var(--pad-card) - var(--bw)); }
.sure { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; } .sure i { display: block; height: 100%; background: var(--act); border-radius: 3px; transition: width .4s; }
.surerow { display: flex; align-items: center; gap: 10px; } .surerow .sure { flex: 1; } .surerow .pct { font: 600 12px/1 var(--mono); color: var(--ink-3); min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }

.tabbar { position: fixed; left: 50%; transform: translateX(-50%); width: var(--tab-w); bottom: var(--tab-bottom); height: var(--tab-h); padding: var(--tab-pad); border-radius: var(--r-tabbar); background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border: var(--bw) solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; box-shadow: 0 10px 30px rgba(0,0,0,.16); z-index: 20; }
.tab { border: 0; background: none; border-radius: var(--r-tabitem); display: grid; place-items: center; align-content: center; gap: 4px; font: 600 11px/1 var(--sans); color: var(--ink-2); cursor: pointer; }
.tab:hover { color: var(--ink); }
.kbd .tabbar, .kbd .tabfade { display: none; }
.tab svg { width: 23px; height: 23px; } .tab[aria-current="page"] { background: var(--accent-wash); color: var(--accent-ink); }

.scrim { touch-action: none; overscroll-behavior: contain; position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 30; border: 0; cursor: pointer; }
.sheet { position: fixed; left: 50%; transform: translateX(-50%); width: calc(min(100vw, 720px) - 2 * var(--sheet-inset)); bottom: calc(var(--sheet-inset) + env(safe-area-inset-bottom)); border-radius: var(--r-sheet); background: var(--surface); border: var(--bw) solid var(--line); padding: var(--pad-sheet); display: grid; gap: 12px; z-index: 40; box-shadow: 0 -10px 40px rgba(0,0,0,.22); max-height: 90dvh; overflow: auto; overscroll-behavior: contain; }
html:has(.sheet), html:has(.sheet) body { overflow: hidden; }
/* A sheet is one column as wide as the sheet: grid columns are "auto" by default and grow to their widest line, so a
   long German or French line widened the whole sheet and cut its right side off (also the map's sheet and the blocks
   inside both) */
.sheet, .msbody, .inblock, .recmode, .dbody { grid-template-columns: minmax(0, 1fr); }   /* the page behind a sheet never scrolls */
/* the grab floats over the top padding, so the header starts at the sheet's inset and its corner button can follow the curve */
.sheet .grab, .msheet .grab { position: absolute; top: 6px; left: 50%; translate: -50% 0; width: 38px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet .hd, .msheet .hd { display: flex; align-items: center; gap: 10px; } .sheet .hd .t-title, .msheet .hd .t-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* the header's buttons: a circle of --r-insheet, so the one in the top corner is concentric with the sheet */
.sheet .hd > .iconbtn, .msheet .hd > .iconbtn { width: calc(2 * var(--r-insheet)); height: calc(2 * var(--r-insheet)); } .sheet .hd > .iconbtn:last-child, .msheet .hd > .iconbtn:last-child { align-self: start; }
/* a button in the sheet's bottom corners follows the sheet's curve */
.sheet > .btn:last-child, .sheet > .btns2:last-child > .btn, .sheet > form:last-child > .btn:last-child { border-radius: var(--r-insheet); }
.sheet > .btn.sm:last-child, .sheet > .btns2:last-child > .btn.sm { min-height: max(var(--h-tap), calc(2 * var(--r-insheet))); }   /* tall enough to hold that corner */
/* and one in a block's bottom corners follows the block's */
.inblock > .btns2:last-child > .btn, .inblock > .btn:last-child { border-radius: var(--r-inblockctl); }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.iconbtn svg { width: 18px; height: 18px; }
.inblock { background: var(--surface-2); border-radius: var(--r-insheet); padding: var(--inblock-pad); display: grid; gap: var(--gap-s); }
.btns2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tl-ax { display: flex; justify-content: space-between; font: 500 11px/1 var(--mono); color: var(--ink-3); }

.mark svg { width: 64px; height: 64px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--tab-bottom) + var(--gap) + var(--dock-h, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); font: 600 14.5px/1.25 var(--sans); padding: 12px 18px 12px 14px; --r-toast: 22px; border-radius: var(--r-toast); box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 60; animation: toast 2.8s ease forwards; pointer-events: none; display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 40px); text-wrap: balance; }
.toast svg { width: 17px; height: 17px; flex: none; color: var(--good-dot); }
.toast.bad svg { color: var(--bg); opacity: .7; }
/* a toast with an action (Undo): the button sits --pad-tact inside the toast's corner, concentric with it */
.toast.act { --pad-tact: 6px; pointer-events: auto; padding: var(--pad-tact) var(--pad-tact) var(--pad-tact) 14px; animation-duration: 6s; }
.toast .tact { min-height: calc(2 * (var(--r-toast) - var(--pad-tact))); padding: 0 14px; border-radius: calc(var(--r-toast) - var(--pad-tact)); border: 0; background: color-mix(in oklab, var(--bg) 18%, transparent); color: var(--bg); font: 650 14.5px/1 var(--sans); cursor: pointer; margin-left: 4px; position: relative; }
.toast .tact[aria-busy="true"]::before { border-color: var(--bg); border-right-color: transparent; }
body:has(.urgent) .toast { bottom: calc(env(safe-area-inset-bottom) + 24px); }   /* no tab bar on the urgent screens */
@keyframes toast { 0% { opacity: 0; translate: 0 6px; } 10%, 85% { opacity: 1; translate: 0 0; } 100% { opacity: 0; } }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: var(--pad-card); border-radius: var(--r-card); background: var(--surface); border: var(--bw) solid var(--line); }
.banner .ic { width: 36px; height: 36px; border-radius: var(--r-ctl); display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.banner .ic.bad { background: var(--bad-wash); color: var(--bad); } .banner .ic.rec { background: var(--accent-wash); color: var(--accent-ink); } .banner .ic svg { width: 20px; height: 20px; }
.banner .btn.sm { padding-inline: var(--gap-s); white-space: nowrap; }   /* two side by side stay one line each in the narrow side column */
.banner .tx { display: grid; gap: var(--gap-xs); flex: 1; min-width: 0; } .banner .tx > .btns2 { margin-top: var(--gap-xs); } .banner b { font: 650 15px/1.3 var(--sans); } .banner p { margin: 0; font: 500 13.5px/1.4 var(--sans); color: var(--ink-2); }
.switch { width: 52px; height: 32px; border-radius: 16px; border: 0; padding: 0; background: color-mix(in oklab, var(--ink) 16%, var(--surface-2)); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch > i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s var(--ease); display: grid; place-items: center; color: var(--ink-3); }
.switch[aria-checked="true"] { background: var(--good-dot); } .switch[aria-checked="true"] > i { transform: translateX(20px); }
.switch.busy > i::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.switch:disabled { opacity: .5; cursor: not-allowed; } .switch.busy:disabled { opacity: 1; cursor: progress; }

/* recording: the dock above the tab bar holds the update notice and the recording bar, same inset and width as the
   tab bar; app.js sets --dock-h to its height so the page, the plan and toasts leave room for it */
.dock { position: fixed; left: 50%; transform: translateX(-50%); width: var(--tab-w); bottom: calc(var(--tab-bottom) + var(--tab-h) + var(--gap-s)); display: grid; gap: var(--gap-s); z-index: 20; }
.dock:empty { display: none; }
/* the bar's buttons sit --rec-pad inside its corner: r-recitem = r-tab - rec-pad */
.recbar { height: 64px; padding: var(--rec-pad) var(--rec-pad) var(--rec-pad) 16px; border-radius: var(--r-tab); background: var(--ink); color: var(--bg); display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.recdot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex: none; animation: recpulse 1.3s ease-in-out infinite; }
.recdot.sm { width: 8px; height: 8px; animation: none; display: inline-block; }
@keyframes recpulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 55%, transparent); } 60% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .recdot { animation: none; } }
.recbar .tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.recbar .tx b { font: 650 14.5px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recbar .tx > span { font: 500 12px/1.2 var(--sans); opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recbar .mono { font: 600 14.5px/1 var(--mono); }
.rbtn { height: 48px; border-radius: var(--r-recitem); padding: 0 14px; font: 650 14px/1 var(--sans); background: color-mix(in oklab, var(--bg) 16%, transparent); color: var(--bg); border: 0; cursor: pointer; flex: none; display: inline-flex; align-items: center; gap: 6px; }
.rbtn svg, .lbtn svg { width: 16px; height: 16px; flex: none; }
.rbtn.stop { background: var(--accent); color: var(--on-accent); }
.rbtn:disabled { opacity: .4; cursor: default; }
/* the update notice: same corner; its icon tile sits rec-pad + border inside it */
.updbar { min-height: 64px; display: flex; align-items: center; gap: 12px; padding: var(--rec-pad) 16px var(--rec-pad) var(--rec-pad); border-radius: var(--r-tab); background: var(--surface); border: var(--bw) solid var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.16); }
.updbar .ic { width: calc(64px - 2 * var(--rec-pad) - 2 * var(--bw)); height: calc(64px - 2 * var(--rec-pad) - 2 * var(--bw)); border-radius: calc(var(--r-tab) - var(--rec-pad) - var(--bw)); background: var(--accent-wash); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.updbar .tx { flex: 1; min-width: 0; display: grid; gap: 2px; } .updbar .tx b { font: 650 14.5px/1.25 var(--sans); } .updbar .tx span { font: 500 12.5px/1.3 var(--sans); color: var(--ink-2); }
/* the app's own update (appUpdBar): the same padding on every side, so the button and the X at the edge share the bar's
   corner centre: their size is the icon's, their radius the bar's minus the padding and the border */
.updbar.appupd { --appupd-in: calc(64px - 2 * var(--rec-pad) - 2 * var(--bw)); padding: var(--rec-pad); gap: var(--rec-pad); }
.updbar.appupd .tx b { font-size: 14px; text-wrap: balance; }
.updbar.appupd .btn.sm, .updbar.appupd .iconbtn { min-height: var(--appupd-in); height: var(--appupd-in); border-radius: calc(var(--r-tab) - var(--rec-pad) - var(--bw)); text-decoration: none; }
.updbar.appupd .iconbtn { width: var(--appupd-in); }
/* the leave question: same corner as the bar; its three big buttons (Still here, Pause, Stop: the icon over the word)
   sit rec-pad + border inside it (concentric) */
.leavebar { display: grid; gap: var(--rec-pad); padding: var(--rec-pad); border-radius: var(--r-tab); background: var(--surface); border: var(--bw) solid var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.16); }
.leavebar .tx { display: grid; gap: 2px; padding: 8px 10px 0; } .leavebar .tx b { font: 650 15px/1.25 var(--sans); text-wrap: balance; } .leavebar .tx span { font: 500 12.5px/1.3 var(--sans); color: var(--ink-2); }
.leavebar .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--rec-pad); }
.lbtn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px; border-radius: calc(var(--r-tab) - var(--rec-pad) - var(--bw)); padding: 6px 8px; font: 650 13.5px/1.2 var(--sans); text-align: center; text-wrap: balance; background: var(--surface-2); color: var(--ink); border: 0; cursor: pointer; }
.lbtn svg { width: 18px; height: 18px; }
.lbtn.left { background: var(--accent); color: var(--on-accent); }
.lbtn:disabled { opacity: .5; cursor: default; }
/* "Where are you right now?" (where.js): rooms in two columns (room names need the width at 375 px), the best guess
   first with a small line under its name; on the map the guess outlined, the other offered rooms dashed */
.leavebar .row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lbtn small { font: 500 11px/1.2 var(--sans); opacity: .8; }
.where .lbtn { overflow-wrap: anywhere; }
.rm.ask .zr { stroke: var(--accent); stroke-width: 8; }
.rm.askalt .zr { stroke: var(--accent); stroke-width: 4; stroke-dasharray: 14 10; }
.whereseg button { padding-inline: 4px; min-width: 0; }
/* Me, the quiet hours of the questions (where.js): From and To side by side, a spinner beside the title while saving */
.quietrow { display: grid; gap: 6px; }
.quietrow .qhd { display: flex; align-items: center; gap: 8px; min-height: 18px; font: 600 13px var(--sans); color: var(--ink-2); }
.qspin { width: 18px; height: 18px; flex: none; }
.qfields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-s); }
.qfield { display: grid; gap: 4px; min-width: 0; } .qfield > span { font: 500 12.5px/1.2 var(--sans); color: var(--ink-2); }
.qfield .input { min-width: 0; appearance: none; -webkit-appearance: none; text-align: start; font-variant-numeric: tabular-nums; }
.qfield .input::-webkit-date-and-time-value { text-align: start; }
/* the dock's card (app.js recCard): recording on the ink, paused, Switch and the favorites on the surface (opaque: the
   map's sheet runs behind it). Everything in it
   sits --dock-pad inside its corner (r-dockitem = r-tab - dock-pad); the light card's outline is a shadow, so no border
   joins the derivation. Its rows: the head (icon tile or dot, what and how long, Cancel), the buttons, the favorites. */
.reccard { display: grid; gap: var(--gap-s); padding: var(--dock-pad); border-radius: var(--r-tab); background: var(--ink); color: var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.reccard.light { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 var(--bw) var(--line), 0 10px 30px rgba(0,0,0,.14); }
.rchd { display: flex; align-items: center; gap: 10px; min-height: var(--h-tap); padding-inline-start: calc(var(--r-dockitem) - 6px); }   /* the dot sits at the curve's centre */
.rchd:has(> .rcic) { padding-inline-start: 0; }
.rchd .tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rchd .tx b { font: 650 15px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rchd .tx > span { font: 500 12.5px/1.25 var(--sans); opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rchd > .mono { font: 600 15px/1 var(--mono); font-variant-numeric: tabular-nums; padding-inline-end: calc(var(--r-dockitem) - 8px); }
.rcic { width: var(--h-tap); height: var(--h-tap); border-radius: var(--r-dockitem); display: grid; place-items: center; flex: none; background: var(--accent-wash); color: var(--accent-ink); }
.rcic svg { width: 18px; height: 18px; }
.rcbtns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--gap-s); }
.reccard .rbtn { height: var(--h-tap); border-radius: var(--r-dockitem); justify-content: center; padding: 0 10px; min-width: 0; white-space: nowrap; }
.reccard.light .rbtn { background: var(--surface-2); color: var(--ink); }
.reccard.light .rbtn.stop { background: var(--accent); color: var(--on-accent); }
.rchd > .rbtn { flex: none; }
/* the favorites: chips (icon and short name) in a row that scrolls sideways, clipped to the chips' own corner */
.favrow { display: flex; gap: var(--gap-s); overflow-x: auto; border-radius: var(--r-dockitem); scrollbar-width: none; overscroll-behavior-x: contain; }
.favrow::-webkit-scrollbar { display: none; }
.fchip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: var(--h-tap); padding: 0 16px 0 14px; border-radius: var(--r-dockitem); border: 0; font: 650 14px/1 var(--sans); cursor: pointer; white-space: nowrap;
  background: color-mix(in oklab, var(--bg) 16%, transparent); color: var(--bg); }
.fchip svg { width: 16px; height: 16px; flex: none; } .fchip .mk { flex: none; }
.reccard.light .fchip { background: var(--surface-2); color: var(--ink); }
.fchip[aria-pressed="true"], .reccard.light .fchip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.fchip:disabled { opacity: .45; cursor: default; }
/* the scrubber of "when": a range from 10 minutes back (left) to now (right), and the button that answers with it */
.scrub { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--gap-s); }
.scrub input[type="range"] { width: 100%; height: var(--h-tap); margin: 0; accent-color: var(--accent); cursor: pointer; display: block; }
/* every slider: the shared slider.js (AGENTS.md rule 11) drives touches through this wrapper */
.slide { display: block; min-width: 0; touch-action: pan-y; }
@media (pointer: coarse) { .slide input { pointer-events: none; } }
.scrub .btn, .scrub .rbtn { font-variant-numeric: tabular-nums; white-space: nowrap; }
.scrub.stop { grid-template-columns: minmax(0, 1fr); }   /* the slider, then "Stop at 19:30" filled, full width */
.inblock > .scrub .btn { border-radius: var(--r-inblockctl); }   /* in the block's right corners */
.reccard .scrub { padding-inline-start: calc(var(--r-dockitem) - 12px); }
/* a room or spot sheet's actions: Record beside the star, "Nobody here" under them (its bar while it runs) */
.recmain { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--gap-s); } .recmain.one { grid-template-columns: 1fr; }
.favbtn { width: auto; } .favbtn[aria-pressed="true"] { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-wash); }
.nobody .row b { font: 650 15px/1.25 var(--sans); } .nobody .mono { font: 600 14px/1 var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.nbar { height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; }
.nbar i { display: block; height: 100%; border-radius: 4px; background: var(--good); transition: width 1s linear; }
.nobody > .btn.sm { justify-self: start; }
.legend i.em { background: color-mix(in oklab, var(--good) 24%, var(--floor)); box-shadow: inset 0 0 0 1px var(--line); }
/* the Stop sheet ("when"): Just now the largest, the other answers rows at least 56 px, "Don't remember" apart */
.btn.big { min-height: 64px; font-size: 18px; } .btn.big svg { width: 22px; height: 22px; }
.whenlist { --h-lrow: 56px; } .whenlist .lrow .tx b { font: 600 16px/1.25 var(--sans); font-variant-numeric: tabular-nums; }
.whenlist .lrow .tx b span { font: inherit; color: var(--ink-2); }
.sheet > .apart { margin-top: calc(var(--gap-l) - 12px); }
@media (prefers-reduced-motion: reduce) { .nbar i, .msmore > * { transition: none; } }
.pill.rec { background: var(--accent-wash); color: var(--accent-ink); } .pill.rec i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip.recchip { cursor: default; background: var(--accent-wash); color: var(--accent-ink); }
/* what Record records, said first: a block (the sheet's inner corner) with an icon tile and one line, Record and the star
   under it. The whole room is the movement blue (a wave), one spot the accent with the map's round spot marker.
   The tile and the buttons sit --inblock-pad inside the block's corner: --r-inblockctl. */
.recmode { display: grid; gap: var(--gap-s); padding: var(--inblock-pad); border-radius: var(--r-insheet); background: var(--surface-2); }
.recmode.bare { padding: 0; background: none; }
.recmode .recmain .btn { border-radius: var(--r-inblockctl); }
.recmode .favbtn { width: 56px; padding: 0; }   /* the star alone beside Record (its name is its label), so Record keeps one line at 375 px */
.recmode.bare .recmain .btn { border-radius: var(--r-ctl); }
.rmhd { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.rmhd .tx { display: grid; gap: 2px; min-width: 0; } .rmhd b { font: 650 16px/1.25 var(--sans); } .rmhd .tx > span { font: 14px/1.35 var(--sans); color: var(--ink-2); text-wrap: pretty; }
.rmic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: var(--r-inblockctl); background: var(--act-wash); color: var(--act); }
.recmode.spot .rmic { background: var(--accent-wash); color: var(--accent-ink); }
.rmring { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 3px currentColor; }
.recarea { display: grid; gap: var(--gap-s); } .recwho { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recwho > .t-small { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mk.sp { border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink-2); }
.recrow .end { gap: var(--gap-xs); } .recrow.gone .tx b { color: var(--ink-3); text-decoration: line-through; }
/* a spot's model under its room in the Model card, and the legend's "how sure at a spot" (a spot filled by its live p) */
.lrow.sub { padding-inline-start: 14px; }
.legend i.spp { border-radius: 50%; background: linear-gradient(90deg, var(--surface), var(--act)); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
/* the span set by hand (app.js spanEditor): the bar is a control in the block (--r-inblockctl). Its bands sit --span-pad
   inside it: what was pressed (the wash) and the 10 minutes either side an edge may move out to (hatched); the part
   kept sits --kept-pad inside those, so each corner is the one around it minus the gap between them */
.endedit { --span-pad: 2px; --kept-pad: 3px; --r-band: calc(var(--r-inblockctl) - var(--span-pad)); --r-kept: max(0px, calc(var(--r-band) - var(--kept-pad))); }
.endspan { position: relative; height: 30px; border-radius: var(--r-inblockctl); background: var(--surface); }
.endspan > i { position: absolute; top: var(--span-pad); bottom: var(--span-pad); }
.endspan .room, .endspan .pressed, .endspan .kept { left: calc(var(--span-pad) + (100% - 2 * var(--span-pad)) * var(--a, 0)); width: calc((100% - 2 * var(--span-pad)) * (var(--b, 1) - var(--a, 0))); min-width: 2px; border-radius: var(--r-band); }
.endspan .room { background: repeating-linear-gradient(45deg, var(--surface) 0 4px, var(--line) 4px 6px); }
.endspan .pressed { background: linear-gradient(var(--act-wash), var(--act-wash)), var(--surface); }
.endspan .kept { top: calc(var(--span-pad) + var(--kept-pad)); bottom: calc(var(--span-pad) + var(--kept-pad)); border-radius: var(--r-kept); background: var(--act); transition: left .15s, width .15s; }
.endspan .mark { top: -3px; bottom: -3px; left: calc(var(--span-pad) + (100% - 2 * var(--span-pad)) * var(--at, 0)); width: 3px; translate: -50% 0; border-radius: 1.5px; background: var(--accent); box-shadow: 0 0 0 1.5px var(--surface-2); }
/* scrubbing: a drag on the bar moves the nearer edge (app.js scrubTo). The bar takes the gesture (no scroll from it);
   its hit area reaches 8px past it, and a knob marks each edge of the kept part. No transition while dragging. */
.endspan { touch-action: none; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.endspan::after { content: ""; position: absolute; inset: -8px 0; }
.endspan .knob { top: 50%; left: calc(var(--span-pad) + (100% - 2 * var(--span-pad)) * var(--at, 0)); width: 16px; height: 16px; translate: -50% -50%; border-radius: 50%; background: var(--surface); border: 2px solid var(--act); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.endspan.scrub .kept { transition: none; }
.endspan.scrub .knob { scale: 1.2; }
@media (prefers-reduced-motion: reduce) { .endspan .kept { transition: none; } }
.spanax { display: grid; white-space: nowrap; letter-spacing: -.02em; grid-template-columns: calc(var(--m) * 100%) 1fr 1fr calc(var(--m) * 100%); font: 500 10px/1 var(--mono); color: var(--ink-3); }
.spanax span:nth-child(n+3) { text-align: right; }
.edgerow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 10em); align-items: center; gap: var(--gap-s); }
.edgerow + .edgerow { margin-top: var(--gap-xs); }
.edgerow .nudges { grid-column: 1 / -1; }
.endedit .input { font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* iPhone Safari draws time fields its own way (grey pill, centred, its own height): make them look like every other field */
.endedit input[type="time"] { -webkit-appearance: none; appearance: none; min-width: 0; display: flex; align-items: center; text-align: left; }
.endedit input[type="time"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.nudges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-s); }
.nudges .btn.sm { width: 100%; padding-inline: 4px; border-radius: var(--r-inblockctl); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* a text button inside a sentence (the leave question's "another time?") */
.lnk { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; position: relative; }
.lnk::after { content: ""; position: absolute; inset: -12px -6px; }

/* ---------- sheets move: they slide in, follow a drag (app.js sheetMove) and settle or fly off ---------- */
@keyframes sheetin { from { translate: 0 calc(100% + 24px); } }
@keyframes fadein { from { opacity: 0; } }
.sheet { animation: sheetin .34s cubic-bezier(.2, .8, .2, 1); } .scrim { animation: fadein .25s ease; }
.sheet.settle { transition: translate .28s cubic-bezier(.2, .8, .2, 1); } .scrim.out { opacity: 0; transition: opacity .26s; }
.sheet .grab, .sheet .hd { touch-action: none; }   /* the drag handles: a finger there moves the sheet, not its scroll */
.sheet .grab::after, .msheet .grab::after { content: ""; position: absolute; inset: -6px -40px -10px; }   /* a grab big enough to take */

/* ---------- the phone's House (app.js mapView, below 900 px): the plan is the screen ----------
   Layers: the map, the floating floor switch and live pill, the sheet (15), the tab bar's blur (18), the dock and
   the tab bar (20), sheets of their own (30, 40). */
html:has(.mapview), html:has(.mapview) body { overflow: hidden; height: 100%; }   /* the map owns the gestures; its sheet scrolls */
/* its padding is the safe areas, which app.js reads (safe()) */
.mapview { position: fixed; inset: 0; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); background: var(--bg); }
.map { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.mapin { position: absolute; transform-origin: 0 0; }
.mapin > svg { display: block; width: 100%; height: auto; }
/* floating controls: glass on the map */
.maptop { position: absolute; z-index: 10; top: calc(env(safe-area-inset-top) + 10px); left: var(--gutter); right: var(--gutter); display: flex; justify-content: space-between; align-items: flex-start; gap: var(--gap-s); pointer-events: none; }
.maptop > * { pointer-events: auto; }
.maptop .seg, .maptop .live, .mapfit { background: color-mix(in oklab, var(--surface) 80%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 0 0 var(--bw) var(--line), 0 6px 20px rgba(0, 0, 0, .12); }
/* the live sensing map is a screen of the Sensing tools: Back returns there (Rev C) */
.mapleft { display: flex; gap: var(--gap-s); align-items: center; min-width: 0; flex: 0 1 auto; }
.maptop .mapback { border: 0; background: color-mix(in oklab, var(--surface) 80%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 0 0 var(--bw) var(--line), 0 6px 18px rgba(0,0,0,.08); }
.maptop .seg { flex: 0 1 auto; min-width: 0; }   /* its outline is a shadow, so its buttons' corner is r-ctl minus its padding only */
.maptop .seg button { padding-inline: 8px; white-space: nowrap; }
/* the floor switch on the map: the shown floor is filled in ink (dark on light, light on dark), the other one quiet
   ink on the glass; a walk that changes floor makes the new one pop (cal.js) */
.floorseg button { color: var(--ink-2); transition: background .2s, color .2s; }
.floorseg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,.22); }
.floorseg button[aria-pressed="true"] .ct { background: var(--bg); color: var(--ink); }
.floorseg.flip button[aria-pressed="true"] { animation: segpop .6s cubic-bezier(.2, .8, .2, 1); background: var(--accent); color: var(--on-accent); }
@keyframes segpop { 0% { transform: scale(.82); } 55% { transform: scale(1.08); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .floorseg.flip button[aria-pressed="true"] { animation: none; } }
.mapbtns { display: grid; justify-items: end; gap: var(--gap-s); min-width: 0; }
.maptop .live > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.maptop .live { border: 0; height: var(--h-tap); white-space: nowrap; max-width: 44vw; min-width: 0; padding-inline: calc(var(--h-tap) / 2 - 4px) 16px; }   /* the dot sits at the pill end's centre */
.mapfit { width: var(--h-tap); height: var(--h-tap); color: var(--ink); }
.mapfit svg { width: 20px; height: 20px; }
/* the sheet: as wide as a sheet of its own, its bottom below the screen; app.js sets its height and where it stops */
.msheet { position: absolute; z-index: 15; top: 0; left: 0; right: 0; margin-inline: auto; width: calc(min(100vw, var(--page-w)) - 2 * var(--sheet-inset)); height: 100dvh; transform: translateY(100dvh);
  display: flex; flex-direction: column; background: var(--surface); border: var(--bw) solid var(--line); border-bottom: 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .14); transition: transform .34s cubic-bezier(.2, .8, .2, 1); touch-action: none; }
.msheet.still, .msheet.drag { transition: none; }
.msbody { flex: 1; min-height: 0; overflow: hidden; display: grid; align-content: start; gap: 12px; padding: var(--pad-sheet) var(--pad-sheet) var(--ms-padb, 200px); overscroll-behavior: contain; }
.msbody:not(.scroll), .msbody:not(.scroll) * { touch-action: none; }   /* overflow hidden makes it a scroll container: its children need their own none, or a drag from a row pans and cancels */
.msbody.scroll { overflow-y: auto; touch-action: pan-y; }
.msmore { display: contents; }
/* collapsed, what lies below the summary line stays out of the strip between it and the dock's card (shown again as
   soon as a finger pulls the sheet) */
.msmore > * { transition: opacity .2s; } .msmore[inert] > * { opacity: 0; } .msheet.drag .msmore > * { opacity: 1; }
.msbody .grab, .msbody .mshd, .msbody .hd { touch-action: none; }
/* the summary line: the sheet's header, a tap opens it to half height */
.mssum { display: flex; align-items: center; width: 100%; min-height: var(--h-tap); margin-top: 2px; padding: 0 4px; border: 0; background: none; text-align: start; cursor: pointer; }
/* it wraps (German and French run long) to two lines at most; app.js measures the sheet's peek from it */
.mssum b { min-width: 0; font: 650 17px/1.25 var(--display); letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.mshd + .t-sec { margin-top: calc(var(--gap-l) - 12px); }
/* cards and lists in the sheet take the sheet's inner corner (r-insheet), their icon tiles that minus their padding */
.msbody .list, .msbody .card-p, .msbody .banner { --pad-card: var(--inblock-pad); border-radius: var(--r-insheet); }
.msbody .lrow .ic, .msbody .now .pulse, .msbody .banner .ic { border-radius: calc(var(--r-insheet) - var(--inblock-pad) - var(--bw)); }
.mapextra { display: grid; gap: var(--gap-s); } .mapextra .legend { padding-inline: 0; }
.lrow .ic.on { background: var(--act); color: var(--on-act); }
/* the tab bar blurs the map and the sheet behind it, fading out upward as in native apps */
.tabfade { position: absolute; z-index: 18; left: 0; right: 0; bottom: 0; height: calc(var(--tab-bottom) + var(--tab-h) + 36px); pointer-events: none;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); -webkit-mask-image: linear-gradient(to top, #000 50%, transparent); mask-image: linear-gradient(to top, #000 50%, transparent); }
/* toasts on the map show above the sheet's visible part (app.js --ms-vis) */
body:has(.mapview) .toast { bottom: calc(var(--ms-vis, 0px) + var(--gap)); }
/* pull to refresh (ptr.js, the same as the Besendorf app's; the timings are written there). The row spans the screen and centres the chip, so the only
   movement is one translateY: never sideways. The ring turns around its own centre. */
.ptr { position: fixed; left: 0; right: 0; top: env(safe-area-inset-top); z-index: 25; display: flex; justify-content: center; pointer-events: none;
  transform: translate3d(0, var(--ptr-y, -44px), 0); opacity: var(--ptr-o, 0); }   /* no layer hint here (test_mapsheet) */
.ptr.settle { transition: transform 420ms cubic-bezier(.22, 1, .36, 1), opacity 120ms linear; }   /* eases into the rest spot, no overshoot: it stays still while it spins */
.ptr.cancel { transition: transform 300ms cubic-bezier(.2, .9, .3, 1), opacity 200ms linear; }
.ptrc { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0,0,0,.18); transition: transform 220ms ease-in, opacity 220ms ease-in; }
.ptr.done .ptrc { transform: scale(.3); opacity: 0; }
.ptrs { display: block; transform-origin: 50% 50%; transform: rotate(-90deg); }
.ptrtrack { fill: none; stroke: var(--line); stroke-width: 2.5; }
.ptrarc { fill: none; stroke: var(--ink-3); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 100 100; }
.ptr.ready .ptrarc, .ptr.spin .ptrarc { stroke: var(--accent); }
.ptr.spin .ptrarc { stroke-dashoffset: 72 !important; }   /* a quarter ring that turns */
.ptr.spin .ptrs { animation: ptrspin 800ms linear infinite; }
@keyframes ptrspin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
@media (prefers-reduced-motion: reduce) {
  .ptr.settle, .ptr.cancel { transition: opacity 150ms linear; }
  .ptr.spin .ptrs { animation: ptrpulse 1.2s ease-in-out infinite; }
  .ptr.spin .ptrarc { stroke-dashoffset: 0 !important; }
  .ptr.done .ptrc { transform: none; }
  @keyframes ptrpulse { 50% { opacity: .45; } }
}
@media (prefers-reduced-motion: reduce) { .sheet, .scrim { animation: none; } .sheet.settle, .scrim.out, .msheet { transition: none; } }

/* ---------- calibration walks (cal.js) ---------- */
/* the walk card: the directions wrap (they are the point of it); its button sits --dock-pad inside the card's corner */
.calcard .rchd .tx > span { white-space: normal; text-wrap: pretty; }
.calcard > .btn { border-radius: var(--r-dockitem); min-height: 52px; }
.rcbtns.three { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row; }
.calhold { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-s); padding-inline: calc(var(--r-dockitem) - 8px); }
.calhold .mono { font: 600 22px/1 var(--mono); font-variant-numeric: tabular-nums; }
/* the hold's progress: a bar whose ends are round, inside the card's padding */
.calbar { height: 8px; border-radius: 4px; background: color-mix(in oklab, var(--bg) 20%, transparent); overflow: hidden; margin-inline: calc(var(--r-dockitem) - 8px); }
.calbar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); }
@keyframes calfill { from { width: 0; } to { width: 100%; } }   /* cal.js startBars: as long as the stay, started where the clock is */
/* the next point is on the other floor: said under the bar, the chevron pointing the way */
.calnext { display: flex; align-items: center; gap: 8px; padding-inline: calc(var(--r-dockitem) - 8px); font: 650 14px/1.3 var(--sans); }
.calnext svg { flex: none; color: var(--accent); transform: rotate(-90deg); } .calnext.down svg { transform: rotate(90deg); }
/* the map changed floor for the walk: a short banner at the top of the map */
.floorbanner { position: absolute; z-index: 12; left: 50%; top: calc(env(safe-area-inset-top) + 10px + var(--h-tap) + var(--gap)); display: inline-flex; align-items: center; gap: 8px; height: var(--h-tap); padding: 0 20px 0 14px; border-radius: calc(var(--h-tap) / 2);
  background: var(--accent); color: var(--on-accent); font: 700 16px/1 var(--sans); box-shadow: 0 8px 24px rgba(0,0,0,.2); pointer-events: none; animation: floorban 2.4s cubic-bezier(.2, .8, .2, 1) both; }
.floorbanner svg { transform: rotate(-90deg); } .floorbanner.down svg { transform: rotate(90deg); }
@keyframes floorban { 0% { opacity: 0; transform: translate(-50%, -12px) scale(.9); } 12%, 82% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -6px); } }
@media (prefers-reduced-motion: reduce) { .floorbanner { animation-name: floorbanfade; } }
@keyframes floorbanfade { 0%, 100% { opacity: 0; transform: translateX(-50%); } 10%, 85% { opacity: 1; transform: translateX(-50%); } }
/* the walk is over: two numbers side by side, what happens next under them */
.calfin { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-s); }
.calstat { display: grid; gap: 2px; padding: var(--inblock-pad); border-radius: var(--r-insheet); background: var(--surface-2); }
.calstat b { font: 700 26px/1.1 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; } .calstat span { font: 13px/1.3 var(--sans); color: var(--ink-2); }
.calfinhd { font: 650 15px/1.25 var(--sans); }
.calest { display: grid; gap: 4px; }
.calest b { font: 650 16px/1.25 var(--sans); }
.calsel { width: auto; flex: 0 1 auto; min-width: 0; max-width: 62%; }
.calchart { width: 100%; height: auto; }
.calpt { cursor: default; } .calpt[data-draggable] { cursor: grab; }
.calring { animation: calpulse 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes calpulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .calring { animation: none; } }

/* ---------- furniture (furn.js, a computer only) ---------- */
.furn { cursor: grab; } .fhandle { cursor: grab; }
.fixpick { cursor: copy; } .fixpick:hover > * { fill: color-mix(in oklab, var(--accent) 30%, var(--fixf)); }
.furn:focus-visible { outline: none; } .furn:focus-visible > :first-child { stroke: var(--accent); stroke-width: 4; }
.furned { display: grid; gap: var(--gap-s); }
.furnnums { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: var(--gap-s); }
.numin { display: flex; align-items: center; gap: 6px; } .numin input { min-width: 0; } .numin span { color: var(--ink-3); font: 500 13px var(--sans); }

/* "Where are you right now?" as a sheet (where.js): the rooms stacked, the best guess filled, its "best guess" under the name */
.wherebtns { display: grid; gap: var(--gap-s); }
.wherebtns .btn { min-height: 56px; border-radius: var(--r-insheet); }
.wherebtns .btn.primary { flex-direction: column; gap: 2px; }
.wherebtns .btn small { font: 600 12px/1 var(--sans); opacity: .75; }
/* The lock screen and "Confirm on your phone" are the shared page code's (onekey.js, onekey.css): here they only take
   BesenPose's colours, light and dark. Their sizes and radii stay onekey.css's own (its sheet's corner is derived
   there from its button's radius and the padding between them). */
.ok-lock, .ok-back { --ok-bg: var(--bg); --ok-surface: var(--surface); --ok-raised: var(--surface-2); --ok-ink: var(--ink); --ok-ink-2: var(--ink-2);
  --ok-line: var(--line); --ok-accent: var(--accent); --ok-accent-ink: var(--accent-ink); --ok-on-accent: var(--on-accent); --ok-bad: var(--bad); }

/* ---------- BesenVakt (design/besenvakt-redesign/rev-c.html, the spec; app.js "BesenVakt") ----------
   One chain of corners with the rest of the app: a card is r-card (r-ctl + pad-card + bw), what sits in a card's
   padding is r-ctl, a pill is half its height, and a sheet's corner is its pill's radius plus the padding between
   them. Every inner radius below is derived from its outer one (or the other way round), never typed twice. */
:root { --h-vrow: 60px; --ic-v: 32px; --h-btn: 52px; --r-btn: calc(var(--h-btn) / 2);
  --arm: 160px; --ring-gap: 6px; --ring-w: 3px; --arm-box: calc(var(--arm) + 2 * (var(--ring-gap) + var(--ring-w)));
  --r-display: calc(var(--tab-inset) + var(--r-tabbar)); }   /* the display's corner the tab bar is concentric with */

/* the top and bottom scroll edges: the status bar's band is opaque (nothing reads through it under the clock), then a
   short fade; under the tab bar the page blurs and fades out, as in native apps */
.topedge { position: fixed; z-index: 19; left: 0; right: 0; top: 0; height: calc(env(safe-area-inset-top) + 8px); background: var(--bg); pointer-events: none; }
.topedge::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; background: linear-gradient(var(--bg), color-mix(in oklab, var(--bg) 0%, transparent)); }
.tabedge { position: fixed; z-index: 19; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + 2 * var(--tab-bottom) + 18px); pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in oklab, var(--bg) 0%, transparent), color-mix(in oklab, var(--bg) 88%, transparent) 42%, var(--bg));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%); mask-image: linear-gradient(to bottom, transparent, #000 45%); }
.kbd .tabedge { display: none; }

/* headers, Back, titles, groups */
.vtop { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.vtop .tl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vtop .tl img { width: 30px; height: 30px; flex: none; }
.vtop .tr { display: flex; align-items: center; gap: 8px; flex: none; }
.ltitle { font: 700 32px/1.05 var(--display); letter-spacing: -.02em; margin: 0; }
.hbtn { width: var(--h-tap); height: var(--h-tap); border-radius: 50%; border: var(--bw) solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; transition: transform .1s, background .15s; }
.hbtn svg { width: 22px; height: 22px; display: block; }
.hbtn:hover { background: var(--surface-2); } .hbtn:active { transform: scale(.95); }
.offpill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; border: var(--bw) solid var(--line); background: var(--surface-2); color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer; }
.offpill svg { width: 16px; height: 16px; }
.navbar { display: flex; align-items: center; min-height: var(--h-tap); margin-bottom: calc(-1 * var(--gap-s)); }
.backbtn { display: inline-flex; align-items: center; gap: 2px; height: var(--h-tap); padding: 0 14px 0 6px; margin-left: -6px; border: 0; border-radius: calc(var(--h-tap) / 2); background: none; color: var(--accent-ink); font: 600 17px/1 var(--sans); cursor: pointer; max-width: 100%; }
.backbtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backbtn:hover { background: var(--accent-wash); } .backbtn svg { width: 22px; height: 22px; flex: none; }
.grp { display: grid; gap: 10px; }
.gh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 4px; }
.gh h2 { font: 650 17px/1.2 var(--sans); margin: 0; letter-spacing: -.005em; }
.gh > span { font: 500 14px/1.2 var(--sans); color: var(--ink-2); }
.foot { font: 400 14px/1.45 var(--sans); color: var(--ink-2); padding: 0 4px; }
.vdeep { gap: var(--gap-l); }   /* Settings, its lists and All activity: room between the groups */
.vdeep > .navbar + .ltitle { margin-top: calc(-1 * var(--gap-l) + var(--gap-s)); }

/* lists: the 32 px icon tiles sit as far from the list's top and bottom as from its side, so the list's corner is
   concentric with theirs (the row centres the tile, the list's padding adds the rest) */
.vlist { --h-row: var(--h-vrow); background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-card);
  padding: calc(var(--pad-card) - (var(--h-row) - var(--ic-v)) / 2) var(--pad-card); display: grid; }
.vlist.one { --h-row: 52px; }
.vrow { display: flex; align-items: center; gap: 12px; min-height: var(--h-row); width: 100%; border: 0; background: none; color: inherit; text-align: left; padding: 0; font: inherit; position: relative; }
.vrow + .vrow::before { content: ""; position: absolute; top: 0; left: calc(var(--ic-v) + 12px); right: 0; border-top: var(--bw) solid var(--line); }
.vrow[hidden] + .vrow::before, .vrow:first-child::before { display: none; }
button.vrow { cursor: pointer; border-radius: var(--r-ctl); }
button.vrow:hover .tx b { color: var(--accent-ink); }
button.vrow:disabled { cursor: default; } button.vrow:disabled .tx b { color: inherit; } button.vrow:disabled .end svg { opacity: .4; }
.vrow .ic { width: var(--ic-v); height: var(--ic-v); border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; position: relative; }
.vrow .ic svg { width: 18px; height: 18px; }
.ic.armed { background: var(--armed-wash); color: var(--armed-ink); } .ic.bad { background: var(--bad-wash); color: var(--bad); }
.ic.good { background: var(--good-wash); color: var(--good); } .ic.acc { background: var(--accent-wash); color: var(--accent-ink); }
/* something to look at that is not an alarm (the robot that started by itself): the calm icon with a small ink badge */
.vrow .ic.badge::after { content: ""; position: absolute; right: -2px; top: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.vrow .tx { display: grid; gap: 2px; min-width: 0; flex: 1; }
.vrow .tx b { font: 600 16px/1.25 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow .tx small { font: 400 14px/1.3 var(--sans); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow .tx .fid { width: 15px; height: 15px; vertical-align: -2px; margin-left: 6px; color: var(--ink-2); }
.vrow .end { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font: 500 15px/1.2 var(--sans); flex: none; text-align: right; }
.vrow .end > svg { width: 16px; height: 16px; color: var(--ink-3); }
.vrow .end .ok { width: 20px; height: 20px; color: var(--accent-ink); }
.vrow .when { display: grid; justify-items: end; gap: 2px; font: 500 14px/1.2 var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; flex: none; }
.vrow .when small { font-size: 12.5px; color: var(--ink-3); }
.vrow[hidden] { display: none !important; }

/* pills: buttons are half their height round, so they nest in sheets by one rule */
.pbtn { font: 650 17px/1.2 var(--sans); min-height: var(--h-btn); padding: 0 22px; border-radius: var(--r-btn); border: var(--bw) solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; text-wrap: balance; transition: background .15s, transform .08s; }
.pbtn:hover { background: var(--surface-2); } .pbtn:active { transform: scale(.98); }
.pbtn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.pbtn.primary:hover { background: color-mix(in oklab, var(--accent) 88%, black); }
.pbtn.block { width: 100%; }
.pbtn.sm { --h-btn: 40px; font-size: 15px; padding: 0 14px; }
.pbtn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.pbtn.primary:disabled { opacity: 1; background: var(--surface-2); color: var(--ink-3); }
.pbtn.busy:disabled { cursor: progress; }
.pbtn.primary.busy:disabled { background: var(--accent); color: var(--on-accent); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; display: inline-block; }
.spin.sm { width: 14px; height: 14px; }

/* the arm button: one round button with one ring outside it (circles are concentric by construction). Disarmed: white,
   a broken ring. Armed: the blue of the logo, a closed ring, the logo's amber heart. Armed but not watching movement
   (the robot cleans): a greyer blue, the ring open at the top, the robot instead of the heart. Confirming: a thin full
   ring with a travelling arc. */
.vhero { display: grid; justify-items: center; gap: 8px; text-align: center; position: relative; isolation: isolate; }
.vhero::before { content: ""; position: absolute; left: 50%; top: calc(var(--arm-box) / 2); width: calc(var(--arm) * 2); height: calc(var(--arm) * 2); translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, var(--halo, transparent), transparent); transition: background .4s; z-index: -1; }
.vhero.on { --halo: var(--armed-wash); }
.arm { --box: calc(var(--arm) + 2 * (var(--ring-gap) + var(--ring-w))); width: var(--box); height: var(--box); border-radius: 50%; border: 0; padding: 0; background: none; cursor: pointer; position: relative; display: grid; place-items: center; color: var(--ink); -webkit-tap-highlight-color: transparent; flex: none; }
.arm .ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
/* the ring's radius is the box's half less half the ring's width (3 px of 178 to 214 px: 49.2 %, within a tenth of a px) */
.arm .ring circle { fill: none; stroke-width: var(--ring-w); transition: stroke .3s, stroke-dasharray .4s var(--ease); }
.arm .ring .track { stroke: transparent; }
.arm .ring .arc { stroke: var(--ink-3); stroke-linecap: round; stroke-dasharray: 84 16; stroke-dashoffset: -8; }
.arm .core { width: var(--arm); height: var(--arm); border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 4px; padding: 0 14px; background: var(--surface);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 12px 30px -12px rgba(0,0,0,.25), 0 0 0 var(--bw) var(--line); transition: background .35s, color .35s, transform .12s; }
.arm:active .core { transform: scale(.975); }
.arm .core b { font: 650 23px/1.1 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.arm .core small { font: 500 14px/1.2 var(--sans); color: var(--ink-2); text-wrap: balance; }
.arm .glyph { width: 30px; height: 30px; margin-bottom: 4px; color: var(--ink-2); }
.arm.a-armed .core { background: linear-gradient(160deg, var(--armed), var(--armed-2)); color: var(--on-armed); box-shadow: 0 16px 36px -14px rgba(29,63,143,.65), inset 0 1px 0 rgba(255,255,255,.18); }
.arm.a-armed .core small { color: rgba(255,255,255,.82); } .arm.a-armed .glyph { color: #fff; }
.arm.a-armed .ring .arc { stroke: var(--armed); stroke-dasharray: 100 0; stroke-dashoffset: 0; }
.arm.a-partial .ring .arc { stroke-dasharray: 84 16; stroke-dashoffset: -8; }
.arm.a-partial .core { background: linear-gradient(160deg, color-mix(in oklab, var(--armed) 55%, #8A93A6), color-mix(in oklab, var(--armed-2) 60%, #4A5263)); }
.arm.a-busy { cursor: progress; }
.arm.a-busy .core small { font-size: 13px; }
.arm.a-busy .ring .track { stroke: color-mix(in oklab, var(--ink) 14%, transparent); }
.arm.a-busy .ring .arc { stroke: var(--ink); stroke-dasharray: 16 84; animation: ringspin 1s linear infinite; }
.arm.a-busy.a-armed .ring .arc { stroke: var(--armed); }
@keyframes ringspin { to { stroke-dashoffset: -100; } }
.arm:disabled { cursor: default; } .arm.a-busy:disabled { cursor: progress; }
/* the urgent looks: bigger, around the same centre */
.arm.a-entry, .arm.a-alarm { --arm: 196px; }
.arm.a-entry .core { background: var(--bad-fill); color: var(--on-bad); box-shadow: 0 18px 40px -14px rgba(210,58,48,.6); }
.arm.a-entry .core small { color: rgba(255,255,255,.88); }
.arm.a-entry .ring .track { stroke: var(--bad-wash); }
.arm.a-entry .ring .arc { stroke: var(--bad-fill); stroke-dashoffset: 0; transition: stroke-dasharray 1s linear; }
.arm.a-entry .core b, .arm.a-alarm .core b { font-size: 28px; }
.arm.a-alarm .core { background: #fff; color: #B3261E; box-shadow: 0 18px 44px -12px rgba(0,0,0,.45); }
.arm.a-alarm .core small { color: #8C1D17; } .arm.a-alarm .glyph { color: #B3261E; }
.arm.a-alarm .ring .arc { stroke: rgba(255,255,255,.9); stroke-dasharray: 100 0; animation: pulse 1.2s ease-in-out infinite; }
.arm.a-entry.a-busy .ring .arc { stroke: var(--bad-fill); }
.arm.a-alarm.a-busy .ring .arc { stroke: #fff; animation: ringspin 1s linear infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.sline { font: 500 16px/1.4 var(--sans); color: var(--ink); max-width: 32ch; text-wrap: balance; }
.undo { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 20px; border: var(--bw) solid var(--line); background: var(--surface); color: var(--ink); font: 600 15px/1 var(--sans); cursor: pointer; }
.undo:hover { background: var(--surface-2); } .undo svg { width: 17px; height: 17px; color: var(--armed-ink); }
.dim { opacity: .55; filter: saturate(.4); }

/* the Vakt screen on a phone never scrolls: the button, who's home and the history heading stay; the history rows take
   what is left (app.js fitVakt measures after every change) */
.scr.vfit { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; gap: 12px;
  padding-bottom: calc(var(--tab-h) + var(--tab-bottom) + 10px + var(--dock-h, 0px)); }
.scr.vfit > * { flex: none; }
.scr.vfit > .actfit { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.actfit > .vlist { flex: none; }
.actfit > .vlist[hidden] { display: none; }
.acthead { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: var(--h-tap); padding: 0 4px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; width: 100%; text-align: left; flex: none; border-radius: var(--r-ctl); }
.acthead h2 { font: 650 17px/1.2 var(--sans); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.acthead span { display: inline-flex; align-items: center; gap: 2px; font: 600 15px/1 var(--sans); color: var(--accent-ink); flex: none; }
.acthead span svg { width: 16px; height: 16px; }
@media (max-height: 700px) { .scr.vfit { gap: 10px; } .sline { font-size: 15px; } :root { --arm: 140px; --ring-gap: 5px; } }

/* the robot vacuum while disarmed: calm and neutral, one title line and one sub line; its icon and button sit
   --pad-rb + bw inside the card's corner (r-card minus that) */
.vrobot { --pad-rb: var(--pad-card); display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: var(--pad-rb); background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-card); }
.vrobot .ic { width: 40px; height: 40px; border-radius: calc(var(--r-card) - var(--pad-rb) - var(--bw)); display: grid; place-items: center; background: var(--surface-2); color: var(--ink); flex: none; }
.vrobot .ic svg { width: 20px; height: 20px; }
.vrobot .tx { flex: 1 1 0; min-width: 0; display: grid; gap: 2px; }
.vrobot b { font: 650 16px/1.25 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrobot small { font: 400 14px/1.3 var(--sans); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrobot .pbtn { border-radius: calc(var(--r-card) - var(--pad-rb) - var(--bw)); flex: none; margin-left: auto; }
.vrobot.stack .pbtn { flex: 1 1 100%; }

/* Who's home: one strip; each face is concentric with the strip's corner (padding = corner - face radius - border).
   Fixed thirds with a 12 px gap; when a "Home 17:05" doesn't fit its third (narrow phones, long words) the strip drops
   the word and keeps the time beside the presence dot (app.js fitVakt) */
.strip { --avatar: 32px; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px 12px; padding: calc(var(--r-card) - var(--avatar) / 2 - var(--bw));
  background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-card); }
.strip.unknown { --n: 1; }
.pchip { display: flex; align-items: center; gap: 8px; min-width: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; border-radius: calc(var(--avatar) / 2); }
.pchip .av { width: var(--avatar); height: var(--avatar); font-size: 14px; overflow: visible; }
.pchip .av img { border-radius: 50%; }
.pchip .av .dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--surface); background: var(--ink-3); z-index: 1; }
.pchip .av .dot.home { background: var(--good-dot); } .pchip .av .dot.unk { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.pchip .av.away { filter: saturate(.25); opacity: .75; }
.pchip .av.unknown { background: var(--surface-2) !important; color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.pchip > span:last-child { display: grid; min-width: 0; }
.pchip b { font: 650 15px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pchip small { font: 400 13px/1.25 var(--sans); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.pchip small .s { display: none; }
.strip.short .pchip small .l { display: none; } .strip.short .pchip small .s { display: inline; }
.pchip:hover b { color: var(--accent-ink); }
.strip .note { font: 500 14.5px/1.35 var(--sans); color: var(--ink-2); padding: 6px 4px; }

/* Settings: read only for members; the field with its clear button inside (the button's corner concentric with the
   field's: r-ctl minus the gap between them) */
.ro { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-card); background: var(--surface-2); font: 500 14.5px/1.35 var(--sans); color: var(--ink-2); }
.ro svg { width: 18px; height: 18px; flex: none; }
.vfield { display: grid; gap: 8px; }
.vfield label { font: 600 14px/1 var(--sans); color: var(--ink-2); padding: 0 4px; }
.infield { --pad-in: 6px; --h-in: var(--h-btn); position: relative; }
.infield .input { height: var(--h-in); padding-right: calc(var(--h-in) + 4px); text-overflow: ellipsis; min-width: 0; }
.infield .input[aria-invalid="true"] { border: 2px solid var(--ink); box-shadow: none; }
.infield .clr { position: absolute; top: var(--pad-in); right: var(--pad-in); width: calc(var(--h-in) - 2 * var(--pad-in)); height: calc(var(--h-in) - 2 * var(--pad-in)); border-radius: calc(var(--r-ctl) - var(--pad-in)); border: 0; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.infield .clr svg { width: 18px; height: 18px; } .infield .clr:hover { color: var(--ink); } .infield .clr:disabled { opacity: .4; cursor: default; }
.vstatus { display: flex; gap: 8px; align-items: flex-start; font: 500 14.5px/1.4 var(--sans); color: var(--ink-2); padding: 0 4px; }
.vstatus svg { width: 18px; height: 18px; margin-top: 1px; flex: none; } .vstatus.attn { color: var(--ink); font-weight: 600; }
.vempty { display: grid; justify-items: center; text-align: center; padding: 28px 20px; gap: 10px; background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-card); }
.vempty .ic { width: 48px; height: 48px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.vempty b { font: 650 17px/1.3 var(--sans); }

/* the urgent screens: one button, the whole screen, no tab bar. The slot above the button has the Vakt header's
   height and the slot holding it the normal button's, so the bigger button grows around the same centre. */
.urgent { position: fixed; inset: 0; z-index: 25; display: grid; grid-template-rows: 48px var(--arm-box) auto 1fr auto; row-gap: 12px; overflow: hidden; text-align: center;
  padding: calc(env(safe-area-inset-top) + 10px) var(--gutter) calc(env(safe-area-inset-bottom) + 16px); }
.urgent > * { min-width: 0; }
.urgent .uhead { display: grid; place-items: center; }
.urgent .slot { position: relative; }
.urgent .slot > .arm { position: absolute; left: 50%; top: 50%; translate: -50% -50%; }
.urgent .utext { padding-top: 20px; display: grid; justify-items: center; }
.urgent .ufoot { display: grid; gap: 10px; align-self: end; max-width: var(--form-w); width: 100%; justify-self: center; }
.urgent.u-entry { background: radial-gradient(120% 70% at 50% 0%, var(--bad-wash), transparent 70%), var(--bg); }
.urgent.u-alarm { background: radial-gradient(100% 60% at 50% 40%, #D8392F, #A3211B); color: #fff; }
.urgent h1 { font: 700 26px/1.1 var(--display); letter-spacing: -.02em; margin: 10px 0 0; text-wrap: balance; }
.urgent.u-alarm h1 { font-size: 34px; margin-top: 18px; }
.urgent .usub { font: 400 16px/1.4 var(--sans); color: var(--ink-2); max-width: 32ch; margin: 8px auto 0; text-wrap: balance; }
.u-alarm .usub { color: rgba(255,255,255,.9); }
.bigcount { display: grid; justify-items: center; gap: 6px; color: var(--bad); }
.bigcount b { font: 700 64px/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bigcount span { font: 600 16px/1.2 var(--sans); }
.ubadge { display: inline-flex; align-items: center; gap: 7px; font: 650 14px/1 var(--sans); letter-spacing: .02em; padding: 8px 12px; border-radius: 16px; background: var(--bad-wash); color: var(--bad); }
.u-alarm .ubadge { background: rgba(255,255,255,.18); color: #fff; }
.ubadge svg { width: 15px; height: 15px; }
.bars { display: inline-flex; gap: 2px; align-items: end; height: 12px; } .bars i { width: 2.5px; background: currentColor; border-radius: 1px; animation: bar .9s ease-in-out infinite; height: 40%; }
.bars i:nth-child(2) { animation-delay: .15s; } .bars i:nth-child(3) { animation-delay: .3s; }
@keyframes bar { 50% { height: 100%; } }
/* where it happened: a card; its icon sits in a well whose corner is r-ctl (the card's padding inside its corner) */
.where2 { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-card); padding: var(--pad-card); }
.u-alarm .where2 { background: rgba(0,0,0,.18); border-color: rgba(255,255,255,.16); color: #fff; }
.where2 .well { width: 48px; height: 48px; border-radius: var(--r-ctl); background: var(--bad-wash); color: var(--bad); flex: none; display: grid; place-items: center; }
.where2 .well svg { width: 24px; height: 24px; }
/* the room with the movement on a small plan: the plan's corner is the well's less its padding (Rev C --r-mini) */
.where2 .well.wellplan { --pad-well: 6px; width: auto; height: auto; padding: var(--pad-well); }
.where2 .well.wellplan .planhost { width: 56px; }
.where2 .well.wellplan svg { width: 56px; height: auto; }
.u-alarm .where2 .well { background: rgba(255,255,255,.14); color: #fff; }
.where2 b { font: 650 16px/1.25 var(--sans); display: block; } .where2 small { font: 400 14px/1.35 var(--sans); color: var(--ink-2); display: block; margin-top: 2px; }
.u-alarm .where2 small { color: rgba(255,255,255,.85); }
.told { font: 400 14px/1.4 var(--sans); color: var(--ink-2); text-wrap: balance; }
.u-alarm .told { color: rgba(255,255,255,.88); }
.urgent .later { justify-self: center; }
.u-alarm .later { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.24); color: #fff; }
@media (max-height: 700px) { .urgent .utext { padding-top: 12px; } .bigcount b { font-size: 52px; } .urgent .usub { font-size: 15px; } }

/* a Rev C sheet (the robot's question): its pills are concentric with it, so the sheet's corner is the pill's radius plus
   the padding (and border) between them; on a phone with a rounded display that padding makes the sheet concentric
   with the display's corner too */
.sheet.rc { --pad-sheet: max(14px, calc(var(--r-display) - var(--sheet-inset) - var(--r-btn) - var(--bw))); --r-sheet: calc(var(--r-btn) + var(--pad-sheet) + var(--bw));
  bottom: var(--sheet-inset); gap: 10px; padding-bottom: max(var(--pad-sheet), env(safe-area-inset-bottom)); }
.sheet.rc .hd { align-items: flex-start; }
.sheet.rc .hd h3 { flex: 1; min-width: 0; font: 700 22px/1.2 var(--display); margin: 0; padding-top: 12px; text-wrap: balance; }
.sheet.rc .hd .hbtn { width: calc(2 * var(--r-btn)); height: calc(2 * var(--r-btn)); background: var(--surface-2); border: 0; }
.sheet.rc p { font: 400 15.5px/1.4 var(--sans); color: var(--ink-2); margin: 0 0 6px; }
.sheet.rc .note { font: 400 14px/1.4 var(--sans); color: var(--ink-2); text-align: center; margin: 2px 0 0; text-wrap: balance; }
.sheet.rc .hd, .sheet.rc .hd h3 { touch-action: none; cursor: grab; }

@media (prefers-reduced-motion: reduce) { .arm .ring .arc, .bars i, .spin, .switch.busy > i::after { animation-duration: 2.4s; } .arm .core, .arm .ring circle { transition: none; } }

/* loading: the button's place held, the rest calm */
.sk { background: var(--surface-2); border-radius: 8px; animation: shimmer 1.4s ease-in-out infinite; }
.skc { width: var(--arm-box); height: var(--arm-box); border-radius: 50%; }
@keyframes shimmer { 50% { opacity: .55; } }

/* on a computer the Vakt tab sits in the side panel: it scrolls there and shows six history rows; an entry delay or
   an alarm is a card in it (the phone stays the urgent device) */
.urgent.inline { position: relative; inset: auto; z-index: auto; border-radius: var(--r-card); padding: 16px; grid-template-rows: auto var(--arm-box) auto auto; }
.urgent.inline > :nth-child(4) { display: none; }

.input.sm { width: auto; height: var(--h-btn-sm); padding: 0 34px 0 10px; }   /* the small fields of the sheets (furniture, a device's name) */

/* ---------- Places and the house map (design/besenvakt-redesign/rev-c.html, sheets 07 and "Places") ----------
   The map card: its plan's outer corner (--r-house) is the card's corner less its padding and border; the floor
   switch and the strip under the plan share that corner, and what sits in them subtracts their own padding. Inside a
   sheet the card's corner is the sheet's inner corner (--r-insheet), and the chain follows from it. */
@property --r-house { syntax: "<length>"; inherits: true; initial-value: 0px; }
:root { --pad-map: 12px; --r-house: calc(var(--r-card) - var(--pad-map) - var(--bw));
  --wall: #D5CFC4; --stair: #EAE6DF; --stair-void: #DCD7CD; --glazing: #9DB5DA; --plan-line: #B3AB9E; --cfix: #E7E2D9;
  --plan-mine: color-mix(in oklab, var(--accent) 16%, var(--floor)); --plan-sel: color-mix(in oklab, var(--ink) 5%, var(--floor)); --plan-trig: color-mix(in oklab, var(--bad-fill) 15%, var(--floor)); }
@media (prefers-color-scheme: dark) { :root { --wall: #353C48; --stair: #2A2F38; --stair-void: #23272F; --glazing: #4A6390; --plan-line: #5A6270; --cfix: #2C323C;
  --plan-mine: color-mix(in oklab, var(--accent) 20%, var(--floor)); --plan-sel: color-mix(in oklab, var(--ink) 7%, var(--floor)); --plan-trig: color-mix(in oklab, var(--bad-fill) 24%, var(--floor)); } }
.mapcard { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-card); padding: var(--pad-map); display: grid; gap: var(--pad-map); min-width: 0; }
.mapcard .seg { border-radius: var(--r-house); } .mapcard .seg button { border-radius: calc(var(--r-house) - var(--seg-pad)); font-size: 15px; }
.mapcard .seg .ct { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 var(--bw) var(--line); }
.mapcard .seg button[aria-pressed="true"] .ct { background: var(--accent-wash); color: var(--accent-ink); box-shadow: none; }
.planhost { display: grid; justify-items: center; min-width: 0; }
.planhost > svg { max-width: 100%; height: auto; }
.sheet .mapcard { --r-card: calc(var(--r-sheet) - var(--pad-sheet) - var(--bw)); background: var(--surface-2); border: 0; --r-house: calc(var(--r-card) - var(--pad-map)); }
.sheet .mapcard .seg { background: color-mix(in oklab, var(--ink) 6%, var(--surface-2)); }
/* the strip under the plan: who is in the tapped room and "I'm here"; its button sits --pad-strip inside its corner */
.mdetail { --pad-strip: 8px; display: flex; align-items: center; gap: 12px; padding: var(--pad-strip) var(--pad-strip) var(--pad-strip) 14px; border-radius: var(--r-house); background: var(--surface-2); min-height: calc(var(--h-tap) + 2 * var(--pad-strip)); }
.mdetail .tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mdetail b { font: 650 16px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdetail small { font: 400 14px/1.3 var(--sans); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdetail small.trig { color: var(--bad); font-weight: 600; }
.mdetail .pbtn { --h-btn: var(--h-tap); border-radius: calc(var(--r-house) - var(--pad-strip)); font-size: 15px; padding: 0 16px; flex: none; }
.mdetail .here { display: flex; gap: 6px; align-items: center; color: var(--ink-2); font: 600 14px/1.2 var(--sans); flex: none; padding-right: 6px; }
.mdetail .here svg { width: 18px; height: 18px; color: var(--accent-ink); }
/* the calm plan (plan.js calm): walls warm, rooms soft tiles, my room orange, the trigger room red */
.cplan { display: block; overflow: visible; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cplan .cwall { fill: var(--wall); } .cplan .cglass { fill: var(--glazing); }
.cplan .cstair { fill: var(--stair); } .cplan .cvoid { fill: var(--stair-void); }
.cplan .cfix, .cplan .cfurn { fill: var(--cfix); } .cplan .cfurn { opacity: .85; }
.cplan .crm { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.cplan .crm > path { transition: fill .2s; }
.cplan .crm .cedge { stroke: var(--ink-3); } .cplan .crm.mine .cedge { stroke: var(--accent); } .cplan .crm.trig .cedge { stroke: var(--bad-fill); }
.cplan .crm:focus-visible > path:first-child { stroke: var(--accent); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.cplan .clabel { fill: var(--ink); font-weight: 600; text-anchor: middle; paint-order: stroke; stroke-linejoin: round; }
.cplan .clabel.quiet { fill: var(--ink-3); } .cplan .clabel.trig { fill: var(--bad); }
.cplan .ctrig circle { fill: var(--bad-fill); }
.cplan .ctrig .ping { fill: none; stroke: var(--bad-fill); transform-box: fill-box; transform-origin: center; animation: cping 1.8s ease-out infinite; }
@keyframes cping { from { transform: scale(.6); opacity: .9; } to { transform: scale(2); opacity: 0; } }
.cplan .cyou { fill: none; stroke: var(--accent); }
.cplan .cspot { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.cplan .cspot .sdot { fill: var(--surface); stroke: var(--ink-2); transition: fill .15s; }
.cplan .cspot.on .sdot { fill: var(--accent); stroke: var(--accent-ink); }
.cplan .cspot .slabel { fill: var(--ink-2); font-weight: 600; text-anchor: middle; paint-order: stroke; stroke-linejoin: round; }
.cplan .cspot.on .slabel { fill: var(--accent-ink); }
.cplan .cspot:focus-visible .sdot { stroke: var(--accent); }
.cplan .cspot.drag { cursor: grab; } .cplan .cspot.drag .sdot { stroke: var(--accent-ink); }
.cplan .cspot.lifted { cursor: grabbing; } .cplan .cspot.lifted .sdot { fill: var(--accent); }
.cplan .cspot .sspin { fill: none; stroke: var(--accent); stroke-dasharray: 22 78; transform-box: fill-box; transform-origin: center; animation: cspin .8s linear infinite; }
@keyframes cspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cplan .ctrig .ping { animation-duration: 4s; } .cplan .cspot .sspin { animation-duration: 2.4s; } }

/* Places: everyone first, then one action, then the house */
.vlist .vrow > .av { width: var(--ic-v); height: var(--ic-v); font-size: 14px; overflow: visible; }
.vlist .vrow > .av img { border-radius: 50%; }
.vrow > .av .dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--surface); background: var(--ink-3); z-index: 1; }
.vrow > .av .dot.home { background: var(--good-dot); } .vrow > .av .dot.unknown { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.vrow > .av.unknown { background: var(--surface-2) !important; color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.vrow .tx b .you { color: var(--ink-3); font-weight: 500; }
/* "Where are you?": one row; its icon well sits --pad-card + bw inside the card's corner (r-ctl), concentric */
.mewhere { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: var(--bw) solid var(--line); background: var(--surface); color: inherit; font: inherit; border-radius: var(--r-card); padding: var(--pad-card); cursor: pointer; min-height: 72px; }
.mewhere:hover { background: color-mix(in oklab, var(--accent) 5%, var(--surface)); }
.mewhere .ic { width: 44px; height: 44px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--accent-wash); color: var(--accent-ink); flex: none; }
.mewhere .ic svg { width: 22px; height: 22px; }
.mewhere .tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mewhere b { font: 650 16.5px/1.25 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mewhere small { font: 400 14px/1.3 var(--sans); color: var(--ink-2); }
.mewhere .go { font: 600 15px/1 var(--sans); color: var(--accent-ink); display: flex; align-items: center; gap: 2px; flex: none; }
.mewhere .go svg { width: 18px; height: 18px; }
.mewhere:disabled { cursor: default; } .mewhere:disabled:hover { background: var(--surface); } .mewhere:disabled .ic { background: var(--surface-2); color: var(--ink-3); }
/* the picker sheet: favorites and a room's spots as pills, the plan as the picker */
.sheet .pchips { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip2 { --h-pc: 44px; display: inline-flex; align-items: center; gap: 7px; min-height: var(--h-pc); padding: 0 16px 0 13px; border-radius: calc(var(--h-pc) / 2); border: var(--bw) solid var(--line); background: var(--surface); color: var(--ink); font: 600 15px/1.1 var(--sans); cursor: pointer; max-width: 100%; }
.pchip2 > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip2 svg { width: 17px; height: 17px; flex: none; color: var(--ink-2); }
.pchip2[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-ink); } .pchip2[aria-pressed="true"] svg { color: var(--accent-ink); }
.pchip2 .av { width: 26px; height: 26px; font-size: 12px; margin-left: -6px; }
.pchip2.unsure { border-style: dashed; }
.sheet .plbl { font: 600 14px/1.2 var(--sans); color: var(--ink-2); padding: 0 4px; }

/* ---------- Me, the first run, loading (Rev C, phase 3) ---------- */
/* you: the picture a perfect circle (ID's, the initial until it loads); the card's corner follows it (padding + border) */
.mehead { --avatar: 64px; --pad-me: 16px; display: flex; align-items: center; gap: 16px; padding: var(--pad-me); background: var(--surface); border: var(--bw) solid var(--line); border-radius: calc(var(--avatar) / 2 + var(--pad-me) + var(--bw)); }
.mehead .av.me { width: var(--avatar); height: var(--avatar); font-size: 26px; }
.mehead .who { display: grid; justify-items: start; gap: 5px; min-width: 0; }
.mehead .who b { font: 700 22px/1.15 var(--display); letter-spacing: -.01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mehead .who small { font: 400 14px/1.3 var(--sans); color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--surface-2); color: var(--ink-2); font: 600 13px/1 var(--sans); }
.badge.admin { background: var(--armed-wash); color: var(--armed-ink); }
.badge svg { width: 14px; height: 14px; }
/* ink fills the one action of a confirm sheet (Sign out), never red */
.pbtn.strong { background: var(--ink); border-color: transparent; color: var(--bg); }
.pbtn.strong:hover { background: color-mix(in oklab, var(--ink) 86%, var(--bg)); }
.pbtn.strong.busy:disabled { opacity: 1; cursor: progress; }
.sheet.rc > .pbtn + .pbtn { margin-top: -2px; }
/* the Sensing tools: the old lists keep their rows, their titles read like the groups around them */
.scr.tools, .dnarrow.tools { gap: var(--gap); }
.scr.vdeep .t-sec, .dnarrow .t-sec { font: 650 17px/1.2 var(--sans); letter-spacing: -.005em; text-transform: none; color: var(--ink); padding: 0 4px; }
.tools .t-sec { margin: calc(var(--gap-l) - var(--gap)) 0 calc(10px - var(--gap)); }
.tools > .navbar + .ltitle { margin-top: calc(-1 * var(--gap) + var(--gap-s)); }
.vdeep > .navbar + .row { margin-top: calc(-1 * var(--gap-l) + var(--gap-s)); }
.tools .whereseg { margin-top: 0; }

/* the first run: once per device, three steps, Back on the later ones */
.first { min-height: 100dvh; max-width: 480px; margin: 0 auto; display: grid; grid-template-rows: auto 1fr auto; gap: 20px; position: relative;
  padding: calc(env(safe-area-inset-top) + 64px) 24px calc(env(safe-area-inset-bottom) + 28px); }
.first .fback { position: absolute; top: calc(env(safe-area-inset-top) + 8px); left: 14px; }
.first .dots { display: flex; gap: 6px; justify-content: center; }
.first .dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--line); transition: width .25s var(--ease), background .25s; }
.first .dots i.on { background: var(--ink); width: 20px; } .first .dots i.done { background: var(--ink-3); }
.first .mid { display: grid; align-content: center; justify-items: center; gap: 16px; text-align: center; }
/* the big icon: a tile whose corner is the icon's box less nothing (its own shape; nothing nests in it) */
.first .big { width: 96px; height: 96px; border-radius: 28px; display: grid; place-items: center; background: var(--surface); border: var(--bw) solid var(--line); color: var(--ink); }
.first .big svg { width: 46px; height: 46px; }
.first h1 { font: 700 30px/1.1 var(--display); letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.first .mid > p { font: 400 16.5px/1.45 var(--sans); color: var(--ink-2); max-width: 32ch; text-wrap: balance; }
.first .how { width: 100%; text-align: left; }
.first .how .vrow .tx b { white-space: normal; text-wrap: balance; }
.first .acts { display: grid; gap: 10px; }
@media (max-height: 700px) { .first { padding-top: calc(env(safe-area-inset-top) + 52px); } .first .big { width: 80px; height: 80px; border-radius: 24px; } .first h1 { font-size: 26px; } }

/* loading: the shapes of what comes (no layout jump when the house answers) */
.sk.skl { display: block; height: 15px; } .sk.sks { display: block; height: 12px; }
.sk.skav { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.vrow .ic.sk { background: var(--surface-2); }
.skstrip .pchip { cursor: default; } .skstrip .pchip .tx { display: grid; gap: 6px; flex: 1; min-width: 0; }
.vlist .vrow.ev .tx .sk + .sk { margin-top: 4px; }
.sk.skmap { height: 360px; border-radius: var(--r-house); }
.tabbar span.tab { cursor: default; }
@media (prefers-reduced-motion: reduce) { .sk { animation-duration: 3s; } }
/* editing the house on the phone (Sensing tools > Devices or Furniture): the switch heads the map's sheet */
.edhd { padding-top: 8px; }
.edtabs svg { width: 18px; height: 18px; flex: none; }
.fsave { display: flex; align-items: center; gap: 6px; min-height: 20px; margin: 0; font: 500 13px/1.3 var(--sans); color: var(--ink-2); }
.fsave .ok { width: 16px; height: 16px; color: var(--good, var(--ink-2)); }
.fsave:empty { display: none; }
/* the switch takes the sheet's inner corner, its buttons that minus the switch's padding */
.edtabs { border-radius: var(--r-insheet); }
.edtabs button { border-radius: calc(var(--r-insheet) - var(--seg-pad)); }
.edbody .btn { border-radius: var(--r-insheet); }
