/* Interval Coach web app. Each skin is a set of CSS variables on [data-skin]. */

@property --p1 { syntax: "<color>"; inherits: true; initial-value: #ff7a2f; }
@property --p2 { syntax: "<color>"; inherits: true; initial-value: #ff2d6b; }

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", -apple-system, "Nunito", system-ui, sans-serif;
  --radius: 22px;
  --tap: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Skins ---------- */

/* Black Purple: near-black with violet. Purple for work, cool blue for rest. */
[data-skin="purple"] {
  color-scheme: dark;
  --bg: #050308; --bg-glow1: rgba(168,85,247,.22); --bg-glow2: rgba(124,58,237,.14);
  --surface: rgba(24,15,40,.72); --surface2: rgba(34,22,56,.8); --border: rgba(192,132,252,.24);
  --glow: 168,85,247; --glow2: 124,58,237; --line: 216,180,254; --rcard1: 30,18,50; --rcard2: 12,7,22;
  --text: #f6f2fc; --text2: rgba(238,230,250,.64); --text3: rgba(238,230,250,.4);
  --brand: #a855f7; --brand2: #7c3aed; --on-brand: #fff;
  --work1: #c084fc; --work2: #7c3aed; --rest1: #7dd3fc; --rest2: #4f46e5;
  --prep1: #f0abfc; --prep2: #c026d3; --done1: #34d399; --done2: #22d3ee;
  --num-weight: 700; --num-glow: 0 0 20px rgba(168,85,247,.45); --ring-glow: 14px;
  --card-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='48' viewBox='0 0 56 48'%3E%3Cpath d='M14 0l14 8v16l-14 8L0 24V8zM42 24l14 8v16M42 24l-14 8v16M28 8l14-8 14 8' fill='none' stroke='%23c084fc' stroke-opacity='.07' stroke-width='1'/%3E%3C/svg%3E");
  --tab-active: #c084fc;
}

/* Tech Green: the bright green of a terminal or a status light on near-black (not forest green).
   The green is light, so text that sits on it is dark, as in Mono Bold. */
[data-skin="green"] {
  color-scheme: dark;
  --bg: #020604; --bg-glow1: rgba(0,255,136,.16); --bg-glow2: rgba(0,200,255,.08);
  --surface: rgba(8,24,17,.72); --surface2: rgba(12,34,25,.8); --border: rgba(0,255,136,.22);
  --glow: 0,255,136; --glow2: 0,201,139; --line: 134,255,200; --rcard1: 8,32,22; --rcard2: 3,13,9;
  --text: #eafff4; --text2: rgba(214,245,228,.64); --text3: rgba(214,245,228,.4);
  --brand: #00ff88; --brand2: #00d4a0; --on-brand: #00170c;
  --work1: #00ff88; --work2: #00c98b; --rest1: #a5f3fc; --rest2: #38bdf8;
  --prep1: #ecfccb; --prep2: #a3e635; --done1: #00ff88; --done2: #22d3ee;
  --num-weight: 700; --num-glow: 0 0 18px rgba(0,255,136,.5); --ring-glow: 16px;
  --card-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='48' viewBox='0 0 56 48'%3E%3Cpath d='M14 0l14 8v16l-14 8L0 24V8zM42 24l14 8v16M42 24l-14 8v16M28 8l14-8 14 8' fill='none' stroke='%2300ff88' stroke-opacity='.07' stroke-width='1'/%3E%3C/svg%3E");
  --tab-active: #00ff88;
}

/* Hot Pink: near-black with bright pink. Pink for work, soft blue for rest. */
[data-skin="pink"] {
  color-scheme: dark;
  --bg: #080306; --bg-glow1: rgba(255,79,163,.20); --bg-glow2: rgba(225,29,116,.13);
  --surface: rgba(34,13,25,.72); --surface2: rgba(48,19,35,.8); --border: rgba(255,121,184,.24);
  --glow: 255,79,163; --glow2: 225,29,116; --line: 255,182,216; --rcard1: 44,15,31; --rcard2: 20,7,14;
  --text: #fdf2f8; --text2: rgba(252,231,243,.64); --text3: rgba(252,231,243,.4);
  --brand: #ff4fa3; --brand2: #e11d74; --on-brand: #fff;
  --work1: #ff7ab8; --work2: #e11d74; --rest1: #7dd3fc; --rest2: #4f46e5;
  --prep1: #f5d0fe; --prep2: #a855f7; --done1: #34d399; --done2: #22d3ee;
  --num-weight: 700; --num-glow: 0 0 20px rgba(255,79,163,.45); --ring-glow: 14px;
  --card-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='48' viewBox='0 0 56 48'%3E%3Cpath d='M14 0l14 8v16l-14 8L0 24V8zM42 24l14 8v16M42 24l-14 8v16M28 8l14-8 14 8' fill='none' stroke='%23ff7ab8' stroke-opacity='.07' stroke-width='1'/%3E%3C/svg%3E");
  --tab-active: #ff7ab8;
}

/* Neon Blue: modelled on the PepMaxx mockups. Deep navy, glass cards, cyan glow, hex texture. */
[data-skin="neon"] {
  color-scheme: dark;
  --bg: #03070e; --bg-glow1: rgba(34,140,255,.20); --bg-glow2: rgba(34,211,238,.10);
  --surface: rgba(12,24,42,.72); --surface2: rgba(18,34,58,.8); --border: rgba(56,189,248,.24);
  --glow: 34,211,238; --glow2: 37,99,235; --line: 125,211,252; --rcard1: 14,30,54; --rcard2: 6,14,28;
  --text: #e8f3ff; --text2: rgba(196,220,245,.68); --text3: rgba(196,220,245,.42);
  --brand: #22d3ee; --brand2: #2563eb; --on-brand: #fff;
  --work1: #22d3ee; --work2: #2563eb; --rest1: #a78bfa; --rest2: #4f46e5;
  --prep1: #7dd3fc; --prep2: #0284c7; --done1: #34d399; --done2: #22d3ee;
  --num-weight: 600; --num-glow: 0 0 18px rgba(34,211,238,.55), 0 0 42px rgba(37,99,235,.35); --ring-glow: 16px;
  --card-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='48' viewBox='0 0 56 48'%3E%3Cpath d='M14 0l14 8v16l-14 8L0 24V8zM42 24l14 8v16M42 24l-14 8v16M28 8l14-8 14 8' fill='none' stroke='%2338bdf8' stroke-opacity='.07' stroke-width='1'/%3E%3C/svg%3E");
  --tab-active: #22d3ee;
}

/* Daylight: clean light theme. */
[data-skin="daylight"] {
  color-scheme: light;
  --bg: #f6f4f1; --bg-glow1: rgba(255,122,47,.16); --bg-glow2: rgba(255,45,107,.10);
  --surface: #ffffff; --surface2: #f1eeea; --border: rgba(0,0,0,.07);
  --text: #16151a; --text2: rgba(22,21,26,.6); --text3: rgba(22,21,26,.38);
  --brand: #ff5a36; --brand2: #ff2d6b; --on-brand: #fff;
  --work1: #ff7a2f; --work2: #ff2d6b; --rest1: #14b8a6; --rest2: #3b6bf0;
  --prep1: #8b5cf6; --prep2: #5b48f2; --done1: #16a34a; --done2: #0ea5e9;
  --num-weight: 700; --num-glow: 0 0 0 transparent; --ring-glow: 10px; --card-pattern: none;
  --tab-active: var(--brand);
}

/* Mono Bold: maximum contrast, readable from across the room. */
[data-skin="mono"] {
  color-scheme: dark;
  --bg: #000; --bg-glow1: rgba(212,255,58,.08); --bg-glow2: rgba(255,255,255,.04);
  --surface: #0e0e0e; --surface2: #181818; --border: rgba(255,255,255,.14);
  --text: #fff; --text2: rgba(255,255,255,.66); --text3: rgba(255,255,255,.4);
  --brand: #d4ff3a; --brand2: #a3e635; --on-brand: #000;
  --work1: #d4ff3a; --work2: #a3e635; --rest1: #f4f4f5; --rest2: #a1a1aa;
  --prep1: #fde047; --prep2: #facc15; --done1: #d4ff3a; --done2: #4ade80;
  --num-weight: 800; --num-glow: 0 0 0 transparent; --ring-glow: 0px; --card-pattern: none;
  --tab-active: var(--brand);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Fixed, app-like page on phones: no double-tap zoom, no sideways drift, no font resizing on rotate. */
html, body { margin: 0; height: 100%; overflow-x: hidden; touch-action: manipulation;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; touch-action: manipulation; }
/* While a workout or a sheet is open, the page behind it must not scroll or bounce. */
html.locked, html.locked body { overflow: hidden; }
.sheet { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.workout { height: 100dvh; touch-action: none; }
.workout button { touch-action: manipulation; }
.done-view { touch-action: pan-y; }
/* iPhone zooms into any text box or menu under 16px when tapped; keep them all at 16px or more. */
input, select, textarea { font-size: max(16px, 1em); }
button, .tabbar, .controls, .rcard, .logo { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 10px; }

#app { min-height: 100%; max-width: 520px; margin: 0 auto; position: relative; }
.page-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 40% at 10% 0%, var(--bg-glow1), transparent 70%), radial-gradient(50% 35% at 95% 5%, var(--bg-glow2), transparent 70%); }

/* Header */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 18px 10px; background: linear-gradient(var(--bg) 60%, transparent); }
/* intervalHQ wordmark: lowercase word, skin-colored dot on the i, InboundHQ-style double-line HQ. */
.logo { display: inline-flex; align-items: baseline; gap: 3px; font: 800 25px/1 -apple-system, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -.6px; color: var(--text); padding: 6px 4px; }
.logo .word { position: relative; }
.logo .idot { position: relative; }
.logo .idot::after { content: ""; position: absolute; left: 50%; top: -.02em; width: .23em; height: .23em; border-radius: 50%;
  transform: translateX(-50%); background: linear-gradient(135deg, var(--brand), var(--brand2)); }
.logo .hq { height: 1em; width: auto; transform: translateY(.1em); margin-left: 1px; }
:is([data-skin="neon"], [data-skin="purple"], [data-skin="green"], [data-skin="pink"]) .logo .hq { filter: drop-shadow(0 0 6px rgba(var(--glow),.55)); }
.logo .ver { align-self: flex-start; margin-left: 6px; padding: 2px 6px; border-radius: 6px; font: 700 11px/1.2 var(--font-num); letter-spacing: 0;
  color: var(--text2); background: var(--surface2); border: 1px solid var(--border); }
/* Coach muted: make the button impossible to miss, so silence is never a mystery. */
.icon-btn.muted, .glass-btn.muted { color: #fff; background: linear-gradient(135deg, #a855f7, #7c3aed); border-color: #a855f7; box-shadow: 0 0 18px -4px #a855f7; }
.tag.def { background: linear-gradient(90deg, var(--brand), var(--brand2)); color: var(--on-brand); }
/* An empty slot the size of a button, so the logo stays centred opposite the speaker button. */
.topbar-gap { width: var(--tap); height: var(--tap); flex: none; }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: 14px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); }

