/* Bella Runs — "warm glass". Bella's coat colours (caramel, copper, cream) on a soft ambient
   gradient with grain; frosted-glass cards with a thin luminous edge; an evening dark theme.
   Shared by the dashboard, account and household pages (account.css adds to it).

   Glass rules: cards are translucent (--glass) over the fixed ambient background, blurred with
   backdrop-filter, edged with a 1px light border and an inset top highlight. Where backdrop-filter
   isn't supported, on low-power devices (html.lowfx, set by theme.js) and with reduced
   transparency they fall back to the solid --glass-solid.
   Motion rules: transform/opacity only, eased (--ease / --spring), never needed to read anything;
   prefers-reduced-motion turns every animation and transition off (bottom of this file). */

:root {
  color-scheme: light;
  --bg: #f6efe5; --paper: #fffaf3; --sand: #f1e7d9; --sand-2: #e3d5c1;
  --ink: #261d18; --ink-2: #54473d; --ink-3: #6b5d52;
  --copper: #a2541d; --copper-2: #cf7f3c; --copper-3: #eab07a; --copper-light: #b8642a;
  --copper-wash: rgba(207,127,60,.12);
  --amber: #e9a35a; --grad-a: #b8581c; --grad-b: #eba45e;
  --fwd: #c26a2a; --rev: #2f7bb3; --rev-wash: rgba(47,123,179,.12);
  --ok: #2e7a4c; --bad: #a23d27;
  --line: rgba(110,72,40,.13); --line-2: rgba(110,72,40,.26);
  --glass: rgba(255,251,246,.6); --glass-strong: rgba(255,251,246,.78); --glass-solid: #fffaf3;
  --glass-edge: rgba(255,255,255,.8); --glass-hi: rgba(255,255,255,.9); --well: rgba(120,80,45,.06);
  --spot: rgba(234,164,94,.16);
  --shadow: 0 1px 2px rgba(70,40,15,.05), 0 12px 32px -14px rgba(70,40,15,.18);
  --shadow-lg: 0 2px 4px rgba(70,40,15,.05), 0 30px 70px -30px rgba(70,40,15,.32);
  --future: rgba(120,80,45,.05);
  --r0: #f3e3cc; --r1: #e8c49a; --r2: #d79a5e; --r3: #b96d31; --r4: #8c4818; --r5: #5c2c0b; --re: #ebe1d2;
  --dial: rgba(255,250,243,.7);
  --ff-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --ff-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ff-num: 'Plus Jakarta Sans', system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.2,.8,.2,1); --spring: cubic-bezier(.34,1.45,.5,1);
  --gutter: 32px; --dock-h: 66px;
  /* type scale: 11 sizes in all (with the three fluid display sizes); nothing smaller than 11px */
  --fs-xs: 11px; --fs-sm: 13px; --fs-md: 14px; --fs-base: 16px; --fs-lg: 18px;
  --fs-xl: 22px; --fs-2xl: 28px; --fs-3xl: 40px;
  --fs-h2: clamp(38px, 4.2vw, 58px); --fs-h1: clamp(44px, 6vw, 88px); --fs-speed: clamp(72px, 7.6vw, 116px);
  /* spacing: a 4px grid */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-24: 96px;
  /* one radius per kind: marks, controls, cards, panels, pills (inner radius = outer − padding) */
  --r-mark: 4px; --r-ctl: 12px; --r-card: 20px; --r-panel: 28px; --r-pill: 999px; --radius: var(--r-card);
  /* text roles: --ink (primary), --ink-2 (secondary), --ink-3 (muted), --accent; plus --on-accent for
     text on a solid accent fill */
  --accent: var(--copper); --on-accent: #fff8ef;
  /* gradient text (headline words) and the ghosted idle speed: darker in light mode, so ≥ 3:1 */
  --tg-a: #9a4614; --tg-b: #c06a2a; --ghost: #8f8074;
}
/* the evening theme: follows the system unless the toggle chose light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #120d0b; --paper: #1e1713; --sand: rgba(255,232,205,.06); --sand-2: rgba(255,232,205,.16);
    --ink: #f7ede3; --ink-2: #d2c3b5; --ink-3: #a39385;
    --copper: #f0a160; --copper-2: #e48a46; --copper-3: #9a5f36; --copper-light: #f5b47c;
    --copper-wash: rgba(240,161,96,.13);
    --amber: #ffc07a; --grad-a: #e27a35; --grad-b: #ffcf8f;
    --fwd: #ec8f4f; --rev: #6fb5ea; --rev-wash: rgba(111,181,234,.14);
    --ok: #6cc28d; --bad: #f08a72;
    --line: rgba(255,225,195,.09); --line-2: rgba(255,225,195,.2);
    --glass: rgba(36,27,22,.55); --glass-strong: rgba(40,30,25,.78); --glass-solid: #221a16;
    --glass-edge: rgba(255,225,195,.1); --glass-hi: rgba(255,235,215,.09); --well: rgba(255,232,205,.05);
    --spot: rgba(240,150,80,.1);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 40px -18px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 36px 80px -30px rgba(0,0,0,.75);
    --future: rgba(255,232,205,.03);
    --r0: #3b2618; --r1: #5e3518; --r2: #8f4c1c; --r3: #c9692a; --r4: #f08f45; --r5: #ffc58a; --re: rgba(255,232,205,.07);
    --dial: rgba(30,23,19,.6);
    --on-accent: #2a1405; --tg-a: var(--grad-a); --tg-b: var(--grad-b); --ghost: #85766a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #120d0b; --paper: #1e1713; --sand: rgba(255,232,205,.06); --sand-2: rgba(255,232,205,.16);
  --ink: #f7ede3; --ink-2: #d2c3b5; --ink-3: #a39385;
  --copper: #f0a160; --copper-2: #e48a46; --copper-3: #9a5f36; --copper-light: #f5b47c;
  --copper-wash: rgba(240,161,96,.13);
  --amber: #ffc07a; --grad-a: #e27a35; --grad-b: #ffcf8f;
  --fwd: #ec8f4f; --rev: #6fb5ea; --rev-wash: rgba(111,181,234,.14);
  --ok: #6cc28d; --bad: #f08a72;
  --line: rgba(255,225,195,.09); --line-2: rgba(255,225,195,.2);
  --glass: rgba(36,27,22,.55); --glass-strong: rgba(40,30,25,.78); --glass-solid: #221a16;
  --glass-edge: rgba(255,225,195,.1); --glass-hi: rgba(255,235,215,.09); --well: rgba(255,232,205,.05);
  --spot: rgba(240,150,80,.1);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 40px -18px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 36px 80px -30px rgba(0,0,0,.75);
  --future: rgba(255,232,205,.03);
  --r0: #3b2618; --r1: #5e3518; --r2: #8f4c1c; --r3: #c9692a; --r4: #f08f45; --r5: #ffc58a; --re: rgba(255,232,205,.07);
  --dial: rgba(30,23,19,.6);
  --on-accent: #2a1405; --tg-a: var(--grad-a); --tg-b: var(--grad-b); --ghost: #85766a;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
html.rm { scroll-behavior: auto; }
body { background: transparent; color: var(--ink); font-family: var(--ff-body); font-weight: 400; font-size: var(--fs-base); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh; position: relative; }
/* film grain over everything, very faint */
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .2 0 0 0 0 .1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] body::after { mix-blend-mode: screen; opacity: .05; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::after { mix-blend-mode: screen; opacity: .05; } }
/* ambient: three soft, still pools of warm light behind the glass (no motion) */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: var(--bg); }
.orb { position: absolute; border-radius: 50%; }
.o1 { width: 62vmax; height: 62vmax; right: -18vmax; top: -26vmax; background: radial-gradient(circle, rgba(241,172,108,.42), transparent 65%); }
.o2 { width: 50vmax; height: 50vmax; left: -20vmax; top: 18vh; background: radial-gradient(circle, rgba(232,150,135,.2), transparent 65%); }
.o3 { width: 55vmax; height: 55vmax; left: 30vw; bottom: -30vmax; background: radial-gradient(circle, rgba(214,150,84,.24), transparent 65%); }
:root[data-theme="dark"] .o1 { background: radial-gradient(circle, rgba(222,112,40,.3), transparent 65%); }
:root[data-theme="dark"] .o2 { background: radial-gradient(circle, rgba(150,60,90,.2), transparent 65%); }
:root[data-theme="dark"] .o3 { background: radial-gradient(circle, rgba(255,160,70,.12), transparent 65%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .o1 { background: radial-gradient(circle, rgba(222,112,40,.3), transparent 65%); }
  :root:not([data-theme="light"]) .o2 { background: radial-gradient(circle, rgba(150,60,90,.2), transparent 65%); }
  :root:not([data-theme="light"]) .o3 { background: radial-gradient(circle, rgba(255,160,70,.12), transparent 65%); }
}

a { color: var(--copper); text-decoration: none; }
button { font: inherit; color: inherit; }
/* em letter-spacing on a big figure computes to px and is inherited: units never take it */
small { letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--copper-2); outline-offset: 3px; border-radius: var(--r-mark); }
b { font-weight: 650; color: var(--ink); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: var(--r-pill); z-index: 200; font-size: var(--fs-md); }
.skip:focus { top: 12px; }
.defs { position: absolute; }
.muted { color: var(--ink-3); font-size: var(--fs-sm); }
.label { font-family: var(--ff-body); font-size: var(--fs-sm); font-weight: 500; color: var(--ink-3); }

/* ── glass ── */
.card { position: relative; min-width: 0; border-radius: var(--radius); background-color: var(--glass); border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
  transition: box-shadow .35s var(--ease), transform .35s var(--ease), border-color .35s; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .card { background-color: var(--glass-solid); } }
html.lowfx .card, html.lowfx .dock-bar, html.lowfx .acct-menu { backdrop-filter: none; -webkit-backdrop-filter: none; background-color: var(--glass-solid); }
@media (prefers-reduced-transparency: reduce) { .card, .dock-bar, .acct-menu { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background-color: var(--glass-solid) !important; } }

/* ── masthead (scrolls away; the dock stays) ── */
.masthead { display: flex; align-items: center; gap: 16px; padding-top: 24px; padding-bottom: 8px; position: relative; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--copper); border-radius: var(--r-ctl); }
.brand-mark { width: 40px; height: 40px; border-radius: var(--r-ctl); display: grid; place-items: center; color: #fff8ef;
  background: linear-gradient(145deg, var(--grad-b), var(--grad-a)); }
