/* FitPath — clean light theme: off-white, black type, colour photos, one small accent (lime or pink). */

@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-var.woff2") format("woff2"); }

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --surface-3: #e2e0d8;
  --line: #e6e4dd;
  --text: #121212;
  --muted: #74726b;
  --faint: #a4a29a;
  --ink: #121212;        /* primary buttons, selected states */
  --on-ink: #ffffff;
  --volt: #d4ff3a;       /* accent: small highlights only */
  --volt-ink: #121212;
  --volt-soft: rgba(212, 255, 58, 0.32);
  --volt-text: #3d4a00;
  --volt-line: rgba(140, 175, 0, 0.45);
  --volt-deep: #8fb800;  /* accent that is readable on white (arrows, small marks) */
  --warn: #9a5b00;
  --warn-soft: #fff1da;
  --danger: #c8302a;
  --danger-soft: #fde8e6;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --dock-h: 68px;
  --shadow: 0 12px 32px rgba(18, 18, 18, 0.08);
  color-scheme: light;
}
/* 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.16);
  --volt-text: #9c1459;
  --volt-line: rgba(255, 102, 184, 0.45);
  --volt-deep: #e8399a;
}

* { 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; }
.standalone, .standalone * { scrollbar-width: none; } /* no scroll bars while scrolling in the app */
.standalone ::-webkit-scrollbar { display: none; width: 0; height: 0; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 14.5px/1.5 var(--body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--dock-h) + 36px + env(safe-area-inset-bottom));
}
body.bare { padding-bottom: 24px; }
body.bare .tabbar, body.bare .avatar { display: none; }
body.wm { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
body.wm .tabbar, body.wm .topbar { display: none; }

a { color: var(--ink); 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 18px 24px; }
.display, .h1, .h2 { font-weight: 750; letter-spacing: -0.025em; line-height: 1.1; }
.h1 { font-size: 26px; }
.h2 { font-size: 19px; letter-spacing: -0.015em; }
.h3 { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.center { text-align: center; }
.volt { color: var(--volt-deep); }
.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: 14px; font-weight: 600; color: var(--muted); }
.spacer { flex: 1; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

/* ───── Top bar & floating dock ───── */
.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(20px, calc((100% - 560px) / 2 + 20px)) 10px;
  background: rgba(246, 245, 241, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 750; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: #111316; 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-3); 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: 12px; 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; z-index: 20; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto; height: var(--dock-h); display: flex; align-items: center; justify-content: space-around;
  padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--faint); font-size: 10px; font-weight: 600; }
.tabbar .desk-only, .tabbar .go-label { display: none; }
.tabbar a[data-near] { color: var(--ink); }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a.dock-go { flex: none; width: 54px; height: 54px; border-radius: 50%; padding: 0; justify-content: center; background: var(--ink); color: var(--volt); margin: 0 4px; }
.tabbar a.dock-go .ic { margin-left: 2px; }

/* ───── Buttons & inputs ───── */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
  font: 600 14.5px var(--body); cursor: pointer; text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn-volt { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-size: 15px; }
.btn-volt .ic { color: var(--volt); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 54px; font-size: 16px; }
.btn[disabled] { opacity: 0.45; }
.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; min-width: 0; padding: 0 10px; gap: 6px; font-size: 13.5px; white-space: nowrap; }
.btn-row > .btn .ic { width: 16px; height: 16px; }
.link { background: none; border: 0; padding: 6px 0; color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--surface-3); }
.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: 50px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text); font: 16px var(--body); /* 16px+ stops iPhones zooming in on tap */
}
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
/* iPhone date fields ignore width:100% and centre their text; make them behave like the other fields. */
input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; line-height: 24px; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
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(--ink); outline-offset: 2px; }
input:focus, select:focus { outline: none; border-color: var(--ink); }

