:root {
    --bg: #0b0e0d;
    --sidebar: #0e1210;
    --surface: #141816;
    --surface-2: #1a201d;
    --surface-3: #232a26;
    --line: #2a312d;
    --text: #f4f2e9;
    --muted: #969e98;
    --faint: #68706b;
    --strength: #c8f45d;
    --strength-dark: #17200b;
    --run: #ff8066;
    --danger: #ff6f6f;
    --success: #75df9a;
    --warn: #f4c95d;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 24px 70px rgba(0, 0, 0, .24);
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--strength);
    outline-offset: 3px;
}
::selection { color: #10140c; background: var(--strength); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }

.hidden { display: none !important; }
.dim { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.button-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.eyebrow {
    display: block;
    color: var(--muted);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .13em;
    line-height: 1.2;
    text-transform: uppercase;
}
.run-color { color: var(--run); }
h1, h2, h3 { letter-spacing: -.035em; line-height: 1.08; }
h1 { font-size: clamp(1.75rem, 4vw, 2.65rem); font-weight: 680; }
h2 { font-size: 1.08rem; font-weight: 680; }
h3 { font-size: .96rem; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: 232px;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--sidebar);
    padding: 26px 18px 20px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    background: var(--strength);
    color: #10140c;
    font-size: 1rem;
    font-weight: 900;
    box-shadow: 0 0 30px rgba(200, 244, 93, .12);
}
.brand b { display: block; font-size: .86rem; letter-spacing: .16em; }
.brand small { display: block; margin-top: 2px; color: var(--faint); font-size: .52rem; font-weight: 750; letter-spacing: .12em; }

.tabs { display: flex; flex-direction: column; gap: 5px; margin-top: 44px; }
.tab {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    padding: 11px 12px;
    color: var(--muted);
    cursor: pointer;
    font-size: .86rem;
    font-weight: 650;
    text-align: left;
    transition: color .18s, background .18s, transform .18s;
}
.tab svg { width: 19px; height: 19px; flex: 0 0 auto; fill: currentColor; }
.tab:hover { background: var(--surface); color: var(--text); }
.tab:active { transform: scale(.98); }
.tab.active { background: var(--surface-2); color: var(--strength); }
.tab.active::after { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: currentColor; content: ""; }
.sidebar-foot { display: flex; align-items: flex-start; gap: 9px; margin-top: auto; padding: 12px; color: var(--muted); font-size: .7rem; line-height: 1.35; }
.sidebar-foot small { color: var(--faint); }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 4px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px rgba(117, 223, 154, .55); }
.mobile-head { display: none; }

