/* LiftBeats styles. Tokens first, then base, then components, then page-specific bits.
   See DESIGN.md. Pages compose components from ui.js; they don't set their own sizes or colors. */

/* Fonts are self-hosted: copy them into /fonts/ (see README). Falls back to the system font. */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/bricolage-grotesque-v9-latin-300.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/bricolage-grotesque-v9-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/bricolage-grotesque-v9-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/bricolage-grotesque-v9-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/bricolage-grotesque-v9-latin-800.woff2') format('woff2'); }

@property --base { syntax: '<color>'; inherits: true; initial-value: #0E1226; }
@property --orbA { syntax: '<color>'; inherits: true; initial-value: #3B4A8F; }
@property --orbB { syntax: '<color>'; inherits: true; initial-value: #6B4E8F; }

/* ---------- tokens ---------- */
:root {
  /* color */
  --base: #0E1226;            /* the sky base, set per need */
  --orbA: #3B4A8F;
  --orbB: #6B4E8F;
  --orb-opacity: 0.55;
  --bg: #0E1226;
  --bg-deep: #070A18;
  --surface-1: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.55);
  --text: #FFFFFF;
  --text-2: #DCE0EE;
  --text-3: #AEB4C8;
  --accent: #FFFFFF;
  --on-accent: #10142A;
  --warm: #FFE2B8;
  --warm-surface: rgba(255, 226, 184, 0.10);
  --warm-line: rgba(255, 226, 184, 0.55);
  --danger: #FFB4A8;
  --good: #62E3A6;
  --mid: #F4C95A;
  --low: #F08A6E;
  --sheet: #1A1F3A;

  /* type */
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 34px;
  --fs-num: 44px;
  --fs-hero: 56px;
  --lh-tight: 1.05;
  --lh-snug: 1.25;
  --lh-body: 1.45;

  /* space (4-point) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --gutter: var(--sp-6);

  /* shape */
  --r-pill: 999px;
  --r-md: 16px;
  --r-lg: 22px;
  --h-btn: 56px;
  --h-chip: 44px;
  --h-row: 56px;
  --h-choice: 64px;
  --tap: 44px;

  /* motion */
  --dur-fast: 150ms;
  --dur: 250ms;
  --dur-slow: 400ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; touch-action: manipulation; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--base);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: --base var(--dur-slow) ease, --orbA var(--dur-slow) ease, --orbB var(--dur-slow) ease;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; border-radius: 4px; }
h1[tabindex="-1"]:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- sky ---------- */
.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.sky .orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: var(--orb-opacity); transition: opacity var(--dur-slow) ease; }
.sky .a { width: 380px; height: 380px; left: -140px; top: -90px; background: var(--orbA); animation: drift 16s ease-in-out infinite; }
.sky .b { width: 330px; height: 330px; right: -150px; bottom: 80px; background: var(--orbB); animation: drift 20s ease-in-out infinite reverse; }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(18px, -14px); } }

