@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(./fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(./fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(./fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(./fonts/inter-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 600; font-display: swap; src: url(./fonts/space-grotesk-latin-600-normal.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #0B0B0D;
  --surface: #151519;
  --surface-2: #1D1D23;
  --surface-3: #2A2A31;
  --line: #23232A;
  --line-strong: #2A2A31;
  --text: #F5F5F7;
  --muted: #A1A1AA;
  --faint: #8A8A94;
  --primary: #6E4BF2;
  --primary-soft: rgba(124, 92, 255, 0.18);
  --accent: #B9A4FF;
  --accent-2: #CDBBFF;
  --teal: #5EEAD4;
  --warn: #FBBF24;
  --teal-soft: rgba(94, 234, 212, 0.14);
  --danger: #FF8FA3;
  --radius: 18px;
  --display: 'Space Grotesk', Inter, system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar: calc(64px + var(--safe-bottom));
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); touch-action: pan-x pan-y; }
* { touch-action: manipulation; }
.reorder .handle, .reorder .handle * { touch-action: none; }
.chips, .strip { touch-action: pan-x pan-y; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.app { max-width: 520px; margin: 0 auto; min-height: 100dvh; position: relative; }
#view { outline: none; }
.tab { padding: calc(var(--safe-top) + 20px) 20px calc(var(--tabbar) + 96px); display: flex; flex-direction: column; gap: 22px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-header > div:not(.segmented) { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-header .segmented { flex: none; }
.title { font-family: var(--display); font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
.title-md { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.card.tight { border-radius: var(--radius); padding: 14px 16px; gap: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 15px; font-weight: 600; text-align: center; }
.btn.primary { background: var(--primary); border-color: transparent; color: #fff; }
.btn.primary:active { background: #5C3BE0; }
.btn.light { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.big { min-height: 56px; border-radius: 18px; font-size: 17px; font-weight: 700; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; }
.btn.dashed { background: transparent; border-style: dashed; border-color: #3A3A44; }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-button { width: 44px; height: 44px; flex: none; border-radius: 22px; border: 0; background: var(--surface); color: var(--text); display: inline-grid; place-items: center; }
.icon-button.small { width: 36px; height: 36px; border-radius: 18px; background: var(--surface-3); }
.icon-button.accent { background: var(--primary-soft); color: var(--accent); }
.icon-button.plain { background: transparent; color: var(--faint); }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: 14px; min-height: 32px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 5px; flex: none; background: var(--surface-3); }
.dot.sm { width: 8px; height: 8px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--primary-soft); color: var(--accent-2); font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.grey { background: var(--surface-2); color: var(--muted); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-height: 52px; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; color: var(--text); }
.rows > .row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .name { font-size: 15px; font-weight: 600; }
.row .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.group .row { padding: 10px 16px; }
.group-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 8px 4px; }
.chev { color: var(--faint); }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat .value { font-family: var(--display); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .value.md { font-size: 22px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .delta { font-size: 12px; font-weight: 600; color: var(--teal); }
.stat .delta.down { color: var(--muted); }

.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.segmented button { flex: 1; min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-size: 13px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: transparent; }
.start-card { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 60px; padding: 8px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-align: left; max-width: 220px; }
.start-card strong { font-size: 14px; }
.start-card span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.start-card.dashed { border-style: dashed; border-color: #3A3A44; }

.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 520px; height: var(--tabbar); padding: 0 12px var(--safe-bottom); display: flex; background: rgba(11, 11, 13, 0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid #1F1F25; z-index: 20; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--faint); font-size: 11px; font-weight: 600; }
.tabbar a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.mini-workout { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 10px); width: calc(100% - 24px); max-width: 496px; z-index: 19; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 8px 0 16px; border-radius: 18px; background: #1E1838; border: 1px solid #3B2F73; color: var(--text); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.mini-workout .grow { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mini-workout strong { font-size: 14px; }
.mini-workout span { font-size: 12px; color: var(--accent-2); }
.mini-workout .resume { height: 40px; padding: 0 14px; border-radius: 12px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; }

.banner { margin: calc(var(--safe-top) + 10px) 16px 0; padding: 12px 14px; border-radius: 14px; background: #2B1A24; border: 1px solid #55303F; color: #FFC2CE; font-size: 14px; }
.banner.info { background: #1E1838; border-color: #3B2F73; color: var(--accent-2); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 80px); z-index: 60; max-width: calc(100% - 40px); padding: 12px 16px; border-radius: 14px; background: var(--surface-3); color: var(--text); font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }

/* Sheets */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 520px; max-height: 88dvh; padding: 0; border: 0; border-top: 1px solid var(--line-strong); border-radius: 28px 28px 0 0; background: #121216; display: flex; flex-direction: column; overflow: hidden; }
.sheet:not([open]) { display: none; }
.sheet.tall { height: 92dvh; }
.sheet[open] { animation: sheet-in 0.24s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
.sheet-header { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 20px 8px; }
.grabber { position: absolute; top: 8px; left: 50%; margin-left: -20px; width: 40px; height: 5px; border-radius: 3px; background: #3A3A44; }
.sheet-title { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.sheet-body { padding: 8px 20px calc(24px + var(--safe-bottom)); overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input, input.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-size: 16px; font-weight: 500; }
textarea.input { padding: 12px 14px; min-height: 160px; line-height: 1.5; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; }
.search { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: 14px; background: var(--surface-2); color: var(--faint); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; min-width: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { min-height: 48px; border-radius: 14px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-size: 15px; font-weight: 600; }
.choice[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--accent-2); }
.form-error { color: var(--danger); font-size: 14px; }
.note-text { font-size: 14px; color: var(--muted); padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }

/* Body */
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 18px 0 8px; border-radius: 24px; background: radial-gradient(90% 70% at 50% 60%, #18181D 0%, var(--bg) 75%); }
.figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.figure figcaption { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.anatomy { width: 100%; max-width: 200px; aspect-ratio: 196 / 262; display: block; }
.anatomy .silhouette path { fill: #18181D; stroke: #34343D; stroke-width: 0.8; }
.anatomy .silhouette .seam { fill: none; stroke: #2A2A31; stroke-width: 0.6; }
.anatomy .muscle { fill: var(--heat); stroke: #0B0B0D; stroke-width: 0.7; cursor: pointer; outline: none; }
.anatomy .muscle[aria-pressed="true"] { stroke: #fff; stroke-width: 1.6; }
.anatomy.has-selection .muscle:not([aria-pressed="true"]) { opacity: 0.5; }
.anatomy .muscle:focus-visible { stroke: var(--accent); stroke-width: 1.6; }
.legend { display: block; padding: 0 4px; }
.legend .bar { position: relative; height: 8px; border-radius: 4px; margin: 4px 0 6px; }
.legend .ticks { position: relative; height: 16px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend .ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.legend .ticks span:first-child { transform: none; }
.legend .caption { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.mini-figures { display: flex; gap: 2px; flex: none; }
.mini-figures .anatomy { width: 80px; }

/* Today */
.start-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.start-tile { min-height: 72px; padding: 10px 6px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; line-height: 1.2; text-align: center; }
.start-tile.primary { background: var(--primary); border-color: transparent; color: #fff; }
.start-tile.primary:active { background: #5C3BE0; }
.start-tile:disabled { opacity: 0.45; }
.type-button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: inherit; color: inherit; border-radius: 8px; }
.type-button .icon { color: var(--faint); }
.type-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.plan-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.plan-list li:first-child { border-top: 0; padding-top: 0; }

/* History */
.session { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-align: left; width: 100%; }
.session .top { display: flex; align-items: center; gap: 10px; }
.session .top strong { flex: 1; font-size: 16px; }
.session .sub { font-size: 13px; color: var(--muted); line-height: 1.4; }
.set-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.set-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.set-chip small { color: var(--muted); font-weight: 500; }
.set-chip.warm { color: var(--muted); }
.set-chip.record { background: var(--primary-soft); color: var(--accent-2); }
.chart { width: 100%; height: auto; display: block; }

/* Workout screen */
.strip { list-style: none; margin: 4px 0 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip .mark { flex: none; min-width: 42px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 10px; background: var(--surface); }
.strip .sym { font-size: 14px; font-weight: 700; line-height: 1; }
.strip .when { font-size: 10px; color: var(--faint); white-space: nowrap; }
.strip .up .sym { color: var(--teal); }
.strip .same .sym { color: var(--muted); }
.strip .down .sym { color: var(--danger); }
.strip .first .sym { color: var(--accent); }
.strip .current { outline: 1px solid var(--primary); }
.coach { display: flex; gap: 8px; align-items: flex-start; margin: -4px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.coach .arrow { flex: none; width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--text); }
.coach.up .arrow { background: var(--teal-soft); color: var(--teal); }
.coach.down .arrow, .coach.note .arrow { background: rgba(255, 143, 163, 0.14); color: var(--danger); }
.coach.same .arrow { background: var(--primary-soft); color: var(--accent-2); }
.workout-screen { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow-y: auto; }
.workout-inner { max-width: 520px; min-height: 100%; margin: 0 auto; padding: calc(var(--safe-top) + 12px) 20px calc(var(--safe-bottom) + 20px); display: flex; flex-direction: column; gap: 16px; }
.workout-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; }
.workout-top .side { flex: none; display: flex; align-items: center; gap: 8px; }
.finish-pill { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; }
.finish-pill:active { background: var(--surface-2); }
.strip .pending .sym { color: var(--faint); }
.workout-top .center { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; min-width: 0; padding-left: 4px; }
.workout-top .center strong, .workout-top .center span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workout-top .center strong { font-size: 15px; }
.workout-top .center span { font-size: 12px; color: var(--muted); }
.segments { display: flex; align-items: center; gap: 4px; min-height: 8px; }
.segments > button { flex: 1; height: 4px; padding: 0; border: 0; border-radius: 2px; background: var(--surface-3); position: relative; }
.segments > button::after { content: ''; position: absolute; inset: -12px -2px; }
.segments > button[aria-current] { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--teal) 40%, var(--surface-3)); }
.segments > button[aria-current] i { border-radius: 4px; background: var(--teal); }
.segments > button i { display: block; height: 100%; border-radius: 2px; background: var(--primary); }
.exercise-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.exercise-title h1 { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.logged { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.logged li button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid transparent; color: var(--text); text-align: left; }
.logged li button[aria-pressed="true"] { border-color: var(--primary); }
.logged .ok { width: 22px; height: 22px; border-radius: 11px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; }
.logged .n { width: 44px; font-size: 13px; color: var(--muted); }
.logged .v { flex: 1; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.logged .e { font-size: 12px; color: var(--muted); }
.rest { align-self: center; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 6px 0 14px; border-radius: 18px; background: var(--primary-soft); color: var(--accent-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rest button { border: 0; background: rgba(255, 255, 255, 0.08); color: var(--text); height: 28px; padding: 0 10px; border-radius: 14px; font-size: 12px; font-weight: 700; }
.set-card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.set-card .head { display: flex; justify-content: space-between; align-items: baseline; }
.steppers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stepper { background: var(--surface-2); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stepper label { font-size: 12px; color: var(--muted); }
.stepper .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
.stepper button { height: 44px; border-radius: 14px; border: 0; background: var(--surface-3); color: var(--text); font-size: 22px; line-height: 1; }
.stepper input { width: 100%; min-width: 0; margin: 2px 0 6px; border: 0; background: transparent; color: var(--text); text-align: center; font-family: var(--display); font-size: 38px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 0; -moz-appearance: textfield; }
.stepper .step-chip { min-height: 32px; margin-top: 4px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.next-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 16px; border-radius: 18px; background: var(--surface); border: 0; color: var(--text); width: 100%; text-align: left; }
.next-row .label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.next-row .grow { flex: 1; font-size: 15px; font-weight: 600; }
.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.queue li { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 0 6px 0 12px; border-radius: 16px; background: var(--surface); border: 1px solid transparent; touch-action: pan-y; }
.queue li.current { border-color: var(--primary); }
.reorder .drag-source { opacity: 0.5; }
.queue li.drop-target { border-color: var(--teal); }
.rows.reorder .drop-target { box-shadow: inset 0 2px 0 var(--teal); }
.queue .open { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; background: none; border: 0; color: var(--text); text-align: left; padding: 8px 0; }
.queue .open strong { font-size: 15px; }
.queue .open span { font-size: 12px; color: var(--muted); }
.queue .open span.live { color: var(--accent-2); }
.reorder .handle { touch-action: none; cursor: grab; }
.ring { flex: none; }
.workout-actions { margin-top: auto; display: flex; gap: 10px; padding-top: 8px; }
.done-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding-top: 24px; }
.done-hero .check { width: 56px; height: 56px; border-radius: 28px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; }
.pr-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.pr-row:first-of-type { border-top: 0; }
.pr-row .grow { flex: 1; font-size: 15px; font-weight: 600; }
.pr-row .was { font-size: 12px; color: var(--faint); }
.pr-row .now { min-width: 74px; text-align: right; font-size: 15px; font-weight: 600; color: var(--accent-2); font-variant-numeric: tabular-nums; }

@media (min-width: 560px) {
  .app { border-left: 1px solid #141418; border-right: 1px solid #141418; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet[open] { animation: none; }
}

/* Interactive body, reusing the original sculpted mesh inside the new Body tab. */
.body-stage { position: relative; border-radius: 24px; overflow: hidden; background: radial-gradient(ellipse at 50% 45%, #1d1d23, var(--bg) 78%); }
.body-volume { display: block; width: min(100%, 59.85dvh, 616px); height: auto; aspect-ratio: 224 / 247; margin-inline: auto; cursor: grab; touch-action: pan-y; }
.body-volume.dragging { cursor: grabbing; }
.body-volume:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.body-stage-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 0; }
.body-orientation { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.body-rotate-hint { display: block; text-align: center; color: var(--faint); font-size: 12px; padding: 0 10px 14px; }
.body-stage [hidden] { display: none !important; }
.body-stage[data-fallback="true"] .body-stage-controls, .body-stage[data-fallback="true"] .body-rotate-hint { display: none; }
.body-muscle-picker { margin-top: 10px; color: var(--muted); font-size: 14px; }
.body-muscle-picker summary { cursor: pointer; padding: 12px 0; }
.body-muscle-buttons { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; }

.workout-discard { margin-top: 12px; border-top: 1px solid var(--line-strong); border-radius: 0; padding-top: 18px; }

.card.reminder { border-color: rgba(251, 191, 36, 0.35); }
.card.reminder .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }

/* ---- Following a split (split.mjs, plan-editor.mjs) ---- */
.badge.warn { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.day-switch { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.day-switch button { min-height: 48px; min-width: 64px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0 6px; }
.day-switch button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.day-switch .name { font-size: 13px; font-weight: 600; white-space: nowrap; }
.day-switch .sub { font-size: 11px; font-weight: 600; color: var(--faint); }
.day-switch .sub.next { color: var(--accent); }
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 4px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); text-align: left; width: 100%; }
.switch-row .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.switch-row .label { font-size: 14px; font-weight: 600; }
.switch-row .sub { font-size: 12px; color: var(--muted); }
.switch-row .icon { color: var(--faint); }
.last-sessions { border-radius: 14px; background: var(--surface); padding: 2px 14px; }
.last-sessions > div { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.last-sessions > div + div { border-top: 1px solid var(--line); }
.last-sessions .when { width: 52px; flex: none; font-size: 12px; color: var(--muted); }
.last-sessions .what { flex: 1; font-size: 14px; font-weight: 600; }
.last-sessions .older .what { color: var(--muted); }
.last-sessions .note { font-size: 12px; color: var(--muted); }
.title-actions { display: flex; gap: 8px; }
.title-actions .btn.sm { min-height: 40px; }
.skipped-card { gap: 8px; }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px; background: var(--surface-2); font-size: 15px; }
.check-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex: none; }
.check-row .grow { flex: 1; }
.title-input { width: 100%; background: transparent; border: 0; border-bottom: 1px dashed transparent; color: var(--text); font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; padding: 0; }
.title-input:focus { outline: none; border-bottom-color: var(--line-strong); }
.split-order { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; }
.split-order li { min-height: 36px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 0 4px; }
.split-order li a { color: var(--muted); display: grid; place-items: center; width: 100%; min-height: 36px; }
.split-order li[aria-current="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--primary); }
.plan-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-item { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.plan-item .head { display: flex; align-items: center; gap: 2px; padding: 4px 8px 4px 2px; }
.plan-item .order { display: flex; flex-direction: column; }
.plan-item .order .icon-button.small { width: 32px; height: 28px; border-radius: 8px; }
.plan-item .open { flex: 1; min-width: 0; min-height: 56px; display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--text); text-align: left; padding: 0 4px; }
.plan-item .open .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-item .open .name { font-size: 15px; font-weight: 600; }
.plan-item .open .sub { font-size: 12px; color: var(--muted); }
.plan-item .chev.up { transform: rotate(180deg); }
.plan-item .edit { border-top: 1px solid var(--line); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.plan-item .edit .line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-item .count { display: flex; align-items: center; gap: 12px; }
.plan-item .count .num { min-width: 18px; text-align: center; font-family: var(--display); font-size: 22px; font-weight: 600; }
.plan-flag { margin: 0 12px 12px; padding: 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.4; }
.plan-flag.swap { background: rgba(124, 92, 255, 0.12); color: #E4DCFF; }
.plan-flag.warn { background: rgba(251, 191, 36, 0.10); color: #FDE68A; }
.tip-card { background: rgba(124, 92, 255, 0.10); border-color: rgba(124, 92, 255, 0.35); gap: 10px; color: #E4DCFF; }
.plan-grid { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
.plan-grid table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.plan-grid th, .plan-grid td { text-align: left; vertical-align: top; padding: 9px 6px; }
.plan-grid thead th { font-size: 11px; font-weight: 600; color: var(--muted); padding-top: 10px; padding-bottom: 8px; }
.plan-grid tbody tr { border-top: 1px solid var(--line); }
.plan-grid th:first-child { padding-left: 12px; width: 30%; }
.plan-grid td:last-child, .plan-grid thead th:last-child { padding-right: 12px; }
.plan-grid tbody th { font-size: 13px; font-weight: 600; line-height: 1.25; }
.cell-variant { display: block; font-size: 11px; font-weight: 600; color: var(--accent); line-height: 1.25; }
.cell-reps { display: block; font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.cell-reps.hit { color: var(--teal); }
.cell-reps.skip { color: var(--warn); font-weight: 600; }
.cell-reps.faint { color: var(--faint); }
.cell-weight { display: block; font-size: 11px; color: var(--muted); }
.plan-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: -4px; }
.load-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.load-chips li { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 14px; background: var(--surface-2); font-size: 12px; font-weight: 600; }
.plan-item .order .icon-button:disabled { opacity: 0.25; }

/* Portrait only on phones. Android installs honour the manifest's orientation; iOS ignores
   it, so a landscape phone sees this note instead of a squashed app. Tablets are unaffected. */
.rotate-note { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .rotate-note { display: flex; position: fixed; inset: 0; z-index: 1000; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--bg); color: var(--text); font-weight: 600; text-align: center; visibility: visible; }
  body > :not(.rotate-note) { visibility: hidden; }
}
