/* splatify. Taglet's room (warm inks, Splash lime accent, Geist + Geist Mono, glass only on the floating
   control layer) with Any Day Now's app shape (floating dock, sheets that grow from their button, the pass header,
   the lamp-amber "working" colour). Semantic tokens only below the :root block. */

@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2-variations"); font-weight: 100 900; font-display: swap; } /* ds-allow-hardcode: @font-face names the family */
@font-face { font-family: "Geist Mono"; src: url("/fonts/geistmono.woff2") format("woff2-variations"); font-weight: 100 900; font-display: swap; } /* ds-allow-hardcode: @font-face names the family */
:root {
  color-scheme: dark;
  --ink-0: #0b0a09; --ink-1: #141210; --ink-2: #1c1916; --ink-3: #27231f;
  --line: rgba(243, 236, 226, .09); --line-strong: rgba(243, 236, 226, .16);
  --paper: #f3ece2; --paper-2: #bdb4a7; --paper-3: #8e867b;
  --accent: #c6f24e; --accent-ink: #1e2a00; --accent-soft: rgba(198, 242, 78, .14);
  --lamp: #f5a524; --lamp-ink: #2a1a00; --lamp-soft: rgba(245, 165, 36, .14);   /* Any Day Now's amber: work in progress */
  --signal: #ff7558; --signal-soft: rgba(255, 117, 88, .14);                     /* problems and destructive actions only */

  --font-display: "Geist", ui-sans-serif, system-ui, sans-serif; /* one family since 2026-11-30: Geist for everything, Geist Mono for times and counts */
  --font-text: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --t-xs: 12px; --t-sm: 14px; --t-md: 16px; --t-lg: 20px; --t-xl: 26px; --t-2xl: 34px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-art: 5px; --r-field: 9px; --r-row: 10px; --r-card: 22px; --r-sheet: 26px; --r-full: 999px;
  --ease-out: cubic-bezier(.23, 1, .32, 1); --dur-fast: 150ms; --dur: 200ms;
  --control: 44px; --hair: 1.5px; --dur-pulse: 1.4s;
  /* Sizes used by components */
  --s0: 2px; --s1h: 6px; --s3h: 14px; --r-mark: 7px; --icon: 22px; --icon-sm: 18px; --step-h: 40px;
  --shutter: 76px; --coverage-ring: 84px; --toggle-w: 46px; --toggle-h: 28px; --toggle-knob: 22px; --shutter-dot: 58px; --shutter-stop: 28px; --thumb: 52px; --thumb-lg: 64px; --control-lg: 54px; --bar-h: 56px; --row-h: 72px; --film-min: 80px;
  --aura-blur: 60px; --toast-top: 76px; --dock-clear: 120px; --dock-w: 420px; --sheet-w: 520px; --page-w: 640px; --dash-w: 1180px; --rail-w: 380px; --tile-min: 210px;

  --glass-fill: linear-gradient(180deg, rgba(48, 43, 38, .62), rgba(26, 23, 20, .58));
  --glass-blur: blur(22px) saturate(1.7) brightness(1.05);
  --glass-edge: inset 0 1px 0 rgba(255, 250, 240, .16), inset 0 -1px 0 rgba(0, 0, 0, .35), inset 0 0 0 .5px rgba(255, 250, 240, .12);
  --glass-drop: 0 10px 30px -8px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .3);
  --scrim: rgba(0, 0, 0, .55);
  --safe-t: env(safe-area-inset-top); --safe-b: env(safe-area-inset-bottom);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ink-0); }
body {
  margin: 0; min-height: 100dvh; background: var(--ink-0); color: var(--paper);
  font: 400 var(--t-md)/1.5 var(--font-text); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; line-height: 1.08; letter-spacing: -.03em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); }
button, input { font: inherit; color: inherit; }
button, a, label { touch-action: manipulation; }
img, svg { display: block; }
svg { width: var(--icon); height: var(--icon); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus { outline: none; }
:focus-visible { outline: var(--s0) solid var(--accent); outline-offset: var(--s0); border-radius: var(--s1h); }
::selection { background: var(--accent); color: var(--accent-ink); }
.muted { color: var(--paper-2); }
.mono { font-family: var(--font-mono); font-size: .92em; }

/* The room light: the current splat's first frame, blurred behind the glass (Taglet's album-art aura). */
.aura { position: fixed; inset: 0 0 auto; height: 70vh; z-index: -1; pointer-events: none; overflow: hidden; }
.aura::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 90% at 50% -10%, var(--accent-soft), transparent 70%), linear-gradient(transparent 40%, var(--ink-0)); }
.aura img { width: 100%; height: 100%; object-fit: cover; filter: blur(var(--aura-blur)) saturate(1.4); opacity: 0; transform: scale(1.3); transition: opacity .6s var(--ease-out); }
.aura img.on { opacity: .45; }