/* ---------- layout ---------- */
#app { position: relative; z-index: 1; min-height: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; padding: calc(var(--sp-5) + var(--safe-top)) var(--gutter) calc(var(--sp-6) + var(--safe-bottom)); animation: enter var(--dur-slow) var(--ease) both; }
.screen.has-nav { padding-bottom: calc(100px + var(--safe-bottom)); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.stack { display: flex; flex-direction: column; gap: var(--sp-2); }
.stack-lg { display: flex; flex-direction: column; gap: var(--sp-6); }
.spacer { flex: 1; min-height: var(--sp-6); }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.center { text-align: center; }

/* ---------- type components ---------- */
.eyebrow { margin: 0; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.title { margin: 0; font-size: var(--fs-3xl); line-height: var(--lh-tight); font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.lede { margin: 0; font-size: var(--fs-md); line-height: var(--lh-body); color: var(--text-2); }
.meta { margin: 0; font-size: var(--fs-sm); line-height: var(--lh-body); color: var(--text-3); }
.heading { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-6); }
.section { margin: 0 0 var(--sp-3); font-size: var(--fs-md); font-weight: 700; color: var(--text); display: flex; align-items: baseline; gap: var(--sp-2); }
.section .meta { font-weight: 400; }
.block { margin-top: var(--sp-6); }
.heading + .block { margin-top: 0; }

/* ---------- topbar ---------- */
.topbar { display: grid; grid-template-columns: var(--tap) 1fr var(--tap); align-items: center; height: var(--tap); margin: 0 calc(-1 * var(--sp-3)) var(--sp-4); }
.topbar .mid { display: flex; justify-content: center; font-size: var(--fs-sm); color: var(--text-2); }
.icon-btn { width: var(--tap); height: var(--tap); border: none; background: transparent; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-pill); color: var(--text); transition: background var(--dur-fast) ease; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn[disabled] { opacity: 0.3; cursor: default; }
.dots { display: flex; gap: 6px; }
.dots i { display: block; height: 6px; width: 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.28); transition: width var(--dur) var(--ease), background var(--dur) ease; }
.dots i.done { background: rgba(255, 255, 255, 0.75); }
.dots i.now { width: 22px; background: var(--text); }

/* ---------- buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); width: 100%; min-height: var(--h-btn); padding: 0 var(--sp-6); border: none; border-radius: var(--r-pill); font-size: var(--fs-lg); font-weight: 700; text-decoration: none; text-align: center; transition: transform var(--dur-fast) ease, background var(--dur-fast) ease; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); font-size: var(--fs-md); }
.btn[disabled] { background: var(--surface-2); color: var(--text-3); border: none; cursor: default; transform: none; }
.link { min-height: var(--tap); padding: 0 var(--sp-1); border: none; background: transparent; font-size: var(--fs-md); font-weight: 600; color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link.soft { font-weight: 400; color: var(--text-2); text-decoration: none; }
.actions { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-4); }
.actions .links { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); }
.actions .links.one { justify-content: center; }

/* ---------- choices ---------- */
.choice { display: flex; align-items: center; gap: var(--sp-4); width: 100%; min-height: var(--h-choice); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface-2); text-align: left; transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease; }
.choice:active { background: var(--surface-3); }
.choice[aria-pressed="true"] { border-color: var(--text); background: var(--surface-3); }
.choice svg { flex: none; }
.choice .t { display: flex; flex-direction: column; gap: 2px; }
.choice .t b { font-size: var(--fs-lg); font-weight: 700; line-height: var(--lh-snug); }
.choice .t span { font-size: var(--fs-sm); color: var(--text-2); line-height: var(--lh-snug); }
.choice.centered { justify-content: center; }

/* ---------- chips and tiles ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { min-height: var(--h-chip); padding: 0 var(--sp-4); border-radius: var(--r-pill); border: 2px solid var(--line); background: var(--surface-2); font-size: var(--fs-md); font-weight: 600; transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease; }
.chip[aria-pressed="true"] { border-color: var(--text); background: var(--surface-3); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.tile { min-height: 72px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tile[aria-pressed="true"] { border-color: var(--text); background: var(--surface-3); }
.tile b { font-size: var(--fs-xl); font-weight: 800; line-height: 1; }
.tile span { font-size: var(--fs-xs); color: var(--text-2); }
.seg { display: inline-grid; grid-auto-flow: column; gap: var(--sp-1); padding: var(--sp-1); border-radius: var(--r-pill); background: var(--surface-2); }
.seg button { min-height: 36px; min-width: 52px; padding: 0 var(--sp-3); border: none; border-radius: var(--r-pill); background: transparent; font-size: var(--fs-sm); font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* ---------- cards ---------- */
.card { display: block; padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg); background: var(--surface-1); border: 1px solid var(--line); text-decoration: none; }
.card.warm { background: var(--warm-surface); border: 2px solid var(--warm-line); }
.card .kicker { margin: 0 0 var(--sp-1); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warm); }
.card .head { margin: 0 0 var(--sp-1); font-size: var(--fs-xl); font-weight: 800; line-height: var(--lh-snug); }
.card .body { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }

