:root {
  --bg: #131313;          /* warm black */
  --panel: #1c1b1b;
  --panel-2: #232221;
  --border: #2a2a2a;
  --text: #e5e2e1;
  --muted: rgba(229, 226, 225, 0.55);
  --muted-2: rgba(229, 226, 225, 0.4);
  --accent: #14a384;      /* teal */
  --accent-bright: #1fc09d;
  --accent-ink: #06231c;  /* text on teal */
  --good: #1fc09d;
  --warn: #d4a72c;
  --bad: #e5534b;
  --cam: radial-gradient(120% 90% at 50% 32%, #26231f 0%, #171614 55%, #0e0d0c 100%);
  --sans: Inter, system-ui, -apple-system, sans-serif;
  --mono: "Space Grotesk", ui-monospace, sans-serif;
  --serif: Newsreader, Georgia, serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
}
body { overflow: hidden; }

/* eyebrow / micro-label used everywhere */
.eyebrow, .repLabel, .repEyebrow, .metric small, .figCaption, .libMuscles,
.ssStep, .historyHead h3, .tabPanel h3, .stat small {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
}

@keyframes cuePop {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.94); }
  60% { transform: translateX(-50%) translateY(-2px) scale(1.02); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(31,192,157,.5); }
  70% { box-shadow: 0 0 0 8px rgba(31,192,157,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,192,157,0); }
}

/* =====================================================   MOBILE-FIRST: full-screen camera + floating controls
   ============================================================ */
.app { height: 100vh; height: 100dvh; }
.topbar { display: none; }
.stage { position: relative; }

.videoWrap { position: fixed; inset: 0; z-index: 0; background: var(--cam); }
.frameBox { position: absolute; inset: 0; overflow: hidden; background: var(--cam); }
#frame {
  position: absolute; inset: 0; z-index: 1;
  transform-origin: 50% 50%; transform: scaleX(-1); will-change: transform;
}
#video, #overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* subtle diagonal texture over the camera (matches design) */
.frameBox::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(229,226,225,.025) 0 2px, transparent 2px 16px);
}

.statusMsg {
  position: absolute; z-index: 5; left: 28px; right: 28px; bottom: 240px;
  padding: 18px 20px; border-radius: 16px;
  background: rgba(19,19,19,.72); backdrop-filter: blur(16px);
  border: 1px solid rgba(229,226,225,.14);
  text-align: center; font-size: 16px; line-height: 1.5; font-weight: 500;
}
.statusMsg.hidden { display: none; }
.statusMsg b { color: var(--accent-bright); }

/* HUD — reps (top-left), account (top-right) */
.hud {
  position: absolute; top: max(20px, env(safe-area-inset-top)); left: 20px; right: 16px;
  z-index: 5; display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; pointer-events: none;
}
.hudLeft { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.repEyebrow { font-size: 10px; color: var(--muted); }
.repbox { display: flex; flex-direction: column; }
.repNum {
  font-family: var(--mono); font-weight: 700; font-size: 104px; line-height: .95;
  letter-spacing: -0.04em; text-shadow: 0 2px 24px rgba(0,0,0,.5);
}
.repLabel { font-family: var(--serif); font-style: italic; font-weight: 400;
  text-transform: none; letter-spacing: 0; font-size: 20px; color: var(--muted); margin-top: 2px; }
.repLabel:empty { display: none; }

.metrics { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.metric {
  padding: 5px 10px; border-radius: 999px;
  background: rgba(19,19,19,.55); border: 1px solid rgba(229,226,225,.12);
  backdrop-filter: blur(8px); display: inline-flex; align-items: baseline; gap: 5px;
}
.metric span { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.metric small { font-size: 9px; letter-spacing: .1em; color: var(--muted); }
.tag.good { color: var(--good); }
.tag.warn { color: var(--warn); }
.tag.bad { color: var(--bad); }

/* Equipment-detection badge (under the metrics) */
.gearBadge {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(6,35,28,.7); border: 1px solid rgba(31,192,157,.45);
  backdrop-filter: blur(8px); pointer-events: none;
  animation: gearPop .25s ease-out;
}
.gearBadge.hidden { display: none; }
.gearIcon { font-size: 13px; line-height: 1; }
.gearName { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--text); }
.gearScore { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .05em; color: var(--accent-bright); }
@keyframes gearPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Manual zoom control (right-center over the camera) */
.zoomCtl {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px; border-radius: 999px;
  background: rgba(19,19,19,.55); border: 1px solid rgba(229,226,225,.14);
  backdrop-filter: blur(10px);
}
.zoomCtl.locked { border-color: rgba(31,192,157,.5); background: rgba(6,35,28,.55); }
.zoomBtn {
  width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%;
  border: 1px solid rgba(229,226,225,.16); background: rgba(229,226,225,.08);
  color: var(--text); font-size: 22px; font-weight: 500; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, background .18s ease;
}
.zoomBtn:hover { background: rgba(229,226,225,.16); }
.zoomBtn:active { transform: scale(.92); }
.zoomLevel {
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .06em;
  color: var(--muted); min-width: 34px; text-align: center;
}
.zoomCtl.locked .zoomLevel { color: var(--accent-bright); }

/* Exit-full-screen button (only visible in immersive workout mode) */
.immersiveExit {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 12;
  width: 42px; height: 42px; border-radius: 50%; display: none;
  align-items: center; justify-content: center;
  background: rgba(19,19,19,.6); border: 1px solid rgba(229,226,225,.16);
  backdrop-filter: blur(10px); color: var(--text); cursor: pointer;
  transition: transform .12s ease, background .18s ease;
}
.immersiveExit:hover { background: rgba(19,19,19,.82); }
.immersiveExit:active { transform: scale(.94); }
.immersiveExit svg { width: 20px; height: 20px; }
body.immersive .immersiveExit { display: flex; }

/* Account button (top-right) */
.acctBtn {
  pointer-events: auto; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid rgba(229,226,225,.2);
  background: rgba(19,19,19,.5); backdrop-filter: blur(8px); color: var(--text);
  font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; flex-shrink: 0;
}
.acctBtn.avatarOnly { padding: 0; width: 40px; justify-content: center; background: var(--panel-2); }
.acctBtnImg {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-weight: 600; font-size: 14px;
}

/* Now-playing strip */
.nowPlaying {
  position: absolute; z-index: 5; top: max(78px, calc(env(safe-area-inset-top) + 58px));
  left: 50%; transform: translateX(-50%);
  height: 32px; padding: 0 14px; border-radius: 999px;
  background: rgba(19,19,19,.6); border: 1px solid rgba(229,226,225,.14); backdrop-filter: blur(12px);
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .16em;
  color: rgba(229,226,225,.85); white-space: nowrap; text-transform: uppercase;
}
.nowPlaying.hidden { display: none; }
.nowPlaying::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good);
  animation: pulseRing 2.2s ease-out infinite; flex-shrink: 0;
}

/* Coaching cue — the signature moment */
.cue {
  position: absolute; left: 50%; bottom: 210px; transform: translateX(-50%);
  z-index: 6; width: 100%; text-align: center; padding: 26px 0 30px;
  background: radial-gradient(ellipse 62% 100% at 50% 50%, rgba(13,13,12,.82) 0%, rgba(13,13,12,.6) 55%, transparent 100%);
  opacity: 0; pointer-events: none;
}
.cue.show { opacity: 1; animation: cuePop .45s cubic-bezier(.22,1,.36,1) both; }
.cueEyebrow {
  display: block; font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .2em; margin-bottom: 6px; color: var(--muted);
}
.cueText {
  display: block; font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 46px; line-height: 1; color: var(--text);
}
.cue.good .cueEyebrow { color: rgba(31,192,157,.85); }
.cue.good .cueText { color: var(--good); text-shadow: 0 2px 36px rgba(20,163,132,.4); }
.cue.warn .cueEyebrow { color: rgba(212,167,44,.9); }
.cue.warn .cueText { color: var(--warn); text-shadow: 0 2px 36px rgba(212,167,44,.3); }
.cue.bad .cueEyebrow { color: rgba(229,83,75,.85); }
.cue.bad .cueText { color: var(--bad); text-shadow: 0 2px 36px rgba(229,83,75,.35); }

/* Rest overlay */
.restOverlay {
  position: absolute; inset: 0; z-index: 7; background: var(--bg);
  background-image: radial-gradient(rgba(229,226,225,.06) 1px, transparent 1px),
    radial-gradient(70% 40% at 50% 38%, rgba(20,163,132,.09) 0%, transparent 100%);
  background-size: 26px 26px, cover;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 16px 24px calc(48px + env(safe-area-inset-bottom)); text-align: center;
}
.restOverlay.hidden { display: none; }
.restCheer { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--good); margin-bottom: 8px; }
.restLabel { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.restCount { font-family: var(--mono); font-weight: 700; font-size: 128px; line-height: .95; letter-spacing: -.05em; }
.restUnit { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--muted-2); }
.restDivider { width: 200px; height: 1px; background: var(--border); margin: 24px 0; }
.restNext { font-size: 17px; font-weight: 500; }
.restNext .restNextLabel { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
/* Same double-count as the dock: 48px already stood in for the safe area, so
   adding the real inset pushed these ~82px up once installed. Safari (inset 0)
   still resolves to 48px. */
.restBtns { position: absolute; left: 24px; right: 24px; bottom: max(48px, calc(env(safe-area-inset-bottom) + 16px)); display: flex; gap: 12px; }
.restBtns button { flex: 1; }

/* ---- Floating dock (chip · start · menu) with corner brackets ---- */
.side { display: contents; }
/* How far the floating dock sits above the bottom of the viewport, and the
   anchor everything stacked above it is measured from.
   This used to be `calc(34px + env(safe-area-inset-bottom))`, which was tuned in
   Safari — where the browser's bottom bar occupies the unsafe area, so the inset
   reads 0 and the dock landed 34px up, correctly. Installed to the home screen
   there IS no browser bar, the inset becomes the ~34px home indicator, and
   34 + 34 left the dock floating ~68px off the bottom. The fixed number was
   already standing in for the safe area, so adding the real one counted it
   twice. Sit a small margin ABOVE the safe area instead — never a second copy
   of it. Safari (inset 0) still resolves to exactly 34px, so nothing moves
   there. */
:root { --dock-bottom: max(34px, calc(env(safe-area-inset-bottom) + 12px)); }
.dock {
  position: fixed; left: 16px; right: 16px; bottom: var(--dock-bottom);
  z-index: 10; height: 64px; padding: 0 10px; border-radius: 16px;
  background: rgba(19,19,19,.72); backdrop-filter: blur(20px);
  border: 1px solid rgba(229,226,225,.14);
  display: flex; align-items: center; gap: 10px;
}
/* recording-style corner brackets */
.dock::before, .dock::after,
.dock .brk1, .dock .brk2 { content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none; }
.dock::before { top: -1px; left: -1px; border-top: 1.5px solid rgba(31,192,157,.55); border-left: 1.5px solid rgba(31,192,157,.55); border-top-left-radius: 16px; }
.dock::after  { top: -1px; right: -1px; border-top: 1.5px solid rgba(31,192,157,.55); border-right: 1.5px solid rgba(31,192,157,.55); border-top-right-radius: 16px; }
.dock .brk1 { bottom: -1px; left: -1px; border-bottom: 1.5px solid rgba(31,192,157,.55); border-left: 1.5px solid rgba(31,192,157,.55); border-bottom-left-radius: 16px; }
.dock .brk2 { bottom: -1px; right: -1px; border-bottom: 1.5px solid rgba(31,192,157,.55); border-right: 1.5px solid rgba(31,192,157,.55); border-bottom-right-radius: 16px; }

.chip {
  height: 44px; padding: 0 16px; border-radius: 12px; border: none;
  background: rgba(229,226,225,.07); color: var(--text);
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; white-space: nowrap;
}
#exChip { flex: 1; justify-content: center; overflow: hidden; text-overflow: ellipsis; }
#moreBtn { width: 44px; padding: 0; justify-content: center; background: transparent; color: var(--muted); }
.dockAv { display: inline-flex; align-items: center; }
.dockAvatarImg { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }

/* The circular start/stop button in the dock */
.dock #startBtn {
  width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: var(--accent-ink); border: none;
  font-size: 0; /* hide the text label, it's an icon button */
  position: relative; cursor: pointer;
}
.dock #startBtn::before {
  content: ""; position: absolute; top: 50%; left: 52%; transform: translate(-50%,-50%);
  border-style: solid; border-width: 8px 0 8px 14px; border-color: transparent transparent transparent var(--accent-ink);
}
.dock #startBtn.running { background: transparent; border: 1.5px solid var(--accent); }
.dock #startBtn.running::before {
  border: none; width: 14px; height: 14px; border-radius: 3px; background: var(--accent);
  top: 50%; left: 50%;
}

/* Floating "log set" action */
.quickLog {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--dock-bottom) + 84px); z-index: 9; /* stacked above the dock */
  height: 48px; padding: 0 24px; border-radius: 999px; border: none;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; gap: 9px;
  box-shadow: 0 8px 30px rgba(20,163,132,.35); cursor: pointer; white-space: nowrap;
}
.quickLog.hidden { display: none; }

/* ---- Bottom sheet ---- */
.panel {
  position: fixed; inset: 0; z-index: 20;   /* full-screen page */
  display: flex; flex-direction: column;
  background: var(--bg); padding: 0;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.panel.open { transform: translateY(0); }
.sheetHead {
  display: flex; align-items: center; justify-content: flex-end;
  padding: max(12px, env(safe-area-inset-top)) 18px 6px; flex-shrink: 0;
}
.grip { display: none; }
.sheetHead .linkbtn { font-size: 14px; font-weight: 600; color: var(--accent-bright); padding: 4px 2px; }

.sheetBackdrop { position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.sheetBackdrop.open { opacity: 1; pointer-events: auto; }

/* Tab bar */
.tabs {
  order: 2; display: flex; padding: 10px 8px calc(14px + env(safe-area-inset-bottom));
  background: rgba(19,19,19,.92); border-top: 1px solid var(--border);
}
.tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 44px; color: rgba(229,226,225,.45);
}
.tab .tabIcon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.tab .tabIcon svg { width: 22px; height: 22px; stroke: currentColor; }
.tab .tabLbl { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.tab.active { color: var(--accent-bright); }
.tabAvatarImg { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

.tabBody { order: 1; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 20px 18px; }
.tabPanel { display: none; flex-direction: column; gap: 16px; }
.tabPanel.show { display: flex; }

/* section eyebrow + serif headline shown at top of Learn/Plan/History/You */
.secHead { display: flex; flex-direction: column; gap: 4px; }
.secHead .eyebrow { font-size: 10px; color: var(--muted); }
.secHead h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -.01em; }
.tabPanel h3 { margin: 4px 0 0; font-size: 10px; color: var(--muted); }

/* ---- Buttons ---- */
button.primary, button.ghost, .btn {
  min-height: 48px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text);
  font-family: var(--sans); font-size: 15px; font-weight: 600; padding: 10px 16px; cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:active { filter: brightness(.94); }
button.ghost { background: transparent; border-color: rgba(229,226,225,.2); color: var(--muted); font-weight: 500; }
button:disabled { opacity: .5; }
.pill { border-radius: 999px !important; }
.linkbtn { min-height: auto; background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 4px 6px; }
.linkbtn:active { color: var(--bad); }

/* Exercise pills */
.exField > .eyebrow { display: block; font-size: 10px; color: var(--muted); margin-bottom: 9px; }
/* ---- Exercise picker (v58) ------------------------------------------------
   A wall of 20 pills is a thicket. Mobile gets a native <select> (grouped, so
   the OS wheel is navigable); desktop gets a searchable combobox. */
.exPicker { position: relative; }
.desktopOnly { display: none; }
.exPicker.locked { opacity: .55; pointer-events: none; }

/* Mobile — a real <select>, styled only as far as a select can be. */
.exSelect {
  width: 100%; height: 44px; padding: 0 38px 0 14px; border-radius: 12px;
  background: rgba(229,226,225,.06); border: 1px solid var(--border); color: var(--text);
  font-family: var(--sans); font-size: 15px; font-weight: 500; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23e5e2e1' stroke-width='1.75' stroke-linecap='round'><path d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
}
.exSelect:focus { outline: none; border-color: var(--accent); }
/* The wheel is drawn by the OS — these only matter where the list renders inline. */
.exSelect option { background: var(--panel); color: var(--text); }
.exSelect optgroup { background: var(--bg); color: var(--muted); font-style: normal; }

/* Desktop — searchable combobox. */
.exComboBtn {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  background: rgba(229,226,225,.06); border: 1px solid var(--border); color: var(--text);
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.exComboBtn:hover, .exComboBtn[aria-expanded="true"] { border-color: var(--accent); }
.exComboPanel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,.5); padding: 8px; display: flex;
  flex-direction: column; gap: 6px; max-height: 320px;
}
.exComboPanel.hidden { display: none; }
.exSearch {
  height: 38px; padding: 0 12px; border-radius: 10px; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-family: var(--sans); font-size: 14px; width: 100%;
}
.exSearch::placeholder { color: var(--muted-2, rgba(229,226,225,.4)); }
.exSearch:focus { outline: none; border-color: var(--accent); }
.exComboList { overflow-y: auto; display: flex; flex-direction: column; }
.exComboCat {
  font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px;
}
.exComboOpt {
  text-align: left; padding: 9px 10px; border-radius: 8px; border: none; cursor: pointer;
  background: none; color: var(--text); font-family: var(--sans); font-size: 14px;
}
.exComboOpt:hover, .exComboOpt:focus { background: rgba(229,226,225,.07); outline: none; }
.exComboOpt.active { color: var(--accent-bright); background: rgba(20,163,132,.1); }
.exComboNone { padding: 14px 10px; font-size: 13px; color: var(--muted); }

/* Toggles as iOS-style switches.
   MUST wrap: this row started at three toggles and quietly grew to six as
   features landed (Detect gear, Hands-free, Quiet mode, Record session). A
   non-wrapping flex row just kept getting wider, pushing the Coach tab into a
   sideways scroll and hiding the last toggles off-screen on a phone. Two-up per
   comp 6a; the icon+sublabel rows take a full line of their own. */
.toggles { display: flex; flex-wrap: wrap; gap: 10px; }
.toggle {
  flex: 1 1 calc(50% - 5px); min-width: 0; min-height: 48px;
  border: 1px solid var(--border); border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  font-size: 13px; font-weight: 500; cursor: pointer; user-select: none;
}
.toggle > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Full-width rows (Record session): icon + label + sublabel need the space. */
.toggleRow { flex-basis: 100%; }
.toggle input { appearance: none; -webkit-appearance: none; margin: 0;
  width: 42px; height: 25px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; flex-shrink: 0; }
.toggle input::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: left .18s ease; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { left: 19.5px; }

/* Coach reference photos */
.coachDemo { display: flex; gap: 10px; }
.coachDemo:empty { display: none; }
.coachDemo figure { flex: 1; margin: 0; }
.coachDemo img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: 12px; display: block; background: var(--panel-2); border: 1px solid var(--border); }
.coachDemo figcaption { font-size: 10px; color: var(--muted); text-align: center; padding-top: 4px; }

