:root {
  color-scheme: dark;
  --ink: #111416;
  --panel: #171b1e;
  --panel-2: #1e2428;
  --panel-3: #252c31;
  --line: rgba(255,255,255,.105);
  --line-strong: rgba(255,255,255,.18);
  --chalk: #f2efe7;
  --muted: #a5adb2;
  --dim: #737d83;
  --brass: #e1aa42;
  --brass-bright: #f3c360;
  --brass-soft: rgba(225,170,66,.14);
  --green: #6cc89f;
  --red: #ef715f;
  --blue: #7ea9c8;
  --shadow: 0 24px 70px rgba(0,0,0,.32);
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 12px;
  --sidebar: 238px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--ink); color: var(--chalk); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(243,195,96,.68); outline-offset: 3px;
}
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 300; padding: 12px 16px; background: var(--chalk); color: var(--ink); border-radius: 10px; }
.skip-link:focus { top: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 28px 18px 22px; border-right: 1px solid var(--line); background: rgba(17,20,22,.95); backdrop-filter: blur(18px); z-index: 50; display: flex; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: 12px; padding: 0 8px; min-height: 48px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.brand > span:last-child { display: grid; line-height: .88; }
.brand strong { font-family: Impact, "Arial Narrow", sans-serif; font-size: 1.42rem; letter-spacing: .055em; font-weight: 500; }
.brand b { color: var(--brass); font-size: .68rem; letter-spacing: .26em; margin-top: 7px; }
.brand-mark { width: 37px; height: 37px; border: 1px solid rgba(225,170,66,.5); border-radius: 50%; display: grid; grid-template-columns: repeat(3, 3px); gap: 3px; align-items: end; justify-content: center; padding: 9px 0; box-shadow: inset 0 0 18px rgba(225,170,66,.09); }
.brand-mark i { display: block; background: var(--brass); border-radius: 3px; }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 13px; }
.side-nav { display: grid; gap: 7px; margin-top: 54px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 13px; border: 1px solid transparent; border-radius: 13px; color: var(--muted); background: transparent; cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease; }
.nav-item:hover { color: var(--chalk); background: rgba(255,255,255,.045); }
.nav-item:active { transform: scale(.985); }
.nav-item.active { color: var(--chalk); background: var(--panel-2); border-color: var(--line); }
.nav-item.active [data-icon] { color: var(--brass); }
.nav-item em { font-style: normal; font-size: .92rem; font-weight: 650; }
[data-icon] { display: inline-flex; width: 20px; height: 20px; }
[data-icon] svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-foot { margin-top: auto; display: grid; gap: 20px; }
.offline-state { display: flex; align-items: center; gap: 8px; padding: 0 13px; color: var(--dim); font-size: .76rem; }
.offline-state span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(108,200,159,.08); }
.offline-state.offline span { background: var(--brass); }

