/* FORM v0.2: night session. See DESIGN.md. Single committed dark world. */
@property --band { syntax: "<color>"; inherits: true; initial-value: #8A93A3; }

:root {
  color-scheme: dark;
  --bg: #0B0D11;
  --surface: #14171D;
  --raised: #1B1F27;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .14);
  --text: #F4F5F7;
  --text-2: #A3ABB8;
  --text-3: #7C8594;
  --ink: #0B0D11;
  --white: #F4F5F7;
  --green: #5BE49B;
  --amber: #FFB547;
  --red: #FF6B6B;
  --none: #8A93A3;
  --band: #8A93A3;
  --band-12: color-mix(in srgb, var(--band) 12%, transparent);
  --band-20: color-mix(in srgb, var(--band) 20%, transparent);
  --band-40: color-mix(in srgb, var(--band) 40%, transparent);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --r: 20px;
  --r-sm: 14px;
  --dock-h: 64px;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  accent-color: var(--band);
  caret-color: var(--band);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
::selection { background: var(--band-40); color: var(--text); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { display: block; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 18px; height: 18px; }

/* the light */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(120% 58% at 50% -14%, var(--band-40), transparent 64%); transition: --band 700ms ease; }
html[data-night="1"] .ambient { opacity: .6; }
.ambient::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 40% at 50% 110%, rgba(255, 255, 255, .025), transparent 60%); }