/* ── Glass control layer ── */
.glass { background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), var(--glass-drop); }
/* While this phone makes a splat, the GPU is the bottleneck: drop the blurs (re-drawn on every scroll and update) for a plain fill. */
.making .aura { display: none; }
.making .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--ink-1); }
.making dialog::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
.bar {
  position: sticky; top: calc(var(--safe-t) + var(--s2)); z-index: 20; margin: var(--s2) var(--s3) 0; margin-top: calc(var(--safe-t) + var(--s2));
  display: flex; align-items: center; gap: var(--s2); padding: var(--s1h) var(--s1h) var(--s1h) var(--s3h); border-radius: var(--r-full); min-height: var(--bar-h);
}
.brand { display: flex; align-items: center; gap: var(--s2); color: var(--paper); text-decoration: none; font: 700 var(--t-lg)/1 var(--font-display); letter-spacing: -.03em; margin-right: auto; min-height: var(--control); }
.brand img { border-radius: var(--r-mark); }
body[data-view="splat"] .brand span { display: none; }
.icon-btn { width: var(--control); height: var(--control); display: grid; place-items: center; border: 0; border-radius: var(--r-full); background: transparent; color: var(--paper); cursor: pointer; }
.icon-btn:active { background: var(--line); }
.account-btn { display: flex; align-items: center; gap: var(--s1h); min-height: var(--control); padding: 0 var(--s3); border: 0; border-radius: var(--r-full); background: var(--accent); color: var(--accent-ink); font: 700 var(--t-sm)/1 var(--font-text); cursor: pointer; white-space: nowrap; }
.account-btn svg { width: var(--icon-sm); height: var(--icon-sm); }
.account-btn.on svg { width: var(--icon); height: var(--icon); }
.account-btn.on { background: transparent; color: var(--accent); width: var(--control); padding: 0; justify-content: center; }
.account-btn.on span { display: none; }
@media (max-width: 479px) { /* ds-allow-hardcode: media queries cannot read vars */ .account-btn { width: var(--control); padding: 0; justify-content: center; } .account-btn span { display: none; } }
.sync-card { margin-bottom: var(--s3); border-color: var(--accent-soft); }
.mac-note.sync-card .mac-icon { color: var(--accent); }
.sync-card-actions { display: flex; gap: var(--s2); margin-top: var(--s3); }
.perks { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; gap: var(--s3); }
.perks li { display: flex; gap: var(--s3); align-items: center; color: var(--paper-2); }
.perks svg { color: var(--accent); }
.acct-optional { margin-top: var(--s3); text-align: center; }
.acct-or { text-align: center; margin: var(--s3) 0; }
#acct-err:empty { display: none; }
#acct-out > p.muted, #acct-in > p, #acct-sent { margin-bottom: var(--s3); }
.mac-pill {
  display: flex; align-items: center; gap: var(--s2); min-height: var(--control); padding: 0 var(--s3h); border: 0; border-radius: var(--r-full);
  background: var(--ink-2); color: var(--paper-2); font: 600 var(--t-sm)/1 var(--font-text); cursor: pointer;
}
.dot { width: var(--s2); height: var(--s2); border-radius: 50%; background: var(--paper-3); flex: none; }
[data-mac="on"] .dot { background: var(--accent); box-shadow: 0 0 0 var(--s1) var(--accent-soft); }
[data-mac="busy"] .dot { background: var(--lamp); box-shadow: 0 0 0 var(--s1) var(--lamp-soft); }
[data-mac="off"] .dot { background: var(--paper-3); }

.dock { position: fixed; left: 50%; bottom: calc(var(--safe-b) + var(--s4)); transform: translateX(-50%); z-index: 20; padding: var(--s1h); border-radius: var(--r-full); width: min(var(--dock-w), calc(100% - var(--s6))); }
.dock .btn { width: 100%; }
body[data-view="splat"] .dock, body[data-view="model"] .dock { display: none; }