.main { grid-column: 2; min-width: 0; min-height: 100vh; }
.view { max-width: 1320px; margin: 0 auto; padding: 42px 48px 72px; }
.mobile-header, .bottom-nav { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { color: var(--brass); font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-family: Impact, "Arial Narrow", sans-serif; font-size: clamp(2.6rem, 5vw, 5rem); line-height: .94; letter-spacing: .025em; font-weight: 500; text-transform: uppercase; }
h2 { font-size: 1.35rem; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
.page-sub { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.date-pill { flex: 0 0 auto; color: var(--muted); font-size: .84rem; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(300px, .75fr); gap: 22px; align-items: start; }
.stack { display: grid; gap: 22px; }
.card { position: relative; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); overflow: hidden; box-shadow: 0 1px 0 rgba(255,255,255,.025); }
.card-pad { padding: 24px; }
.hero-session { min-height: 470px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); background: radial-gradient(circle at 85% 15%, rgba(225,170,66,.11), transparent 31%), linear-gradient(145deg, #171b1e, #121517 72%); }
.hero-copy { display: flex; flex-direction: column; justify-content: space-between; padding: 30px; z-index: 2; }
.session-code { display: inline-flex; align-items: center; gap: 8px; color: var(--brass); font-size: .78rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.session-code::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.hero-session h2 { max-width: 580px; margin: 18px 0 14px; font-family: Impact, "Arial Narrow", sans-serif; font-size: clamp(2.7rem, 5vw, 5.3rem); font-weight: 500; line-height: .88; letter-spacing: .02em; text-transform: uppercase; }
.hero-session h2 span { display: block; color: var(--brass); }
.session-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.meta-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.025); font-size: .78rem; }
.meta-chip [data-icon] { width: 15px; height: 15px; color: var(--brass); }
.primary-button, .secondary-button, .ghost-button, .danger-button { min-height: 48px; border-radius: 14px; padding: 0 18px; font-weight: 800; border: 1px solid transparent; cursor: pointer; transition: transform .18s ease, filter .18s ease, border-color .18s ease, background .18s ease; }
.primary-button { color: #17130b; background: var(--brass); box-shadow: 0 10px 30px rgba(225,170,66,.15); }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.secondary-button { color: var(--chalk); background: var(--panel-3); border-color: var(--line); }
.secondary-button:hover, .ghost-button:hover { border-color: var(--line-strong); background: #2b3338; }
.ghost-button { color: var(--muted); background: transparent; border-color: var(--line); }
.danger-button { color: #ffd9d3; background: rgba(239,113,95,.11); border-color: rgba(239,113,95,.32); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-action { margin-top: 28px; }
.hero-action .primary-button { min-width: 190px; }
.hero-visual { position: relative; min-width: 0; display: grid; place-items: center; padding: 22px 26px 22px 0; }
.hero-visual::after { content: ""; position: absolute; inset: 13% 11% 8% 0; border: 1px solid rgba(225,170,66,.15); border-radius: 46% 46% 22px 22px; transform: rotate(3deg); }
.hero-visual .exercise-figure { position: relative; z-index: 2; width: min(100%, 340px); }

.week-card { padding: 24px; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 19px; }
.card-title-row h2, .card-title-row h3 { margin: 0; }
.text-button { border: 0; color: var(--brass); background: transparent; padding: 5px; font-size: .82rem; font-weight: 750; cursor: pointer; }
.week-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.day-node { min-width: 0; border: 1px solid var(--line); border-radius: 15px; padding: 14px 13px; background: rgba(255,255,255,.018); }
.day-node .node-top { display: flex; justify-content: space-between; color: var(--dim); font-size: .73rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.day-node strong { display: block; margin-top: 13px; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-node.current { border-color: rgba(225,170,66,.45); background: var(--brass-soft); }
.day-node.done .node-status { color: var(--green); }
.progress-line { height: 4px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.07); }
.progress-line > span { display: block; height: 100%; width: var(--progress, 0%); border-radius: inherit; background: var(--brass); transition: width .4s ease; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.progress-stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; }
.stat { padding: 18px; border: 1px solid var(--line); background: var(--panel); border-radius: 17px; }
.stat small { display: block; color: var(--dim); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .075em; }
.stat strong { display: block; margin-top: 12px; font-size: 1.55rem; letter-spacing: -.04em; }
.stat span { display: block; color: var(--muted); font-size: .75rem; margin-top: 3px; }
.insight-card { padding: 23px; }
.insight-card .kicker { display: flex; gap: 8px; align-items: center; color: var(--blue); font-size: .77rem; font-weight: 750; }
.insight-card .kicker [data-icon] { width: 17px; height: 17px; }
.insight-card p { color: var(--muted); line-height: 1.55; margin: 13px 0 0; }

.program-intro { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.75fr); gap: 22px; margin-bottom: 22px; }
.block-card { padding: 26px; }
.block-number { color: var(--brass); font-family: Impact, "Arial Narrow", sans-serif; font-size: 4.5rem; line-height: .82; }
.block-card p { color: var(--muted); line-height: 1.55; }
.phase-list { display: grid; gap: 10px; }
.phase-row { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.phase-row:first-child { border-top: 0; }
.phase-row strong { color: var(--brass); font-size: .78rem; }
.phase-row span { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.program-days { display: grid; gap: 18px; }
.program-day { display: grid; grid-template-columns: 185px minmax(0,1fr); }
.day-identity { padding: 25px; border-right: 1px solid var(--line); background: linear-gradient(150deg, rgba(225,170,66,.09), transparent 70%); }
.day-letter { font-family: Impact, "Arial Narrow", sans-serif; color: var(--brass); font-size: 4rem; line-height: .9; }
.day-identity h2 { margin: 18px 0 9px; font-size: 1.1rem; }
.day-identity p { color: var(--muted); font-size: .83rem; line-height: 1.45; }
.day-identity button { width: 100%; margin-top: 16px; }
.exercise-list { padding: 10px 20px; }
.exercise-row { width: 100%; display: grid; grid-template-columns: 44px minmax(0,1fr) auto 34px; gap: 13px; align-items: center; min-height: 68px; border: 0; border-bottom: 1px solid var(--line); color: inherit; background: transparent; text-align: left; cursor: pointer; }
.exercise-row:last-child { border-bottom: 0; }
.exercise-row:hover .exercise-name { color: var(--brass-bright); }
.exercise-index { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: var(--dim); font-size: .75rem; }
.exercise-name { display: block; font-weight: 740; transition: color .18s ease; }
.exercise-note { display: block; color: var(--dim); font-size: .76rem; margin-top: 4px; }
.exercise-dose { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.exercise-row [data-icon] { width: 16px; height: 16px; color: var(--dim); }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filter-chip { min-height: 39px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; color: var(--muted); background: var(--panel); cursor: pointer; font-weight: 700; font-size: .82rem; }
.filter-chip.active { color: #17130b; background: var(--brass); border-color: var(--brass); }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.movement-card { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--panel); cursor: pointer; color: inherit; text-align: left; padding: 0; }
.movement-card:hover { border-color: rgba(225,170,66,.34); }
.movement-preview { height: 230px; display: grid; place-items: center; background: radial-gradient(circle at 50% 52%, rgba(225,170,66,.1), transparent 42%), #14181a; overflow: hidden; }
.movement-preview .exercise-figure { height: 220px; width: 170px; }
.movement-info { padding: 18px; }
.movement-info small { color: var(--brass); font-weight: 750; text-transform: uppercase; letter-spacing: .09em; }
.movement-info h3 { margin: 9px 0 0; font-size: 1rem; }

.progress-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px,.65fr); gap: 22px; }
.chart-card { padding: 24px; }
.chart-wrap { min-height: 260px; margin-top: 18px; position: relative; }
.empty-state { min-height: 250px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-state [data-icon] { width: 36px; height: 36px; margin: 0 auto 14px; color: var(--dim); }
.history-list { display: grid; }
.history-row { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-mark { width: 42px; height: 42px; border-radius: 13px; background: var(--brass-soft); color: var(--brass); display: grid; place-items: center; font-weight: 850; }
.history-row strong { display: block; }
.history-row span { color: var(--dim); font-size: .78rem; }
.history-volume { text-align: right; color: var(--muted); font-size: .82rem; }
.chart-svg { width: 100%; height: 260px; overflow: visible; }
.chart-svg text { fill: var(--dim); font-size: 11px; }

.settings-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
.settings-card { padding: 24px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-copy strong { display: block; font-size: .92rem; }
.setting-copy span { display: block; color: var(--dim); font-size: .78rem; line-height: 1.45; margin-top: 4px; }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); background: var(--ink); border-radius: 11px; }
.segmented button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; color: var(--dim); background: transparent; cursor: pointer; font-size: .78rem; font-weight: 750; }
.segmented button.active { color: var(--ink); background: var(--chalk); }
.toggle { position: relative; width: 48px; height: 28px; border: 0; border-radius: 999px; background: var(--panel-3); cursor: pointer; }
.toggle::after { content: ""; position: absolute; width: 20px; height: 20px; top: 4px; left: 4px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background .2s ease; }
.toggle.on { background: var(--brass-soft); }
.toggle.on::after { transform: translateX(20px); background: var(--brass); }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: .78rem; font-weight: 700; }
.field input, .field select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; color: var(--chalk); background: var(--ink); padding: 0 12px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.source-note { color: var(--dim); font-size: .78rem; line-height: 1.5; margin-top: 18px; }
.source-note a { color: var(--muted); }

.workout-view { max-width: 1500px; padding: 0; }
.workout-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.workout-topbar { display: grid; grid-template-columns: minmax(170px,1fr) minmax(220px,2fr) minmax(170px,1fr); align-items: center; gap: 24px; padding: 20px 28px; border-bottom: 1px solid var(--line); background: rgba(17,20,22,.94); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 15; }
.workout-topbar .back-button { justify-self: start; }
.workout-label { text-align: center; }
.workout-label strong { display: block; font-size: .9rem; }
.workout-label span { color: var(--dim); font-size: .76rem; }
.workout-clock { justify-self: end; font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: .06em; }
.workout-body { display: grid; grid-template-columns: minmax(340px,.88fr) minmax(430px,1.12fr); min-height: 0; }
.demo-stage { min-height: 620px; position: sticky; top: 89px; height: calc(100vh - 89px); display: grid; place-items: center; border-right: 1px solid var(--line); background: radial-gradient(circle at 50% 42%, rgba(225,170,66,.13), transparent 32%), linear-gradient(155deg,#171b1e,#111416); overflow: hidden; }
.demo-stage::before { content: attr(data-index); position: absolute; left: 26px; bottom: 12px; color: rgba(255,255,255,.025); font-family: Impact, "Arial Narrow", sans-serif; font-size: 13rem; line-height: 1; }
.demo-stage .exercise-figure { width: min(68%, 410px); position: relative; z-index: 2; }
.demo-controls { position: absolute; right: 22px; bottom: 22px; display: flex; gap: 8px; z-index: 3; }
.round-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: rgba(17,20,22,.78); cursor: pointer; }
.round-button [data-icon] { width: 18px; height: 18px; }
.exercise-panel { padding: 42px clamp(25px,4vw,62px) 130px; max-width: 760px; width: 100%; }
.exercise-panel h1 { font-size: clamp(2.7rem,5vw,5.6rem); margin: 12px 0 15px; }
.exercise-panel .movement-description { max-width: 640px; color: var(--muted); line-height: 1.58; }
.target-strip { display: grid; grid-template-columns: repeat(3,1fr); margin: 28px 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.target-cell { padding: 15px; border-right: 1px solid var(--line); }
.target-cell:last-child { border-right: 0; }
.target-cell small { display: block; color: var(--dim); font-size: .69rem; text-transform: uppercase; letter-spacing: .09em; }
.target-cell strong { display: block; margin-top: 7px; font-size: .92rem; }
.cue-list { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; }
.cue-list li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: var(--muted); line-height: 1.45; font-size: .88rem; }
.cue-list li::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border: 2px solid var(--brass); border-radius: 50%; }
.set-table { border: 1px solid var(--line); border-radius: 17px; overflow: hidden; }
.set-head, .set-row { display: grid; grid-template-columns: 46px 1fr 1fr .85fr 46px; gap: 9px; align-items: center; min-height: 54px; padding: 0 12px; }
.set-head { color: var(--dim); background: rgba(255,255,255,.028); font-size: .7rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.set-row { border-top: 1px solid var(--line); }
.set-number { color: var(--muted); font-weight: 800; }
.set-row input { width: 100%; min-width: 0; height: 38px; border: 1px solid transparent; border-radius: 9px; color: var(--chalk); background: rgba(255,255,255,.035); padding: 0 9px; text-align: center; }
.set-row input:focus { border-color: rgba(225,170,66,.5); outline: 0; }
.set-check { width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 50%; color: transparent; background: transparent; cursor: pointer; display: grid; place-items: center; }
.set-check.done { color: var(--ink); background: var(--green); border-color: var(--green); }
.set-check [data-icon] { width: 16px; height: 16px; }
.set-row.complete { background: rgba(108,200,159,.035); }
.workout-footer { position: fixed; left: var(--sidebar); right: 0; bottom: 0; display: grid; grid-template-columns: auto minmax(220px,1fr) auto; align-items: center; gap: 18px; padding: 14px 28px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(17,20,22,.95); backdrop-filter: blur(18px); z-index: 20; }
.workout-footer .progress-line { max-width: 540px; width: 100%; justify-self: center; }
.footer-progress { text-align: center; color: var(--dim); font-size: .74rem; margin-bottom: 7px; }
.rest-pill { position: fixed; right: 25px; top: 88px; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid rgba(225,170,66,.35); border-radius: 14px; background: #211e17; box-shadow: var(--shadow); }
.rest-pill strong { font-variant-numeric: tabular-nums; color: var(--brass-bright); }
.rest-pill button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }

.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 22px; background: rgba(3,5,6,.74); backdrop-filter: blur(12px); animation: fadeIn .18s ease; }
.modal { width: min(100%, 760px); max-height: min(90vh,860px); overflow: auto; border: 1px solid var(--line-strong); border-radius: 26px; background: #171b1e; box-shadow: var(--shadow); animation: liftIn .24s ease; }
.modal.wide { width: min(100%, 980px); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: rgba(23,27,30,.94); backdrop-filter: blur(12px); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 24px; }
.close-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; background: transparent; cursor: pointer; }
.close-button [data-icon] { width: 17px; height: 17px; }
.movement-modal-grid { display: grid; grid-template-columns: minmax(260px,.9fr) minmax(280px,1.1fr); gap: 26px; }
.modal-figure { min-height: 430px; display: grid; place-items: center; border-radius: 20px; background: radial-gradient(circle, rgba(225,170,66,.11), transparent 45%), var(--ink); }
.modal-figure .exercise-figure { width: 250px; max-height: 420px; }
.modal-copy p { color: var(--muted); line-height: 1.55; }
.modal-copy h3 { margin-top: 25px; }
.summary-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 22px 0; }
.summary-cell { padding: 15px; border: 1px solid var(--line); border-radius: 14px; }
.summary-cell small { display: block; color: var(--dim); font-size: .71rem; }
.summary-cell strong { display: block; margin-top: 7px; font-size: 1.15rem; }
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 400; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 240px; max-width: 360px; padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 13px; color: var(--chalk); background: #252c31; box-shadow: var(--shadow); animation: liftIn .2s ease; }

.exercise-figure { display: block; aspect-ratio: 3 / 4; }
.exercise-video { height: auto; object-fit: cover; border-radius: 20px; background: #151719; box-shadow: 0 22px 54px rgba(0,0,0,.28); }
.hero-visual .exercise-video { width: min(100%, 325px); }
.movement-preview .exercise-video { width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; }
.demo-stage .exercise-video { width: min(72%, 450px); max-height: calc(100vh - 132px); object-fit: contain; position: relative; z-index: 2; }
.modal-figure .exercise-video { width: min(100%, 310px); max-height: 420px; object-fit: contain; }
.exercise-figure .figure-ground { stroke: rgba(255,255,255,.11); stroke-width: 2; }
.exercise-figure .limb-far { stroke: #4e585e; stroke-width: 18; stroke-linecap: round; }
.exercise-figure .limb-near { stroke: #cfd2cd; stroke-width: 19; stroke-linecap: round; }
.exercise-figure .joint { fill: #cfd2cd; }
.exercise-figure .torso { fill: #c7c9c4; }
.exercise-figure .pelvis { fill: #7b858a; }
.exercise-figure .head { fill: #dddcd5; }
.exercise-figure .equipment { stroke: var(--brass); fill: #201a10; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.exercise-figure .plate { fill: #2a2419; stroke: var(--brass); stroke-width: 3; }
.exercise-figure .motion-path { stroke: rgba(225,170,66,.34); fill: none; stroke-width: 2; stroke-dasharray: 4 8; }
.exercise-figure .mat { fill: rgba(126,169,200,.12); }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes liftIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }

@media (max-width: 1100px) {
  :root { --sidebar: 205px; }
  .view { padding: 34px 30px 64px; }
  .hero-session { grid-template-columns: 1fr .72fr; }
  .library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workout-body { grid-template-columns: minmax(300px,.75fr) minmax(400px,1.25fr); }
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; }
  .app-shell { display: block; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .main { min-height: 100vh; }
  .mobile-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; height: 66px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(17,20,22,.91); backdrop-filter: blur(18px); }
  .brand.compact { padding: 0; gap: 9px; }
  .brand.compact .brand-mark { width: 32px; height: 32px; padding-block: 7px; }
  .brand.compact strong { font-size: 1.17rem; }
  .brand.compact b { font-size: .57rem; margin-top: 5px; }
  .icon-button { width: 42px; height: 42px; border: 0; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: transparent; }
  .bottom-nav { position: fixed; inset: auto 0 0; z-index: 80; display: grid; grid-template-columns: repeat(5,1fr); min-height: 70px; padding: 7px 7px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(17,20,22,.95); backdrop-filter: blur(19px); }
  .bottom-nav .nav-item { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 52px; padding: 0 3px; border-radius: 11px; }
  .bottom-nav .nav-item em { font-size: .66rem; }
  .bottom-nav .nav-item [data-icon] { width: 19px; height: 19px; }
  .bottom-nav .train-nav { color: var(--ink); background: var(--brass); transform: translateY(-13px); box-shadow: 0 10px 28px rgba(225,170,66,.24); }
  .bottom-nav .train-nav:hover { color: var(--ink); background: var(--brass-bright); }
  .view { padding: 25px 17px 35px; }
  .page-head { align-items: flex-start; }
  .date-pill { display: none; }
  h1 { font-size: clamp(2.55rem,14vw,4.3rem); }
  .dashboard-grid, .program-intro, .progress-layout, .settings-grid { grid-template-columns: 1fr; }
  .progress-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-session { min-height: 620px; grid-template-columns: 1fr; grid-template-rows: auto 255px; }
  .hero-copy { padding: 24px; }
  .hero-session h2 { font-size: clamp(3rem,15vw,5rem); }
  .hero-visual { grid-row: 2; padding: 0 20px 14px; }
  .hero-visual .exercise-figure { height: 265px; width: 200px; }
  .hero-visual .exercise-video { width: auto; max-width: 100%; }
  .week-track { grid-template-columns: 1fr; }
  .day-node { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .day-node strong { margin-top: 7px; }
  .program-day { grid-template-columns: 1fr; }
  .day-identity { border-right: 0; border-bottom: 1px solid var(--line); }
  .day-identity button { width: auto; }
  .exercise-list { padding: 8px 14px; }
  .exercise-row { grid-template-columns: 38px minmax(0,1fr) 25px; gap: 10px; }
  .exercise-dose { display: none; }
  .library-grid { grid-template-columns: 1fr; }
  .movement-preview { height: 210px; }
  .movement-preview .exercise-figure { height: 210px; }
  .workout-view { padding: 0; }
  .workout-shell { padding-bottom: 82px; }
  .workout-topbar { grid-template-columns: auto 1fr auto; padding: 12px 14px; gap: 10px; top: 0; }
  .workout-topbar .back-button { width: 42px; height: 42px; padding: 0; font-size: 0; }
  .workout-topbar .back-button::before { content: "‹"; font-size: 1.6rem; }
  .workout-clock { font-size: .83rem; }
  .workout-body { display: block; }
  .demo-stage { position: relative; top: 0; height: 330px; min-height: 330px; border-right: 0; border-bottom: 1px solid var(--line); }
  .demo-stage::before { left: 12px; bottom: 0; font-size: 8rem; }
  .demo-stage .exercise-figure { height: 315px; width: 235px; }
  .demo-stage .exercise-video { width: auto; max-width: 92%; object-fit: contain; }
  .exercise-panel { padding: 28px 18px 38px; }
  .exercise-panel h1 { font-size: clamp(2.5rem,14vw,4.2rem); }
  .target-strip { margin: 22px 0; }
  .target-cell { padding: 12px 9px; }
  .target-cell strong { font-size: .8rem; }
  .workout-footer { left: 0; grid-template-columns: 1fr 1fr; gap: 8px; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); }
  .workout-footer .footer-track { position: absolute; left: 12px; right: 12px; top: -13px; }
  .workout-footer button { width: 100%; }
  .rest-pill { top: 76px; right: 12px; }
  .movement-modal-grid { grid-template-columns: 1fr; }
  .modal { max-height: 94vh; }
  .modal-figure { min-height: 340px; }
  .modal-figure .exercise-figure { height: 330px; }
  .modal-figure .exercise-video { width: auto; max-width: 100%; }
}

@media (max-width: 430px) {
  .page-head { margin-bottom: 22px; }
  .hero-session { min-height: 590px; }
  .session-meta { gap: 7px; }
  .meta-chip { font-size: .72rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .program-day { border-radius: 20px; }
  .exercise-list { padding-inline: 10px; }
  .exercise-row { min-height: 64px; }
  .set-head, .set-row { grid-template-columns: 38px 1fr 1fr .75fr 38px; gap: 5px; padding-inline: 7px; }
  .summary-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 8px; align-items: end; }
  .modal { border-radius: 24px 24px 10px 10px; max-height: 92vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