main { position: relative; z-index: 1; padding: 4px 18px calc(110px + var(--safe-bottom)); }
.hello small { display: block; font-size: 12px; font-weight: 800; letter-spacing: 1.6px; color: var(--brand); text-transform: uppercase; }
.hello h1 { margin: 4px 0 4px; font-size: 34px; letter-spacing: -.6px; font-weight: 800; }
.hello p { margin: 0; color: var(--text2); font-size: 15px; display: flex; gap: 6px; align-items: center; }
h2 { font-size: 20px; margin: 26px 0 12px; letter-spacing: -.2px; display: flex; justify-content: space-between; align-items: center; }
h2 a, .link { font-size: 14px; color: var(--brand); text-decoration: none; font-weight: 600; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  background-image: var(--card-pattern); background-position: right -10px top -6px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
:is([data-skin="neon"], [data-skin="purple"], [data-skin="green"], [data-skin="pink"]) .card { box-shadow: inset 0 1px 0 rgba(var(--line),.08), 0 10px 30px rgba(0,0,0,.35); }

/* Segmented control */
.seg { display: flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 9px 6px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--text2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
:is([data-skin="neon"], [data-skin="purple"], [data-skin="green"], [data-skin="pink"]) .seg button[aria-pressed="true"] { background: linear-gradient(180deg, rgba(var(--glow),.22), rgba(var(--glow2),.22)); color: #fff; box-shadow: inset 0 0 0 1px rgba(var(--glow),.5); }
[data-skin="mono"] .seg button[aria-pressed="true"] { background: var(--brand); color: #000; }

/* Interval rows */
.rows { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 14px; }
.row + .row { border-top: 1px solid var(--border); }
.badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.badge.work { background: linear-gradient(135deg, var(--work1), var(--work2)); }
.badge.rest { background: linear-gradient(135deg, var(--rest1), var(--rest2)); }
.badge.prep { background: linear-gradient(135deg, var(--prep1), var(--prep2)); }
.badge.done { background: linear-gradient(135deg, var(--done1), var(--done2)); }
[data-skin="mono"] .badge, [data-skin="green"] .badge { color: #000; }
:is([data-skin="neon"], [data-skin="purple"], [data-skin="green"], [data-skin="pink"]) .badge { box-shadow: 0 0 16px rgba(var(--glow),.25); }
.row .val { flex: 1; text-align: left; min-width: 0; }
.row .val small { display: block; color: var(--text2); font-weight: 600; font-size: 13px; }
.row .val .num { font-size: 28px; font-weight: var(--num-weight); line-height: 1.1; }
/* The time is a button: a dotted underline and a small pencil say "tap to set it directly". */
.row .val .num.editable { display: inline-flex; align-items: center; gap: 7px; padding-bottom: 1px;
  border-bottom: 2px dotted color-mix(in srgb, var(--brand) 55%, transparent); }
.row .val .num.editable .pencil { width: 15px; height: 15px; color: var(--brand); opacity: .9; }
.row .val:active .num.editable { opacity: .6; }
.stepper button:active { background: color-mix(in srgb, var(--brand) 22%, transparent); }
.stepper button:first-child { border-radius: 999px 0 0 999px; }
.stepper button:last-child { border-radius: 0 999px 999px 0; }
.stepper { display: flex; background: var(--surface2); border-radius: 999px; border: 1px solid var(--border); }
.stepper button { width: 46px; height: 42px; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--text); }
.stepper button + button { border-left: 1px solid var(--border); }
.stepper button:disabled { opacity: .3; }
.summary { margin: 10px 4px 14px; color: var(--text2); font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.summary .dim { color: var(--text3); }
.mode-note { margin: 10px 6px 0; color: var(--text2); font-size: 13px; line-height: 1.4; }

/* Big CTA */
.cta { width: 100%; display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-radius: 24px; color: var(--on-brand);
  background: linear-gradient(90deg, var(--brand), var(--brand2)); box-shadow: 0 12px 30px -8px var(--brand2); transition: transform .12s; text-align: left; }
.cta:active { transform: scale(.97); }
.cta .play { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; }
[data-skin="mono"] .cta .play, [data-skin="green"] .cta .play { background: rgba(0,0,0,.12); }
.cta strong { display: block; font-size: 22px; }
.cta span { font-size: 14px; opacity: .85; font-weight: 600; }
.cta .grow { flex: 1; }
:is([data-skin="neon"], [data-skin="purple"], [data-skin="green"], [data-skin="pink"]) .cta { box-shadow: 0 0 0 1px rgba(var(--line),.45) inset, 0 10px 34px -6px rgba(var(--glow),.6); }
.ghost { width: 100%; margin-top: 10px; padding: 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-weight: 600; font-size: 15px; display: flex; gap: 8px; justify-content: center; align-items: center; }

/* Routine cards */
/* The row runs 18px past the text on both sides so cards can slide under the edge. scroll-padding
   keeps the first card lined up with the headings (without it the snap pulled a full row 18px left,
   while a short row stayed put), and the mask fades a cut-off card instead of slicing it. */
.carousel { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 18px; padding: 4px 18px 10px; margin: 0 -18px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); }
.carousel::-webkit-scrollbar { display: none; }
.rcard { scroll-snap-align: start; flex: none; width: 168px; height: 188px; border-radius: 24px; padding: 16px; color: #fff; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; transition: transform .12s; }
.rcard:active { transform: scale(.96); }
.rcard .top { display: flex; justify-content: space-between; align-items: flex-start; }
.rcard .playdot { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.24); display: grid; place-items: center; }
.rcard b { font-size: 17px; display: block; }
.rcard .num { font-size: 14px; font-weight: 700; opacity: .92; }
.rcard small { font-size: 12px; opacity: .75; font-weight: 600; }
.acc-ember { background: linear-gradient(135deg, #ff8a3d, #ff3d6e); }
.acc-ocean { background: linear-gradient(135deg, #36d1dc, #3a63e8); }
.acc-violet { background: linear-gradient(135deg, #b57bff, #5b48f2); }
.acc-lime { background: linear-gradient(135deg, #a3e635, #16a34a); }
.acc-rose { background: linear-gradient(135deg, #ff7eb3, #e8336e); }
.acc-gold { background: linear-gradient(135deg, #ffc35a, #ff8c2b); }
:is([data-skin="neon"], [data-skin="purple"], [data-skin="green"], [data-skin="pink"]) .rcard { background: linear-gradient(160deg, rgba(var(--rcard1),.95), rgba(var(--rcard2),.95)); border: 1px solid rgba(var(--glow),.3);
  box-shadow: 0 0 24px -8px rgba(var(--glow),.45); background-image: var(--card-pattern), linear-gradient(160deg, rgba(var(--rcard1),.95), rgba(var(--rcard2),.95)); }
:is([data-skin="neon"], [data-skin="purple"], [data-skin="green"], [data-skin="pink"]) .rcard .playdot { background: linear-gradient(135deg, var(--brand), var(--brand2)); }
[data-skin="green"] .rcard .playdot { color: #00170c; }
.mini-ring { width: 34px; height: 34px; }

/* Lists */
.list { display: grid; gap: 10px; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px; }
.lrow .sw { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; flex: none; color: #fff; }
.lrow .meta { flex: 1; min-width: 0; text-align: left; }
.lrow .meta b { display: flex; gap: 6px; align-items: center; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .meta .num { color: var(--text2); font-size: 14px; font-weight: 600; display: block; }
.lrow .meta small { color: var(--text3); font-size: 12px; }
.star { color: #a855f7; }
.round-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.small-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--text2); flex: none; }

/* Affiliate */
.gear { display: grid; gap: 10px; }
.gear a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; text-decoration: none; color: inherit; }
.gear .gi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface2); font-size: 22px; flex: none; }
.gear .gt { flex: 1; min-width: 0; }
.gear .gt b { display: block; font-size: 15px; }
.gear .gt span { color: var(--text2); font-size: 13px; }
.tag { font-size: 10px; font-weight: 800; letter-spacing: .8px; padding: 3px 7px; border-radius: 6px; background: var(--surface2); color: var(--text3); text-transform: uppercase; }
.disclosure { color: var(--text3); font-size: 12px; margin: 10px 4px 0; line-height: 1.4; }

/* Settings */
.group { margin-bottom: 8px; }
.group > .card { overflow: hidden; }
.srow { display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 52px; }
.srow + .srow { border-top: 1px solid var(--border); }
.srow .lbl { flex: 1; font-weight: 500; }
.srow .lbl small { display: block; color: var(--text2); font-size: 13px; font-weight: 400; }
.terms { padding: 0 4px 18px; }
.terms h4 { margin: 20px 0 6px; font-size: 16px; }
.terms p { margin: 0 0 10px; color: var(--text2); font-size: 15px; line-height: 1.5; }
.story { padding-top: 6px; }
.story p { font-size: 16px; line-height: 1.55; margin-bottom: 14px; }
.story p.lead { color: var(--text); font-size: 19px; font-weight: 700; line-height: 1.35; margin-bottom: 18px; }
.terms .terms-date { margin-top: 22px; color: var(--text3); font-size: 13px; }
.terms-line { margin: 22px 6px 0; text-align: center; color: var(--text3); font-size: 12px; line-height: 1.4; }
.terms-line a { color: var(--text2); text-decoration: underline; }
.foot { color: var(--text3); font-size: 13px; margin: 8px 6px 18px; line-height: 1.4; }
.toggle { position: relative; width: 52px; height: 32px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface2); border: 1px solid var(--border); transition: .2s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle input:checked + span { background: linear-gradient(90deg, var(--brand), var(--brand2)); border-color: transparent; }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
select.sel { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; }
input[type="range"] { width: 100%; accent-color: var(--brand); }
.coach-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; width: 100%; text-align: left; }
.coach-row + .coach-row { border-top: 1px solid var(--border); }
.coach-row .ci { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface2); font-size: 18px; flex: none; }
.coach-row[aria-checked="true"] .ci { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: var(--on-brand); }
.coach-row .lbl { flex: 1; }
.coach-row .lbl b { display: block; font-weight: 600; }
.coach-row .lbl small { color: var(--text2); font-size: 13px; }
.check { color: var(--brand); }
.skins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.skin { border-radius: 18px; padding: 10px; text-align: left; border: 2px solid transparent; position: relative; }
.skin[aria-checked="true"] { border-color: var(--brand); }
.skin .preview { height: 86px; border-radius: 12px; position: relative; overflow: hidden; display: grid; place-items: center; }
.skin b { display: block; margin-top: 8px; font-size: 14px; }
.skin small { color: var(--text2); font-size: 12px; }

/* Tab bar */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 520px; z-index: 10;
  display: flex; justify-content: space-around; padding: 8px 10px calc(8px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-top: 1px solid var(--border); }
.tabbar button { flex: 1; display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text3); padding: 4px 0; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button[aria-current="page"] { color: var(--tab-active); }
:is([data-skin="neon"], [data-skin="purple"], [data-skin="green"], [data-skin="pink"]) .tabbar button[aria-current="page"] svg { filter: drop-shadow(0 0 6px rgba(var(--glow),.8)); }

/* Sheet */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-bottom: 0;
  border-radius: 26px 26px 0 0; padding: 10px 18px calc(22px + var(--safe-bottom)); animation: up .28s cubic-bezier(.2,.9,.3,1); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--text3); margin: 0 auto 8px; }
.sheet header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet header h3 { margin: 0; font-size: 17px; }
.sheet header button { color: var(--brand); font-weight: 600; padding: 8px; min-width: 60px; }
.picker-value { font-size: 60px; text-align: center; font-weight: var(--num-weight); margin: 4px 0 14px; text-shadow: var(--num-glow); }
.picker-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.picker-cols label { display: grid; gap: 6px; font-size: 13px; color: var(--text2); font-weight: 600; }
.picker-cols select { width: 100%; padding: 12px; font-size: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.chip { padding: 9px 14px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.chip[aria-pressed="true"] { background: linear-gradient(90deg, var(--brand), var(--brand2)); color: var(--on-brand); border-color: transparent; }
.field { width: 100%; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); font-size: 18px; font-weight: 600; }
.label { font-size: 13px; color: var(--text2); font-weight: 600; margin: 16px 2px 8px; display: block; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 3px solid transparent; background-origin: border-box; background-repeat: no-repeat; }
.swatch[aria-checked="true"] { border-color: var(--text); }
.total-banner { margin-top: 14px; padding: 16px 18px; border-radius: 20px; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.total-banner small { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; opacity: .8; }
.total-banner .num { font-size: 30px; font-weight: 700; }
.danger { color: #ef4444; }
/* Confirm / pause sheet: two thumb-sized buttons, styled like the Start button. */
.confirm-title { text-align: center; margin: 10px 0 4px; font-size: 24px; letter-spacing: -.3px; }
.confirm-msg { text-align: center; color: var(--text2); margin: 0 0 6px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.confirm-btns { display: grid; gap: 16px; margin-top: 18px; }
.big-btn { width: 100%; min-height: 92px; padding: 14px 20px; border-radius: 26px; display: flex; align-items: center; gap: 16px; text-align: left;
  transition: transform .1s; position: relative; overflow: hidden; }
.big-btn:active { transform: scale(.97); }
.big-btn .bi { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.big-btn .bi svg { width: 26px; height: 26px; }
.big-btn .bt { display: grid; gap: 2px; min-width: 0; }
.big-btn strong { font-size: 23px; font-weight: 800; letter-spacing: -.3px; }
.big-btn small { font-size: 14px; font-weight: 600; opacity: .82; }
/* Keep Going: the skin's glowing primary, same recipe as Start. */
.big-btn.stay { color: var(--on-brand); background: linear-gradient(90deg, var(--brand), var(--brand2)); box-shadow: 0 12px 30px -8px var(--brand2); }
.big-btn.stay .bi { background: rgba(255,255,255,.22); }
[data-skin="mono"] .big-btn.stay .bi, [data-skin="green"] .big-btn.stay .bi { background: rgba(0,0,0,.12); }
:is([data-skin="neon"], [data-skin="purple"], [data-skin="green"], [data-skin="pink"]) .big-btn.stay { box-shadow: 0 0 0 1px rgba(var(--line),.45) inset, 0 10px 34px -6px rgba(var(--glow),.6); }
/* End / Delete: a glass card with a red edge and a red disc, so it reads as the serious choice. */
.big-btn.leave { color: var(--text); background: var(--surface); background-image: var(--card-pattern);
  border: 1px solid rgba(248,113,113,.55); box-shadow: 0 0 26px -10px rgba(239,68,68,.75), inset 0 1px 0 rgba(255,255,255,.05); }
.big-btn.leave .bi { color: #fff; background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 0 18px -2px rgba(239,68,68,.6); }
.big-btn.leave small { color: var(--text2); opacity: 1; }
[data-skin="daylight"] .big-btn.leave { background: #fff; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translateX(-50%); z-index: 50; background: var(--surface2);
  border: 1px solid var(--border); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; animation: fade .2s; }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* ---------- Workout ---------- */
.workout { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; overflow: hidden;
  transition: --p1 .6s, --p2 .6s; }
.workout[data-phase="work"] { --p1: var(--work1); --p2: var(--work2); }
.workout[data-phase="rest"] { --p1: var(--rest1); --p2: var(--rest2); }
.workout[data-phase="prep"] { --p1: var(--prep1); --p2: var(--prep2); }
.workout[data-phase="finished"] { --p1: var(--done1); --p2: var(--done2); }
.blob { position: absolute; width: 130vmax; height: 130vmax; border-radius: 50%; pointer-events: none; opacity: .5; }
.blob.a { left: -70vmax; top: -75vmax; background: radial-gradient(closest-side, var(--p1), transparent); animation: breathe 2.6s ease-in-out infinite; }
.blob.b { right: -70vmax; bottom: -80vmax; background: radial-gradient(closest-side, var(--p2), transparent); animation: breathe 2.6s ease-in-out infinite reverse; }
.workout[data-phase="rest"] .blob { animation-duration: 8s; }
.workout[data-phase="prep"] .blob { animation-duration: 4s; }
.workout[data-state="paused"] .blob, .workout[data-state="idle"] .blob { animation-play-state: paused; }
[data-skin="daylight"] .blob { opacity: .32; }
[data-skin="mono"] .blob { opacity: .14; }
@keyframes breathe { 50% { transform: scale(1.07); } }

.w-inner { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 560px; margin: 0 auto;
  padding: calc(10px + var(--safe-top)) 20px calc(22px + var(--safe-bottom)); }
.w-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.w-title { text-align: center; min-width: 0; }
.w-title b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-title small { color: var(--text2); font-size: 12px; font-weight: 600; }
.glass-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.glass-btn:disabled { opacity: .35; }
.sound-off { margin-top: 10px; padding: 10px 16px; border-radius: 999px; background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; font-weight: 700; font-size: 14px;
  display: inline-flex; gap: 8px; align-items: center; box-shadow: 0 6px 20px -6px #a855f7; }
.sound-off[hidden] { display: none; }
.phase-pill { margin-top: auto; padding: 9px 24px; border-radius: 999px; color: #fff; font: 800 22px/1 var(--font-num); letter-spacing: 6px; padding-right: 18px;
  background: linear-gradient(90deg, var(--p1), var(--p2)); box-shadow: 0 8px 28px -6px var(--p2); }
[data-skin="mono"] .phase-pill, [data-skin="green"] .phase-pill { color: #000; }
:is([data-skin="neon"], [data-skin="purple"], [data-skin="green"], [data-skin="pink"]) .phase-pill { box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset, 0 0 30px -2px var(--p1); }
.ring-wrap { position: relative; width: min(84vw, 52vh, 460px); aspect-ratio: 1; margin: 18px 0 14px; }
.ring-wrap svg { width: 100%; height: 100%; overflow: visible; }
.ring-track { stroke: var(--text); opacity: .08; }
.ring-ticks line { stroke: var(--text); opacity: .13; }
.ring-arc { filter: drop-shadow(0 0 var(--ring-glow) var(--p2)); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.big-time { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: var(--num-weight); font-size: min(21vw, 13vh, 116px);
  line-height: 1; letter-spacing: -1px; text-shadow: var(--num-glow); }
.ring-round { margin-top: 8px; font: 800 15px var(--font-num); letter-spacing: 2.5px; color: var(--text2); }
/* Pulse view (breathing routines): no ring, no numbers. One circle that grows and shrinks with the
   breath inside a faint outline of its full size. The colour never changes, so nothing feels rushed. */
.orb-wrap { display: none; position: absolute; inset: 0; place-items: center; }
.workout[data-view="pulse"] .ring-wrap svg, .workout[data-view="pulse"] .ring-center { display: none; }
.workout[data-view="pulse"] .orb-wrap { display: grid; }
.workout[data-view="pulse"] .stats { visibility: hidden; }
.workout[data-view="pulse"][data-state="running"] .phase-pill { visibility: hidden; }
.workout[data-view="pulse"] .blob { animation: none; }
.orb, .orb-halo { position: absolute; inset: 6%; border-radius: 50%; }
.orb-halo { border: 1px solid color-mix(in srgb, var(--text) 16%, transparent); }
.orb { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--p1) 80%, #fff), var(--p2)); box-shadow: 0 0 70px -8px var(--p1); opacity: .92; transform: scale(.6); will-change: transform; }
.orb-label { position: relative; text-align: center; color: #fff; text-shadow: 0 1px 14px rgba(0,0,0,.45); padding: 0 8px; }
.orb-label b { display: block; font-size: min(6.4vw, 4.4vh, 30px); font-weight: 700; letter-spacing: .2px; }
.orb-label small { display: block; margin-top: 6px; font: 700 12px var(--font-num); letter-spacing: 2px; text-transform: uppercase; opacity: .82; }
[data-skin="mono"] .orb-label, [data-skin="green"] .orb-label { color: #000; text-shadow: none; }
.pulse { animation: pulse .5s ease-out; }
@keyframes pulse { 0% { transform: scale(1.08); } }
.stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { text-align: center; padding: 10px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.stat small { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; color: var(--text2); text-transform: uppercase; }
.stat .num { display: block; font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* one line, or the whole screen shifts when the text wraps */
.caption { height: 52px; margin: 6px 0; display: grid; place-items: center; text-align: center; color: var(--text2); font-weight: 600; font-size: 15px; padding: 0 10px; }
.caption span { animation: fade .3s; }
.controls { margin-top: auto; display: flex; align-items: center; gap: 34px; }
.controls .glass-btn { width: 64px; height: 64px; }
.primary { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--p1), var(--p2)); box-shadow: 0 10px 30px -6px var(--p2); transition: transform .12s; }
.primary:active { transform: scale(.92); }
.primary svg { width: 38px; height: 38px; }
[data-skin="mono"] .primary, [data-skin="green"] .primary { color: #000; }
:is([data-skin="neon"], [data-skin="purple"], [data-skin="green"], [data-skin="pink"]) .primary { box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset, 0 0 36px -4px var(--p1); }

@media (orientation: landscape) and (max-height: 560px) {
  .w-inner { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto auto auto; column-gap: 28px; max-width: 980px; align-items: center; }
  .w-top { grid-column: 2; grid-row: 1; }
  .ring-wrap { grid-column: 1; grid-row: 1 / span 5; width: min(80vh, 46vw); margin: 0; }
  .phase-pill { grid-column: 2; grid-row: 2; justify-self: center; margin-top: 0; }
  .stats { grid-column: 2; grid-row: 3; }
  .caption { grid-column: 2; grid-row: 4; height: 40px; }
  .controls { grid-column: 2; grid-row: 5; justify-self: center; margin-top: 0; }
  .big-time { font-size: min(13vw, 22vh); }
}

/* Completion */
.done-view { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: calc(30px + var(--safe-top)) 24px calc(26px + var(--safe-bottom));
  text-align: center; animation: fade .4s; overflow-y: auto; }
.done-view .check-ring { width: 140px; height: 140px; margin-top: 4vh; }
.done-view .check-ring circle.prog { stroke-dasharray: 440; stroke-dashoffset: 440; animation: draw 1s .1s cubic-bezier(.3,.9,.3,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-view h2 { display: block; font-size: 30px; margin: 22px 0 4px; }
.done-view p { color: var(--text2); margin: 0; font-weight: 600; }
.done-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin: 22px 0; }
.done-stats .stat .num { font-size: 22px; }
.done-view .cta { margin-top: auto; background: linear-gradient(90deg, var(--done1), var(--done2)); box-shadow: 0 12px 30px -8px var(--done2); }
.done-gear { width: 100%; text-align: left; margin-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .done-view .check-ring circle.prog { stroke-dashoffset: 0; }
}

/* Encouragement slider (settings) */
.enc-row { display: block; }
.enc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.enc-head b { font-size: 14px; color: var(--brand); font-variant-numeric: tabular-nums; }
input.enc { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; margin: 8px 0 0; background: transparent; }
input.enc::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); }
input.enc::-moz-range-track { height: 8px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); }
input.enc::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--brand); border: 3px solid var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
input.enc::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); border: 3px solid var(--surface); }
input.enc:disabled { opacity: .4; }
.enc-ticks { display: flex; justify-content: space-between; padding: 0 6px; font-size: 11px; color: var(--text3, var(--text2)); font-variant-numeric: tabular-nums; }

/* A segmented control with more options than fit on one line */
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 30%; min-width: 96px; }