.brand-mark svg { width: 26px; height: 26px; }
.brand-name { font-family: var(--ff-display); font-size: var(--fs-2xl); font-weight: 500; font-style: italic; color: var(--ink); letter-spacing: -.015em; line-height: 1; white-space: nowrap; font-variation-settings: 'opsz' 96, 'WONK' 0; }
/* WONK 0: Fraunces' "wonky" italic l has a looped descender that makes "Bella" read as "Beſſa" */
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--glass-edge); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; transition: color .2s, border-color .2s; }
.icon-btn:hover { color: var(--copper); border-color: var(--line-2); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-moon { display: none; }
.theme-btn[data-mode="dark"] .i-sun { display: none; }
.theme-btn[data-mode="dark"] .i-moon { display: block; fill: currentColor; stroke: none; }
.link-chip { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--r-pill); padding: 8px 12px; white-space: nowrap; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.link-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); position: relative; }
.link-chip[data-state="live"] i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.link-chip[data-state="reconnecting"] i, .link-chip[data-state="connecting"] i { background: var(--copper-2); animation: blink 1.2s infinite; }
.link-chip[data-state="polling"] i { background: var(--copper-3); }
.link-chip[data-state="offline"] i { background: var(--bad); }
@keyframes blink { 50% { opacity: .25; } }
.acct-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--glass-edge); border-radius: var(--r-ctl); padding: 12px 16px; margin: 8px 0 16px; color: var(--ink-2); font-size: var(--fs-base); box-shadow: inset 3px 0 0 var(--copper-2), var(--shadow); }
.acct-banner.quiet { font-size: var(--fs-md); box-shadow: inset 3px 0 0 var(--copper-3), var(--shadow); }
.acct-banner .btn { margin-left: auto; }
.acct-banner .ab-text { flex: 1 1 320px; }
.acct-banner .ab-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.acct-banner .ab-btns .btn { margin-left: 0; }

/* ── segmented control with a sliding pill (ui.js adds .seg-ind) ── */
.seg { position: relative; display: inline-flex; background: var(--well); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px; gap: 0; isolation: isolate; }
.seg button { position: relative; z-index: 1; border: none; background: transparent; font-family: var(--ff-body); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); padding: 8px 12px; border-radius: var(--r-pill); cursor: pointer; transition: color .25s; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--ink); background: var(--paper); box-shadow: 0 1px 3px rgba(60,40,20,.16); }
.seg.has-ind button[aria-pressed="true"] { background: transparent; box-shadow: none; }
.seg-ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: var(--r-pill); background: var(--paper); box-shadow: 0 1px 2px rgba(60,40,20,.14); transition: transform .42s var(--spring), width .42s var(--spring), opacity .2s; }
.seg.no-anim .seg-ind { transition: none; }
:root[data-theme="dark"] .seg-ind { background: rgba(255,232,205,.14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-ind { background: rgba(255,232,205,.14); } }

/* ── buttons ── */
.btn { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--glass-strong); color: var(--ink); font-family: var(--ff-body); font-size: var(--fs-md); font-weight: 600; padding: 8px 16px; border-radius: var(--r-pill); cursor: pointer; transition: border-color .2s, color .2s, background-color .2s; }
.btn:hover { border-color: var(--copper-2); color: var(--copper); }
.btn-sm { padding: 8px 12px; font-size: var(--fs-sm); }

/* ── type ── */
.eyebrow { font-family: var(--ff-body); font-size: var(--fs-sm); font-weight: 600; color: var(--copper); display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.eyebrow .num { display: inline-grid; place-items: center; min-width: 32px; height: 24px; padding: 0 8px; border-radius: var(--r-pill); font-family: var(--ff-mono); font-size: var(--fs-xs); font-weight: 500; color: var(--on-accent); background: var(--copper); }
h1, h2 { font-family: var(--ff-display); font-weight: 450; line-height: 1; letter-spacing: -.025em; font-variation-settings: 'opsz' 144; }
h1 em, h2 em { font-style: italic; font-weight: 400; color: var(--copper-light); background: linear-gradient(100deg, var(--tg-a), var(--tg-b) 70%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; padding-right: .06em; }
h1 { font-size: clamp(46px, 5.6vw, 80px); }
h2 { font-size: var(--fs-h2); }
h3 { font-family: var(--ff-body); font-weight: 650; font-size: var(--fs-lg); line-height: 1.25; letter-spacing: -.01em; }
.sect { padding-top: 96px; }
main section[id] { scroll-margin-top: 16px; }
main section[id]:focus { outline: none; }
.sect-h { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 8px 40px; align-items: end; margin-bottom: 24px; }
.sect-h .eyebrow { grid-column: 1 / -1; margin-bottom: 8px; }
.sect-note { color: var(--ink-3); font-size: var(--fs-base); line-height: 1.55; justify-self: end; text-align: right; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.legend { font-size: var(--fs-sm); color: var(--ink-3); display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: var(--r-mark); vertical-align: -1px; margin: 0 0 0 8px; }
.key:first-child { margin-left: 0; }
.key.fwd { background: var(--fwd); } .key.rev { background: var(--rev); }
.key.usual { background: linear-gradient(90deg, var(--r0), var(--r2), var(--r4)); width: 22px; }

/* ── reveal on scroll (sections rise in once; app content is visible without JS) ── */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ═══════════════ hero: right now ═══════════════
   The heading and a sentence, then one glass card: Bella's painting (bella-art.js) on a panel the
   exact colour of the painting's own background, and beside it (below it on phones) the speed,
   this run and today's trace. --art-run / --art-rest = the running / resting paintings' background
   (tools/make-art.py prints them; keep them equal or the picture shows an edge). */
:root { --art-run: #fee9cc; --art-rest: #fee9cc; --art-streak: rgba(178,96,38,.55); --art-blend: soft-light; }
:root[data-theme="dark"] { --art-run: #170f0c; --art-rest: #170f0c; --art-streak: rgba(255,186,120,.5); --art-blend: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --art-run: #170f0c; --art-rest: #170f0c; --art-streak: rgba(255,186,120,.5); --art-blend: screen; } }
.hero { position: relative; padding-top: clamp(24px, 6vh, 64px); }
.hero-head { text-align: center; max-width: 860px; margin: 0 auto clamp(26px, 4vh, 40px); }
.hero-head h1 { font-size: var(--fs-h1); }
.hero-eyebrow { display: inline-flex; padding: 8px 16px 8px 12px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--glass-edge); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); margin-bottom: 16px; }
.hero .eyebrow .pulse { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--copper-2); box-shadow: 0 0 0 3px var(--copper-wash); margin-right: 8px; vertical-align: 1px; }
.hero-sub { color: var(--ink-2); font-size: var(--fs-lg); line-height: 1.6; max-width: 600px; margin: 16px auto 0; min-height: 1.6em; }

/* the live card: Bella (16:9 clips) | speed, gait and this run; under both, the pass ticker */
.live-card { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr); grid-template-areas: "art panel" "tick tick"; padding: 8px; border-radius: var(--r-panel); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-lg); }
.live-art { --v: 0; --kick: 0; grid-area: art; position: relative; min-width: 0; aspect-ratio: 1600 / 894; align-self: start; border-radius: calc(var(--r-panel) - 8px); overflow: hidden; isolation: isolate; background: var(--art-rest); transition: background-color .7s ease; }
.live-art[data-state="walk"], .live-art[data-art="walk"], .live-art[data-art="trot"], .live-art[data-art="run"] { background: var(--art-run); }
/* v6: the painted tropical backyard behind the wheel (Gemini; day for light, dusk with string lights for dark). Painted in
   the art area's own frame (1600 x 894), so 100% x 100% keeps the deck line under the bed and supports at every width.
   If the image doesn't load, the plain ground colour above stays. Phones get the 1280 px file, wider screens 1920. */
.live-art.b6-scene, .live-art.b6-scene[data-art] { background-image: url(/media/bella-scene-light-1920-v1.webp); background-size: 100% 100%; background-repeat: no-repeat; background-position: center; }
:root[data-theme="dark"] .live-art.b6-scene, :root[data-theme="dark"] .live-art.b6-scene[data-art] { background-image: url(/media/bella-scene-dark-1920-v1.webp); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .live-art.b6-scene, :root:not([data-theme="light"]) .live-art.b6-scene[data-art] { background-image: url(/media/bella-scene-dark-1920-v1.webp); } }
@media (max-width: 700px) {
  .live-art.b6-scene, .live-art.b6-scene[data-art] { background-image: url(/media/bella-scene-light-1280-v1.webp); }
  :root[data-theme="dark"] .live-art.b6-scene, :root[data-theme="dark"] .live-art.b6-scene[data-art] { background-image: url(/media/bella-scene-dark-1280-v1.webp); }
}
@media (max-width: 700px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .live-art.b6-scene, :root:not([data-theme="light"]) .live-art.b6-scene[data-art] { background-image: url(/media/bella-scene-dark-1280-v1.webp); } }
.live-status { position: absolute; z-index: 4; top: 16px; left: 16px; display: inline-flex; align-items: center; gap: 8px; font-family: var(--ff-body); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
  padding: 4px 12px; border-radius: var(--r-pill); background: var(--glass-strong); border: 1px solid var(--glass-edge); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.live-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); opacity: .7; }