#app { position: relative; z-index: 1; max-width: 430px; margin: 0 auto; min-height: 100dvh; padding-top: env(safe-area-inset-top, 0px); }
#view { position: relative; display: grid; }
.page { grid-area: 1 / 1; padding: 12px 16px calc(var(--dock-h) + 40px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 22px; align-content: start; transition: opacity 360ms var(--ease-out), transform 360ms var(--ease-out); }
.page.onboard { min-height: 100dvh; align-content: center; padding-bottom: 32px; gap: 22px; }
.page-in-right { opacity: 0; transform: translateX(28px); }
.page-in-left { opacity: 0; transform: translateX(-28px); }
.page-out-left, .page-out-right { position: absolute; left: 0; right: 0; top: 0; opacity: 0; pointer-events: none; transition-duration: 160ms; transition-timing-function: var(--ease-in); }
.page-out-left { transform: translateX(-18px); }
.page-out-right { transform: translateX(18px); }
.page > * { animation: rise 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* type */
.h1 { font-weight: 600; font-size: 26px; line-height: 1.15; letter-spacing: -.01em; }
.h2 { font-weight: 600; font-size: 19px; line-height: 1.25; }
.sub { color: var(--text-2); }
.small { color: var(--text-3); font-size: 13px; }
.disp { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; line-height: .95; }
.num { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; line-height: 1; }
.fine { color: var(--text-3); font-size: 13px; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: 0 14px 30px -22px rgba(0, 0, 0, .7); display: grid; gap: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rows { display: grid; }
.row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; min-height: 62px; padding: 8px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.tile { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--band-12); color: var(--band); transition: background-color 400ms ease, color 400ms ease; }

/* controls */
.btn { min-height: 50px; padding: 0 20px; border-radius: 15px; border: 1px solid transparent; background: var(--raised); color: var(--text); font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform 120ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, opacity 150ms ease; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--white); color: var(--ink); }
.btn.primary:active { background: #E3E6EA; }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 6px 0; min-height: 44px; color: var(--band); font-weight: 600; font-size: 14px; transition: color 400ms ease; }
:is(.btn, .chip, .tick, .rowbtn, .link, .dock button, .seg button, .option, .hold, details summary):focus-visible { outline: 2px solid var(--band); outline-offset: 3px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.row-btns > .btn { flex: 1 1 140px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-weight: 500; font-size: 15px; display: inline-flex; align-items: center; transition: transform 120ms var(--ease-out), border-color 150ms ease, background-color 150ms ease, color 150ms ease; }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { border-color: var(--band); background: var(--band-20); color: var(--text); }
.chips.static .chip { min-height: 34px; font-size: 13px; padding: 0 12px; pointer-events: none; border-color: var(--line); color: var(--text-2); }
.input { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg); color: var(--text); transition: border-color 150ms ease, box-shadow 150ms ease; }
.input::placeholder { color: var(--text-3); }
.input:focus-visible { outline: none; border-color: var(--band); box-shadow: 0 0 0 4px var(--band-20); }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.45; }
select.input { appearance: none; -webkit-appearance: none; }
.field { display: grid; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.seg.two { grid-template-columns: 1fr 1fr; }
.seg.three { grid-template-columns: 1fr 1fr 1fr; }
.seg button { min-height: 56px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: transparent; color: var(--text); display: grid; justify-items: center; align-content: center; gap: 2px; padding: 6px 4px; transition: transform 120ms var(--ease-out), border-color 150ms ease, background-color 150ms ease; }
.seg button:active { transform: scale(.96); }
.seg button .num { font-size: 24px; }
.seg button small { font-weight: 500; font-size: 11px; color: var(--text-3); }
.seg button[aria-pressed="true"] { border-color: var(--band); background: var(--band-20); }
.seg button[aria-pressed="true"] small { color: var(--text); }
.options { display: grid; gap: 10px; }
.option { text-align: left; min-height: 64px; padding: 12px 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: transparent; color: var(--text); display: grid; gap: 2px; transition: transform 120ms var(--ease-out), border-color 150ms ease, background-color 150ms ease; }
.option:active { transform: scale(.98); }
.option[aria-pressed="true"] { border-color: var(--band); background: var(--band-20); }
.option small { color: var(--text-2); font-size: 13px; }
.option span { font-weight: 600; }

/* onboarding */
.wm { font-family: var(--display); font-weight: 700; font-size: 84px; letter-spacing: .06em; line-height: .9; display: flex; }
.wm i { font-style: normal; display: inline-block; animation: letter 800ms var(--ease-out) both; animation-delay: calc(var(--i) * 80ms); }
@keyframes letter { from { opacity: 0; transform: translateY(18px); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
.tag { font-size: 20px; color: var(--text-2); margin-top: 10px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 28px; height: 3px; border-radius: 2px; background: var(--line-2); transition: background-color 300ms ease; }
.dots i.on { background: var(--band); }

/* today hero */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.streak { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.streak .num { font-size: 22px; color: var(--band); transition: color 400ms ease; }
.streak .icon { color: var(--band); animation: flicker 1.1s ease-in-out 1; transition: color 400ms ease; }
.streak.pop { animation: streakpop 900ms var(--ease-out) 1; border-color: var(--band); }
@keyframes streakpop { 0% { transform: scale(1); } 35% { transform: scale(1.12); box-shadow: 0 0 0 8px var(--band-20); } 100% { transform: scale(1); } }
.stat .spark { margin-top: 6px; }
@keyframes flicker { 0%, 100% { transform: none; } 30% { transform: scale(1.12) rotate(-4deg); } 60% { transform: scale(.96) rotate(3deg); } }
.hero { display: grid; gap: 14px; padding: 6px 0 2px; }
.hero-ask .disp { font-size: 38px; }
.hero-band { display: grid; grid-template-columns: 124px 1fr; gap: 18px; align-items: center; }
.ringwrap { position: relative; width: 124px; height: 124px; }
.ring { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--line-2); stroke-width: 8; }
.ring-arc { fill: none; stroke: var(--band); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: calc(326.7 * (1 - var(--p, 0))); transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 900ms var(--ease-out), stroke 600ms ease; filter: drop-shadow(0 0 6px var(--band-40)); }
.hero.done .ring-arc { animation: ringpulse 700ms var(--ease-out) 1; }
@keyframes ringpulse { 0% { filter: drop-shadow(0 0 6px var(--band-40)); } 40% { filter: drop-shadow(0 0 18px var(--band)); } 100% { filter: drop-shadow(0 0 6px var(--band-40)); } }
.ring-mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 0; }
.ring-mid .num { font-size: 40px; }
.ring-mid .small { margin-top: 2px; }
button.streak { cursor: pointer; font: inherit; }
button.band-word { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.band-word { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; line-height: .9; font-size: 54px; color: var(--band); transition: color 600ms ease; }
.hero-line { color: var(--text-2); font-size: 14px; margin-top: 8px; }
.hero-means { margin-top: 6px; }
.hero.swap-out > * { transition: opacity 150ms var(--ease-in), transform 150ms var(--ease-in); opacity: 0; transform: translateY(-6px); }

/* plan */
.plan .row { grid-template-columns: 44px 1fr 44px; }
.rowbtn { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; text-align: left; background: none; border: 0; padding: 0; min-height: 44px; color: inherit; grid-column: 1 / 3; }
.row-title { font-weight: 500; display: block; transition: opacity 200ms ease; }
.row-meta { color: var(--text-2); font-size: 13px; display: block; }
.tick { width: 44px; height: 44px; border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--band); transition: transform 120ms var(--ease-out); }
.tick:active { transform: scale(.9); }
.tick svg { width: 28px; height: 28px; overflow: visible; }
.tick .ring2 { fill: none; stroke: var(--line-2); stroke-width: 1.5; transition: stroke 200ms ease, fill 200ms ease; }
.tick .path { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 320ms var(--ease-out) 40ms; }
.row[data-done="1"] .tick .ring2 { stroke: var(--band); fill: var(--band); }
.row[data-done="1"] .tick .path { stroke-dashoffset: 0; }
.row[data-done="1"] .row-title, .row[data-done="1"] .row-meta { opacity: .5; }
.row[data-done="1"] .tile { animation: pulse 360ms var(--ease-out) 1; background: var(--band-20); }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1); } }
.bar { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--band); transform-origin: left center; transform: scaleX(var(--p, 0)); transition: transform 320ms var(--ease-out), background-color 400ms ease; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--band-12); border: 1px solid var(--band-20); color: var(--text-2); font-size: 14px; }