/* This-set log */
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.log:empty::after { content: "Your reps will show up here."; color: var(--muted); font-size: 13px; font-style: italic; }
.log li { display: flex; align-items: center; gap: 12px; height: 38px; border-bottom: 1px solid var(--border); font-size: 13px; }
.log li:last-child { border-bottom: none; }
.log li > span:first-child { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }
.log li.good > span:first-child { color: var(--good); }
.log li.warn > span:first-child { color: var(--warn); }
.log li .rep { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }

.setBtns { display: flex; gap: 10px; }
#logSetBtn { flex: 1.6; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
#resetBtn { flex: 1; }

/* Fields (routine select etc.) */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); }
select {
  width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-family: var(--sans); font-size: 15px; padding: 10px 14px; cursor: pointer;
}

/* Session status (Plan) */
.sessionStatus {
  display: flex; flex-direction: column; gap: 12px;
  background: rgba(20,163,132,.07); border: 1px solid var(--accent); border-radius: 16px; padding: 16px;
}
.sessionStatus.hidden { display: none; }
.ssBar { height: 4px; border-radius: 999px; background: rgba(229,226,225,.12); overflow: hidden; }
.ssBar > div { height: 100%; width: 0%; background: var(--accent); transition: width .3s ease; }
.ssHead { display: flex; align-items: center; gap: 8px; }
.ssDot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-bright); animation: pulseRing 2.2s ease-out infinite; flex-shrink: 0; }
.ssName { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-bright); }
.ssLine { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ssLineMain { font-size: 15px; font-weight: 600; }
.ssStep { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.ssBtns { display: flex; gap: 10px; }
.ssBtns button { flex: 1; }
#skipSetBtn { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#endSessionBtn { border-color: rgba(229,83,75,.4); color: var(--bad); }

/* Exercise library (Learn) */
.library { display: flex; flex-direction: column; gap: 22px; }
.libCat { display: flex; flex-direction: column; }
.libCatLabel { font-size: 10px; color: var(--muted); padding: 0 0 6px; }
.libRow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: none; border-bottom: 1px solid var(--border); background: none; color: var(--text); text-align: left; cursor: pointer; }
.libRow:last-child { border-bottom: none; }
.libThumb { width: 54px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--panel-2); }
.libRowText { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.libRowName { font-size: 15px; font-weight: 600; }
.libRowMuscles { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.libChevron { font-family: var(--mono); color: var(--muted-2); flex-shrink: 0; }

/* exercise detail page */
.learnDetail { display: flex; flex-direction: column; gap: 16px; }
.learnDetail.hidden { display: none; }
.detailBack { align-self: flex-start; background: none; border: none; color: var(--accent-bright); font-family: var(--mono); font-size: 12px; letter-spacing: .06em; cursor: pointer; padding: 0; }
.detailHead { display: flex; flex-direction: column; gap: 4px; }
.detailCat { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.detailSec { display: flex; flex-direction: column; gap: 10px; }
.detailSec .eyebrow { font-size: 10px; color: var(--muted); }
.checkList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.checkList li { display: flex; gap: 11px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.checkList li::before { content: "✓"; color: var(--accent-bright); flex-shrink: 0; font-weight: 700; }
.libCard { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.figWrap { display: flex; flex-direction: column; }
.figImgs { display: flex; gap: 10px; }
.figImg { width: 50%; aspect-ratio: 3/2; object-fit: cover; border-radius: 10px; display: block; background: var(--panel-2); }
.figCaption { display: flex; justify-content: space-around; font-size: 9px; color: var(--muted); padding-top: 5px; }
.libName { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.libMuscles { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--accent-bright); margin-top: -6px; }
.libSteps { margin: 2px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; counter-reset: step; }
.libSteps li { display: flex; gap: 11px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.libSteps li::before { counter-increment: step; content: "0" counter(step); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--accent-bright); flex-shrink: 0; }
.libStart { height: 44px; border-radius: 12px; border: 1px solid var(--accent); background: transparent; color: var(--accent-bright); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.libCredit { font-size: 10px; color: var(--muted-2); text-align: center; padding: 2px 0; }

/* History */
.historyHead { display: flex; align-items: center; justify-content: space-between; }
.statRow { display: flex; gap: 10px; }
.statRow .stat { flex: 1; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
.stat b { display: block; font-family: var(--mono); font-weight: 700; font-size: 24px; letter-spacing: -.02em; }
.stat.hl b { color: var(--accent-bright); }
.stat small { display: block; font-size: 9px; letter-spacing: .16em; color: var(--muted); margin-top: 2px; }
.historyList { display: flex; flex-direction: column; }
.histEmpty { font-size: 13px; color: var(--muted); font-style: italic; }
.histItem { border-bottom: 1px solid var(--border); padding: 13px 0; }
.histItem summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; }
.histItem summary::-webkit-details-marker { display: none; }
.histItem summary > span:first-child { font-size: 14px; font-weight: 600; flex: 1; }
.histReps { font-family: var(--mono); font-size: 11px; color: var(--accent-bright); }
.histWhen { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.hset { color: var(--muted); font-size: 12px; padding: 6px 0 0 12px; margin-top: 6px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }

/* Account (You) */
.account { display: flex; flex-direction: column; gap: 20px; }
.acctScreen { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 30px 16px 8px; }
.acctLogo { color: var(--accent); }
.acctTitle { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: -.01em; line-height: 1.2; }
.acctSub { font-size: 14px; line-height: 1.7; color: var(--muted); max-width: 300px; }
.acctGoogle { width: 100%; height: 52px; border-radius: 999px; border: none; background: var(--text); color: var(--bg); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; margin-top: 6px; }
.gicon { font-family: var(--mono); font-weight: 700; font-size: 17px; color: #4285f4; }
.acctFoot { font-size: 12px; color: var(--muted); }
.acctErr { font-size: 12px; color: var(--bad); background: rgba(229,83,75,.1); border: 1px solid rgba(229,83,75,.35); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; width: 100%; }
.acctErr span { color: var(--muted); }
.acctProfile { display: flex; flex-direction: column; gap: 20px; }
.acctIdent { display: flex; align-items: center; gap: 16px; }
.acctAvatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(229,226,225,.2); flex-shrink: 0; }
.acctInitial { display: flex; align-items: center; justify-content: center; background: var(--panel-2); color: var(--text); font-family: var(--mono); font-size: 20px; font-weight: 600; }
.acctName { font-family: var(--serif); font-weight: 500; font-size: 24px; }
.acctEmail { font-size: 13px; color: var(--muted); }
.acctSync { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); font-size: 13px; color: var(--muted); }
.acctSync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: pulseRing 2.2s ease-out infinite; }
.acctSignout { width: 100%; }

/* Onboarding (first run) */
.onboarding { position: fixed; inset: 0; z-index: 50; background: var(--bg); }
.onboarding.hidden { display: none; }
.obSlide { position: absolute; inset: 0; display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.obSlide.hidden { display: none; }
.obDots { position: absolute; inset: 0; background-image: radial-gradient(rgba(229,226,225,.07) 1px, transparent 1px); background-size: 26px 26px; pointer-events: none; }
/* grow to fill when there's room, but never shrink — tall content scrolls instead of clipping */
.obBody { position: relative; flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; padding: max(44px, env(safe-area-inset-top)) 32px 24px; gap: 20px; }
.obLogo { color: var(--accent); }
.obEyebrow { font-family: var(--mono); font-weight: 600; text-transform: uppercase; letter-spacing: .2em; font-size: 11px; color: rgba(229,226,225,.62); }
.obTitle { font-family: var(--serif); font-weight: 500; font-size: 38px; line-height: 1.1; letter-spacing: -.02em; }
.obTitle.sm { font-size: 30px; }
.obHi { color: var(--accent-bright); border-bottom: 2px solid rgba(20,163,132,.5); }
.obSub { font-size: 15px; line-height: 1.7; color: rgba(229,226,225,.66); }
.obDiagram { border: 1px solid var(--border); border-radius: 16px; background: var(--panel); padding: 8px 10px; }
.obDiagram svg { width: 100%; height: auto; display: block; }
.obSteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: ob; }
.obSteps li { display: flex; gap: 12px; font-size: 14px; line-height: 1.5; color: rgba(229,226,225,.75); }
.obSteps li::before { counter-increment: ob; content: "0" counter(ob); font-family: var(--mono); font-size: 12px; color: var(--accent-bright); letter-spacing: .1em; flex-shrink: 0; }
.obFoot { position: relative; flex-shrink: 0; padding: 8px 24px calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.obFoot .primary { height: 52px; }
.obFine { font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .2em; color: rgba(229,226,225,.4); text-align: center; }
.obSkip { background: none; border: none; color: rgba(229,226,225,.4); font-size: 13px; cursor: pointer; padding: 6px; }

/* Weekly reps chart (History) */
.weekChart { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.wcHead { display: flex; justify-content: space-between; align-items: baseline; }
.wcTotal { font-family: var(--mono); font-size: 11px; color: var(--accent-bright); letter-spacing: .1em; }
.wcBars { display: flex; align-items: flex-end; gap: 8px; height: 72px; }
.wcCol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.wcBar { width: 100%; border-radius: 4px 4px 0 0; background: rgba(229,226,225,.18); min-height: 3px; }
.wcBar.today { background: var(--accent); }
.wcCol span { font-family: var(--mono); font-size: 9px; color: var(--muted-2); }
.wcCol.today span { color: var(--accent-bright); }

/* ============================================================
   FULL-SCREEN EXERCISE LIBRARY (card grid, all breakpoints)
   ============================================================ */
.libPage {
  position: fixed; inset: 0; z-index: 55;
  background: var(--bg); color: var(--text);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.libPage.hidden { display: none; }
.libPageHead {
  position: relative; padding: calc(20px + env(safe-area-inset-top)) 22px 8px;
  display: flex; flex-direction: column; gap: 10px;
}
.libPageHead .exBack { position: static; align-self: flex-start; }
.libPageTitle { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 8vw, 40px); line-height: 1.02; letter-spacing: -.01em; margin: 6px 0 0; }
.libPageEyebrow { font-family: var(--mono); text-transform: uppercase; letter-spacing: .2em; font-weight: 600; font-size: 11px; color: var(--accent-bright); }
.libPageBody { padding: 12px 22px calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 30px; }
.libCatSec { display: flex; flex-direction: column; gap: 14px; }
.libCatTitle { font-family: var(--mono); text-transform: uppercase; letter-spacing: .2em; font-weight: 600; font-size: 11px; color: var(--muted); }
.libGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 158px), 1fr)); gap: 14px; }
.libCard {
  display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  color: var(--text); transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.libCard:hover { transform: translateY(-3px); border-color: rgba(31,192,157,.4); background: var(--panel-2); }
.libCard:active { transform: translateY(-1px); }
.libCardImg { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--panel-2); }
.libCardText { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 4px; }
.libCardName { font-family: var(--sans); font-weight: 600; font-size: 15px; }
.libCardMuscles { font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; font-size: 9.5px; color: var(--muted); line-height: 1.4; }
.libCredit2 { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin-top: 4px; }

/* ============================================================
   FULL-SCREEN EXERCISE PAGE (all breakpoints)
   ============================================================ */
.exPage {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg); color: var(--text);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
}
.exPage.hidden { display: none; }
/* Transform-only entrance so content is NEVER hidden if the animation doesn't run.
   Applied to inner blocks (not .exPage) so it never traps the fixed back button. */
.exPage:not(.hidden) .exHero,
.exPage:not(.hidden) .exContent { animation: exRise .42s cubic-bezier(.2,.8,.2,1); }
.exPage:not(.hidden) .exContent { animation-delay: .05s; animation-fill-mode: backwards; }
@keyframes exRise { from { transform: translateY(16px); } to { transform: none; } }

/* floating back control */
.exBack {
  position: fixed; top: max(14px, env(safe-area-inset-top)); left: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 16px 0 12px; border-radius: 999px;
  background: rgba(19,19,19,.6); backdrop-filter: blur(14px);
  border: 1px solid rgba(229,226,225,.16); color: var(--text);
  font-family: var(--sans); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .15s ease, background .2s ease;
}
.exBack:hover { background: rgba(19,19,19,.82); }
.exBack:active { transform: scale(.96); }

/* hero */
.exHero { position: relative; width: 100%; height: 46vh; min-height: 300px; max-height: 460px; overflow: hidden; flex-shrink: 0; }
.exHeroImg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.exHeroScrim { position: absolute; inset: 0; background:
  linear-gradient(to top, var(--bg) 2%, rgba(19,19,19,.72) 26%, rgba(19,19,19,.15) 62%, rgba(19,19,19,.35) 100%); }
.exHeroText { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 22px 22px; }
.exCat { display: block; font-size: 11px; color: var(--accent-bright); margin-bottom: 8px; }
.exTitle { font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 11vw, 60px); line-height: 1; letter-spacing: -.01em; margin: 0 0 14px; }
.exTags { display: flex; flex-wrap: wrap; gap: 8px; }
.exTag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text); background: rgba(229,226,225,.08); border: 1px solid rgba(229,226,225,.14);
  padding: 6px 11px; border-radius: 999px;
}

/* content */
.exContent { flex: 1; padding: 26px 22px 120px; display: grid; gap: 34px; }
.exSec { display: flex; flex-direction: column; gap: 14px; }
.exSec .eyebrow { font-size: 11px; color: var(--muted); }
.exSteps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.exSteps li { counter-increment: step; position: relative; padding-left: 44px; line-height: 1.5; color: var(--text); font-size: 15.5px; }
.exSteps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent-bright);
  background: rgba(31,192,157,.1); border: 1px solid rgba(31,192,157,.28);
}
.exCheckList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.exCheckList li {
  position: relative; padding: 15px 0 15px 34px; line-height: 1.45; font-size: 15px; color: var(--text);
  border-top: 1px solid var(--border);
}
.exCheckList li:last-child { border-bottom: 1px solid var(--border); }
.exCheckList li::before {
  content: ""; position: absolute; left: 2px; top: 18px;
  width: 16px; height: 9px; border-left: 2px solid var(--accent-bright); border-bottom: 2px solid var(--accent-bright);
  transform: rotate(-45deg);
}
.exFrames { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.exFrame { margin: 0; }
.exFrame img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); display: block; }
.exFrame figcaption { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted-2); margin-top: 8px; }

/* sticky CTA */
.exCta {
  position: sticky; bottom: 0; margin-top: auto;
  padding: 16px 22px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, rgba(19,19,19,0));
  display: flex; justify-content: center;
}
.exStart { width: 100%; max-width: 440px; height: 54px; font-size: 15px; }
.exStartSide { display: none; }         /* desktop-only, lives in the side card */

@media (prefers-reduced-motion: reduce) {
  .exPage:not(.hidden),
  .exPage:not(.hidden) .exHero,
  .exPage:not(.hidden) .exContent { animation: none; }
}

/* ============================================================
   DESKTOP
   ============================================================ */
