/* FitPath — athletic dark theme */

@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-var.woff2") format("woff2"); }

:root {
  --bg: #0b0c0e;
  --surface: #15171b;
  --surface-2: #1e2126;
  --surface-3: #282c32;
  --line: #2b2f36;
  --text: #f3f4f6;
  --muted: #8e949e;
  --faint: #5f656e;
  --volt: #d4ff3a;
  --volt-ink: #0b0c0e;
  --volt-soft: rgba(212, 255, 58, 0.1);
  --volt-text: #e8ff9c;
  --volt-line: rgba(212, 255, 58, 0.25);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, 0.12);
  --danger: #ff5c5c;
  --danger-soft: rgba(255, 92, 92, 0.12);
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tab-h: 66px;
  color-scheme: dark;
}
/* Pink accent: used for women by default, or when someone picks it in their profile. */
:root[data-accent="pink"] {
  --volt: #ff66b8;
  --volt-soft: rgba(255, 102, 184, 0.12);
  --volt-text: #ffc6e3;
  --volt-line: rgba(255, 102, 184, 0.3);
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Installed app (see lockZoomInApp in app.js): scroll only, no zoom, bounce or selection pop-ups. */
.standalone, .standalone body, .standalone * { touch-action: pan-x pan-y; }
.standalone, .standalone body { overscroll-behavior: none; }
.standalone body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.standalone input, .standalone textarea, .standalone select { -webkit-user-select: text; user-select: text; }
.standalone img { -webkit-user-drag: none; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 20px);
}
body.bare { padding-bottom: 24px; }
body.bare .tabbar, body.bare .avatar { display: none; }
body.wm { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.wm .tabbar, body.wm .topbar { display: none; }

a { color: var(--volt); text-decoration: none; }
p { margin: 0.5rem 0; }
h1, h2, h3 { margin: 0; font-weight: 700; }
.ic { flex: none; display: block; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

.container { max-width: 560px; margin: 0 auto; padding: 4px 16px 24px; }
.display, .h1, .h2 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; line-height: 0.95; }
.h1 { font-size: 42px; }
.h2 { font-size: 26px; }
.h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.label { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.center { text-align: center; }
.volt { color: var(--volt); }
.stack > * + * { margin-top: 12px; }
.section { margin-top: 28px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.section-head a, .section-head .link { font-size: 13px; font-weight: 600; }
.spacer { flex: 1; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

/* ───── Top bar & tabs ───── */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, calc((100% - 560px) / 2 + 16px)) 10px;
  background: rgba(11, 12, 14, 0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 0.04em; text-transform: uppercase; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: #111316; border: 1px solid var(--line); color: var(--volt); display: grid; place-items: center; }
.brand-mark-lg { width: 56px; height: 56px; border-radius: 16px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); color: var(--text); display: grid; place-items: center; }
.sync-pill { margin-left: auto; margin-right: 10px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; }
.sync-pill[hidden] { display: none; }
.sync-pill[data-state="offline"] { background: var(--warn-soft); color: var(--warn); }
.sync-pill[data-state="error"] { background: var(--danger-soft); color: var(--danger); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  padding: 8px max(6px, calc((100% - 560px) / 2)) calc(8px + env(safe-area-inset-bottom));
  background: rgba(14, 15, 18, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.tabbar a[aria-current="page"] { color: var(--volt); }

/* ───── Buttons & inputs ───── */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--text);
  font: 600 15px var(--body); cursor: pointer; text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn-volt { background: var(--volt); color: var(--volt-ink); font: 700 19px var(--display); letter-spacing: 0.05em; text-transform: uppercase; }
.btn-ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 56px; font-size: 21px; }
.btn[disabled] { opacity: 0.5; }
.btn-icon { width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.link { background: none; border: 0; padding: 6px 0; color: var(--volt); font-weight: 600; cursor: pointer; }
.back { display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 12px; color: var(--muted); font-weight: 600; background: none; border: 0; padding: 6px 0; cursor: pointer; }

input[type="text"], input:not([type]), input[type="number"], input[type="date"], input[type="search"], input[type="email"], input[type="password"], select {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--text); font: 16px var(--body); /* 16px+ stops iPhones zooming in on tap */
}
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input::placeholder { color: var(--faint); }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
input:focus { outline: none; border-color: var(--volt); }

.field { display: block; margin: 18px 0; }
.field > span:first-child { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field em { font-style: normal; color: var(--faint); font-weight: 400; }
.hint { margin: 6px 0; font-size: 13px; color: var(--muted); }
.unit { display: flex; align-items: center; gap: 10px; }
.unit input { flex: 1; }
.unit > span { color: var(--muted); min-width: 22px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.error { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: 14px; }
.form-error[hidden] { display: none; }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--volt); color: var(--volt-ink); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0 0 12px; padding: 0; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--volt); color: var(--volt-ink); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.pill-volt { background: var(--volt); color: var(--volt-ink); }
.pill-line { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* ───── Cards & notes ───── */
.card { background: var(--surface); border-radius: 18px; padding: 16px; }
.card + .card { margin-top: 10px; }
.card-link { display: block; color: var(--text); }
.note { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; }
.note p { margin: 2px 0; }
.note-warn { background: var(--warn-soft); color: #ffd9a1; }
.note-danger { background: var(--danger-soft); color: #ffc2c2; }
.note-volt { background: var(--volt-soft); color: var(--volt-text); }
.note ul { margin: 4px 0 0; padding-left: 18px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 480px) { .stats.four { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 14px 12px; border-radius: 16px; background: var(--surface); min-width: 0; }
.stat b { display: block; margin-top: 4px; font: 700 28px/1 var(--display); letter-spacing: 0.01em; }
.stat span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

/* Lists of rows (exercises, history, settings) */
.rows { border-radius: 18px; background: var(--surface); padding: 0 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); }
.row:first-child { border-top: 0; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-num { width: 26px; flex: none; font: 700 18px var(--display); color: var(--faint); text-align: center; }
.row .chev { color: var(--faint); }
.thumb { flex: none; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface-2); filter: grayscale(1) contrast(1.05); }
.thumb-sm { width: 44px; height: 44px; border-radius: 10px; }
.thumb-empty { display: grid; place-items: center; color: var(--faint); }

/* ───── Home ───── */
.greet { display: flex; justify-content: space-between; align-items: flex-end; margin: 8px 0 14px; }
.hero { position: relative; overflow: hidden; border-radius: 24px; background: var(--surface); min-height: 330px; display: flex; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1) brightness(0.75); }
.hero-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 12, 14, 0.2) 0%, rgba(11, 12, 14, 0.55) 45%, rgba(11, 12, 14, 0.96) 100%); }
.hero-body { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; width: 100%; padding: 20px; }
.hero-body .h1 { font-size: 48px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 14px; color: #d0d3d8; font-size: 13px; font-weight: 600; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero.rest { min-height: 240px; background: var(--surface); }
.hero.done { box-shadow: inset 0 0 0 2px var(--volt); }
.hero-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--volt); }

.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ws-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 8px; border-radius: 14px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.ws-day b { font: 700 20px/1 var(--display); color: var(--text); }
.ws-day i { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.ws-day.train i { background: var(--faint); }
.ws-day.done i { background: var(--volt); }
.ws-day.today { background: var(--volt); color: var(--volt-ink); }
.ws-day.today b { color: var(--volt-ink); }
.ws-day.today.train i, .ws-day.today.done i { background: var(--volt-ink); }

/* ───── Workout mode ───── */
.wm-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 0 12px; background: var(--bg); }
.wm-bar { flex: 1; display: flex; gap: 4px; }
.wm-bar span { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.wm-bar span.done { background: var(--volt); }
.wm-bar span.now { background: var(--text); }
.wm-clock { font: 700 18px var(--display); color: var(--muted); min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.wm-step { margin: 4px 0 14px; }
.wm-name { font-size: 38px; margin: 10px 0 4px; }
.demo { position: relative; overflow: hidden; border-radius: 20px; background: var(--surface-2); aspect-ratio: 3 / 2; }
.demo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08); }
.demo img + img { animation: demo-flip 2.4s steps(1, end) infinite; }
@keyframes demo-flip { 0% { opacity: 0; } 50% { opacity: 1; } }
.demo-tag { position: absolute; left: 12px; bottom: 12px; z-index: 1; }
.demo-empty { display: grid; place-items: center; color: var(--faint); }
.effort { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; color: #d0d3d8; font-size: 14px; }
.effort .ic { color: var(--volt); margin-top: 1px; }

.settable { margin-top: 6px; }
.set-head, .set-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 76px 64px 48px; gap: 8px; align-items: center; }
.set-head { padding: 0 6px 6px; }
.set-head.noweight, .set-row.noweight { grid-template-columns: 34px minmax(0, 1fr) 84px 48px; }
.set-row { padding: 6px; border-radius: 14px; transition: background 0.15s; }
.set-row + .set-row { margin-top: 4px; }
.set-row.done { background: var(--volt-soft); }
.set-n { font: 700 20px var(--display); color: var(--muted); text-align: center; }
.set-prev { font-size: 13px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-row input { min-height: 44px; padding: 8px 4px; text-align: center; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.set-check { width: 48px; height: 44px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--faint); display: grid; place-items: center; cursor: pointer; }
.set-check[aria-pressed="true"] { background: var(--volt); color: var(--volt-ink); }
.set-add { margin-top: 8px; }

.wm-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; gap: 10px;
  padding: 12px max(16px, calc((100% - 560px) / 2 + 16px)) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(11, 12, 14, 0) 0%, var(--bg) 30%);
}
.wm-foot .btn-icon { width: 56px; height: 56px; background: var(--surface-2); }
.wm-foot .btn-volt { flex: 1; min-height: 56px; }