/* coach */
.rep-hero { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.rep-n { font-size: 84px; color: var(--band); line-height: .85; transition: color 400ms ease; }
.rep-title { font-weight: 600; font-size: 22px; line-height: 1.2; }
.script { margin: 0; padding: 16px 18px 16px 20px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); font-size: 19px; line-height: 1.35; font-weight: 500; position: relative; }
.script::before { content: "\201C"; position: absolute; left: 10px; top: 2px; font-family: var(--display); font-size: 40px; color: var(--band); line-height: 1; }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; }
.ladder li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: center; min-height: 48px; color: var(--text-3); font-size: 15px; }
.ladder li::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.ladder li:first-child::before { top: 50%; }
.ladder li:last-child::before { bottom: 50%; }
.ladder .dot { position: relative; z-index: 1; width: 14px; height: 14px; margin-left: 7px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--bg); transition: border-color 300ms ease, background-color 300ms ease, transform 300ms var(--ease-out); }
.ladder li[data-state="done"] .dot { background: var(--band); border-color: var(--band); }
.ladder li[data-state="done"] { color: var(--text-2); }
.ladder li[data-state="now"] { color: var(--text); font-weight: 600; }
.ladder li[data-state="now"] .dot { border-color: var(--band); transform: scale(1.35); box-shadow: 0 0 0 5px var(--band-20); }
details.lesson { border-top: 1px solid var(--line); }
details.lesson:first-of-type { border-top: 0; }
details.lesson > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; font-weight: 500; }
details.lesson > summary::-webkit-details-marker { display: none; }
details.lesson > summary .tagm { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }
details.lesson[open] > summary .tagm { color: var(--band); }
details.lesson > p { padding-bottom: 14px; color: var(--text-2); animation: rise 360ms var(--ease-out) both; }
.notes { display: grid; gap: 8px; }
.note { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); font-size: 15px; animation: rise 400ms var(--ease-out) both; animation-delay: calc(var(--i) * 70ms); }
.note b { font-family: var(--display); font-size: 18px; text-transform: uppercase; letter-spacing: .04em; color: var(--band); }
.answer { padding: 14px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); color: var(--text-2); animation: rise 360ms var(--ease-out) both; }