@media (min-width: 860px) {
  .mobileOnly { display: none !important; }
  .desktopOnly { display: block; }
  .app { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
  .brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 22px; font-weight: 500; flex-shrink: 0; }
  .brand em { color: var(--accent); font-style: normal; }
  .logo { font-size: 24px; }

  /* Top navigation */
  .topnav { display: flex; align-items: center; gap: 4px; }
  .topTab {
    font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: -.01em;
    color: var(--muted); background: none; border: none; cursor: pointer;
    height: 40px; padding: 0 16px; border-radius: 999px; min-height: 0;
    transition: color .18s ease, background .18s ease;
  }
  .topTab:hover { color: var(--text); background: rgba(229,226,225,.06); }
  .topTab.active { color: var(--accent-ink); background: var(--accent-bright); }
  .topAccount { flex-shrink: 0; padding: 0 6px; }
  .topAccount.active { color: var(--accent-ink); background: var(--accent-bright); }
  .topAvatarWrap { display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; }
  .topAvatarImg { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
  .topRight { display: flex; align-items: center; gap: 6px; }
  .iconBtn {
    width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--muted); cursor: pointer;
    transition: color .18s ease, background .18s ease;
  }
  .iconBtn:hover { color: var(--text); background: rgba(229,226,225,.06); }
  .iconBtn svg { width: 20px; height: 20px; }

  /* in-panel bottom tab bar is replaced by the top nav on desktop */
  .tabs { display: none; }

  .stage { flex: 1; min-height: 0; display: flex; flex-direction: row; gap: 16px; padding: 16px; }
  .videoWrap { position: relative; inset: auto; flex: 1; display: flex; align-items: center; justify-content: center; border-radius: 18px; overflow: hidden; }
  .frameBox { position: relative; inset: auto; height: 100%; width: auto; aspect-ratio: 9/16; max-width: 100%; border-radius: 18px; border: 1px solid var(--border); }
  .cue { bottom: 210px; }
  .restCount { font-size: 112px; }

  .side { display: flex; flex-direction: column; flex: 0 0 380px; gap: 14px; }
  .dock { position: static; height: auto; padding: 0; background: none; border: none; backdrop-filter: none; }
  .dock::before, .dock::after, .dock .brk1, .dock .brk2 { display: none; }
  .dock #startBtn { width: 100%; height: 52px; border-radius: 999px; font-size: 15px; }
  .dock #startBtn::before { display: none; }
  .dock #startBtn.running { background: var(--accent); border: none; }

  .panel {
    position: static; transform: none; flex: 1; min-height: 0; max-height: none;
    background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
    overflow: hidden; padding: 0;
  }
  .sheetBackdrop { display: none; }
  #acctBtn { display: none; }
  .tabBody { padding: 18px 18px; }

  /* --- Desktop view switching (driven by body[data-view]) ---
     Coach = camera + 380 rail. Plan/History/You = full-width content page. */
  body[data-view="routine"] .videoWrap,
  body[data-view="challenges"] .videoWrap,
  body[data-view="history"] .videoWrap,
  body[data-view="account"] .videoWrap { display: none; }
  body[data-view="routine"] .dock,
  body[data-view="challenges"] .dock,
  body[data-view="history"] .dock,
  body[data-view="account"] .dock { display: none; }
  body[data-view="routine"] .side,
  body[data-view="challenges"] .side,
  body[data-view="history"] .side,
  body[data-view="account"] .side { flex: 1; min-width: 0; }
  body[data-view="routine"] .panel,
  body[data-view="challenges"] .panel,
  body[data-view="history"] .panel,
  body[data-view="account"] .panel { background: transparent; border: none; border-radius: 0; }
  body[data-view="routine"] .tabBody,
  body[data-view="challenges"] .tabBody,
  body[data-view="history"] .tabBody,
  body[data-view="account"] .tabBody { max-width: 760px; margin: 0 auto; width: 100%; padding: 22px 24px 40px; }
  body[data-view="routine"] .stage,
  body[data-view="challenges"] .stage,
  body[data-view="history"] .stage,
  body[data-view="account"] .stage { padding: 0; }

  /* --- Immersive "workout mode": mobile-style full-bleed camera + floating UI ---
     Reverts the desktop framed+sidebar layout to the immersive base layout. */
  body.immersive .topbar { display: none; }
  body.immersive .stage { display: block; padding: 0; }
  body.immersive .videoWrap { position: fixed; inset: 0; flex: none; border-radius: 0; }
  body.immersive .frameBox {
    position: absolute; inset: 0; width: auto; height: auto;
    aspect-ratio: auto; max-width: none; border: none; border-radius: 0;
  }
  body.immersive .side { display: contents; }
  body.immersive .panel { display: none; }        /* settings sidebar hidden in workout mode */
  body.immersive .cue { bottom: 120px; }
  body.immersive .dock {
    position: fixed; left: 50%; right: auto; transform: translateX(-50%); bottom: 28px;
    width: auto; height: auto; padding: 0; background: none; border: none; z-index: 11;
  }
  body.immersive .dock #startBtn { width: 220px; }

  /* Learn library + exercise detail render IN-FLOW below the persistent top nav
     (on desktop they are not overlays — the top nav stays visible & usable). */
  .topbar { position: relative; z-index: 5; }
  body.libOpen .stage, body.detailOpen .stage { display: none; }
  body.libOpen .libPage:not(.hidden),
  body.detailOpen .exPage:not(.hidden) {
    position: static; inset: auto; z-index: auto;
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
  }
  body.detailOpen .libPage { display: none; }   /* detail replaces the grid */
  .libPage .exBack { display: none; }            /* top nav handles library nav */
  .exPage .exBack { top: 82px; }                 /* clear the top bar */

  /* Full-screen library → centered grid */
  .libPageHead { max-width: 1100px; margin: 0 auto; width: 100%; padding: 40px 40px 8px; }
  .libPageTitle { font-size: 48px; }
  .libPageBody { max-width: 1100px; margin: 0 auto; width: 100%; padding: 20px 40px 80px; gap: 40px; }
  .libGrid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
  .libCardName { font-size: 16px; }
  .libCardMuscles { font-size: 10px; }

  /* Full-screen exercise page → editorial desktop layout */
  .exPage { padding: 0 40px; }
  .exBack { top: 24px; left: 32px; }
  .exHero {
    width: 100%; max-width: 1100px; margin: 0 auto; height: 52vh; max-height: 520px;
    border-radius: 0 0 22px 22px;
  }
  .exHeroText { padding: 0 40px 34px; }
  .exTitle { font-size: clamp(52px, 5vw, 76px); }
  .exContent {
    width: 100%; max-width: 1100px; margin: 0 auto;
    grid-template-columns: 1.5fr 1fr; gap: 56px;
    padding: 44px 40px 130px; align-items: start;
  }
  .exColMain { display: flex; flex-direction: column; gap: 44px; }
  .exColSide { position: sticky; top: 40px; }
  .exColSide .exSec {
    background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px;
  }
  .exColSide .exCheckList li:first-child { border-top: none; padding-top: 4px; }
  .exColSide .exCheckList li:last-child { border-bottom: none; padding-bottom: 4px; }
  .exColSide .exStartSide { display: inline-flex; width: 100%; height: 52px; margin-top: 22px; }
  .exCta { display: none; }              /* mobile sticky CTA hidden; side-card CTA shows instead */
}

/* ============================================================
   ANIMATIONS (Magic-UI-inspired, recreated natively)
   ============================================================ */

/* Animated gradient text (brand "AI", accents) */
.gradText {
  background: linear-gradient(90deg, var(--accent), var(--accent-bright), var(--warn), var(--accent-bright), var(--accent));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent; font-style: normal;
  animation: gradShift 6s linear infinite;
}
@keyframes gradShift { to { background-position: 200% 0; } }

/* Animated shiny text — a light sweep across the letters */
.shinyText {
  background: linear-gradient(110deg, rgba(229,226,225,.65) 35%, #fff 50%, rgba(229,226,225,.65) 65%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shinyMove 2.6s linear infinite;
}
@keyframes shinyMove { from { background-position: 150% 0; } to { background-position: -150% 0; } }

/* Border beam — a light travelling around the border of a card */
@property --beamA { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.beam { position: relative; }
.beam::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--beamA), transparent 0 62%, var(--accent) 74%, var(--accent-bright) 82%, #fff 87%, var(--accent-bright) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none; z-index: 1; animation: beamSpin 4.5s linear infinite;
}
@keyframes beamSpin { to { --beamA: 360deg; } }

/* Shimmer sweep on the primary Start button */
#startBtn { position: relative; overflow: hidden; }
#startBtn::after {
  content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-18deg); pointer-events: none;
  animation: shimmerSweep 3.4s ease-in-out infinite;
}
@keyframes shimmerSweep { 0% { left: -70%; } 45%, 100% { left: 140%; } }
/* While recording, swap the shimmer for a pulsing "live" ring */
#startBtn.running::after { display: none; }
#startBtn.running { animation: recPulse 1.7s ease-out infinite; }
@keyframes recPulse {
  0% { box-shadow: 0 0 0 0 rgba(31,192,157,.5); }
  70%, 100% { box-shadow: 0 0 0 15px rgba(31,192,157,0); }
}

/* Rep count "pop" on each completed rep */
.repNum.pop { animation: repPop .42s cubic-bezier(.2,1.5,.4,1); }
@keyframes repPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.16); color: var(--accent-bright);
        text-shadow: 0 0 30px rgba(31,192,157,.9), 0 2px 24px rgba(0,0,0,.5); }
  100% { transform: scale(1); }
}

/* Blur-in reveal for library cards (transform+blur only → never hides content) */
.libCard { animation: blurIn .55s cubic-bezier(.2,.8,.2,1) backwards; }
.libGrid .libCard:nth-child(1) { animation-delay: .03s; }
.libGrid .libCard:nth-child(2) { animation-delay: .09s; }
.libGrid .libCard:nth-child(3) { animation-delay: .15s; }
.libGrid .libCard:nth-child(4) { animation-delay: .21s; }
.libGrid .libCard:nth-child(5) { animation-delay: .27s; }
.libGrid .libCard:nth-child(6) { animation-delay: .33s; }
@keyframes blurIn { from { filter: blur(12px); transform: translateY(16px); } to { filter: blur(0); transform: none; } }

/* Confetti / particle canvas */
.fxCanvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 90; }

@media (prefers-reduced-motion: reduce) {
  .gradText, .shinyText, #startBtn::after, #startBtn.running, .beam::after, .libCard { animation: none !important; }
  .gradText { -webkit-text-fill-color: var(--accent); color: var(--accent); }
  .shinyText { -webkit-text-fill-color: var(--text); color: var(--text); }
}

/* ============================================================
   RANGE-OF-MOTION CALIBRATION (feature 02)
   ============================================================ */
