/* GymNav web. Dark, with the watches' amber; the figures are the pictures. */

:root {
  --bg: #0e1014;
  --rail: #121419;
  --panel: #171a20;
  --panel-2: #1d2128;
  --well: #242932;
  --line: #262b34;
  --line-2: #323844;
  --text: #eef1f5;
  --soft: #b9c1cc;
  --dim: #8b95a2;      /* 4.8:1 on the wells (inputs, chips), 5.7:1 on cards */
  --field-edge: #6c7482; /* an input's edge: 3.7:1 on a card, 3.4:1 on panel-2 */
  --amber: #ffa62b;
  --amber-2: #ffbb5c;
  --amber-ink: #2a1a04;
  --teal: #57c785;
  --blue: #5b8def;
  --red: #ff6b5e;
  --stage: #07090c;
  --radius: 14px;
  --radius-s: 10px;
  --rail-w: 76px;
  --top-h: 60px;
  --bar-h: 64px;       /* the bottom bar on a phone */
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* No grey flash on a tap: each control shows its own pressed state (:active, below) instead. */
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 0.9375rem/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ex-name, .lift-name, .wr-title, .stop-name, .dc-name, .choice-name, .gym-name, .sr-name, .ex-block-name, .device .nm, .r-name, .go-list span { overflow-wrap: anywhere; min-width: 0; }
.dim { color: var(--dim); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.mark { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 5px solid var(--amber); flex: none; }

/* ---------- buttons ---------- */

.primary, .ghost, .danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; padding: 9px 18px; border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 0.875rem;
  transition: filter .15s, background .15s, border-color .15s;
}
.primary { background: var(--amber); color: var(--amber-ink); }
.primary:not(:disabled):hover { filter: brightness(1.08); }
.ghost { background: rgba(255, 255, 255, .04); border-color: var(--line-2); color: var(--soft); }
.ghost:hover { border-color: var(--dim); color: var(--text); }
.ghost .icon { width: 16px; height: 16px; }
.danger { background: none; border-color: var(--line-2); color: var(--red); font-size: 0.8125rem; padding: 6px 14px; }
.danger.sure { background: var(--red); color: #200; border-color: var(--red); }
.wide { width: 100%; }
button:disabled { opacity: .45; cursor: default; }
.link-btn { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 0.8125rem; padding: 0; text-decoration: underline; }
/* pressed: what a finger sees, since the tap highlight is off */
.primary:not(:disabled):active { filter: brightness(.88); }
.chip.on:active, .seg button.on:active { filter: brightness(.88); }
.ghost:not(:disabled):active, .danger:not(.sure):not(:disabled):active, .chip:not(.on):active, .seg button:not(.on):active, .icon-btn:not(:disabled):active,
.day-card:active, .gym-card:active, .station-row:active, .choice:not(:disabled):active, .choice-card:active, .go-list button:not(:disabled):active,
.map-open:active, .menu a:active, .menu button:active { background-color: rgba(255, 255, 255, .1); }
.rail a:active, .result:active, .workout-row:active, .lift-card:active, .ex-card:active, .best-row:active, .nw-row:active { background-color: var(--panel-2); }
.link-btn:active, .back:active, .more:active, a.inline:active { opacity: .7; }
.avatar:active { filter: brightness(.85); }

/* ---------- the shell: rail, top bar, view ---------- */

.shell { min-height: 100vh; min-height: 100dvh; }
/* The rail, with the notch side of a phone on its side kept clear (viewport-fit=cover): its width
   grows by the inset, its links stay where a thumb finds them. Too short for all its links, it scrolls. */
.rail {
  position: fixed; inset: 0 auto 0 0; width: calc(var(--rail-w) + env(safe-area-inset-left)); z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: max(14px, env(safe-area-inset-top)) 0 max(14px, env(safe-area-inset-bottom)) env(safe-area-inset-left);
  background: var(--rail); border-right: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: none; }
.rail-brand { height: 44px; display: grid; place-items: center; margin-bottom: 14px; }
.rail a:not(.rail-brand) {
  width: 60px; padding: 9px 0 7px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--dim); font-size: 0.6562rem; font-weight: 600; letter-spacing: .01em; transition: color .15s, background .15s;
}
.rail a:not(.rail-brand):hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.rail a.on { color: var(--amber); background: rgba(255, 166, 43, .1); }
.rail .icon { width: 22px; height: 22px; }
.rail-gap { flex: 1 0 0; }

.topbar {
  position: sticky; top: 0; z-index: 15; min-height: calc(var(--top-h) + env(safe-area-inset-top)); margin-left: calc(var(--rail-w) + env(safe-area-inset-left));
  display: flex; align-items: center; gap: 14px; padding: env(safe-area-inset-top) max(28px, env(safe-area-inset-right)) 0 28px;
  background: rgba(14, 16, 20, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.top-brand { display: none; align-items: center; gap: 9px; font-weight: 700; font-size: 1.062rem; }
.top-brand .mark { width: 18px; height: 18px; border-width: 4px; }
.search { position: relative; flex: 1; max-width: 460px; margin: 0 auto; display: flex; align-items: center; }
.search > .icon { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--dim); pointer-events: none; }
.search input {
  width: 100%; min-height: 38px; border-radius: 999px; border: 1px solid var(--field-edge); background: var(--panel);
  padding: 6px 40px 6px 38px; font-size: 0.875rem; transition: border-color .15s, background .15s;
}
.search input:focus { outline: none; border-color: var(--amber); background: var(--panel-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  position: absolute; right: 12px; font: 600 0.6875rem/1 system-ui; color: var(--dim); border: 1px solid var(--line-2);
  border-radius: 5px; padding: 3px 6px; pointer-events: none;
}
.search input:focus ~ kbd { display: none; }
.results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); max-height: 70vh; max-height: 70dvh; overflow: auto;
}
.result { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 9px; min-height: 44px; justify-content: center; overflow-wrap: anywhere; }
.result:hover, .result.picked { background: var(--well); }
.result .r-name { font-weight: 600; font-size: 0.875rem; }
.result .r-sub { color: var(--dim); font-size: 0.75rem; }
.result.none { color: var(--dim); font-size: 0.875rem; }
.result.all { color: var(--amber); font-size: 0.8125rem; font-weight: 600; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; margin-top: 4px; }

.live { width: 28px; height: 28px; display: grid; place-items: center; flex: none; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); transition: background .3s, box-shadow .3s; }
.live[data-state="on"] .dot { background: var(--teal); box-shadow: 0 0 0 4px rgba(87, 199, 133, .16); }
.live[data-state="retry"] .dot { background: var(--amber); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.avatar {
  width: max(34px, 2.4em); height: max(34px, 2.4em); padding: 0; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: linear-gradient(135deg, var(--amber), #e07b12); color: var(--amber-ink); font-weight: 800; font-size: 0.875rem;
}
.menu {
  position: absolute; right: max(20px, env(safe-area-inset-right)); top: calc(100% - 6px); width: min(240px, calc(100vw - 20px)); background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); display: flex; flex-direction: column;
}
.menu-email { color: var(--dim); font-size: 0.75rem; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button { text-align: left; background: none; border: 0; padding: 9px 12px; min-height: 44px; display: flex; align-items: center; border-radius: 9px; cursor: pointer; font-size: 0.875rem; }
.menu a:hover, .menu button:hover { background: var(--well); }
.menu a.on { color: var(--amber); }

.main { margin-left: calc(var(--rail-w) + env(safe-area-inset-left)); padding: 28px max(32px, env(safe-area-inset-right)) 80px 32px; }
.view { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; animation: rise .4s cubic-bezier(.22, .61, .36, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
/* The same page drawn again (new data, a filter) is simply there: it does not arrive again. */
.view.still { animation: none; }
/* A page turning (main.js): the old page fades into the new one, and the new one settles. What is
   the same on both, the rail and the bar, does not move. Clicks go through to the new page. */
.soft .view { animation-name: settle; }
@keyframes settle { from { transform: translateY(8px); } }
/* A page that was waiting for its data fades in when it comes. */
.view.arrive { animation-name: rise; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .36s; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
::view-transition { pointer-events: none; }
.view.loading, .loading { min-height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- shared pieces ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.875rem; font-weight: 750; color: var(--amber); }
.page-head .sub { margin: 4px 0 0; color: var(--soft); }
.head-extra { display: flex; gap: 10px; align-items: center; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 1.062rem; font-weight: 700; }
.more { display: inline-flex; align-items: center; gap: 2px; color: var(--amber); font-size: 0.8125rem; font-weight: 600; }
.more .icon { width: 15px; height: 15px; }
.kicker { color: var(--amber); font-size: 0.75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.kicker .icon { width: 15px; height: 15px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h2 { font-size: 1rem; margin-bottom: 10px; }
.empty { color: var(--dim); background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 26px; text-align: center; }
.empty p { margin: 0; }
.fine { color: var(--dim); font-size: 0.75rem; margin: 0; }
.msg { margin: 12px 0 0; font-size: 0.875rem; color: var(--soft); }
.msg.ok { color: var(--teal); }
.msg.err { color: var(--red); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--soft); font-size: 0.875rem; font-weight: 600; margin-bottom: -12px; align-self: flex-start; }
.back:hover { color: var(--text); }
.back .icon { width: 17px; height: 17px; }
.head-stats { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--soft); font-size: 0.875rem; margin-top: 8px; }
.head-stats span { display: inline-flex; align-items: center; gap: 2px; }
.head-stats .icon { width: 16px; height: 16px; color: var(--dim); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--well); color: var(--soft); white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; }
.badge.watch::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.badge.watch.apple-watch::before { background: var(--blue); }
.badge.watch.garmin::before { background: var(--teal); }
.badge.best { background: rgba(255, 166, 43, .15); color: var(--amber); }
.badge.up { background: rgba(87, 199, 133, .13); color: var(--teal); }
.badge.down { background: rgba(255, 107, 94, .12); color: var(--red); }
.badge.safety.phase2 { background: rgba(91, 141, 239, .15); color: #8fb0f5; }
.badge.safety.ask { background: rgba(255, 166, 43, .14); color: var(--amber-2); }
.badge.safety.never { background: rgba(255, 107, 94, .13); color: #ff8f85; }

/* a tag fits its card: a long one wraps rather than running out of it */
.tag { font-size: 0.7188rem; color: var(--soft); background: rgba(255, 255, 255, .05); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; max-width: 100%; overflow-wrap: anywhere; }
.tag.weight { color: var(--amber-2); border-color: rgba(255, 166, 43, .25); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -12px; }
.chips.small { margin-top: -18px; }
.chip {
  border: 1px solid var(--line-2); background: var(--panel); color: var(--soft); border-radius: 999px; padding: 6px 14px;
  font-size: 0.8125rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
}
.chips.small .chip { padding: 4px 11px; font-size: 0.7812rem; }
.chip:hover { color: var(--text); border-color: var(--dim); }
.chip.on { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.chip.plan:not(.on) { border-color: rgba(255, 166, 43, .45); color: var(--amber-2); }
.chip .count { font-size: 0.6875rem; opacity: .65; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; overflow: hidden; }
.tile-icon { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 166, 43, .1); color: var(--amber); }
.tile-icon .icon { width: 18px; height: 18px; }
.tile .n { padding-right: 40px; overflow-wrap: anywhere; line-height: 1.25; margin: 4px 0 2px; font-size: 1.875rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile .l { color: var(--soft); font-size: 0.8125rem; }
.tile .note { color: var(--dim); font-size: 0.75rem; margin-top: 2px; }

/* figures */
.stage { position: relative; background: radial-gradient(120% 90% at 50% 30%, #12161c 0%, var(--stage) 70%); aspect-ratio: 4 / 3; overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .3s; }
.stage.ready canvas { opacity: 1; }
.stage.none::after { content: ""; position: absolute; inset: 0; margin: auto; width: 34%; aspect-ratio: 1; border-radius: 50%; border: 6px solid rgba(255, 166, 43, .15); }

/* ---------- today ---------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 300px; border-radius: 20px; overflow: hidden;
  background: linear-gradient(115deg, #1d1710 0%, #17181d 45%, var(--stage) 100%); border: 1px solid #2c2518;
}
.hero.loading { min-height: 300px; }
.hero-text { padding: 34px 36px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.hero h2 { font-size: 2.375rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--soft); font-size: 0.875rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 3px; }
.hero-meta .icon { width: 17px; height: 17px; color: var(--amber); }
.effort { margin: 2px 0 0; color: var(--dim); font-size: 0.875rem; }
.hero-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.hero-art { position: relative; }
.hero-stage, .hero-stage .stage { position: absolute; inset: 0; aspect-ratio: auto; background: none; }
.hero-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 70% at 55% 50%, rgba(255, 166, 43, .09), transparent 70%); }
.hero-caption { position: absolute; left: 20px; bottom: 16px; background: rgba(7, 9, 12, .7); backdrop-filter: blur(6px); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; }
.hero-caption .n { color: var(--amber); font-variant-numeric: tabular-nums; }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: -8px; }
.wk-day {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px 9px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 5px; transition: border-color .15s;
}
.wk-day:hover { border-color: var(--line-2); }
.wk-name { font-size: 0.75rem; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; }
.wk-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed var(--line-2); display: grid; place-items: center; }
.wk-dot .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.wk-what { font-size: 0.7188rem; color: var(--dim); }
.wk-day.did .wk-dot { border: 0; background: var(--amber); color: var(--amber-ink); }
.wk-day.missed .wk-dot { border-color: rgba(255, 107, 94, .35); }
.wk-day.today { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255, 166, 43, .12); }
.wk-day.today .wk-name { color: var(--amber); }

.workout-row {
  display: flex; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px 12px 12px; transition: border-color .15s, background .15s;
}
.workout-row:hover { border-color: var(--line-2); background: var(--panel-2); }
.date-chip { min-width: 52px; min-height: 56px; padding: 4px; border-radius: 12px; background: var(--well); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.date-chip .wd { font-size: 0.6875rem; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: .06em; }
.date-chip .dn { font-size: 1.25rem; font-weight: 750; line-height: 1.1; }
.wr-main { flex: 1; min-width: 0; }
.wr-title { font-weight: 650; }
.wr-meta { color: var(--dim); font-size: 0.8125rem; }
.wr-ex { color: var(--soft); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--dim); width: 18px; height: 18px; }

.best-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.best-row:hover { border-color: var(--line-2); }
.best-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 166, 43, .12); color: var(--amber); display: grid; place-items: center; }
.best-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.best-name { font-weight: 600; }
.best-meta { color: var(--dim); font-size: 0.7812rem; }
.best-val { text-align: right; display: flex; flex-direction: column; }
.best-val .up { color: var(--teal); font-size: 0.75rem; font-weight: 600; }
.up-next { margin-top: 8px; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- exercise cards ---------- */

.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.ex-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.ex-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 12px 28px rgba(0, 0, 0, .35); }
.ex-card .stage { border-bottom: 1px solid var(--line); }
.ex-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ex-name { font-weight: 650; font-size: 0.9062rem; line-height: 1.3; }
.ex-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ex-group { color: var(--dim); font-size: 0.75rem; margin-top: auto; }

.filter-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1 1 240px; min-width: min(240px, 100%); max-width: 520px; display: flex; align-items: center; }
.search-wrap .icon { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--dim); pointer-events: none; }
.search-box { width: 100%; min-height: 42px; border-radius: 12px; border: 1px solid var(--field-edge); background: var(--panel); padding: 8px 14px 8px 38px; }
.search-box:focus { outline: none; border-color: var(--amber); }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--soft); font-size: 0.875rem; cursor: pointer; user-select: none; }
.toggle input { appearance: none; width: 36px; height: 21px; border-radius: 999px; background: var(--well); border: 1px solid var(--field-edge); flex: none; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--soft); transition: transform .15s; }
.toggle input:checked { background: var(--amber); border-color: var(--amber); }
.toggle input:checked::after { transform: translateX(15px); background: var(--amber-ink); }
.count-line { font-size: 0.8125rem; margin: -6px 0 12px; }
.more-sentinel { height: 1px; }

/* ---------- lift and library pages ---------- */

.lift-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.lift-hero-art .stage { height: 100%; min-height: 300px; aspect-ratio: auto; }
.lift-hero-text { padding: 30px 32px; display: flex; flex-direction: column; gap: 12px; }
.lift-hero-text h1 { font-size: 2rem; font-weight: 800; line-height: 1.15; }
.cue { color: var(--soft); font-size: 0.8438rem; }
.cue.big { font-size: 1.062rem; color: var(--amber-2); font-weight: 600; margin: 0; }
.cue.big::before { content: "“"; } .cue.big::after { content: "”"; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 4px 0 0; font-size: 0.875rem; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; }
.what { color: var(--soft); margin: 0; font-size: 0.9062rem; }
.call { border-radius: var(--radius); padding: 16px 20px; border: 1px solid var(--line); background: var(--panel); }
.call p { margin: 8px 0 0; color: var(--soft); font-size: 0.875rem; }
.call p a { color: var(--amber); font-weight: 600; }
.call-head { display: flex; align-items: center; gap: 10px; }
.call.ok { border-color: rgba(87, 199, 133, .3); } .call.ok .icon { color: var(--teal); }
.call.phase2 { border-color: rgba(91, 141, 239, .35); } .call.phase2 .icon { color: var(--blue); }
.call.ask { border-color: rgba(255, 166, 43, .35); } .call.ask .icon { color: var(--amber); }
.call.never { border-color: rgba(255, 107, 94, .35); } .call.never .icon { color: var(--red); }

.chart-card { color: var(--amber); }
.chart-card h2 { color: var(--text); }
.chart-box { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .axis, .bars .axis, .cal .axis { fill: var(--dim); font-size: 11px; }
.chart .line { fill: none; stroke: var(--amber); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart .pt circle { fill: var(--bg); stroke: var(--amber); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart .pt:hover circle, .chart .pt.on circle { fill: var(--amber); }
/* a value, shown where it was pointed at or tapped */
.tip rect { fill: var(--panel-2); stroke: var(--field-edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tip text { fill: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-empty { color: var(--dim); padding: 40px; text-align: center; }

.history { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 0.875rem; }
.history th { text-align: left; font-size: 0.7188rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 700; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.history td { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.history tr:last-child td { border-bottom: 0; }
.history td a { font-weight: 600; }
.history td a:hover { color: var(--amber); }
.history .n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- progress ---------- */

.cal-wrap { overflow-x: auto; }
.cal { width: 100%; min-width: 420px; height: auto; display: block; }
.cal .day { fill: var(--well); }
.cal .day.l1 { fill: rgba(255, 166, 43, .45); }
.cal .day.l2 { fill: rgba(255, 166, 43, .75); }
.cal .day.l3 { fill: var(--amber); }
.cal .day.today { stroke: var(--text); stroke-width: 1.5; }
.cal .day.on { stroke: var(--amber-2); stroke-width: 2; }
.legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; color: var(--dim); font-size: 0.7188rem; margin-top: 8px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--well); display: inline-block; }
.legend i.l1 { background: rgba(255, 166, 43, .45); } .legend i.l2 { background: rgba(255, 166, 43, .75); } .legend i.l3 { background: var(--amber); }
.legend i.l0 { margin-left: 4px; } .legend i.l3 { margin-right: 4px; }
.bars { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.bars .track { fill: rgba(255, 255, 255, .03); }
.bars .bar { fill: rgba(255, 166, 43, .55); }
.bars .now .bar { fill: var(--amber); }
.bars g:hover .bar, .bars g.on .bar { fill: var(--amber-2); }
.bars g.on .track { fill: rgba(255, 255, 255, .07); }

.lift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 14px; margin-top: -14px; }
.lift-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s, transform .15s; }
.lift-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.lift-top { display: flex; gap: 12px; align-items: center; }
.stage.thumb { width: 72px; flex: none; border-radius: 10px; }
.lift-name { font-weight: 650; }
.lift-top .dim { font-size: 0.7812rem; }
.lift-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.lift-val { font-size: 1.375rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.delta { font-size: 0.75rem; color: var(--dim); }
.delta.up { color: var(--teal); } .delta.down { color: var(--red); }
.spark { width: 120px; height: 36px; flex: none; overflow: visible; }
.spark path { fill: none; stroke: var(--amber); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark circle { fill: var(--amber); }
.spark .flat { stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 3 4; }

/* ---------- workouts ---------- */

.week-group .section-head .dim { font-size: 0.8125rem; }
.workout-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.workout-head h1 { font-size: 2rem; font-weight: 800; margin-top: 6px; }
.ex-list { display: flex; flex-direction: column; gap: 12px; }
.ex-block { display: flex; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; align-items: stretch; }
.ex-block-fig { width: 150px; flex: none; display: block; }
.ex-block-fig .stage { border-radius: 10px; width: 100%; height: 100%; min-height: 104px; aspect-ratio: auto; }
.ex-block-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 4px 6px 4px 0; }
.ex-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ex-block-name { font-weight: 700; font-size: 1.031rem; }
.ex-block-name:hover { color: var(--amber); }
.set-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.set-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--well); border-radius: 9px; padding: 5px 11px 5px 5px; font-size: 0.875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.set-chip .set-n { width: 22px; height: 22px; border-radius: 6px; background: rgba(255, 255, 255, .06); color: var(--soft); display: grid; place-items: center; font-size: 0.7188rem; }
.set-chip.top { box-shadow: inset 0 0 0 1px rgba(255, 166, 43, .5); }
.set-chip.top .set-n { background: var(--amber); color: var(--amber-ink); }
.prev { color: var(--dim); font-size: 0.7812rem; }

/* ---------- plan ---------- */

.plan-progress { height: 6px; background: var(--well); border-radius: 999px; overflow: hidden; margin-top: -14px; }
.plan-progress .bar { height: 100%; background: linear-gradient(90deg, #e07b12, var(--amber)); border-radius: 999px; }
.plan-note { margin: -12px 0 0; color: var(--dim); font-size: 0.8125rem; display: flex; align-items: center; gap: 4px; }
.plan-note .icon { width: 15px; height: 15px; }
.day-cards { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day-card {
  text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; transition: border-color .15s, background .15s;
}
.day-card:hover { border-color: var(--line-2); }
.day-card.on { border-color: var(--amber); background: rgba(255, 166, 43, .07); }
.dc-top { display: flex; justify-content: space-between; align-items: center; }
.dc-day { font-size: 0.75rem; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; }
.day-card.today .dc-day { color: var(--amber); }
.day-card.today .dc-day::after { content: " · today"; text-transform: none; letter-spacing: 0; font-weight: 600; }
.dc-done { width: 18px; height: 18px; border-radius: 50%; background: var(--amber); color: var(--amber-ink); display: grid; place-items: center; }
.dc-done .icon { width: 12px; height: 12px; stroke-width: 3; }
.dc-name { font-weight: 650; font-size: 0.8438rem; line-height: 1.3; }
.dc-meta { color: var(--dim); font-size: 0.75rem; }
.plan-day-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.plan-day-head h2 { font-size: 1.25rem; }
.plan-day-head .head-stats { margin: 0; }
.stop-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.stop-row { display: grid; grid-template-columns: 28px 120px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 18px 10px 12px; }
.stop-n { color: var(--dim); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.stop-fig .stage { border-radius: 9px; }
.stop-name { font-weight: 700; }
.stop-name:hover { color: var(--amber); }
.stop-where { color: var(--dim); font-size: 0.7812rem; display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.stop-where .icon { width: 14px; height: 14px; }
.stop-nums { text-align: right; font-size: 0.875rem; display: flex; flex-direction: column; gap: 1px; }
.stop-nums .dim { font-size: 0.7812rem; }
.effort-tag { color: var(--red); font-size: 0.7188rem; font-weight: 600; }

/* ---------- watches and account ---------- */

.link .steps { color: var(--soft); padding-left: 20px; margin: 0 0 16px; font-size: 0.9062rem; }
.link .steps li { margin-bottom: 6px; }
.link-form { display: flex; gap: 10px; }
#code {
  flex: 1 1 0; width: 0; min-width: 0; background: var(--well); border: 1px solid var(--field-edge); border-radius: 12px; padding: 10px 14px;
  font-size: 1.625rem; letter-spacing: .2em; font-variant-numeric: tabular-nums; text-align: center;
}
#code:focus { outline: none; border-color: var(--amber); }
.link .fine { margin-top: 14px; }
.watches h2 { font-size: 1rem; margin-bottom: 10px; }
.device { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.watch-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--well); color: var(--soft); flex: none; }
.watch-icon.garmin { color: var(--teal); background: rgba(87, 199, 133, .1); }
.watch-icon.apple-watch { color: var(--blue); background: rgba(91, 141, 239, .12); }
.device .info { flex: 1; min-width: 0; }
.device .nm { font-weight: 650; }
.device .meta { color: var(--dim); font-size: 0.8125rem; }
.account-cards { max-width: 620px; display: flex; flex-direction: column; gap: 16px; }
/* sharing with a coach or physio, and looking at what was shared */
.share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.share .info { flex: 1 1 180px; min-width: 0; }
.share .nm { font-weight: 650; overflow-wrap: anywhere; }
.share .meta { color: var(--dim); font-size: 0.8125rem; }
.account .stack + .link-form { margin-top: 12px; }
.share-email { flex: 1 1 0; width: 0; min-width: 0; background: var(--well); border: 1px solid var(--field-edge); border-radius: 11px; padding: 10px 13px; font-size: 0.9375rem; }
.share-email:focus { outline: none; border-color: var(--amber); }
.callout.looking { margin-bottom: 18px; }
.callout.looking b { color: var(--text, inherit); overflow-wrap: anywhere; }
.callout.looking button { margin-left: auto; }
.account .card p { margin: 0 0 14px; color: var(--soft); font-size: 0.875rem; }
.account .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.account .danger-zone { border-color: rgba(255, 107, 94, .3); }

/* ---------- signing in ---------- */

.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(80% 60% at 50% 0%, rgba(255, 166, 43, .08), transparent 70%); }
.gate-card { width: min(410px, 100%); padding: 32px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 60px rgba(0, 0, 0, .4); }
.gate .brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; font-size: 1.375rem; font-weight: 800; }
.gate h1 { font-size: 1.25rem; margin: 0 0 4px; text-align: center; }
.gate .sub { color: var(--dim); font-size: 0.875rem; text-align: center; margin: 0 0 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 0.8125rem; color: var(--soft); font-weight: 600; }
.field input { background: var(--well); border: 1px solid var(--field-edge); border-radius: 11px; padding: 11px 13px; font-size: 0.9375rem; font-weight: 400; }
.field input:focus { outline: none; border-color: var(--amber); }
.gate .primary, .gate .ghost { padding: 11px 16px; margin-top: 6px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 0.75rem; margin: 16px 0 10px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.switch { text-align: center; margin-top: 18px; font-size: 0.8125rem; color: var(--dim); }
.switch .link-btn { color: var(--amber); }
.gate .row { display: flex; justify-content: flex-end; margin: -6px 0 8px; }
.gate .fine { text-align: center; margin-top: 18px; }

/* ---------- controls: choices, small buttons, fields ---------- */

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--well); border: 1px solid var(--line); border-radius: 12px; }
.seg button { background: none; border: 0; border-radius: 9px; padding: 7px 14px; cursor: pointer; color: var(--soft); font-weight: 600; font-size: 0.8438rem; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--amber); color: var(--amber-ink); }
.ghost.small { padding: 6px 12px; font-size: 0.8125rem; }
.ghost.small.warn { color: var(--red); }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); color: var(--soft); cursor: pointer; display: inline-grid; place-items: center; flex: none; padding: 0; }
.icon-btn:not(:disabled):hover, .icon-btn.on { color: var(--amber); border-color: var(--amber); }
.icon-btn .icon { width: 16px; height: 16px; }
select, .inline-field input, .edit-set input {
  background: var(--well); border: 1px solid var(--field-edge); border-radius: 9px; padding: 6px 9px; font: inherit; font-size: 0.875rem; color: var(--text);
}
select:focus, .inline-field input:focus, .edit-set input:focus { outline: none; border-color: var(--amber); }
.inline-field { display: inline-flex; align-items: center; gap: 6px; color: var(--soft); font-size: 0.8438rem; }
.inline-field input, .edit-set input { width: 84px; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; gap: 8px; color: var(--soft); font-size: 0.8438rem; }
.stepper b { min-width: 18px; text-align: center; color: var(--text); font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
a.inline { color: var(--amber); text-decoration: underline; }
.callout { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: rgba(255, 166, 43, .07); border: 1px solid rgba(255, 166, 43, .3); border-radius: var(--radius); padding: 12px 16px; color: var(--soft); font-size: 0.875rem; }
.callout .icon { color: var(--amber); }
.callout .more { margin-left: auto; }

/* ---------- the floor, drawn ---------- */

.maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; align-items: start; }
.maps.tall { grid-template-columns: 1fr; }
.map { position: relative; margin: 0; background: var(--stage); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-frame { position: relative; width: 100%; }
.map-floor, .map-over { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map figcaption { padding: 8px 12px; color: var(--dim); font-size: 0.7812rem; border-top: 1px solid var(--line); }
.map figcaption b { color: var(--soft); }
/* The marks are in plan units, and the plan is drawn small on a phone: --k (map.js) is how many
   plan units make a pixel, so lines and names keep their size on the screen. */
.map-over { --k: 1; }
.map-over .room { fill: #171b22; stroke: var(--line-2); stroke-width: 2; }
.map-over .station circle { fill: var(--soft); opacity: .7; stroke: var(--stage); stroke-width: calc(1.5px * var(--k)); }
.map-over .station circle.hit { fill: transparent; stroke: none; opacity: 1; }
.map-over .station.can { cursor: pointer; }
.map-over .station.can:hover circle:not(.hit) { fill: var(--amber-2); opacity: 1; }
.map-over .station.lit circle:not(.hit) { fill: var(--amber); opacity: 1; stroke: var(--amber-ink); }
.map-over .station text { fill: var(--text); font-size: max(13px, calc(11.5px * var(--k))); font-weight: 600; paint-order: stroke; stroke: var(--stage); stroke-width: max(4px, calc(3px * var(--k))); pointer-events: none; }
.map-over .walk-under { fill: none; stroke: var(--stage); stroke-width: max(9px, calc(6px * var(--k))); stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.map-over .walk { fill: none; stroke: var(--amber); stroke-width: max(4px, calc(2.6px * var(--k))); stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: max(1px, calc(.7px * var(--k))) max(9px, calc(6px * var(--k))); }
.map-over .pin circle { fill: var(--amber); stroke: var(--amber-ink); stroke-width: max(2.5px, calc(1.5px * var(--k))); }
.map-over .pin text { fill: var(--amber-ink); font-size: max(19px, calc(13px * var(--k))); font-weight: 800; pointer-events: none; }
/* the way to see a floor larger */
.map-open {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--field-edge); background: rgba(7, 9, 12, .82); color: var(--text); font-size: 0.8125rem; font-weight: 600; cursor: pointer;
}
.map-open .icon { width: 16px; height: 16px; }
.map-open:hover { border-color: var(--amber); color: var(--amber); }
html.map-shown, html.map-shown body { overflow: hidden; }
.map-full {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--stage);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.map-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--rail); }
.map-bar b { font-size: 1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-bar-gap { flex: 1; }
.map-bar .icon-btn { width: 40px; height: 40px; }
.map-bar .ghost.small { min-height: 40px; }
/* pan with a finger: the box scrolls; pinch: the browser zooms */
.map-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; -webkit-overflow-scrolling: touch; display: grid; }
.map-zoom { margin: auto; padding: 8px; }
.map-zoom .map { border-radius: 10px; }
.map-info { margin: 0; padding: 10px 14px; min-height: 44px; border-top: 1px solid var(--line); background: var(--rail); color: var(--soft); font-size: 0.875rem; overflow-wrap: anywhere; }
details.walk { margin-bottom: 14px; }
details.walk summary { cursor: pointer; color: var(--soft); font-weight: 600; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; list-style: none; }
details.walk summary::-webkit-details-marker { display: none; }
details.walk summary::after { content: "hide"; color: var(--dim); font-weight: 500; font-size: 0.7812rem; margin-left: 6px; }
details.walk:not([open]) summary::after { content: "show"; }
details.walk summary .icon { width: 17px; height: 17px; color: var(--amber); }

/* ---------- the plan, being changed ---------- */

.stop-row.editing { border-color: var(--amber); }
.stop-nums .icon-btn { align-self: flex-end; margin-top: 6px; }
.stop-nums .goes-up { color: var(--teal); display: inline-flex; align-items: center; gap: 3px; justify-content: flex-end; }
.stop-nums .goes-up .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.stop-edit { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.edit-bar, .edit-fields { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.plan-notes { margin: 12px 0 0; padding-left: 20px; color: var(--dim); font-size: 0.8125rem; }
.plan-day .effort { margin: -4px 0 14px; }
.add-ex { margin-top: 12px; }
.chooser { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.stop-edit .chooser { margin-top: 0; }
.chooser.loading { min-height: 120px; }
.chooser-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.choice-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.choice-card:hover, .choice:not(:disabled):hover { border-color: var(--amber); }
.choice-card .stage { width: 100%; height: 84px; }
.choice-group { display: flex; flex-direction: column; gap: 6px; }
.choice-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 6px; }
.choice { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; text-align: left; display: flex; flex-direction: column; }
.choice-name { font-weight: 650; font-size: 0.8438rem; }
.choice-sub { color: var(--dim); font-size: 0.75rem; }

/* ---------- today: a new member, and the weights to come ---------- */

.hero.welcome { grid-template-columns: 1fr; }
.steps-list { list-style: none; padding: 0; margin: 18px 0 4px; display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step p { margin: 2px 0 0; color: var(--soft); font-size: 0.875rem; }
.step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--well); color: var(--soft); font-weight: 800; font-size: 0.8125rem; display: inline-grid; place-items: center; flex: none; }
.step.done .step-n { background: var(--amber); color: var(--amber-ink); }
.step-n .icon { width: 14px; height: 14px; stroke-width: 3; }
.next-weights { padding: 6px 16px; margin-bottom: 8px; }
.nw-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.nw-row:last-child { border-bottom: 0; }
.nw-row:hover .nw-name { color: var(--amber); }
.nw-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; font-size: 0.875rem; }
.nw-val { font-variant-numeric: tabular-nums; }
.nw-note { margin: 0 0 22px; }

/* ---------- setting up: the gym and the answers ---------- */

.start { max-width: 860px; }
.step-card h2 { display: flex; align-items: center; gap: 10px; font-size: 1.125rem; }
.step-card h2 .step-n { background: var(--amber); color: var(--amber-ink); }
.step-card .sub { color: var(--dim); font-size: 0.875rem; margin: 6px 0 16px; }
.gym-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.gym-card { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; cursor: pointer; text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; }
.gym-card:hover { border-color: var(--dim); }
.gym-card.on { border-color: var(--amber); background: rgba(255, 166, 43, .08); }
.gym-icon { grid-row: span 2; width: 38px; height: 38px; border-radius: 10px; background: var(--well); display: grid; place-items: center; color: var(--soft); }
.gym-card.on .gym-icon { color: var(--amber); }
.gym-name { font-weight: 700; }
.gym-sub { color: var(--dim); font-size: 0.7812rem; }
.own-gym { margin-top: 18px; }
.own-gym .field { max-width: 360px; }
.check-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 4px 14px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.check { display: flex; align-items: center; gap: 9px; padding: 5px 0; min-height: 32px; cursor: pointer; color: var(--soft); font-size: 0.875rem; }
.check input { width: 17px; height: 17px; accent-color: var(--amber); flex: none; }
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr); gap: 12px; align-items: center; }
.form-label { color: var(--soft); font-weight: 600; font-size: 0.875rem; }
.form-row .seg { justify-self: start; }
.build-bar { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.build-bar .primary { padding: 12px 26px; font-size: 0.9375rem; }
.build-bar .fine, .build-bar .msg { margin: 0; }

/* ---------- the gym ---------- */

.gym-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.gym-layout:has(.station-list) { grid-template-columns: minmax(0, 1fr) 300px; }
.station-list { display: flex; flex-direction: column; gap: 6px; max-height: 80vh; max-height: 80dvh; overflow: auto; position: sticky; top: calc(var(--top-h) + 12px); }
.station-row { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; text-align: left; display: flex; flex-direction: column; }
.station-row:hover, .station-row.on { border-color: var(--amber); }
.sr-name { font-weight: 650; font-size: 0.875rem; }
.sr-sub { color: var(--dim); font-size: 0.75rem; }
.station-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-color: var(--amber); }
.ex-tags.roomy { gap: 8px; }
.ex-card.out .stage { opacity: .4; }
.ex-card.out .ex-name { color: var(--soft); }

/* ---------- a workout, corrected ---------- */

.set-editor { display: flex; flex-direction: column; gap: 14px; }
.set-editor .sub { margin: 0; color: var(--dim); font-size: 0.875rem; }
.edit-ex { display: flex; flex-direction: column; gap: 6px; }
.edit-set { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--soft); font-size: 0.875rem; }
.edit-set .set-n { width: 24px; height: 24px; border-radius: 50%; background: var(--well); display: inline-grid; place-items: center; font-size: 0.75rem; font-weight: 700; flex: none; }

/* ---------- the privacy and terms pages ---------- */

.legal main { max-width: 720px; margin: 0 auto; padding: 40px 22px 80px; }
.legal .brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 800; margin-bottom: 28px; }
.legal h1 { font-size: 1.875rem; }
.legal h2 { font-size: 1.125rem; margin: 30px 0 8px; }
.legal .sub { color: var(--dim); margin: 4px 0 22px; }
.legal p, .legal li { color: var(--soft); }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal b { color: var(--text); }
.legal p a, .legal li a { color: var(--amber); text-decoration: underline; }
.legal .fine { margin-top: 40px; }
.legal .fine a { color: var(--dim); }
.gate .legal-links a { text-decoration: underline; }

/* ---------- smaller screens ---------- */

@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 240px; order: -1; }
  .lift-hero { grid-template-columns: 1fr; }
  .lift-hero-art .stage { min-height: 240px; }
  .cols, .cols.even { grid-template-columns: 1fr; }
  .day-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* The rail becomes a bar along the bottom on a phone held upright. A phone on its side (wide, and
   short) keeps the rail at the side, smaller, where it costs width it has instead of height it has
   not; and the rail scrolls if it is still too short. Not by height alone: a keyboard opening on
   an upright phone makes it short too. */
:root { --nav-bottom: 0px; }
@media (max-width: 559px), (max-width: 720px) and (min-height: 501px) {
  :root { --rail-w: 0px; --nav-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
  .rail {
    inset: auto 0 0 0; width: auto; height: auto; min-height: calc(var(--bar-h) + env(safe-area-inset-bottom)); flex-direction: row; justify-content: space-around; gap: 0;
    padding: 6px max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
    border-right: 0; border-top: 1px solid var(--line); background: rgba(18, 20, 25, .96); backdrop-filter: blur(12px); overflow: visible;
  }
  .rail > * { flex: 1 1 0; }
  .rail-brand, .rail-gap, .rail-low { display: none !important; }
  .rail a:not(.rail-brand) { width: auto; min-width: 0; padding: 6px 0; font-size: 0.5938rem; }
  .rail a span { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-brand { display: flex; font-size: 0; gap: 0; }
  .main { padding-bottom: calc(var(--nav-bottom) + 32px); }
  /* a workout under way (go.js): the page is the member's whole screen; it has its own way out */
  body.working { --nav-bottom: env(safe-area-inset-bottom); }
  body.working .rail { display: none; }
}
@media (min-width: 560px) and (max-height: 500px) {
  .rail { gap: 2px; padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .rail-brand { display: none; }
  .rail a:not(.rail-brand) { padding: 5px 0 4px; gap: 2px; }
  .rail .icon { width: 20px; height: 20px; }
  .top-brand { display: flex; font-size: 0; gap: 0; }
  :root { --top-h: 52px; }
  .main { padding-top: 18px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}

@media (max-width: 720px) {
  .topbar { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); gap: 10px; }
  .search kbd { display: none; }
  .main { padding-top: 20px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .view { gap: 22px; }
  .page-head h1 { font-size: 1.625rem; }
  .section-head { flex-wrap: wrap; }
  .tiles, .tiles.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  /* the tile's icon above its number, so a long number ("102.5 kg") has the tile's width */
  .tile { padding: 12px 12px 14px; }
  .tile-icon { position: static; width: 30px; height: 30px; border-radius: 9px; margin-bottom: 6px; }
  .tile .n { font-size: 1.5rem; padding-right: 0; margin-top: 0; }
  .hero-text { padding: 22px; }
  .hero h2 { font-size: 1.875rem; }
  .week-strip { gap: 4px; }
  .wk-day { padding: 8px 2px; min-width: 0; }
  .wk-name { letter-spacing: 0; overflow-wrap: anywhere; }
  .wk-what { display: none; }
  .ex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ex-body { padding: 10px 11px 12px; }
  .ex-name { font-size: 0.8438rem; }
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workout-row { gap: 12px; padding: 10px 12px 10px 10px; }
  .workout-row .badge { display: none; }
  .ex-block { flex-direction: column; }
  .ex-block-fig { width: 100%; }
  .ex-block-fig .stage { aspect-ratio: 16 / 9; height: auto; }
  /* the week's days: seven across even at 320 wide; a day done is a dot in its corner */
  .day-cards { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .day-card { position: relative; padding: 10px 1px; min-height: 44px; align-items: center; justify-content: center; text-align: center; }
  .dc-top { justify-content: center; }
  .dc-day { letter-spacing: 0; overflow-wrap: anywhere; min-width: 0; }
  .dc-done { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; }
  .dc-done .icon { display: none; }
  .dc-name, .dc-meta, .day-card.today .dc-day::after { display: none; }
  .stop-row { grid-template-columns: 90px minmax(0, 1fr); gap: 12px; padding: 10px; }
  .stop-n { display: none; }
  .stop-nums { grid-column: 2; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
  .lift-hero-text { padding: 22px; }
  .lift-hero-text h1, .workout-head h1 { font-size: 1.625rem; }
  .menu { right: max(10px, env(safe-area-inset-right)); }
  .form-row { grid-template-columns: 1fr; gap: 6px; }
  .gym-layout:has(.station-list) { grid-template-columns: 1fr; }
  .station-list { position: static; max-height: none; order: -1; }
  .stop-edit { grid-column: 1 / -1; }
  .maps { grid-template-columns: 1fr; }
  .map-open span { display: none; } /* the icon alone, on a small map */
  .map-open { padding: 6px 10px; }
}

/* A field's words at 16px or more where a finger types: smaller, and iOS zooms the page in on it. */
@media (max-width: 720px), (pointer: coarse) {
  .search input, .search-box, .field input, .share-email, select, .inline-field input, .edit-set input, textarea { font-size: max(16px, 1rem); }
}

/* A finger needs about 44px. Small controls keep their size and get a larger place to press. */
@media (pointer: coarse) {
  .icon-btn, .ghost.small, .danger, .chip, .seg button, .avatar, .link-btn, .back, .more, details.walk summary { position: relative; }
  .icon-btn::before, .ghost.small::before, .danger::before, .chip::before, .seg button::before, .avatar::before, .link-btn::before,
  .back::before, .more::before, .map-open::before, details.walk summary::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
  }
  .seg button { min-height: 36px; }
  .chip { min-height: 36px; }
  .primary, .ghost:not(.small), .search input, .search-box, select { min-height: 44px; }
  .top-brand { position: relative; }
  .top-brand::before { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
  .go-list button, .station-row, .check, .toggle, .choice, .menu a, .menu button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- a workout on the phone ---------- */

.go { max-width: 760px; }
.go-now { display: grid; grid-template-columns: minmax(0, 240px) 1fr; gap: 20px; align-items: start; }
.go-fig { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.go-fig .stage { width: 100%; }
.go-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.go-body h2 { font-size: 1.5rem; margin: 0; }
.go-body p { margin: 0; }
.go-target { color: var(--soft); }
.go-target b { color: var(--text); }
.go-where { display: flex; align-items: center; gap: 4px; }
.go-where .icon, .go-rest .dim .icon { width: 15px; height: 15px; }
.go-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0; }
.go-label { width: 62px; color: var(--soft); font-size: 0.8438rem; }
.go-num { min-width: 96px; text-align: center; font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.go-num input { width: 74px; background: var(--well); border: 1px solid var(--field-edge); border-radius: 9px; padding: 6px 4px; font: inherit; color: var(--text); text-align: center; }
.go-num input:focus { outline: none; border-color: var(--amber); }
.go-num .dim { font-size: 0.8125rem; font-weight: 400; }
.icon-btn.big { width: 46px; height: 46px; border-radius: 12px; }
.icon-btn.big .icon { width: 20px; height: 20px; }
.go-main { padding: 14px 22px; font-size: 1rem; flex: 1 1 220px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.go-more { margin-top: 4px; }
.go-rest, .go-done, .go-start { display: flex; flex-direction: column; gap: 12px; }
.go-rest p, .go-done h2, .go-start p { margin: 0; }
.go-clock { font-size: 4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.go-bar { height: 6px; border-radius: 3px; background: var(--well); overflow: hidden; }
.go-bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .25s linear; }
.go-list { list-style: none; margin: 14px 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.go-start .go-list { margin: 0; padding: 0; }
.go-list li { display: flex; }
.go-start .go-list li { justify-content: space-between; gap: 12px; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 0.9062rem; }
.go-list button { flex: 1; display: flex; justify-content: space-between; gap: 12px; align-items: center; background: none; border: 0; border-radius: 9px; padding: 9px 10px; font: inherit; font-size: 0.9062rem; color: var(--soft); cursor: pointer; text-align: left; }
.go-list button:not(:disabled):hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.go-list button:disabled { cursor: default; opacity: 1; } /* the one in hand, or done: still read in full */
.go-list li.now button { color: var(--amber); font-weight: 700; }
.go-list li.done button { color: var(--teal); }
.go-list li.done .icon { width: 15px; height: 15px; vertical-align: -2px; }
.badge.watch.web { color: var(--soft); }


/* A message about the workout (go.js), under the page's head: a strip, not a line lost in the page. */
.go > .msg { margin: 0; padding: 10px 14px; border-radius: var(--radius-s); background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); }
.go > .msg.ok { background: rgba(87, 199, 133, .08); border-color: rgba(87, 199, 133, .35); }
.go > .msg.err { background: rgba(255, 107, 94, .08); border-color: rgba(255, 107, 94, .4); color: #ff8f85; }

/* Today: a workout left under way, to pick up or put away */
.card.resume {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 18px; row-gap: 4px; align-items: center;
  background: linear-gradient(100deg, rgba(255, 166, 43, .13), rgba(255, 166, 43, .04) 70%), var(--panel);
  border-color: rgba(255, 166, 43, .5); box-shadow: inset 4px 0 0 var(--amber);
}
.card.resume > :not(.actions) { grid-column: 1; }
.card.resume h2 { margin: 0; color: var(--text); }
.card.resume p { margin: 0; color: var(--soft); font-size: 0.875rem; }
.card.resume .actions { grid-column: 2; grid-row: 1 / span 3; }

/* The action of the set in hand stays in reach: it sticks above the bottom bar (or the screen's
   edge) while the rest of the page scrolls under it. */
.go-now .go-body > .actions:not(.go-more), .go-rest > .actions {
  position: sticky; bottom: calc(var(--nav-bottom) + 6px); z-index: 2;
  /* stuck, it is a strip of the card: what scrolls under it is hidden, not seen through */
  background: var(--panel); padding: 6px 0; margin: -6px 0; box-shadow: 0 -10px 10px -6px var(--panel);
}
.go-rest > .actions { margin-top: 0; }

@media (max-width: 720px) {
  .go { gap: 14px; }
  .go .page-head { flex-wrap: nowrap; align-items: center; gap: 10px; }
  .go .page-head > div { min-width: 0; }
  .go .page-head h1 { font-size: 1.25rem; line-height: 1.25; }
  .go .page-head .sub { font-size: 0.8438rem; margin-top: 2px; }
  .go .head-extra .ghost { padding: 8px 14px; font-size: 0.8125rem; white-space: nowrap; }
  .go-now { grid-template-columns: 1fr; gap: 10px; padding: 12px 14px 14px; }
  /* the figure: as large as it can be and still leave the set's controls on the screen */
  .go-fig { width: min(100%, calc(28vh * 4 / 3)); width: min(100%, calc(28svh * 4 / 3)); justify-self: center; }
  .go-body { gap: 6px; }
  .go-body h2 { font-size: 1.25rem; line-height: 1.25; }
  .go-target, .go-where { font-size: 0.875rem; }
  .go-body > .kicker { font-size: 0.6875rem; }
  /* weight and reps: label, minus, number, plus on one line at 320 wide; the units under the number */
  .go-row { gap: 8px; padding: 2px 0; flex-wrap: wrap; }
  .go-label { width: auto; flex: 0 0 3.5rem; font-size: 0.8125rem; }
  .go-num { min-width: 0; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
  .go-num input { width: 100%; max-width: 6.5rem; padding: 5px 4px; }
  .go-num .dim { font-size: 0.75rem; white-space: nowrap; }
  .go-row > .badge { flex: 0 0 auto; margin-left: calc(3.5rem + 8px); }
  .go-row .icon-btn.big { width: 44px; height: 44px; }
  .go-main { padding: 13px 18px; }
  .go-more { margin-top: 0; }
  .go-now .go-clock { font-size: 3rem; }
  .go-clock { font-size: 3.5rem; }
  .card.resume { grid-template-columns: minmax(0, 1fr); }
  .card.resume .actions { grid-column: 1; grid-row: auto; margin-top: 8px; }
  .card.resume .actions > * { flex: 1 1 auto; }
}
/* a short phone (an SE, or the browser's bars showing): a smaller figure, so the set still fits */
@media (max-width: 720px) and (max-height: 700px) {
  .go-fig { width: min(100%, calc(21vh * 4 / 3)); width: min(100%, calc(21svh * 4 / 3)); }
  .go .page-head .sub { margin-top: 0; }
  .go-now { padding-top: 10px; }
}
/* a phone on its side: the figure beside the set, the head on one short line */
@media (min-width: 560px) and (max-height: 500px) {
  .go { gap: 12px; }
  .go .page-head { flex-wrap: nowrap; align-items: center; }
  .go .page-head h1 { font-size: 1.25rem; }
  .go .page-head .sub { margin-top: 0; font-size: 0.8438rem; }
  .go-now { grid-template-columns: minmax(0, 34%) minmax(0, 1fr); gap: 14px; padding: 12px 16px; }
  .go-fig { width: auto; max-width: none; justify-self: stretch; }
  /* too short for the set and its button together: the page scrolls, rather than the button hiding the reps */
  .go-now .go-body > .actions:not(.go-more), .go-rest > .actions { position: static; box-shadow: none; }
  .go-body { gap: 6px; }
  .go-body h2 { font-size: 1.25rem; }
  .go-row { padding: 0; }
}

/* a wide thing inside (a calendar, a code box) scrolls or shrinks: it never widens the page */
.view > *, .cols > *, .card { min-width: 0; }