.field { display: block; margin: 18px 0; }
.field > span:first-child { display: block; margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.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: 14px; 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: 999px; background: var(--surface-2); }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(18, 18, 18, 0.12); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 12px; padding: 0 20px; }
.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: 38px; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 600; }
.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: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.card + .card { margin-top: 10px; }
.card-link { display: block; color: var(--text); }
.note { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); font-size: 14px; }
.note p { margin: 2px 0; }
.note-warn { background: var(--warn-soft); color: #6b4000; }
.note-danger { background: var(--danger-soft); color: #8c1d18; }
.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 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.stat p.label { margin: 0; font-size: 12px; }
.stat b { display: block; margin-top: 4px; font-size: 18px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

/* Lists of rows (exercises, history, settings) */
.rows { border-radius: 22px; background: var(--surface); border: 1px solid var(--line); 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; }
/* Names wrap onto a second line instead of being cut off. */
.row-main strong { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-main span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-num { width: 26px; flex: none; font-weight: 700; font-size: 15px; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
.row .chev { color: var(--faint); }
.thumb { flex: none; width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: var(--surface-2); }
.thumb-sm { width: 46px; height: 46px; border-radius: 12px; }
.thumb.art { object-fit: contain; background: #fff; border: 1px solid var(--line); }
.thumb-empty { display: grid; place-items: center; color: var(--faint); }

/* ───── Home ───── */
.greet { display: flex; justify-content: space-between; align-items: flex-end; margin: 6px 0 18px; }
.greet .h1 { margin-top: 2px; }
.hero { position: relative; overflow: hidden; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.hero-img { width: 100%; height: 190px; object-fit: cover; background: var(--surface-2); }
.hero-scrim { display: none; }
.hero-body { position: relative; display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 16px; }
.hero-body .h1 { font-size: 23px; }
.hero-body .pill { align-self: flex-start; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; font-weight: 500; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero.done { box-shadow: inset 0 0 0 2px var(--ink); }
.hero.rest .hero-body { padding: 20px; }
.hero-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }

.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ws-day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; border-radius: 16px; color: var(--muted); font-size: 12px; font-weight: 500; }
.ws-day b { font-size: 16px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.ws-day i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.ws-day.train i { background: var(--surface-3); }
.ws-day.done i { background: var(--ink); }
.ws-day.today { background: var(--ink); color: rgba(255, 255, 255, 0.7); }
.ws-day.today b { color: var(--on-ink); }
.ws-day.today.train i, .ws-day.today.done i { background: var(--volt); }

/* ───── 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-top .btn-icon { background: var(--surface); }
.wm-bar { flex: 1; display: flex; gap: 4px; }
.wm-bar span { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); }
.wm-bar span.done { background: var(--ink); }
.wm-bar span.now { background: var(--volt-deep); }
.wm-clock { font-size: 15px; font-weight: 650; color: var(--text); min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.wm-step { margin: 4px 0 14px; }
.wm-name { font-size: 25px; margin: 10px 0 6px; }
/* Exercise pictures: start and finish side by side (or one photo). */
.demo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo.one { grid-template-columns: 1fr; }
.demo figure { position: relative; margin: 0; overflow: hidden; border-radius: 20px; background: var(--surface-2); aspect-ratio: 4 / 5; }
.demo.one figure { aspect-ratio: 3 / 2; }
.demo img { width: 100%; height: 100%; object-fit: cover; }
.demo img.art { object-fit: contain; background: var(--surface); }
.demo.drawn figure { aspect-ratio: 3 / 2; background: var(--surface); border: 1px solid var(--line); }
.demo.one.tall figure { aspect-ratio: 4 / 5; } /* portrait photos: show the whole person */
.demo figcaption { position: absolute; left: 8px; bottom: 8px; }
.demo-empty { display: grid; place-items: center; color: var(--faint); aspect-ratio: 3 / 2; border-radius: 20px; background: var(--surface-2); }
.photo-credit { margin: 6px 2px 0; font-size: 11.5px; color: var(--faint); }
.photo-credit a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--surface-3); }
.effort { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; color: var(--text); font-size: 14px; }
.effort .ic { color: var(--volt-deep); margin-top: 1px; }

/* Sets: a compact list, one slim row per set. */
.settable { margin-top: 10px; padding: 2px 14px 6px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.set-head, .set-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 62px 54px 34px; gap: 10px; align-items: center; }
.set-head.noweight, .set-row.noweight { grid-template-columns: 24px minmax(0, 1fr) 62px 34px; }
.set-head { padding: 10px 0 8px; }
.set-head .label { font-size: 11.5px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.set-row { padding: 7px 0; border-top: 1px solid var(--line); }
.set-n { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; display: grid; place-items: center; transition: background 0.15s, color 0.15s; }
.set-row.done .set-n { background: var(--ink); color: var(--volt); }
.set-prev { font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.set-row input {
  min-height: 0; height: 36px; padding: 0 4px; border: 1px solid transparent; border-radius: 10px;
  background: var(--bg); text-align: center; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; /* 16px: no iPhone zoom */
}
.set-row input::placeholder { color: var(--faint); font-weight: 500; }
.set-row input:focus { border-color: var(--ink); background: var(--surface); }
.set-row.done input { background: var(--volt-soft); }
.set-check { width: 34px; height: 34px; border: 1.5px solid var(--surface-3); border-radius: 50%; background: var(--surface); color: var(--faint); display: grid; place-items: center; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.set-check[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--volt); }
.set-add { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 0; padding: 8px 2px; border: 0; background: none; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.set-add:hover { color: var(--ink); }

.wm-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; gap: 10px;
  padding: 12px max(20px, calc((100% - 560px) / 2 + 20px)) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(246, 245, 241, 0) 0%, var(--bg) 32%);
}
.wm-foot .btn-icon { width: 56px; height: 56px; background: var(--surface); }
.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: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; }
.tick[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--volt); }
.check-item.done strong { color: var(--muted); text-decoration: line-through; }

/* Rest timer: a slim bar (time on the left, buttons on the right) so the sets above stay reachable. */
.rest-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "track track" "label btns" "time btns" "next next"; column-gap: 12px; align-items: center;
  padding: 14px 18px calc(12px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0;
  background: var(--surface); box-shadow: 0 -12px 40px rgba(18, 18, 18, 0.14);
}
.rest-sheet[hidden] { display: none; }
.rest-track { grid-area: track; height: 4px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-bottom: 10px; }
.rest-fill { width: 0; height: 100%; background: var(--ink); transition: width 0.25s linear; }
.rest-sheet .t-label { grid-area: label; margin: 0; }
.rest-time { grid-area: time; justify-self: start; font-size: 36px; font-weight: 750; letter-spacing: -0.035em; line-height: 1.05; color: var(--text); font-variant-numeric: tabular-nums; transform-origin: left center; }
.rest-sheet.finished .rest-time { animation: pulse 0.7s ease-in-out 3; }
.rest-next { grid-area: next; margin: 6px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest-sheet .btn-row { grid-area: btns; gap: 6px; }
.rest-sheet .btn-row > .btn { flex: none; min-height: 42px; padding: 0 13px; }
body.resting { padding-bottom: calc(var(--rest-h, 160px) + 16px); } /* room to scroll the last sets above the timer */
@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; }
.install-card .hero-icon { width: 48px; height: 48px; background: #111316; color: var(--volt); }
.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; border: 0; }
.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: var(--text); }
.install-step-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.week-plan .row { cursor: pointer; }
.wp-day { width: 44px; flex: none; font-weight: 700; font-size: 15px; color: var(--faint); }
.wp-day.has { color: var(--ink); }
.empty { padding: 26px 16px; border-radius: 22px; border: 1.5px dashed var(--surface-3); text-align: center; color: var(--muted); }
.empty .h3 { color: var(--text); margin-bottom: 4px; }

.bx { padding: 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.bx + .bx { margin-top: 8px; }
.bx-head { display: flex; align-items: center; gap: 12px; }
/* Sets, reps and rest: three equal boxes with the same height and look. */
.bx-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.bx-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bx-controls .label { font-size: 12px; }
.stepper, .bx-range, .bx-controls select { height: 44px; border: 1px solid transparent; border-radius: 12px; background-color: var(--bg); }
.stepper { display: flex; align-items: center; }
.stepper button { flex: none; width: 32px; height: 100%; border: 0; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.stepper output { flex: 1; min-width: 0; text-align: center; font-size: 16px; font-weight: 700; }
.bx-range { display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.bx-range:focus-within { border-color: var(--ink); background-color: var(--surface); }
.bx-range > span { flex: none; color: var(--faint); font-weight: 600; }
.bx-range input { flex: 0 1 46px; width: 0; min-width: 0; min-height: 0; height: 36px; padding: 0 2px; border: 0; border-radius: 8px; background: none; text-align: center; font-size: 16px; font-weight: 700; }
.bx-range input::placeholder { font-size: 12px; font-weight: 500; }
.bx-controls select {
  -webkit-appearance: none; appearance: none; width: 100%; min-height: 0; padding: 0 26px 0 12px; font-weight: 700; color: var(--text);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 14px;
}
.bx-controls select:focus { border-color: var(--ink); }
.bx-move { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 4px; }
.bx-move .btn-icon { width: 36px; height: 36px; }
.pick-list .row { cursor: pointer; }
.pick-list .row[aria-pressed="true"] .pick-tick { background: var(--ink); color: var(--volt); border-color: var(--ink); }
.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: 5px; border-radius: 3px; background: var(--surface-3); }
.ob-progress span.on { background: var(--ink); }
.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(246, 245, 241, 0) 0%, var(--bg) 35%); }
.welcome { min-height: calc(100vh - 110px); min-height: calc(100dvh - 110px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding-bottom: 4px; }
.welcome .brand-mark-lg { width: 46px; height: 46px; border-radius: 13px; }
.welcome .lead { margin: 0; }
.welcome .h1 { font-size: 31px; line-height: 1.06; letter-spacing: -0.03em; }
.welcome .h1 .volt { color: var(--text); background: linear-gradient(transparent 62%, var(--volt) 62%, var(--volt) 92%, transparent 92%); }
.welcome .lead { font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.welcome-list { list-style: none; padding: 0; margin: 2px 0 6px; }
.welcome-list li { display: flex; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; line-height: 1.35; color: var(--text); }
.welcome-list .ic { color: var(--volt-deep); }
.choices { display: grid; gap: 10px; }
.choice { display: flex; flex-direction: column; gap: 3px; padding: 16px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.choice strong { font-size: 15px; }
.choice span { color: var(--muted); font-size: 13.5px; }
.choice[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-chip { min-height: 48px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.day-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.check-row { display: flex; gap: 12px; align-items: flex-start; width: 100%; margin: 6px 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; 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); border-color: #f3d39b; }
.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 #fff; 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: var(--text); font-size: 14px; }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ink); }

/* ───── 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: 18px; }
.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(--ink); box-shadow: 0 0 0 4px var(--volt-soft); }
.timeline li.past::after { background: var(--faint); }
.accordion details { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.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: var(--muted); }
.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(--ink); }
.rec h3 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.rec p { margin: 0; color: var(--muted); font-size: 14px; }

.guide-photos { margin-bottom: 14px; }
.guide h4 { margin: 18px 0 8px; font-size: 15px; font-weight: 700; color: var(--text); }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 10px 36px; color: var(--text); font-size: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 25px; height: 25px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.bullets { margin: 0; padding-left: 18px; color: var(--muted); }
.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); text-decoration: underline; }
.video-link { margin-top: 12px; }
.search { margin-bottom: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; 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: 12.5px; font-weight: 500; 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(--ink); }
.set-details .danger-text { color: var(--danger); }
.inline-form { display: flex; gap: 8px; margin: 12px 0; }
.inline-form input { flex: 1; }
.big { font-size: 30px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.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: 28px 28px 0 0; background: var(--surface); color: var(--text);
}
.sheet::backdrop { background: rgba(18, 18, 18, 0.38); }
#sheet-body { max-height: 90vh; overflow-y: auto; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.sheet-head .btn-icon { border: 0; background: var(--surface-2); }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 28px; } }
.toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); z-index: 40; width: max-content; max-width: min(340px, calc(100% - 40px));
  display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 14px;
  background: var(--ink); color: var(--on-ink); font-weight: 600; font-size: 13px; line-height: 1.3; box-shadow: var(--shadow);
  /* Hidden = faded out, not just slid up (it used to peek out under the iPhone notch / Dynamic Island). */
  transform: translate(-50%, -16px); opacity: 0; visibility: hidden; transition: transform 0.3s, opacity 0.3s, visibility 0.3s; pointer-events: none;
}
.toast .ic { flex: none; width: 15px; height: 15px; color: var(--volt); }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ───── Loading screen (shown while the app opens) ───── */
.splash {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--bg); transition: opacity 0.35s ease, visibility 0.35s;
  animation: splash-giveup 0.01s 12s forwards; /* never block the app if something went wrong */
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash-mark { width: 92px; height: 92px; border-radius: 26px; background: #111316; display: grid; place-items: center; box-shadow: var(--shadow); animation: splash-pop 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.15) both; }
.splash-mark svg { width: 54px; height: 54px; overflow: visible; }
.splash-mark polygon { fill: var(--volt); }
.splash-mark .s1 { animation: splash-slide 0.5s 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.splash-mark .s2 { animation: splash-slide 0.5s 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.splash-word { font-size: 24px; font-weight: 750; letter-spacing: -0.025em; color: var(--text); animation: splash-fade 0.45s 0.4s both; }
.splash-bar { width: 64px; height: 3px; margin-top: 4px; border-radius: 3px; background: var(--surface-3); overflow: hidden; animation: splash-fade 0.3s 0.6s both; }
.splash-bar span { display: block; width: 40%; height: 100%; border-radius: 3px; background: var(--ink); animation: splash-load 1.1s 0.6s ease-in-out infinite; }
@keyframes splash-pop { from { transform: scale(0.82); opacity: 0; } }
@keyframes splash-slide { from { transform: translateX(-9px); opacity: 0; } }
@keyframes splash-fade { from { opacity: 0; transform: translateY(4px); } }
@keyframes splash-load { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@keyframes splash-giveup { to { opacity: 0; visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .splash-bar { 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; }

/* ───── Grids used on wider screens ───── */
.card-grid { display: grid; gap: 10px; }
.card-grid > .card + .card { margin-top: 0; }
.split-media { margin-bottom: 14px; }

/* ───── Tablet (600px+) ───── */
@media (min-width: 600px) {
  body { font-size: 15px; }
  .container { max-width: 680px; padding: 8px 24px 32px; }
  .topbar { padding-left: max(24px, calc((100% - 680px) / 2 + 24px)); padding-right: max(24px, calc((100% - 680px) / 2 + 24px)); }
  .h1 { font-size: 30px; }
  .h2 { font-size: 21px; }
  .h3 { font-size: 17px; }
  .label { font-size: 13px; }
  .hero-img { height: 260px; }
  .hero-body .h1 { font-size: 26px; }
  .wm-name { font-size: 30px; }
  .welcome .h1 { font-size: 44px; }
  .stat b { font-size: 21px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo figure { aspect-ratio: 4 / 3; }
  .wm-foot { padding-left: max(24px, calc((100% - 680px) / 2 + 24px)); padding-right: max(24px, calc((100% - 680px) / 2 + 24px)); }
}
@media (min-width: 760px) {
  .rows.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; padding: 0 18px; }
  .rows.cols-2 > .row:nth-child(2) { border-top: 0; }
}

/* ───── Desktop (1000px+): side menu instead of the floating dock, wider pages ───── */
@media (min-width: 1000px) {
  body { padding: 0 0 40px 248px; }
  body.bare, body.wm { padding-left: 0; }
  body:not(.bare) .topbar { display: none; }
  .container { max-width: 820px; padding: 36px 44px 48px; }
  body.wide .container { max-width: 1080px; }
  body.narrow .container { max-width: 520px; }
  /* Signed-out pages have no side menu: line the logo up with the page below. */
  body.bare .topbar { padding-left: max(44px, calc((100% - 820px) / 2 + 44px)); padding-right: max(44px, calc((100% - 820px) / 2 + 44px)); }
  body.bare.wide .topbar { padding-left: max(44px, calc((100% - 1080px) / 2 + 44px)); padding-right: max(44px, calc((100% - 1080px) / 2 + 44px)); }
  body.narrow .topbar { padding-left: max(44px, calc((100% - 520px) / 2 + 44px)); padding-right: max(44px, calc((100% - 520px) / 2 + 44px)); }
  body.wm .container { max-width: 820px; }
  .wm-foot { padding-left: max(44px, calc((100% - 820px) / 2 + 44px)); padding-right: max(44px, calc((100% - 820px) / 2 + 44px)); }

  .tabbar {
    top: 0; bottom: 0; left: 0; right: auto; width: 248px; height: auto; max-width: none; margin: 0; padding: 26px 16px;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px;
    border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; background: var(--surface);
  }
  .tabbar > * { order: 3; }
  .tabbar .desk-only { display: flex; }
  .tabbar a { flex: none; flex-direction: row; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: 14.5px; font-weight: 550; color: var(--muted); }
  .tabbar a:hover { background: var(--bg); color: var(--text); }
  .tabbar a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
  .tabbar a[data-near]:not([aria-current]) { color: var(--muted); }
  .tabbar .side-brand { order: 1; margin: 0 0 22px; padding: 2px 6px; gap: 10px; font-size: 19px; font-weight: 750; letter-spacing: -0.02em; color: var(--text); }
  .tabbar .side-brand:hover { background: none; }
  .tabbar a.dock-go { order: 2; width: auto; height: 48px; margin: 0 0 18px; padding: 0 18px; border-radius: 999px; gap: 8px; justify-content: center; font-size: 14.5px; font-weight: 650; color: var(--on-ink); background: var(--ink); }
  .tabbar a.dock-go:hover { background: #2a2a2a; color: var(--on-ink); }
  .tabbar a.dock-go .ic { color: var(--volt); margin-left: 0; }
  .tabbar .go-label { display: inline; }

  .h1 { font-size: 32px; }
  .greet { margin-top: 0; }
  .home-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .home-main { position: sticky; top: 24px; }
  .home-side > .section:first-child { margin-top: 0; }
  .hero-img { height: 320px; }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
  .split-media { position: sticky; top: 24px; margin: 0; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet { max-width: 640px; }
}