/* ---------- rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.row { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--h-row); padding: var(--sp-2) var(--sp-4) var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); text-align: left; color: var(--text); }
button.row:active { background: var(--surface-3); }
.row .lead { width: 28px; height: 28px; flex: none; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: 700; }
.row .name { flex: 1; min-width: 0; font-size: var(--fs-md); font-weight: 600; line-height: var(--lh-snug); }
.row .val { flex: none; font-size: var(--fs-sm); color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.row.done .lead { background: var(--text); border-color: var(--text); color: var(--on-accent); }
.row.done .name { color: var(--text-2); }
.row.muted { opacity: 0.55; }

/* ---------- settings groups ---------- */
.group { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-1); border: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--h-row); padding: var(--sp-3) var(--sp-4); border: none; border-top: 1px solid var(--line); background: transparent; text-align: left; font-size: var(--fs-md); text-decoration: none; color: var(--text); }
.item:first-child { border-top: none; }
.item .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item .txt small { font-size: var(--fs-sm); color: var(--text-3); }
.item.danger { color: var(--danger); }
button.item:active, a.item:active, label.item:active { background: var(--surface-2); }

/* ---------- stepper ---------- */
.stepper { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 64px; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; }
.stepper .ctl { display: inline-flex; align-items: center; gap: var(--sp-1); }
.stepper .ctl b { min-width: 84px; text-align: center; font-size: var(--fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.stepper .icon-btn { border: 2px solid var(--line); font-size: var(--fs-xl); line-height: 1; }

/* ---------- tip, toast, sheet ---------- */
.tip { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-2) var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.tip p { flex: 1; margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.tip .ic { color: var(--warm); padding-top: 2px; }
.tip .icon-btn, .tip .link { margin: calc(-1 * var(--sp-2)) 0; }
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-bottom)); transform: translateX(-50%); z-index: 20; max-width: calc(100vw - 2 * var(--gutter)); padding: var(--sp-3) var(--sp-5); border-radius: var(--r-md); background: var(--accent); color: var(--on-accent); font-size: var(--fs-md); font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); animation: enter var(--dur) var(--ease) both; }
.sheet-wrap { position: fixed; inset: 0; z-index: 30; background: rgba(4, 6, 18, 0.6); display: flex; align-items: flex-end; justify-content: center; animation: fade var(--dur) ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: 100%; max-width: 480px; padding: var(--sp-6) var(--gutter) calc(var(--sp-5) + var(--safe-bottom)); border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--sheet); display: flex; flex-direction: column; gap: var(--sp-2); animation: enter var(--dur) var(--ease) both; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4); }
.sheet p { margin: 0 0 var(--sp-3); font-size: var(--fs-lg); line-height: var(--lh-body); }
.banner { position: relative; z-index: 6; display: flex; align-items: center; gap: var(--sp-3); padding: calc(var(--sp-3) + var(--safe-top)) var(--sp-4) var(--sp-3); background: var(--warm); color: var(--on-accent); font-size: var(--fs-sm); font-weight: 600; }
.banner p { flex: 1; margin: 0; }
.banner .icon-btn { color: var(--on-accent); }

/* ---------- navigation ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 480px; margin: 0 auto; padding: var(--sp-2) var(--sp-3) calc(var(--sp-3) + var(--safe-bottom)); border-top: 1px solid var(--line); background: rgba(10, 13, 30, 0.75); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); min-height: var(--tap); padding: var(--sp-1) 0; color: var(--text-3); text-decoration: none; font-size: var(--fs-xs); font-weight: 600; }
.nav a[aria-current="page"] { color: var(--text); font-weight: 700; }

/* ---------- pages ---------- */
/* Today */
.date { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-1); text-align: center; margin-top: var(--sp-3); }
.week .d { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.week .d span { font-size: var(--fs-xs); color: var(--text-3); }
.week .d.today span { color: var(--text); font-weight: 700; }
.slot { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.dot { width: 5px; height: 5px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.3); }
.dot.later { background: rgba(255, 255, 255, 0.12); }
.ring { width: 14px; height: 14px; border-radius: var(--r-pill); border: 2px solid var(--text); animation: twinkle 2s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.start-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 180px; padding: var(--sp-4) 0; }
.start { width: 148px; height: 148px; border-radius: 50%; border: none; background: var(--accent); color: var(--on-accent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; animation: breathe 3s ease-in-out infinite; }
.start b { font-size: var(--fs-2xl); font-weight: 800; line-height: 1; }
.start span { font-size: var(--fs-xs); font-weight: 700; color: #3A4060; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); } 50% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); } }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.shortcut { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; min-height: var(--h-choice); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); text-align: left; }
.shortcut b { font-size: var(--fs-md); }
.shortcut span { font-size: var(--fs-xs); color: var(--text-2); }
.shortcut[disabled] { opacity: 0.45; cursor: default; }

/* Check-in */
.battery-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: var(--sp-6); }
.battery { display: flex; align-items: center; gap: 6px; }
.battery .shell { width: 280px; max-width: 72vw; height: 128px; border: 3px solid var(--text); border-radius: 26px; padding: var(--sp-2); display: flex; }
.battery .fill { height: 100%; border-radius: var(--r-md); transition: width 120ms linear, background-color var(--dur) ease; }
.battery .nub { width: 10px; height: 44px; border-radius: 0 6px 6px 0; background: var(--text); }
.energy-word { margin: 0; font-size: var(--fs-2xl); font-weight: 700; }
input[type=range] { width: 100%; height: var(--tap); margin: 0; accent-color: var(--text); }
.agree { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); border-radius: var(--r-md); background: var(--surface-1); border: 2px solid transparent; cursor: pointer; transition: background var(--dur) ease, border-color var(--dur) ease; }
.agree.nudge { background: var(--surface-3); border-color: var(--low); }
.agree input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--text); }
.agree span { font-size: var(--fs-sm); color: var(--text-2); }
.agree a { color: var(--text); }