.hero[data-state="live"] .live-status::before { background: var(--copper-2); opacity: 1; box-shadow: 0 0 0 3px var(--copper-wash); }
.demo-chip { align-self: flex-start; margin: 0 0 -8px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); background: var(--glass-strong); border: 1px dashed var(--line-2); border-radius: var(--r-pill); padding: 4px 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.live-panel { grid-area: panel; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 16px 20px 16px 32px; }
.speedo { display: flex; align-items: flex-end; gap: 16px; }
.speed-num { font-family: var(--ff-display); font-weight: 500; font-size: var(--fs-speed); line-height: .8; letter-spacing: -.045em; font-variant-numeric: lining-nums tabular-nums; color: var(--ink); font-variation-settings: 'opsz' 144; }
.hero[data-state="idle"] .speed-num, .hero[data-state="empty"] .speed-num, .hero[data-state="loading"] .speed-num { color: var(--ghost); }
.hero[data-state="live"] .speed-num { background: linear-gradient(170deg, var(--grad-b), var(--grad-a) 75%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero.no-cat .speed-num { -webkit-text-fill-color: currentColor; background: none; color: var(--ink-3); }
.speed-unit { display: flex; flex-direction: column; gap: 4px; padding-bottom: .35em; }
.speed-unit b { font-family: var(--ff-num); font-weight: 700; font-size: var(--fs-lg); color: var(--ink-2); }
.speed-unit small { font-family: var(--ff-body); font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.35; max-width: 13em; }

/* what she's doing: the player's state, and a walk / trot / run meter */
.gait { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gait-label { font-family: var(--ff-display); font-style: italic; font-size: var(--fs-2xl); line-height: 1.1; letter-spacing: -.01em; color: var(--ink-2); font-variation-settings: 'opsz' 72; }
.gait[data-state="walk"] .gait-label, .gait[data-state="trot"] .gait-label, .gait[data-state="run"] .gait-label { color: var(--copper-light); }
.gait-meter { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--well); border: 1px solid var(--line); }
.gait-meter i { position: relative; display: grid; place-items: center; min-width: 52px; height: 24px; border-radius: var(--r-pill); font-style: normal; transition: background-color .35s var(--ease), color .35s; color: var(--ink-3); }
.gait-meter b { font-family: var(--ff-body); font-size: var(--fs-xs); font-weight: 500; color: inherit; }
.gait-meter i.on { color: var(--on-accent); background: var(--copper); }
.gait-meter i[data-g="walk"].on { background: var(--g-walk); color: var(--ink); }
.gait-meter i[data-g="trot"].on { background: var(--g-trot); }
.gait-meter i[data-g="trot"].on { color: #2a1405; }
.gait-meter i[data-g="run"].on { background: var(--g-run); }
:root[data-theme="dark"] .gait-meter i[data-g="walk"].on { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gait-meter i[data-g="walk"].on { color: var(--ink); } }

/* the player: stills underneath, two or more stacked <video>s crossfading over them (bella-art.js).
   Edges fade softly into the panel colour. */
.bella-stage { position: absolute; inset: 0; z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(180deg, transparent, #000 5%, #000 96%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(180deg, transparent, #000 5%, #000 96%, transparent); mask-composite: intersect; }
.bp-still, .bp-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; opacity: 0; display: block; }
.bp-still { transition: opacity .6s ease; }
.bp-still.on { opacity: 1; }
.bp-video { z-index: 1; transition: opacity .25s ease; pointer-events: none; }
.bp-video.on { opacity: 1; z-index: 3; }
.bp-video.on.out { z-index: 2; }
/* fx layer (the speed glow that used to live here was removed in Nov 2026: it read as a glitch) */
.bella-fx { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.bella-kick { display: none; }
/* v6 prototype (bella-v6.js): wheel back / cat / near rim, the cat above everything while she is on the floor */
.bella-v6 .b6-layer, .bella-v6 .b6-poster { position: absolute; display: block; pointer-events: none; }
.bella-v6 .b6-layer { inset: 0; width: 100%; height: 100%; }
.bella-v6 .b6-back { z-index: 1; } .bella-v6 .b6-cat, .bella-v6 .b6-poster { z-index: 2; } .bella-v6 .b6-front { z-index: 3; } .bella-v6 .b6-bed { z-index: 3; }
.bella-v6[data-inside="0"] .b6-cat, .bella-v6[data-inside="0"] .b6-poster { z-index: 4; }
.bella-v6 .b6-poster { transition: opacity .2s ease; transform-origin: 50% 50%; }
.bella-v6 .b6-vids { position: absolute; left: 0; top: 0; width: 2px; height: 2px; overflow: hidden; opacity: .01; z-index: 0; }
.bella-v6 .b6-vids video { width: 2px; height: 2px; }
.bolt { position: absolute; z-index: 6; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; border-radius: 40%; -webkit-tap-highlight-color: transparent; }
.bolt canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.bolt:focus-visible { outline: 2px solid var(--rev); outline-offset: -4px; }
.bolt-bubble { position: absolute; z-index: 7; max-width: min(56%, 300px); width: max-content; padding: 8px 12px 8px; font: 500 var(--fs-sm)/1.32 var(--ff-body, system-ui), system-ui, sans-serif;
  color: #2b2420; background: linear-gradient(170deg, #fffaf1, #f8eedd); border: 1.5px solid rgba(150, 110, 70, .45); border-radius: 15px 17px 16px 13px;
  box-shadow: 0 6px 18px -8px rgba(80, 50, 20, .45), inset 0 1px 0 rgba(255,255,255,.8); pointer-events: none; transform-origin: 8% 100%;
  opacity: 0; transform: translateY(4px) scale(.94); transition: opacity .22s ease, transform .22s ease; }
.bolt-bubble.on { opacity: 1; transform: none; }
.bolt-bubble::after { content: ''; position: absolute; left: 14px; bottom: -7px; width: 12px; height: 12px; background: #f8eedd; border-right: 1.5px solid rgba(150, 110, 70, .45); border-bottom: 1.5px solid rgba(150, 110, 70, .45); transform: rotate(45deg) skew(8deg, 8deg); border-bottom-right-radius: 3px; }
:root[data-theme="dark"] .bolt-bubble { color: #f6eee3; background: linear-gradient(170deg, #3a302a, #2c241f); border-color: rgba(230, 190, 140, .35); }
:root[data-theme="dark"] .bolt-bubble::after { background: #2c241f; border-color: rgba(230, 190, 140, .35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bolt-bubble { color: #f6eee3; background: linear-gradient(170deg, #3a302a, #2c241f); border-color: rgba(230, 190, 140, .35); }
  :root:not([data-theme="light"]) .bolt-bubble::after { background: #2c241f; border-color: rgba(230, 190, 140, .35); } }
.bolt-bubble.tight { font-size: 10.5px; line-height: 1.25; padding: 4px 7px 6px; }
.bolt-bubble.to-left { bottom: var(--bb-wide); transform-origin: 92% 100%; } .bolt-bubble.to-left::after { left: auto; right: 14px; }
@media (prefers-reduced-motion: reduce) { .bolt-bubble { transition: opacity .15s linear; transform: none; } }
@media (max-width: 600px) { .bolt-bubble { font-size: var(--fs-xs); padding: 4px 8px 8px; max-width: 62%; } .bolt-bubble::after { left: 10px; width: 9px; height: 9px; bottom: -5px; } .bolt-bubble.to-left { bottom: var(--bb-narrow); max-width: 44%; } .bolt-bubble.to-left::after { left: auto; right: 10px; } }
.b6-debug { position: absolute; right: 6px; top: 6px; max-width: 58%; z-index: 9; font: 8.5px/1.25 ui-monospace, monospace; color: #fff; background: rgba(0,0,0,.55); padding: 0 4px; border-radius: 5px; pointer-events: none; word-break: break-word; }
:root[data-theme="dark"] .bella-v6 .b6-poster { filter: brightness(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bella-v6 .b6-poster { filter: brightness(.9); } }

/* the run's numbers, in wells inside the live card */
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hero-stats > div { padding: 12px 12px 8px; min-width: 0; border-radius: var(--r-ctl); background: var(--well); border: 1px solid var(--line); }
.hero-stats dt { font-family: var(--ff-body); font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-stats dd { font-family: var(--ff-num); font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.025em; line-height: 1.15; margin-top: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.hero-stats dd small, .tile-v small, .rec-v small, .st-v small, .d-stats dd small { font-family: var(--ff-mono); font-size: var(--fs-xs); font-weight: 400; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
/* one short word on one line, the same height as the number tiles next to it */
#hs-dir { font-family: var(--ff-body); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0; padding-top: 4px; white-space: nowrap; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 359px) { #hs-dir .dir { display: none; } } /* the word alone fits a 320 px phone */
.dir { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--well); color: var(--copper); font-size: var(--fs-sm); margin-right: 4px; vertical-align: 1px; }
.dir.rev { background: var(--rev-wash); color: var(--rev); }
.hero-weight { display: inline-block; font-family: var(--ff-mono); font-size: var(--fs-sm); color: var(--ink-3); }

/* the pass ticker (ticker.js): every magnet pass, live */
.ticker-wrap { grid-area: tick; min-width: 0; padding: 12px 12px 4px; }
.ticker-h { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; margin-bottom: 4px; }
.ticker-note { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); }
.hero[data-state="live"] .ticker-note { color: var(--copper); }
.ticker-host { position: relative; height: 80px; border-radius: var(--r-ctl); background: var(--well); border: 1px solid var(--line); overflow: hidden; }
.ticker { position: absolute; inset: 0; display: block; }

/* ═══════════════ today at a glance + live activity, right under the live card ═══════════════ */
:root { --g-walk: #ecc48f; --g-trot: #d8833c; --g-run: #a8401a; --hop: #8b7a6c; }
:root[data-theme="dark"] { --g-walk: #8a6a48; --g-trot: #e08a45; --g-run: #ffd59c; --hop: #b2a090; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --g-walk: #8a6a48; --g-trot: #e08a45; --g-run: #ffd59c; --hop: #b2a090; } }
.key.g-walk { background: var(--g-walk); } .key.g-trot { background: var(--g-trot); } .key.g-run { background: var(--g-run); }
.key.hop { width: 4px; height: 10px; border-radius: var(--r-mark); background: var(--hop); }
.strip { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 2fr); padding: 8px; border-radius: var(--r-panel); }
/* two groups: today's six totals under a "Today" eyebrow, then Streak + Last on the wheel past a divider */
.st-g { position: relative; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.st-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.st-ever .st-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-ever::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--line-2); }
.st-eb { display: flex; align-items: center; gap: 0; padding: 8px 12px 0 16px; font-size: var(--fs-sm); font-weight: 600; color: var(--copper); white-space: nowrap; overflow: hidden; }
.st-eb span { color: var(--ink-3); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.st-eb::after { content: ''; flex: 1 1 0; min-width: 12px; margin-left: 8px; height: 1px; background: var(--line); }
.st-i { position: relative; min-width: 0; padding: 12px 12px 12px 16px; border-radius: calc(var(--r-panel) - 8px); }
.st-today .st-i { padding-top: 8px; }
.st-i + .st-i::before { content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 1px; background: var(--line); }
.st-i .label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-n { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; white-space: nowrap; }
.st-n b { font-family: var(--ff-num); font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; transition: color .6s; }
.st-n b.bump { color: var(--copper); }
.st-n small { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); }
.strip.is-live .st-i[data-k="since"] b { background: linear-gradient(170deg, var(--grad-b), var(--grad-a)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.strip.is-live .st-i[data-k="runs"] small { color: var(--copper); }

.pulse-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; margin-top: 16px; align-items: start; }
.pulse-grid .timeline-card { margin-top: 0; }
.feed-card { padding: 20px 16px 8px 16px; }
.feed-card h3 { display: flex; align-items: center; gap: 8px; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
/* part of the page flow, never a scroll area of its own (it trapped phones' swipes): expand.js */
.feed { list-style: none; overflow-anchor: none; }
.fi { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 0 12px; padding: 12px 8px 12px 0; border-radius: var(--r-ctl); }
.fi + .fi { border-top: 1px solid var(--line); }
.fi[data-run] { cursor: pointer; transition: background-color .2s; }
.fi[data-run]:hover { background: var(--well); }
.fi-ico { width: 32px; height: 32px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--copper-wash); color: var(--copper); }
.fi-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-hops { background: var(--well); color: var(--ink-2); } .ic-hops svg { fill: currentColor; stroke: none; }
.ic-rev { background: var(--well); color: var(--ink-2); }
.ic-record { color: var(--on-accent); background: var(--copper); }
.ic-gait { background: var(--copper-wash); color: var(--g-run); } .ic-gait svg { fill: currentColor; stroke: none; }
.ic-online { background: rgba(63,139,92,.13); color: var(--ok); } .ic-offline { background: rgba(180,71,47,.12); color: var(--bad); }
.ic-hand { background: var(--well); color: var(--ink-3); }
.fi-body { min-width: 0; }
.fi-title { font-size: var(--fs-md); line-height: 1.35; color: var(--ink-2); display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.fi-title b { font-family: var(--ff-num); font-weight: 700; color: var(--ink); }
.fi-meta { font-family: var(--ff-mono); font-size: var(--fs-xs); line-height: 1.5; color: var(--ink-3); margin-top: 0; }
.fi-meta .dir { width: 16px; height: 16px; font-size: var(--fs-xs); margin-right: 0; }
.fi-time { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.35; }
.fi-time small { font-size: var(--fs-xs); color: var(--ink-3); }
.fi-chip { font-size: var(--fs-xs); font-weight: 600; border-radius: var(--r-pill); padding: 0 8px; white-space: nowrap; }
.fi-chip.warn { color: var(--copper); background: var(--copper-wash); }
.fi-chip.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, transparent); }
.fi.is-flagged .fi-title b { text-decoration: line-through; text-decoration-color: var(--ink-3); color: var(--ink-3); }
.fi-mix { display: flex; height: 4px; margin-top: 8px; max-width: 240px; border-radius: var(--r-mark); overflow: hidden; gap: 4px; }
.fi-mix i { display: block; height: 100%; }
.fi-mix .g-walk { background: var(--g-walk); } .fi-mix .g-trot { background: var(--g-trot); } .fi-mix .g-run { background: var(--g-run); }
.fi-mixtxt { display: block; font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); margin-top: 4px; }
.fi-record .fi-title b { color: var(--copper); font-family: var(--ff-display); font-size: var(--fs-lg); font-style: italic; font-weight: 500; }
.fi-record { background: var(--copper-wash); }
.fi-toggle { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 24px; border-radius: var(--r-mark); }
.fi-toggle:focus-visible { outline: 2px solid var(--copper-2); outline-offset: 3px; }
.fi-chev { width: 8px; height: 8px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: rotate(-45deg); transition: transform .25s var(--ease); margin-left: 0; }
.fi-toggle[aria-expanded="true"] .fi-chev { transform: rotate(45deg); }
.fi-sub { list-style: none; margin-top: 8px; display: grid; gap: 0; }
.fi-sub li { display: flex; gap: 8px; align-items: baseline; font-size: var(--fs-sm); padding: 4px 8px; min-height: 28px; border-radius: var(--r-mark); background: var(--well); cursor: pointer; }
.fi-sub span { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); min-width: 64px; }
.fi-sub em { font-style: normal; font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--bad); }
.fi-live { background: var(--copper-wash); }
.fi-live .fi-ico { color: var(--on-accent); background: var(--copper); }
.fi-live .fi-time b { font-family: var(--ff-num); font-size: var(--fs-base); color: var(--copper); }
.fi-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--copper-2); align-self: center; }
/* the page's one entrance: a new event slides into the feed */
.fi-new { animation: fiIn .3s var(--ease) both; }
@keyframes fiIn { from { opacity: 0; transform: translateY(-8px); } }
.feed-empty { display: grid; gap: 4px; padding: 24px 8px 24px; text-align: center; color: var(--ink-3); font-size: var(--fs-md); }
.feed-empty b { font-family: var(--ff-display); font-size: var(--fs-xl); font-weight: 450; color: var(--ink-2); }
.feed-card .more { margin: 8px auto 8px; display: flex; }
/* under the day's timeline: time by gait + the day's shape */
.day-facts { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px 24px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.df-mix .label small { font-weight: 400; }
.df-bar { display: flex; gap: 4px; height: 8px; margin: 8px 0; border-radius: var(--r-mark); overflow: hidden; }
.df-bar i { display: block; height: 100%; min-width: 4px; }
.df-bar .g-walk { background: var(--g-walk); } .df-bar .g-trot { background: var(--g-trot); } .df-bar .g-run { background: var(--g-run); }
.df-gaits { list-style: none; display: grid; gap: 4px; font-size: var(--fs-md); color: var(--ink-2); }
.df-gaits b { font-family: var(--ff-num); font-weight: 700; color: var(--ink); margin-left: 4px; }
.df-gaits small { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); margin-left: 4px; }
.df-none { color: var(--ink-3); font-size: var(--fs-md); margin-top: 8px; }
.df-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.df-facts > div { padding: 8px 12px; border-radius: var(--r-ctl); background: var(--well); border: 1px solid var(--line); min-width: 0; }
.df-facts dt { font-family: var(--ff-body); font-size: var(--fs-sm); color: var(--ink-3); }
.df-facts dd { font-family: var(--ff-num); font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.02em; margin-top: 0; white-space: nowrap; }
.df-facts dd small { font-family: var(--ff-mono); font-size: var(--fs-xs); font-weight: 400; color: var(--ink-3); }
/* the day's timeline: bars coloured by gait */
.chart .run.g-walk .bar { fill: var(--g-walk); } .chart .run.g-trot .bar { fill: var(--g-trot); } .chart .run.g-run .bar { fill: var(--g-run); }
.chart .hop { cursor: pointer; outline: none; }
.chart .hop-tick { stroke: var(--hop); stroke-width: 2.4; stroke-linecap: round; }
.chart .hop:hover .hop-tick, .chart .hop:focus-visible .hop-tick { stroke: var(--copper); }

/* ═══════════════ section nav ("the dock") ═══════════════
   Under 1024px: a tab bar fixed to the bottom, an icon over each label; it slides away while you
   scroll down (nav.js). From 1024px: labelled links in the masthead, which sticks to the top, so
   nothing floats over the content. The active section gets a solid copper pill (.dock-ind). */
.dock { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(560px, calc(100vw - 16px)); z-index: 70; pointer-events: none; }
.dock-bar { pointer-events: auto; position: relative; list-style: none; display: flex; justify-content: space-between; padding: 4px; border-radius: var(--r-panel);
  background: var(--glass-strong); border: 1px solid var(--glass-edge); backdrop-filter: blur(26px) saturate(1.8); -webkit-backdrop-filter: blur(26px) saturate(1.8); box-shadow: var(--shadow-lg); }
.dock-bar > li { display: flex; }
.dock-bar > li:not(.dock-ind):not(.dock-sep) { flex: 1 1 0; min-width: 0; }
.dock-item { position: relative; width: 100%; min-height: 56px; display: grid; grid-template-rows: 24px auto; place-items: center; align-content: center; gap: 4px; padding: 4px 0; border: 0; background: transparent;
  border-radius: calc(var(--r-panel) - 4px); color: var(--ink-2); cursor: pointer; text-decoration: none; transition: color .25s, background-color .25s; -webkit-tap-highlight-color: transparent; }
.dock-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock-item:hover { color: var(--ink); background-color: var(--well); }
.dock-item[aria-current="true"] { color: var(--on-accent); background-color: transparent; }
.dock-item:focus-visible { outline-offset: 2px; }
.dock-label { font-size: var(--fs-xs); font-weight: 600; line-height: 1.25; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dock-ind { position: absolute; left: 0; top: 0; width: 48px; height: 48px; border-radius: calc(var(--r-panel) - 4px); opacity: 0; pointer-events: none; background: var(--copper); }
.dock-ind.ready { transition: transform .4s var(--ease), width .2s var(--ease), height .2s var(--ease), opacity .3s; }
.dock-sep { flex: none; width: 1px; align-self: stretch; margin: 12px 4px; background: var(--line-2); }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: inherit; font-family: var(--ff-body); font-weight: 700; font-size: var(--fs-sm); }
.avatar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.avatar.has-initial { color: var(--on-accent); background: var(--copper); }
.dock-acct[aria-expanded="true"] { background-color: var(--well); color: var(--ink); }
/* the page always scrolls clear of the dock, home indicator included */
body { padding-bottom: calc(var(--dock-h) + 32px + env(safe-area-inset-bottom, 0px)); }
/* account popover above the dock */
.acct-menu { position: fixed; z-index: 75; left: 50%; bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom, 0px)); width: 320px; margin-left: -160px; padding: 16px; border-radius: var(--r-card);
  background: var(--glass-strong); border: 1px solid var(--glass-edge); backdrop-filter: blur(26px) saturate(1.6); -webkit-backdrop-filter: blur(26px) saturate(1.6); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-lg);
  animation: pop .18s ease-out both; }
@keyframes pop { from { opacity: 0; } }
.am-who { font-size: var(--fs-md); color: var(--ink-2); padding: 0 4px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.am-role { font-family: var(--ff-body); font-size: var(--fs-xs); font-weight: 600; color: var(--copper); background: var(--copper-wash); border-radius: var(--r-pill); padding: 0 8px; margin-left: 4px; vertical-align: 1px; }
.am-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 4px; }
.am-links { display: grid; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.am-links a { padding: 12px 8px; border-radius: var(--r-ctl); color: var(--ink); font-weight: 600; font-size: var(--fs-md); transition: background .2s; }
.am-links a:hover { background: var(--well); }
.am-links a.logout { color: var(--bad); }
.am-links .am-signin { padding: 12px 8px; border: 0; background: none; border-radius: var(--r-ctl); color: var(--ink-2); font-weight: 500; font-size: var(--fs-md); text-align: left; cursor: pointer; }
.am-links .am-signin:hover { background: var(--well); }
.am-links .am-signin[hidden] { display: none; }
/* the More sheet (below 1024px): the same panel as a bottom sheet over a scrim, with the sections
   that have no tab of their own as large tiles first */
.am-grab, .am-sections { display: none; }
.sheet-scrim { position: fixed; inset: 0; z-index: 74; background: rgba(20,12,8,.32); animation: pop .18s ease-out both; }
.acct-menu.is-sheet { left: 0; right: 0; bottom: 0; width: auto; margin: 0; max-height: min(86vh, 640px); overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px)); border-radius: var(--r-panel) var(--r-panel) 0 0; border-bottom: 0;
  background-color: var(--glass-solid); backdrop-filter: none; -webkit-backdrop-filter: none; animation: sheetIn .24s var(--ease) both; }
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } }
.acct-menu.is-sheet .am-grab { display: block; width: 40px; height: 4px; margin: 0 auto 12px; border-radius: var(--r-pill); background: var(--line-2); }
.acct-menu.is-sheet .am-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.am-sec { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px; border-radius: var(--r-ctl); background: var(--well); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: var(--fs-md); }
.am-sec[hidden] { display: none; }
.acct-menu.is-sheet .seg button { min-height: 44px; padding: 12px 16px; }
.acct-menu.is-sheet .seg-ind { top: 4px; bottom: 4px; }
.am-sec svg { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--copper); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.am-sec:hover { border-color: var(--line-2); }
.am-sec[aria-current="true"] { background: var(--copper); border-color: var(--copper); color: var(--on-accent); }
.am-sec[aria-current="true"] svg { stroke: currentColor; }
html.sheet-open body { overflow: hidden; }
/* five tabs below 1024px: the wide-only sections sit in More; More itself only exists here */
.dock-wide { display: none !important; }
.dock-more[aria-expanded="true"]:not([aria-current]) { background-color: var(--well); color: var(--ink); }
/* the owner's discreet passkey sign-in in the footer (public/auth.js) */
.owner-signin { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 4px; font-size: var(--fs-sm); color: var(--ink-3); border-radius: var(--r-ctl); transition: color .2s; }
.owner-signin:hover, .owner-signin:focus-visible { color: var(--ink); }
.owner-signin svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.owner-signin[hidden] { display: none; }
/* back to top: a small glass button above the dock */
.to-top { position: fixed; right: 24px; bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom, 0px)); z-index: 65; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--glass-edge); background: var(--glass-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); color: var(--copper); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s linear .25s; }
.to-top.show { opacity: 1; visibility: visible; transition: opacity .25s, visibility 0s; }
.to-top:hover { color: var(--copper-light); border-color: var(--line-2); }
.to-top svg { width: 20px; height: 20px; }