/* ── Buttons and fields ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--control); padding: 0 var(--s5);
  border: 0; border-radius: var(--r-full); background: var(--ink-3); color: var(--paper); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn.big { min-height: var(--control-lg); font-size: var(--t-md); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--signal-soft); color: var(--signal); }
.btn.ghost { background: transparent; color: var(--paper-2); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:has(input:focus-visible) { outline: var(--s0) solid var(--accent); outline-offset: var(--s0); }
.field { display: grid; gap: var(--s1h); }
.field span { font: 600 var(--t-sm)/1 var(--font-text); color: var(--paper-2); }
.field input { min-height: var(--control); padding: 0 var(--s3h); border-radius: var(--r-field); border: 1px solid var(--line-strong); background: var(--ink-1); font-size: var(--t-md); caret-color: var(--accent); }
.field input:focus-visible { outline: var(--s0) solid var(--accent); outline-offset: 1px; }
.actions { display: grid; gap: var(--s2); align-content: start; }
.actions.row { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); } /* a hidden button gives its column back */

/* ── Pages ── */
main { padding: var(--s5) var(--s4) calc(var(--dock-clear) + var(--safe-b)); max-width: var(--page-w); margin: 0 auto; }
.page { display: grid; gap: var(--s5); }
.hero { display: grid; gap: var(--s3); padding-top: var(--s4); }
.hero h1 { font-size: var(--t-2xl); }
.lede { color: var(--paper-2); font-size: var(--t-md); }
body.has-splats .hero h1 { font-size: var(--t-xl); }
body.has-splats .how { display: none; }

.mac-note { display: flex; gap: var(--s3); padding: var(--s4); border-radius: var(--r-card); background: var(--ink-1); border: 1px solid var(--line); }
.mac-note .mac-icon { color: var(--paper-2); margin-top: var(--s0); }
.mac-note h2 { font-size: var(--t-md); font-family: var(--font-text); font-weight: 700; letter-spacing: 0; margin-bottom: var(--s1); }
.mac-note p { color: var(--paper-2); font-size: var(--t-sm); }
[data-mac="on"] .mac-note .mac-icon { color: var(--accent); }
[data-mac="busy"] .mac-note .mac-icon { color: var(--lamp); }

.section-title { font-size: var(--t-lg); }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.day summary { display: flex; align-items: center; gap: var(--s2); min-height: var(--control); padding: 0 var(--s1); cursor: pointer; list-style: none; font: 650 var(--t-md)/1.2 var(--font-text); }
.day summary::-webkit-details-marker { display: none; }
.day-count { font: 500 var(--t-xs)/1 var(--font-mono); color: var(--paper-3); }
.day summary .chev { margin-left: auto; transform: rotate(90deg); transition: transform var(--dur) var(--ease-out); }
.day details:not([open]) summary .chev { transform: none; }
.day-rows { list-style: none; margin: 0 0 var(--s2); padding: 0; display: grid; gap: var(--s0); border-radius: var(--r-card); overflow: hidden; }
.row-link { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); min-height: var(--row-h); background: var(--ink-1); color: var(--paper); text-decoration: none; }
.row-link:active { background: var(--ink-2); }
.thumb { width: var(--thumb); height: var(--thumb); border-radius: var(--r-art); background: var(--ink-3); object-fit: cover; flex: none; }
.row-text { min-width: 0; flex: 1; display: grid; gap: var(--s0); }
.row-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { font: 500 var(--t-xs)/1.3 var(--font-mono); color: var(--paper-3); display: flex; align-items: center; gap: var(--s1h); }
.status.working { color: var(--lamp); }
.status.ready { color: var(--accent); }
.status.failed { color: var(--signal); }
.status.working::before { content: ""; width: var(--s1h); height: var(--s1h); border-radius: 50%; background: currentColor; animation: pulse var(--dur-pulse) ease-in-out infinite; }
.chev { color: var(--paper-3); width: var(--icon-sm); height: var(--icon-sm); }