/* progress */
.glow-tile { --h: 150 70% 62%; position: relative; border-radius: 26px; padding: 20px 20px 18px; min-height: 168px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: radial-gradient(circle at 50% 46%, hsl(var(--h) / 1) 0%, hsl(var(--h) / .78) 32%, hsl(var(--h) / .42) 62%, hsl(var(--h) / .28) 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset, 0 16px 34px -18px rgba(0, 0, 0, .75); transition: background 600ms ease; }
.glow-tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(circle at 50% 50%, transparent 55%, rgba(255, 255, 255, .28) 100%); }
.glow-tile > * { position: relative; z-index: 1; }
.glow-tile .lbl { font-size: 15px; font-weight: 500; opacity: .95; }
.glow-tile .big { font-size: 72px; line-height: .9; text-shadow: 0 2px 12px rgba(0, 0, 0, .18); }
.glow-tile .foot { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; opacity: .92; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 14px; display: grid; gap: 4px; box-shadow: 0 14px 30px -22px rgba(0, 0, 0, .7); }
.stat .num { font-size: 40px; }
.stat .num small { font-family: var(--body); font-weight: 500; font-size: 14px; color: var(--text-3); margin-left: 3px; letter-spacing: 0; }
.stat .lbl { color: var(--text-2); font-size: 13px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-size: 11px; font-weight: 600; text-align: center; color: var(--text-3); letter-spacing: .04em; }
.cal .d { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: var(--text-3); border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.cal .d[data-s="done"] { background: var(--band); color: var(--ink); font-weight: 600; }
.cal .d[data-s="frozen"] { border-color: var(--band); border-style: dashed; color: var(--band); }
.cal .d[data-s="miss"] { background: var(--raised); }
.cal .d[data-s="none"] { color: var(--line-2); }
.cal .d[data-today="1"] { box-shadow: 0 0 0 2px var(--text); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.insight { padding: 14px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); display: grid; gap: 4px; }
.insight b { font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: 15px; color: var(--text-3); font-weight: 700; }
.insight .big { font-size: 18px; line-height: 1.3; font-weight: 500; }
.lifts { list-style: none; margin: 0; padding: 0; display: grid; }
.lifts li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.spark { width: 72px; height: 22px; overflow: visible; }
.spark .cline { stroke-width: 1.75; animation-duration: 900ms; }
.spark .cdot { animation-delay: 700ms; }
.ex-last { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; margin-top: -4px; }
.ex-last .link { min-height: 36px; font-size: 13px; padding: 0 4px; }
.row-btns.tight { gap: 6px; flex-wrap: nowrap; flex: none; }
.row-btns.tight > .btn { flex: none; padding: 0 12px; }
.lifts li:first-child { border-top: 0; }
.lifts .num { font-size: 22px; }
.lifts .pb { font-family: var(--display); color: var(--band); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin-left: 8px; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo { display: grid; gap: 6px; }
.photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); max-width: 100%; }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 26px 18px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); }
.empty .icon { width: 30px; height: 30px; color: var(--text-3); }
.empty h3 { font-size: 16px; font-weight: 600; }
.empty p { color: var(--text-2); font-size: 14px; max-width: 32ch; }