/* Session */
.figure-box { margin: 0 calc(-1 * var(--sp-3)) var(--sp-2); aspect-ratio: 300 / 262; max-height: 24vh; display: flex; justify-content: center; }
.detail-foot { display: flex; justify-content: flex-end; margin-top: var(--sp-2); }
.fig-wrap { position: relative; }
.cue { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-3xl); font-weight: 800; opacity: 0; pointer-events: none; }
.cue span { display: flex; align-items: center; justify-content: center; width: 112px; height: 112px; border-radius: 50%; background: rgba(10, 13, 30, .72); border: 2px solid rgba(255, 255, 255, .3); }
.cue.on { opacity: 1; }
.cue.pulse { animation: cue 450ms var(--ease) both; }
@keyframes cue { from { transform: scale(1.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.count-wrap.tiny { width: 64px; height: 64px; margin: 0; flex: none; }
.count-wrap.tiny .count-in b { font-size: var(--fs-lg); }
.count-wrap.tiny .count-in span { display: none; }
.upnext { margin-bottom: var(--sp-4); }
.stepper .wval { min-width: 104px; min-height: var(--tap); padding: 0 var(--sp-2); border: none; border-radius: var(--r-md); background: transparent; }
.stepper .wval b { font-size: var(--fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--warm); text-decoration: underline dotted rgba(255, 226, 184, .5); text-underline-offset: 6px; }
.wnote { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-1); }
.wnote .link { min-height: 32px; font-size: var(--fs-sm); color: var(--warm); }
.wnote.up { color: var(--text-2); }
.sheet.pick { gap: var(--sp-3); max-height: 88vh; overflow-y: auto; }
.sheet .pick-total { margin: 0; text-align: center; font-size: var(--fs-num); font-weight: 800; color: var(--warm); }
svg.bar { width: 100%; height: auto; }
svg.bar .shaft { stroke: var(--text-2); stroke-width: 6; stroke-linecap: round; }
svg.bar .collar { stroke: var(--text); stroke-width: 6; stroke-linecap: round; }
svg.bar rect { fill: var(--warm); }
.chips.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chips.grid .chip, .chips.plates .chip { padding: 0 var(--sp-2); font-variant-numeric: tabular-nums; }
.sheet-wrap.still, .sheet-wrap.still .sheet, #app.same .screen { animation: none; }
.upnext-list { list-style: none; margin: var(--sp-2) 0 0; padding: 0; }
.upnext-list li { display: flex; gap: var(--sp-3); padding: var(--sp-2) 0; border-top: 1px solid rgba(255, 226, 184, .2); font-size: var(--fs-sm); }
.upnext-list .name { flex: 1; font-weight: 600; }
.upnext-list .val { color: var(--warm); font-variant-numeric: tabular-nums; }
/* iPhone home-screen apps place a fixed nav too high on pages that don't scroll; pages with the nav always scroll by a hair. */
#app:has(.nav) { min-height: calc(100% + 1px); }
.groove { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin: 0 0 var(--sp-2); }
.groove-name { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tempo { display: inline-flex; align-items: center; flex: none; border-radius: var(--r-pill); background: var(--surface-2); }
.tempo b { min-width: 64px; text-align: center; font-size: var(--fs-md); }
.tempo small { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); }
.figure { height: 100%; width: auto; max-width: 100%; overflow: visible; }
.fig-ground { stroke: rgba(255, 255, 255, 0.25); stroke-width: 2; stroke-linecap: round; }
.fig-quiet path { fill: none; stroke: rgba(255, 255, 255, 0.4); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.fig-ghost path, .fig-ghost circle { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.fig-back path { fill: none; stroke: rgba(255, 255, 255, 0.45); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.fig-body path { fill: none; stroke: var(--text); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4)); }
.fig-props path { fill: none; stroke: var(--warm); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.target { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.target .meta { font-size: var(--fs-md); color: var(--text-2); }
.target b { font-size: var(--fs-num); line-height: var(--lh-tight); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.setdots { display: inline-flex; gap: 6px; }
.setdots i { display: block; width: 12px; height: 12px; border-radius: var(--r-pill); border: 2px solid var(--line-strong); }
.setdots i.on { background: var(--text); border-color: var(--text); }
.howto { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line); }
.howto summary { cursor: pointer; font-weight: 700; font-size: var(--fs-sm); min-height: 28px; display: flex; align-items: center; }
.howto ol { margin: var(--sp-2) 0 var(--sp-1); padding-left: var(--sp-5); }
.howto li { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--sp-2); }
.count-wrap { position: relative; width: 200px; height: 200px; margin: var(--sp-4) auto; }
.count-wrap.small { width: 150px; height: 150px; margin: var(--sp-2) auto; }
.count-wrap svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.count-wrap .track { fill: none; stroke: rgba(255, 255, 255, 0.15); stroke-width: 6; }
.count-wrap .bar { fill: none; stroke: var(--text); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 250ms linear; }
.count-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.count-in b { font-size: var(--fs-hero); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.count-wrap.small .count-in b { font-size: var(--fs-num); }
.count-in span { font-size: var(--fs-xs); color: var(--text-2); }
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--sp-3); }
.hero .title { margin-top: var(--sp-2); }
.pop { animation: pop 700ms cubic-bezier(0.2, 1.2, 0.4, 1) both; }
@keyframes pop { from { transform: scale(0.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* Your sky */
body.deep { --base: var(--bg-deep); }
.night { padding: var(--sp-3) var(--sp-2) var(--sp-2); border-radius: var(--r-lg); background: rgba(4, 6, 18, 0.55); border: 1px solid var(--line); }
.night .head { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--sp-1) var(--sp-2); }
.night .head p { margin: 0; font-size: var(--fs-md); font-weight: 700; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal .dow { text-align: center; font-size: var(--fs-xs); color: var(--text-3); padding-bottom: 2px; }
.cal .cell { height: 44px; display: flex; align-items: center; justify-content: center; }
.cal .star { width: var(--tap); height: var(--tap); border: none; border-radius: var(--r-md); background: transparent; display: flex; align-items: center; justify-content: center; }
.cal .star[aria-pressed="true"] { background: var(--surface-3); outline: 2px solid var(--line-strong); }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: var(--sp-3) var(--sp-1) 0; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); }
.legend i { width: 9px; height: 9px; border-radius: var(--r-pill); display: block; }
.need-name { margin: 2px 0 0; font-size: var(--fs-lg); font-weight: 800; display: flex; align-items: center; gap: var(--sp-2); }
.need-name i { width: 10px; height: 10px; border-radius: var(--r-pill); display: block; }
.detail ul { list-style: none; margin: var(--sp-3) 0 0; padding: 0; }
.detail li { display: flex; gap: var(--sp-3); padding: var(--sp-2) 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.detail li .name { flex: 1; font-weight: 600; }
.detail li .val { color: var(--text-2); font-variant-numeric: tabular-nums; }
.detail li.muted { opacity: 0.5; }

/* Docs */
.doc h2 { margin: var(--sp-6) 0 var(--sp-2); font-size: var(--fs-lg); }
.doc p { margin: 0 0 var(--sp-3); font-size: var(--fs-md); color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.sheet.pick p.meta { margin: 0; font-size: var(--fs-sm); }