.how { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.how li { display: flex; gap: var(--s3); align-items: flex-start; }
.how .n { width: var(--s6); height: var(--s6); border-radius: 50%; display: grid; place-items: center; background: var(--ink-2); font: 600 var(--t-sm)/1 var(--font-mono); color: var(--accent); flex: none; }
.how p { color: var(--paper-2); font-size: var(--t-sm); }

/* ── Splat page: the pass ── */
.pass { position: relative; display: grid; gap: var(--s4); padding: var(--s5); border-radius: var(--r-card); background: var(--ink-1); border: 1px solid var(--line); overflow: hidden; }
.pass-head { display: flex; gap: var(--s4); align-items: center; }
.pass-head .thumb { width: var(--thumb-lg); height: var(--thumb-lg); }
.pass h1 { font-size: var(--t-xl); word-break: break-word; }
.pass .meta { font: 500 var(--t-xs)/1.4 var(--font-mono); color: var(--paper-3); margin-top: var(--s1); }
.eta { font: 650 var(--t-2xl)/1 var(--font-display); letter-spacing: -.03em; }
.eta small { display: block; font: 500 var(--t-sm)/1.4 var(--font-text); color: var(--paper-2); letter-spacing: 0; margin-top: var(--s2); }
.meter { height: var(--s2); border-radius: var(--r-full); background: var(--ink-3); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--lamp); transition: width .6s var(--ease-out); }
.meter.done i { background: var(--accent); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.steps li { display: flex; gap: var(--s3); align-items: center; min-height: var(--step-h); color: var(--paper-3); font-size: var(--t-sm); }
.steps .mark { width: var(--icon); height: var(--icon); border-radius: 50%; border: var(--hair) solid var(--ink-3); display: grid; place-items: center; flex: none; }
.steps .mark svg { width: var(--s3h); height: var(--s3h); stroke-width: 2.6; }
.steps li.done { color: var(--paper-2); }
.steps li.done .mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps li.now { color: var(--paper); font-weight: 600; }
.steps li.now .mark { border-color: var(--lamp); background: var(--lamp-soft); }
.steps li.now .mark::after { content: ""; width: var(--s2); height: var(--s2); border-radius: 50%; background: var(--lamp); animation: pulse var(--dur-pulse) ease-in-out infinite; }
.callout { padding: var(--s3) var(--s4); border-radius: var(--r-row); background: var(--ink-2); color: var(--paper-2); font-size: var(--t-sm); }
.callout.bad { background: var(--signal-soft); color: var(--paper); }
.callout strong { color: var(--paper); }

.stage { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-card); overflow: hidden; background: var(--ink-1); border: 1px solid var(--line); touch-action: none; }
.stage canvas { width: 100%; height: 100%; display: block; }
.stage .hint { position: absolute; left: 50%; bottom: var(--s3); transform: translateX(-50%); padding: var(--s2) var(--s3h); border-radius: var(--r-full); font-size: var(--t-xs); color: var(--paper-2); white-space: nowrap; pointer-events: none; transition: opacity .4s; }
.stage .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--paper-2); font-size: var(--t-sm); }
.stage .fs-btn { position: absolute; top: var(--s3); right: var(--s3); }
.stage.full { position: fixed; inset: 0; z-index: 50; aspect-ratio: auto; border-radius: 0; border: 0; background: var(--ink-0); }
.stage.full .fs-btn { top: calc(var(--safe-t) + var(--s3)); }
.stage .live { position: absolute; inset: 0; }
.stage .live canvas { object-fit: contain; }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.tools .wide { grid-column: 1 / -1; }
.models { display: grid; gap: var(--s2); margin-top: var(--s4); }
.models-title { margin: 0; font: 600 var(--t-sm)/1.4 var(--font-text); color: var(--paper-2); }
.models-title span { display: block; font-weight: 400; color: var(--paper-3); }
.models-scope { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.models-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.models-row .btn { padding: 0; font-variant-numeric: tabular-nums; }
.models-row .btn:disabled { opacity: .6; cursor: progress; }

/* ── Sheets (dialogs) ── */
dialog.sheet {
  width: min(var(--sheet-w), 100%); max-width: 100%; max-height: calc(100dvh - var(--safe-t) - var(--s5)); margin: auto auto 0; padding: var(--s5) var(--s5) calc(var(--s5) + var(--safe-b));
  border: 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--ink-1); color: var(--paper); box-shadow: var(--glass-drop), var(--glass-edge);
  overflow-y: auto; overscroll-behavior: contain;
}
/* A modal <dialog> is pinned top and bottom, so without height: fit-content (Safari leaves it out) it stretches to its max-height, and a grid then stretches its rows to fill it (the delete sheet's buttons
   grew to fill the screen). Height follows the content and rows stay at the top. */