/* you */
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: 0 14px 30px -22px rgba(0, 0, 0, .7); }
.group .row { padding: 10px 16px; grid-template-columns: 1fr auto; min-height: 58px; }
.group .row + .row { border-top: 1px solid var(--line); }
.group .row .row-meta { margin-top: 2px; }
.danger { border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); border-radius: var(--r); padding: 18px; display: grid; gap: 8px; margin-top: 8px; }
.danger h3 { font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: 15px; color: var(--red); }
@property --hold { syntax: "<number>"; inherits: true; initial-value: 0; }
.hold { --hold: 0; --hold-dur: 0ms; display: inline-flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px; min-height: 54px; border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); border-radius: var(--r-sm); background: transparent; color: inherit; user-select: none; -webkit-user-select: none; touch-action: none; justify-self: start; transition: --hold var(--hold-dur) linear, border-color 150ms ease, background-color 150ms ease; }
.hold-ring { position: relative; width: 28px; height: 28px; border-radius: 50%; background: conic-gradient(var(--red) calc(var(--hold) * 360deg), color-mix(in srgb, var(--red) 22%, transparent) 0); display: grid; place-items: center; }
.hold-ring::after { content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.hold-ring svg { position: absolute; width: 12px; height: 12px; color: var(--red); }
.hold-label { display: grid; line-height: 1.2; text-align: left; font-weight: 600; }
.hold-label small { opacity: .6; font-size: .8em; font-weight: 500; }
.hold[data-state="holding"] { border-color: var(--red); background: color-mix(in srgb, var(--red) 16%, transparent); }
.hold[data-state="done"] { border-color: var(--red); background: var(--red); color: #fff; }
.hold[data-state="done"] .hold-ring::after { background: var(--red); }
.hold[data-state="done"] .hold-ring svg { color: #fff; }

/* dock */
.dock { position: fixed; z-index: 20; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: calc(100% - 24px); max-width: 406px; height: var(--dock-h); border-radius: 22px; background: rgba(20, 23, 29, .72); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); border: 1px solid rgba(255, 255, 255, .09); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06); display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px; }
.dock .ind { position: absolute; top: 8px; bottom: 8px; left: 8px; width: calc((100% - 16px) / 5); border-radius: 15px; background: var(--band-20); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform 460ms cubic-bezier(.2, .8, .2, 1), background-color 400ms ease; }
.dock button { position: relative; z-index: 1; border: 0; background: none; color: var(--text-3); display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 11px; font-weight: 600; letter-spacing: .02em; min-height: 44px; border-radius: 15px; transition: color 240ms ease; }
.dock button .icon { transition: transform 360ms var(--ease-out), color 240ms ease; }
.dock button[aria-current="page"] { color: var(--text); }
.dock button[aria-current="page"] .icon { color: var(--band); transform: translateY(-1px); }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 30; }
.scrim { position: absolute; inset: 0; background: rgba(3, 5, 10, .62); opacity: 0; transition: opacity 260ms ease; }
.panel { position: absolute; left: 50%; bottom: 0; width: 100%; max-width: 430px; max-height: 90dvh; transform: translate(-50%, 104%); background: var(--surface); border-radius: 24px 24px 0 0; border: 1px solid var(--line-2); border-bottom: 0; box-shadow: 0 -18px 50px -24px rgba(0, 0, 0, .9); display: grid; grid-template-rows: auto 1fr; transition: transform 460ms var(--ease-ios); will-change: transform; }
.sheet.is-open .scrim { opacity: 1; }
.sheet.is-open .panel { transform: translate(-50%, 0); }
.grab { touch-action: none; cursor: grab; padding: 8px 16px 4px; }
.handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 2px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head .x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--raised); color: var(--text-2); display: grid; place-items: center; }
.panel-body { overflow: auto; padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px; align-content: start; }
.panel-body > * { animation: rise 420ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
.ex { list-style: none; margin: 0; padding: 0; display: grid; }
.ex li { padding: 11px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.ex li:first-child { border-top: 0; }
.ex .sets { color: var(--text-2); font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: .03em; white-space: nowrap; }

/* submit + toast */
.submit { position: relative; }
.submit .stack { display: grid; place-items: center; }
.submit .stack > * { grid-area: 1 / 1; transition: opacity 150ms ease, transform 150ms var(--ease-out); }
.submit .spin, .submit .did { opacity: 0; transform: translateY(4px); }
.submit[data-state="loading"] .lab, .submit[data-state="done"] .lab { opacity: 0; transform: translateY(-4px); }
.submit[data-state="loading"] .spin, .submit[data-state="done"] .did { opacity: 1; transform: none; }
.spin { width: 1.1em; height: 1.1em; border-radius: 50%; border: 2px solid rgba(11, 13, 17, .25); border-top-color: var(--ink); animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(var(--dock-h) + 28px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 14px); opacity: 0; pointer-events: none; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--raised); color: var(--text); border: 1px solid var(--line-2); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .8); font-weight: 500; font-size: 15px; transition: transform 240ms var(--ease-out), opacity 240ms ease; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

.daystrip { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; min-height: 36px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.daystrip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* week strip */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wk { display: grid; justify-items: center; gap: 1px; padding: 8px 0 7px; border-radius: 12px; border: 1px solid transparent; transition: border-color 400ms ease, background-color 400ms ease; }
.wk-d { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .04em; }
.wk-n { font-size: 19px; }
.wk-l { font-size: 11px; color: var(--text-2); }
.wk[data-s="today"] { border-color: var(--band); background: var(--band-12); }
.wk[data-s="today"] .wk-n, .wk[data-s="done"] .wk-n { color: var(--band); }
.wk[data-s="miss"] .wk-n, .wk[data-s="none"] .wk-n { color: var(--text-3); }
.wk[data-s="next"] .wk-n { color: var(--text-2); }
.wk[data-s="frozen"] { border-color: var(--band-40); border-style: dashed; }
.wk[data-s="frozen"] .wk-n { color: var(--band); }
.ladder .rung { background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; min-height: 44px; display: flex; align-items: center; width: 100%; }
.wk[data-s="done"] .wk-l::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--band); margin-right: 4px; vertical-align: 1px; }

