@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-var-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: block;
}

:root {
  /* One unit that scales with the panel (1920x1280 or 1280x853, both 3:2). */
  --u: min(1vh, 0.6667vw);
  --bg: #0b0d10;
  --surface: #14181d;
  --surface-2: #1b2027;
  --surface-3: #232a32;
  --line: #262d36;
  --text: #ece8e1;
  --text-2: #a7abb1;
  --muted: #6f757d;
  --amber: #f0b45c;
  --amber-bg: rgba(240, 180, 92, 0.14);
  --green: #84c99c;
  --green-bg: rgba(132, 201, 156, 0.12);
  --red: #f0705e;
  --red-bg: rgba(240, 112, 94, 0.15);
  --blue: #8db4e8;
  --blue-bg: rgba(141, 180, 232, 0.13);
  --radius: calc(var(--u) * 2.4);
  --gap: calc(var(--u) * 2);
  --tap: max(64px, calc(var(--u) * 8));
  /* every way back (data-exit): at least a tap target; the station raises it to ~12 mm */
  --exit: var(--tap);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; background: var(--bg); color: var(--text);
  font-family: 'Inter', system-ui, sans-serif; font-feature-settings: 'tnum' 1, 'cv11' 1;
  overflow: hidden; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
input { font: inherit; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; display: none; }
body[data-moment="working"] #working,
body[data-moment="arrive"] #arrive,
body[data-moment="ambient"] #ambient,
body[data-moment="away"] #ambient { display: grid; }
body[data-moment="loading"] #working { display: grid; opacity: .25; }

/* ---------- WORKING ---------- */
#working {
  padding: calc(var(--u) * 3.2) calc(var(--u) * 3.6) 0;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  grid-template-rows: calc(var(--u) * 40) minmax(0, 1fr) calc(var(--u) * 12);
  column-gap: calc(var(--u) * 3.2); row-gap: calc(var(--u) * 2.6);
  grid-template-areas: "clock meeting" "rem controls" "strip strip";
}
.clock-block { grid-area: clock; align-self: start; padding-top: calc(var(--u) * 0.2); min-width: 0; }
.time { font-size: calc(var(--u) * 21); font-weight: 300; letter-spacing: -0.04em; line-height: 0.92; }
.time .ampm { font-size: 0.26em; font-weight: 400; letter-spacing: 0; color: var(--text-2); margin-left: 0.25em; }
.date { font-size: calc(var(--u) * 4); color: var(--text-2); margin-top: calc(var(--u) * 1.6); font-weight: 450; }
.allday { margin-top: calc(var(--u) * 1.4); display: flex; flex-wrap: wrap; gap: calc(var(--u) * 1); }
.allday span { font-size: calc(var(--u) * 2.3); color: var(--text-2); background: var(--surface); border-radius: 999px; padding: calc(var(--u) * 0.6) calc(var(--u) * 1.6); }

.card { background: var(--surface); border-radius: var(--radius); min-height: 0; }

/* meeting card */
.meeting { grid-area: meeting; padding: calc(var(--u) * 2.6) calc(var(--u) * 3); display: flex; flex-direction: column; gap: calc(var(--u) * 0.8); position: relative; overflow: hidden; }
.eyebrow { font-size: calc(var(--u) * 2.4); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: calc(var(--u) * 1); }
.countdown { font-size: calc(var(--u) * 7.6); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.countdown small { font-size: 0.42em; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.m-title { font-size: calc(var(--u) * 4); font-weight: 550; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-time { font-size: calc(var(--u) * 2.9); color: var(--text-2); }
.m-later { margin-top: auto; padding-top: calc(var(--u) * 1.4); border-top: 1px solid var(--line); font-size: calc(var(--u) * 2.7); color: var(--text-2); display: grid; gap: calc(var(--u) * 0.6); }
.m-later div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-later b { color: var(--text); font-weight: 550; margin-right: 0.6em; }
.meeting.soon .countdown { color: var(--amber); }
.meeting.empty .countdown { color: var(--text-2); font-size: calc(var(--u) * 5); font-weight: 500; }
.meeting.oncall { background: linear-gradient(160deg, #2a1714, var(--surface) 70%); box-shadow: inset 0 0 0 2px rgba(240, 112, 94, .45); }
.onair { display: inline-flex; align-items: center; gap: calc(var(--u) * 1); color: var(--red); }
.onair i { width: calc(var(--u) * 1.6); height: calc(var(--u) * 1.6); border-radius: 50%; background: var(--red); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.cal-note { font-size: calc(var(--u) * 2.6); color: var(--amber); display: flex; align-items: center; gap: .5em; }
.cal-note.muted { color: var(--muted); }
.call-hint { position: absolute; top: calc(var(--u) * 1.8); right: calc(var(--u) * 2); align-self: flex-start; display: inline-flex; align-items: center; gap: .6em; font-size: calc(var(--u) * 2.3); font-weight: 550; padding: 0 calc(var(--u) * 2.2); min-height: var(--tap); border-radius: 999px; background: var(--surface-3); }
.call-hint:active { background: var(--line); }

/* reminders */
.reminders { grid-area: rem; display: flex; flex-direction: column; padding: calc(var(--u) * 2.2) calc(var(--u) * 1.6) calc(var(--u) * 1.4) calc(var(--u) * 3); }
.r-head { display: flex; align-items: center; gap: calc(var(--u) * 1); padding-bottom: calc(var(--u) * 1); }
.r-head .eyebrow { flex: 1; }
.r-head .count { color: var(--text); background: var(--surface-3); border-radius: 999px; padding: 0.1em 0.7em; letter-spacing: 0; }
.pill-btn { min-height: var(--tap); padding: 0 calc(var(--u) * 2.4); border-radius: 999px; font-size: calc(var(--u) * 2.6); font-weight: 600; display: inline-flex; align-items: center; gap: .5em; background: var(--surface-3); color: var(--text); }
.pill-btn:active { background: var(--line); }
.pill-btn.ghost { background: transparent; color: var(--text-2); }
.pill-btn.on { background: var(--amber-bg); color: var(--amber); }
.r-list { list-style: none; overflow-y: auto; min-height: 0; flex: 1; margin-right: calc(var(--u) * -0.4); scrollbar-width: none; }
.r-list::-webkit-scrollbar { display: none; }
.r-list.scrolls { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--u) * 7), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - var(--u) * 7), transparent); }
.r-list.scrolls.at-end { -webkit-mask-image: none; mask-image: none; }
.r-item { display: flex; align-items: center; gap: calc(var(--u) * 1.8); min-height: calc(var(--u) * 7.6); padding: calc(var(--u) * .4) 0; border-bottom: 1px solid var(--line); }
.r-item:last-child { border-bottom: 0; }
.r-check { width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; margin-left: calc(var(--u) * -1.6); }
.r-check span { width: calc(var(--u) * 4.2); height: calc(var(--u) * 4.2); border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; font-size: calc(var(--u) * 2.8); color: transparent; transition: background .2s, border-color .2s; }
.r-check:active span { border-color: var(--text); }
.r-text { flex: 1; font-size: calc(var(--u) * 3.6); line-height: 1.2; overflow-wrap: anywhere; }
.r-meta { font-size: calc(var(--u) * 2.3); color: var(--muted); white-space: nowrap; }
.r-item.new .r-text::before { content: ''; display: inline-block; width: calc(var(--u) * 1.1); height: calc(var(--u) * 1.1); border-radius: 50%; background: var(--amber); margin-right: .55em; vertical-align: 0.15em; }
.r-item.done .r-text { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.r-item.done .r-check span { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.r-del { width: var(--tap); height: var(--tap); display: grid; place-items: center; color: var(--red); font-size: calc(var(--u) * 3.4); flex: none; }
.r-empty { color: var(--muted); font-size: calc(var(--u) * 3.2); padding: calc(var(--u) * 2) 0; }
.r-more { font-size: calc(var(--u) * 2); color: var(--muted); padding-top: calc(var(--u) * .6); }

/* controls */
.controls { grid-area: controls; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: var(--gap); min-height: 0; min-width: 0; }
.scenes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-rows: minmax(var(--tap), 1fr); gap: var(--gap); min-height: 0; }
.scene { background: var(--surface); border-radius: var(--radius); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: calc(var(--u) * 1.2); padding: 0 calc(var(--u) * 3); font-size: calc(var(--u) * 3.6); font-weight: 600; position: relative; transition: background .15s, transform .08s; }
.scene .ic { font-size: calc(var(--u) * 4.4); color: var(--text-2); }
/* Five scenes (Work · Call · Kids / Evening · Off): 3 on top, 2 wider below, same row heights as before. */
.scenes.scenes-5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.scenes-5 .scene { grid-column: span 2; min-width: 0; }
.scenes-5 .scene:nth-child(n+4) { grid-column: span 3; }
.scene:active { transform: scale(.98); background: var(--surface-2); }
.scene.active { background: var(--amber-bg); color: var(--amber); box-shadow: inset 0 0 0 2px rgba(240, 180, 92, .5); }
.scene.active .ic { color: var(--amber); }
.scene.pending::after, .tile.pending::after { content: ''; position: absolute; right: calc(var(--u) * 2.4); top: calc(var(--u) * 2.4); width: calc(var(--u) * 2.4); height: calc(var(--u) * 2.4); border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }
.control-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--gap); min-width: 0; }   /* Lights at its natural width, the door gets the rest */
.tile { position: relative; min-width: 0; background: var(--surface); border-radius: var(--radius); min-height: calc(var(--u) * 11.5); display: flex; align-items: center; gap: calc(var(--u) * 1.6); padding: 0 calc(var(--u) * 2.6); font-size: calc(var(--u) * 3.3); font-weight: 600; text-align: left; }
.tile:active { background: var(--surface-2); }
.tile .ic { font-size: calc(var(--u) * 4); }
.tile .chev { font-size: calc(var(--u) * 3); color: var(--muted); margin-left: auto; }
/* Wall only: no chevron on Lights, so the door tile fits "Office door / Unlocked" + Lock whole (2026-11-15 cut-off report). */
@media (min-width: 1101px) and (min-height: 601px) { .lights-btn .chev { display: none; } }
.door-wrap { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.door { justify-content: flex-start; }
.door .d-label { display: flex; flex-direction: column; gap: calc(var(--u) * .3); min-width: 0; }
.door .d-name, .door .d-state { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.door .ic { flex: none; }
.door .d-name { font-size: calc(var(--u) * 2.4); color: var(--text-2); font-weight: 500; }
.door .d-state { font-size: calc(var(--u) * 3.8); }
.door .d-act { margin-left: auto; font-size: calc(var(--u) * 2.4); color: var(--text-2); font-weight: 600; border: 2px solid var(--line); border-radius: 999px; padding: calc(var(--u) * .9) calc(var(--u) * 1.8); flex: none; }
.door.locked .ic { color: var(--green); }
.door.unlocked { background: var(--amber-bg); }
.door.unlocked .ic, .door.unlocked .d-state { color: var(--amber); }
.door.unavailable { opacity: .55; }

/* bottom strip */
.strip { grid-area: strip; display: flex; align-items: center; gap: calc(var(--u) * 2); border-top: 1px solid var(--line); margin: 0 calc(var(--u) * -3.6); padding: 0 calc(var(--u) * 3.6); }   /* same gutters as the columns above */
.status { flex: 1; display: flex; align-items: center; gap: calc(var(--u) * 2.6); font-size: calc(var(--u) * 3.1); color: var(--text-2); white-space: nowrap; overflow: hidden; }
.status .st { display: inline-flex; align-items: center; gap: .5em; flex: none; }
.status > * { flex: none; }   /* whole or not at all (fitStatus in app.js) */
.status .st .ic { font-size: 1.25em; color: var(--muted); }
.status .st b { color: var(--text); font-weight: 600; }
.status .st.warn, .status .st.warn b, .status .st.warn .ic { color: var(--amber); }
.status .st.dim { opacity: .55; }
.status .st-sub { color: var(--text-2); font-size: .85em; }
.status .st-health { font: inherit; color: var(--amber); background: none; border: 0; padding: 0; min-height: var(--tap); }
.status .st-health b, .status .st-health .ic { color: inherit; }
.status .st-health.crit { color: var(--red); }
.status .st-health:active { opacity: .6; }
.toy-shelf { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--u) * 1.2); }
.toy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: calc(var(--u) * 1.2); align-items: stretch; }
.toy-fb { min-height: var(--tap); padding: 0 calc(var(--u) * 2.2); border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: calc(var(--u) * 2.4); font-weight: 600; display: inline-flex; align-items: center; gap: .45em; }
.toy-fb.liked.on { background: var(--green-bg); color: var(--green); box-shadow: inset 0 0 0 2px rgba(132, 201, 156, .5); }
.toy-fb.disliked.on { background: var(--amber-bg); color: var(--amber); box-shadow: inset 0 0 0 2px rgba(240, 180, 92, .5); }
.toy-fb:active { background: var(--line); }
.sc-hint { position: absolute; right: calc(var(--u) * 1.6); top: calc(var(--u) * 1.4); max-width: 55%; text-align: right; line-height: 1.15; font-size: calc(var(--u) * 1.8); font-weight: 500; color: var(--muted); }
.scene.active .sc-hint { color: inherit; opacity: .75; }
/* the office door when the panel cannot command it (config door.commands false): state only */
.door-ro .d-hint { margin-left: auto; font-size: calc(var(--u) * 2.2); color: var(--muted); font-weight: 500; white-space: nowrap; }
/* wall: a quiet pill in the clock block's top-right corner (free space): mic + camera icons, dimmed when off, green while
   live; the words are in its sheet. Phones: never (office screens only). */