.checklist { list-style: none; margin: 0; padding: 0; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.check-item:first-child { border-top: 0; }
.tick { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--surface-3); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; }
.tick[aria-pressed="true"] { background: var(--volt); border-color: var(--volt); color: var(--volt-ink); }
.check-item.done strong { color: var(--muted); text-decoration: line-through; }

/* Rest timer */
.rest-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 560px; margin: 0 auto;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0;
  background: var(--surface-2); box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5); text-align: center;
}
.rest-sheet[hidden] { display: none; }
.rest-track { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-bottom: 12px; }
.rest-fill { width: 0; height: 100%; background: var(--volt); transition: width 0.25s linear; }
.rest-time { font: 700 72px/1 var(--display); color: var(--volt); font-variant-numeric: tabular-nums; }
.rest-sheet.finished .rest-time { animation: pulse 0.7s ease-in-out 3; }
.rest-next { margin: 6px 0 14px; color: var(--muted); font-size: 14px; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ───── Train tab & builder ───── */
.plan-card { display: flex; align-items: center; gap: 14px; }
.plan-card .hero-icon { width: 48px; height: 48px; }

/* Install on the home screen */
.install-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px 14px; align-items: center; border: 1px solid var(--volt-line); }
.install-card .hero-icon { width: 48px; height: 48px; }
.install-card .row-main strong, .install-card .row-main span { white-space: normal; }
.install-card .btn-block { grid-column: 1 / -1; }
.install-x { width: 36px; height: 36px; align-self: start; }
.install-steps { list-style: none; margin: 6px 0 14px; padding: 0; display: grid; gap: 12px; }
.install-steps li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; color: #dcdfe4; }
.install-step-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--volt); }
.week-plan .row { cursor: pointer; }
.wp-day { width: 44px; flex: none; font: 700 20px var(--display); text-transform: uppercase; color: var(--muted); }
.wp-day.has { color: var(--volt); }
.empty { padding: 26px 16px; border-radius: 18px; border: 1.5px dashed var(--line); text-align: center; color: var(--muted); }
.empty .h3 { color: var(--text); margin-bottom: 4px; }