/* ═══════════════ today ═══════════════ */
/* label, big figure, comparison. Distance leads (twice as wide, with its last 14 days); the other
   three are compact, so the row has a rhythm instead of four identical boxes */
.tiles { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.tile-v { font-family: var(--ff-num); font-size: var(--fs-3xl); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; margin: 4px 0; }
.tile-lead .tile-v { color: var(--copper); }
.cmp { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.cmp-ico { font-size: var(--fs-xs); width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--sand); color: var(--ink-3); flex: none; }
.cmp.up { color: var(--copper); } .cmp.up .cmp-ico { background: var(--copper-wash); color: var(--copper); }
.cmp.none { color: var(--ink-3); font-weight: 400; }
.tile-spark { height: 44px; margin: 12px 0 4px; }
.tile-spark .mini-spark { height: 44px; }
.mini-spark { display: block; width: 100%; height: 34px; overflow: visible; }
.ms-line { fill: none; stroke: var(--copper-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ms-dot { fill: var(--copper-2); stroke: var(--paper); stroke-width: 1.5; }
.tile-foot { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; }
.timeline-card { margin-top: 16px; padding: 24px 24px 16px; }
.timeline, .bars, .trace-host, .rhythm-chart { position: relative; }
.chart { display: block; max-width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--ff-mono); }
.chart .tick { font-size: var(--fs-xs); fill: var(--ink-3); }
.chart .tick.strong { fill: var(--ink-2); font-weight: 500; }
.chart .tick.unit { font-size: var(--fs-xs); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.faint { opacity: .45; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .future { fill: var(--future); }
.chart .now-line { stroke: var(--copper); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart .now-lbl { font-family: var(--ff-body); font-size: var(--fs-xs); fill: var(--copper); font-weight: 600; }
.chart .live-dot { fill: var(--copper-2); stroke: var(--paper); stroke-width: 2; }
.chart .run { cursor: pointer; outline: none; }
.chart .run:hover path, .chart .run:focus path { filter: brightness(1.15); }
.chart .run:focus-visible rect { stroke: var(--copper-2); stroke-width: 2; rx: 4; }
.chart .run-dot { fill: var(--ink); }
.chart .avg-line { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 5 4; opacity: .6; }
.chart .avg-lbl { font-size: var(--fs-xs); fill: var(--ink-2); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.chart .avg-key { letter-spacing: 0; }
.chart .bar path { transition: filter .2s; }
.chart .bar .hit { fill: transparent; }
.chart .bar:hover .hit { fill: var(--copper-wash); }
.chart .bar:hover path { filter: brightness(1.12) saturate(1.1); }
.chart .bar.cur .hit { fill: var(--well); }
.f-fwd { fill: var(--fwd); } .f-rev { fill: var(--rev); }
.s-fwd { stroke: var(--fwd); } .s-rev { stroke: var(--rev); }
.st-fwd { stop-color: var(--fwd); } .st-rev { stop-color: var(--rev); }
.st-a { stop-color: var(--grad-a); } .st-b { stop-color: var(--grad-b); }
.qe { fill: var(--re); background: var(--re); }
.q0 { fill: var(--r0); background: var(--r0); } .q1 { fill: var(--r1); background: var(--r1); } .q2 { fill: var(--r2); background: var(--r2); }
.q3 { fill: var(--r3); background: var(--r3); } .q4 { fill: var(--r4); background: var(--r4); } .q5 { fill: var(--r5); background: var(--r5); }
.overlay-msg { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); background: var(--glass-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-edge); border-radius: var(--r-pill); padding: 8px 16px; font-size: var(--fs-md); color: var(--ink-2); white-space: nowrap; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; }

/* ═══════════════ runs ═══════════════ */
.explorer { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.run-list-card { padding: 16px 8px 12px 16px; display: flex; flex-direction: column; }
.run-list-card .card-h { padding-right: 8px; }
.run-list { list-style: none; overflow-anchor: none; }
.run-day { font-family: var(--ff-body); font-size: var(--fs-sm); font-weight: 600; color: var(--copper); padding: 16px 8px 8px; position: sticky; top: 0; z-index: 1; background: linear-gradient(var(--glass-solid) 70%, transparent); }
.run-day:first-child { padding-top: 0; }
.run-row { position: relative; width: 100%; display: grid; grid-template-columns: 70px minmax(0, 1fr) 60px 72px; gap: 0 8px; align-items: baseline; text-align: left; background: transparent; border: 1px solid transparent; border-radius: var(--r-ctl); padding: 12px 8px; cursor: pointer; font-family: var(--ff-body); font-size: var(--fs-md); color: var(--ink); transition: background .2s, border-color .2s; }
.run-row:hover { background: var(--well); }
.run-row[aria-pressed="true"] { background: var(--copper-wash); border-color: color-mix(in srgb, var(--copper-2) 35%, transparent); }
.rr-time { font-family: var(--ff-mono); font-size: var(--fs-sm); color: var(--ink-2); }
.rr-dist { font-weight: 700; font-variant-numeric: tabular-nums; }
.rr-dur { font-family: var(--ff-mono); font-size: var(--fs-sm); color: var(--ink-3); text-align: right; }
.rr-top { font-family: var(--ff-mono); font-size: var(--fs-sm); text-align: right; }
.rr-top small { color: var(--ink-3); font-size: var(--fs-xs); }
.rr-bar { grid-column: 1 / -1; display: flex; gap: 0; height: 4px; margin-top: 4px; border-radius: var(--r-mark); overflow: hidden; }
.rr-bar i { display: block; height: 100%; background: var(--fwd); }
.rr-bar i.rev { background: var(--rev); }
.run-row.flagged { color: var(--ink-3); }
.run-row.flagged .rr-dist { font-weight: 500; text-decoration: line-through; text-decoration-color: var(--line-2); }
.run-row.flagged .rr-time, .run-row.flagged .rr-top { color: var(--ink-3); }
.run-row.flagged .rr-bar i { background: var(--sand-2); }
.rr-flag { grid-column: 1 / -1; order: 10; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 4px; }
.rr-flag::before { content: '✋ '; }
.rr-flag::after { content: ' · not counted'; opacity: .8; }
.flag-chip { color: var(--copper); }
.rr-sus { grid-column: 1 / -1; order: 10; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 4px; }
.rr-sus::after { content: ' · still counted'; opacity: .8; }
/* short hops (bursts below "shortest run"): grouped into one quiet line, opened on a tap */
.hop-group { width: 100%; display: grid; grid-template-columns: 70px minmax(0, 1fr) 20px; gap: 8px; align-items: baseline; text-align: left; background: transparent; border: 1px dashed var(--line-2); border-radius: var(--r-ctl); padding: 12px 8px; margin: 0; cursor: pointer; font-family: var(--ff-body); font-size: var(--fs-md); color: var(--ink-2); }
.hop-group:hover { background: var(--well); }
.hop-group small { color: var(--ink-3); margin-left: 8px; }
.hg-chev { color: var(--ink-3); text-align: right; }
.run-row.hop { font-size: var(--fs-sm); color: var(--ink-2); padding-top: 8px; padding-bottom: 8px; }
.run-row.hop .rr-dur { font-family: var(--ff-body); font-size: var(--fs-xs); color: var(--ink-3); }
.run-detail.flagged .d-stats dd { color: var(--ink-3); }
.who { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.who-txt { font-size: var(--fs-md); color: var(--ink-3); line-height: 1.5; flex: 1 1 220px; }
.who-txt b { color: var(--ink-2); }
.who-done { color: var(--copper); font-weight: 600; }
.who-err { color: var(--bad); }
.btn-quiet { background: transparent; border-style: dashed; color: var(--ink-2); font-size: var(--fs-sm); padding: 8px 12px; }
.btn-quiet:disabled { opacity: .6; cursor: default; }
.ignored-note { margin-top: 12px; font-size: var(--fs-md); color: var(--ink-3); display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; }
.ignored-note small { font-family: var(--ff-mono); font-size: var(--fs-xs); }
.ignored-note a { display: inline-block; padding: 12px 4px; margin: -12px 0; }
.ignored-note .paw-ico { font-size: var(--fs-sm); }
.list-empty, .detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 40px 16px; color: var(--ink-3); font-size: var(--fs-md); line-height: 1.55; }
.list-empty b, .detail-empty b { font-family: var(--ff-display); font-size: var(--fs-2xl); font-weight: 500; color: var(--ink); letter-spacing: -.01em; }
.detail-empty svg { width: 160px; color: var(--copper-3); margin-bottom: 8px; }
/* Bella's round portrait: a thin copper ring and a soft halo */
.portrait { display: block; flex: none; border-radius: 50%; padding: 4px; background: var(--copper-2); }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.first-art { width: 120px; margin-bottom: 16px; }
.detail-empty span { max-width: 380px; }
.more { align-self: center; margin-top: 8px; }
.run-detail { padding: 24px 24px 16px; min-height: 420px; transition: opacity .2s; }
.run-detail.loading { opacity: .55; }
.d-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 16px; }
.d-stats > div { background: var(--well); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 12px 16px; min-width: 0; }
.d-stats dt { font-family: var(--ff-body); font-size: var(--fs-sm); color: var(--ink-3); }
.d-stats dd { font-family: var(--ff-num); font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.split { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.split-bar { flex: 0 0 140px; display: flex; gap: 0; height: 8px; border-radius: var(--r-mark); overflow: hidden; }
.split-bar i { display: block; height: 100%; background: var(--fwd); }
.split-bar i.rev { background: var(--rev); }
.split-bar i[style*="width:0.0%"] { display: none; }
.split-txt { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-2); }
.trace .trace-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.trace .pass-dot { stroke: var(--paper); stroke-width: 1; }
.trace .turn { stroke: var(--rev); stroke-width: 1.2; stroke-dasharray: 2 3; opacity: .7; }
.trace .turn-lbl { font-size: var(--fs-sm); fill: var(--ink-2); }
.trace .top-dot { fill: var(--paper); stroke: var(--copper); stroke-width: 2.5; }
.trace .top-lbl { font-size: var(--fs-xs); font-weight: 500; fill: var(--copper); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.trace .xhair { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 2; }
.trace .xdot { stroke: var(--paper); stroke-width: 2; }
.trace .hit-all { cursor: crosshair; }
.caption { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 8px; line-height: 1.55; max-width: 44em; }

/* ═══════════════ rhythm ═══════════════ */
.rhythm-card { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 24px 56px; align-items: center; padding: 28px 40px 28px 28px; }
.rhythm-chart { display: flex; justify-content: center; }
.rhythm .dial { fill: var(--dial); stroke: var(--line); }
.rhythm .night { fill: rgba(43,36,32,.045); }
.rhythm .petal { fill: var(--copper-2); }
.rhythm .petal.peak { fill: var(--copper); }
.rhythm .petal.zero { fill: var(--sand-2); }
.rhythm path[data-tip]:hover { stroke: var(--ink); stroke-width: 1.5; }
.rhythm .glyph.sun { fill: none; stroke: var(--copper-2); stroke-width: 1.6; stroke-linecap: round; }
.rhythm .glyph.moon { fill: var(--ink-3); opacity: .7; }
.rhythm .c-lbl { font-family: var(--ff-body); font-size: var(--fs-xs); font-weight: 500; fill: var(--ink-3); }
.rhythm .c-big { font-family: var(--ff-num); font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.03em; fill: var(--ink); }
.rhythm .ring-lbl { font-size: var(--fs-xs); fill: var(--ink-3); paint-order: stroke; stroke: var(--paper); stroke-width: 3px; }
.rhythm-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.rhythm-side .seg { align-self: flex-start; }
.big-fact { font-family: var(--ff-display); font-size: var(--fs-2xl); line-height: 1.2; color: var(--ink); letter-spacing: -.015em; }
.big-fact b { font-weight: 600; color: var(--copper); }
.small-fact { font-size: var(--fs-md); color: var(--ink-2); margin-top: 16px; }
.share-list { list-style: none; display: grid; gap: 12px; margin-top: 16px; }
.share-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 44px; align-items: center; gap: 12px; }
.sl-n { font-size: var(--fs-md); font-weight: 600; display: flex; flex-direction: column; line-height: 1.2; }
.sl-n small { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); font-weight: 400; }
.sl-bar { height: 8px; background: var(--sand); border-radius: var(--r-pill); overflow: hidden; }
.sl-bar i { display: block; height: 100%; background: var(--copper-2); border-radius: var(--r-pill); }
.share-list b { font-family: var(--ff-mono); font-size: var(--fs-sm); font-weight: 500; text-align: right; }
.ramp-legend { display: flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--ink-3); flex-wrap: wrap; }
.ramp-legend i { width: 14px; height: 14px; border-radius: var(--r-mark); display: inline-block; }
.ramp-legend span { margin: 0 4px; }
.ramp-legend .best-key { display: inline-flex; align-items: center; gap: 8px; margin-left: 16px; }
.ramp-legend .best-key i { width: 14px; height: 14px; background: var(--r4); position: relative; }
.ramp-legend .best-key i::after { content: ''; position: absolute; inset: 4px; background: var(--paper); border-radius: 50%; }

/* ═══════════════ trends / year ═══════════════ */
.trend-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; }
.chart-card { padding: 24px 20px 12px; }
.year-card { padding: 24px 24px 16px; }
.streaks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.streaks > div { padding: 16px; min-width: 0; border-radius: var(--r-ctl); background: var(--well); border: 1px solid var(--line); }
.st-v { font-family: var(--ff-num); font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: 0; }
.cal { max-width: none; }
.cal-scroll { overflow-x: auto; overflow-y: hidden; padding: 4px 0 8px; scrollbar-width: thin; scrollbar-color: var(--sand-2) transparent; border-radius: var(--r-ctl); }
.cal .day { cursor: pointer; transition: opacity .15s; }
.cal .day:hover { stroke: var(--ink-2); stroke-width: 1.5; }
.cal .day.today { stroke: var(--copper); stroke-width: 2; }
.cal .day.sel { stroke: var(--ink); stroke-width: 2.2; }
.cal .best-dot { fill: var(--paper); }
.cal-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; margin-top: 8px; }
.cal-detail { font-size: var(--fs-base); color: var(--ink-2); min-height: 1.5em; }
.badge-best { display: inline-block; font-family: var(--ff-body); font-size: var(--fs-xs); font-weight: 600; color: var(--copper); background: var(--copper-wash); border-radius: var(--r-pill); padding: 0 8px; margin-left: 8px; }

/* ═══════════════ records ═══════════════ */
.records-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.odo-card { padding: 24px 28px 24px; overflow: hidden; }
.odometer { display: flex; align-items: flex-end; gap: 8px; margin: 16px 0 24px; font-family: var(--ff-mono); font-size: var(--fs-h2); font-weight: 500; flex-wrap: wrap; position: relative; }
.odo-d { display: inline-block; width: .74em; height: 1.24em; overflow: hidden; background: linear-gradient(180deg, #1c1714, #3a302a 50%, #1c1714); color: #f8efe3; border-radius: var(--r-ctl); box-shadow: inset 0 2px 4px rgba(0,0,0,.5); position: relative; }
.odo-d::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.4), transparent 30%, rgba(255,255,255,.06) 50%, transparent 70%, rgba(0,0,0,.4)); pointer-events: none; }
.odo-d.tenth { background: linear-gradient(180deg, #7c3f14, #c46e2e 50%, #7c3f14); }
.odo-strip { display: block; transition: transform 1.2s cubic-bezier(.16,.84,.24,1); }
.odo-strip i { display: block; height: 1.24em; line-height: 1.24em; text-align: center; font-style: normal; }
.odo-dot { color: var(--ink); line-height: 1; padding-bottom: .1em; }
.odo-unit { font-size: var(--fs-sm); color: var(--ink-3); margin-left: 8px; padding-bottom: .5em; }
.compare { list-style: none; display: grid; gap: 8px; position: relative; }
.compare li { font-family: var(--ff-display); font-size: var(--fs-xl); line-height: 1.3; color: var(--ink-2); padding-left: 28px; position: relative; letter-spacing: -.01em; }
.compare li::before { content: ''; position: absolute; left: 4px; top: .5em; width: 12px; height: 12px; border-radius: 50%; background: var(--copper-2); }
.compare li b { color: var(--copper); font-weight: 600; font-variant-numeric: lining-nums; }
.compare li.muted { font-family: var(--ff-display); font-size: var(--fs-xl); }
.compare li.muted::before { background: none; border: 2px dashed var(--copper-3); }
.life-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.life-stats dt, .periods dt { font-family: var(--ff-body); font-size: var(--fs-sm); color: var(--ink-3); }
.life-stats dd { font-size: var(--fs-base); font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.periods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 24px; }
.periods > div { background: var(--well); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 12px 16px; min-width: 0; }
.periods dd { font-family: var(--ff-num); font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.periods small { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); }
.rec-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rec { padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.rec-k { display: flex; align-items: center; gap: 8px; }
.rec-ic { width: 20px; height: 18px; flex: none; fill: none; stroke: var(--copper); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.rec-v { font-family: var(--ff-num); font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; margin: 4px 0 0; }
.rec-when { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 12px; }
.rec .btn { margin-top: auto; }
.rec.none .rec-v { color: var(--ink-3); }
.rec.none .rec-ic { stroke: var(--copper-3); }

/* ── weight ── */
.weight-card { margin-top: 16px; padding: 24px 24px 16px; }
.weight-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 28px; flex-wrap: wrap; }
.weight-v { font-family: var(--ff-num); font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -.035em; line-height: 1.08; font-variant-numeric: tabular-nums; white-space: nowrap; }
.weight-v small { font-family: var(--ff-mono); font-size: var(--fs-sm); font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.weight-sub { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); }
.weight-stats { display: flex; gap: 8px 28px; flex-wrap: wrap; }
.weight-stats dt { font-family: var(--ff-body); font-size: var(--fs-sm); color: var(--ink-3); }
.weight-stats dd { font-size: var(--fs-base); font-weight: 700; margin-top: 4px; white-space: nowrap; }
.weight-chart { margin-top: 12px; }
.weight-chart svg { display: block; overflow: visible; }
.weight-line { fill: none; stroke: var(--copper-2); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; } /* .spark-line has no rule of its own: without fill none the line filled black */

/* ── footer ── */
.foot { margin-top: 96px; padding-top: 24px; padding-bottom: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.exports { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.exports .label { margin-right: 8px; }
.foot-note { font-size: var(--fs-sm); color: var(--ink-3); }

/* ── tooltip ── */
.tip { position: absolute; z-index: 90; pointer-events: none; background: rgba(32,24,20,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #f6efe3; border: 1px solid rgba(255,230,200,.12); border-radius: var(--r-ctl); padding: 8px 12px; font-size: var(--fs-sm); line-height: 1.45; box-shadow: var(--shadow-lg); max-width: 260px; }
.tip b { display: block; color: #fff; font-weight: 650; font-size: var(--fs-md); }
.tip span { display: block; color: #e7dccc; }
.tip em { display: block; font-style: normal; font-size: var(--fs-xs); color: #eab07a; margin-top: 0; }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-mark); margin-right: 8px; }
.tip .sw.fwd { background: #e08a4f; } .tip .sw.rev { background: #6fb5ea; }

/* ── empty / loading ── */
.chart-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 32px; color: var(--ink-3); }
.chart-empty svg { width: 40px; color: var(--copper-3); }
body:not(.ready) main .card { animation: shimmer 1.6s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: .6; } }

/* wheel passthrough marker */
.wheel-mark { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); background: var(--well); border: 1px dashed var(--line-2); border-radius: var(--r-pill); padding: 8px 12px; white-space: nowrap; }
.wheel-mark b { color: var(--ink); font-weight: 600; }

/* ═══════════════ weather (public/wx.js) ═══════════════ */
.wx-now { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px auto 0; max-width: 640px; }
.wx-now li { font-size: var(--fs-sm); color: var(--ink-2); background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--r-pill); padding: 4px 12px; white-space: nowrap; }
.wx-now li b { font-family: var(--ff-num); font-weight: 700; color: var(--ink); font-size: var(--fs-sm); }
.wx-now .wx-lead span { color: var(--ink-3); font-size: var(--fs-xs); }
.wx-now .wx-in { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-edge)); cursor: help; }
.wx-now .wx-in span { color: var(--ink-3); font-size: var(--fs-xs); }
.wx-indoor-note { margin: 16px 0 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.55; max-width: 900px; }
.rr-wx { grid-column: 1 / -1; order: 9; font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-row.flagged .rr-wx { opacity: .7; }
.wx-detail { margin: 0 0 16px; }
.wx-detail .label { margin-bottom: 8px; }
.wx-detail dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.wx-detail dl > div { background: var(--well); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 8px 12px; min-width: 0; }
.wx-detail dt { font-family: var(--ff-body); font-size: var(--fs-sm); color: var(--ink-3); }
.wx-detail dd { font-size: var(--fs-md); font-weight: 600; color: var(--ink); line-height: 1.35; }
.wx-detail dd small { display: block; font-family: var(--ff-mono); font-size: var(--fs-xs); font-weight: 400; color: var(--ink-3); }
.wx-empty { padding: 24px 24px; display: grid; gap: 8px; justify-items: start; }
.wx-empty .muted-p { color: var(--ink-2); font-size: var(--fs-md); max-width: 620px; }
.wx-intro { padding: 24px 24px; display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 16px 32px; align-items: center; }
.wx-prog-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.wx-prog-h b { font-family: var(--ff-display); font-size: var(--fs-xl); font-weight: 600; }
.wx-prog-h span { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); }
.wx-bar-track { display: block; height: 8px; border-radius: var(--r-pill); background: var(--well); border: 1px solid var(--line); overflow: hidden; }
.wx-bar-track i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--copper-2); transition: width .8s var(--ease); }
.wx-sum { color: var(--ink-2); font-size: var(--fs-base); line-height: 1.6; }
.wx-pill { font-size: var(--fs-xs); font-weight: 500; border-radius: var(--r-pill); padding: 4px 8px; border: 1px solid var(--line-2); color: var(--ink-3); white-space: nowrap; }
.wx-pill.real { color: var(--copper); border-color: var(--copper-2); background: var(--copper-wash); font-weight: 600; }
.wx-pill.wait { border-style: dashed; }
.wx-sun { margin-top: 16px; padding: 24px 24px 16px; }
.wx-note { color: var(--ink-2); font-size: var(--fs-md); margin: -4px 0 12px; max-width: 760px; }
.wx-sun-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; }
.wx-sun-grid .label { margin-bottom: 0; }
.wx-sun-chart, .wx-plot { position: relative; }
.wx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.wx-card { padding: 16px 16px 16px; }
.wx-card .card-h { margin-bottom: 8px; }
.wx-card h3, .wx-sun h3 { font-size: var(--fs-lg); }
.wx-stat { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; margin-top: 4px; }
.wx-stat span { font-family: var(--ff-body); color: var(--ink-2); margin-right: 4px; }
.wx-find { font-size: var(--fs-md); color: var(--copper); font-weight: 600; margin-top: 8px; }
.wx-method { margin-top: 16px; max-width: 900px; }
.chart .wx-dot { fill: var(--fwd); fill-opacity: .72; stroke: var(--paper); stroke-width: 1.2; transition: r .2s var(--spring), fill-opacity .2s; cursor: pointer; }
.chart .wx-dot.zero { fill: var(--ink-3); fill-opacity: .45; }
.chart .wx-dot:hover { fill-opacity: 1; r: 6; }
.chart .wx-bar { fill: var(--copper-3); }
.chart .wx-bar.now { fill: var(--fwd); }

/* ═══════════════ page polish: vs usual, last night, the sensor offline, hops, focus ═══════════════ */
/* under four of today's numbers: a 14-day sparkline and how today compares with her usual */
.st-vs { display: flex; align-items: center; gap: 4px; margin-top: 4px; min-width: 0; font-family: var(--ff-mono); font-size: var(--fs-xs); line-height: 1.3; color: var(--ink-3); }
.st-vs .mini-spark { display: none; }
.st-vs-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-vs.up .st-vs-t { color: var(--ok); } .st-vs.down .st-vs-t { color: var(--copper); }
/* the last-night sentence over the strip (mornings) */
.night-line { display: flex; align-items: flex-start; gap: 8px; margin: 16px 4px 0; padding: 0 8px; font-size: var(--fs-base); line-height: 1.45; color: var(--ink-2); }
.night-line svg { flex: none; width: 18px; height: 18px; margin-top: 0; fill: none; stroke: var(--copper); stroke-width: 1.8; stroke-linejoin: round; }
.night-line + .strip { margin-top: 8px; }
/* the hero when the wheel's sensor isn't checking in: say so, never "resting" */
.off-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-right: 8px; vertical-align: 1px; }
.hero.is-offline .live-status { color: var(--bad); }
/* sensor offline on the day's chart: a hatched band */
.off-bg { fill: var(--well); }
.off-hatch { stroke: var(--ink-3); stroke-width: 1.4; opacity: .45; }
.chart .off-band { fill: url(#p-offline); }
.chart .off-edge { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; opacity: .7; }
.chart .offline { outline: none; }
.chart .offline:focus-visible .off-band { stroke: var(--copper-2); stroke-width: 2; }
.key.off { width: 12px; height: 10px; border-radius: var(--r-mark); background: repeating-linear-gradient(45deg, var(--ink-3) 0 1.4px, transparent 1.4px 5px); opacity: .7; }
/* short hops: never louder than a faint line, in the feed and the run list */
.fi-faint { padding-top: 8px; padding-bottom: 8px; }
.fi-faint .fi-ico { width: 24px; height: 24px; border-radius: var(--r-mark); margin-left: 4px; }
.fi-faint .fi-ico svg { width: 14px; height: 14px; }
.fi-faint .fi-title { font-size: var(--fs-sm); color: var(--ink-3); }
.fi-faint .fi-title b { font-weight: 600; color: var(--ink-2); }
.fi-faint .fi-time { font-size: var(--fs-xs); color: var(--ink-3); }
.fi-span { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--ink-3); }
.run-row.hop { color: var(--ink-3); }
/* the bottom tab bar slides away while you scroll down (nav.js), back on scroll up and at rest */
.dock { transition: transform .32s var(--ease), opacity .25s; }
.dock.dock-away { transform: translate(-50%, calc(100% + 24px + env(safe-area-inset-bottom, 0px))); opacity: 0; }
.dock.dock-away .dock-bar { pointer-events: none; }
/* focus you can see on everything you can reach with the keyboard */
.run-row:focus-visible, .hop-group:focus-visible { outline: 2px solid var(--copper-2); outline-offset: -2px; }
.chart .hop:focus-visible rect { stroke: var(--copper-2); stroke-width: 2; }
.seg button:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .to-top:focus-visible, .brand:focus-visible { outline: 2px solid var(--copper-2); outline-offset: 2px; }
.cal-scroll:focus-visible { outline-offset: -2px; border-radius: var(--r-ctl); }
.feed:focus-visible { outline-offset: -2px; }

/* "Show 10 more" / "Show less" under a list (expand.js) */
.list-more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin: 8px 0 0; padding: 12px 16px; border-radius: var(--r-ctl); border: 1px dashed var(--line-2); background: transparent; color: var(--ink-2); font-family: var(--ff-body); font-size: var(--fs-md); font-weight: 600; cursor: pointer; transition: background-color .2s, color .2s; }
.list-more:hover { background: var(--well); color: var(--ink); }
.list-more:focus-visible { outline: 2px solid var(--copper-2); outline-offset: 2px; }
.list-more .lm-chev { width: 8px; height: 8px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .25s var(--ease); }
.list-more.is-less .lm-chev { transform: translateY(2px) rotate(-135deg); }
.list-more .lm-n { font-family: var(--ff-mono); font-size: var(--fs-xs); font-weight: 400; color: var(--ink-3); }
.list-more + .more { margin-top: 8px; }
/* sideways chart scrollers leave vertical swipes to the page */
.cal-scroll { touch-action: pan-x pan-y; }

/* the viewer's clock isn't Bella's: one quiet line near the top, and a hint under the diary */
.tz-note { margin: 4px 4px 10px; font-family: var(--ff-mono); font-size: 11px; letter-spacing: .02em; color: var(--ink-3); }
#am-times { flex-wrap: wrap; row-gap: 6px; }
#am-times .seg { margin-left: auto; }
.bd-tz { margin-top: 6px; font-family: var(--ff-mono); font-size: 10.5px; color: var(--ink-3); }

/* ═══════════════ responsive ═══════════════ */
@media (max-width: 1100px) {
  .rhythm-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 24px; gap: 24px 32px; }
  .masthead .wm-rest { display: none; }
}
@media (max-width: 900px) {
  :root { --gutter: 20px; }
  .live-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "art" "panel" "tick"; }
  .live-panel { padding: 24px 16px 8px; }
  .hero-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .strip { grid-template-columns: minmax(0, 1fr); }
  .st-today .st-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-today .st-i:nth-child(3n+1)::before { display: none; }
  .st-today .st-i:nth-child(n+4) { padding-top: 12px; }
  .st-ever { margin-top: 4px; padding-top: 4px; }
  .st-ever::before { left: 14px; right: 12px; top: 0; bottom: auto; width: auto; height: 1px; }
  .pulse-grid { grid-template-columns: minmax(0, 1fr); }
  .sect { padding-top: 72px; }
  .sect-h { grid-template-columns: minmax(0, 1fr); }
  .sect-note { justify-self: start; text-align: left; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile-lead { grid-column: 1 / -1; }
  .explorer, .trend-grid, .records-grid { grid-template-columns: minmax(0, 1fr); }
  .rhythm-card { grid-template-columns: minmax(0, 1fr); }
  .wx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wx-intro { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .masthead .seg-units { display: none; }
  .acct-menu { left: 8px; right: 8px; width: auto; margin-left: 0; }
  .dock-bar { padding: 2px; }
  .dock-sep { margin: 12px 2px; }
  .dock-label { font-weight: 500; }
  .to-top { right: 16px; width: 44px; height: 44px; }
}
/* from 1024px: the section links sit in the masthead, which sticks to the top with a glass band
   once you scroll; the units and theme live in the Display popover; nothing floats at the bottom */
@media (min-width: 1024px) {
  :root { --dock-h: 0px; }
  .dock-wide { display: flex !important; }
  .dock-wide[hidden] { display: none !important; }
  .dock-narrow { display: none !important; }
  .masthead { position: sticky; top: 0; z-index: 60; padding-top: 12px; padding-bottom: 12px; }
  .masthead::before { content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); background: var(--glass-strong);
    backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5); border-bottom: 1px solid var(--line); opacity: 0; transition: opacity .25s; }
  .masthead:has(.dock.lifted)::before { opacity: 1; }
  .dock, .dock.dock-away { position: static; transform: none; opacity: 1; width: auto; margin: 0 auto; pointer-events: auto; }
  .dock.dock-away .dock-bar { pointer-events: auto; }
  .dock-bar { padding: 4px; border-radius: var(--r-pill); background: var(--glass); box-shadow: none; }
  .dock-bar > li:not(.dock-ind):not(.dock-sep) { flex: none; }
  .dock-item { min-height: 44px; display: inline-flex; gap: 8px; padding: 0 16px; border-radius: var(--r-pill); }
  .dock-item > svg { display: none; }
  .dock-label { font-size: var(--fs-md); }
  .dock-ind { border-radius: var(--r-pill); }
  .dock-sep { margin: 8px 4px; }
  .avatar { width: 20px; height: 20px; }
  .avatar svg { width: 18px; height: 18px; }
  .masthead .seg-units { display: none; }
  .masthead .top-right { margin-left: 0; }
  .acct-menu { top: 72px; bottom: auto; left: auto; right: max(var(--gutter), calc((100vw - 1240px) / 2 + var(--gutter))); margin-left: 0; }
  main section[id] { scroll-margin-top: 80px; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .dock-item { padding: 0 12px; }
  .masthead .link-chip span { display: none; }
  .masthead .link-chip { padding: 12px; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; --r-panel: 24px; }
  .masthead { gap: 8px; padding-top: 16px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-name { font-size: var(--fs-xl); }
  .top-right { gap: 8px; }
  .link-chip span { display: none; }
  .link-chip { padding: 8px; }
  .icon-btn { width: 44px; height: 44px; }
  .wheel-mark { padding: 4px 8px; font-size: var(--fs-xs); }
  .wheel-mark .wm-rest, .wheel-mark .wm-w { display: none; }
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-3xl); }
  .hero { padding-top: 4px; }
  .hero-head { margin-bottom: 16px; }
  .hero-head h1 { font-size: clamp(36px, 11vw, 44px); }
  .hero-eyebrow { margin-bottom: 8px; padding: 4px 12px 4px 8px; }
  .hero-sub { font-size: var(--fs-base); line-height: 1.45; margin-top: 8px; }
  .live-status { top: 8px; left: 8px; font-size: var(--fs-xs); padding: 4px 8px; }
  .demo-chip { font-size: var(--fs-xs); padding: 4px 8px; margin: 0; }
  .live-panel { padding: 16px 8px 4px; gap: 12px; }
  .gait-label { font-size: var(--fs-xl); }
  .gait-meter i { min-width: 44px; height: 24px; }
  .ticker-wrap { padding: 8px 4px 0; }
  .ticker-host { height: 56px; }
  .strip { padding: 4px; gap: 0; }
  .st-today .st-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-i, .st-today .st-i, .st-today .st-i:nth-child(n+4) { padding: 8px 8px 8px 12px; }
  .st-today .st-i:nth-child(-n+2) { padding-top: 8px; }
  .st-eb { padding: 8px 8px 0 12px; }
  .st-i::before { display: none; }
  .st-i:nth-child(even)::before { display: block !important; }
  .st-today .st-i:nth-child(n+3) { border-top: 1px solid var(--line); border-radius: 0; }
  .st-ever { margin-top: 0; padding-top: 0; }
  .st-ever::before { left: 12px; right: 12px; }
  /* phones: top speed and wheel turns repeat the live card's last-run numbers, so the strip keeps four */
  .st-i[data-k="top"], .st-i[data-k="laps"] { display: none; }
  .st-n b { font-size: var(--fs-xl); }
  .night-line { font-size: var(--fs-md); margin: 12px 0 0; padding: 0 4px; }
  .feed-card { padding: 16px 8px 8px 12px; }
  .fi { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 0 8px; }
  .fi-ico { width: 28px; height: 28px; }
  .fi-title { font-size: var(--fs-md); }
  .day-facts { grid-template-columns: minmax(0, 1fr); }
  .speed-num { font-size: 80px; }
  .speed-unit b { font-size: var(--fs-lg); }
  .speed-unit small { font-size: var(--fs-xs); }
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hero-stats > div { padding: 8px; }
  .hero-stats dt { font-size: var(--fs-xs); }
  .hero-stats dd { font-size: var(--fs-lg); }
  #hs-dir { font-size: var(--fs-sm); }
  .tiles { gap: 8px; }
  .tile { padding: 16px 12px; }
  .tile-v { font-size: var(--fs-xl); }
  .tile-lead { padding: 16px; }
  .tile-lead .tile-v { font-size: var(--fs-3xl); }
  .tiles .cmp { font-size: var(--fs-xs); gap: 4px; align-items: flex-start; }
  .cmp-ico { margin-top: 0; }
  .timeline-card, .chart-card, .year-card, .run-detail { padding: 16px 16px 12px; }
  .run-list-card { padding: 16px 8px 8px 8px; }
  .run-row { grid-template-columns: 64px minmax(0, 1fr) 52px 64px; padding: 12px 8px; font-size: var(--fs-md); gap: 0 8px; }
  .d-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-stats dd { font-size: var(--fs-xl); }
  .rhythm-card { padding: 16px 16px 20px; }
  .big-fact { font-size: var(--fs-xl); }
  .share-list li { grid-template-columns: 96px minmax(0, 1fr) 40px; gap: 8px; }
  .streaks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .streaks > div { padding: 12px; }
  .st-v { font-size: var(--fs-2xl); }
  .odo-card { padding: 20px 16px; }
  .odometer { font-size: var(--fs-3xl); gap: 4px; }
  .compare li { font-size: var(--fs-lg); }
  .life-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .periods { grid-template-columns: minmax(0, 1fr); }
  .periods > div { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .rec-cards { gap: 8px; }
  .rec { padding: 16px; }
  .rec-v { font-size: var(--fs-2xl); }
  .weight-card { padding: 16px 16px 12px; }
  .wx-now { margin-top: 8px; gap: 4px; }
  .wx-now .wx-opt { display: none; }
  .wx-now li { font-size: var(--fs-xs); padding: 4px 8px; }
  .wx-detail dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wx-grid, .wx-sun-grid { grid-template-columns: minmax(0, 1fr); }
  .wx-intro, .wx-empty { padding: 16px 16px; }
  .wx-sun, .wx-card { padding: 16px 16px 12px; }
  .foot { margin-top: 64px; padding-right: 56px; }
  .overlay-msg { white-space: normal; text-align: center; border-radius: var(--r-ctl); width: max-content; max-width: calc(100% - 24px); font-size: var(--fs-sm); line-height: 1.4; }
  .card { backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); }
}