.calibBar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--dock-bottom) + 86px); z-index: 30; /* stacked above the dock */
  width: min(440px, calc(100vw - 32px));
  background: rgba(6,35,28,.9); backdrop-filter: blur(16px);
  border: 1px solid rgba(31,192,157,.5); border-radius: 18px;
  padding: 16px 18px; text-align: center; box-shadow: 0 14px 44px rgba(0,0,0,.5);
}
.calibBar.hidden { display: none; }
.calibText { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.4; color: var(--text); }
.calibText b { font-style: normal; font-family: var(--mono); color: var(--accent-bright); }
.calibBig { font-family: var(--mono); font-weight: 700; font-size: 46px; letter-spacing: -.02em; color: var(--accent-bright); margin-top: 4px; line-height: 1; }
.calibBtns { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.calibBtns button { min-height: 42px; padding: 0 18px; }

/* Coach-panel entry button */
.calibEntry { width: 100%; }
.calibEntry.isCalibrated { border-color: rgba(31,192,157,.5); color: var(--accent-bright); }

/* "Your ranges" (You tab) */
.rangesSec { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.rangesSec .eyebrow { font-size: 10px; color: var(--muted); }
.rangesEmpty { font-size: 13px; color: var(--muted); line-height: 1.5; }
.rangeRow { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.rangeName { font-size: 14px; font-weight: 600; }
.rangeVal { font-family: var(--mono); font-size: 11px; color: var(--accent-bright); letter-spacing: .04em; margin-top: 2px; }
.rangeBtns { display: flex; gap: 5px; flex-shrink: 0; }
.rangeBtns button { width: auto; min-height: 32px; height: 32px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(229,226,225,.06); color: var(--text);
  font-size: 12px; font-weight: 600; cursor: pointer; }
.rangeBtns button:hover { background: rgba(229,226,225,.12); }

/* ============================================================
   HANDS-FREE CONTROL (feature 01)
   ============================================================ */
.gestHelp { font-size: 11.5px; line-height: 1.5; color: var(--muted); margin: 8px 2px 0; }
.gestHelp b { color: var(--accent-bright); font-weight: 600; }

.gestureRing {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  z-index: 8; width: 108px; height: 108px; display: grid; place-items: center; pointer-events: none;
}
.gestureRing.hidden { display: none; }
.gestureRing svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.gestTrack { fill: rgba(19,19,19,.5); stroke: rgba(229,226,225,.18); stroke-width: 6; }
.gestProg {
  fill: none; stroke: var(--accent-bright); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 263.9; stroke-dashoffset: 263.9; transition: stroke-dashoffset .09s linear;
}
.gestLbl {
  font-family: var(--mono); font-weight: 700; font-size: 17px; letter-spacing: .08em;
  color: #fff; text-shadow: 0 1px 10px rgba(0,0,0,.7);
}

/* ============================================================
   COMBOS + XP (feature 04) — Considered-coach, not neon
   ============================================================ */
.comboBadge {
  font-family: var(--mono); font-weight: 700; font-size: 26px; letter-spacing: -.02em;
  line-height: 1; margin-top: 4px; color: var(--accent-bright);
  text-shadow: 0 1px 12px rgba(0,0,0,.4);
}
.comboBadge.hidden { display: none; }
.comboBadge.m25 { color: var(--warn); }                                  /* gold from x25 */
.comboBadge.m50 { color: #e2b53a; text-shadow: 0 0 14px rgba(212,167,44,.55); }
.comboBadge.m100 { color: #ffd479; text-shadow: 0 0 22px rgba(212,167,44,.8); }
.comboBadge.pulse { animation: comboPulse .42s cubic-bezier(.2,1.5,.4,1); }
@keyframes comboPulse { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }

/* Level + XP (You tab) */
.levelSec { margin-top: 22px; }
.levelTop { display: flex; align-items: center; gap: 14px; }
.levelBadge {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 24px; color: var(--accent-ink);
  background: var(--accent-bright);
}
.levelStats { min-width: 0; }
.levelXp { font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.levelSub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.levelBar { height: 8px; border-radius: 999px; background: rgba(229,226,225,.12); overflow: hidden; margin-top: 12px; }
.levelFill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.levelMeta { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); margin-top: 8px; }

/* ============================================================
   LIVE XP (feature 4.6) — session counter + drifting +N
   ============================================================ */
.hudRight { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.xpHud { position: relative; text-align: right; pointer-events: none; }
.xpHud.hidden { display: none; }
.xpHudLabel {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: rgba(229,226,225,.45);
}
.xpHudVal {
  font-family: var(--mono); font-weight: 700; font-size: 24px;
  letter-spacing: -.02em; color: rgba(229,226,225,.9); line-height: 1.05;
  text-shadow: 0 1px 10px rgba(0,0,0,.4);
}
/* +N drifts up-left of the counter; fuller (not louder) as combo climbs */
.xpDrift {
  position: absolute; right: 100%; margin-right: 8px; bottom: 2px;
  font-family: var(--mono); font-weight: 600; font-size: 15px; white-space: nowrap;
  color: rgba(31,192,157,.75); pointer-events: none;
  animation: xpDrift 1s ease-out forwards;
}
.xpDrift.t1 { font-size: 18px; color: #1fc09d; text-shadow: 0 0 10px rgba(31,192,157,.6); }
.xpDrift.tMile { font-size: 22px; color: #ffd479; text-shadow: 0 0 16px rgba(212,167,44,.8); }
@keyframes xpDrift {
  from { opacity: 0; transform: translateY(6px); }
  20% { opacity: 1; }
  to { opacity: 0; transform: translateY(-22px); }
}

/* Combo badge — align to comp t4 (28px + COMBO label, hierarchy reps→combo→XP) */
.comboBadge { font-size: 28px; display: inline-flex; align-items: baseline; gap: 7px; }
.comboLbl {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted-2);
}

/* ============================================================
   READY GATE — camera on, not counting until you arm it
   ============================================================ */
.readyOverlay {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--dock-bottom) + 86px); z-index: 15; /* stacked above the dock */
  width: min(400px, calc(100vw - 32px));
  background: rgba(19,19,19,.82); backdrop-filter: blur(16px);
  border: 1px solid rgba(31,192,157,.45); border-radius: 18px;
  padding: 18px 20px; text-align: center; box-shadow: 0 14px 44px rgba(0,0,0,.5);
  animation: gearPop .28s ease-out;
}
.readyOverlay.hidden { display: none; }
.readyEyebrow { font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .2em; color: var(--accent-bright); }
.readyText { font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.45; color: var(--text); margin-top: 6px; }
.readyText b { font-style: normal; color: var(--accent-bright); }
.readyOverlay .primary { margin-top: 14px; width: 100%; }

/* ============================================================
   SESSION RECORDER (feature 06) — quiet REC indicator
   ============================================================ */
/* Comp 6b — sits under the Session XP block, top-right. A hollow teal square
   and an elapsed timer: it reads at 3 m by CONTRAST, not motion. No red, no
   blink — a recording indicator shouldn't feel like an alarm. */
.recChip {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(19,19,19,.55); border: 1px solid rgba(31,192,157,.35);
  backdrop-filter: blur(8px); pointer-events: none;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .16em; color: var(--accent-bright);
}
.recChip.hidden { display: none; }
.recChip svg { flex-shrink: 0; }

/* Comp 6c — recordings are account data, so they live in the You tab. */
.recRow { display: flex; align-items: center; gap: 14px;
  padding: 16px 0; border-bottom: 1px solid var(--border); }
.recRow:last-child { border-bottom: none; }
.recName { font-size: 15px; font-weight: 600; }
.recMeta { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: rgba(229,226,225,.45); }
.recExport {
  height: 34px; padding: 0 14px; border-radius: 10px; flex-shrink: 0;
  border: 1px solid var(--border); background: none; cursor: pointer;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .1em; color: var(--accent-bright);
}
.recExport:hover { border-color: var(--accent); }
.recDel { background: none; border: none; padding: 0; cursor: pointer;
  color: rgba(229,226,225,.45); display: flex; flex-shrink: 0; }
.recDel:hover { color: var(--bad); }
.recIncomplete { color: var(--warn); }
.recNote { font-size: 13px; line-height: 1.6; color: rgba(229,226,225,.55); }

/* Comp 6d — empty state: two quiet lines, no call to action shouting. */
.recEmpty { border: 1px dashed var(--border); border-radius: 16px; padding: 26px 22px;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.recEmpty svg { color: rgba(229,226,225,.35); }
.recEmptyLead { font-family: var(--serif); font-size: 18px; line-height: 1.45; color: rgba(229,226,225,.75); }
.recEmptySub { font-size: 12px; color: rgba(229,226,225,.45); }

/* Comp 6a — icon + sublabel row (matches the Gestures row treatment). */
.toggleRow { gap: 12px; min-height: 56px; justify-content: flex-start; }
.toggleIcon { flex-shrink: 0; color: rgba(229,226,225,.7); }
.toggleText { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.toggleSub { font-family: var(--mono); font-size: 10px; font-weight: 400;
  letter-spacing: .12em; text-transform: uppercase; color: rgba(229,226,225,.45); }
/* Comp 2g — the "—°" placeholder that anchors the empty ranges card. */
.rangesEmptyNum { font-family: var(--mono); font-weight: 700; font-size: 34px;
  letter-spacing: -.03em; color: rgba(229,226,225,.25); }

/* ============================================================
   CREATE WITH AI (feature 08) — comps 6e–6h
   ============================================================ */
.aiHidden { display: none !important; }

/* 6e — chooser row */
.aiRow {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 64px; padding: 0 2px; background: none; cursor: pointer;
  border: none; border-bottom: 1px solid var(--border); color: var(--text);
}
.aiRow:hover .aiRowName, .aiRow:hover .aiRowArrow { color: var(--accent-bright); }
.aiRowIcon { flex-shrink: 0; color: var(--accent-bright); }
.aiRowText { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aiRowName { font-size: 15px; font-weight: 500; color: var(--accent-bright); }
.aiRowText small { font-size: 12px; color: rgba(229,226,225,.5); }
.aiRowArrow { font-family: var(--mono); color: var(--accent-bright); flex-shrink: 0; }

/* 6f — the flow */
.aiFlow { display: flex; flex-direction: column; gap: 14px; }
.aiFlow.hidden { display: none; }
.aiBack { align-self: flex-start; padding: 0; }
.aiHead { display: flex; flex-direction: column; gap: 6px; }
.aiTitle { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.15;
  letter-spacing: -.01em; margin: 0; }
.aiSub { font-size: 14px; line-height: 1.7; color: rgba(229,226,225,.6); margin: 0; }
.aiStep { display: flex; align-items: center; gap: 12px; }
.aiStepPaste { align-items: flex-start; }
.aiStepNo { font-family: var(--mono); font-size: 12px; color: var(--accent-bright); letter-spacing: .12em; flex-shrink: 0; }
.aiStepPaste .aiStepNo { padding-top: 16px; }
.aiCopy { flex: 1; height: 52px; display: flex; align-items: center; justify-content: center; gap: 9px; }
.aiCopied { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-bright); padding-left: 34px; }
.aiCopied.hidden { display: none; }
.aiCopied.aiCopyFail { color: var(--warn); letter-spacing: .06em; text-transform: none; font-size: 11px; }
.aiPaste {
  flex: 1; min-height: 140px; border-radius: 12px; border: 1px dashed var(--border);
  background: var(--panel); padding: 14px; color: var(--text); resize: vertical;
  font-family: var(--mono); font-size: 12px; line-height: 1.6; width: 100%;
}
.aiPaste::placeholder { color: rgba(229,226,225,.4); }
.aiPaste:focus { outline: none; border-color: var(--accent); border-style: solid; }
.aiCheck { height: 52px; }

/* 6g/6h — result */
.aiResult:empty { display: none; }
.aiResult { display: flex; flex-direction: column; gap: 14px; }
.aiSay { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.35; color: var(--accent-bright); }
.aiSay.plain { color: var(--text); }
.aiSubtle { font-size: 14px; line-height: 1.7; color: rgba(229,226,225,.6); margin-top: -8px; }
.aiCard { border: 1px solid var(--accent); border-radius: 16px; padding: 18px;
  background: rgba(20,163,132,.07); display: flex; flex-direction: column; gap: 12px; }
.aiCard.neutral { border-color: var(--border); background: var(--panel); }
.aiCardTop { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.aiCardName { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.aiCardSum { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: rgba(229,226,225,.5); flex-shrink: 0; }
.aiPrevRows { display: flex; flex-direction: column; }
.aiPrevRow { display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid rgba(229,226,225,.08); font-size: 14px; }
.aiPrevRow:last-child { border-bottom: none; }
.aiPrevRow > span:first-of-type { flex: 1; font-weight: 500; }
.aiPrevRow.ok svg { color: var(--accent-bright); flex-shrink: 0; }
.aiPrevRow.ok { opacity: .9; }
.aiPrevMeta { font-family: var(--mono); font-size: 12px; color: rgba(229,226,225,.6); flex: 0 !important; white-space: nowrap; }
.aiQ { font-family: var(--mono); font-size: 13px; color: var(--warn); flex: 0 !important; }
.aiUnknown { flex: 1; color: var(--warn); }
.aiChip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--accent);
  background: none; color: var(--accent-bright); cursor: pointer; flex-shrink: 0;
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .1em; }
.aiChip:hover { background: rgba(20,163,132,.12); }
.aiCardRest { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: rgba(229,226,225,.45); }
.aiFixNote { font-size: 12.5px; color: rgba(229,226,225,.5); margin-top: -6px; }
.aiBtns { display: flex; gap: 12px; }
.aiBtns .pill { flex: 1; height: 52px; }
.aiBtns .aiSave { flex: 1.4; }

/* ============================================================
   UNITS (feature 09) — comp 6i
   ============================================================ */
.setRow { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.unitSeg { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.unitOpt {
  height: 36px; padding: 0 16px; background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: rgba(229,226,225,.55); border-right: 1px solid var(--border);
}
.unitOpt:last-child { border-right: none; }
.unitOpt.on { background: rgba(20,163,132,.16); color: var(--accent-bright); }
.unitOpt:not(.on):hover { color: var(--text); }
/* The choice shown, not described: the same set line in both units. */
.unitPrevRow { display: flex; gap: 10px; margin-top: 12px; }
.unitPrev { flex: 1; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  background: var(--panel); opacity: .7; }
.unitPrev.on { border-color: var(--accent); background: rgba(20,163,132,.07); opacity: 1; }
.unitPrevName { font-size: 13px; font-weight: 500; }
.unitPrevVal { font-family: var(--mono); font-size: 13px; margin-top: 3px; color: rgba(229,226,225,.7); }
.unitPrev.on .unitPrevVal { color: var(--accent-bright); }

/* ============================================================
   COMPED STATES (feature 09 Scope B) — 2y camera blocked, 2z empty history
   ============================================================ */
/* 2y — a dead end that explains instead of scolding. */
.statusMsg.camBlocked {
  inset: 0; display: flex; flex-direction: column; justify-content: center;
  align-items: flex-start; gap: 16px; padding: 32px; text-align: left;
  background: var(--bg);
  background-image: radial-gradient(rgba(229,226,225,.06) 1px, transparent 1px);
  background-size: 26px 26px;
  overflow-y: auto;
}
.camBlockedIcon { color: rgba(229,226,225,.6); flex-shrink: 0; }
.camBlockedTitle { font-family: var(--serif); font-weight: 500; font-size: 30px;
  line-height: 1.15; letter-spacing: -.02em; }
.camBlockedBody { font-size: 14px; line-height: 1.7; color: rgba(229,226,225,.6); max-width: 42ch; }
.camBlockedSteps { display: flex; flex-direction: column; gap: 12px; font-size: 14px;
  line-height: 1.5; color: rgba(229,226,225,.75); }
.camBlockedSteps div { display: flex; gap: 12px; }
.camBlockedSteps span { font-family: var(--mono); font-size: 12px; color: var(--accent-bright);
  letter-spacing: .12em; flex-shrink: 0; }
.camBlockedCta { height: 52px; padding: 0 28px; margin-top: 4px; }
.camBlockedFoot { font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .2em; color: rgba(229,226,225,.4); }

/* 2z — dashes, not a wall of confident zeros. "0 day streak" reads as failure. */
.statRow.empty .stat b, .weekChart.empty .wcTotal { color: rgba(229,226,225,.3); }
.statRow.empty .stat { border-style: dashed; }
.wcBar.ghost { background: rgba(229,226,225,.08) !important; }
.weekChart.empty { opacity: .5; }
.histEmptyBox { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; margin-top: 16px; }
.histEmptyLead { font-family: var(--serif); font-size: 20px; line-height: 1.45; color: rgba(229,226,225,.85); }
.histEmptyCta { height: 46px; padding: 0 22px; white-space: nowrap; }
/* Feature 10.3 — quiet link out to the beta page. */
.tellFriend { display: inline-block; margin-top: 16px; font-size: 13px;
  color: var(--muted); text-decoration: none; }
.tellFriend:hover { color: var(--accent-bright); }

/* ---- Re-measure offer (feature 12.4) — quiet, in the log-moment slot ---- */
.remeasureCard { border: 1px solid var(--accent); border-radius: 14px; padding: 14px 16px;
  background: rgba(20,163,132,.07); display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.remeasureCard.hidden { display: none; }
.rmLead { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--accent-bright); }
.rmBody { font-size: 13px; line-height: 1.6; color: var(--muted); }
.rmBtns { display: flex; gap: 10px; margin-top: 2px; }
.rmBtns button { flex: 1; height: 42px; }
/* ============================================================
   SHAPE POP (Labs, feature 11)
   ============================================================ */
/* Labs row on the You tab (comp 8c) */
.labsRow { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 14px 0; background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer; color: var(--text); }
.labsGlyph { width: 30px; height: 30px; flex: none; }
.labsText { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.labsName { font-size: 15px; font-weight: 600; }
.labsText small { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(229,226,225,.45); }
.labsBadge { font-family: var(--mono); font-size: 8px; font-weight: 600; letter-spacing: .16em; color: var(--warn);
  border: 1px solid rgba(212,167,44,.4); border-radius: 999px; padding: 4px 9px; flex: none; }
.labsRow:hover .labsName { color: var(--accent-bright); }
.labsNote { font-size: 12px; line-height: 1.6; color: rgba(229,226,225,.45); margin-top: 10px; }

/* Full-bleed game layer (over the camera) */
.gameLayer { position: fixed; inset: 0; z-index: 60; pointer-events: none; color: var(--text);
  font-family: var(--sans); }
.gameLayer.hidden { display: none; }
.gameLayer button { pointer-events: auto; }
/* Cards (first-run 9d, level 9c, end 8b) — centred, glass */
.gCard { pointer-events: auto; position: absolute; left: 28px; right: 28px; top: 50%; transform: translateY(-50%);
  max-width: 420px; margin: 0 auto; border-radius: 20px; background: rgba(19,19,19,.92); backdrop-filter: blur(20px);
  border: 1px solid var(--border); padding: 28px 24px; display: flex; flex-direction: column; align-items: center;
  gap: 10px; text-align: center; }
.gEyebrow { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.gEyebrow.amber { color: var(--warn); }
.gCard h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.15; letter-spacing: -.01em; margin: 4px 0 0; }
.gCard p { font-size: 14px; line-height: 1.7; color: rgba(229,226,225,.6); margin: 0; }
.gLegend { display: flex; align-items: center; gap: 22px; padding: 16px 0; }
.gLeg { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gGlyph { width: 52px; height: 52px; fill: none; stroke-width: 1.75; }
.gGlyph.teal { stroke: var(--accent-bright); } .gGlyph.amber { stroke: var(--warn); }
.gLeg span { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .16em; }
span.teal, b.teal { color: var(--accent-bright); } span.amber { color: var(--warn); }
.gLegNote { flex: 1; text-align: left; font-size: 13px; line-height: 1.55; color: rgba(229,226,225,.55); }
.gFoot { font-size: 12px; color: rgba(229,226,225,.45); }
.gBtn { height: 52px; padding: 0 28px; margin-top: 10px; width: 100%; }
.gBtnWide { flex: 1.4; }
.gLink { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; margin-top: 2px; }
.gLvlNum, .gEndScore { font-family: var(--mono); font-weight: 700; font-size: 84px; line-height: .95; letter-spacing: -.04em; }
.gLvlGlyphs { display: flex; gap: 12px; margin: 6px 0; }
.gChip { position: relative; width: 44px; height: 44px; border: 2px solid var(--accent-bright); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 600; font-size: 15px; color: var(--accent-bright); }
.gLvlLine { font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.35; }
.gEndSay { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--accent-bright); }
.gEndStats { display: flex; gap: 24px; margin-top: 12px; }
.gEndStats b { display: block; font-family: var(--mono); font-weight: 700; font-size: 22px; letter-spacing: -.02em; }
.gEndStats small { font-family: var(--mono); font-size: 8px; letter-spacing: .16em; color: rgba(229,226,225,.5); }
.gEndBtns { display: flex; gap: 10px; width: 100%; margin-top: 16px; }
.gEndBtns button { flex: 1; height: 48px; margin: 0; }
/* In-play HUD (8a) */
.gPlay { position: absolute; inset: 0; }
.gTop { position: absolute; top: 64px; left: 0; right: 0; text-align: center; }
.gScoreLbl { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.gScore { font-family: var(--mono); font-weight: 700; font-size: 72px; line-height: .95; letter-spacing: -.04em; text-shadow: 0 2px 24px rgba(0,0,0,.5); }
.gTimer { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--accent-bright); margin-top: 4px; }
.gHint { position: absolute; left: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  padding: 7px 14px; border-radius: 999px; background: rgba(19,19,19,.55); border: 1px solid rgba(229,226,225,.12);
  backdrop-filter: blur(8px); white-space: nowrap; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: rgba(229,226,225,.55); }
.gExit { position: absolute; top: max(18px, env(safe-area-inset-top)); right: 18px; width: 40px; height: 40px;
  border-radius: 50%; background: rgba(19,19,19,.55); border: 1px solid var(--border); color: var(--text); font-size: 16px; cursor: pointer; }

/* ============================================================
   GESTURE REFERENCE CARD (feature 13) — comps 8d / 8e
   ============================================================ */
.gestRow { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border); }
.gestRowText { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gestRowName { font-size: 14px; font-weight: 500; }
.gestRowText small { font-size: 12px; color: var(--muted); }
#viewGuideBtn { flex: none; color: var(--accent-bright); }

.gestureCard { position: fixed; inset: 0; z-index: 70; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  overflow-y: auto; }
.gestureCard.hidden { display: none; }
.gcCard { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 18px; }
.gcHead { display: flex; flex-direction: column; gap: 6px; }
.gcTitle { font-family: var(--serif); font-weight: 500; font-size: 32px; line-height: 1.15; letter-spacing: -.01em; margin: 0; }
.gcHold { font-size: 13px; color: var(--muted); }
.gcRows { display: flex; flex-direction: column; }
.gcRow { display: flex; align-items: center; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.gcGlyph { flex: none; color: var(--text); }
.gcRowText { flex: 1; min-width: 0; }
.gcName { font-size: 14px; font-weight: 500; }
.gcDesc { font-size: 12px; color: rgba(229,226,225,.5); margin-top: 2px; }
.gcAction { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .14em;
  color: var(--accent-bright); text-align: right; flex: none; }
.gcNotes { display: flex; flex-direction: column; gap: 8px; }
.gcContext { font-size: 13px; line-height: 1.6; color: rgba(229,226,225,.6); }
.gcCamera { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(229,226,225,.5); }
.gcDone { height: 52px; margin-top: 6px; }
@media (max-width: 420px) { .gcAction { font-size: 9px; } .gcRow { gap: 12px; } }

/* ===========================================================================
   Friend challenges (feature 15). "Progress is drawn, not written" - racing
   bars, per-row bars scaled to the leader, day segments, daily ladders; teal
   leads, gold only on the winner numeral, ranks move teal-up / white-down,
   never red. Tokens: --accent #14a384, --accent-bright #1fc09d.
   =========================================================================== */

/* ---- Home section under You (10a / 10b) ---- */
.chSection { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.chHead { display: flex; flex-direction: column; gap: 3px; }
.chEyebrow { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted); }
.chEyebrow.teal { color: var(--accent-bright); }
.chLede { font-size: 13px; line-height: 1.5; color: var(--muted); }
.chCard { text-align: left; width: 100%; border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 18px; background: var(--panel); color: var(--text); display: flex; flex-direction: column;
  gap: 10px; cursor: pointer; font-family: var(--sans); }
.chCard.lead { border-color: var(--accent); background: rgba(20,163,132,.07); }
.chCardTop { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.chCardTitle { font-family: var(--serif); font-weight: 500; font-size: 19px; }
.chCardBadge { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--muted); white-space: nowrap; }
.chCardBadge.teal { color: var(--accent-bright); }
.chCardStand { display: flex; align-items: center; gap: 10px; }
.chRank { font-family: var(--mono); font-weight: 700; font-size: 30px; letter-spacing: -.03em; color: rgba(229,226,225,.85); }
.chRank.teal { color: var(--accent-bright); }
.chSub { font-size: 13px; color: var(--muted); }
.chSplit { display: flex; height: 5px; border-radius: 999px; overflow: hidden; background: var(--border); }
.chSplit.big { height: 6px; }
.chSplitGap { width: 3px; background: var(--bg); flex: none; }
.chSegs { display: flex; gap: 5px; }
.chSeg { flex: 1; height: 5px; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 1px rgba(229,226,225,.25); }
.chSeg.on { background: var(--accent); box-shadow: none; }
.chSeg.miss { box-shadow: inset 0 0 0 1px rgba(212,167,44,.5); position: relative; }
.chSeg.miss::after { content: ""; position: absolute; top: 50%; left: 25%; right: 25%; height: 2px;
  transform: translateY(-50%); border-radius: 999px; background: var(--warn); }
.chEmpty { border: 1px dashed var(--border); border-radius: 16px; padding: 24px 20px;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.chEmptyRank { font-family: var(--mono); font-weight: 700; font-size: 34px; letter-spacing: -.03em; color: rgba(229,226,225,.25); }
.chEmptyLine { font-family: var(--serif); font-size: 18px; line-height: 1.45; color: rgba(229,226,225,.75); }
.chStartGhost { height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--accent);
  background: transparent; color: var(--accent-bright); font-weight: 600; font-size: 13px; cursor: pointer;
  font-family: var(--sans); align-self: flex-start; }
.chStartBtn { height: 50px; border-radius: 999px; border: none; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 15px; cursor: pointer; font-family: var(--sans); }
.chStartBtn:hover, .chStartGhost:hover { filter: brightness(1.06); }

/* ---- Full-screen overlay + shared screen furniture ---- */
.chOverlay { position: fixed; inset: 0; z-index: 60; display: none; background: var(--bg);
  overflow-y: auto; -webkit-overflow-scrolling: touch; }
.chOverlay.show { display: block; }
body.chLock { overflow: hidden; }
.chScreen { min-height: 100dvh; position: relative; display: flex; flex-direction: column;
  justify-content: center; padding: max(40px, env(safe-area-inset-top)) 24px calc(40px + env(safe-area-inset-bottom)); }
.chScreen.center { align-items: center; text-align: center; }
.chScreen.halo { background: radial-gradient(70% 45% at 50% 32%, rgba(20,163,132,.09) 0%, transparent 100%); }
.chScreenBody { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 460px; margin: 0 auto; }
.chScreenBody.center { align-items: center; text-align: center; }
.chX { position: absolute; top: 16px; right: 18px; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 22px; line-height: 1;
  cursor: pointer; z-index: 2; }
.chBigTitle { font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -.01em; line-height: 1.2; }
.chItalic { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--accent-bright); }
.chStamp { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .16em; color: var(--muted); }
.chStamp.gold { color: #c9a227; }
.chNote { font-size: 14px; line-height: 1.65; color: var(--muted); max-width: 300px; }
.chErr { font-family: var(--serif); font-size: 22px; color: rgba(229,226,225,.85); }
.chFoot { font-size: 12px; color: rgba(229,226,225,.4); }
.chPrimary { height: 52px; padding: 0 22px; border-radius: 999px; border: none; background: var(--accent);
  color: var(--accent-ink); font-weight: 600; font-size: 15px; cursor: pointer; font-family: var(--sans);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.chPrimary:hover { background: var(--accent-bright); }
.chPrimary.grow { flex: 1.4; }
.chGhost { height: 50px; padding: 0 22px; border-radius: 999px; border: 1px solid rgba(229,226,225,.25);
  background: transparent; color: var(--text); font-weight: 500; font-size: 14px; cursor: pointer; font-family: var(--sans); }
.chGhost.grow { flex: 1; }
.chText { background: none; border: none; color: rgba(229,226,225,.5); font-size: 13px; cursor: pointer;
  font-family: var(--sans); padding: 6px; }
.chText:hover { color: var(--text); }
.chSpin { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border);
  border-top-color: var(--accent-bright); animation: chSpin .8s linear infinite; }
@keyframes chSpin { to { transform: rotate(360deg); } }

/* ---- Templates (10c) ---- */
.chTpl { text-align: left; width: 100%; border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px;
  background: var(--panel); color: var(--text); display: flex; flex-direction: column; gap: 5px; cursor: pointer;
  font-family: var(--sans); }
.chTpl.lead { border-color: var(--accent); background: rgba(20,163,132,.07); }
.chTplTop { display: flex; align-items: baseline; justify-content: space-between; }
.chTplName { font-family: var(--serif); font-weight: 500; font-size: 19px; }
.chTplDays { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--muted); }
.chTplBlurb { font-size: 12px; line-height: 1.55; color: var(--muted); }
.chTplVerified { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--accent-bright); margin-top: 3px; }

/* ---- Share (10d) ---- */
.chLinkRow { display: flex; align-items: center; gap: 10px; width: 100%; }
.chLink { flex: 1; height: 50px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel);
  display: flex; align-items: center; padding: 0 18px; font-family: var(--mono); font-size: 12px;
  color: var(--muted); overflow: hidden; white-space: nowrap; }
.chCopy { height: 50px; white-space: nowrap; }

/* ---- Privacy sheet (10j) ---- */
.chSheetWrap { min-height: 100dvh; display: flex; align-items: flex-end; justify-content: center;
  padding: 0; background: rgba(0,0,0,.5); }
.chSheet { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 20px 20px 0 0; padding: 14px 22px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px; }
.chGrab { width: 36px; height: 4px; border-radius: 999px; background: rgba(229,226,225,.22); margin: 0 auto; }
.chSheetHead { display: flex; flex-direction: column; gap: 6px; }
.chSheetTitle { font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: -.01em; line-height: 1.2; }
.chShared { display: flex; flex-direction: column; gap: 10px; }
.chSharedRow { display: flex; gap: 12px; align-items: baseline; font-size: 14px; line-height: 1.5; color: rgba(229,226,225,.8); }
.chSharedRow svg { flex: none; transform: translateY(1px); }
.chSharedNote { font-size: 13px; line-height: 1.65; color: var(--muted); margin: 0; }
.chField { display: flex; flex-direction: column; gap: 8px; }
.chFieldLbl { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.chInput { height: 48px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg);
  color: var(--text); padding: 0 16px; font-size: 15px; font-weight: 500; font-family: var(--sans); }
.chInput:focus { outline: none; border-color: var(--accent); }

/* ---- Boards: header + actions ---- */
.chBoardHead { display: flex; flex-direction: column; gap: 4px; }
.chBoardTitle { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: -.01em; }
.chBoardMeta { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--accent-bright); }
.chBoardActions { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 6px; }
.chBoardActions.row { flex-direction: row; width: 100%; padding: 0 20px; box-sizing: border-box; }
.chBoardActions .chPrimary { min-width: 200px; }

/* ---- Duel (10g): facing columns, delta, border beam on the leader ---- */
.chDuel { display: flex; align-items: stretch; gap: 0; }
.chDuelCol { flex: 1; border: 1px solid var(--border); border-radius: 18px; background: var(--panel);
  padding: 20px 12px; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; box-sizing: border-box; }
.chDuelCol.beam { border: none; padding: 1.5px; border-radius: 18px; display: block;
  background: conic-gradient(from 230deg, transparent 0 55%, var(--accent-bright) 76%, transparent 92%), rgba(20,163,132,.45); }
.chBeamInner { height: 100%; border-radius: 17px; background: #15201d; padding: 20px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; box-sizing: border-box; }
.chAvatar { width: 44px; height: 44px; border-radius: 50%; background: var(--border); color: var(--text);
  display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 15px; font-weight: 600; }
.chAvatar.me { background: var(--accent); color: var(--accent-ink); }
.chAvatar.sm { width: 34px; height: 34px; font-size: 13px; }
.chDuelName { font-size: 14px; font-weight: 600; margin-top: 2px; }
.chDuelNum { font-family: var(--mono); font-weight: 700; font-size: 48px; line-height: .95; letter-spacing: -.04em; color: rgba(229,226,225,.85); }
.chDuelNum.teal { color: var(--accent-bright); }
.chDuelUnit { font-family: var(--mono); font-size: 9px; letter-spacing: .16em; color: var(--muted); }
.chSpark { display: flex; align-items: flex-end; gap: 3px; height: 20px; margin-top: 8px; }
.chSpark > div { width: 4px; border-radius: 2px; }
.chDuelMid { width: 72px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.chDelta { font-family: var(--mono); font-weight: 700; font-size: 28px; letter-spacing: -.02em; }
.chDelta.teal { color: var(--accent-bright); } .chDelta.dim { color: rgba(229,226,225,.8); }
.chDeltaLbl { font-family: var(--mono); font-size: 8px; font-weight: 600; letter-spacing: .16em; color: var(--muted); }
.chDuelFoot { display: flex; flex-direction: column; gap: 8px; }
.chDuelLine { font-family: var(--serif); font-style: italic; font-size: 15px; color: rgba(229,226,225,.65); text-align: center; }

/* ---- Leaderboard (10h): rank, name, move arrow, bar scaled to leader ---- */
.chBoardList { display: flex; flex-direction: column; }
.chRow { display: flex; flex-direction: column; gap: 7px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.chRow.me { padding: 12px; border: 1px solid rgba(20,163,132,.4); background: rgba(20,163,132,.1); border-radius: 12px; margin: 4px 0; }
.chRowTop { display: flex; align-items: center; gap: 12px; }
.chRowRank { font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: -.02em; color: rgba(229,226,225,.85); width: 26px; }
.chRowRank.teal { color: var(--accent-bright); }
.chRowName { flex: 1; font-size: 15px; font-weight: 600; }
.chRowName.teal { color: var(--accent-bright); }
.chMove { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.chMove.up { color: var(--accent-bright); } .chMove.down { color: rgba(229,226,225,.45); }
.chRowNum { font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: -.02em; color: rgba(229,226,225,.85); }
.chRowNum.teal { color: var(--accent-bright); }
.chRowBar { height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; margin-left: 72px; }
.chRowBar > div { height: 100%; }

/* ---- Show-up (10n) + ladder (10o) ---- */
.chShowList { display: flex; flex-direction: column; gap: 12px; }
.chShowRow { display: flex; align-items: center; gap: 12px; }
.chShowName { font-size: 13px; font-weight: 600; width: 44px; color: rgba(229,226,225,.75); }
.chShowName.teal { color: var(--accent-bright); }
.chShowRow .chSegs { flex: 1; }
.chShowRow .chSeg { height: 8px; }
.chLostCard { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--panel);
  display: flex; flex-direction: column; gap: 6px; }
.chLostTitle { font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.4; color: var(--text); }
.chLostSub { font-size: 12px; line-height: 1.6; color: var(--muted); }
.chLadder { display: flex; align-items: flex-end; gap: 14px; height: 120px; padding: 0 8px; }
.chLadCell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chLadBar { width: 100%; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(229,226,225,.2); position: relative; }
.chLadBar.on { background: var(--accent); box-shadow: none; }
.chLadNum { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-family: var(--mono);
  font-weight: 700; font-size: 14px; color: var(--accent-bright); }
.chLadLbl { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; color: var(--muted); }
.chLadLbl.teal { color: var(--accent-bright); }

/* ---- Winner (10i): gold numeral, confetti, runner-up ---- */
.chGold { font-family: var(--mono); font-weight: 700; font-size: 96px; line-height: .95; letter-spacing: -.04em;
  background: linear-gradient(180deg, #f0d98c 0%, #c9a227 70%, #a8841d 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.chConfetti { position: absolute; width: 6px; height: 11px; border-radius: 1px; z-index: 1; }
.chDivider { width: 200px; height: 1px; background: var(--border); margin: 8px 0; }
.chRunnerName { font-size: 15px; font-weight: 600; }
.chRunnerLine { font-family: var(--serif); font-style: italic; font-size: 18px; color: rgba(229,226,225,.75); }

/* ---- Lead-change toast (10l) ---- */
.chToast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  z-index: 70; max-width: 360px; width: calc(100% - 48px); background: rgba(19,19,19,.92); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 18px; opacity: 0; pointer-events: none; backdrop-filter: blur(12px);
  transition: opacity .3s ease, transform .3s cubic-bezier(.22,1,.36,1); }
.chToast.show { opacity: 1; transform: translate(-50%, 0); }
.chToast.good { border-color: rgba(31,192,157,.4); }
.chToastKind { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .2em; color: rgba(229,226,225,.5); }
.chToast.good .chToastKind { color: var(--accent-bright); }
.chToastLine { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 22px; line-height: 1.2; margin-top: 4px; color: var(--text); }
.chToast.good .chToastLine { color: var(--accent-bright); }

/* ---- Rest-overlay mini board (10m) ---- */
.chRest { width: 100%; border: 1px solid var(--border); border-radius: 16px; background: var(--panel);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; }
.chRestTop { display: flex; align-items: center; justify-content: space-between; }
.chRestTag { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .18em; color: var(--accent-bright); }
.chRestVerified { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: rgba(229,226,225,.4); }
.chRestRow { display: flex; align-items: center; gap: 10px; }
.chRestName { font-size: 13px; font-weight: 600; width: 44px; color: rgba(229,226,225,.75); }
.chRestName.teal { color: var(--accent-bright); }
.chRestBar { flex: 1; height: 5px; border-radius: 999px; background: rgba(19,19,19,.6); overflow: hidden; }
.chRestBar > div { height: 100%; }
.chRestNum { font-family: var(--mono); font-weight: 700; font-size: 16px; color: rgba(229,226,225,.85); }
.chRestNum.teal { color: var(--accent-bright); }
.chRestLine { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--muted); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .chSpin { animation: none; }
  .chToast { transition: opacity .2s ease; }
}

/* In-workout duel tick (10k) + rest-overlay board slot (10m) */
.challengePill { align-self: flex-end; margin-top: 8px; padding: 6px 12px; border-radius: 999px;
  background: rgba(19,19,19,.55); border: 1px solid rgba(229,226,225,.2);
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .14em;
  color: rgba(229,226,225,.7); white-space: nowrap; backdrop-filter: blur(8px); }
.challengePill.good { border-color: rgba(31,192,157,.35); color: var(--accent-bright); }
.challengePill.hidden { display: none; }
.restChallenge { width: 100%; max-width: 340px; margin: 18px auto 2px; }
.restChallenge:empty { display: none; }

/* ===========================================================================
   Challenges promoted to a main tab (comps t12) — the tab's three states,
   You->Progress fold-in, and the quiet it's-your-move dot on the nav.
   =========================================================================== */

/* The tab panel container */
.challengesTab { padding: 4px 2px 8px; }
.chTab { display: flex; flex-direction: column; gap: 14px; }
.chTabHead { display: flex; flex-direction: column; gap: 3px; }
.chTabTitle { font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -.01em; }

/* Empty (12d) + signed-out (12e) — the tab is a pitch surface */
.chTabPitch, .chTabSignedOut { min-height: 58vh; justify-content: center; gap: 16px;
  background: radial-gradient(70% 40% at 50% 34%, rgba(20,163,132,.07) 0%, transparent 100%); }
.chTabSignedOut { justify-content: center; }
.chPitchGlyph { color: var(--accent-bright); }
.chPitchTitle { font-family: var(--serif); font-weight: 500; font-size: 32px; line-height: 1.15; letter-spacing: -.015em; }
.chTabSignedOut .chPitchTitle { font-size: 30px; }
.chPitchBody { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 0; }
.chPitchFoot { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.chPitchFoot .chStartBtn, .chPitchFoot .chPrimary { width: 100%; }
.chPitchNote { font-size: 12px; color: rgba(229,226,225,.45); text-align: center; }
.chPitchNote.mono { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .18em; color: rgba(229,226,225,.4); }
.chRules { border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; background: var(--panel);
  display: flex; flex-direction: column; gap: 9px; }
.chRule { display: flex; gap: 12px; font-size: 13px; line-height: 1.5; color: rgba(229,226,225,.75); }
.chRule i { font-family: var(--mono); font-style: normal; font-size: 11px; color: var(--accent-bright); letter-spacing: .1em; flex: none; }

/* You -> Progress (comp 12f) */
.progressSec { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.progHead { display: flex; align-items: baseline; justify-content: space-between; }
.progWk { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(229,226,225,.4); }
.histAll { width: 100%; background: none; border: none; text-align: left; cursor: pointer; padding: 12px 0;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--accent-bright); }

/* The quiet it's-your-move dot — mobile tab bar + desktop top nav */
.tab .tabIcon { position: relative; }
.tab.hasBadge .tabIcon::after {
  content: ""; position: absolute; top: -2px; right: -4px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent-bright); }
.topTab.hasBadge { position: relative; }
.topTab.hasBadge::after {
  content: ""; position: absolute; top: 8px; right: -3px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent-bright); }

/* ===========================================================================
   Challenges — group mode, configurable length, "the work" breakdown (t12
   addenda / v14 prototype feel; doc rules win). No freezes, no shop, ever.
   =========================================================================== */

/* LENGTH picker on template cards */
.chTpl .chTplDays { color: var(--muted); }
.chLenRow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.chLenLbl { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: rgba(229,226,225,.45); }
.chLen { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: rgba(229,226,225,.75); font-family: var(--mono); font-size: 11px;
  font-weight: 600; cursor: pointer; }
.chLen:hover { border-color: var(--accent); color: var(--accent-bright); }

/* THE WORK — WHERE IT'S WON */
.chWorkHead { display: flex; align-items: baseline; justify-content: space-between; margin-top: 2px; }
.chWorkTitle { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .2em; color: var(--muted); }
.chWorkTot { font-family: var(--mono); font-size: 8px; letter-spacing: .14em; color: rgba(229,226,225,.4); }
.chWorkTot b { color: var(--accent-bright); }
.chWorkList { display: flex; flex-direction: column; gap: 10px; }
.chWorkRow { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel); padding: 10px 12px; }
.chWorkThumb { width: 52px; height: 40px; object-fit: cover; border-radius: 8px; filter: saturate(.8); flex: none; }
.chWorkBody { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.chWorkTop { display: flex; align-items: baseline; justify-content: space-between; }
.chWorkName { font-size: 13px; font-weight: 600; }
.chWorkDelta { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; }
.chWorkBar { height: 3.5px; border-radius: 999px; background: var(--border); overflow: hidden; }
.chWorkBar > div { height: 100%; }
.chWorkNums { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 8px; letter-spacing: .1em; color: rgba(229,226,225,.4); }
.chWorkNums b { color: var(--accent-bright); }

/* GROUP streak board — hero */
.chGHero { display: flex; align-items: stretch; }
.chGHeroCol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--border); box-sizing: border-box; }
.chGHeroCol.beam2 { background: rgba(20,163,132,.08); border-color: rgba(20,163,132,.4); }
.chGHeroLbl { font-family: var(--mono); font-size: 8px; font-weight: 600; letter-spacing: .16em; color: rgba(229,226,225,.5); text-align: center; }
.chGHeroNum { font-family: var(--mono); font-weight: 700; font-size: 40px; line-height: .95; letter-spacing: -.03em; color: rgba(229,226,225,.85); }
.chGHeroNum.teal { color: var(--accent-bright); }
.chGHeroUnit { font-family: var(--mono); font-size: 8px; letter-spacing: .14em; color: rgba(229,226,225,.4); }
.chGHeroVs { width: 66px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.chGVs { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .18em; color: rgba(229,226,225,.35); }
.chGVsNum { font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.chGVsNum.teal { color: var(--accent-bright); } .chGVsNum.warn { color: var(--warn); }
.chGVsLbl { font-family: var(--mono); font-size: 7px; font-weight: 600; letter-spacing: .14em; color: rgba(229,226,225,.45); text-align: center; }

/* GROUP rows + last-7 segments */
.chGList { display: flex; flex-direction: column; }
.chGRow { display: flex; flex-direction: column; gap: 7px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.chGRow.me { padding: 12px; border: 1px solid rgba(20,163,132,.4); background: rgba(20,163,132,.1); border-radius: 12px; margin: 4px 0; }
.chGRowTop { display: flex; align-items: center; gap: 12px; }
.chGRowTop .chRowName { flex: 1; }
.chSegs7 { display: flex; gap: 3px; align-items: center; margin-left: 72px; }
.chSeg7 { flex: 1; height: 5px; border-radius: 999px; background: var(--border); }
.chSeg7.on { background: var(--accent); }
.chSeg7Lbl { font-family: var(--mono); font-size: 7px; letter-spacing: .1em; color: rgba(229,226,225,.35); flex: none; margin-left: 4px; }

/* TODAY — who's shown up */
.chToday { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.chTodayHead { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .18em; color: rgba(229,226,225,.55); }
.chTodayRow { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.chTodayCell { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.chTodayAv { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--border);
  display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--text); opacity: .5; }
.chTodayAv.done { opacity: 1; box-shadow: inset 0 0 0 1.5px var(--accent); }
.chTodayAv.me { color: var(--accent-bright); }
.chTodayDone { position: absolute; bottom: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--panel); display: flex; align-items: center; justify-content: center; }
.chTodayName { font-family: var(--mono); font-size: 8px; letter-spacing: .1em; color: rgba(229,226,225,.55); }
.chTodayName.teal { color: var(--accent-bright); }

/* ===========================================================================
   Desktop parity (feature 16, Part A) — the coaching station. EVERYTHING here
   is gated to desktop (>=860px) or guarded, so mobile stays byte-identical.
   No engine/gesture/threshold/recorder change; desktop CSS + a keyboard layer.
   =========================================================================== */
@media (min-width: 860px) {
  /* ---- Nav: level chip + XP ring around the avatar ---- */
  .navLevel { font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
    color: rgba(229,226,225,.5); white-space: nowrap; align-self: center; }
  .topbar .topAccount {
    padding: 3px; border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--xp, 0) * 1%), rgba(229,226,225,.16) 0);
  }
  .topbar .topAccount .topAvatarWrap { border: 2px solid var(--bg); border-radius: 50%; background: var(--panel); }
  .topbar .topAccount .topAvatarImg { border: 2px solid var(--bg); }

  /* ---- Cockpit rail: reorder the coach panel into the coaching station ---- */
  body[data-view="coach"] .tabPanel[data-panel="coach"] { display: flex; flex-direction: column; gap: 12px; height: 100%; }
  body[data-view="coach"] .tabPanel[data-panel="coach"] > #cockpit { order: 1; }
  body[data-view="coach"] .tabPanel[data-panel="coach"] > .thisSetHead { order: 3; }
  body[data-view="coach"] .tabPanel[data-panel="coach"] > #log { order: 4; flex: 1; min-height: 72px; overflow-y: auto; }
  body[data-view="coach"] .tabPanel[data-panel="coach"] > #cockActions { order: 5; }
  body[data-view="coach"] .tabPanel[data-panel="coach"] > .exField,
  body[data-view="coach"] .tabPanel[data-panel="coach"] > .coachDemo,
  body[data-view="coach"] .tabPanel[data-panel="coach"] > .toggles,
  body[data-view="coach"] .tabPanel[data-panel="coach"] > .gestRow { order: 8; }
  /* the cockpit action bar replaces these two on desktop */
  body[data-view="coach"] .tabPanel[data-panel="coach"] > #calibBtn,
  body[data-view="coach"] .tabPanel[data-panel="coach"] > .setBtns { display: none; }

  .cockpit { display: flex; flex-direction: column; gap: 12px; }
  .cockEx { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
    border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--text);
    padding: 12px 14px; font-family: var(--sans); }
  .cockEx:hover { border-color: var(--accent); }
  .cockExImg { width: 56px; height: 42px; border-radius: 8px; background-size: cover; background-position: center;
    filter: saturate(.85); flex: none; background-color: var(--border); }
  .cockExText { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .cockExName { font-size: 14px; font-weight: 600; }
  .cockExMuscle { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--accent-bright); }
  .cockExChange { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .1em; color: rgba(229,226,225,.45); white-space: nowrap; }
  .cockStats { display: flex; gap: 12px; }
  .cockStat { flex: 1; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
  .cockStatLbl { display: block; font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .18em; color: rgba(229,226,225,.45); text-transform: uppercase; }
  .cockStatVal { font-family: var(--mono); font-weight: 700; font-size: 28px; letter-spacing: -.02em; }

  /* "This set" becomes the rail card */
  body[data-view="coach"] .thisSetHead { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .18em;
    text-transform: uppercase; color: rgba(229,226,225,.55); margin: 2px 0 0; }
  body[data-view="coach"] #log { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); padding: 6px 14px; }

  /* Action bar */
  .cockActions { display: flex; gap: 10px; }
  .cockMeasure { flex: none; height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border);
    background: transparent; color: rgba(229,226,225,.7); font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .1em; cursor: pointer; }
  .cockMeasure:hover { border-color: var(--accent); color: var(--accent-bright); }
  .cockLog { flex: 1; height: 50px; border-radius: 12px; border: none; background: var(--accent); color: var(--accent-ink);
    display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; font-size: 14px; cursor: pointer; font-family: var(--sans); }
  .cockLog:hover { background: var(--accent-bright); }
  .cockKey { font-family: var(--mono); font-size: 9px; opacity: .6; border: 1px solid rgba(6,35,28,.4); border-radius: 4px; padding: 1px 6px; }
  .cockStop { flex: none; width: 50px; height: 50px; border-radius: 12px; border: 1.5px solid var(--accent); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .cockStop span { width: 14px; height: 14px; border-radius: 3px; background: var(--accent); }

  /* Keyboard hint strip under the camera */
  .keyHints { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 22px;
    font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: rgba(229,226,225,.35); pointer-events: none; z-index: 4; }
  .keyHints b { border: 1px solid rgba(229,226,225,.25); border-radius: 4px; padding: 2px 7px; color: rgba(229,226,225,.55); font-weight: 400; }
  #keyHintsMore { pointer-events: auto; cursor: pointer; }
  body.immersive .keyHints { display: none; }

  /* Calibration split-pane (14e): the calib rail docks to the right, camera keeps the rest */
  body.calibrating .calibBar { position: absolute; left: auto; right: 0; top: 0; bottom: 0; transform: none;
    width: 420px; max-width: 42vw; border: none; border-left: 1px solid var(--border); border-radius: 0;
    background: var(--bg); display: flex; flex-direction: column; }

  /* Hover + focus rules everywhere (the ruling) */
  .rangeRow, .recRow, .libCard { transition: transform .12s ease, box-shadow .12s ease; }
  .rangeRow:hover, .recRow:hover, .libCard:hover { transform: translateY(-1px); box-shadow: inset 3px 0 0 var(--accent); }
  a:focus-visible, button:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 1.5px solid var(--accent-bright); outline-offset: 2px; }
}

/* The ? shortcut overlay — hidden by default; only the desktop keyboard layer
   ever toggles it, and it is force-hidden below the breakpoint for good measure. */
.shortcutOverlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); padding: 24px; }
.shortcutOverlay.hidden { display: none; }
.shortcutCard { width: 560px; max-width: 100%; border-radius: 20px; background: rgba(19,19,19,.97); border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,.4); padding: 26px 28px; }
.shortcutHead { display: flex; align-items: baseline; gap: 12px; padding-bottom: 10px; }
.shortcutTitle { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.shortcutSub { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: rgba(229,226,225,.4); }
.shortcutClose { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }
.shortcutGrid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
.shortcutRow { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(229,226,225,.07); font-size: 13px; color: rgba(229,226,225,.8); }
.shortcutRow kbd { font-family: var(--mono); font-size: 11px; border: 1px solid rgba(229,226,225,.25); border-radius: 5px; padding: 3px 10px; color: rgba(229,226,225,.7); }
.shortcutFoot { font-size: 12px; color: rgba(229,226,225,.45); padding-top: 12px; }
@media (max-width: 859px) { .shortcutOverlay { display: none !important; } }

/* ---- Cockpit REST state (14b) — desktop only ---------------------------- */
@media (min-width: 860px) {
  /* the rest rail is hidden until we're actually resting */
  .cockRest { display: none; flex-direction: column; gap: 12px; }
  body.cockResting .cockRest { display: flex; order: 1; }
  /* while resting, the mid-set blocks step aside (comp 14b) */
  body.cockResting[data-view="coach"] .tabPanel[data-panel="coach"] > #cockpit,
  body.cockResting[data-view="coach"] .tabPanel[data-panel="coach"] > .thisSetHead,
  body.cockResting[data-view="coach"] .tabPanel[data-panel="coach"] > #log,
  body.cockResting[data-view="coach"] .tabPanel[data-panel="coach"] > #cockActions { display: none; }

  .cockNext { border: 1px solid rgba(20,163,132,.4); border-radius: 14px; background: rgba(20,163,132,.07);
    padding: 16px; display: flex; flex-direction: column; gap: 12px; }
  .cockNextLbl { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .18em;
    text-transform: uppercase; color: var(--accent-bright); }
  .cockNextRow { display: flex; align-items: center; gap: 12px; }
  .cockNextImg { width: 74px; height: 54px; border-radius: 10px; background-size: cover; background-position: center;
    background-color: var(--border); filter: saturate(.85); flex: none; }
  .cockNextName { font-size: 16px; font-weight: 600; }
  .cockNextMeta { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: rgba(229,226,225,.55); }
  .cockNextBtns { display: flex; gap: 10px; }
  .cockRestBtn { flex: 1; height: 46px; border-radius: 12px; border: 1px solid rgba(229,226,225,.25);
    background: transparent; color: var(--text); font-family: var(--mono); font-weight: 600; font-size: 13px; cursor: pointer; }
  .cockRestBtn:hover { border-color: var(--accent); color: var(--accent-bright); }
  .cockRestBtn.primary { flex: 1.4; border: none; background: var(--accent); color: var(--accent-ink); font-family: var(--sans); }
  .cockRestBtn.primary:hover { background: var(--accent-bright); color: var(--accent-ink); }

  .cockLogged { border: 1px solid var(--border); border-radius: 14px; background: var(--panel);
    padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
  .cockLoggedLbl { font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .18em;
    text-transform: uppercase; color: rgba(229,226,225,.55); padding-bottom: 6px; }
  .cockLoggedRow { display: flex; justify-content: space-between; padding: 5px 0;
    font-family: var(--mono); font-size: 12px; color: rgba(229,226,225,.6); }
  .cockLoggedN { color: var(--text); }
  .cockLoggedEmpty { font-family: var(--serif); font-style: italic; font-size: 13px; color: rgba(229,226,225,.4); padding: 4px 0; }
  .cockBreathe { margin-top: auto; font-family: var(--serif); font-style: italic; font-size: 15px;
    color: rgba(229,226,225,.5); text-align: center; padding-bottom: 6px; }
}

/* ---- 14a: the camera is the centerpiece, not a phone box ----------------- */
@media (min-width: 860px) {
  /* Desktop coaching stops being "stretched mobile": the frame FILLS the column
     instead of being locked to a 9/16 phone portrait, which was using only ~45%
     of the available width and hard-cropping a 16:9 webcam to head-and-shoulders.
     #video and #overlay are both object-fit:cover into this same box, so they
     crop identically and stay aligned; auto-frame reads the box aspect already. */
  body[data-view="coach"] .frameBox { width: 100%; height: 100%; aspect-ratio: auto; max-width: none; }
}

/* ---- 14a metrics: match the comp's geometry exactly --------------------- */
@media (min-width: 860px) {
  /* comp 14a @1440x880: 60px nav · stage padding 20/28/16 · 20px gap · 400px rail
     → camera column = 1440-28-28-400-20 = 964 wide, 880-60-20-16 = 784 tall. */
  body[data-view="coach"] .stage { gap: 20px; padding: 20px 28px 16px; }
  body[data-view="coach"] .side { flex: 0 0 400px; }
}

/* ---- 14a: full-bleed coaching station + 60px nav ------------------------ */
@media (min-width: 860px) {
  /* The 1400px cap steals 40px from the camera at 1440 and more on wider
     screens. The cockpit is full-bleed in the comp — content views keep the cap
     so prose doesn't run to the edges. */
  body[data-view="coach"] .app { max-width: none; }
  /* Comp nav is exactly 60px; ours was 69 (14px padding + 1px border). */
  .topbar { height: 60px; padding: 0 28px; }
}

/* ===========================================================================
   14a — the coaching station, screen to screen. The desktop nav is part of the
   full-height layout (60px, flex:none) and is styled to the comp: mono caps,
   teal underline on the active tab, level chip + XP-ring avatar. The topbar is
   display:none below 860px, so none of this can reach mobile.
   =========================================================================== */
@media (min-width: 860px) {
  /* --- screen to screen: nav + stage exactly fill the viewport, never scroll --- */
  body[data-view="coach"] .app { height: 100dvh; overflow: hidden; }
  body[data-view="coach"] .stage { min-height: 0; }

  /* --- the bar --- */
  .topbar { gap: 32px; border-bottom: 1px solid var(--border); }
  .brand { display: flex; align-items: center; gap: 9px; }
  .brandGlyph { flex: none; }
  .brandName { font-family: var(--mono); font-size: 10px; font-weight: 600;
    letter-spacing: .18em; text-transform: uppercase; color: var(--text); }
  .topnav { display: flex; gap: 26px; align-items: stretch; height: 100%; }
  .topbar .topTab {
    font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .16em;
    text-transform: uppercase; color: rgba(229,226,225,.5);
    background: none; border: none; border-bottom: 2px solid transparent;
    padding: 0; margin: 0; height: 100%; border-radius: 0; cursor: pointer;
  }
  .topbar .topTab:hover { color: var(--text); }
  .topbar .topTab.active { color: var(--accent-bright); border-bottom-color: var(--accent); }
  /* the account button is a ring, not a tab — keep it out of the underline rules */
  .topbar .topTab.topAccount, .topbar .topTab.topAccount.active { border-bottom-color: transparent; height: auto; }
  .topRight { display: flex; align-items: center; gap: 12px; margin-left: auto; }
  /* immersive lives on the camera as a pill (below), not as a nav icon */
  .topbar #immersiveBtn { display: none; }

  /* --- the camera column: camera fills, hints sit BELOW it (not on top) --- */
  body[data-view="coach"] .videoWrap { display: flex; flex-direction: column; gap: 10px; }
  body[data-view="coach"] .frameBox { flex: 1; min-height: 0; border-radius: 16px; }
  .keyHints { position: static; flex: none; display: flex; justify-content: center; gap: 22px;
    font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: rgba(229,226,225,.35); }

  /* --- IMMERSIVE · F pill on the camera (14a) --- */
  .immersivePill { position: absolute; top: 26px; right: 26px; z-index: 5;
    height: 36px; padding: 0 16px; border-radius: 999px;
    background: rgba(19,19,19,.6); border: 1px solid rgba(229,226,225,.16);
    backdrop-filter: blur(8px); display: flex; align-items: center; gap: 8px; cursor: pointer;
    font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .14em;
    color: rgba(229,226,225,.7); }
  .immersivePill:hover { border-color: var(--accent); color: var(--accent-bright); }
  body.immersive .immersivePill { display: none; }
}

/* ===========================================================================
   15c — the You hub as a desktop two-column: identity + chart + session table
   on the left, a "YOURS" rail on the right. On mobile .youMain/.youSide are
   plain transparent wrappers, so the stack order is exactly what it was.
   =========================================================================== */
@media (min-width: 860px) {
  /* the hub uses the full width, not the 760px reading column */
  body[data-view="account"] .tabBody { max-width: none; padding: 28px 40px; }
  body[data-view="account"] #account {
    display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 28px; align-items: start;
  }
  /* identity block spans both columns, like the comp's header row */
  body[data-view="account"] #account > .acctProfile,
  body[data-view="account"] #account > .acctScreen { grid-column: 1 / -1; }
  .youMain { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
  .youSide { display: flex; flex-direction: column; gap: 2px; }

  /* identity row: avatar + name/email/level, stat tiles pushed right */
  body[data-view="account"] .acctProfile { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
  body[data-view="account"] .acctIdent { display: flex; align-items: center; gap: 18px; }
  body[data-view="account"] .acctAvatar { width: 64px; height: 64px; }
  body[data-view="account"] .acctName { font-family: var(--serif); font-weight: 500; font-size: 24px; }
  body[data-view="account"] .acctEmail { font-size: 12px; color: rgba(229,226,225,.5); }
  body[data-view="account"] .acctSync { margin-left: auto; }

  /* Progress: stat tiles in a row, chart + session list as cards (15c) */
  body[data-view="account"] .progressSec { gap: 14px; }
  body[data-view="account"] .progressSec .statRow { display: flex; gap: 12px; }
  body[data-view="account"] .progressSec .stat { flex: 1; border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 16px; background: var(--panel); text-align: center; }
  body[data-view="account"] #weekChart { border: 1px solid var(--border); border-radius: 16px;
    background: var(--panel); padding: 18px 20px; }
  body[data-view="account"] #historyList { border: 1px solid var(--border); border-radius: 16px;
    background: var(--panel); padding: 12px; display: flex; flex-direction: column; gap: 2px; }

  /* YOURS rail: rows lift with a teal edge (the hover rule) */
  .youSide .rangesSec, .youSide .setRow { border: none; background: none; padding: 0; }
  .youSide .rangesSec > .eyebrow { font-family: var(--mono); font-size: 10px; font-weight: 600;
    letter-spacing: .2em; text-transform: uppercase; color: rgba(229,226,225,.55); padding-bottom: 8px; display: block; }
  .youSide .rangeRow, .youSide .recRow, .youSide .labsRow, .youSide .setRow {
    border-radius: 10px; border-left: 2px solid transparent; padding: 13px 12px;
    transition: background .12s ease, border-color .12s ease; }
  .youSide .rangeRow:hover, .youSide .recRow:hover, .youSide .labsRow:hover, .youSide .setRow:hover {
    background: rgba(20,163,132,.05); border-left-color: var(--accent); transform: none; box-shadow: none; }
  .youSide .acctSignout { margin-top: 14px; height: 46px; border-radius: 12px; }
}

/* ===========================================================================
   Exercise / routine picker modal (brief 6). Photo cards + search + the
   routine shortcuts, so changing what you're coaching is one decision in one
   place. Responsive: the 880px / 3-column card on desktop, a full-width
   1-column sheet on phones — same component, same language, both widths.
   =========================================================================== */
.pickerModal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(13,13,12,.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.pickerModal.hidden { display: none; }

.pickerCard {
  width: 880px; max-width: 100%; max-height: 720px; box-sizing: border-box;
  border-radius: 20px; background: rgba(19,19,19,.97); border: 1px solid #2a2a2a;
  box-shadow: 0 20px 60px rgba(0,0,0,.4); padding: 26px 28px;
  display: flex; flex-direction: column; gap: 16px; overflow: hidden;
  animation: pickerPop .22s ease-out both;
}
.pickerHead { display: flex; align-items: center; justify-content: space-between; }
.pickerTitle { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 0; }
.pickerClose {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: rgba(229,226,225,.08); border: 1px solid rgba(229,226,225,.15);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.pickerClose svg { width: 12px; height: 12px; stroke: rgba(229,226,225,.7); }
.pickerClose:hover { background: rgba(229,226,225,.14); }


.pickerEyebrow {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: rgba(229,226,225,.5);
}
.pickerChips { display: contents; }
.pickerChip {
  height: 34px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: none; color: var(--ink);
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
}
.pickerChip:hover { border-color: var(--accent); color: var(--accent-bright); }
.pickerChipAI { border-style: dashed; border-color: rgba(20,163,132,.5); color: var(--accent-bright); }

.pickerSearch {
  display: flex; align-items: center; gap: 10px; height: 44px; flex: none;
  border-radius: 12px; border: 1px solid #2a2a2a; background: #1c1b1b;
  padding: 0 14px; box-sizing: border-box;
}
.pickerSearch svg { width: 15px; height: 15px; stroke: rgba(229,226,225,.5); flex: none; }
.pickerSearch input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--ink); font-family: inherit; font-size: 14px;
}

.pickerGrid {
  flex: 1; min-height: 0; overflow-y: auto; align-content: start;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.pickerOpt {
  border: 1px solid var(--border); border-radius: 12px; background: none;
  padding: 12px; display: flex; align-items: center; gap: 13px;
  cursor: pointer; text-align: left; color: var(--ink); width: 100%;
}
.pickerOpt:hover { border-color: var(--accent); }
.pickerOptImg {
  width: 66px; height: 50px; flex: none; border-radius: 8px;
  background: #222 center/cover no-repeat; filter: saturate(.85);
}
.pickerOptText { flex: 1; min-width: 0; }
.pickerOptName {
  font-size: 15px; font-weight: 600; display: block; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pickerOptMuscle {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent-bright);
  margin-top: 3px; line-height: 1.35;
  /* bigger type wraps the long lists to three lines and the grid goes ragged —
     two lines is enough to identify the movement */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pickerOpt.current { border-color: var(--accent); background: rgba(20,163,132,.06); }
.pickerOpt.current .pickerOptName { color: var(--accent-bright); }
.pickerOptTick { width: 14px; height: 14px; flex: none; stroke: var(--accent-bright); }
.pickerOpt:not(.current) .pickerOptTick { display: none; }
.pickerNone {
  grid-column: 1 / -1; padding: 30px 0; text-align: center;
  font-family: var(--serif); font-style: italic; font-size: 17px;
  color: rgba(229,226,225,.5);
}

/* Phones: a sheet, not a floating card — one column, thumb-reachable. */
@media (max-width: 859px) {
  .pickerModal { padding: 0; align-items: flex-end; }
  .pickerCard {
    width: 100%; max-height: 88dvh; border-radius: 20px 20px 0 0;
    border-bottom: none; padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .pickerGrid { grid-template-columns: 1fr; }
}

/* ===========================================================================
   Desktop chrome fixes
   1. The nav is a flex item in a 100dvh column, so when Learn's page claimed
      the height the 60px bar got shrunk to 23. flex:none pins it.
   2. The nav must be edge-to-edge on EVERY view, not just Coach. The 1400px
      cap moves off .app (which wraps the nav) and onto the content, so prose
      still reads at a sane measure while the bar spans the screen.
   3. One exercise picker, not two. The rail's Exercise dropdown is replaced by
      the cockpit card + picker modal; the mobile <select> is untouched.
   =========================================================================== */
@media (min-width: 860px) {
  .topbar { flex: none; }

  .app { max-width: none; }
  .tabBody { max-width: 1400px; margin: 0 auto; width: 100%; }
  body[data-view="account"] .tabBody { max-width: 1400px; }

  /* the rail's dropdown is now redundant — the card above it opens the picker */
  .exField { display: none; }
}

/* ===========================================================================
   Picker: categories + favourites
   cuePop ends at translateX(-50%) — it belongs to the cue bubble, which is
   positioned with left:50%. Borrowing it dragged the centred card 440px left,
   so the picker gets its own keyframes: opacity and scale, no translate.
   =========================================================================== */
@keyframes pickerPop {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}

.pickerCat {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: rgba(229,226,225,.5);
  font-size: 10px; padding: 14px 2px 4px;
}
.pickerCat::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.pickerGrid > .pickerCat:first-child { padding-top: 0; }

/* the star sits in the card but is its own control — hit it and you favourite,
   hit anywhere else and you start coaching that move */
.pickerFav {
  width: 26px; height: 26px; flex: none; padding: 0; border: none; border-radius: 8px;
  background: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: rgba(229,226,225,.3);
}
.pickerFav svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.75; }
.pickerFav:hover { background: rgba(229,226,225,.08); color: rgba(229,226,225,.75); }
.pickerFav.on { color: var(--accent-bright); }
.pickerFav.on svg { fill: currentColor; stroke: currentColor; }
.pickerOpt:not(:hover) .pickerFav:not(.on) { opacity: 0; }
.pickerOpt:focus-visible .pickerFav:not(.on) { opacity: 1; }
.pickerOpt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===========================================================================
   14g — Challenges home. The card grows a photo header, template pills and a
   standing row on both widths; desktop lays them out three across with the
   dashed start tile as the last cell. Mobile keeps one column and the solid
   start button, so the stack order is unchanged.
   =========================================================================== */
.chCardHead {
  position: relative; height: 96px; overflow: hidden; display: block;
  border-radius: 14px 14px 0 0; background: #222;
}
.chCardImg { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: saturate(.7) brightness(.9); }
.chCardScrim { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(19,19,19,.15) 0%, rgba(28,27,27,.96) 100%); }
.chCardPills { position: absolute; top: 10px; left: 14px; display: flex; gap: 6px; }
.chPill {
  font-family: var(--mono); font-size: 8px; font-weight: 600; letter-spacing: .16em;
  border-radius: 999px; padding: 4px 9px; color: var(--ink);
  background: rgba(19,19,19,.7); border: 1px solid rgba(229,226,225,.2);
}
.chPill.teal { color: #06231c; background: var(--accent); border-color: var(--accent); }
.chCardHead .chCardTitle {
  position: absolute; bottom: 8px; left: 14px; right: 14px;
  font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chCardBody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }

/* duel: two totals facing each other */
.chVs { display: flex; align-items: stretch; }
.chVsSide { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.chVsNum { font-family: var(--mono); font-weight: 700; font-size: 26px;
  letter-spacing: -.03em; color: rgba(229,226,225,.8); }
.chVsNum.teal { color: var(--accent-bright); }
.chVsMid { width: 56px; flex: none; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
.chVsLbl { font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: .16em; color: rgba(229,226,225,.35); }
.chVsGap { font-family: var(--mono); font-weight: 700; font-size: 17px; color: var(--accent-bright); }

/* group: rank + who else is in it */
.chFaces { display: flex; margin-left: auto; }
.chFaces .chAvatar { border: 2px solid var(--panel); box-sizing: content-box; }
.chFaces .chAvatar + .chAvatar { margin-left: -8px; }
.chAvatar.more { background: #2a2a2a; font-size: 9px; }

.chStartTile {
  border: 1px dashed rgba(229,226,225,.2); border-radius: 18px; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; cursor: pointer; padding: 24px; color: rgba(229,226,225,.55);
}
.chStartTile svg { width: 26px; height: 26px; color: rgba(229,226,225,.4); }
.chStartTile:hover { border-color: var(--accent); color: var(--accent-bright); }
.chStartTileName { font-size: 14px; font-weight: 500; }
.chStartTileNote { font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(229,226,225,.35); }

.chHeadTitle, .chHeadStart { display: none; }        /* desktop-only header row */
.chStartTile { display: none; }                       /* mobile keeps the button */

@media (min-width: 860px) {
  body[data-view="challenges"] .tabBody { max-width: 1400px; padding: 28px 40px; }
  .chSection { display: flex; flex-direction: column; gap: 20px; }

  .chHead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
  .chHead .chEyebrow { display: none; }               /* the serif title carries it */
  .chHeadTitle { display: block; font-family: var(--serif); font-weight: 500;
    font-size: 32px; letter-spacing: -.01em; }
  .chLede { font-size: 14px; color: rgba(229,226,225,.55); }
  .chHeadStart {
    display: flex; align-items: center; flex: none; height: 48px; padding: 0 26px;
    border-radius: 999px; border: none; background: var(--accent); color: #06231c;
    font-weight: 600; font-size: 14px; cursor: pointer;
  }
  .chHeadStart:hover { background: var(--accent-bright); }

  .chGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
  .chCard { border-radius: 18px; padding: 0; overflow: hidden; background: var(--panel); }
  .chStartTile { display: flex; min-height: 230px; }
  .chStartBtn { display: none; }                      /* the tile is the affordance */
}

/* ===========================================================================
   14h — the duel board. A photo banner, then the two totals stacked in a
   420px rail with the work table beside them. The rail/table split is a grid
   on .chScreenBody, so the markup order stays the one mobile reads top to
   bottom: banner, duel, split bar, work, actions.
   =========================================================================== */
.chBoardHead { position: relative; overflow: hidden; }
.chBoardImg { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: saturate(.7) brightness(.85); }
.chBoardScrim { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(19,19,19,.5) 0%, var(--bg) 100%); }
.chBoardHeadText, .chBoardBack, .chBoardDo { position: relative; }
.chBoardBack, .chBoardDo { display: none; }   /* the X and the sheet do this on mobile */

/* work rows: flat children, stacked on mobile */
.chWorkRow {
  display: grid; width: 100%; text-align: left; cursor: pointer;
  grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  padding: 10px 12px; border-radius: 12px; border: none;
  border-left: 2px solid transparent; background: none; color: var(--ink);
}
.chWorkLead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chWorkThumb { width: 52px; height: 38px; flex: none; object-fit: cover;
  border-radius: 8px; filter: saturate(.8); }
.chWorkName { font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chWorkMine, .chWorkTheirs { font-family: var(--mono); font-weight: 700; font-size: 17px; }
.chWorkMine { color: var(--accent-bright); }
.chWorkTheirs { color: rgba(229,226,225,.75); }
.chWorkBest { font-family: var(--mono); font-size: 12px; color: rgba(229,226,225,.6); }
.chWorkDelta { font-family: var(--mono); font-size: 11px; font-weight: 600; }
.chWorkBars { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 3px; }
.chWorkBar { display: block; height: 4px; border-radius: 999px; background: #2a2a2a; overflow: hidden; }
.chWorkBar i { display: block; height: 100%; }
.chWorkRow:hover { background: rgba(20,163,132,.05); border-left-color: var(--accent); }

@media (min-width: 860px) {
  /* banner */
  body[data-view="challenges"] .chBoardHead {
    height: 130px; flex: none; padding: 0; border: none; background: none;
    /* bleeds past the body's 20/40 padding so the photo runs edge to edge */
    margin: -20px -40px 0;
  }
  body[data-view="challenges"] .chBoardHeadText { position: absolute; bottom: 14px; left: 40px; right: 200px; }
  body[data-view="challenges"] .chBoardTitle { font-family: var(--serif); font-weight: 500;
    font-size: 28px; letter-spacing: -.01em; }
  body[data-view="challenges"] .chBoardMeta { font-family: var(--mono); font-size: 10px;
    letter-spacing: .16em; color: var(--accent-bright); margin-top: 2px; }
  body[data-view="challenges"] .chBoardBack {
    display: block; position: absolute; top: 18px; left: 40px; background: none; border: none;
    font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
    color: rgba(229,226,225,.75); cursor: pointer; padding: 0;
  }
  body[data-view="challenges"] .chBoardBack:hover { color: var(--ink); }
  body[data-view="challenges"] .chBoardDo {
    display: flex; align-items: center; position: absolute; bottom: 16px; right: 40px;
    height: 44px; padding: 0 24px; border-radius: 999px; border: none;
    background: var(--accent); color: #06231c; font-weight: 600; font-size: 14px; cursor: pointer;
  }
  body[data-view="challenges"] .chBoardDo:hover { background: var(--accent-bright); }

  /* rail + table */
  body[data-view="challenges"] .chBoardBody {
    display: grid; grid-template-columns: 420px minmax(0, 1fr);
    gap: 12px 24px; padding: 20px 40px 24px; align-content: start;
  }
  body[data-view="challenges"] .chBoardHead { grid-column: 1 / -1; }
  body[data-view="challenges"] .chDuel {
    grid-column: 1; grid-row: 2; flex-direction: column; gap: 12px;
  }
  body[data-view="challenges"] .chDuelFoot { grid-column: 1; grid-row: 3; }
  body[data-view="challenges"] .chBoardActions { grid-column: 1 / -1; }

  /* each side is a wide card: avatar left, the number big beside it */
  body[data-view="challenges"] .chDuelCol {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto;
    align-items: center; gap: 0 18px; padding: 20px; border-radius: 20px;
    border: 1px solid var(--border); background: var(--panel); text-align: left;
  }
  body[data-view="challenges"] .chDuelCol .chAvatar { grid-row: 1 / 4; width: 60px; height: 60px; font-size: 20px; }
  body[data-view="challenges"] .chDuelName { font-size: 15px; font-weight: 600; }
  body[data-view="challenges"] .chDuelNum { font-family: var(--mono); font-weight: 700;
    font-size: 50px; line-height: .95; letter-spacing: -.04em; }
  body[data-view="challenges"] .chDuelUnit { font-family: var(--mono); font-size: 8px;
    letter-spacing: .16em; color: rgba(229,226,225,.5); }
  body[data-view="challenges"] .chDuelCol .chSpark { display: none; }  /* the bar below carries it */
  body[data-view="challenges"] .chDuelMid {
    display: flex; align-items: center; justify-content: center; gap: 14px;
  }
  body[data-view="challenges"] .chDelta { font-family: var(--mono); font-weight: 700;
    font-size: 32px; letter-spacing: -.02em; }
  body[data-view="challenges"] .chDeltaLbl { font-family: var(--mono); font-size: 9px;
    font-weight: 600; letter-spacing: .16em; color: rgba(229,226,225,.5); }

  /* the work table */
  body[data-view="challenges"] .chWork {
    grid-column: 2; grid-row: 2 / span 2; border: 1px solid var(--border);
    border-radius: 20px; background: var(--panel); padding: 20px 26px; min-width: 0;
  }
  body[data-view="challenges"] .chWorkRow {
    grid-template-columns: minmax(0,1fr) 100px 100px 110px 120px; gap: 0 18px; padding: 13px 12px;
  }
  body[data-view="challenges"] .chWorkMine,
  body[data-view="challenges"] .chWorkTheirs,
  body[data-view="challenges"] .chWorkBest,
  body[data-view="challenges"] .chWorkDelta { text-align: right; }
  body[data-view="challenges"] .chWorkBars { display: none; }   /* numbers do the work here */
}

/* The board is a page, not a centred card. The overlay starts below the 60px
   nav so the nav stays usable (it is a destination you navigate away from,
   and it has a URL), the 460px reading cap comes off, and the screen
   top-aligns instead of centring a 130px banner in the viewport. */
@media (min-width: 860px) {
  body[data-view="challenges"] .chOverlay { top: 60px; }
  body[data-view="challenges"] .chScreen {
    min-height: calc(100dvh - 60px); justify-content: flex-start; padding: 0;
  }
  body[data-view="challenges"] .chScreenBody { max-width: none; margin: 0; padding: 28px 40px; }
  body[data-view="challenges"] .chBoardBody { padding: 20px 40px 24px; }
  body[data-view="challenges"] .chScreen > .chX { display: none; } /* the back link does this */
}

/* ===========================================================================
   15a — Plan as cards. The dropdown hid what a routine costs; a card states
   it. Three across on desktop, one column on mobile. The <select> stays in
   the DOM as the single place a session starts — the cards drive it — but it
   is hidden once the cards are there.
   =========================================================================== */
.planGrid { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 1100px; }
.planCard {
  border: 1px solid var(--border); border-radius: 16px; background: var(--panel);
  padding: 20px; display: flex; flex-direction: column; gap: 6px;
  cursor: pointer; text-align: left; color: var(--ink); min-height: 128px;
}
.planCard:hover { border-color: var(--accent); }
.planCardName { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.planCardName svg { width: 16px; height: 16px; flex: none; }
.planCardSub { font-size: 13px; color: rgba(229,226,225,.55); }
.planCardCta {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  color: var(--accent-bright); margin-top: auto; padding-top: 14px;
}
.planFree .planCardCta { color: rgba(229,226,225,.4); }
.planCard.mine { border-color: rgba(20,163,132,.4); background: rgba(20,163,132,.05); }
.planMine { color: var(--accent-bright); }
.planCard.mine .planCardSub { color: var(--accent-bright); }
.planAI { border-style: dashed; border-color: rgba(20,163,132,.45); background: none; }
.planAI .planCardName { color: var(--accent-bright); }

/* the cards replace both the dropdown and the old Create-with-AI row */
.planSelect, #aiRow { display: none; }

@media (min-width: 860px) {
  .planGrid { grid-template-columns: repeat(3, 1fr); }
  body[data-view="routine"] .secHead .eyebrow { display: none; }
  body[data-view="routine"] .secHead h2 { font-family: var(--serif); font-weight: 500;
    font-size: 32px; letter-spacing: -.01em; }
  body[data-view="routine"] .tabBody { max-width: 1400px; padding: 28px 40px; }
}
.planLede { font-size: 14px; color: rgba(229,226,225,.55); margin: 4px 0 0; }

/* ===========================================================================
   Challenge flow on desktop — templates, share, privacy. These were phone
   sheets rendered on a 1920px screen: the whole path to creating a challenge
   sat in a 460px column.
   =========================================================================== */
.chTplHead { position: relative; height: 92px; overflow: hidden; border-radius: 14px 14px 0 0; background: #222; }
.chTplImg { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: saturate(.7) brightness(.9); }
.chTplScrim { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(19,19,19,.2) 0%, rgba(28,27,27,.97) 100%); }
.chTplKind {
  position: absolute; top: 10px; left: 14px;
  font-family: var(--mono); font-size: 8px; font-weight: 600; letter-spacing: .16em;
  background: rgba(19,19,19,.7); border: 1px solid rgba(229,226,225,.2);
  border-radius: 999px; padding: 3px 8px;
}
.chTplHead .chTplName {
  position: absolute; bottom: 7px; left: 14px; right: 14px;
  font-family: var(--serif); font-weight: 500; font-size: 20px;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.chTplBody { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 9px; }
.chTplGrid { display: grid; grid-template-columns: 1fr; gap: 20px; }

@media (min-width: 860px) {
  /* templates */
  body[data-view="challenges"] .chTplGrid { grid-template-columns: repeat(3, 1fr); }
  body[data-view="challenges"] .chTpl {
    border: 1px solid var(--border); border-radius: 18px; background: var(--panel);
    overflow: hidden; padding: 0;
  }
  body[data-view="challenges"] .chTpl:hover { border-color: var(--accent); }
  body[data-view="challenges"] .chBigTitle { font-family: var(--serif); font-weight: 500;
    font-size: 32px; letter-spacing: -.01em; }
  body[data-view="challenges"] .chScreenBody > .chBoardBack {
    display: block; position: static; margin-bottom: 4px; background: none; border: none;
    font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
    color: rgba(229,226,225,.5); cursor: pointer; padding: 0; text-align: left;
  }

  /* share — a centred hero, not a column. The screen already carries
     .center .halo; it just needs room and scale. */
  body[data-view="challenges"] .chScreen.center { justify-content: center; }
  body[data-view="challenges"] .chScreenBody.center { max-width: 520px; margin: 0 auto; }
  body[data-view="challenges"] .chScreen.center .chBigTitle { font-size: 38px; letter-spacing: -.015em; }
  body[data-view="challenges"] .chItalic { font-family: var(--serif); font-style: italic;
    font-size: 24px; color: var(--accent-bright); }
  body[data-view="challenges"] .chLinkRow { display: flex; align-items: center; gap: 10px; width: 100%; }
  body[data-view="challenges"] .chLink { flex: 1; height: 50px; border-radius: 999px; }
  body[data-view="challenges"] .chCopy { height: 50px; padding: 0 22px; border-radius: 999px; white-space: nowrap; }

  /* privacy — a modal card, centred */
  body[data-view="challenges"] .chSheet { max-width: 520px; border-radius: 20px; margin: auto; }
  body[data-view="challenges"] .chSheetWrap {
    display: flex; align-items: center; justify-content: center; min-height: 100%;
  }
}

/* ===========================================================================
   14i — the group board. Every participant is a row; every day of the
   challenge is a cell. Four cell states, because "not yet" and "missed" are
   different facts. On mobile the row stacks and the cells wrap under it; on
   desktop it is a five-column table with the strip filling the middle.
   =========================================================================== */
.chMatrix {
  border: 1px solid var(--border); border-radius: 20px; background: var(--panel);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
}
.chGHead { display: none; }                 /* labels are desktop-only */
.chGRow {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 6px 10px;
  align-items: center; padding: 12px; border-radius: 12px;
  border-left: 2px solid transparent;
}
.chGRow.me { background: rgba(20,163,132,.06); border-left-color: var(--accent); }
.chGRow:hover { background: rgba(20,163,132,.05); border-left-color: var(--accent); }
.chGWho { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chGMove { font-family: var(--mono); font-size: 11px; font-weight: 600; }
/* a 30-day challenge puts 30 cells in a phone-width row — 4px gaps left them
   5px wide. Tighter gaps and a min-width keep the strip readable as a pattern. */
.chCells { grid-column: 1 / -1; display: flex; gap: 2px; }
.chCell { min-width: 3px; }
.chCell { flex: 1; height: 14px; border-radius: 4px; background: #2a2a2a; }
.chCell.on { background: var(--accent); box-shadow: 0 0 8px rgba(20,163,132,.35); }
.chCell.miss { background: none; border: 1.5px solid rgba(227,193,95,.55); }
.chCell.pending { background: none; border: 1.5px dashed rgba(229,226,225,.35); }
.chCell.future { background: rgba(229,226,225,.07); }

@media (min-width: 860px) {
  body[data-view="challenges"] .chMatrix { padding: 18px 24px; }
  body[data-view="challenges"] .chGHead,
  body[data-view="challenges"] .chGRow {
    display: grid; grid-template-columns: 50px 210px 60px minmax(0,1fr) 80px;
    gap: 0 18px; align-items: center;
  }
  body[data-view="challenges"] .chGHead {
    padding: 6px 12px; font-family: var(--mono); font-size: 8px;
    letter-spacing: .14em; color: rgba(229,226,225,.4);
  }
  body[data-view="challenges"] .chGStreakLbl { text-align: right; }
  body[data-view="challenges"] .chCells { grid-column: auto; gap: 4px; }
  body[data-view="challenges"] .chGRow .chRowRank { font-family: var(--mono);
    font-weight: 700; font-size: 19px; }
  body[data-view="challenges"] .chGRow .chRowNum { text-align: right;
    font-family: var(--mono); font-weight: 700; font-size: 19px; }
  body[data-view="challenges"] .chGRow .chAvatar { width: 34px; height: 34px; }
  body[data-view="challenges"] .chGRow .chRowName { font-size: 15px; font-weight: 600; }
  /* the group board is one column, not the duel's rail + table */
  body[data-view="challenges"] .chBoardBody:has(.chMatrix) { grid-template-columns: minmax(0,1fr); }
  body[data-view="challenges"] .chBoardBody:has(.chMatrix) > * { grid-column: 1; }
  body[data-view="challenges"] .chBoardBody:has(.chMatrix) > .chBoardHead { grid-column: 1 / -1; }
  body[data-view="challenges"] .chGHero { display: flex; gap: 14px; align-items: stretch; }
}

/* ===========================================================================
   Responsive + DRY pass. One fluid rule instead of a fixed desktop override:
   the grids reflow at any width rather than snapping at 860px.
   =========================================================================== */

/* Picker: fluid card, auto-stacking columns. Replaces the fixed 880px + the
   separate 1-col mobile block — the columns fall from 3 to 1 on their own. */
.pickerCard { width: min(880px, 100%); }
.pickerGrid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (max-width: 859px) { .pickerGrid { grid-template-columns: 1fr; } }

/* Pages get a measure and a centre. The coaching station is exempt — it is
   deliberately full-bleed — and so is the board banner, which bleeds by design. */
@media (min-width: 860px) {
  body:not([data-view="coach"]) .chBoardBody,
  body:not([data-view="coach"]) .chScreenBody {
    max-width: 1400px; margin-inline: auto;
  }
  body[data-view="challenges"] .chBoardHead { max-width: none; }

  /* XP ring to comp: 38px outer, 31px inner, 2px page-coloured gap.
     Must out-specify `.topbar .topTab { background: none; }` and
     `.topbar .topTab.topAccount { height: auto; }`, which are declared later
     and were silently erasing the ring — hence "I don't see the xp ring". */
  .topbar .topTab.topAccount {
    width: 38px; height: 38px; padding: 0; flex: none;
    display: grid; place-items: center; border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--xp, 0) * 1%),
                               rgba(229,226,225,.16) 0);
  }
  .topbar .topAccount .topAvatarWrap { width: 31px; height: 31px; padding: 0;
    border: 2px solid var(--bg); box-sizing: border-box; overflow: hidden; }
  .topbar .topAccount .topAvatarImg { width: 100%; height: 100%; border: none;
    display: block; }
}
/* avatars: a photo when we have one, the initial when we don't */
.chAvatar.hasPhoto { padding: 0; overflow: hidden; background: none; }
.chAvatar.hasPhoto img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Plan detail — what the routine is, set by set, before you commit to it. */
.planCardActs { margin-top: auto; padding-top: 14px; display: flex;
  align-items: center; gap: 14px; flex-wrap: wrap; }
.planCardGo, .planCardMore {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; cursor: pointer;
}
.planCardGo { color: var(--accent-bright); }
/* was rgba(...,.45) — it rendered, but read as disabled text next to a teal
   RUN, so it may as well not have been there. A border makes it a control. */
.planCardMore {
  color: rgba(229,226,225,.8); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px;
}
.planCardMore:hover { color: var(--ink); border-color: var(--accent); }
.planCardGo:hover { color: var(--ink); }
.planCard { cursor: default; }

.planDetail { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.planDetail.hidden { display: none; }
.planBack { align-self: flex-start; background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: rgba(229,226,225,.5); }
.planBack:hover { color: var(--ink); }
.planDetailTitle { font-family: var(--serif); font-weight: 500; font-size: 32px;
  letter-spacing: -.01em; margin: 0; }
.planDetailSub { font-size: 14px; color: rgba(229,226,225,.55); margin: 4px 0 0; }
.planSteps { display: flex; flex-direction: column; gap: 8px; }
.planStep { display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.planStepNo { font-family: var(--mono); font-size: 11px; color: rgba(229,226,225,.4); flex: none; }
.planStepImg { width: 56px; height: 42px; flex: none; border-radius: 8px;
  background: #222 center/cover no-repeat; filter: saturate(.85); }
.planStepText { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.planStepName { font-size: 15px; font-weight: 600; }
.planStepMeta { font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  color: var(--accent-bright); }
.planStepRest { font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  color: rgba(229,226,225,.45); flex: none; }
.planStart { align-self: flex-start; min-width: 220px; }

/* ===========================================================================
   .hidden is a utility, so it must win. There was no global rule — every
   element had its own hand-written `.x.hidden { display: none }`, so any
   element whose rule was never written stayed visible with the class on it.
   That is what buried the routine detail 400px down the page behind a grid
   that was still laid out. One rule replaces the lot.
   =========================================================================== */
.hidden { display: none !important; }

/* The routine detail is a page: nothing else from the Plan panel shares it. */
.tabPanel[data-panel="routine"].detailOpen > *:not(#planDetail) { display: none; }
@media (min-width: 860px) {
  .planDetail { max-width: 900px; }
  .planDetailTitle { font-size: 38px; }
}

/* ===========================================================================
   Picker tabs (brief 7). The routine chips became a segmented control, and
   routines got their own pane — a list, not a row of pills.
   =========================================================================== */
.pickerTabs {
  display: flex; gap: 4px; flex: none; padding: 4px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
}
.pickerTab {
  flex: 1; height: 38px; border: none; border-radius: 9px; cursor: pointer;
  background: none; color: rgba(229,226,225,.6);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em;
}
.pickerTab:hover { color: var(--ink); }
.pickerTab.active { background: var(--accent); color: var(--accent-ink); }

.pickerPane { display: flex; flex-direction: column; gap: 16px; flex: 1; min-height: 0; }
.pickerRtList { flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px; }
.pickerRt {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel); cursor: pointer; text-align: left; color: var(--ink);
}
.pickerRt:hover { border-color: var(--accent); }
.pickerRtIcon {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center; color: var(--accent-bright);
  background: rgba(20,163,132,.1); border: 1px solid rgba(20,163,132,.3);
}
.pickerRtIcon.plain { background: none; border: none; }
.pickerRtIcon svg { width: 18px; height: 18px; }
.pickerRtText { flex: 1; min-width: 0; }
.pickerRtName { display: block; font-size: 15px; font-weight: 600; }
.pickerRtMeta { display: block; margin-top: 2px; font-family: var(--mono);
  font-size: 9px; letter-spacing: .12em; color: rgba(229,226,225,.5); }
.pickerRtGo { flex: none; font-family: var(--mono); font-size: 10px;
  font-weight: 600; letter-spacing: .1em; color: var(--accent-bright); }
.pickerRtAI { background: none; border-style: dashed; border-color: rgba(20,163,132,.5); }
.pickerRtAI:hover { background: rgba(20,163,132,.05); }
.pickerRtAI .pickerRtName { color: var(--accent-bright); }

/* Wordmark: the middle word carries the colour, and the whole thing is a link
   home. b is the markup because "good" is the emphasis, not decoration. */
.brandName b { color: var(--accent-bright); font-weight: inherit; }
a.brand { text-decoration: none; color: inherit; }
a.brand:hover .brandName { color: var(--ink); }
/* the mark takes its colour from the token, so a brand change is one edit */
.brandGlyph { color: var(--accent); }

/* ===========================================================================
   Coach settings sheet + Start camera on the canvas.
   The comp's rail is five fixed blocks that never scroll; configuration lives
   behind a gear, and Start camera sits on the camera it starts.
   =========================================================================== */
.coachSettings {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(13,13,12,.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.coachSettings.hidden { display: none; }
.coachSettingsCard {
  width: min(560px, 100%); max-height: 80dvh; box-sizing: border-box;
  border-radius: 20px; background: rgba(19,19,19,.97); border: 1px solid #2a2a2a;
  box-shadow: 0 20px 60px rgba(0,0,0,.4); padding: 26px 28px;
  display: flex; flex-direction: column; gap: 16px; overflow: hidden;
  animation: pickerPop .22s ease-out both;
}
.coachSettingsBody { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.cockSettings {
  width: 44px; height: 44px; flex: none; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: none; color: rgba(229,226,225,.6);
  display: grid; place-items: center;
}
.cockSettings svg { width: 17px; height: 17px; }
.cockSettings:hover { border-color: var(--accent); color: var(--accent-bright); }

@media (min-width: 860px) {
  /* the rail is the cockpit, not a settings panel — it must not scroll */
  body[data-view="coach"] .tabPanel[data-panel="coach"] { overflow: hidden; }

  /* Start camera belongs on the camera. The dock was a mobile construct. */
  body[data-view="coach"] .dock { display: none; }
  body[data-view="coach"] #startBtn {
    display: flex; align-items: center; justify-content: center;
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    z-index: 4; height: 52px; padding: 0 34px; width: auto; border-radius: 999px;
    font-size: 15px;
  }
  /* Once the camera is live the button becomes Stop and gains .running; on the
     canvas that would sit over the skeleton, so it moves to a corner chip. */
  body[data-view="coach"] #startBtn.running {
    top: auto; bottom: 16px; left: 16px; transform: none;
    height: 36px; padding: 0 18px; font-size: 12px;
    background: rgba(19,19,19,.75); border: 1px solid var(--border); color: var(--ink);
  }
}