dialog.sheet { height: fit-content; min-height: 0; inset: auto 0 0; } /* phones: anchored to the bottom edge only, so it can never stretch */
dialog.sheet.small { display: grid; gap: var(--s3); align-content: start; grid-auto-rows: max-content; }
.sheet-body { align-content: start; }
dialog.sheet:not([open]) { display: none; }
@media (min-width: 768px) { /* ds-allow-hardcode: media queries cannot read vars */ dialog.sheet { inset: 0; margin: auto; border-radius: var(--r-sheet); } }
dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(var(--s1h)); backdrop-filter: blur(var(--s1h)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin: calc(var(--s2) * -1) calc(var(--s2) * -1) var(--s3) 0; }
.sheet-head h2 { font-size: var(--t-xl); }
.sheet-body { display: grid; gap: var(--s5); }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.tips li { display: flex; gap: var(--s3); }
.tips svg { color: var(--accent); margin-top: 1px; }
.tips p { color: var(--paper-2); font-size: var(--t-sm); }
.fine { color: var(--paper-3); font-size: var(--t-xs); line-height: 1.5; }
.error { color: var(--signal); font-size: var(--t-sm); }

.install-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: var(--s3); }
.install-steps li { counter-increment: step; display: flex; gap: var(--s3); align-items: center; font-size: var(--t-sm); color: var(--paper-2); }
.install-steps li::before { content: counter(step); flex: none; width: var(--s6); height: var(--s6); border-radius: 50%; display: grid; place-items: center; background: var(--ink-2); color: var(--accent); font: 600 var(--t-sm)/1 var(--font-mono); }
.install-steps b { color: var(--paper); font-weight: 600; }
.install-steps svg { display: inline-block; width: var(--icon-sm); height: var(--icon-sm); vertical-align: text-bottom; color: var(--accent); }
.method { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.method legend { font: 600 var(--t-sm)/1 var(--font-text); color: var(--paper-2); padding: 0; margin-bottom: var(--s2); }
.toggle { display: grid; grid-template-columns: 1fr auto; column-gap: var(--s3); align-items: center; padding: var(--s3); border-radius: var(--r-row); background: var(--ink-2); border: var(--hair) solid var(--line); cursor: pointer; min-height: var(--control); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-text { display: grid; gap: var(--s1); }
.toggle-track { width: var(--toggle-w); height: var(--toggle-h); border-radius: var(--r-full); background: var(--ink-3); border: var(--hair) solid var(--line); position: relative; transition: background var(--dur) var(--ease-out); }
.toggle-track i { position: absolute; top: 50%; left: var(--s0); width: var(--toggle-knob); height: var(--toggle-knob); border-radius: 50%; background: var(--paper-2); transform: translateY(-50%); transition: transform var(--dur) var(--ease-out), background var(--dur) var(--ease-out); }
.toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.toggle:has(input:checked) .toggle-track { background: var(--accent); }
.toggle:has(input:checked) .toggle-track i { transform: translate(calc(var(--toggle-w) - var(--toggle-knob) - 2 * var(--s0) - 2 * var(--hair)), -50%); background: var(--accent-ink); }
.toggle:has(input:focus-visible) { outline: var(--s0) solid var(--accent); outline-offset: var(--s0); }
.method-opt { position: relative; display: grid; grid-template-columns: 1fr auto; column-gap: var(--s3); row-gap: var(--s1); align-items: baseline; padding: var(--s3); border-radius: var(--r-row); background: var(--ink-2); border: var(--hair) solid var(--line); cursor: pointer; min-height: var(--control); }
.method-opt input { position: absolute; opacity: 0; pointer-events: none; }
.method-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.method-opt:has(input:focus-visible) { outline: var(--s0) solid var(--accent); outline-offset: var(--s0); }
.method-opt:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.m-title { font-weight: 600; }
.m-eta { font: 500 var(--t-sm)/1.1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--paper); white-space: nowrap; }
.method-opt:has(input:checked) .m-eta { color: var(--accent); }
.m-note { grid-column: 1 / -1; font-size: var(--t-xs); color: var(--paper-3); line-height: 1.4; }
.legend-note { font-weight: 400; color: var(--paper-3); margin-left: var(--s1); }
.film { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); min-height: var(--film-min); }
.film img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-art); background: var(--ink-3); }
.send-label { font: 650 var(--t-lg)/1.2 var(--font-display); }
#send-meter i { background: var(--accent); }

.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + var(--toast-top)); transform: translateX(-50%); z-index: 60; padding: var(--s3) var(--icon-sm); border-radius: var(--r-full); font-weight: 600; font-size: var(--t-sm); max-width: calc(100% - var(--s6)); }