.bx { padding: 12px; border-radius: 16px; background: var(--surface); }
.bx + .bx { margin-top: 8px; }
.bx-head { display: flex; align-items: center; gap: 12px; }
.bx-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; }
.bx-controls label { display: flex; flex-direction: column; gap: 4px; }
.bx-controls input { width: 84px; min-height: 40px; padding: 6px 8px; text-align: center; font-weight: 700; }
.bx-controls select { width: 96px; min-height: 40px; padding: 6px 8px; }
.stepper { display: inline-flex; align-items: center; height: 40px; border-radius: 10px; background: var(--surface-2); }
.stepper button { width: 38px; height: 40px; border: 0; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.stepper output { min-width: 26px; text-align: center; font: 700 20px var(--display); }
.bx-move { display: flex; gap: 4px; margin-left: auto; }
.bx-move .btn-icon { width: 36px; height: 36px; }
.pick-list .row { cursor: pointer; }
.pick-list .row[aria-pressed="true"] .pick-tick { background: var(--volt); color: var(--volt-ink); border-color: var(--volt); }
.pick-tick { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface-3); display: grid; place-items: center; color: transparent; }

/* ───── Onboarding ───── */
.ob-progress { display: flex; gap: 4px; margin: 10px 0 18px; }
.ob-progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.ob-progress span.on { background: var(--volt); }
.ob-nav { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 22px; padding: 16px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(11, 12, 14, 0) 0%, var(--bg) 35%); }
.welcome { min-height: calc(100vh - 80px); display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding-bottom: 10px; }
.welcome .h1 { font-size: 64px; line-height: 0.9; }
.welcome .lead { font-size: 17px; color: #c9ccd2; }
.welcome-list { list-style: none; padding: 0; margin: 8px 0; }
.welcome-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; color: #d6d9de; }
.welcome-list .ic { color: var(--volt); }
.choices { display: grid; gap: 10px; }
.choice { display: flex; flex-direction: column; gap: 3px; padding: 16px; border: 2px solid transparent; border-radius: 16px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.choice strong { font-size: 16px; }
.choice span { color: var(--muted); font-size: 14px; }
.choice[aria-pressed="true"] { border-color: var(--volt); background: var(--volt-soft); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-chip { min-height: 48px; padding: 0; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.day-chip[aria-pressed="true"] { background: var(--volt); color: var(--volt-ink); }
.check-row { display: flex; gap: 12px; align-items: flex-start; width: 100%; margin: 6px 0; padding: 14px; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.check-row .box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--surface-3); display: grid; place-items: center; }
.check-row[aria-pressed="true"] { background: var(--warn-soft); }
.check-row[aria-pressed="true"] .box { background: var(--warn); border-color: var(--warn); }
.check-row[aria-pressed="true"] .box::after { content: ""; width: 10px; height: 6px; border: 2.5px solid var(--bg); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; cursor: pointer; color: #d0d3d8; font-size: 14px; }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--volt); }

/* ───── Programs, plan, library ───── */
.prog { display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.prog-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.prog .h2 { font-size: 24px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: -6px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); }
.timeline li.now::after { background: var(--volt); box-shadow: 0 0 0 4px var(--volt-soft); }
.timeline li.past::after { background: var(--faint); }
.accordion details { border-radius: 16px; background: var(--surface); }
.accordion details + details { margin-top: 8px; }
.accordion summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 16px; font-weight: 600; cursor: pointer; list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary .ic { color: var(--muted); transition: transform 0.2s; }
.accordion details[open] summary .ic { transform: rotate(180deg); }
.accordion details p, .accordion details ul { margin: 0 16px 12px; color: #c4c8ce; }
.recs .rec { display: flex; gap: 12px; align-items: flex-start; }
.rec-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--volt); }
.rec h3 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.rec p { margin: 0; color: var(--muted); font-size: 14px; }

.guide-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.guide-photos figure { position: relative; margin: 0; overflow: hidden; border-radius: 14px; aspect-ratio: 3 / 2; background: var(--surface-2); }
.guide-photos img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08); }
.guide-photos figcaption { position: absolute; left: 8px; bottom: 8px; }
/* Drawn illustrations keep their lime movement arrows (photos are shown in black and white). */
.thumb.art, .demo img.art, .guide-photos img.art { filter: none; }
.guide h4 { margin: 16px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 10px 34px; color: #dcdfe4; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--volt); color: var(--volt-ink); display: grid; place-items: center; font: 700 14px var(--display); }
.bullets { margin: 0; padding-left: 18px; color: #c4c8ce; }
.bullets li { margin: 4px 0; }
.guide-grid { display: grid; gap: 4px 16px; }
@media (min-width: 520px) { .guide-grid { grid-template-columns: 1fr 1fr; } }
.credit { margin: 12px 0 0; font-size: 12px; color: var(--faint); }
.credit a { color: var(--muted); }
.video-link { margin-top: 12px; }
.search { margin-bottom: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }

/* ───── Profile & progress ───── */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 0; }
.kv dt { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.set-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-line:first-child { border-top: 0; }
.set-details { padding: 12px 0; border-top: 1px solid var(--line); }
.set-details summary { cursor: pointer; font-weight: 600; color: var(--volt); }
.set-details .danger-text { color: var(--danger); }
.inline-form { display: flex; gap: 8px; margin: 12px 0; }
.inline-form input { flex: 1; }
.big { font: 700 40px/1 var(--display); }
.fine { font-size: 12px; color: var(--faint); }
.auth { padding-top: 24px; }

/* ───── Sheet & toast ───── */
.sheet {
  width: 100%; max-width: 560px; max-height: 90vh; margin: auto auto 0; padding: 0; border: 0;
  border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text);
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.65); }
#sheet-body { max-height: 90vh; overflow-y: auto; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 24px; } }
.toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); z-index: 40; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  background: var(--volt); color: var(--volt-ink); font-weight: 700; font-size: 14px;
  transform: translate(-50%, -160%); transition: transform 0.3s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .demo img + img { display: none; }
}

/* Rows that are buttons (tap to open, pick or swap) */
.row-btn { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.row-btn:first-child { border-top: 0; }