button.wk, button.d { font: inherit; color: inherit; cursor: pointer; }
button.wk { background: transparent; }
.cal button.d { border: 1px solid transparent; background: transparent; padding: 0; width: 100%; }
.cal button.d[data-s="done"] { background: var(--band); }
.cal button.d[data-s="miss"] { background: var(--raised); }
.cal button.d[data-s="frozen"] { border-color: var(--band); border-style: dashed; }

/* photo compare */
.compare { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); touch-action: none; user-select: none; -webkit-user-select: none; cursor: ew-resize; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.compare img.top { clip-path: inset(0 0 0 var(--x)); }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; background: var(--white); transform: translateX(-1px); }
.cmp-handle i { position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; border-radius: 50%; background: var(--white); transform: translate(-50%, -50%); box-shadow: 0 6px 20px -6px rgba(0, 0, 0, .8); }
.cmp-handle i::before, .cmp-handle i::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; border: 5px solid transparent; }
.cmp-handle i::before { left: 6px; border-right-color: var(--ink); transform: translateY(-50%); }
.cmp-handle i::after { right: 6px; border-left-color: var(--ink); transform: translateY(-50%); }
.cmp-lbl { position: absolute; bottom: 10px; padding: 4px 8px; border-radius: 8px; background: rgba(11, 13, 17, .7); color: var(--text); font-size: 12px; font-weight: 600; }
.cmp-lbl.left { left: 10px; }
.cmp-lbl.right { right: 10px; }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.ctxt { fill: var(--text-3); font-size: 11px; font-family: var(--body); font-weight: 500; }
.cgrid { stroke: var(--line); stroke-width: 1; }
.cgrid.dash { stroke: var(--line-2); stroke-dasharray: 3 4; }
.cstub { fill: var(--line-2); }
.cbar, .cdot { cursor: pointer; }
.cbar { transform-box: fill-box; transform-origin: bottom; animation: barup 700ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes barup { from { transform: scaleY(0); } }
.cline { fill: none; stroke: var(--band); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1200ms var(--ease-out) 150ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.cdot { fill: var(--band); stroke: var(--surface); stroke-width: 2; animation: rise 400ms var(--ease-out) 900ms both; }

/* roleplay */
.chat { display: grid; gap: 8px; }
.bub { max-width: 86%; padding: 10px 14px; border-radius: 18px; background: var(--raised); line-height: 1.4; animation: rise 300ms var(--ease-out) both; }
.bub.them { justify-self: start; border-bottom-left-radius: 6px; }
.bub.me { justify-self: end; background: var(--band); color: var(--ink); border-bottom-right-radius: 6px; font-weight: 500; }
.bub small { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 2px; font-weight: 600; }
.chat-in { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.chat-in textarea.input { min-height: 52px; }
.chat-in .btn { min-height: 52px; }

/* look */
.ex .plain { font-family: var(--body); font-weight: 500; font-size: 15px; letter-spacing: 0; color: var(--text-2); text-align: right; max-width: 62%; white-space: normal; }
.ex.kv li { display: grid; grid-template-columns: 104px 1fr; gap: 12px; align-items: start; }
.ex.kv li > span:first-child { font-weight: 600; color: var(--text); }
.ex.kv .plain { text-align: left; max-width: none; font-weight: 400; }
.guide { display: grid; gap: 10px; animation: rise 400ms var(--ease-out) both; }
.guide strong { color: var(--text); font-weight: 600; }
details.lesson > ul.ex { padding-bottom: 8px; animation: rise 360ms var(--ease-out) both; }

/* in-session tools */
.rest { display: grid; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--band-40); }
.rest .bar i { transition: transform 250ms linear, background-color 400ms ease; }
.rest-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rest .num { font-size: 34px; color: var(--band); }
.setlist { list-style: none; margin: 0; padding: 0; display: grid; }
.setlist li { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.setlist li:first-child { border-top: 0; }
.ex-name { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 500; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { min-width: 52px; height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .02em; transition: transform 120ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.pill:active { transform: scale(.94); }
.pill[aria-pressed="true"] { background: var(--band); border-color: var(--band); color: var(--ink); }
.runner { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 8px 0 4px; }
.runner .phase { font-size: 40px; color: var(--text-2); transition: color 300ms ease; }
.runner[data-kind="run"] .phase { color: var(--band); }
.runner .big { font-size: 96px; line-height: .9; }
.runner .bar { width: 100%; margin-top: 12px; }
.runner .bar i { transition: transform 250ms linear, background-color 400ms ease; }
.breathe { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 18px 0 8px; }
.orb { width: 120px; height: 120px; border-radius: 50%; background: var(--band-20); border: 2px solid var(--band); transform: scale(.7); transition: transform 4000ms ease-in-out, background-color 300ms ease; }
.breathe[data-phase="go"] .orb { animation: orbpulse 900ms ease-in-out infinite; background: var(--band); }
.breathe[data-phase="over"] .orb { background: var(--band-20); }
@keyframes orbpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.breathe .disp { font-size: 44px; }
.breathe[data-phase="go"] .disp { color: var(--band); }
.livepill { position: fixed; z-index: 21; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-h) + 26px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px 0 14px; border-radius: 999px; background: var(--band); color: var(--ink); font-weight: 600; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .8); border: 0; animation: rise 360ms var(--ease-out) both; }
.livepill .num { font-size: 20px; }
.switch { width: 52px; height: 32px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--raised); position: relative; padding: 0; flex: none; transition: background-color 200ms ease, border-color 200ms ease; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--text-2); transition: transform 260ms var(--ease-out), background-color 200ms ease; }
.switch[aria-checked="true"] { background: var(--band-40); border-color: var(--band); }
.switch[aria-checked="true"] i { transform: translateX(20px); background: var(--band); }

/* wide screens: the phone, framed, on the desk. A fixed overlay masks everything outside the frame; the window still scrolls. */
@media (min-width: 700px) and (min-height: 600px) {
  #app { padding-top: 44px; }
  #app::before { content: ""; position: fixed; z-index: 15; left: 50%; top: 24px; width: 430px; height: calc(100dvh - 48px); transform: translateX(-50%); border-radius: 40px; border: 1px solid var(--line-2); box-shadow: 0 0 0 200vmax var(--bg), 0 40px 80px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06); pointer-events: none; }
  .page { padding-bottom: calc(var(--dock-h) + 72px); }
  .dock { bottom: 36px; }
  .toast { bottom: calc(var(--dock-h) + 60px); }
  .livepill { bottom: calc(var(--dock-h) + 58px); }
  .panel { max-height: calc(100dvh - 120px); border-radius: 24px 24px 32px 32px; bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .orb { transition-duration: 300ms !important; }
  .cbar, .cdot { animation: none; }
  .cline { animation: none; stroke-dashoffset: 0; }
  .breathe[data-phase="go"] .orb { animation: none; }
  .livepill { animation: none; }
  .page, .page-out-left, .page-out-right { transition: opacity 120ms ease; transform: none !important; }
  .page > *, .wm i, .panel-body > *, .note, .answer, details.lesson > p { animation: none; }
  .streak .icon, .row[data-done="1"] .tile, .hero.done .ring-arc { animation: none; }
  .ring-arc, .bar i, .tick .path { transition-duration: 1ms; }
  .panel { transition: opacity 200ms ease; transform: translate(-50%, 0) !important; opacity: 0; }
  .sheet.is-open .panel { opacity: 1; }
  .dock .ind { transition-duration: 1ms; }
  .ambient { transition: none; }
  .hold { transition-duration: 1ms; }
}
@media (prefers-reduced-transparency: reduce) { .dock { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media (prefers-contrast: more) { :root { --line: rgba(255, 255, 255, .18); --line-2: rgba(255, 255, 255, .32); --text-2: #C9D0DA; --text-3: #A3ABB8; } .dock { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; } .ambient { opacity: .6; } }