.workspace { min-height: 100vh; margin-left: 232px; padding: 42px clamp(24px, 4vw, 58px) 64px; }
.view { display: none; width: min(1180px, 100%); margin: 0 auto; }
.view.active { display: block; animation: view-in .34s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; min-height: 62px; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-head .eyebrow { margin-bottom: 9px; }
.date-chip, .kbd-hint {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    padding: 7px 12px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 22px;
    box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-head .eyebrow { margin-bottom: 7px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }

.session-hero {
    min-height: 328px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--strength);
    color: #11150d;
    isolation: isolate;
}
.session-hero::before {
    position: absolute;
    width: 390px;
    height: 390px;
    right: -120px;
    top: -160px;
    z-index: -1;
    border: 1px solid rgba(17, 21, 13, .13);
    border-radius: 50%;
    box-shadow: 0 0 0 45px rgba(17, 21, 13, .035), 0 0 0 90px rgba(17, 21, 13, .025);
    content: "";
}
.session-hero .eyebrow { color: rgba(17, 21, 13, .58); }
.session-hero h2 { max-width: 560px; margin-top: 10px; font-size: clamp(1.7rem, 4vw, 3.1rem); }
.hero-meta { display: flex; align-items: center; gap: 17px; margin-top: 15px; color: rgba(17, 21, 13, .67); font-size: .78rem; font-weight: 700; }
.hero-meta span + span::before { margin-right: 17px; content: "•"; }
.hero-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero-exercises { display: flex; max-width: 66%; flex-wrap: wrap; gap: 6px; }
.hero-exercises span { max-width: 100%; border: 1px solid rgba(17, 21, 13, .17); border-radius: 999px; padding: 5px 9px; font-size: .67rem; font-weight: 750; overflow-wrap: anywhere; }
.hero-start { display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: #11150d; color: var(--strength); cursor: pointer; font-size: 1.4rem; transition: transform .2s var(--ease); }
.hero-start:hover { transform: translateX(3px) scale(1.04); }
.loading-panel::after { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.15) 50%, transparent 70%); animation: shimmer 1.4s infinite; content: ""; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.muscle-panel { min-height: 410px; }
.live-chip { display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: .62rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.live-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--strength); box-shadow: 0 0 9px rgba(200,244,93,.6); }
.muscle-map { position: relative; isolation: isolate; min-height: 300px; display: grid; place-items: center; margin: 8px auto 0; }
.muscle-map::before { position: absolute; inset: 12% 8% 8%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(200,244,93,.055), transparent 68%); content: ""; }
.muscle-map.run-map::before { background: radial-gradient(circle, rgba(255,128,102,.06), transparent 68%); }
.muscle-map.compact { min-height: 320px; }
.muscle-map svg { width: 100%; max-width: 430px; height: 315px; overflow: visible; }
.muscle-map.compact svg { max-width: 390px; height: 305px; }
.muscle-map .body-base { fill: #202622; stroke: #424b45; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.muscle-map .anatomy-guides path { fill: none; stroke: #4a534d; stroke-width: .75; opacity: .65; vector-effect: non-scaling-stroke; }
.muscle-map .map-caption text { fill: #79827c; font-size: 9px; font-weight: 850; letter-spacing: 2.2px; }
.muscle-map .map-caption line { stroke: #414944; stroke-width: 1; }
.muscle-map [data-muscle] { fill: #2b322e; stroke: #505a53; stroke-width: .8; opacity: .9; vector-effect: non-scaling-stroke; transition: fill .35s, stroke .35s, filter .35s, opacity .35s; }
.muscle-map [data-muscle].is-active { opacity: 1; }
.muscle-map [data-muscle].load-low { fill: #60713d; stroke: #829850; }
.muscle-map [data-muscle].load-medium { fill: #91ad49; stroke: #b7d866; filter: drop-shadow(0 0 2px rgba(200,244,93,.18)); }
.muscle-map [data-muscle].load-high { fill: var(--strength); stroke: #e4ff9e; filter: drop-shadow(0 0 6px rgba(200,244,93,.4)); animation: muscle-pulse 2.8s var(--ease) infinite; }
.muscle-map.run-map [data-muscle].load-low { fill: #835247; stroke: #a66a5e; }
.muscle-map.run-map [data-muscle].load-medium { fill: #c76956; stroke: #ef8b77; filter: drop-shadow(0 0 2px rgba(255,128,102,.2)); }
.muscle-map.run-map [data-muscle].load-high { fill: var(--run); stroke: #ffc0b3; filter: drop-shadow(0 0 6px rgba(255,128,102,.42)); }
.muscle-map .map-key circle { fill: var(--strength); }
.muscle-map.run-map .map-key circle { fill: var(--run); }
.muscle-map .map-key circle.secondary { fill: #73864a; }
.muscle-map.run-map .map-key circle.secondary { fill: #9a5e51; }
.muscle-map .map-key text { fill: #747d77; font-size: 7px; font-weight: 800; letter-spacing: 1px; }
@keyframes muscle-pulse { 50% { filter: drop-shadow(0 0 10px rgba(200,244,93,.55)); } }
.muscle-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.muscle-legend span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); padding: 4px 8px; color: var(--muted); font-size: .63rem; text-transform: capitalize; }
.muscle-legend span i { width: 5px; height: 5px; border-radius: 50%; background: #73864a; }
.muscle-legend span.primary { border-color: rgba(200,244,93,.24); color: var(--text); }
.muscle-legend span.primary i { background: var(--strength); box-shadow: 0 0 7px rgba(200,244,93,.45); }
.run-map + .muscle-legend span.primary i, .run-layout .muscle-legend span.primary i { background: var(--run); }

.metric-inline { color: var(--strength); font-family: "SFMono-Regular", Consolas, monospace; font-size: .78rem; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 23px; }
.week-day { display: flex; min-height: 94px; flex-direction: column; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; background: #111512; padding: 11px 5px 9px; }
.week-day.today { border-color: #59634f; }
.week-day small { color: var(--faint); font-size: .59rem; font-weight: 800; letter-spacing: .08em; }
.week-day b { font-family: "SFMono-Regular", Consolas, monospace; font-size: .8rem; }
.day-marks { display: flex; min-height: 22px; align-items: flex-end; gap: 3px; }
.day-marks i { display: block; width: 5px; border-radius: 5px; background: var(--strength); }
.day-marks i.run { background: var(--run); }
.day-marks i.empty { width: 4px; height: 4px !important; background: var(--surface-3); }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; margin-top: 19px; border-radius: 12px; background: var(--line); }
.metric { min-height: 78px; background: #111512; padding: 12px; }
.metric b { display: block; font-family: "SFMono-Regular", Consolas, monospace; font-size: 1.25rem; letter-spacing: -.04em; }
.metric small { color: var(--faint); font-size: .6rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.activity-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 17px; }
.activity-mini { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #111512; padding: 12px; }
.activity-mini .activity-type { color: var(--strength); font-size: .58rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.activity-mini.run .activity-type { color: var(--run); }
.activity-mini strong { display: block; overflow: hidden; margin: 7px 0 3px; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.activity-mini small { color: var(--faint); font-size: .65rem; }
.text-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .72rem; }
.text-btn:hover { color: var(--strength); }

.btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 10px 16px;
    background: var(--surface-3);
    color: var(--text);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 800;
    transition: transform .16s, background .16s, opacity .16s, border-color .16s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--strength); color: #11150d; }
.btn.run { background: var(--run); color: #1b0c09; }
.btn.ghost { border-color: var(--line); background: transparent; }
.btn.danger { border-color: rgba(255,111,111,.3); background: rgba(255,111,111,.1); color: var(--danger); }
.btn.block { width: 100%; }
.btn.lg { min-height: 52px; font-size: .84rem; }
.btn:disabled { cursor: wait; opacity: .52; }
.icon-btn { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 1.15rem; }
.icon-btn:hover { color: var(--text); }

.seg { display: flex; gap: 3px; border: 1px solid var(--line); border-radius: 11px; background: #101411; padding: 3px; }
.seg button { flex: 1; border: 0; border-radius: 8px; background: transparent; padding: 8px 14px; color: var(--muted); cursor: pointer; font-size: .72rem; font-weight: 750; white-space: nowrap; }
.seg button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 5px 15px rgba(0,0,0,.18); }
.mode-seg button.active[data-v="run"], .mode-seg button.active[data-v="running"] { color: var(--run); }
.session-seg { margin: 21px 0 18px; }
.session-seg button { min-height: 44px; }

.train-setup, .timer-layout, .run-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr); gap: 16px; }
.setup-main { padding: 25px; }
.setup-aside, .timer-context, .run-aside { display: flex; flex-direction: column; }
.setup-aside h2, .timer-context h2, .run-aside h2 { margin-top: 8px; }
.setup-aside p, .run-aside p { margin-top: auto; }
.preview { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.pv-group { border: 1px solid var(--line); border-radius: 12px; background: #101411; padding: 12px; }
.pv-head, .pv-ex { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pv-head { margin-bottom: 7px; }
.pv-badge { color: var(--strength); font-size: .61rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.pv-ex { padding: 4px 0; font-size: .76rem; }
.pv-ex .pv-name { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.pv-detail { flex: 0 0 auto; color: var(--faint); font-family: "SFMono-Regular", Consolas, monospace; font-size: .66rem; }
.pv-last { color: var(--strength); }
.mode-toggle { display: flex; gap: 4px; margin: 7px 0; }
.mode-toggle button { border: 1px solid var(--line); border-radius: 7px; background: transparent; padding: 4px 7px; color: var(--faint); cursor: pointer; font-size: .58rem; text-transform: uppercase; }
.mode-toggle button.active { border-color: rgba(200,244,93,.35); color: var(--strength); }
.pv-flow { color: var(--faint); font-size: .64rem; }

.timer-main { padding: 20px 28px 27px; }
.t-topbar { display: flex; align-items: center; justify-content: space-between; }
.t-elapsed { color: var(--faint); font-size: .63rem; font-weight: 800; letter-spacing: .08em; }
.t-elapsed b { margin-left: 5px; color: var(--text); font-size: .76rem; }
.progress { margin: 18px 0 10px; }
.progress-bar { height: 4px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.progress-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--strength); transition: width .4s var(--ease); }
.progress > small { display: block; margin-top: 6px; font-size: .62rem; }
.badge { display: inline-block; border: 1px solid rgba(200,244,93,.26); border-radius: 999px; background: rgba(200,244,93,.08); padding: 5px 10px; color: var(--strength); font-size: .58rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.badge.transition, .badge.rest { border-color: var(--line); background: var(--surface-2); color: var(--muted); }
.ring { position: relative; width: min(240px, 62vw); height: min(240px, 62vw); margin: 14px auto 11px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 8; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--strength); stroke-linecap: round; stroke-dasharray: 659.73; stroke-dashoffset: 659.73; transition: stroke-dashoffset .25s linear, stroke .25s; }
.ring-fg.work { stroke-dashoffset: 0 !important; opacity: .28; }
.ring-fg.rest { stroke: var(--muted); }
.ring-fg.transition { stroke: var(--run); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.ring-center .count { font-size: clamp(2.5rem, 7vw, 3.7rem); font-weight: 650; letter-spacing: -.08em; line-height: 1; }
.t-name { margin-top: 6px; font-size: clamp(1.15rem, 3vw, 1.55rem); }
.t-name.combined { font-size: 1.1rem; }
.t-detail { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.tag-chip { border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); padding: 4px 9px; color: var(--muted); font-size: .64rem; }
.ss-list { width: min(360px, 100%); }
.ss-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 6px 0; text-align: left; }
.ss-row .n { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--strength); color: #11150d; font-size: .6rem; font-weight: 900; }
.ss-row .nm { overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.ss-row .rp { color: var(--muted); font-size: .65rem; }
.t-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 19px; }
.round { display: flex; width: 52px; height: 52px; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); cursor: pointer; }
.round b { font-size: 1rem; }
.round small { color: var(--faint); font-size: .49rem; font-weight: 800; text-transform: uppercase; }
.round.main { width: 72px; height: 72px; border: 0; background: var(--strength); color: #11150d; box-shadow: 0 12px 32px rgba(200,244,93,.14); }
.round.main b { font-size: 1.45rem; }
.round.main small { color: rgba(17,21,13,.6); }
.timer-context .muscle-map { margin: 5px 0; }
.next-up { margin-top: auto; border: 1px solid var(--line); border-radius: 12px; background: #101411; padding: 12px; color: var(--muted); font-size: .72rem; }
.next-up .eyebrow { margin-bottom: 5px; color: var(--strength); }
.done-panel { max-width: 720px; margin: 60px auto 0; padding: 42px; text-align: center; }
.finish-mark { display: grid; width: 64px; height: 64px; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: var(--strength); color: #11150d; font-size: 1.7rem; }
.done-panel h1 { margin: 10px 0 25px; }
.done-panel .button-row { justify-content: center; margin-top: 22px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats-grid > div { border: 1px solid var(--line); border-radius: 12px; background: #101411; padding: 15px 9px; }
.stats-grid b { display: block; font-family: "SFMono-Regular", Consolas, monospace; font-size: 1.25rem; }
.stats-grid small { color: var(--faint); font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.log-layout { display: flex; flex-direction: column; gap: 14px; }
.log-toolbar { display: grid; grid-template-columns: 1fr auto minmax(220px, .5fr); align-items: center; gap: 18px; }
.log-toolbar strong { display: block; margin-top: 5px; font-size: .9rem; }
.exercise-log-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ex-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 17px; content-visibility: auto; contain-intrinsic-size: auto 160px; }
.ex-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.ex-name { font-size: .86rem; font-weight: 750; }
.ex-meta { margin-top: 4px; color: var(--faint); font-size: .64rem; }
.ex-last { color: var(--strength); }
.ex-ss-tag { display: inline-block; margin-left: 6px; border-radius: 4px; background: var(--strength); padding: 1px 5px; color: #11150d; font-size: .55rem; }
.ex-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ex-in label { display: block; margin-bottom: 5px; color: var(--faint); font-size: .56rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stepper { display: grid; grid-template-columns: 34px 1fr 34px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #101411; }
.stepper button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.stepper button:hover { background: var(--surface-3); color: var(--text); }
.stepper input { min-width: 0; width: 100%; border: 0; background: transparent; padding: 8px 0; color: var(--text); text-align: center; }
.stepper input:focus { outline: 0; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; }
.ss-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ss-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .67rem; }
.ss-tag { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 6px; background: var(--strength); color: #11150d; font-weight: 900; }
.note-save { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }

.input { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #101411; padding: 10px 12px; color: var(--text); font-size: .78rem; transition: border-color .16s; }
.input:focus { border-color: #59634f; outline: 0; }
.input.tight { width: auto; min-height: 40px; }
.input.center { text-align: center; }
textarea.input { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--muted); font-size: .61rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 22px 0 17px; }
.input-unit { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #101411; }
.input-unit input { min-width: 0; flex: 1; border: 0; background: transparent; padding: 10px 12px; color: var(--text); }
.input-unit input:focus { outline: 0; }
.input-unit b { display: grid; place-items: center; border-left: 1px solid var(--line); padding: 0 11px; color: var(--faint); font-size: .66rem; }
input[type="range"] { width: 100%; accent-color: var(--run); }
.run-form { padding: 25px; }
.run-form .btn { margin-top: 20px; }
.pace-preview { color: var(--run); font-size: 1.05rem; font-weight: 750; }

.filter-seg { width: max-content; margin-bottom: 15px; }
.history-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 15px; }
.stat { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 15px; }
.stat b { display: block; font-family: "SFMono-Regular", Consolas, monospace; font-size: 1.15rem; letter-spacing: -.04em; }
.stat small { color: var(--faint); font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.h-card { display: grid; grid-template-columns: 175px 1fr auto; align-items: start; gap: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 16px; content-visibility: auto; contain-intrinsic-size: auto 120px; }
.h-card::before { position: absolute; content: none; }
.h-day { font-size: .78rem; font-weight: 750; }
.h-sum { margin-top: 4px; color: var(--faint); font-size: .63rem; }
.h-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 18px; }
.h-row { display: flex; justify-content: space-between; gap: 9px; min-width: 0; font-size: .69rem; }
.h-name { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.h-val { flex: 0 0 auto; font-family: "SFMono-Regular", Consolas, monospace; }
.h-val .s { color: var(--strength); }
.h-notes { max-width: 190px; color: var(--faint); font-size: .66rem; font-style: italic; }
.h-card.run { border-color: rgba(255,128,102,.25); }
.run-summary { display: flex; align-items: center; gap: 22px; }
.run-summary b { color: var(--run); font-family: "SFMono-Regular", Consolas, monospace; }
.run-summary span { color: var(--muted); font-size: .7rem; }

.progress-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 15px; }
.progress-controls > .seg { flex: 0 0 auto; }
.pills { display: flex; min-width: 0; flex: 1; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: transparent; padding: 7px 11px; color: var(--muted); cursor: pointer; font-size: .66rem; }
.pill.active { border-color: var(--strength); background: rgba(200,244,93,.08); color: var(--strength); }
.chart-card { margin-bottom: 15px; }
.chart { display: block; width: 100%; height: 260px; margin-top: 12px; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 10px; }
.chart .line-a { fill: none; stroke: var(--strength); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .line-b { fill: none; stroke: var(--run); stroke-width: 1.8; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.chart .area-a { fill: rgba(200,244,93,.06); }
.chart .dot-a { fill: var(--strength); }
.chart-legend { display: flex; align-items: center; gap: 5px; color: var(--faint); font-size: .6rem; }
.chart-legend i { width: 14px; height: 2px; background: var(--strength); }
.chart-legend i.alt { margin-left: 8px; background: var(--run); }
.rows { display: flex; flex-direction: column; }
.rrow { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 9px; border-bottom: 1px solid var(--line); padding: 10px 2px; font-size: .7rem; }
.rrow:last-child { border-bottom: 0; }
.rrow .rvol { color: var(--run); text-align: right; }
.rrow .rsets { color: var(--strength); }
.pr { margin-left: 5px; border-radius: 5px; background: var(--strength); padding: 1px 4px; color: #11150d; font-size: .52rem; font-weight: 900; }

.program-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.program-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.program-card { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 17px; cursor: pointer; transition: border-color .18s, transform .18s, background .18s; }
.program-card:hover { transform: translateY(-2px); border-color: #48514b; background: var(--surface-2); }
.program-index { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--faint); font-family: "SFMono-Regular", Consolas, monospace; font-size: .65rem; }
.program-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.program-card h3 { margin-bottom: 6px; }
.program-prescription { margin-top: 14px; font-family: "SFMono-Regular", Consolas, monospace; font-size: .72rem; }
.program-prescription b { color: var(--strength); }
.program-muscles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.program-muscles span { border-radius: 999px; background: var(--surface-3); padding: 3px 7px; color: var(--muted); font-size: .57rem; text-transform: capitalize; }

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(4,6,5,.78); padding: 20px; backdrop-filter: blur(10px); animation: fade-in .2s; }
@keyframes fade-in { from { opacity: 0; } }
.modal-card { width: min(560px, 100%); max-height: min(760px, 92vh); overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 35px 100px rgba(0,0,0,.6); }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px; }
.modal-head { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); background: rgba(20,24,22,.96); backdrop-filter: blur(10px); }
.modal-head h2 { margin-top: 6px; }
.modal-body { padding: 22px; }
.modal-foot { position: sticky; bottom: 0; border-top: 1px solid var(--line); background: rgba(20,24,22,.96); }
.muscle-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.muscle-picker button { border: 1px solid var(--line); border-radius: 999px; background: transparent; padding: 6px 9px; color: var(--muted); cursor: pointer; font-size: .64rem; text-transform: capitalize; }
.muscle-picker button.active { border-color: var(--strength); background: rgba(200,244,93,.09); color: var(--strength); }

.loading, .empty { display: grid; min-height: 110px; place-items: center; border: 1px dashed var(--line); border-radius: 13px; color: var(--faint); font-size: .75rem; text-align: center; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; min-width: 240px; border: 1px solid var(--line); border-left: 3px solid var(--success); border-radius: 12px; background: var(--surface-2); padding: 12px 15px; box-shadow: 0 18px 55px rgba(0,0,0,.42); font-size: .75rem; animation: toast-in .3s var(--ease); }
.toast.error { border-left-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(7px); transition: .22s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 960px) {
    .sidebar { width: 88px; align-items: center; padding-inline: 12px; }
    .brand > span:last-child, .tab span, .sidebar-foot span { display: none; }
    .tabs { width: 100%; }
    .tab { justify-content: center; padding: 13px; }
    .tab.active::after { display: none; }
    .sidebar-foot { justify-content: center; }
    .workspace { margin-left: 88px; }
    .span-7, .span-5 { grid-column: span 12; }
    .muscle-panel { min-height: 310px; }
    .train-setup, .timer-layout, .run-layout { grid-template-columns: 1fr; }
    .setup-aside, .run-aside { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
    .setup-aside .muscle-map, .run-aside .muscle-map { grid-row: 1 / 4; grid-column: 2; }
    .timer-context { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
    .timer-context .muscle-map { grid-column: 2; grid-row: 1 / 4; }
    .timer-context .next-up { grid-column: 1; margin-top: 15px; }
    .h-card { grid-template-columns: 150px 1fr; }
    .h-notes { grid-column: 2; max-width: none; }
}

@media (max-width: 700px) {
    body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    .sidebar { inset: auto 0 0; width: 100%; height: calc(66px + env(safe-area-inset-bottom)); align-items: stretch; border-top: 1px solid var(--line); border-right: 0; padding: 5px 5px env(safe-area-inset-bottom); background: rgba(14,18,16,.96); backdrop-filter: blur(14px); }
    .sidebar > .brand, .sidebar-foot { display: none; }
    .tabs { width: 100%; height: 100%; flex-direction: row; gap: 1px; margin: 0; }
    .tab { min-width: 0; gap: 2px; flex-direction: column; padding: 6px 2px 4px; border-radius: 9px; font-size: .52rem; }
    .tab span { display: block; }
    .tab svg { width: 18px; height: 18px; }
    .mobile-head { display: flex; height: 58px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 16px; }
    .mobile-head .brand { gap: 8px; }
    .mobile-head .brand-mark { width: 29px; height: 29px; border-radius: 9px; font-size: .78rem; }
    .mobile-head .brand b { font-size: .72rem; }
    .mobile-head > span { font-size: .66rem; }
    .workspace { margin-left: 0; padding: 23px 14px 28px; }
    .page-head { min-height: 48px; align-items: flex-start; margin-bottom: 19px; }
    .page-head h1 { font-size: 1.78rem; }
    .date-chip, .kbd-hint { display: none; }
    .dashboard-grid { gap: 12px; }
    .panel { padding: 17px; border-radius: 15px; }
    .session-hero { min-height: 300px; }
    .hero-exercises { max-width: 80%; }
    .activity-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
    .activity-mini { min-width: 160px; scroll-snap-align: start; }
    .week-strip { gap: 4px; }
    .week-day { min-height: 82px; padding-inline: 2px; }
    .exercise-log-grid, .program-grid { grid-template-columns: 1fr; }
    .ss-group { grid-template-columns: 1fr; }
    .log-toolbar { grid-template-columns: 1fr auto; }
    .log-toolbar .seg { grid-column: 1 / -1; }
    .note-save { grid-template-columns: 1fr; }
    .note-save .btn { width: 100%; }
    .page-head .mode-seg { align-self: flex-start; }
    .page-head .mode-seg button { padding-inline: 9px; }
    .history-stats { grid-template-columns: repeat(2, 1fr); }
    .h-card { grid-template-columns: 1fr; gap: 13px; }
    .h-rows, .h-notes { grid-column: 1; }
    .run-summary { justify-content: space-between; }
    .progress-controls { align-items: stretch; flex-direction: column; }
    .pills { width: 100%; }
    .chart { height: 220px; }
    .rrow { grid-template-columns: 1.25fr 1fr 1fr; }
    .rrow > :last-child { display: none; }
    .program-head { align-items: flex-start; flex-direction: column; }
    .program-head .seg { width: 100%; }
    .setup-aside, .run-aside, .timer-context { display: flex; }
    .timer-context .muscle-map { order: 2; }
    .timer-context .muscle-legend { order: 3; }
    .timer-context .next-up { order: 4; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .done-panel { margin-top: 10px; padding: 28px 17px; }
    .done-panel .button-row { align-items: stretch; flex-direction: column-reverse; }
    .form-grid { grid-template-columns: 1fr; }
    .modal { align-items: flex-end; padding: 0; }
    .modal-card { max-height: 94vh; border-radius: 20px 20px 0 0; }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .toast { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); left: 14px; min-width: 0; }
}

@media (max-width: 390px) {
    .page-head { gap: 10px; }
    .page-head h1 { font-size: 1.55rem; }
    .session-hero h2 { font-size: 1.75rem; }
    .hero-meta { gap: 9px; }
    .hero-meta span + span::before { margin-right: 9px; }
    .filter-seg { width: 100%; }
    .filter-seg button { padding-inline: 7px; }
}

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