:root {
  --bg: #0d0f12;
  --bg2: #14171c;
  --card: #1a1e24;
  --card2: #22272f;
  --line: #2c323b;
  --text: #f2f4f7;
  --muted: #9aa3ae;
  --accent: #ff5a36;
  --work: #ff5a36;
  --rest: #2ed47a;
  --transition: #2fa8ff;
  --warmup: #ffb020;
  --cooldown: #9b6bff;
  --ready: #8a93a0;
  --radius: 16px;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); min-height: 100vh; -webkit-font-smoothing: antialiased; }
body.playing { overflow: hidden; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0 0 .3em; line-height: 1.1; }
h1 { font: 800 clamp(30px, 5vw, 48px)/1.05 var(--display); letter-spacing: .01em; text-transform: uppercase; }
h2 { font: 700 26px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font: 700 13px var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: .6em; }
.link { color: var(--accent); font-weight: 600; }
.back { display: inline-block; margin-bottom: 14px; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; }
.gap { gap: 10px; }
.empty { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.ok { color: var(--rest); font-weight: 600; }
.danger { color: #ff6b6b !important; }

/* ---------- Header ---------- */
.app-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 12px max(16px, calc((100vw - 1200px) / 2)); background: rgba(13, 15, 18, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { font: 800 24px var(--display); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.logo b { color: var(--accent); font-weight: 800; }
.logo-mark { color: var(--accent); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.nav a:hover { color: var(--text); background: var(--card); }
.nav a.on { color: var(--text); background: var(--card2); }
.profile-chip { position: relative; }
.chip-btn { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 4px 12px 4px 4px; font: 600 14px var(--sans); cursor: pointer; }
.caret { color: var(--muted); font-size: 11px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 20px 40px rgba(0, 0, 0, .45); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: none; border: 0; color: var(--text); font: 500 14px var(--sans); text-align: left; border-radius: 8px; cursor: pointer; }
.menu button:hover, .menu a:hover { background: var(--card2); }
.menu a { color: var(--accent); border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0 0 8px 8px; }
.avatar { --av: var(--accent); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--av); color: #111; font: 800 13px var(--sans); flex: none; }
.avatar.lg { width: 52px; height: 52px; font-size: 19px; }

.view { max-width: 1200px; margin: 0 auto; padding: 28px 16px 80px; }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font: 600 14px var(--sans); cursor: pointer; transition: transform .08s, background .15s; white-space: nowrap; }
.btn:hover { background: #2a3039; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #ff7150; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--card2); }
.btn-lg { padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--card2); color: var(--muted); font-size: 12px; font-weight: 600; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 6px; font: 700 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; background: rgba(255, 90, 54, .15); color: var(--work); }
.tag-Cardio { background: rgba(47, 168, 255, .15); color: var(--transition); }
.tag-HIIT { background: rgba(255, 176, 32, .15); color: var(--warmup); }
.tag-Mixed { background: rgba(46, 212, 122, .15); color: var(--rest); }
.tag-Sculpt { background: rgba(155, 107, 255, .18); color: var(--cooldown); }
.tag-Express { background: rgba(255, 79, 163, .15); color: #ff4fa3; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
input, select { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: 500 15px var(--sans); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.grid4 label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.span2 { grid-column: span 2; }
.check { display: flex !important; align-items: center; gap: 8px; color: var(--text) !important; font-size: 14px !important; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg label { display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg span { display: block; padding: 7px 14px; border-radius: 9px; color: var(--muted); font: 600 13px var(--sans); }
.seg input:checked + span { background: var(--card2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.swatches { display: flex; gap: 10px; }
.swatches input { position: absolute; opacity: 0; width: 0; }
.swatches span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--sw); cursor: pointer; border: 3px solid transparent; }
.swatches input:checked + span { border-color: var(--text); }

/* ---------- Layout pieces ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.card h3 { margin: 0; font: 700 24px var(--display); text-transform: uppercase; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; }
.workout-card .row { margin-top: auto; }
.feature-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; }
.facts b { color: var(--text); }
.facts.big { font-size: 14px; }
.facts.big b { font: 700 22px var(--display); margin-right: 3px; }
.facts.col { flex-direction: column; gap: 4px; margin-bottom: 14px; }

.strip { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 1px; background: var(--bg); }
.strip i { display: block; min-width: 1px; }
.strip-lg { height: 18px; margin: 14px 0 10px; }
.ph-ready { background: var(--ready); }
.ph-warmup { background: var(--warmup); }
.ph-work { background: var(--work); }
.ph-rest { background: var(--rest); }
.ph-transition { background: var(--transition); }
.ph-cooldown { background: var(--cooldown); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; align-items: center; margin-bottom: 24px; }
.feature-card { background: linear-gradient(145deg, #23191a, var(--card) 55%); border: 1px solid #3a2a27; border-radius: 20px; padding: 24px; display: grid; gap: 12px; }
.feature-card h2 { font-size: 34px; margin: 0; }
.feature-card p { margin: 0; }
.hero > * { min-width: 0; }               /* let the hero columns shrink instead of pushing the page wider */
.feature-card .row { flex-wrap: wrap; }   /* Start / Train with friends / Preview wrap on narrow screens */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; }
.tile-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.tile b { font: 800 38px/1 var(--display); }
.tile small { font-size: 18px; color: var(--muted); }
.meter { height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--rest); border-radius: 4px; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.history li:first-child { border-top: 0; }
.history li > div:first-child { display: grid; }
.history-stats { display: flex; gap: 16px; font-size: 14px; font-variant-numeric: tabular-nums; }
.big-num { font: 800 26px var(--display); color: var(--accent); }

.welcome { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; min-height: 70vh; }
.welcome-fig { width: 200px; height: 240px; margin-top: 10px; }

/* ---------- Profiles ---------- */
.profile-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.profile-card h3 { font-size: 26px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg2); border-radius: 12px; padding: 10px; text-align: center; }
.mini-stats b { display: block; font: 800 26px var(--display); }
.mini-stats span { font-size: 12px; color: var(--muted); }

/* ---------- Stations & figures ---------- */
.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.station { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; justify-items: center; text-align: center; gap: 2px; }
.station b { font-size: 14px; line-height: 1.25; }
.station .muted { font-size: 12px; }
.station-no { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 7px; background: var(--card2); font: 800 14px var(--display); color: var(--muted); }
.station .station-no { position: absolute; top: 8px; left: 8px; }
.station .station-no:empty { display: none; }
.station-fig { width: 90px; height: 110px; }
.reps { font: 800 18px var(--display); color: var(--accent); }
.mini-fig { width: 44px; height: 54px; flex: none; }
.figure { width: 100%; height: 100%; overflow: visible; }
.fig-limb { fill: none; stroke: var(--fig, var(--text)); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.fig-head { fill: var(--fig, var(--text)); }
.fig-back { opacity: .42; }
.fig-ground { stroke: var(--line); stroke-width: 2; stroke-linecap: round; }
.prop-fill { fill: var(--fig-prop, var(--accent)); }
.prop-line { stroke: var(--fig-prop, var(--accent)); stroke-width: 6; stroke-linecap: round; fill: none; }
.prop-bar { stroke-width: 4; }
.prop-plate { fill: none; stroke: var(--fig-prop, var(--accent)); stroke-width: 4; opacity: .7; }
.prop-ring { fill: none; stroke: var(--muted); stroke-width: 3; }

/* ---------- Builder ---------- */
.builder { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.builder-side { position: sticky; top: 84px; }
.block-name { font: 700 22px var(--display); text-transform: uppercase; background: transparent; border-color: transparent; padding: 4px 8px; max-width: 280px; }
.block-name:hover { border-color: var(--line); }
.block-edit select { width: auto; }
.station-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.station-list li { display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; }
.station-list select { flex: 1; width: auto; min-width: 0; }
.reps-in { display: flex !important; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.reps-in input { width: 70px; }
.add-block { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 13px var(--sans); cursor: pointer; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Summary ---------- */
.summary { text-align: center; max-width: 820px; margin: 20px auto; }
.summary h1 { font-size: clamp(40px, 7vw, 68px); }
.summary .tiles { text-align: left; margin: 28px 0; }
.summary .panel { text-align: left; }

/* ================= LIVE PLAYER ================= */
.player { --ph: var(--work); position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto auto auto auto; gap: 14px; padding: 16px max(16px, 3vw) 18px; background: radial-gradient(1200px 700px at 25% 40%, color-mix(in srgb, var(--ph) 22%, transparent), transparent 70%), var(--bg); transition: background .5s; overflow: auto; }
.player[data-phase="rest"] { --ph: var(--rest); }
.player[data-phase="transition"] { --ph: var(--transition); }
.player[data-phase="warmup"] { --ph: var(--warmup); }
.player[data-phase="cooldown"] { --ph: var(--cooldown); }
.player[data-phase="ready"] { --ph: var(--ready); }

.pl-top { display: flex; align-items: center; gap: 24px; }
.pl-title { flex: 1; display: grid; min-width: 0; }
.pl-title b { font: 800 26px var(--display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-title span { color: var(--muted); font-weight: 600; }
.pl-clock { display: grid; text-align: right; }
.pl-clock span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.pl-clock b { font: 700 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 18px; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--card2); }
.icon-btn.lg { width: 58px; height: 58px; font-size: 22px; border-radius: 16px; }
.icon-btn.off { opacity: .35; text-decoration: line-through; }

.pl-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3vw; align-items: center; min-height: 0; }
.pl-timer { display: grid; place-items: center; }
.ring { position: relative; width: min(40vh, 40vw, 500px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 14; }
.ring-fg { fill: none; stroke: var(--ph); stroke-width: 14; stroke-linecap: round; transition: stroke .4s; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--ph) 60%, transparent)); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.pl-phase { font: 800 clamp(22px, 3.6vh, 38px) var(--display); text-transform: uppercase; letter-spacing: .14em; color: var(--ph); }
.pl-secs { font: 800 clamp(80px, 17vh, 190px)/.9 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pl-sub { color: var(--muted); font-weight: 600; font-size: clamp(13px, 1.8vh, 17px); margin-top: 6px; }
.player.final .pl-secs { color: var(--ph); animation: pulse 1s infinite; }
@keyframes pulse { 0% { transform: scale(1.08); } 60% { transform: scale(1); } }
.pl-paused[hidden] { display: none; }
.pl-paused { position: absolute; inset: 18%; display: grid; place-items: center; border-radius: 50%; background: rgba(13, 15, 18, .82); font: 800 44px var(--display); text-transform: uppercase; letter-spacing: .14em; }

.pl-ex { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.pl-ex-label { font: 700 13px var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--ph); }
.pl-fig { height: min(22vh, 300px); aspect-ratio: 3 / 4; --fig: var(--text); --fig-prop: var(--ph); }
.pl-ex.preview .pl-fig { opacity: .7; }
.pl-exname { font: 800 clamp(26px, 5.4vh, 64px)/1 var(--display); margin: 0; text-transform: uppercase; }
.pl-cue { color: var(--muted); font-size: clamp(14px, 2vh, 19px); margin: 0; }
.pl-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { padding: 4px 12px; border-radius: 8px; font: 700 13px var(--sans); text-transform: uppercase; letter-spacing: .06em; background: var(--ph); color: #0d0f12; }
.badge.outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.pl-amrap { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.pl-amrap[hidden] { display: none; }
.amrap-count { display: grid; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 18px; }
.amrap-count span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.amrap-count b { font: 800 40px/1 var(--display); }

.pl-next { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 16px; }
.pl-next-label { font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.pl-next b { font: 700 22px var(--display); text-transform: uppercase; }
.pl-next .mini-fig { width: 36px; height: 44px; }

.pl-stations-head { font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 6px; }
.pl-station-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.pl-station { flex: 1 1 0; min-width: 104px; display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; transition: all .3s; }
.pl-station .mini-fig { width: 30px; height: 38px; }
.pl-st-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.pl-station .station-no:empty { display: none; }
.pl-station.active { border-color: var(--ph); background: color-mix(in srgb, var(--ph) 20%, var(--card)); box-shadow: 0 0 0 1px var(--ph) inset; }
.pl-station.active .station-no { background: var(--ph); color: #0d0f12; }
.pl-station.next { border-color: var(--ph); border-style: dashed; animation: blink 1.2s infinite; }
@keyframes blink { 50% { border-color: transparent; } }

.pl-timeline { position: relative; }
.pl-timeline .strip { margin: 0; height: 16px; cursor: pointer; }
.pl-timeline .strip i { opacity: .55; transition: opacity .3s; }
.pl-timeline .strip i.done { opacity: .18; }
.pl-timeline .strip i.cur { opacity: 1; }
.playhead { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--text); border-radius: 2px; box-shadow: 0 0 8px rgba(255, 255, 255, .7); pointer-events: none; }

.pl-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.pl-transport { display: flex; align-items: center; gap: 18px; }
.pl-toggles { display: flex; gap: 8px; min-width: 100px; }
.pl-toggles:last-child { justify-content: flex-end; }
.play-btn { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--ph); color: #0d0f12; font-size: 26px; font-weight: 900; cursor: pointer; transition: background .4s, transform .08s; box-shadow: 0 8px 30px color-mix(in srgb, var(--ph) 45%, transparent); }
.play-btn:active { transform: scale(.94); }

/* ---------- Weekly plan ---------- */
.tag-Strength { background: rgba(255, 90, 54, .15); color: var(--work); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { --k: var(--line); position: relative; display: grid; align-content: start; justify-items: start; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-top: 3px solid var(--k); border-radius: 12px; padding: 10px; min-height: 92px; }
.day.kind-Strength { --k: var(--work); }
.day.kind-Cardio { --k: var(--transition); }
.day.kind-Mixed { --k: var(--rest); }
.day.rest { border-top-color: var(--line); opacity: .7; }
.day.is-today { box-shadow: 0 0 0 2px var(--text); opacity: 1; }
.day-head { display: flex; justify-content: space-between; width: 100%; font-size: 13px; }
.day-head span { color: var(--muted); font-variant-numeric: tabular-nums; }
.day-rest { color: var(--muted); font-size: 13px; margin-top: auto; }
.day .tag { font-size: 10px; padding: 2px 6px; }
.day-status { font-size: 12px; font-weight: 700; color: var(--muted); }
.day.st-done .day-status { color: var(--rest); }
.day.st-today .day-status { color: var(--text); }
.day.st-missed .day-status { color: var(--warmup); }
.day.st-done { background: color-mix(in srgb, var(--rest) 8%, var(--bg2)); }
.week-big { margin-bottom: 16px; }
.week-big .day { min-height: 190px; padding: 12px; background: var(--card); }
.week-big .day.st-done { background: color-mix(in srgb, var(--rest) 8%, var(--card)); }
.day-name { font: 700 19px/1.05 var(--display); text-transform: uppercase; }
.day-name:hover { color: var(--accent); }
.week-big .day .btn { margin-top: auto; justify-self: stretch; }
.plan-progress { display: grid; min-width: 160px; }
.plan-progress b { font: 800 40px/1 var(--display); }
.plan-progress small { font-size: 20px; color: var(--muted); }
.plan-progress span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.plan-days { display: grid; gap: 8px; margin: 12px 0; }
.plan-day { --k: var(--line); display: grid; grid-template-columns: 64px minmax(0, 1fr) 104px; gap: 12px; align-items: center; padding: 8px 12px; background: var(--bg2); border-radius: 12px; border-left: 4px solid var(--k); cursor: pointer; }
.plan-day.kind-Strength { --k: var(--accent); }
.plan-day.kind-Cardio { --k: var(--rest); }
.plan-day.kind-Mixed { --k: var(--transition); }
.plan-day.is-rest { opacity: .8; }
.plan-day-name { display: grid; line-height: 1.1; }
.plan-day-name b { font: 700 18px var(--display); text-transform: uppercase; }
.plan-day-name span { color: var(--muted); font-size: 12px; }
.plan-day .tag { justify-self: end; }
.plan-rest { justify-self: end; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 560px) { .plan-day { grid-template-columns: 44px minmax(0, 1fr); } .plan-day .tag, .plan-rest { display: none; } }
.plan-rows { display: grid; gap: 10px; margin-bottom: 12px; }
.plan-row { display: grid; grid-template-columns: 120px 180px minmax(0, 1fr); gap: 12px; align-items: end; padding: 10px; background: var(--bg2); border-radius: 12px; }
.plan-row .tag { align-self: center; justify-self: start; }
.plan-row label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.warn { color: var(--warmup); font-weight: 600; font-size: 14px; }
.feature-when { margin: 0; }

/* ---------- Bootcamps & friends ---------- */
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 26px 0 12px; }
.section-head h2 { margin: 0; font-size: 24px; }
.lead { font-size: 16px; color: var(--muted); max-width: 760px; }
.loc-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.loc-bar select { width: auto; min-width: 180px; }
.loc-bar .warn { width: 100%; margin: 0; }
.bc-card { transition: border-color .15s, transform .15s; }
.bc-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.bc-card.kind-home { border-top: 3px solid var(--warmup); }
.bc-card.kind-beach { border-top: 3px solid var(--transition); }
.bc-card.kind-park { border-top: 3px solid var(--rest); }
.bc-card.kind-stairs, .bc-card.kind-other { border-top: 3px solid var(--cooldown); }
.bc-kind { font-size: 13px; font-weight: 600; color: var(--muted); }
.pill-private { background: rgba(255, 176, 32, .15); color: var(--warmup); }
.pill-public { background: rgba(46, 212, 122, .14); color: var(--rest); }
.eq-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.eq-chips span { padding: 4px 10px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.here { color: var(--rest); }
.warn-text { color: var(--warmup); font-weight: 600; font-size: 13px; }
.checkin { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-left: 4px solid var(--warmup); }
.checkin.ok { border-left-color: var(--rest); }
.checkin .warn { width: 100%; margin: 0; }
.picker { border: 1px solid var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; display: grid; gap: 12px; }
.picker .panel-head { margin-bottom: 0; }
.picker p { margin: 0; }
.people-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; }
.pick input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.pick span:last-child { display: grid; line-height: 1.25; }
.pick small { color: var(--muted); font-size: 12px; }
.pick.on { border-color: var(--av); box-shadow: inset 0 0 0 1px var(--av); }
.routine-list { display: grid; gap: 10px; }
.routine { display: flex; justify-content: space-between; gap: 16px; padding: 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; flex-wrap: wrap; }
.routine > div:first-child { display: grid; gap: 4px; flex: 1; min-width: 240px; justify-items: start; }
.routine-name { font: 700 22px var(--display); text-transform: uppercase; }
.routine p { margin: 0; }
.routine-figs { display: flex; gap: 2px; flex-wrap: wrap; }
.routine-figs .mini-fig { width: 34px; height: 42px; }
.routine-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; justify-content: center; min-width: 120px; }
.kind-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.kind-pick label { display: block; cursor: pointer; }
.kind-pick input { position: absolute; opacity: 0; width: 0; }
.kind-pick span { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-weight: 600; font-size: 14px; }
.kind-pick small { color: var(--muted); font-weight: 500; font-size: 12px; }
.kind-pick input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.kind-pick input:disabled + span { opacity: .35; cursor: default; }
.kind-pick input:focus-visible + span { outline: 2px solid var(--accent); }
.bc-form[data-type="public"] .priv-only { display: none; }
.pin-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.eq-pick { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; display: grid; gap: 10px; }
.eq-pick legend { padding: 0 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; margin-top: 6px; }
.friend-card h3 { font-size: 22px; }
.note { margin-top: 24px; border-left: 4px solid var(--transition); }
.note p { margin: 4px 0 0; }
.bc-banner { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; border-left: 4px solid var(--warmup); }
.pl-where { color: var(--warmup); font-weight: 600; font-size: 13px; }
.player.is-many .pl-fig { height: min(15vh, 180px); }
.player.is-many .pl-exname { font-size: clamp(18px, 3vh, 34px); }
.player.is-many .pl-cue { display: none; }
.player.is-many .pl-ex { padding: 10px; }
.player.is-many .ring { width: min(34vh, 24vw, 400px); }

/* ---------- Home: bootcamp or gym ---------- */
.chooser { max-width: 920px; margin: 4vh auto 0; text-align: center; }
.chooser h1 { margin-bottom: 28px; }
.chooser-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.choice { display: grid; justify-items: center; gap: 10px; padding: 32px 24px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer; text-align: center; transition: transform .12s, border-color .15s, box-shadow .15s; }
.choice:hover, .choice:focus-visible { transform: translateY(-3px); outline: none; }
.choice-bootcamp:hover, .choice-bootcamp:focus-visible { border-color: var(--warmup); box-shadow: 0 0 0 1px var(--warmup) inset, 0 16px 40px rgba(255, 176, 32, .12); }
.choice-gym:hover, .choice-gym:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 16px 40px rgba(255, 90, 54, .14); }
.choice-icon { font-size: 54px; line-height: 1; }
.choice > b { font: 800 40px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.choice .muted { max-width: 330px; }
.choice-meta { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }
.mode-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 18px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); font-size: 14px; }
.mode-bar span { margin-right: auto; }
.bc-home-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.bc-home { margin: 0; display: grid; gap: 12px; align-content: start; border-top: 3px solid var(--line); }
.bc-home.kind-home { border-top-color: var(--warmup); }
.bc-home.kind-beach { border-top-color: var(--transition); }
.bc-home.kind-park { border-top-color: var(--rest); }
.bc-home.kind-stairs, .bc-home.kind-other { border-top-color: var(--cooldown); }
.bc-home.is-here { box-shadow: 0 0 0 2px var(--rest); }
.bc-home-head { display: grid; gap: 8px; }
.bc-home h3 { margin: 6px 0 2px; font: 800 26px/1.05 var(--display); text-transform: uppercase; }
.bc-home h3 a:hover { color: var(--accent); }
.bc-routines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bc-routines li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.bc-routines .mini-fig { width: 32px; height: 40px; }
.bc-r-text { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.lock-note { margin: 0; }
.far { margin-top: 18px; }
.far summary { cursor: pointer; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
@media (max-width: 720px) {
  .chooser-grid { grid-template-columns: 1fr; }
  .choice { padding: 22px 18px; }
  .choice-icon { font-size: 40px; }
  .bc-home-list { grid-template-columns: 1fr; }
}

/* ---------- Couples / partners ---------- */
form[data-type="solo"] .duo-only, form[data-type="duo"] .solo-only { display: none; }
.seg-big { display: flex; }
.seg-big label { flex: 1; }
.seg-big span { padding: 10px 16px; text-align: center; font-size: 14px; }
.members { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.member { border: 1px solid var(--line); border-top: 3px solid var(--av); border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 12px; min-width: 0; background: var(--bg2); }
.member legend { padding: 0 6px; font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--av); }
.member .seg { display: flex; }
.member .seg label { flex: 1; }
.member .seg span { padding: 7px 6px; text-align: center; font-size: 12px; }
.member .swatches span { width: 24px; height: 24px; }
.avatar-pair { display: inline-flex; }
.avatar-pair .avatar + .avatar { margin-left: -9px; box-shadow: 0 0 0 2px var(--card); }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.member-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.member-list li { display: flex; align-items: center; gap: 10px; background: var(--bg2); border-radius: 10px; padding: 6px 10px; }
.member-list .avatar { width: 24px; height: 24px; font-size: 10px; }
.partner-panel { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.mode-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.mode-card { cursor: pointer; }
.mode-card input { position: absolute; opacity: 0; width: 0; }
.mode-card span { display: grid; gap: 2px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); min-width: 220px; }
.mode-card small { color: var(--muted); font-size: 12px; }
.mode-card input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mode-card input:focus-visible + span { outline: 2px solid var(--accent); }
.partner-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 16px; }
.partner-result { border-top: 3px solid var(--av); display: grid; gap: 14px; margin: 0; }

/* partner lanes in the live player */
.pl-team { display: flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 13px; }
.pl-team .avatar + .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--bg); }
.pl-team span:last-child { margin-left: 8px; }
.pl-lanes { display: grid; gap: 16px; min-width: 0; }
.player.is-duo .pl-main { grid-template-columns: auto minmax(0, 1fr); gap: 2.5vw; }
.player.is-duo .ring { width: min(38vh, 30vw, 460px); }
.player.is-duo .pl-lanes { grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
.player.is-duo .pl-ex { background: color-mix(in srgb, var(--card) 80%, transparent); border: 1px solid var(--line); border-top: 4px solid var(--av); border-radius: 18px; padding: 12px 16px 16px; justify-items: center; text-align: center; align-content: start; height: 100%; }
.player.is-duo .pl-fig { height: min(20vh, 240px); }
.player.is-duo .pl-exname { font-size: clamp(22px, 4vh, 46px); }
.player.is-duo .pl-meta { justify-content: center; }
.player.is-duo .pl-amrap { flex-wrap: wrap; justify-content: center; }
.lane-head { display: flex; align-items: center; gap: 8px; justify-self: stretch; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.lane-head b { font: 800 22px var(--display); text-transform: uppercase; color: var(--av); }
.lane-head .muted { margin-left: auto; font-size: 12px; font-weight: 600; }
.pl-variant { margin: 2px 0 0; font-size: clamp(13px, 1.8vh, 16px); font-weight: 600; }
.pl-variant span { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 6px; background: var(--av, var(--ph)); color: #0d0f12; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; vertical-align: 1px; }
.pl-variant[hidden] { display: none; }
.st-who { display: inline-flex; margin-left: auto; }
.st-who .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--card); }
.pl-station { position: relative; }
.pl-next { flex-wrap: wrap; }
.next-who { display: inline-flex; align-items: center; gap: 8px; }
.next-who + .next-who { padding-left: 14px; border-left: 1px solid var(--line); }
.next-who .muted { font-size: 14px; }
.next-dur { margin-left: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero, .welcome, .builder { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .builder-side { position: static; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .app-header { flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .profile-chip { margin-left: auto; }
  .welcome { min-height: 0; }
  .week-big { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .week-big .day.rest { min-height: 0; }
  .plan-row { grid-template-columns: 1fr 1fr; }
  .plan-row .tag { grid-column: span 2; }
}
@media (max-width: 560px) {
  .week { gap: 4px; }
  .week:not(.week-big) .day { padding: 6px 4px; min-height: 76px; }
  .week:not(.week-big) .day .tag { font-size: 8px; padding: 1px 3px; letter-spacing: 0; }
  .week:not(.week-big) .day-status { font-size: 10px; }
  .week:not(.week-big) .day-head { flex-direction: column; }
  .week-big { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .player { grid-template-rows: auto auto auto auto auto auto; gap: 12px; }
  .pl-main { grid-template-columns: minmax(0, 1fr); justify-items: center; min-height: auto; gap: 10px; }
  .pl-clock-elapsed, .pl-team { display: none !important; }
  .pl-station { min-width: 120px; }
  .ring { width: min(62vw, 34vh, 340px); }
  .pl-ex { justify-items: center; text-align: center; }
  .pl-fig { height: 120px; }
  .pl-meta { justify-content: center; }
  .pl-clock b { font-size: 20px; }
  .pl-top { gap: 12px; }
  .pl-title b { font-size: 20px; }
  .pl-toggles { min-width: 0; }
  .pl-transport { gap: 10px; }
  .grid2 { grid-template-columns: 1fr; }
  .members, .partner-results { grid-template-columns: 1fr; }
  .player.is-duo .pl-main { grid-template-columns: minmax(0, 1fr); }
  .player.is-many .pl-lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player.is-many .ring { width: min(56vw, 30vh, 300px); }
  .player.is-duo .ring { width: min(56vw, 30vh, 300px); }
  .player.is-duo .pl-lanes { gap: 8px; width: 100%; }
  .player.is-duo .pl-ex { padding: 8px 8px 12px; }
  .player.is-duo .pl-fig { height: 90px; }
  .player.is-duo .pl-exname { font-size: 20px; }
  .player.is-duo .pl-cue { display: none; }
  .lane-head b { font-size: 17px; }
  .lane-head .muted { display: none; }
  .pl-team span:last-child { display: none; }
  .mode-card span { min-width: 0; }
}

/* ================= App shell (installed app / phone) ================= */
.nav-ic { display: none; }
#install-btn { flex: none; }
.app-header { padding-top: max(12px, env(safe-area-inset-top)); }
.player { padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(18px, env(safe-area-inset-bottom)); }
/* landscape on iPhone: keep the workout clear of the Dynamic Island / notch on the sides too */
@supports (padding: max(0px)) {
  .player { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
}

@media (max-width: 720px) {
  /* phone: logo + profile up top, native-style tab bar at the bottom */
  /* no backdrop-filter here: it would trap the fixed tab bar inside the header */
  .app-header { flex-wrap: nowrap; padding-bottom: 10px; backdrop-filter: none; background: var(--bg); }
  .logo { font-size: 21px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; order: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
    padding: 6px 4px max(8px, env(safe-area-inset-bottom));
    background: rgba(13, 15, 18, .94); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .nav a { display: grid; justify-items: center; gap: 2px; padding: 4px 2px; border-radius: 10px; font-size: 11px; font-weight: 600; background: none !important; }
  .nav a.on { color: var(--accent); }
  .nav .nav-ic { display: block; font-size: 21px; line-height: 1.1; }
  .nav .nav-desktop { display: none; }
  .view { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .chip-name { display: none; }
  /* 3–4 people on a phone: compact lanes side by side (2×2 for four) */
  .player.is-many .pl-lanes { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; }
  .player.is-four .pl-lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player.is-many .pl-ex { padding: 6px 6px 10px; gap: 3px; }
  .player.is-many .pl-fig { height: 72px; }
  .player.is-many .pl-exname { font-size: 15px; }
  .player.is-many .pl-ex-label { font-size: 10px; letter-spacing: .1em; }
  .player.is-many .pl-variant { font-size: 11px; line-height: 1.3; }
  .player.is-many .pl-variant span { font-size: 9px; padding: 0 5px; }
  .player.is-many .badge { font-size: 10px; padding: 2px 6px; }
  .player.is-many .lane-head { gap: 5px; }
  .player.is-many .lane-head b { font-size: 14px; }
  .player.is-many .lane-head .avatar { width: 20px; height: 20px; font-size: 9px; }
  .chip-btn { padding-right: 8px; }
  #install-btn { padding: 6px 10px; }
}

/* ================= Seasonal program ================= */
.season { display: grid; gap: 14px; border-top: 4px solid var(--rest); }
.season-summer { border-top-color: var(--warmup); }
.season-autumn { border-top-color: var(--accent); }
.season-winter { border-top-color: var(--transition); }
.season-head { display: flex; gap: 16px; align-items: flex-start; }
.season-head h2 { margin: 0 0 4px; font-size: 32px; }
.season-head p { margin: 0; }
.season-icon { font-size: 46px; line-height: 1; }
.season-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.season-facts span { padding: 6px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; }
.wave { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.wave div { display: grid; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); }
.wave div b { font: 700 16px var(--display); text-transform: uppercase; }
.wave div span { font-size: 11px; }
.wave div.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 14%, var(--bg2)); }
.year { display: flex; flex-wrap: wrap; gap: 6px; }
.year span { display: grid; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); }
.year span small { font-weight: 500; font-size: 11px; }
.year span.on { color: var(--text); border-color: var(--text); }
.why summary { cursor: pointer; font-weight: 700; }
.why ul { margin: 10px 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.season-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.prog-card { border-top: 3px solid var(--rest); }
.prog-label { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-top: 2px; }
.pill-today { background: var(--accent); color: #fff; font-size: 11px; padding: 2px 8px; }
.prog-here li.is-next { border-color: var(--accent); }
.swaps { font-size: 12px; margin-top: 2px; }
.swaps summary { cursor: pointer; color: var(--warmup); font-weight: 600; }
.swaps div { color: var(--muted); padding-left: 10px; }
.swaps div b { color: var(--text); }

/* "Equipment busy?" swaps in the live player */
.pl-swap, .swap-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pl-swap[hidden] { display: none; }
.swap-q { font-size: 12px; font-weight: 700; color: var(--warmup); }
.swap-chip { padding: 6px 10px; border-radius: 999px; border: 1px dashed var(--warmup); background: color-mix(in srgb, var(--warmup) 10%, transparent); color: var(--text); font: 600 12px var(--sans); cursor: pointer; }
.swap-chip:hover { background: color-mix(in srgb, var(--warmup) 22%, transparent); border-style: solid; }
.next-swap { flex-basis: 100%; display: grid; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.player.is-duo .pl-swap { justify-content: center; }
.player.is-many .swap-q { display: none; }
.player.is-many .swap-chip { font-size: 10px; padding: 4px 6px; }

/* ================= Combined workout sheet & invites ================= */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(5, 6, 8, .72); display: grid; place-items: end center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; margin: 0; display: grid; gap: 14px; border-color: var(--accent); box-shadow: 0 -10px 50px rgba(0, 0, 0, .5); animation: up .2s ease-out; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet .panel-head { margin: 0; }
.sheet p { margin: 0; }
@media (min-width: 721px) { .sheet-backdrop { place-items: center; } }
.invite-panel { border-left: 4px solid var(--accent); }
.invite-panel h3 { margin-bottom: 12px; }
.invite-form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: end; }
.invite-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.invite-flash { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--rest) 12%, var(--bg2)); border: 1px solid color-mix(in srgb, var(--rest) 40%, var(--line)); font-size: 14px; }
.invite-panel .muted.small { margin: 10px 0 0; }
.invite-card { border-color: var(--accent); }
.invite-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.invite-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.invite-list li > div:first-child { display: grid; margin-right: auto; }
.warn-note { border-left-color: var(--warmup); }
.invite-page { max-width: 640px; margin: 6vh auto; display: grid; gap: 14px; }
.invite-page h1 { font-size: clamp(28px, 5vw, 40px); }
.invite-page p { margin: 0; }
@media (max-width: 720px) { .invite-form { grid-template-columns: 1fr; } }

/* ================= Casting ================= */
.cast-sheet { position: absolute; z-index: 5; top: 72px; right: max(16px, 3vw); width: min(420px, calc(100vw - 32px)); max-height: calc(100% - 90px); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); display: grid; gap: 14px; }
.cast-sheet[hidden] { display: none; }
.cast-sheet h3 { margin: 0; font: 800 24px var(--display); text-transform: uppercase; }
.cast-opt { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.cast-opt b { font-size: 15px; }
.cast-opt p { margin: 0; }
.cast-code { display: flex; gap: 8px; }
.cast-code input { font: 800 26px var(--display); letter-spacing: .3em; text-align: center; }
.cast-status { font-weight: 600; font-size: 14px; color: var(--warmup); }
.cast-status.ok { color: var(--rest); }
.icon-btn.casting { background: var(--rest); color: #0d0f12; border-color: var(--rest); }
.player.is-follower .pl-controls, .player.is-follower [data-pl="exit"], .player.is-follower [data-pl="cast"], .player.is-follower [data-pl="round"], .player.is-follower [data-pl="unround"] { display: none !important; }
.player.is-follower { grid-template-rows: auto 1fr auto auto auto; }

/* the screen (TV) page */
.screen-wait { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; padding: 24px;
  background: radial-gradient(900px 500px at 50% 30%, rgba(255, 90, 54, .16), transparent 70%), var(--bg); }
.screen-wait h1 { font-size: clamp(34px, 6vw, 70px); margin: 0; }
.screen-code { font: 800 clamp(70px, 16vw, 190px)/1 var(--display); letter-spacing: .18em; color: var(--accent); padding-left: .18em; }
.screen-steps { color: var(--muted); font-size: clamp(16px, 2vw, 22px); max-width: 760px; }
.screen-steps b { color: var(--text); }
.screen-ok { font: 700 22px var(--sans); color: var(--rest); }
.screen-logo { font: 800 30px var(--display); text-transform: uppercase; }
.screen-logo b { color: var(--accent); }

/* demo mode inside the preview phone frames: room for the notch, no scrollbars */
html.demo { scrollbar-width: none; }
html.demo #install-btn { display: none !important; }
html.demo .player { scrollbar-width: none; }
html.demo .player::-webkit-scrollbar { display: none; }
html.demo::-webkit-scrollbar { display: none; }
/* same top safe area as a Dynamic Island iPhone (≈54 px), so the preview shows what a real phone shows */
html.demo .app-header { padding-top: 54px; }
html.demo .player { padding-top: 56px; }
html.demo.tv .player { padding-top: 16px; }

/* ================= Phone: the live workout always fits one screen (no scrolling) ================= */
@media (max-width: 720px) {
  .player { height: 100dvh; overflow: hidden; grid-template-rows: auto minmax(0, 1fr) auto auto auto auto; gap: 8px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .player.is-follower { grid-template-rows: auto minmax(0, 1fr) auto auto auto; }
  /* the middle area takes whatever height is left; ring + figure scale to it (cqh = % of that height) */
  .pl-main { container-type: size; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: 4px; min-height: 0; overflow: hidden; }
  /* the ring fills whatever height the move details leave over */
  .pl-timer { flex: 1 1 0; min-height: 0; width: 100%; display: flex; justify-content: center; align-items: center; }
  .pl-lanes { flex: none; width: 100%; }
  .pl-ex { gap: 3px; }
  .ring, .player.is-duo .ring, .player.is-many .ring { width: auto; height: 100%; aspect-ratio: 1; max-height: min(66vw, 320px); container-type: size; }
  .player.is-duo .ring { max-height: min(56vw, 260px); }
  .player.is-many .ring { max-height: min(48vw, 220px); }
  .pl-phase { font-size: max(10px, 10cqw); letter-spacing: .1em; }
  .pl-secs { font-size: 36cqw; }
  .pl-sub { font-size: max(9px, 5.5cqw); margin-top: 2px; }
  .pl-paused { font-size: 10cqw; }
  .pl-swap { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .pl-swap::-webkit-scrollbar { display: none; }
  .pl-swap > * { flex: none; }
  .pl-fig { height: clamp(40px, 15cqh, 120px); }
  .pl-exname { font-size: clamp(20px, 6cqh, 34px); }
  .pl-cue { font-size: 13px; }
  .pl-ex-label { font-size: 11px; }
  .pl-meta .badge { font-size: 11px; padding: 2px 8px; }
  .player.is-duo .pl-fig { height: clamp(34px, 12cqh, 90px); }
  .player.is-duo .pl-exname { font-size: clamp(15px, 4.6cqh, 20px); }
  .player.is-duo .pl-ex { padding: 6px 6px 8px; }
  .player.is-many .pl-fig { height: clamp(28px, 8cqh, 72px); }
  .player.is-four .pl-fig { height: clamp(24px, 5cqh, 60px); }
  .player.is-many .pl-exname { font-size: clamp(12px, 3.4cqh, 15px); }
  /* bottom rows: compact */
  .pl-next { padding: 6px 12px; gap: 10px; }
  .pl-next b { font-size: 17px; }
  .pl-next .mini-fig { width: 26px; height: 32px; }
  .pl-stations-head { margin-bottom: 4px; font-size: 11px; }
  /* numbered chips; only the current / next station shows its name (the ring + Up next already say the rest) */
  .pl-station-row { gap: 5px; scroll-behavior: smooth; }
  .pl-station { flex: none; min-width: 0; padding: 3px; gap: 6px; border-radius: 9px; }
  .pl-station .station-no { min-width: 24px; height: 24px; font-size: 13px; padding: 0 4px; }
  .pl-station .mini-fig, .pl-station .pl-st-name, .pl-station .reps { display: none; }
  .pl-station.active .pl-st-name, .pl-station.next .pl-st-name { display: block; white-space: nowrap; font-size: 13px; padding-right: 6px; }
  .pl-station-row.is-special .pl-station { padding: 4px 10px; }
  .pl-station-row.is-special .pl-st-name { display: block; white-space: nowrap; font-size: 12px; }
  .pl-station .st-who:empty { display: none; }
  .pl-station-row { scrollbar-width: none; }
  .pl-station-row::-webkit-scrollbar { display: none; }
  .pl-timeline .strip { height: 10px; }
  .icon-btn { width: 40px; height: 40px; }
  .icon-btn.lg { width: 48px; height: 48px; font-size: 19px; }
  .play-btn { width: 64px; height: 64px; font-size: 22px; }
  /* group "Up next" + swap chips: one row each, swipe sideways instead of stacking */
  .next-whos { display: flex; flex: 1; min-width: 0; gap: 10px; overflow-x: auto; scrollbar-width: none; }
  .next-whos::-webkit-scrollbar, .next-swap::-webkit-scrollbar { display: none; }
  .next-whos .next-who { flex: none; }
  .next-whos .next-who .muted { display: none; }
  .player.is-duo .pl-next .mini-fig { display: none; }
  .next-swap { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-top: 5px; }
  .next-swap .swap-line { flex: none; flex-wrap: nowrap; }
  .swap-chip { padding: 5px 9px; white-space: nowrap; }
  .player.is-many .pl-meta .badge:not(:first-child) { display: none; }
}
@media (min-width: 721px) { .next-whos { display: contents; } }
/* short phones (older/smaller screens): drop the cue text */
@container (max-height: 380px) { .pl-cue { display: none; } }
@container (max-height: 330px) { .pl-ex-label, .pl-meta { display: none; } .pl-fig { height: 36px; } }
@container (max-height: 300px) { .player.is-many .pl-variant { display: none; } }
@container (max-height: 270px) { .pl-fig, .pl-variant { display: none; } }
@media (max-width: 720px) { .ring, .player.is-duo .ring, .player.is-many .ring { min-height: 104px; } }

/* ================= Training partners ================= */
/* Home: "Your group this week" strip (kept compact so the Bootcamp/Gym cards stay on screen) */
.group-strip { max-width: 560px; margin: 20px auto 0; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; display: grid; gap: 4px; transition: box-shadow .3s; }
.group-strip.is-empty { display: none; }
.group-strip:not(.has-group) { padding: 0; }
.group-strip.flash { box-shadow: 0 0 0 2px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 40%, transparent); }
.gs-head { display: flex; justify-content: space-between; align-items: baseline; font: 700 15px var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gs-row { display: grid; grid-template-columns: 22px 64px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 32px; }
.gs-row > b, .gs-name b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-name { all: unset; cursor: pointer; min-width: 0; text-decoration: underline dotted color-mix(in srgb, var(--text) 40%, transparent); text-underline-offset: 3px; }
.gs-name:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.gs-sq { display: flex; gap: 4px; flex-wrap: wrap; }
.sq { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--line); background: transparent; }
.sq.on { background: var(--accent); border-color: var(--accent); }
.gs-nudge { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.gs-nudge:disabled { opacity: .55; cursor: default; }
.gs-fire { font-size: 12px; font-weight: 700; color: var(--warmup); white-space: nowrap; }
.gs-cta { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 10px 12px; color: var(--text); text-decoration: none; }
.gs-cta b { font: 700 16px var(--display); text-transform: uppercase; }
.gs-cta .muted { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* partner's recent sessions */
.ps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ps-list li { display: grid; gap: 2px; padding: 10px 12px; background: var(--bg2); border-radius: 10px; }
.ps-list span { color: var(--muted); font-size: 13px; }
/* partners page */
.auth-form { display: grid; gap: 12px; max-width: 420px; }
.auth-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.auth-form .seg button { all: unset; cursor: pointer; padding: 7px 14px; border-radius: 9px; color: var(--muted); font: 600 13px var(--sans); }
.auth-form .seg button.on { background: var(--card2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.auth-form .seg { justify-self: start; }
.pg-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.pg-list li { display: flex; align-items: center; gap: 10px; }
.invite-box { margin-top: 14px; padding: 14px; border: 1px dashed var(--accent); border-radius: 12px; display: grid; gap: 10px; justify-items: start; }
.invite-code { font: 800 40px/1 var(--display); letter-spacing: .22em; color: var(--accent); }
.invite-link { display: flex; gap: 8px; width: 100%; }
.invite-link input { flex: 1; min-width: 0; }
.code-form { display: flex; gap: 8px; max-width: 320px; }
.code-form input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .2em; font-weight: 700; }
.switch-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.switch-row span { display: grid; }
.switch-row small { color: var(--muted); }
.pn-device { margin: 6px 0 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ok-text { color: var(--rest); font-weight: 600; font-size: 14px; }
.join-card { text-align: center; display: grid; gap: 10px; justify-items: center; }
.join-card h2 { margin: 0; }
.join-icon { font-size: 40px; margin: 0; }
.partners-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; color: var(--text); text-decoration: none; border-left: 4px solid var(--accent); }
.partners-card small { display: block; color: var(--muted); }
.pc-icon { font-size: 28px; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 120; background: var(--card2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-weight: 600; pointer-events: none; transition: all .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) {
  /* phone home: compact side-icon cards so the group strip + both choices fit on one screen */
  .chooser { margin-top: 0; }
  .chooser .eyebrow { margin-bottom: 2px; }
  .chooser h1 { margin-bottom: 12px; font-size: 25px; line-height: 1.05; }
  .choice-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-self: stretch; min-width: 0; text-align: left; }
  .choice > b { line-height: 1; }
  .chooser-grid { gap: 10px; }
  .choice { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; gap: 4px 14px; padding: 14px 16px; border-radius: 18px; }
  .choice-icon { grid-row: span 2; font-size: 34px; align-self: center; }
  .choice > b { font-size: 28px; }
  .choice .muted { display: none; }
  .choice-meta { font-size: 12px; padding: 4px 10px; max-width: 100%; }
  .group-strip { margin: 12px 0 0; }
  .gs-row { grid-template-columns: 22px 52px minmax(0, 1fr) auto; gap: 6px; min-height: 28px; }
  .group-strip { padding: 6px 12px; gap: 2px; }
  .gs-head { font-size: 13px; }
  .sq { width: 14px; height: 14px; }
}

/* ================= Spacing on phones: one scale (8 · 12 · 16 · 24 px) everywhere ================= */
@media (max-width: 720px) {
  .view { padding-top: 16px; }
  .page-head { margin-bottom: 16px; gap: 12px; align-items: center; }
  .page-head h1 { margin-bottom: 4px; }
  .page-head p { margin: 0; }
  .page-head > * { min-width: 0; }
  .page-head .row, .panel-head .row { flex-wrap: wrap; gap: 8px; }  /* action buttons wrap instead of widening the page */
  .panel-head { flex-wrap: wrap; gap: 8px; }
  .builder { grid-template-columns: minmax(0, 1fr); }
  .builder > *, .builder fieldset, .builder .panel, .builder-main > * { min-width: 0; }
  .station-list li { gap: 6px; padding: 6px 4px; min-width: 0; }
  .station-list li > * { min-width: 0; }
  .station-list .mini-fig { width: 26px; height: 32px; flex: none; }
  .station-list .btn { flex: none; padding: 6px 8px; }
  .eyebrow { margin-bottom: 4px; }
  .mb-pre { display: none; }                      /* "Training at:" label: the icon + place say it */
  .panel { padding: 16px; margin-bottom: 12px; }
  .card { padding: 16px; gap: 10px; }
  .cards, .bc-home-list, .partner-results, .members { gap: 12px; }
  .section-head { margin: 24px 0 12px; gap: 2px 10px; }
  .section-head h2 { font-size: 21px; }
  .tiles { gap: 8px; }
  .tile { padding: 12px 14px; }
  .hero { gap: 16px; margin-bottom: 16px; }
  .feature-card { padding: 16px; gap: 10px; border-radius: 16px; }
  .feature-card h2 { font-size: 28px; }
  .feature-card .row { gap: 8px; }
  .feature-card .btn-lg { flex: 1 1 100%; }
  /* "Training at" bar: one tidy row */
  .mode-bar { flex-wrap: nowrap; gap: 6px; padding: 6px 6px 6px 12px; margin-bottom: 16px; }
  .mode-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mode-bar .btn { padding: 6px 10px; flex: none; }
  /* location panel: text, then a full-width row of controls */
  .loc-bar { gap: 12px; }
  .loc-bar > .row { width: 100%; gap: 8px; flex-wrap: nowrap; }
  .loc-bar select { flex: 1; min-width: 0; }
  /* plan: week cards size to their content (no empty space) */
  .week-big { gap: 8px; }
  .week-big .day { min-height: 0; padding: 12px; gap: 4px; }
  .week-big .day .btn { margin-top: 8px; }
  .week-big .day.rest { padding: 10px 12px; }
  .week-big .day-rest { margin-top: 0; }
  /* Friends: training partners card gets the full width for its text */
  .partners-card { grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
  .partners-card .link { display: none; }
  .pc-icon { font-size: 24px; }
}

/* ================= Phone preview page ================= */
.preview-page { padding: 28px 16px 60px; max-width: 1500px; margin: 0 auto; }
.preview-page h1 { text-align: center; }
.preview-page > p { text-align: center; color: var(--muted); max-width: 760px; margin: 0 auto 28px; }
.phones { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.phone { display: grid; justify-items: center; gap: 12px; }
.phone-frame { width: 312px; height: 675px; border-radius: 46px; padding: 12px; background: #050607; box-shadow: 0 0 0 2px #2c323b, 0 30px 60px rgba(0, 0, 0, .55); position: relative; }
.phone-frame::before { content: ''; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 92px; height: 24px; border-radius: 14px; background: #050607; z-index: 2; }
.phone-screen { width: 288px; height: 651px; border-radius: 36px; overflow: hidden; position: relative; background: var(--bg); }
.phone-screen iframe { width: 390px; height: 882px; border: 0; transform: scale(.7385); transform-origin: 0 0; }
.phone b, .tv b { font: 700 18px var(--display); text-transform: uppercase; letter-spacing: .04em; }
.phone span, .tv span { color: var(--muted); font-size: 13px; text-align: center; max-width: 300px; }
.tv { display: grid; justify-items: center; gap: 12px; margin-top: 40px; }
.tv-frame { width: min(960px, 92vw); aspect-ratio: 16 / 9; padding: 12px; border-radius: 16px; background: #050607; box-shadow: 0 0 0 2px #2c323b, 0 30px 60px rgba(0, 0, 0, .55); }
.tv-screen { width: 100%; height: 100%; overflow: hidden; border-radius: 6px; position: relative; }
.tv-screen iframe { width: 1280px; height: 720px; border: 0; transform-origin: 0 0; }
.tv-stand { width: 160px; height: 14px; border-radius: 0 0 10px 10px; background: #1a1e24; margin-top: -12px; }