@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* The in-app camera (js/capture.js), full screen over everything. */
dialog.cam { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--ink-0); color: var(--paper); overflow: hidden; }
dialog.cam:not([open]) { display: none; }
dialog.cam::backdrop { background: var(--ink-0); }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-top { position: absolute; top: calc(var(--safe-t) + var(--s3)); left: var(--s3); right: var(--s3); display: flex; justify-content: space-between; align-items: center; }
.cam-time { padding: var(--s2) var(--s3); border-radius: var(--r-full); font: 600 var(--t-md)/1 var(--font-mono); }
.cam-time.rec::before { content: ""; display: inline-block; width: var(--s2); height: var(--s2); margin-right: var(--s2); border-radius: 50%; background: var(--signal); vertical-align: middle; }
.cam-advice { position: absolute; left: 50%; top: calc(var(--safe-t) + var(--s7) + var(--s4)); transform: translateX(-50%); max-width: calc(100% - var(--s6)); padding: var(--s2) var(--s4); border-radius: var(--r-full); font: 600 var(--t-md)/1.3 var(--font-text); text-align: center; transition: background var(--dur) var(--ease-out); }
.cam-advice[data-level="good"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.cam-advice[data-level="warn"] { background: var(--lamp-soft); box-shadow: inset 0 0 0 1px var(--lamp); }
.cam-advice[data-level="bad"] { background: var(--signal-soft); box-shadow: inset 0 0 0 1px var(--signal); }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + var(--s5)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; }
.cam-ring { width: var(--coverage-ring); height: var(--coverage-ring); grid-column: 1; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); } /* ds-allow-hardcode: a small shadow so the ring reads on any camera picture */
.cam-ring path { fill: none; stroke-width: 10; stroke: rgba(243, 236, 226, .25); transition: stroke .3s; } /* ds-allow-hardcode: SVG viewBox units; the unfilmed colour, readable on any picture */
.cam-ring path.good { stroke: var(--accent); }
.cam-ring path.weak { stroke: var(--lamp); }
.cam-ring .dot { fill: var(--paper); stroke: var(--ink-0); stroke-width: 2; } /* ds-allow-hardcode: SVG viewBox units */
.cam-ring text { fill: var(--paper); font: 700 26px var(--font-text); } /* ds-allow-hardcode: SVG viewBox units, scales with the ring */
.cam-shutter { grid-column: 2; width: var(--shutter); height: var(--shutter); border-radius: 50%; border: var(--s1) solid var(--paper); background: transparent; display: grid; place-items: center; padding: 0; }
.cam-shutter i { width: var(--shutter-dot); height: var(--shutter-dot); border-radius: 50%; background: var(--signal); transition: all var(--dur) var(--ease-out); }
.cam-shutter.on i { width: var(--shutter-stop); height: var(--shutter-stop); border-radius: var(--r-art); }
.cam-shutter:disabled { opacity: .4; }
.cam-review { position: absolute; left: var(--s3); right: var(--s3); bottom: calc(var(--safe-b) + var(--s3)); padding: var(--s5); border-radius: var(--r-sheet); display: grid; gap: var(--s3); }
.cam-review h2 { font-size: var(--t-xl); }
.cam-review ul { display: grid; gap: var(--s2); padding-left: var(--s4); color: var(--paper-2); }
.cam-review .actions { display: grid; gap: var(--s2); }

/* The three laps (index.html .laps): a phone goes round each ring in turn, the ring it's on lit; 9 s for all three.
   Phones ride the front of their ring (offset-path), drawn over the figure; reduced motion shows each at the front. */