/* ═══════════════ short screens: the whole live card above the fold ═══════════════
   On a laptop (wide but short: about 620-1000 px tall once tabs and bookmarks take their share)
   the centred headline and the card's stacked ticker pushed the run's numbers and the pass-by-pass
   chart under the dock. Here the heading folds into one line over the card's left edge, the
   painting's height follows the viewport (--stage-h; its width follows at the clips' 1600:894),
   and the ticker moves into the right column under the stats, so the card ends above the dock. */
@media (min-width: 901px) and (max-height: 1000px) {
  :root { --stage-h: clamp(300px, calc(100vh - 254px), 400px); }
  .masthead { padding-top: 16px; padding-bottom: 4px; }
  .hero { padding-top: 8px; }
  .hero-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; max-width: none; margin: 0 0 16px; padding: 0 8px; text-align: left; }
  .hero-eyebrow { margin: 0; flex: none; }
  .hero-head h1 { flex: none; font-size: clamp(36px, 6.2vh, 54px); }
  .hero-sub { flex: 1 1 280px; max-width: 640px; margin: 0; font-size: var(--fs-base); line-height: 1.4; min-height: 0; }
  .live-card { grid-template-columns: minmax(0, min(calc(var(--stage-h) * 1600 / 894), 58%)) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "art panel" "art tick"; }
  .live-panel { gap: 12px; padding: 8px 16px 4px 24px; }
  .speed-num { font-size: clamp(60px, 10vh, 100px); }
  .ticker-wrap { padding: 8px 4px 4px 24px; }
  .ticker-host { height: 64px; }
  .hero-stats > div { padding: 8px 12px 8px; }
  .wx-now { flex: 1 1 100%; justify-content: flex-start; max-width: none; margin: 0 0 0; }
  :root:has(#wx-now:not([hidden])) { --stage-h: clamp(300px, calc(100vh - 286px), 400px); }
}

/* ═══════════════ reduced motion: everything still, everything visible ═══════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ring.pending .rg-v { stroke-dashoffset: var(--off); }
}
html.rm *, html.rm *::before, html.rm *::after { animation: none !important; transition: none !important; }
html.rm .ring.pending .rg-v { stroke-dashoffset: var(--off); }