.clock-block { position: relative; }
.sens-btn { position: absolute; top: 0; right: 0; min-height: var(--tap); padding: 0 calc(var(--u) * 2); display: inline-flex; align-items: center; gap: calc(var(--u) * 1.2); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: calc(var(--u) * 3.2); }
.sens-btn span { display: none; }
.sens-btn .sn-g { display: inline-flex; font-style: normal; }
.sens-btn .sn-g.off { opacity: .45; }
.sens-btn .sn-g.live { color: var(--green); }
.sens-btn.paused { background: var(--amber-bg); color: var(--amber); }
.sn-row { display: flex; gap: calc(var(--u) * 2); align-items: flex-start; padding: calc(var(--u) * 1.6) 0; border-bottom: 1px solid var(--line); font-size: calc(var(--u) * 2.4); color: var(--text-2); }
.sn-row .ic { font-size: 1.4em; color: var(--text); margin-top: .1em; }
.sn-row b { display: block; color: var(--text); font-size: 1.1em; margin-bottom: .2em; }
.sn-note { font-size: calc(var(--u) * 2.4); color: var(--text-2); font-weight: 600; align-self: center; }
.cap-body { padding: calc(var(--u) * 2) 0; display: flex; flex-direction: column; gap: calc(var(--u) * 1.4); }
.cap-text { font-size: calc(var(--u) * 4.6); font-weight: 600; line-height: 1.2; }
.cap-listen { font-size: calc(var(--u) * 3.6); font-weight: 600; display: flex; align-items: center; gap: .5em; }
.cap-sub { font-size: calc(var(--u) * 2.4); color: var(--text-2); }
.jv .jv-k { font-size: calc(var(--u) * 2); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: calc(var(--u) * 1.4); }
.jv .jv-v { font-size: calc(var(--u) * 3); }
.jv .jv-reply { font-size: calc(var(--u) * 2.8); line-height: 1.4; white-space: pre-wrap; }
.dk-junsure { display: inline-block; font-size: .7em; font-weight: 600; color: var(--amber); border: 1.5px solid currentColor; border-radius: 999px; padding: .05em .55em; vertical-align: middle; }
.dk-jdot { width: .6em; height: .6em; border-radius: 50%; background: var(--blue); flex: none; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
#desk, #st-tabs { display: none; }
.toy-pick { min-height: var(--tap); text-align: left; padding: calc(var(--u) * 1.4) calc(var(--u) * 2); border-radius: calc(var(--u) * 1.6); background: var(--surface-2); display: flex; flex-direction: column; gap: .2em; }
.toy-pick b { font-size: calc(var(--u) * 2.6); font-weight: 600; }
.toy-pick small { font-size: calc(var(--u) * 2); color: var(--muted); }
.toy-pick.on { outline: 2px solid var(--green); }
.toy-pick:active { background: var(--line); }
.playend-btn { display: flex; align-items: center; gap: .6em; justify-content: center; font-weight: 600; }
.hl-note { color: var(--text-2); font-size: calc(var(--u) * 2.4); margin: 0 0 calc(var(--u) * 1.6); }
.hl-stale { color: var(--amber); }
.hl-list { list-style: none; margin: 0 0 calc(var(--u) * 2); padding: 0; display: flex; flex-direction: column; gap: calc(var(--u) * 1.4); }
.hl-item { display: flex; align-items: center; gap: .7em; font-size: calc(var(--u) * 2.9); }
.hl-item.warn .ic { color: var(--amber); }
.hl-item.crit .ic { color: var(--red); }
.ha-pill { display: inline-flex; align-items: center; gap: .55em; background: var(--amber-bg); color: var(--amber); border-radius: 999px; padding: .35em 1em; font-weight: 600; }
.leave-btn { min-height: calc(var(--u) * 8.4); min-width: calc(var(--u) * 22); display: inline-flex; align-items: center; justify-content: center; gap: .6em; padding: 0 calc(var(--u) * 3.2); border-radius: 999px; font-size: calc(var(--u) * 3.3); font-weight: 650; background: var(--surface-3); color: var(--text); }
.leave-btn .ic { font-size: 1.2em; }
.leave-btn:active { background: var(--line); }
body.ha-down .scenes, body.ha-down .control-row { opacity: .45; }

/* ---------- ARRIVE ---------- */
#arrive { padding: calc(var(--u) * 6) calc(var(--u) * 6) calc(var(--u) * 5); grid-template-rows: auto minmax(0, 1fr) auto; gap: calc(var(--u) * 4); animation: fadein .6s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(calc(var(--u) * 1)); } }
.ar-head { display: flex; align-items: baseline; gap: calc(var(--u) * 3); }
.ar-hello { font-size: calc(var(--u) * 10); font-weight: 600; letter-spacing: -0.035em; }
.ar-sub { font-size: calc(var(--u) * 3); color: var(--text-2); }
.ar-time { margin-left: auto; font-size: calc(var(--u) * 6); font-weight: 300; color: var(--text-2); }
.ar-cols { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 3); min-height: 0; }
.ar-card { background: var(--surface); border-radius: var(--radius); padding: calc(var(--u) * 3) calc(var(--u) * 3.4); display: flex; flex-direction: column; gap: calc(var(--u) * 1.2); min-height: 0; overflow: hidden; }
.ar-card .countdown { font-size: calc(var(--u) * 8.4); }
.ar-card .m-title { font-size: calc(var(--u) * 3.8); }
.ar-new { list-style: none; display: grid; gap: calc(var(--u) * 1.2); margin-top: calc(var(--u) * .6); }
.ar-new li { font-size: calc(var(--u) * 3.2); line-height: 1.2; display: flex; gap: calc(var(--u) * 1.4); align-items: baseline; }
.ar-new li::before { content: ''; width: calc(var(--u) * 1.3); height: calc(var(--u) * 1.3); border-radius: 50%; background: var(--amber); flex: none; transform: translateY(-0.15em); }
.ar-new li small { font-size: calc(var(--u) * 2); color: var(--muted); margin-left: auto; white-space: nowrap; }
.ar-quiet { font-size: calc(var(--u) * 3); color: var(--muted); }
.ar-new.old li { color: var(--text-2); }
.ar-new.old li::before { background: transparent; border: 2px solid var(--muted); }
.ar-warn { font-size: calc(var(--u) * 2.4); color: var(--amber); display: flex; gap: .6em; align-items: center; background: var(--amber-bg); border-radius: calc(var(--u) * 1.4); padding: calc(var(--u) * 1.4) calc(var(--u) * 2); }
.ar-actions { display: flex; gap: var(--gap); align-items: center; }
.big-btn { min-height: calc(var(--u) * 11); padding: 0 calc(var(--u) * 4.4); border-radius: 999px; font-size: calc(var(--u) * 3.2); font-weight: 650; display: inline-flex; align-items: center; gap: .6em; background: var(--surface-3); color: var(--text); }
.big-btn .ic { font-size: 1.25em; }
.big-btn.primary { background: var(--text); color: var(--bg); }
.big-btn.amber { background: var(--amber); color: #1d1408; }
.big-btn.danger { background: var(--red); color: #1f0b08; }
.big-btn:active { filter: brightness(.88); transform: scale(.985); }
.ar-actions .spacer { flex: 1; }
.ar-settle { font-size: calc(var(--u) * 2.2); color: var(--muted); }

/* ---------- AMBIENT / AWAY ---------- */
#ambient { place-items: center; background: #000; }
.amb-inner { text-align: center; transition: transform 2s ease; }
.amb-time { font-size: calc(var(--u) * 30); font-weight: 200; letter-spacing: -0.045em; color: #8d8880; line-height: 1; }
.amb-time .ampm { font-size: 0.18em; font-weight: 400; color: #5d5953; margin-left: 0.3em; letter-spacing: 0; }
.amb-date { font-size: calc(var(--u) * 3.6); color: #5d5953; margin-top: calc(var(--u) * 2); }
.amb-line { font-size: calc(var(--u) * 3.2); color: #7d776f; margin-top: calc(var(--u) * 5); min-height: 1.2em; }
.amb-line .soon { color: #c39552; }
.amb-sub { font-size: calc(var(--u) * 2.6); color: #5d5953; margin-top: calc(var(--u) * 2.4); min-height: 1.2em; }
.amb-sub.warn { color: #a8793a; }
.amb-line.oncall { color: #c0604f; }

/* ---------- OVERLAYS ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; }
#takeover { background: #050608; display: grid; animation: fadein .35s ease; }
.to-door { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: calc(var(--u) * 4); padding: calc(var(--u) * 4); }
.to-cam { position: relative; display: grid; place-items: center; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; gap: calc(var(--u) * 1.5); }
.cam-frame { position: relative; max-width: 100%; max-height: 100%; display: grid; }
.to-cam .cam-frame { width: 100%; height: 100%; }
.to-cam .cv-video, .to-cam .cv-img { max-width: 100%; max-height: calc(100vh - var(--u) * 16); border-radius: var(--radius); }
.to-cam > .live.live { position: static; justify-self: center; }
.to-cam .cam-err { position: absolute; color: var(--text-2); font-size: calc(var(--u) * 3); text-align: center; padding: calc(var(--u) * 3); display: grid; gap: calc(var(--u) * 1); justify-items: center; }
.to-cam .cam-err .ic { font-size: calc(var(--u) * 6); color: var(--muted); }
.to-cam .cam-err-title { font-size: calc(var(--u) * 4); color: var(--text); font-weight: 600; }
.to-cam .cam-err-sub { font-size: calc(var(--u) * 2.6); color: var(--text-2); max-width: calc(var(--u) * 70); line-height: 1.3; }
.to-cam .live[data-kind="live"]::before, .camglance .gl-sub[data-kind="live"]::before { content: ''; display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--green); margin-right: .45em; vertical-align: .05em; }
.to-cam .live[data-kind="paused"], .to-cam .live[data-kind="ended"], .to-cam .live[data-kind="saved"], .to-cam .live[data-kind="frame"],
.camglance .gl-sub[data-kind="paused"], .camglance .gl-sub[data-kind="ended"], .camglance .gl-sub[data-kind="saved"] { color: var(--amber); }
.to-cam .to-again { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 2; min-height: var(--exit); padding: 0 calc(var(--u) * 3.4); border-radius: 999px; background: var(--amber); color: #1d1408; font-size: calc(var(--u) * 3); font-weight: 650; display: inline-flex; align-items: center; gap: .5em; box-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 4) rgba(0, 0, 0, .6); }
.to-cam .to-again:active { background: var(--line); color: var(--text); }
.to-cam .live { position: absolute; left: calc(var(--u) * 2); top: calc(var(--u) * 2); background: rgba(0, 0, 0, .6); border-radius: 999px; padding: .3em .9em; font-size: calc(var(--u) * 2.3); color: #ddd; }
.to-side { display: flex; flex-direction: column; gap: calc(var(--u) * 2); padding: calc(var(--u) * 2) 0; }
.to-kicker { font-size: calc(var(--u) * 2.2); text-transform: uppercase; letter-spacing: .12em; color: var(--amber); font-weight: 650; display: flex; align-items: center; gap: .6em; }
.to-kicker .ic { font-size: 1.5em; }
.to-title { font-size: calc(var(--u) * 6.2); font-weight: 650; letter-spacing: -0.025em; line-height: 1.05; }
.to-when { font-size: calc(var(--u) * 2.8); color: var(--text-2); }
.to-side .spacer { flex: 1; }
.to-side .big-btn { justify-content: center; width: 100%; min-height: calc(var(--u) * 13); font-size: calc(var(--u) * 3.6); }
.to-timer { height: calc(var(--u) * .7); background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.to-timer i { display: block; height: 100%; background: var(--muted); transform-origin: left; }
.to-timer-label { font-size: calc(var(--u) * 2.1); color: var(--muted); }
.to-queued { font-size: calc(var(--u) * 2.2); color: var(--text-2); }

.to-notice { place-self: center; width: min(78vw, calc(var(--u) * 135)); background: var(--surface); border-radius: calc(var(--radius) * 1.4); padding: calc(var(--u) * 5) calc(var(--u) * 5.4) calc(var(--u) * 4); display: flex; flex-direction: column; gap: calc(var(--u) * 2.2); border-top: calc(var(--u) * 1) solid var(--blue); }
.to-notice.warn { border-top-color: var(--amber); }
.to-notice.critical { border-top-color: var(--red); background: linear-gradient(180deg, #2a1513, var(--surface) 55%); }
.to-notice .to-kicker { color: var(--blue); }
.to-notice.warn .to-kicker { color: var(--amber); }
.to-notice.critical .to-kicker { color: var(--red); }
.to-body { font-size: calc(var(--u) * 3.4); line-height: 1.35; color: var(--text-2); white-space: pre-wrap; max-height: calc(var(--u) * 34); overflow: auto; }
.to-notice .row { display: flex; align-items: center; gap: var(--gap); margin-top: calc(var(--u) * 1.6); }
.to-notice .row .spacer { flex: 1; }

/* sheets */
.sheet-overlay { background: rgba(4, 5, 7, .78); display: grid; place-items: center; animation: fadein .2s ease; }
.sheet { width: min(88vw, calc(var(--u) * 140)); max-height: 90vh; background: var(--surface); border-radius: calc(var(--radius) * 1.3); padding: calc(var(--u) * 3.6) calc(var(--u) * 4); display: flex; flex-direction: column; gap: calc(var(--u) * 2.4); overflow: hidden; }
.sheet-head { display: flex; align-items: center; gap: var(--gap); }
.sheet-head h2 { flex: 1; font-size: calc(var(--u) * 4.6); font-weight: 650; letter-spacing: -0.02em; }
/* the way back of every sheet: top right, icon + word (CLAUDE.md "Touch is the primary interface") */
.x-btn { flex: none; align-self: flex-start; min-width: var(--exit); height: var(--exit); padding: 0 calc(var(--u) * 2.8) 0 calc(var(--u) * 2.2); border-radius: 999px; background: var(--surface-3); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: .45em; font-size: calc(var(--u) * 2.8); font-weight: 650; white-space: nowrap; }
.x-btn .ic { font-size: 1.2em; }
.x-btn:active { background: var(--line); }
.sheet-body { overflow-y: auto; min-height: 0; scrollbar-width: none; }
/* more below (app.js markScroll): the only scroll sign on a touch screen */
/* a whole sheet that scrolls (phones, the station): a sticky fade at its bottom edge instead of a see-through mask */
.sheet[data-more] { -webkit-mask-image: none; mask-image: none; }
.sheet[data-more]::after { content: ''; flex: none; position: sticky; bottom: -16px; display: block; height: var(--tap); margin-top: calc(var(--tap) * -1); margin-bottom: -16px; background: linear-gradient(to bottom, rgba(20, 24, 29, 0), var(--surface)); pointer-events: none; }
:not(.sheet)[data-more] { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--tap)), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - var(--tap)), transparent); }

.l-row { display: flex; align-items: center; gap: calc(var(--u) * 2); min-height: calc(var(--u) * 10.5); border-bottom: 1px solid var(--line); }
.l-row:last-child { border-bottom: 0; }
.l-name { flex: 1; font-size: calc(var(--u) * 3); font-weight: 550; display: flex; align-items: center; gap: .6em; }
.l-name .ic { font-size: 1.15em; color: var(--muted); }
.l-row.on .l-name .ic { color: var(--amber); }
.l-row.na { opacity: .5; }
.steps { display: flex; gap: calc(var(--u) * 1); }
.step { min-width: calc(var(--u) * 10); min-height: var(--tap); border-radius: calc(var(--u) * 1.6); background: var(--surface-3); font-size: calc(var(--u) * 2.3); font-weight: 600; color: var(--text-2); }
.step.on { background: var(--amber-bg); color: var(--amber); box-shadow: inset 0 0 0 2px rgba(240, 180, 92, .45); }
.toggle { width: calc(var(--u) * 15); min-height: var(--tap); border-radius: 999px; background: var(--surface-3); font-size: calc(var(--u) * 2.4); font-weight: 650; color: var(--text-2); position: relative; }
.toggle.on { background: var(--amber); color: #1d1408; }
.toggle.pending { opacity: .6; }

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(var(--u) * 1.4); }
.chip { min-height: calc(var(--u) * 10); border-radius: calc(var(--u) * 1.8); background: var(--surface-3); font-size: calc(var(--u) * 2.6); font-weight: 600; padding: 0 calc(var(--u) * 1.4); }
.chip:active { background: var(--line); }
.type-row { display: flex; gap: calc(var(--u) * 1.4); }
.type-field { flex: 1; min-height: calc(var(--u) * 9); border-radius: calc(var(--u) * 1.8); border: 2px solid var(--line); background: var(--bg); color: var(--text); padding: 0 calc(var(--u) * 2.4); font-size: calc(var(--u) * 3.4); display: flex; align-items: center; text-align: left; overflow: hidden; white-space: nowrap; }
.type-field.active { border-color: var(--text-2); }
.kb-head .type-field { min-height: var(--exit); }
.type-field .tf-ph { color: var(--muted); }
.type-field .tf-text { overflow: hidden; text-overflow: ellipsis; direction: rtl; unicode-bidi: plaintext; }
.caret { display: inline-block; width: 3px; height: 1.15em; background: var(--amber); margin-left: 2px; flex: none; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.kb { display: grid; gap: calc(var(--u) * 1.1); }
.kb-row { display: grid; grid-template-columns: repeat(10, 1fr); gap: calc(var(--u) * 1.1); }
.kb-r3 { grid-template-columns: 1.5fr repeat(7, 1fr) 1.5fr; }
.kb-r4 { grid-template-columns: 1fr 5fr 1fr 3fr; }
.kb-key { min-height: max(64px, calc(var(--u) * 8.6)); border-radius: calc(var(--u) * 1.4); background: var(--surface-3); font-size: calc(var(--u) * 3.4); font-weight: 550; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: .4em; }
.kb-key:active { background: var(--line); transform: scale(.97); }
.kb-key.on { background: var(--amber-bg); color: var(--amber); }
.kb-space { font-size: calc(var(--u) * 2.4); color: var(--text-2); }
.kb-done { background: var(--text); color: var(--bg); font-weight: 650; }
.kb-done:active { background: var(--text-2); }
.kb-done .ic { font-size: 1.1em; }
.hint { font-size: calc(var(--u) * 2.1); color: var(--muted); }

.lv-list { list-style: none; display: grid; gap: calc(var(--u) * 1.4); }
.lv-list li { display: flex; align-items: center; gap: calc(var(--u) * 1.6); font-size: calc(var(--u) * 3); }
.lv-list li .ic { font-size: 1.2em; color: var(--text-2); }
.lv-list li.ok .ic { color: var(--green); }
.lv-list li.fail .ic { color: var(--red); }
.lv-list li small { color: var(--text-2); font-size: calc(var(--u) * 2.3); margin-left: auto; }
.lv-sec { font-size: calc(var(--u) * 2.1); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: calc(var(--u) * 1); }
.lv-rem { list-style: none; display: grid; gap: calc(var(--u) * .8); font-size: calc(var(--u) * 2.6); color: var(--text-2); }
.lv-rem li::before { content: '○'; margin-right: .6em; color: var(--muted); }
.sheet-actions { display: flex; gap: var(--gap); justify-content: flex-end; align-items: center; }
.sheet-actions .spacer { flex: 1; }
.lv-count { font-size: calc(var(--u) * 16); font-weight: 250; text-align: center; line-height: 1; letter-spacing: -0.04em; }
.lv-count-sub { text-align: center; font-size: calc(var(--u) * 3); color: var(--text-2); }
.lv-done { font-size: calc(var(--u) * 4); font-weight: 600; }
.lv-done.ok { color: var(--green); }
.lv-done.fail { color: var(--amber); }

/* toast + offline */
.toast { position: fixed; left: 50%; bottom: calc(var(--u) * 13.5); transform: translateX(-50%); z-index: 40; background: var(--surface-3); color: var(--text); border-radius: 999px; padding: calc(var(--u) * 1.6) calc(var(--u) * 3.4); font-size: calc(var(--u) * 2.5); font-weight: 550; display: flex; align-items: center; gap: .7em; box-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 4) rgba(0, 0, 0, .5); max-width: 80vw; animation: fadein .25s ease; }
.toast.warn { background: #3a2c17; color: var(--amber); }
.toast .ic { font-size: 1.3em; }
.offline { position: fixed; left: 0; right: 0; top: 0; z-index: 50; text-align: center; padding: calc(var(--u) * 1.2); background: #3a2c17; color: var(--amber); font-size: calc(var(--u) * 2.3); font-weight: 600; }
body.stale #working, body.stale #arrive { filter: saturate(.4) brightness(.75); }

/* ---------- WORK + HOME FEED ---------- */
/* summary chip + glance under the date */
.sum-chip { overflow: hidden; margin-top: calc(var(--u) * 1.8); display: inline-flex; align-items: center; gap: calc(var(--u) * 1.4); min-height: var(--tap); padding: 0 calc(var(--u) * 1.6) 0 calc(var(--u) * 2.2); border-radius: 999px; background: var(--surface); font-size: calc(var(--u) * 2.6); font-weight: 600; max-width: 100%; }
.sum-chip:active { background: var(--surface-2); }
.sum-chip .sum-name { display: inline-flex; align-items: center; gap: .55em; white-space: nowrap; }
.sum-chip .sum-name .ic { color: var(--amber); font-size: 1.2em; }
.sum-chip .sum-when { color: var(--text-2); font-weight: 500; white-space: nowrap; }
.sum-chip .chev { color: var(--muted); font-size: 1.1em; }
.sum-chip.stale .sum-name .ic { color: var(--muted); }
.sum-chip.stale .sum-when { color: var(--muted); }
.glance { display: inline-flex; gap: calc(var(--u) * 2); color: var(--text-2); font-weight: 500; border-left: 1px solid var(--line); padding-left: calc(var(--u) * 1.8); overflow: hidden; }
.glance span { display: inline-flex; align-items: center; gap: .35em; white-space: nowrap; }
.glance b { color: var(--text); font-weight: 650; }
.glance .ic { color: var(--muted); font-size: 1.1em; }
.glance .g-home .ic { color: var(--blue); }

/* promises in the To do list */
.w-meta { font-size: calc(var(--u) * 2.2); color: var(--muted); margin-top: calc(var(--u) * .4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-item.due .w-meta { color: var(--amber); }
.tag { display: inline-flex; align-items: center; gap: .3em; font-size: calc(var(--u) * 1.9); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); background: var(--blue-bg); border-radius: 999px; padding: .15em .7em; margin-right: .6em; vertical-align: .25em; }
.tag .ic { font-size: 1.15em; }
.r-foot { display: flex; align-items: center; gap: calc(var(--u) * 2); justify-content: flex-end; font-size: calc(var(--u) * 2.1); color: var(--muted); padding-top: calc(var(--u) * 1); list-style: none; }
.r-older { margin-right: auto; color: var(--text-2); font-size: calc(var(--u) * 2.3); min-height: calc(var(--u) * 6); }

/* summary sheet */
.sheet.wide { width: min(94vw, calc(var(--u) * 172)); max-height: 94vh; }
.s-made { font-size: calc(var(--u) * 2.2); color: var(--text-2); }
.s-made.stale { color: var(--muted); }
.s-cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: calc(var(--u) * 4); }
.s-col { min-width: 0; display: flex; flex-direction: column; gap: calc(var(--u) * .8); }
.s-area { font-size: calc(var(--u) * 2.6); font-weight: 650; display: flex; align-items: center; gap: .5em; padding-bottom: calc(var(--u) * 1); border-bottom: 1px solid var(--line); }
.s-area .ic { color: var(--amber); font-size: 1.2em; }
.s-area.home .ic { color: var(--blue); }
.s-head { font-size: calc(var(--u) * 2.8); color: var(--text); line-height: 1.3; margin-top: calc(var(--u) * 1); }
.s-sec { font-size: calc(var(--u) * 2); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: calc(var(--u) * 1.6); }
.s-sec span { letter-spacing: 0; }
.s-list { list-style: none; display: grid; }
.s-item { display: flex; align-items: center; gap: calc(var(--u) * 1.2); min-height: calc(var(--u) * 7); font-size: calc(var(--u) * 2.9); line-height: 1.2; }
.s-item.meet { align-items: baseline; padding: calc(var(--u) * .8) 0; }
.s-item.meet b { width: calc(var(--u) * 8.4); flex: none; font-weight: 650; }
.s-text { flex: 1; min-width: 0; }
.s-text small { display: block; font-size: calc(var(--u) * 2.2); color: var(--text-2); margin-top: calc(var(--u) * .3); }
.s-dot { width: calc(var(--u) * 1.2); height: calc(var(--u) * 1.2); border-radius: 50%; background: var(--blue); flex: none; margin: 0 calc(var(--u) * 1.4); }
.r-check.sm { margin-left: calc(var(--u) * -1.8); }
.r-check.sm span { width: calc(var(--u) * 3.6); height: calc(var(--u) * 3.6); }
.s-item.done .s-text { color: var(--muted); text-decoration: line-through; }
.s-item.done .r-check span { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.s-quiet { font-size: calc(var(--u) * 2.6); color: var(--muted); margin-top: calc(var(--u) * 1.6); }

/* arrive: first arrival of the day */
.ar-meets { list-style: none; display: grid; gap: calc(var(--u) * 1.4); margin-top: calc(var(--u) * .6); }
.ar-meets li { display: flex; gap: calc(var(--u) * 1.8); font-size: calc(var(--u) * 3.1); line-height: 1.2; align-items: baseline; }
.ar-meets b { font-weight: 650; width: calc(var(--u) * 8.6); flex: none; }
.ar-meets small { display: block; font-size: calc(var(--u) * 2.3); color: var(--text-2); margin-top: calc(var(--u) * .3); }
.ar-counts { font-size: calc(var(--u) * 2.7); color: var(--text-2); margin-top: calc(var(--u) * 1); }
.ar-counts b { color: var(--amber); }
.ar-home { list-style: none; display: grid; gap: calc(var(--u) * .8); }
.ar-home li { display: flex; align-items: center; gap: .6em; font-size: calc(var(--u) * 2.7); color: var(--text); }
.ar-home .ic { color: var(--blue); }
.ar-home small { color: var(--muted); font-size: .85em; margin-left: auto; }
.ar-more { margin-top: auto; align-self: flex-start; min-height: var(--tap); display: inline-flex; align-items: center; gap: .4em; font-size: calc(var(--u) * 2.5); font-weight: 600; color: var(--text-2); }



/* ---------- REMOTE ACCESS: PIN pad (sign-in page, unlock/leave re-entry, setting the PIN on the wall) ---------- */
.ra-btn { min-height: calc(var(--u) * 8.4); min-width: calc(var(--u) * 8.4); display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: 0; border-radius: 999px; font-size: calc(var(--u) * 3.3); font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.ra-btn span { display: none; }   /* icon only on the wall; labelled on phones */
.ra-btn:active { background: var(--line); }
.pin-page { overflow: auto; height: 100%; color-scheme: dark; }
.pin-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(18px, 4vh, 44px); padding: 24px 16px; text-align: center; }
.pin-head { display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.4vh, 14px); max-width: 30em; }
.pin-logo[hidden] { display: none; }
.pin-logo { font-size: clamp(34px, 5vh, 52px); color: var(--amber); }
.pin-title { font-size: clamp(24px, 3.6vh, 36px); font-weight: 650; letter-spacing: -0.02em; }
.pin-msg { font-size: clamp(17px, 2.4vh, 23px); color: var(--text-2); min-height: 1.4em; line-height: 1.35; text-align: center; }
.pin-page .pin-google { min-height: 52px; padding: 0 1.15rem; font-size: 1rem; text-decoration: none; }
.jarvis-login { --bg: #101317; --surface-3: #222933; --text: #f3eee6; --text-2: #b2bcc8; --amber: #f0b765;
  --jarvis-signin-ink: #22160c; background: var(--bg); }
.jarvis-login .pin-wrap { gap: clamp(14px, 3dvh, 26px); }
.jarvis-login .pin-head { width: min(100%, 21rem); }
.jarvis-login .pin-google { width: 100%; justify-content: center; color: var(--jarvis-signin-ink); background: var(--amber); }
.jarvis-login .pin-option { min-height: 52px; font-size: 1rem; padding-inline: 1rem; }
.jarvis-login .pin-pad { --k: clamp(56px, min(21vw, 10dvh), 88px); }
@media (prefers-color-scheme: light) {
  .pin-page.jarvis-login { --bg: #f8f7f3; --surface-3: #eeece5; --text: #222930; --text-2: #515c66;
    --amber: #7a440f; --jarvis-signin-ink: #fffaf1; }
}
.pin-msg.warn { color: var(--amber); }
.pin-foot { font-size: clamp(14px, 1.9vh, 18px); color: var(--muted); }
.pin-body { display: flex; flex-direction: column; align-items: center; gap: clamp(18px, 3.4vh, 36px); }
.pin-dots { display: flex; gap: clamp(14px, 2.4vh, 24px); }
.pin-dots i { width: clamp(16px, 2.3vh, 24px); height: clamp(16px, 2.3vh, 24px); border-radius: 50%; border: 2px solid var(--muted); transition: background .12s, border-color .12s; }
.pin-dots i.on { background: var(--text); border-color: var(--text); }
.pin-dots.shake { animation: pin-shake .42s ease; }
.pin-dots.shake i { border-color: var(--amber); }
@keyframes pin-shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-12px); } 40%, 80% { transform: translateX(12px); } }
/* Big round keys: --k is the key size; at least 64px wherever it fits. */
.pin-pad { --k: clamp(64px, min(25vw, 12vh), 128px); display: grid; grid-template-columns: repeat(3, var(--k)); gap: calc(var(--k) * .2) calc(var(--k) * .28); }
.pin-key { width: var(--k); height: var(--k); border-radius: 50%; background: var(--surface-3); font-size: calc(var(--k) * .4); font-weight: 550; color: var(--text); display: grid; place-items: center; }
.pin-key:active { background: var(--line); transform: scale(.95); }
.pin-key.fn { background: transparent; color: var(--text-2); font-size: calc(var(--k) * .34); }
.pin-pad.off { opacity: .35; pointer-events: none; }
/* Short landscape screens (phone on its side): title beside the pad. */
@media (orientation: landscape) and (max-height: 560px) {
  .pin-wrap { flex-direction: row; flex-wrap: wrap; gap: 24px 48px; }
  .pin-head { max-width: 40vw; }
  .pin-pad { --k: clamp(56px, 17vh, 96px); }
  .pin-body { gap: 14px; }
}
/* Inside a sheet (wall tablet, or a signed-in phone): same pad, sized with the panel. */
.sheet.pin-sheet { width: min(92vw, calc(var(--u) * 78)); }
.sheet .pin-body { padding-bottom: calc(var(--u) * 1); gap: calc(var(--u) * 2.4); }
.sheet .pin-msg { font-size: calc(var(--u) * 3.2); }
.sheet .pin-foot { font-size: calc(var(--u) * 2.4); }
.sheet .pin-pad { --k: max(64px, calc(var(--u) * 10.5)); }
.sheet .pin-dots i { width: calc(var(--u) * 2.6); height: calc(var(--u) * 2.6); }
.ra { display: flex; flex-direction: column; gap: calc(var(--u) * 1.8); overflow: auto; }
.ra-note { font-size: calc(var(--u) * 2.8); line-height: 1.4; color: var(--text-2); display: flex; gap: .55em; align-items: flex-start; }
.ra-note b { color: var(--text); font-weight: 600; }
.ra-note.warn { color: var(--amber); }
.ra-note .ic { margin-top: .2em; }
.ra-list { list-style: none; display: flex; flex-direction: column; gap: calc(var(--u) * 1.2); }
.ra-list li { display: flex; align-items: center; gap: var(--gap); background: var(--surface-2); border-radius: var(--radius); padding: calc(var(--u) * 1.6) calc(var(--u) * 2.4); }
.ra-dev { flex: 1; display: flex; flex-direction: column; gap: .25em; min-width: 0; }
.ra-dev b { font-size: calc(var(--u) * 3); font-weight: 600; }
.ra-dev small { font-size: calc(var(--u) * 2.3); color: var(--muted); }
.ra-quiet { font-size: calc(var(--u) * 2.7); color: var(--muted); }
@media (max-width: 1100px), (max-height: 600px) {
  .sheet.pin-sheet { width: 100%; max-width: 520px; }
  .sheet .pin-pad { --k: clamp(56px, min(18vw, 8.2dvh), 84px); }
  .sheet .pin-msg { font-size: 18px; }
  .sheet .pin-dots i { width: 18px; height: 18px; }
}

/* Auto: footer button, toast with Undo / Stop doing this, sheet with switches + today's log */
.auto-btn span { display: none; font-size: calc(var(--u) * 2.4); }   /* icon only on the wall, "Auto off" when off */
.auto-btn.off { padding: 0 calc(var(--u) * 2.2); }
.auto-btn.off span { display: inline; }
.auto-btn .ic { color: var(--amber); }
.auto-btn.off .ic { color: var(--muted); }
.auto-btn.off span { color: var(--amber); }
.auto-btn.obs .ic { color: var(--text-2); }
.atoast { position: fixed; left: 50%; bottom: calc(var(--u) * 13.5); transform: translateX(-50%); z-index: 41; background: var(--surface-3); color: var(--text); border-radius: calc(var(--u) * 5); padding: calc(var(--u) * 0.8) calc(var(--u) * 0.8) calc(var(--u) * 0.8) calc(var(--u) * 3); font-size: calc(var(--u) * 2.6); font-weight: 550; display: flex; align-items: center; gap: calc(var(--u) * 1.4); box-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 4) rgba(0, 0, 0, .5); max-width: 92vw; animation: fadein .25s ease; }
.atoast.warn { background: #3a2c17; color: var(--amber); }
.atoast > .ic { font-size: 1.3em; color: var(--amber); flex: none; }
.atoast .at-text { padding-right: calc(var(--u) * 1); white-space: nowrap; }
.atoast .at-btn { min-height: var(--tap); padding: 0 calc(var(--u) * 2.6); border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 650; font-size: calc(var(--u) * 2.4); display: inline-flex; align-items: center; gap: .45em; white-space: nowrap; }
.atoast .at-btn.primary { background: var(--amber); color: #1d1408; }
.atoast .at-btn:active { background: var(--line); }
.atoast .at-x { min-width: var(--exit); height: var(--exit); padding: 0 calc(var(--u) * 2.2); border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: .4em; color: var(--text-2); font-weight: 600; font-size: calc(var(--u) * 2.3); flex: none; white-space: nowrap; }
.atoast .at-x:active { background: var(--line); }
.ab-master { display: flex; align-items: center; gap: var(--gap); background: var(--surface-2); border-radius: var(--radius); padding: calc(var(--u) * 1.6) calc(var(--u) * 2.4); }
.ab-master .ab-t { flex: 1; display: flex; flex-direction: column; gap: .25em; }
.ab-master b { font-size: calc(var(--u) * 3.2); font-weight: 650; }
.ab-master small, .ab-rule small { font-size: calc(var(--u) * 2.2); color: var(--muted); line-height: 1.35; }
.ab-rule { display: flex; align-items: center; gap: var(--gap); padding: calc(var(--u) * 1.3) 0; border-bottom: 1px solid var(--line); }
.ab-rule .ab-t { flex: 1; display: flex; flex-direction: column; gap: .2em; min-width: 0; }
.ab-rule b { font-size: calc(var(--u) * 2.8); font-weight: 600; }
.ab-rule.dim { opacity: .5; }
.ab-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: calc(var(--u) * 4); min-height: 0; overflow: hidden; }
.ab-cols > div { overflow-y: auto; min-height: 0; scrollbar-width: none; }
.ab-log { list-style: none; display: flex; flex-direction: column; gap: calc(var(--u) * 1); }
.ab-log li { display: grid; grid-template-columns: calc(var(--u) * 11) 1fr; gap: calc(var(--u) * 1.2); font-size: calc(var(--u) * 2.4); line-height: 1.35; color: var(--text-2); }
.ab-log li time { color: var(--muted); font-variant-numeric: tabular-nums; }
.ab-log li.act { color: var(--text); }
.ab-log li.fail { color: var(--amber); }
.ab-log li.undone span { text-decoration: line-through; color: var(--muted); }
.ab-log li.obs span::before { content: 'observe · '; color: var(--muted); }
.ab-note { font-size: calc(var(--u) * 2.2); color: var(--muted); line-height: 1.4; }
.ab-note.warn { color: var(--amber); }
.prep { font-size: calc(var(--u) * 2.3); color: var(--muted); display: flex; align-items: center; gap: .45em; margin-top: calc(var(--u) * 0.6); }
.prep .ic { color: var(--amber); }
.sheet.auto-sheet { width: min(94vw, calc(var(--u) * 175)); }
@media (max-width: 1100px), (max-height: 600px) {
  .ab-cols { grid-template-columns: 1fr; overflow: visible; }
  .auto-btn span { display: inline; }
}

/* ---------- PHONE / FOLD ----------
   Anything that is not the wall's 3:2 landscape (1920x1280 / 1280x853) — Galaxy Fold cover (~412x830) and inner
   (~750x720 in a Chrome tab, ~750x800 installed), phones, a phone on its side — gets its own scale and arrangement.
   Sizes are in rem here (--u = 0.36rem), so Android's text-size setting scales them; the wall never matches
   these queries and stays pixel-identical. */
@media (max-width: 1100px), (max-height: 600px) {
  :root { --u: 0.36rem; --tap: 48px; --exit: 52px; --radius: 16px; --gap: 10px; }
  html, body { overflow: auto; height: auto; min-height: 100%; }
  #app { position: static; min-height: 100vh; min-height: 100dvh; }
  .screen { position: relative; min-height: 100vh; min-height: 100dvh; }
  #working {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: auto;
    grid-template-areas: "clock" "meeting" "controls" "rem" "strip";
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    row-gap: 12px; column-gap: 14px;
  }
  /* header: time + date on one line, summary chip under it */
  .clock-block { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; row-gap: 4px; padding: 0; }
  .time { font-size: 2.6rem; line-height: 1; letter-spacing: -0.03em; font-weight: 350; }
  .date { font-size: 1rem; margin: 0; }
  .allday { margin: 0; flex-basis: 100%; }
  .allday span { font-size: .8rem; padding: 3px 10px; }
  #w-summary { flex-basis: 100%; min-width: 0; }
  .sum-chip { margin-top: 4px; font-size: .9rem; min-height: 44px; flex-wrap: wrap; row-gap: 2px; padding: 4px 12px 4px 14px; border-radius: 22px; }
  .glance { border-left: 0; padding-left: 0; }
  /* meeting card */
  .meeting { padding: 14px 16px; gap: 4px; }
  .eyebrow { font-size: .72rem; }
  .countdown { font-size: 2rem; }
  .meeting.empty .countdown { font-size: 1.25rem; }
  .m-title { font-size: 1.05rem; }
  .m-time { font-size: .85rem; }
  .m-later { font-size: .85rem; padding-top: 8px; }
  .call-hint { top: 10px; right: 10px; font-size: .8rem; min-height: 40px; padding: 0 12px; }
  .prep { font-size: .8rem; }
  /* scenes + lights/door */
  .controls { gap: 10px; }
  .scenes { grid-auto-rows: 60px; gap: 10px; }
  .scene { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; padding: 0 16px; font-size: 1.05rem; }
  .scene .ic { font-size: 1.4rem; }
  .scenes.scenes-5 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }   /* phones: two columns, Off full width */
  .scenes-5 .scene, .scenes-5 .scene:nth-child(n+4) { grid-column: auto; }
  .scenes-5 .scene:last-child { grid-column: span 2; }
  .control-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; }
  .tile { min-height: 60px; padding: 0 14px; font-size: 1rem; gap: 10px; }
  .tile .ic { font-size: 1.3rem; }
  .tile .chev { font-size: 1rem; }
  .door .d-name { font-size: .75rem; }
  .door .d-state { font-size: 1.1rem; }
  .door .d-act { font-size: .8rem; padding: 6px 12px; }
  .scene.pending::after, .tile.pending::after { right: 10px; top: 10px; width: 14px; height: 14px; }
  /* to-do: capped, scrolls inside its card so the controls stay reachable */
  .reminders { padding: 10px 8px 8px 14px; max-height: min(30rem, 70dvh); }
  .r-head .eyebrow { font-size: .72rem; }
  .r-head .pill-btn { min-height: 40px; font-size: .9rem; padding: 0 12px; }
  .r-list { flex: 1; min-height: 0; overflow-y: auto; }
  .r-item { min-height: 48px; gap: 8px; padding: 4px 0; }
  .r-check { width: 44px; height: 44px; margin-left: -8px; }
  .r-check span { width: 22px; height: 22px; font-size: 14px; }
  .r-text { font-size: 1rem; line-height: 1.25; }
  .r-meta { font-size: .75rem; white-space: normal; text-align: right; }
  .r-item .r-text small, .r-sub { font-size: .78rem; }
  .r-del { width: 44px; height: 44px; font-size: 1.1rem; }
  .r-empty { font-size: .95rem; }
  .r-foot { flex-wrap: wrap; justify-content: space-between; row-gap: 4px; font-size: .78rem; }
  .r-foot .r-older { font-size: .85rem; min-height: 40px; }
  /* footer: status line, then Auto / Remote / Leave */
  .strip { flex-wrap: wrap; margin: 0; padding: 10px 0 0; gap: 10px; border-top: 1px solid var(--line); }
  .status { flex-basis: 100%; flex-wrap: wrap; white-space: normal; row-gap: 6px; column-gap: 16px; font-size: .9rem; }
  .status .st-health { min-height: 44px; }
  .ra-btn { min-height: 48px; min-width: 48px; font-size: .95rem; padding: 0 14px; flex: none; }
  .ra-btn span { display: inline; }
  .leave-btn { flex: 1; min-height: 48px; min-width: 0; font-size: 1rem; padding: 0 16px; }
  /* arrive (only ever on the wall, but keep it sane) */
  #arrive { padding: 20px 14px; grid-template-rows: none; }
  .ar-head { flex-wrap: wrap; }
  .ar-cols { grid-template-columns: minmax(0, 1fr); }
  .ar-actions { flex-wrap: wrap; }
  /* sheets: near full screen, own scroll */
  .sheet-overlay { place-items: end center; }
  .sheet, .sheet.wide, .sheet.auto-sheet { width: 100%; max-width: 760px; max-height: 92dvh; padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border-radius: 20px 20px 0 0; gap: 12px; overflow-y: auto; }
  /* the whole sheet scrolls here: its head (title + Close) stays on screen */
  .sheet-head { flex-wrap: nowrap; position: sticky; top: -16px; z-index: 2; margin: -16px -16px 0; padding: 16px 16px 6px; background: var(--surface); }
  .sheet-head h2 { font-size: 1.35rem; }
  .x-btn { height: var(--exit); padding: 0 16px 0 12px; font-size: 1rem; }
  .big-btn[data-exit] { min-height: var(--exit); }
  .l-row { min-height: 56px; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
  .l-name { font-size: 1rem; }
  .steps { gap: 6px; }
  .step { min-width: 52px; min-height: 44px; font-size: .85rem; border-radius: 12px; }
  .toggle { width: 72px; min-height: 44px; font-size: .9rem; flex: none; }
  .big-btn { min-height: 48px; font-size: 1rem; padding: 0 18px; }
  .sheet-actions { flex-wrap: wrap; }
  .lv-sec { font-size: .72rem; }
  .lv-list li { font-size: .95rem; }
  .lv-list li small { font-size: .78rem; }
  .s-cols { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .chips { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .chip { min-height: 44px; font-size: .9rem; }
  .kb { gap: 6px; }
  .kb-row { gap: 4px; }
  .kb-key { min-height: 46px; font-size: 1.05rem; border-radius: 8px; }
  .kb-space { font-size: .85rem; }
  /* takeovers */
  .to-door { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; overflow-y: auto; }
  .to-cam .cv-video, .to-cam .cv-img { max-height: 50dvh; }
  .to-title { font-size: 1.6rem; }
  .to-when, .to-body { font-size: 1rem; }
  .to-kicker { font-size: .75rem; }
  .to-side .big-btn { min-height: 52px; font-size: 1.05rem; }
  .to-notice { width: calc(100vw - 28px); padding: 20px 18px 16px; gap: 10px; border-top-width: 6px; }
  .toast { bottom: max(16px, env(safe-area-inset-bottom)); font-size: .9rem; padding: 10px 16px; }
  .ab-cols { grid-template-columns: minmax(0, 1fr); overflow: visible; gap: 16px; flex: none; min-height: auto; }
  .sheet > .sheet-body, .sheet > .s-cols { flex: none; }
  .ab-cols > div { overflow: visible; }
  .ab-master { padding: 12px 14px; }
  .ab-master b { font-size: 1.05rem; }
  .ab-rule b { font-size: .95rem; }
  .ab-master small, .ab-rule small, .ab-note { font-size: .78rem; }
  .ab-log li { grid-template-columns: 4.8rem 1fr; font-size: .85rem; }
  .sum-chip .chev { display: none; }
  .door .d-name { white-space: nowrap; }
  .atoast { left: 14px; right: 14px; transform: none; max-width: 560px; margin: 0 auto; bottom: max(14px, env(safe-area-inset-bottom)); border-radius: 18px; padding: 6px 6px 6px 14px; font-size: .9rem; gap: 8px; flex-wrap: nowrap; }
  .atoast .at-text { white-space: normal; flex: 1; min-width: 0; line-height: 1.25; }
  .atoast .at-btn { min-height: 44px; font-size: .85rem; padding: 0 12px; }
  .atoast .at-x { height: var(--exit); padding: 0 12px; font-size: .85rem; }
}
/* Unfolded Fold (or any screen ≥ 640 px wide that isn't the wall): two columns, everything on the first screen.
   Left: header + summary + to-do (scrolls in its card). Right: meeting, scenes, lights + door, footer with Leave. */
@media (min-width: 640px) and (max-width: 1100px), (min-width: 640px) and (max-height: 600px) {
  #working {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    grid-template-areas: "clock meeting" "rem controls" "rem strip" "rem .";
    align-items: start;
  }
  /* contain: size → the list never makes the page taller; it fills the left column and scrolls inside */
  .reminders { max-height: none; min-height: 16rem; align-self: stretch; contain: size; }
}
@media (max-width: 380px) {
  .control-row { grid-template-columns: minmax(0, 1fr); }
  .atoast { flex-wrap: wrap; }
}

/* Voice commands (public/voice.js): listening pill + heard/reply toast */
.vbar { position: fixed; top: calc(var(--u) * 2); left: 50%; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: calc(var(--u) * 1.4); padding: calc(var(--u) * 1.2) calc(var(--u) * 3.2); border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: calc(var(--u) * 3); font-weight: 650; box-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 4) rgba(0, 0, 0, .5); animation: fadein .2s ease; }
.vbar .vdot { width: calc(var(--u) * 2.2); height: calc(var(--u) * 2.2); border-radius: 50%; background: #5ab0ff; animation: vpulse 1s ease-in-out infinite; }
.vbar.thinking .vdot { background: var(--amber); }
@keyframes vpulse { 0%, 100% { transform: scale(.7); opacity: .6; } 50% { transform: scale(1.15); opacity: 1; } }
.vtoast { position: fixed; top: calc(var(--u) * 2); left: 50%; transform: translateX(-50%); z-index: 44; max-width: 80vw; padding: calc(var(--u) * 1.6) calc(var(--u) * 3.2); border-radius: calc(var(--u) * 2.4); background: var(--surface-3); color: var(--text); box-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 4) rgba(0, 0, 0, .5); animation: fadein .25s ease; }
.vtoast:not([hidden]) { display: flex; align-items: center; gap: calc(var(--u) * 2); padding-right: calc(var(--u) * 1); }
.vtoast .vt-main { min-width: 0; }
.vtoast .vt-x { flex: none; min-width: var(--exit); height: var(--exit); padding: 0 calc(var(--u) * 2.2); border-radius: 999px; background: var(--surface-2); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; gap: .4em; font-size: calc(var(--u) * 2.3); font-weight: 600; white-space: nowrap; }
.vtoast .vt-x:active { background: var(--line); }
.vtoast .vt-heard { font-size: calc(var(--u) * 2.4); color: var(--text-2); }
.vtoast .vt-reply { font-size: calc(var(--u) * 3); font-weight: 650; margin-top: calc(var(--u) * .4); }
.vtoast.warn .vt-reply { color: var(--amber); }

/* Camera view (public/glance.js): full screen; a persistent top bar (name, live state, big labelled Close) that never
   hides, a camera picker row when there are several, and an end panel (Watch again / Close) when the picture stops. */
.camglance { position: fixed; inset: 0; z-index: 46; background: #000; display: flex; flex-direction: column; }
.camglance .gl-frame { flex: 1 1 0; height: auto; min-height: 0; position: relative; overflow: hidden; display: grid; place-items: center; transition: opacity .3s; }
.camglance .gl-frame.gl-dim { opacity: .35; }
/* the picture fills the space between the bars and never grows over them */
.camglance .gl-frame .cv-video, .camglance .gl-frame .cv-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
/* public/camview.js: one camera picture (live video / fresh frame / labelled saved picture) */
.cv { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; }
.cv-video, .cv-img { grid-area: 1 / 1; max-width: 100%; max-height: 100%; object-fit: contain; display: block; background: #000; transition: opacity .3s; }
.cv-video.cv-stale { opacity: .5; }
.cv-msg { grid-area: 1 / 1; z-index: 1; color: var(--text-2); font-size: calc(var(--u) * 3); background: rgba(0, 0, 0, .55); padding: .4em 1em; border-radius: 999px; }
.camglance .gl-bar { flex: none; display: flex; align-items: center; gap: calc(var(--u) * 2); padding: calc(var(--u) * 1.4) calc(var(--u) * 1.6) calc(var(--u) * 1.4) calc(var(--u) * 3); background: rgba(18, 21, 26, .96); border-bottom: 1px solid var(--line); }
.camglance .gl-head { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: calc(var(--u) * 2); }
.camglance .gl-title { font-size: calc(var(--u) * 3.4); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camglance .gl-sub { min-width: 0; font-size: calc(var(--u) * 2.6); font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camglance .gl-sub[data-kind="live"] { color: var(--green); }
.camglance .gl-sub[data-kind="live"]::before { content: ''; display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--green); margin-right: .45em; vertical-align: .05em; }
.camglance .gl-sub[data-kind="paused"], .camglance .gl-sub[data-kind="ended"], .camglance .gl-sub[data-kind="saved"], .camglance .gl-sub[data-kind="frame"], .camglance .gl-sub[data-kind="notready"] { color: var(--amber); }
.camglance .gl-x, .camglance .gl-again, .camglance .gl-opt, .camglance .gl-cam { flex: none; min-height: var(--exit); min-width: var(--exit); padding: 0 calc(var(--u) * 3.2); display: inline-flex; align-items: center; justify-content: center; gap: .5em; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: calc(var(--u) * 3); font-weight: 650; white-space: nowrap; }
.camglance .gl-x { background: var(--text); color: var(--bg); min-width: calc(var(--u) * 20); }
.camglance .gl-x .ic { font-size: 1.15em; }
.camglance .gl-x:active { background: var(--text-2); }
.camglance .gl-again:active, .camglance .gl-opt:active, .camglance .gl-cam:active { background: var(--line); }
.camglance .gl-opt.on { background: var(--amber-bg); color: var(--amber); box-shadow: inset 0 0 0 2px rgba(240, 180, 92, .45); }
.camglance .gl-end { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -40%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 2); max-width: 92vw; padding: calc(var(--u) * 4) calc(var(--u) * 5); border-radius: calc(var(--radius) * 1.3); background: rgba(20, 24, 29, .96); text-align: center; box-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 6) rgba(0, 0, 0, .6); }
.camglance .gl-end-t { font-size: calc(var(--u) * 4.4); font-weight: 650; }
.camglance .gl-end-s { font-size: calc(var(--u) * 2.5); color: var(--text-2); max-width: calc(var(--u) * 90); line-height: 1.35; }
.camglance .gl-end-row { display: flex; gap: calc(var(--u) * 2); margin-top: calc(var(--u) * 1); }
.camglance .gl-again { background: var(--amber); color: #1d1408; }
.camglance .gl-pick { flex: none; display: flex; gap: calc(var(--u) * 1.4); justify-content: center; padding: calc(var(--u) * 1.4) calc(var(--u) * 2); background: rgba(18, 21, 26, .96); border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.camglance .gl-cam .ic { color: var(--muted); }
.camglance .gl-cam.on { background: var(--text); color: var(--bg); }
.camglance .gl-cam.on .ic { color: var(--bg); }
@media (max-width: 1100px), (max-height: 600px) {
  .camglance .gl-bar { padding: 8px 8px 8px 16px; gap: 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .camglance .gl-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .camglance .gl-title { font-size: 1.1rem; } .camglance .gl-sub { font-size: .9rem; }
  .camglance .gl-x, .camglance .gl-again, .camglance .gl-opt, .camglance .gl-cam { font-size: 1rem; padding: 0 18px; }
  .camglance .gl-x { min-width: 112px; }
  .camglance .gl-end { padding: 20px 18px; gap: 10px; }
  .camglance .gl-end-t { font-size: 1.3rem; } .camglance .gl-end-s { font-size: .9rem; }
  .camglance .gl-pick { justify-content: flex-start; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); gap: 8px; }
}

/* Photo frame (public/photos.js, wall tablet only): full-screen photos with a slow crossfade, portrait pairs, small overlay. */
.photoframe { position: fixed; inset: 0; z-index: 30; background: #000; overflow: hidden; touch-action: none; animation: fadein .8s ease; }
.photoframe .pf-stage { position: absolute; inset: 0; }
.photoframe .pf-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 30%); }
.photoframe .pf-layer { position: absolute; inset: 0; display: flex; background: #000; opacity: 0; transition: opacity 3s ease; }
.photoframe .pf-layer.in { opacity: 1; }
.photoframe .pf-pair { gap: calc(var(--u) * 0.6); }
.photoframe .pf-photo { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.photoframe .pf-blur { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(calc(var(--u) * 4)) brightness(.45); }
.photoframe .pf-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.photoframe .pf-pair .pf-img { object-fit: cover; }
.photoframe .pf-cap { position: absolute; right: calc(var(--u) * 3.5); bottom: calc(var(--u) * 3.6); z-index: 2; max-width: calc(100% - var(--u) * 7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: calc(var(--u) * 2.4); font-weight: 500; color: rgba(255, 255, 255, .86); text-shadow: 0 1px calc(var(--u) * 0.8) rgba(0, 0, 0, .7); }
.photoframe .pf-layer:not(.pf-pair) .pf-cap { max-width: 44%; }
.photoframe .pf-cap:empty { display: none; }
/* In a pair the left photo's caption sits above the clock block (bottom-left), never beside it. */
.photoframe .pf-pair .pf-photo:first-child .pf-cap { left: calc(var(--u) * 4); right: auto; bottom: calc(var(--u) * 18.5); text-align: left; }
.photoframe .pf-hide { position: absolute; top: 0; right: 0; z-index: 2; width: calc(var(--tap) * 1.25); height: calc(var(--tap) * 1.25); display: grid; place-items: center; color: #fff; opacity: .45; font-size: calc(var(--u) * 2.6); }
.photoframe .pf-hide .ic { filter: drop-shadow(0 0 calc(var(--u) * 0.5) rgba(0, 0, 0, .8)); }
.photoframe .pf-hide:active { opacity: .9; }
.photoframe .pf-hint { position: absolute; left: 50%; top: calc(var(--u) * 3); transform: translateX(-50%); z-index: 3; pointer-events: none; padding: calc(var(--u) * 1.2) calc(var(--u) * 3); border-radius: 999px; background: rgba(0, 0, 0, .55); color: rgba(255, 255, 255, .9); font-size: calc(var(--u) * 2.4); font-weight: 600; opacity: 0; animation: pfhint 7s ease forwards; }
@keyframes pfhint { 0%, 8% { opacity: 0; } 15%, 75% { opacity: 1; } 100% { opacity: 0; } }
.photoframe .pf-info { position: absolute; left: calc(var(--u) * 4); bottom: calc(var(--u) * 3.2); z-index: 2; pointer-events: none; text-shadow: 0 1px calc(var(--u) * 1.2) rgba(0, 0, 0, .75); }
.photoframe .pf-time { font-size: calc(var(--u) * 10); font-weight: 300; line-height: 1; letter-spacing: -0.02em; color: #fff; }
.photoframe .pf-next { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: calc(var(--u) * 1); font-size: calc(var(--u) * 2.6); font-weight: 550; color: rgba(255, 255, 255, .88); }
.pftoast { position: fixed; left: 50%; top: calc(var(--u) * 3); transform: translateX(-50%); z-index: 41; background: var(--surface-3); color: var(--text); border-radius: calc(var(--u) * 5); padding: calc(var(--u) * 0.8) calc(var(--u) * 0.8) calc(var(--u) * 0.8) calc(var(--u) * 3); font-size: calc(var(--u) * 2.6); font-weight: 550; display: flex; align-items: center; gap: calc(var(--u) * 1.4); box-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 4) rgba(0, 0, 0, .5); animation: fadein .25s ease; }
.pftoast .pft-text { white-space: nowrap; padding-right: calc(var(--u) * 1); }
.pftoast .pft-btn { min-height: var(--tap); padding: 0 calc(var(--u) * 2.6); border-radius: 999px; background: var(--amber); color: #1d1408; font-weight: 650; font-size: calc(var(--u) * 2.4); display: inline-flex; align-items: center; gap: .45em; }
.pftoast .pft-btn:active { background: var(--line); color: var(--text); }
.ab-rule small.pf-warn { color: var(--amber); }

/* ---- Play (README "Play (daily toy)"): the kid-mode shell (public/play.html + play.js); opened by the Kids scene. */
body[data-moment="play"] { background: #000; touch-action: none; }
.kidtoy { position: fixed; inset: 0; width: 100vw; height: 100vh; border: 0; display: block; background: #000; z-index: 1; }
.kidempty { position: fixed; inset: 0; z-index: 2; display: grid; place-items: center; font-size: calc(var(--u) * 3.2); color: var(--muted); }
/* The child lock: above the iframe, outside it. Small and faint, so a toddler has nothing to aim at. */
.kidbell { position: fixed; top: calc(var(--u) * 2); left: 50%; transform: translateX(-50%); z-index: 8; pointer-events: none; display: flex; align-items: center; gap: .7em; max-width: calc(100vw - var(--tap) * 2 - 32px); padding: calc(var(--u) * 1.8) calc(var(--u) * 3.6); border-radius: 999px; background: rgba(20, 22, 27, .92); color: #fff; font-size: calc(var(--u) * 3.4); font-weight: 650; box-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 4) rgba(0, 0, 0, .55); animation: fadein .3s ease; white-space: nowrap; }
.kidbell svg { width: 1.3em; height: 1.3em; flex: none; fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kidbell span { overflow: hidden; text-overflow: ellipsis; }
.kidhold { position: fixed; top: 0; right: 0; z-index: 10; width: max(64px, var(--tap)); height: max(64px, var(--tap)); display: grid; place-items: center; opacity: .28; touch-action: none; }
.kidhold svg { width: 62%; height: 62%; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
.kidhold .kh-track { stroke: rgba(255, 255, 255, .35); }
.kidhold .kh-fill { stroke: var(--amber); stroke-dasharray: 100; stroke-dashoffset: 100; transform: rotate(-90deg); transform-origin: 50% 50%; }
.kidhold .kh-glyph { stroke-width: 2.2; transform: rotate(45deg); transform-origin: 50% 50%; }
.kidhold.holding { opacity: 1; }
/* For grown-ups only: a faint "hold to exit" next to the lock; not a control (touches go through to the toy). */
.kidhint { position: fixed; top: 0; right: max(64px, var(--tap)); z-index: 9; height: max(64px, var(--tap)); display: flex; align-items: center; padding-right: calc(var(--u) * .6); pointer-events: none; font-size: max(13px, calc(var(--u) * 1.8)); font-weight: 600; color: rgba(255, 255, 255, .42); text-shadow: 0 1px 3px rgba(0, 0, 0, .8); white-space: nowrap; }
.kidhold.holding .kh-fill { stroke-dashoffset: 0; transition: stroke-dashoffset var(--hold-ms, 3000ms) linear; }

/* ---- Away screen (public/away.html + away.js, README "Devices and roaming"): the wall tablet outside the office or in
   "kids only" mode, when nobody is playing. A clock, Play, one line; no panel state and no way to the dashboard. */
body[data-moment="awayscreen"] { background: var(--bg); }
.awayscr { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 2.4); padding: calc(var(--u) * 5); text-align: center; }
.awayscr .aw-time { font-size: calc(var(--u) * 24); font-weight: 300; letter-spacing: -0.04em; line-height: .95; }
.awayscr .aw-time .ampm { font-size: .3em; margin-left: .25em; color: var(--text-2); letter-spacing: 0; }
.awayscr .aw-date { font-size: calc(var(--u) * 4); color: var(--text-2); }
.awayscr .aw-play { margin-top: calc(var(--u) * 3); min-height: calc(var(--tap) * 1.6); min-width: calc(var(--u) * 44); padding: 0 calc(var(--u) * 5); border-radius: 999px; background: var(--amber); color: #1d1408; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .5em; font-size: calc(var(--u) * 5); font-weight: 700; }
.awayscr .aw-play svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.awayscr .aw-play:active { background: var(--line); color: var(--text); }
.awayscr .aw-note { max-width: calc(var(--u) * 110); font-size: calc(var(--u) * 2.8); color: var(--muted); line-height: 1.35; }
.awayscr .aw-back { position: relative; min-height: var(--tap); padding: 0 calc(var(--u) * 3); border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: calc(var(--u) * 2.4); font-weight: 600; overflow: hidden; }
.awayscr .aw-back span:last-child { position: relative; }
.awayscr .aw-back .aw-ring { position: absolute; inset: 0; background: var(--green-bg); transform: scaleX(0); transform-origin: left; }
.awayscr .aw-back.holding .aw-ring { transform: scaleX(1); transition: transform 3s linear; }

/* ---------- OFFICE STATION (README "Office station") ----------
   Raspberry Pi 4 + 7-inch 1024x600 capacitive touch screen, landscape (aspect 1.707), fixed next to the door/desk.
   app.js sets html.station when the server says ui.device.role = station, or on a kiosk whose viewport is ~1024x600.
   Its own units instead of the wall's 3:2 --u:
     --su  = one design pixel of the 1024x600 layout (scales if the viewport is a little different);
     --tap = 76 design px. The screen is ~170 dpi at DPR 1, so 76 px = 11.4 mm, the wall's physical tap size
             (64-68 CSS px at ~145 CSS px per inch on the 10.6-inch 1920x1280 tablet = 11-12 mm).
   The phone/Fold rules above also match 1024x600 (max-height: 600px); everything here is `html.station …`, so it wins
   by specificity. Nothing here applies to the wall (1920x1280 / 1280x853) or to phones. */
html.station {
  --su: min(calc(100vh / 600), calc(100vw / 1024));
  --tap: max(64px, calc(var(--su) * 76));
  --exit: max(var(--tap), calc(var(--su) * 82)); /* ways back: 82 design px ≈ 12.3 mm at ~170 dpi */
  --u: calc(var(--su) * 6);          /* only for shared wall pieces the phone rules don't resize */
  --radius: calc(var(--su) * 16);
  --gap: calc(var(--su) * 12);
}
html.station, html.station body { overflow: hidden; height: 100%; }
html.station #app { position: fixed; inset: 0; min-height: 0; }
html.station .screen { position: absolute; inset: 0; min-height: 0; }
html.station #working {
  padding: calc(var(--su) * 14) calc(var(--su) * 18) 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  grid-template-rows: calc(var(--su) * 156) minmax(0, 1fr) calc(var(--su) * 96);
  grid-auto-rows: auto;
  grid-template-areas: "clock meeting" "controls controls" "strip strip";
  column-gap: calc(var(--su) * 16); row-gap: calc(var(--su) * 12);
  align-items: stretch;
}
/* clock + date (+ all-day chips); the summary chip only on the "More" page */
html.station .clock-block { display: flex; flex-direction: column; justify-content: center; gap: calc(var(--su) * 6); padding: 0; min-width: 0; }
html.station .time { font-size: calc(var(--su) * 92); line-height: .92; letter-spacing: -0.04em; font-weight: 300; }
html.station .time .ampm { font-size: .3em; }
html.station .date { font-size: calc(var(--su) * 22); margin: 0; }
html.station .allday { margin: 0; gap: calc(var(--su) * 6); flex-wrap: nowrap; overflow: hidden; }
html.station .allday span { font-size: calc(var(--su) * 15); padding: calc(var(--su) * 3) calc(var(--su) * 10); white-space: nowrap; }
html.station #w-summary { display: none; }
/* next meeting: one compact card (countdown + title); later meetings and prep notes stay on the wall */
html.station .meeting { padding: calc(var(--su) * 14) calc(var(--su) * 18); gap: calc(var(--su) * 4); justify-content: center; }
html.station .eyebrow { font-size: calc(var(--su) * 14); gap: calc(var(--su) * 6); }
html.station .countdown { font-size: calc(var(--su) * 44); }
html.station .meeting.empty .countdown { font-size: calc(var(--su) * 28); }
html.station .m-title { font-size: calc(var(--su) * 21); -webkit-line-clamp: 1; }
html.station .m-time { font-size: calc(var(--su) * 16); }
html.station .m-later, html.station .meeting .prep { display: none; }
html.station .cal-note { font-size: calc(var(--su) * 15); }
html.station .onair i { width: calc(var(--su) * 11); height: calc(var(--su) * 11); }
html.station .call-hint { top: calc(var(--su) * 10); right: calc(var(--su) * 10); min-height: var(--tap); padding: 0 calc(var(--su) * 18); font-size: calc(var(--su) * 17); }
/* scenes in one row of five, then Lights + Office door */
html.station .reminders { display: none; }
html.station .controls { grid-template-rows: minmax(0, 1fr) auto; gap: calc(var(--su) * 12); }
html.station .scenes, html.station .scenes.scenes-5 { grid-template-columns: none; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; grid-template-rows: minmax(var(--tap), 1fr); grid-auto-rows: minmax(var(--tap), 1fr); gap: calc(var(--su) * 12); }
html.station .scenes .scene, html.station .scenes.scenes-5 .scene:nth-child(n) { grid-column: auto; }
html.station .scene { flex-direction: column; align-items: flex-start; justify-content: center; gap: calc(var(--su) * 8); padding: 0 calc(var(--su) * 18); font-size: calc(var(--su) * 21); }
html.station .scene .ic { font-size: calc(var(--su) * 28); }
html.station .control-row { grid-template-columns: auto minmax(0, 1fr); gap: calc(var(--su) * 12); }
html.station .tile { min-height: calc(var(--su) * 96); padding: 0 calc(var(--su) * 20); font-size: calc(var(--su) * 21); gap: calc(var(--su) * 12); }
html.station .tile .ic { font-size: calc(var(--su) * 26); }
html.station .lights-btn .chev { display: none; }
html.station .door .d-name { font-size: calc(var(--su) * 15); white-space: nowrap; }
html.station .door .d-state { font-size: calc(var(--su) * 24); }
html.station .door .d-act { font-size: calc(var(--su) * 17); padding: calc(var(--su) * 10) calc(var(--su) * 20); min-height: calc(var(--su) * 52); display: inline-flex; align-items: center; }
html.station .scene.pending::after, html.station .tile.pending::after { right: calc(var(--su) * 12); top: calc(var(--su) * 12); width: calc(var(--su) * 16); height: calc(var(--su) * 16); }
/* bottom strip: status (fitStatus drops whole items), camera, More, Auto, Remote, Leave */
html.station .strip { flex-wrap: nowrap; margin: 0 calc(var(--su) * -18); padding: 0 calc(var(--su) * 18); gap: calc(var(--su) * 10); border-top: 1px solid var(--line); }
html.station .status { flex: 1; flex-basis: auto; flex-wrap: nowrap; white-space: nowrap; font-size: calc(var(--su) * 17); gap: calc(var(--su) * 16); }
html.station .ra-btn { min-height: var(--tap); min-width: var(--tap); padding: 0 calc(var(--su) * 16); font-size: calc(var(--su) * 17); flex: none; }
html.station .ra-btn .ic { font-size: calc(var(--su) * 26); }
html.station .ra-btn span { display: none; }
html.station .gl-btn span, html.station .more-btn span, html.station .auto-btn.off span { display: inline; }
html.station .leave-btn { flex: none; min-height: var(--tap); min-width: calc(var(--su) * 150); padding: 0 calc(var(--su) * 22); font-size: calc(var(--su) * 19); }
.more-btn { display: none; }
html.station .more-btn { display: none; }
/* "More": the to-do list (+ summary chip) in place of the controls until Back (or 90 s without a touch) */
html.station.st-more #working { grid-template-areas: "clock meeting" "rem rem" "strip strip"; grid-template-rows: calc(var(--su) * 180) minmax(0, 1fr) calc(var(--su) * 96); }
html.station.st-more .time { font-size: calc(var(--su) * 64); }
html.station.st-more .controls { display: none; }
html.station.st-more #w-summary { display: block; }
html.station.st-more .reminders { display: flex; padding: calc(var(--su) * 10) calc(var(--su) * 10) calc(var(--su) * 8) calc(var(--su) * 18); max-height: none; contain: none; }
html.station.st-more .clock-block .allday { display: none; }
html.station .r-head .pill-btn, html.station .r-check, html.station .r-del { min-height: var(--tap); min-width: var(--tap); justify-content: center; }
html.station .r-check { width: var(--tap); height: var(--tap); }
html.station .r-del { width: var(--tap); height: var(--tap); }
html.station .r-text { font-size: calc(var(--su) * 19); }
html.station .r-item { min-height: var(--tap); }
html.station .sum-chip { min-height: var(--tap); margin-top: 0; font-size: calc(var(--su) * 16); flex-wrap: nowrap; }
/* doorbell takeover: camera left, who/what + Dismiss right (not stacked like a phone) */
html.station .to-door { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: calc(var(--su) * 18); padding: calc(var(--su) * 18); overflow: hidden; }
html.station .to-cam .cv-video, html.station .to-cam .cv-img { max-height: calc(100vh - var(--su) * 70); }
html.station .to-side { gap: calc(var(--su) * 12); padding: calc(var(--su) * 6) 0; }
html.station .to-kicker { font-size: calc(var(--su) * 14); }
html.station .to-title { font-size: calc(var(--su) * 34); }
html.station .to-when, html.station .to-body { font-size: calc(var(--su) * 18); }
html.station .to-side .big-btn { min-height: calc(var(--tap) * 1.15); font-size: calc(var(--su) * 21); }
html.station .to-notice { width: min(88vw, calc(var(--su) * 760)); padding: calc(var(--su) * 26) calc(var(--su) * 28) calc(var(--su) * 22); gap: calc(var(--su) * 12); }
html.station .to-notice .big-btn { min-height: var(--tap); font-size: calc(var(--su) * 20); }
/* sheets (Lights, Leave, Auto, PIN): the phone's bottom sheet, with the station's touch size */
html.station .sheet, html.station .sheet.wide, html.station .sheet.auto-sheet { max-width: calc(var(--su) * 900); max-height: 96vh; }
html.station .x-btn { height: var(--exit); padding: 0 calc(var(--su) * 22) 0 calc(var(--su) * 16); font-size: calc(var(--su) * 20); }
html.station .sheet .big-btn[data-exit], html.station .to-notice .big-btn[data-exit] { min-height: var(--exit); }
html.station .status .st-health { min-height: var(--tap); }
html.station .camglance .gl-bar { padding: calc(var(--su) * 8) calc(var(--su) * 8) calc(var(--su) * 8) calc(var(--su) * 18); gap: calc(var(--su) * 10); }
html.station .camglance .gl-title { font-size: calc(var(--su) * 22); }
html.station .camglance .gl-sub { font-size: calc(var(--su) * 17); }
html.station .camglance .gl-x, html.station .camglance .gl-again, html.station .camglance .gl-opt, html.station .camglance .gl-cam { font-size: calc(var(--su) * 20); padding: 0 calc(var(--su) * 22); }
html.station .camglance .gl-x { min-width: calc(var(--su) * 150); }
html.station .camglance .gl-end-t { font-size: calc(var(--su) * 26); }
html.station .camglance .gl-end-s { font-size: calc(var(--su) * 16); }
html.station .to-cam .to-again { font-size: calc(var(--su) * 20); padding: 0 calc(var(--su) * 22); }
html.station .toggle { min-height: var(--tap); width: calc(var(--su) * 100); }
html.station .step { min-height: var(--tap); min-width: calc(var(--su) * 76); }
html.station .big-btn { min-height: var(--tap); }
html.station .l-row { min-height: calc(var(--tap) + 8px); }
html.station .chip, html.station .kb-key, html.station .pill-btn { min-height: var(--tap); }
html.station .pill-btn { min-width: var(--tap); justify-content: center; }
html.station .type-field { min-height: var(--exit); font-size: calc(var(--su) * 22); }
html.station .sheet .kb { gap: calc(var(--su) * 6); }
html.station .sheet .kb-row { gap: calc(var(--su) * 6); }
html.station .sheet .kb-key { font-size: calc(var(--su) * 22); }
html.station .more-btn[data-exit] { min-height: var(--exit); }
html.station .sheet .pin-pad { --k: var(--tap); }
html.station .sheet.pin-sheet { gap: calc(var(--su) * 8); }
html.station .sheet .pin-body { gap: calc(var(--su) * 10); }
html.station .atoast .at-btn { min-height: var(--tap); min-width: var(--tap); }
html.station .atoast .at-x { min-height: var(--exit); min-width: var(--exit); font-size: calc(var(--su) * 17); }


/* ---------- OFFICE STATION: DESK COMPANION (README "Office station → desk companion") ----------
   Page "Now" (#desk) by default, "Room" (#working) on the tab. Read at ~50 cm: body text 26-30 design px (≈ 4 mm),
   labels ≥ 20, numbers big; content is dropped, never shrunk, to fit. One unit: --su (1 design px at 1024x600). */
html.station { --tabs: calc(var(--su) * 88); }
html.station #st-tabs:not([hidden]) {
  display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabs); align-items: center; gap: calc(var(--su) * 12);
  padding: 0 calc(var(--su) * 16); border-top: 1px solid var(--line); background: var(--bg); z-index: 5;
}
html.station .st-tab { min-height: var(--tap); min-width: calc(var(--su) * 128); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: calc(var(--su) * 26); font-weight: 600; }
html.station .st-tab.on { background: var(--text); color: var(--bg); }
html.station .st-tab:active { background: var(--surface-2); }
html.station .st-clock { flex: 1; text-align: center; font-size: calc(var(--su) * 44); font-weight: 400; letter-spacing: -0.02em; white-space: nowrap; }
html.station .st-clock .ampm { font-size: .6em; margin-left: .2em; color: var(--text-2); }
html.station .door-pill { display: inline-flex; align-items: center; gap: calc(var(--su) * 8); height: calc(var(--su) * 56); padding: 0 calc(var(--su) * 18); border-radius: 999px; background: var(--surface); font-size: calc(var(--su) * 22); color: var(--text-2); white-space: nowrap; }
html.station .door-pill b { color: var(--text); font-weight: 600; }
html.station .door-pill small { font-size: calc(var(--su) * 20); color: var(--muted); margin-left: -.15em; }
html.station .st-sens .sn-g { display: inline-flex; align-items: center; gap: calc(var(--su) * 6); font-style: normal; }
html.station .st-sens .sn-g + .sn-g { margin-left: calc(var(--su) * 10); }
html.station .st-sens .sn-g.off { opacity: .6; }
html.station .st-sens .sn-g.live b { color: var(--green); }
html.station .st-sens b { font-weight: 600; color: var(--text); }
html.station .st-sens.paused b { color: var(--amber); }
html.station .door-pill .ic { font-size: calc(var(--su) * 26); }
html.station .door-pill.locked .ic { color: var(--green); }
html.station .door-pill.unlocked { background: var(--amber-bg); } html.station .door-pill.unlocked .ic, html.station .door-pill.unlocked b { color: var(--amber); }
html.station .st-sens { min-height: var(--tap); padding: 0 calc(var(--su) * 20); border-radius: 999px; background: var(--surface); color: var(--text-2); white-space: nowrap; font-size: calc(var(--su) * 20); font-weight: 600; display: inline-flex; align-items: center; gap: calc(var(--su) * 8); }
html.station .st-sens .ic { font-size: calc(var(--su) * 26); }
html.station .st-sens.paused { background: var(--amber-bg); color: var(--amber); }

/* pages: Now = #desk, Room = #working (no clock / meeting / to-dos there: they live on Now) */
html.st-now body[data-moment="working"] #working { display: none; }
html.st-now body[data-moment="working"] #desk { display: grid; }
html.station #desk {
  bottom: var(--tabs); padding: calc(var(--su) * 8) calc(var(--su) * 18) calc(var(--su) * 8);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); grid-template-rows: minmax(0, 1fr) var(--tap) var(--tap);
  grid-template-areas: "now todo" "jarvis jarvis" "actions actions"; gap: calc(var(--su) * 10) calc(var(--su) * 14);
}
html.st-room #working { bottom: var(--tabs); grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) calc(var(--su) * 92); grid-template-areas: "controls" "strip"; padding-top: calc(var(--su) * 16); row-gap: calc(var(--su) * 14); }
html.st-room .clock-block, html.st-room #w-meeting, html.st-room .reminders { display: none; }
/* Room: the five scenes + Lights in one row of tall tiles; the door lives in the tab bar (read-only pill) */
html.st-room .controls { display: flex; gap: calc(var(--su) * 12); min-height: 0; }
html.st-room .controls .scenes { flex: 5 1 0; min-width: 0; }
html.st-room .control-row { flex: 1 1 0; display: flex; min-width: 0; }
html.st-room .control-row .lights-btn { flex: 1; flex-direction: column; align-items: flex-start; justify-content: center; gap: calc(var(--su) * 6); padding: 0 calc(var(--su) * 18); }
html.st-room .control-row .lights-btn .ic { font-size: calc(var(--su) * 32); color: var(--text-2); }
html.st-room #w-door { display: none; }
html.st-room .ra-btn span { display: inline; font-size: calc(var(--su) * 22); }
html.station .sc-hint { position: static; max-width: none; text-align: left; line-height: 1.2; }
html.st-room .scene { font-size: calc(var(--su) * 24); gap: calc(var(--su) * 6); justify-content: flex-end; padding-bottom: calc(var(--su) * 26); }
html.st-room .control-row .lights-btn { justify-content: flex-end; padding-bottom: calc(var(--su) * 26); }
html.st-room .scene .ic { font-size: calc(var(--su) * 32); }
html.station .sc-hint { font-size: calc(var(--su) * 18); }
html.st-room .tile { min-height: 0; font-size: calc(var(--su) * 24); }
html.st-room .strip { margin: 0; padding: 0; border-top: 0; }
html.st-room .ra-btn { padding: 0 calc(var(--su) * 20); }
html.station .door-ro .d-hint { font-size: calc(var(--su) * 20); }
html.station .door-ro .d-state { font-size: calc(var(--su) * 26); }

html.station .dk-card { background: var(--surface); border-radius: var(--radius); min-width: 0; min-height: 0; position: relative; overflow: hidden; }
html.station .dk-eye { display: flex; align-items: center; gap: calc(var(--su) * 8); font-size: calc(var(--su) * 22); color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.station .dk-eye .ic { font-size: calc(var(--su) * 24); flex: none; }
html.station .dk-eye b { color: var(--text); margin-left: .25em; }
html.station .dk-now { grid-area: now; display: flex; flex-direction: column; gap: calc(var(--su) * 6); padding: calc(var(--su) * 18) calc(var(--su) * 22); }
html.station .dk-big { font-size: calc(var(--su) * 76); font-weight: 300; line-height: 1; letter-spacing: -0.035em; margin-top: calc(var(--su) * 4); white-space: nowrap; }
html.station .dk-big small { font-size: .4em; letter-spacing: 0; color: var(--text-2); font-weight: 500; }
html.station .dk-mid { font-size: calc(var(--su) * 40); font-weight: 400; line-height: 1.12; margin-top: calc(var(--su) * 6); }
html.station .dk-title { font-size: calc(var(--su) * 30); font-weight: 600; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
html.station .dk-line { font-size: calc(var(--su) * 24); color: var(--text-2); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
html.station .dk-btn { margin-top: auto; align-self: flex-start; min-height: var(--tap); padding: 0 calc(var(--su) * 28); border-radius: 999px; background: var(--surface-3); font-size: calc(var(--su) * 26); font-weight: 600; display: inline-flex; align-items: center; gap: calc(var(--su) * 10); }
html.station .dk-btn .ic { font-size: calc(var(--su) * 28); }
html.station .dk-btn:active { background: var(--line); }
html.station .dk-now.soon .dk-eye { color: var(--amber); }
html.station .dk-now.soon .dk-btn { background: var(--amber-bg); color: var(--amber); }
html.station .dk-now.oncall { background: var(--red-bg); }
html.station .dk-now.oncall .dk-eye { color: var(--red); }
html.station .dk-air { width: calc(var(--su) * 14); height: calc(var(--su) * 14); border-radius: 50%; background: var(--red); flex: none; }
html.station .dk-now.focus { background: var(--blue-bg); }
html.station .dk-now.focus .dk-eye { color: var(--blue); }
html.station .dk-now.focus .dk-big { font-size: calc(var(--su) * 96); font-variant-numeric: tabular-nums; }
html.station .dk-now.focus .dk-line { -webkit-line-clamp: 1; }
html.station .dk-jarrow { color: var(--muted); }
html.station .dk-done { position: absolute; top: calc(var(--su) * 14); right: calc(var(--su) * 14); display: inline-flex; align-items: center; gap: .3em; font-size: calc(var(--su) * 20); font-weight: 600; color: var(--green); background: var(--green-bg); border-radius: 999px; padding: calc(var(--su) * 6) calc(var(--su) * 14); }

html.station .dk-todo { grid-area: todo; display: flex; flex-direction: column; padding: calc(var(--su) * 2) calc(var(--su) * 12) calc(var(--su) * 2) calc(var(--su) * 20); }
html.station .dk-th .dk-eye { font-size: calc(var(--su) * 24); }
html.station .dk-th { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); flex: none; }
html.station .dk-all { min-height: calc(var(--tap) - var(--su) * 8); min-width: var(--tap); padding: 0 calc(var(--su) * 18); border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: calc(var(--su) * 22); font-weight: 600; display: inline-flex; align-items: center; gap: calc(var(--su) * 6); }
html.station .dk-all { min-height: var(--tap); }
html.station .dk-tl { list-style: none; display: flex; flex-direction: column; min-height: 0; }
html.station .dk-ti { display: flex; align-items: center; gap: calc(var(--su) * 6); min-height: calc(var(--tap) + var(--su) * 4); border-top: 1px solid var(--line); }
html.station .dk-tick { width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; margin-left: calc(var(--su) * -14); }
html.station .dk-tick .ic { width: calc(var(--su) * 44); height: calc(var(--su) * 44); padding: calc(var(--su) * 8); border: 2.5px solid var(--muted); border-radius: 50%; color: transparent; }
html.station .dk-tick:active .ic { color: var(--green); border-color: var(--green); }
html.station .dk-ti.due .dk-tick .ic { border-color: var(--amber); }
html.station .dk-tt { font-size: calc(var(--su) * 27); line-height: 1.2; min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-right: calc(var(--su) * 10); }
html.station .dk-tempty { font-size: calc(var(--su) * 26); color: var(--text-2); padding: calc(var(--su) * 16) 0; border-top: 1px solid var(--line); }

html.station .dk-jrow { grid-area: jarvis; display: flex; gap: calc(var(--su) * 12); min-width: 0; }
html.station .dk-nchip { flex: none; min-height: var(--tap); padding: 0 calc(var(--su) * 20); border-radius: var(--radius); background: var(--blue-bg); color: var(--blue); font-size: calc(var(--su) * 22); font-weight: 600; display: inline-flex; align-items: center; gap: calc(var(--su) * 8); }
html.station .dk-nchip .ic { font-size: calc(var(--su) * 24); }
html.station .dk-jarvis { flex: 1; display: flex; align-items: center; gap: calc(var(--su) * 14); padding: 0 calc(var(--su) * 22); border-radius: var(--radius); background: var(--surface); font-size: calc(var(--su) * 26); text-align: left; min-width: 0; overflow: hidden; white-space: nowrap; }
html.station .dk-jarvis > * { flex: none; }
html.station .dk-jarvis .ic { font-size: calc(var(--su) * 28); color: var(--muted); }
html.station .dk-jarvis.hint { color: var(--muted); }
html.station .dk-jhint, html.station .dk-jreply { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html.station .dk-jheard { color: var(--text-2); max-width: 34%; overflow: hidden; text-overflow: ellipsis; }
html.station .dk-jint, html.station .dk-jwho { font-size: calc(var(--su) * 20); font-weight: 600; color: var(--blue); background: var(--blue-bg); border-radius: 999px; padding: calc(var(--su) * 4) calc(var(--su) * 12); }
html.station .dk-jarvis.warn .dk-jreply { color: var(--amber); }
html.station .dk-jarvis.busy { color: var(--blue); font-weight: 600; }
html.station .dk-jarvis .dk-junsure { font-size: calc(var(--su) * 18); }

html.station .dk-actions { grid-area: actions; display: flex; gap: calc(var(--su) * 12); min-width: 0; }
html.station .dk-act { flex: 1 1 0; min-width: 0; min-height: var(--tap); padding: 0 calc(var(--su) * 16); border-radius: var(--radius); background: var(--surface-2); font-size: calc(var(--su) * 26); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--su) * 10); white-space: nowrap; }
html.station .dk-act .ic { font-size: calc(var(--su) * 30); color: var(--text-2); flex: none; }
html.station .dk-act span { overflow: hidden; text-overflow: ellipsis; }
html.station .dk-act:active { background: var(--line); }
html.station .dk-cap { flex: 1.25 1 0; background: var(--amber-bg); color: var(--amber); }
html.station .dk-cap .ic { color: var(--amber); }
html.station .dk-f { flex: .5 1 0; padding: 0 calc(var(--su) * 8); flex-direction: column; gap: 0; line-height: 1; }
html.station .dk-f small { font-size: calc(var(--su) * 18); color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
html.station .dk-f b { font-size: calc(var(--su) * 34); font-weight: 600; }
html.station .dk-f i { font-style: normal; font-size: .55em; color: var(--text-2); }
/* sheets opened from Now: the station's sizes */
html.station .sh-capture h2, html.station .sh-sensors h2, html.station .sh-jarvis h2, html.station .sh-todos h2, html.station .sh-toys h2 { font-size: calc(var(--su) * 26); }
html.station .sh-capture .big-btn, html.station .sh-sensors .big-btn { font-size: calc(var(--su) * 22); padding: 0 calc(var(--su) * 28); }
html.station .sh-todos .r-list { max-height: none; }
html.station .sh-todos .r-older { min-height: var(--tap); display: inline-flex; align-items: center; }
html.station .sh-todos .r-text { font-size: calc(var(--su) * 24); }
html.station .cap-text { font-size: calc(var(--su) * 40); }
html.station .cap-listen { font-size: calc(var(--su) * 32); }
html.station .cap-sub, html.station .sn-row, html.station .sn-note { font-size: calc(var(--su) * 22); }
html.station .jv .jv-k { font-size: calc(var(--su) * 18); }
html.station .jv .jv-v { font-size: calc(var(--su) * 28); }
html.station .jv .jv-reply { font-size: calc(var(--su) * 26); }
html.station .toy-pick b { font-size: calc(var(--su) * 24); }
html.station .toy-pick small { font-size: calc(var(--su) * 18); }
html.station .toy-fb { font-size: calc(var(--su) * 20); padding: 0 calc(var(--su) * 18); }

/* calm pictures (public/calm.js): full bleed, dimmer than the wall frame (50 cm away), slow crossfade, no motion */
.stcalm { position: fixed; inset: 0; z-index: 40; background: #000; overflow: hidden; }
.stcalm-img { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; filter: brightness(.72) saturate(.9); }
.stcalm-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 62%, rgba(0,0,0,.55) 100%); }
.stcalm-top { position: absolute; left: calc(var(--su, 1px) * 28); top: calc(var(--su, 1px) * 22); color: rgba(255,255,255,.92); text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.stcalm-clock { font-size: calc(var(--su, 1px) * 64); font-weight: 300; letter-spacing: -0.03em; line-height: 1; }
.stcalm-clock .ampm { font-size: .4em; margin-left: .2em; opacity: .8; }
.stcalm-next { font-size: calc(var(--su, 1px) * 24); margin-top: calc(var(--su, 1px) * 8); opacity: .85; }
.stcalm-bottom { position: absolute; left: calc(var(--su, 1px) * 28); right: calc(var(--su, 1px) * 28); bottom: calc(var(--su, 1px) * 20); display: flex; align-items: flex-end; gap: calc(var(--su, 1px) * 24); color: rgba(255,255,255,.85); text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.stcalm-jarvis { flex: 1; min-width: 0; font-size: calc(var(--su, 1px) * 22); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stcalm-cap { flex: none; font-size: calc(var(--su, 1px) * 18); opacity: .6; }
/* in the tab bar over the clock (nothing to press there), clear of Now/Room */
.stcalm-hide { position: fixed; z-index: 30; left: calc(var(--su, 1px) * 316); bottom: calc((var(--tabs, 92px) - var(--tap)) / 2); min-height: var(--tap); padding: 0 calc(var(--su, 1px) * 22); border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: calc(var(--su, 1px) * 22); font-weight: 600; display: inline-flex; align-items: center; gap: .4em; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
html.station .sh-gallery h2 { font-size: calc(var(--su) * 26); }
html.station .sh-gallery .ab-rule { gap: calc(var(--su) * 12); }
html.station .sh-gallery .ab-t b { font-size: calc(var(--su) * 22); }
html.station .sh-gallery .ab-t small { font-size: calc(var(--su) * 18); }
html.station .sh-gallery .steps { display: flex; gap: calc(var(--su) * 8); }
html.station .sh-gallery .step { font-size: calc(var(--su) * 20); min-width: calc(var(--su) * 88); }

/* ordinary notices (public/app.js renderBrief): a brief banner at the top, then a chip; never a full-screen takeover */
.nbrief { position: fixed; z-index: 35; top: calc(var(--u) * 2); left: 50%; transform: translateX(-50%); width: min(92vw, calc(var(--u) * 110)); display: flex; align-items: center; gap: calc(var(--u) * 2); padding: calc(var(--u) * 1.4) calc(var(--u) * 1.4) calc(var(--u) * 1.4) calc(var(--u) * 2.6); border-radius: calc(var(--radius) * 1.2); background: var(--surface-3); box-shadow: 0 10px 40px rgba(0,0,0,.55); border-left: 4px solid var(--blue); }
.nbrief > .ic { font-size: calc(var(--u) * 4); color: var(--blue); flex: none; }
.nbrief .nb-t { flex: 1; min-width: 0; text-align: left; }
.nbrief .nb-t b { display: block; font-size: calc(var(--u) * 3.2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbrief .nb-t small { display: block; font-size: calc(var(--u) * 2.3); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .2em; }
.nbrief .nb-x { flex: none; min-height: var(--tap); padding: 0 calc(var(--u) * 2.4); border-radius: 999px; background: var(--surface-2); font-size: calc(var(--u) * 2.6); font-weight: 600; }
.st-notes { color: var(--blue); }
.nl-row { display: flex; align-items: center; gap: calc(var(--u) * 2); padding: calc(var(--u) * 1.4) 0; border-bottom: 1px solid var(--line); }
.nl-row .nl-t { flex: 1; min-width: 0; }
.nl-row .nl-t b { display: block; font-size: calc(var(--u) * 2.8); }
.nl-row .nl-t small { display: block; font-size: calc(var(--u) * 2.2); color: var(--text-2); margin-top: .2em; }
html.station .nbrief { top: calc(var(--su) * 10); width: calc(100vw - var(--su) * 36); padding: calc(var(--su) * 8) calc(var(--su) * 8) calc(var(--su) * 8) calc(var(--su) * 20); gap: calc(var(--su) * 14); }
html.station .nbrief > .ic { font-size: calc(var(--su) * 30); }
html.station .nbrief .nb-t b { font-size: calc(var(--su) * 26); }
html.station .nbrief .nb-t small { font-size: calc(var(--su) * 20); }
html.station .nbrief .nb-x { font-size: calc(var(--su) * 22); padding: 0 calc(var(--su) * 24); min-height: var(--exit); }
html.station .nl-row .nl-t b { font-size: calc(var(--su) * 24); }
html.station .nl-row .nl-t small { font-size: calc(var(--su) * 18); }
html.station .sh-notices h2 { font-size: calc(var(--su) * 26); }
.status .st-notes { min-height: var(--tap); display: inline-flex; align-items: center; gap: .35em; }
html.station .sh-todos .r-head .eyebrow { visibility: hidden; }
html.station .sh-todos .r-head .pill-btn { font-size: calc(var(--su) * 20); padding: 0 calc(var(--su) * 22); }
html.station .sh-todos .w-meta, html.station .sh-todos .r-meta { font-size: calc(var(--su) * 18); }
html.station .sh-todos .r-foot { font-size: calc(var(--su) * 18); }

/* ---------------------------------------------------------------- Jarvis agent (README "Jarvis agent"): live line, card,
   Activity and Memory sheets. Wall sizes in --u, station overrides in --su (text ≥ 20 design px, targets ≥ --tap). */
.ja-trace, .ja-did { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 1); margin-top: calc(var(--u) * 1); }
.ja-trace span { font-size: calc(var(--u) * 2.2); color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: calc(var(--u) * .4) calc(var(--u) * 1.4); }
.ja-did span { font-size: calc(var(--u) * 2.4); color: var(--green, #2e7d32); display: inline-flex; align-items: center; gap: .4em; }
.ja-card { font-size: calc(var(--u) * 3); line-height: 1.35; }
.ja-card p { margin: 0 0 .6em; }
.ja-card ul { margin: 0 0 .6em 1.1em; padding: 0; }
.ja-card li { margin: .25em 0; }
.ja-list .ja-act { padding: calc(var(--u) * 1.2) 0; border-bottom: 1px solid var(--line); }
.ja-at b { display: block; font-size: calc(var(--u) * 2.8); font-weight: 600; }
.ja-at small { display: block; font-size: calc(var(--u) * 2.2); color: var(--muted); margin-top: .2em; }
.ja-didl { font-size: calc(var(--u) * 2.6); color: var(--text-2); margin-top: .3em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ja-arow { display: flex; align-items: center; gap: calc(var(--u) * 1.6); padding: calc(var(--u) * .8) 0; font-size: calc(var(--u) * 2.6); }
.ja-arow > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ja-arow.ep > span { color: var(--text-2); }
html.station .dk-jarvis .dk-jstep { font-style: normal; color: var(--muted); font-weight: 500; }
html.station .dk-jarvis .dk-jstop { flex: none; display: inline-flex; align-items: center; gap: calc(var(--su) * 6); font-size: calc(var(--su) * 22); font-weight: 600; color: var(--text); background: var(--surface-2); border-radius: 999px; padding: calc(var(--su) * 6) calc(var(--su) * 16); }
html.station .dk-jarvis.agent .dk-jreply { white-space: nowrap; }
html.station .ja-trace span { font-size: calc(var(--su) * 20); padding: calc(var(--su) * 4) calc(var(--su) * 12); }
html.station .ja-did span { font-size: calc(var(--su) * 22); }
html.station .ja-card { font-size: calc(var(--su) * 28); }
html.station .ja-at b { font-size: calc(var(--su) * 26); }
html.station .ja-at small { font-size: calc(var(--su) * 20); }
html.station .ja-didl { font-size: calc(var(--su) * 24); }
html.station .ja-arow { font-size: calc(var(--su) * 24); gap: calc(var(--su) * 14); }
html.station .sh-jcard .sheet-actions .hl-note { font-size: calc(var(--su) * 22); }
html.station .sh-jcard h2, html.station .sh-jactivity h2, html.station .sh-jmemory h2 { font-size: calc(var(--su) * 26); }
html.station .sh-jarvis .big-btn, html.station .sh-jcard .big-btn { font-size: calc(var(--su) * 22); padding: 0 calc(var(--su) * 28); }
html.station .ja-list .pill-btn, html.station .sh-jarvis .ab-t b { font-size: calc(var(--su) * 22); }
html.station .sh-jarvis .ab-t small { font-size: calc(var(--su) * 20); }
html.station .ja-list .lv-sec { font-size: calc(var(--su) * 20); }

/* Station: toasts (Auto, generic) sit at the TOP, like the notice banner — at the bottom they covered the Now/Room bar
   and the action row (owner, 2026-11-15). */
html.station .toast, html.station .atoast { bottom: auto; top: calc(var(--su) * 10); max-width: calc(100vw - var(--su) * 36); }

/* Jarvis Memory sheet (README "Jarvis agent → Memory"): Me / Household tabs, search, Edit / Forget; proposals Yes / No. */
.mem-bar { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 1); padding: 0 0 calc(var(--u) * 1); }
.mem-bar .mem-q { max-width: 40%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ja-arow.mem > span b { font-weight: 650; }
.mem-k { font-style: normal; flex: none; font-size: calc(var(--u) * 2); color: var(--amber); background: var(--amber-bg); border-radius: 999px; padding: calc(var(--u) * .3) calc(var(--u) * 1.2); }
.mem-sum { font-size: calc(var(--u) * 2.5); color: var(--text-2); margin: calc(var(--u) * .6) 0; line-height: 1.35; }
.ab-rule.prop .big-btn { flex: none; }
html.station .mem-bar { padding: 0 0 calc(var(--su) * 8); gap: calc(var(--su) * 10); }
html.station .mem-k { font-size: calc(var(--su) * 20); padding: calc(var(--su) * 3) calc(var(--su) * 10); }
html.station .mem-sum { font-size: calc(var(--su) * 22); }

/* Jarvis on the phone (README "Phone → Ask Jarvis"): remote clients only (body.remote). Phone sizes (rem), never the wall's. */
.ask-launchers { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; }
.ask-fab { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-width: 52px;
  min-height: 52px; padding: 0 1.2rem; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font-size: 1.05rem; font-weight: 650;
  box-shadow: 0 6px 24px rgba(0,0,0,.45); text-decoration: none; touch-action: manipulation; }
.ask-fab:active { filter: brightness(1.2); }
.ask-fab .ic { width: 1.3rem; height: 1.3rem; }
.sheet.ask-sheet { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); color-scheme: dark; }
.ask-body { flex: 1; min-height: 8rem; overflow-y: auto; }
.ask-item { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.ask-q { font-size: 1rem; color: var(--text-2); }
.ask-a { font-size: 1.15rem; line-height: 1.4; margin-top: .35rem; white-space: pre-wrap; }
.ask-a.warn { color: var(--amber); }
.ask-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .5rem; }
.ask-row > span { flex: 1 1 10rem; min-width: 0; }
.ask-row.act > span { color: var(--green, #2e7d32); display: inline-flex; gap: .4rem; align-items: center; }
.ask-row .pill-btn, .ask-foot .pill-btn { min-height: 44px; font-size: .95rem; padding: 0 .9rem; }
.ask-card { margin-top: .6rem; padding: .7rem .8rem; border-radius: 12px; background: var(--surface-2); font-size: 1rem; line-height: 1.35; }
.ask-card.appr { border: 1px solid var(--amber); }
.ask-card b { display: block; margin-bottom: .3rem; }
.ask-card p { margin: 0 0 .5em; }
.ask-note { color: var(--amber); display: flex; gap: .4rem; align-items: center; font-size: .95rem; }
.ask-bar { display: flex; gap: .5rem; align-items: center; padding-top: .6rem; }
.ask-input { flex: 1; min-width: 0; min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 1.05rem; padding: 0 .9rem; }
.ask-bar .pill-btn { min-height: 52px; font-size: 1rem; }
.ask-mic { min-height: 52px; min-width: 64px; border-radius: 999px; background: var(--surface-3); color: var(--text); display: inline-flex; align-items: center;
  justify-content: center; gap: .35rem; padding: 0 .8rem; font-size: .95rem; font-weight: 600; touch-action: none; user-select: none; -webkit-user-select: none; }
.ask-mic.rec { background: var(--amber-bg); color: var(--amber); }
.ask-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding-top: .5rem; }

.ask-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .7rem; font-size: .9rem; color: var(--text-2); }
.ask-account .pill-btn { min-height: 52px; padding: 0 .85rem; font-size: .9rem; }
body.member #working, body.member #desk, body.member #st-tabs { display: none; }

body.member #sheet { background: var(--bg); }
:where(.pin-page, .ask-sheet) :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.ask-input::placeholder { color: var(--muted); opacity: 1; }

@media (prefers-color-scheme: light) {
  .pin-page,
  body.member,
  body.remote .ask-fab,
  body.remote .ask-sheet {
    color-scheme: light;
    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-2: #f1f4f7;
    --surface-3: #e4eaf0;
    --line: #8290a2;
    --text: #182331;
    --text-2: #465364;
    --muted: #566376;
    --amber: #734408;
    --amber-bg: #f7e8d0;
    --green: #1d6341;
    --green-bg: #e0f0e7;
    --red: #a52f24;
    --red-bg: #fae7e4;
    --blue: #245b91;
    --blue-bg: #e3eef9;
  }
  body.remote .ask-sheet { color: var(--text); }
  body.remote .ask-fab { box-shadow: 0 4px 14px rgba(28, 42, 62, .24); }
}