.laps { display: block; width: 100%; max-width: 300px; margin-top: var(--s3); overflow: visible; }
.laps .lap-ring path { fill: none; stroke: var(--line-strong); stroke-width: var(--hair); }
.laps .lap-ring.back path { stroke-dasharray: 3 4; }
.laps .lap-figure { fill: var(--ink-3); stroke: var(--paper-3); stroke-width: 1; }
.laps .lap-label text { fill: var(--paper-3); font: 600 var(--t-xs) var(--font-mono); }
.laps .lap-phone { fill: var(--accent); stroke: var(--accent-ink); stroke-width: 1; opacity: 0; }
.laps .p1 { offset-path: path('M226 42a96 12 0 1 1-192 0a96 12 0 1 1 192 0'); offset-rotate: 0deg; }
.laps .p2 { offset-path: path('M226 6a96 12 0 1 1-192 0a96 12 0 1 1 192 0'); offset-rotate: 35deg; } /* tilted down at it */
.laps .p3 { offset-path: path('M226 106a96 12 0 1 1-192 0a96 12 0 1 1 192 0'); offset-rotate: -35deg; } /* tilted up at it */
.laps .p1 { animation: lap-go 9s linear infinite; }
.laps .p2 { animation: lap-go 9s linear infinite -6s; }
.laps .p3 { animation: lap-go 9s linear infinite -3s; }
.laps .lap-ring .r1, .laps .lap-label .r1 { animation: lap-lit 9s linear infinite; }
.laps .lap-ring .r2, .laps .lap-label .r2 { animation: lap-lit 9s linear infinite -6s; }
.laps .lap-ring .r3, .laps .lap-label .r3 { animation: lap-lit 9s linear infinite -3s; }
@keyframes lap-go { 0% { offset-distance: 0%; opacity: 1; } 33.3% { offset-distance: 100%; opacity: 1; } 33.4%, 100% { opacity: 0; } }
@keyframes lap-lit { 0%, 33.3% { stroke: var(--accent); fill: var(--accent); } 33.4%, 100% { stroke: var(--line-strong); fill: var(--paper-3); } }
.laps .lap-ring path { fill: none !important; }
.laps-key { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); color: var(--paper-2); font-size: var(--t-xs); }
.laps-key b { color: var(--accent); font-family: var(--font-mono); margin-right: var(--s1); }
@media (prefers-reduced-motion: reduce) {
  .laps .lap-phone, .laps .lap-ring path, .laps .lap-label text { animation: none; }
  .laps .lap-phone { opacity: 1; offset-distance: 25%; }
}
.tips .laps-tip > div { flex: 1; min-width: 0; }
.tips svg.laps { width: 100%; height: auto; max-width: 300px; margin-top: var(--s3); color: inherit; }

/* Thing or room (index.html #what): two pills; the sheet's data-what picks which tips show */
.what { border: 0; padding: 0; margin: 0 0 var(--s4); display: flex; flex-wrap: wrap; gap: var(--s2); }
.what legend { color: var(--paper-2); font-size: var(--t-sm); margin-bottom: var(--s2); padding: 0; }
.what label { position: relative; }
.what input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.what span { display: inline-flex; align-items: center; min-height: var(--control); padding: 0 var(--s4); border-radius: var(--r-full); border: var(--hair) solid var(--line-strong); color: var(--paper-2); font-weight: 500; }
.what input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--paper); }
.what input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
#new-sheet[data-what="room"] .laps-tip, #new-sheet[data-what="room"] .thing-tip, #new-sheet:not([data-what="room"]) .room-tip { display: none; }
.tips .room-tip > div { flex: 1; min-width: 0; }
.tips svg.room-walk { width: 100%; height: auto; max-width: 300px; margin-top: var(--s3); color: inherit; }
.room-walk .rw-wall { fill: none; stroke: var(--paper-3); stroke-width: var(--hair); }
.room-walk .rw-thing { fill: var(--ink-3); stroke: var(--line-strong); stroke-width: 1; }
.room-walk .rw-path { fill: none; stroke: var(--line-strong); stroke-width: var(--hair); stroke-dasharray: 3 4; }
/* the phone and its view: rides the path with its x axis along it, so +y (its view) points into the room (clockwise) */
.room-walk .rw-phone { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; offset-path: path('M32 26h196a6 6 0 0 1 6 6v86a6 6 0 0 1-6 6H32a6 6 0 0 1-6-6V32a6 6 0 0 1 6-6z'); offset-rotate: auto; animation: room-walk 8s linear infinite; }
@keyframes room-walk { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@media (prefers-reduced-motion: reduce) { .room-walk .rw-phone { animation: none; offset-distance: 10%; } }

/* Model export page (js/print-page.js) */
.models-link { margin-top: var(--s4); display: grid; grid-template-columns: auto 1fr; column-gap: var(--s2); justify-items: start; text-align: left; }
.models-link span { grid-column: 2; font: 400 var(--t-sm)/1.4 var(--font-text); color: var(--paper-2); }
#model-page { display: grid; gap: var(--s4); padding-bottom: var(--s7); }
#model-page[hidden] { display: none; }
.mp-title { font-size: var(--t-xl); }
.mp-card { display: grid; gap: var(--s3); padding: var(--s4); border-radius: var(--r-card); background: var(--ink-1); border: 1px solid var(--line); }
.mp-card h2 { font-size: var(--t-lg); }
.mp-sizes { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s1h); }
.mp-sizes legend { font: 600 var(--t-sm)/1 var(--font-text); color: var(--paper-2); margin-bottom: var(--s2); }
.mp-sizes .method-opt { padding: var(--s2) 0; justify-items: center; }
.mp-opts { display: grid; gap: var(--s2); }
.mp-opt { display: flex; gap: var(--s3); align-items: flex-start; cursor: pointer; }
.mp-opt input { margin-top: var(--s1); width: var(--s4); height: var(--s4); accent-color: var(--accent); flex: none; }
.mp-opt > span { display: grid; gap: var(--s0); }
.mp-opt .muted { font-size: var(--t-sm); }
.mp-result { display: grid; gap: var(--s3); padding: var(--s3); border-radius: var(--r-row); background: var(--ink-2); }
.mp-price { display: grid; gap: var(--s1); }
.mp-price b { font: 700 var(--t-xl)/1 var(--font-display); color: var(--accent); }
.mp-price span { font-size: var(--t-sm); color: var(--paper-2); }
.mp-check { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s1h); font-size: var(--t-sm); }
.mp-check li { padding-left: var(--s5); position: relative; }
.mp-check li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.mp-check li.warn::before { content: '!'; color: var(--lamp); }
.mp-files { display: grid; gap: var(--s2); }
.mp-files[hidden] { display: none; }
.mp-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.mp-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); } /* ds-allow-hardcode: a column's least width */
.mp-app { display: grid; justify-items: start; text-align: left; gap: var(--s0); min-height: var(--control-lg); padding: var(--s2) var(--s3); }
.mp-app span { font: 400 var(--t-xs)/1.3 var(--font-text); color: var(--paper-2); }
.mp-app:disabled { opacity: .6; cursor: progress; }

/* ── Wide screens: a modular dashboard (2026-12-06). Home: a rail of modules (start, this device, sign-in, how it
   works) beside your splats as tiles; the Model export page: its two cards side by side. Phones keep the column. ── */
.hero-new { display: none; }
@media (min-width: 1024px) { /* ds-allow-hardcode: media queries cannot read vars */
  .bar { width: min(var(--dash-w), 100% - 2 * var(--s4)); margin-inline: auto; }
  body[data-view="home"] main, body[data-view="model"] main { max-width: calc(var(--dash-w) + 2 * var(--s4)); padding-bottom: var(--s7); }
  body[data-view="home"] .dock { display: none; }
  .hero-new { display: inline-flex; justify-self: start; margin-top: var(--s2); }

  #home { grid-template-columns: var(--rail-w) minmax(0, 1fr); gap: var(--s4); align-items: start;
    grid-template-areas: "hero how" "sync how"; }
  body.has-splats #home { grid-template-areas: "hero title" "hero rows" "sync rows"; grid-template-rows: auto auto 1fr; }
  #home > .hero { grid-area: hero; padding: var(--s5); border-radius: var(--r-card); background: var(--ink-1); border: 1px solid var(--line); }
  #home > .hero h1 { font-size: var(--t-xl); }
  #sync-card { grid-area: sync; margin: 0; }
  body.has-splats #list-title { grid-area: title; padding: var(--s2) var(--s1) 0; }
  body.has-splats #rows { grid-area: rows; }
  body:not(.has-splats) #rows { display: none; }

  /* empty: how it works fills the main area as its own module */
  #how::before { content: "How it works"; font: 650 var(--t-lg)/1.08 var(--font-display); letter-spacing: -.03em; }
  #how { grid-area: how; padding: var(--s6); gap: var(--s5); border-radius: var(--r-card); background: var(--ink-1); border: 1px solid var(--line); }
  #how li { gap: var(--s4); }
  #how strong { font-size: var(--t-lg); }
  #how p { font-size: var(--t-md); }
  #how .n { width: var(--step-h); height: var(--step-h); font-size: var(--t-md); }

  /* your splats as tiles */
  .day-rows { grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr)); gap: var(--s3); overflow: visible; border-radius: 0; }
  .rows .row-link { flex-direction: column; align-items: stretch; gap: var(--s2); padding: var(--s2) var(--s2) var(--s3); min-height: 0; border-radius: var(--r-card); border: 1px solid var(--line);
    transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
  .rows .row-link:hover { background: var(--ink-2); border-color: var(--line-strong); }
  .rows .thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: var(--r-row); }
  .rows .row-text { padding: 0 var(--s1h); }
  .rows .chev { display: none; }

  /* Model export: print on the left, 3D apps on the right */
  #model-page { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
  #model-page > .pass { grid-column: 1 / -1; }
}
