:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #eef2ed;
  --ink: #202a26;
  --muted: #68746f;
  --line: #e2e7e2;
  --accent: #2f6b57;
  --accent-strong: #245342;
  --accent-soft: #e3efe8;
  --warm: #f3eee3;
  --shadow: 0 8px 28px rgba(34, 54, 45, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(47, 107, 87, 0.22); outline-offset: 2px; }
button { border: 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 7vw, 42px); line-height: 1.15; letter-spacing: -0.04em; }
h2 { margin-bottom: 0; font-size: 19px; line-height: 1.3; letter-spacing: -0.015em; }
h3 { font-size: 16px; }
p { margin-bottom: 0; }
svg { display: block; }
[hidden] { display: none !important; }
.icon { width: 21px; height: 21px; flex: 0 0 auto; }

.app-shell { min-height: 100vh; }
.main-content { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px 112px; }
.main-content.wide { max-width: 1280px; }
.mobile-demo-strip { margin: 0 -20px 24px; padding: 8px 20px; color: var(--accent-strong); background: var(--accent-soft); text-align: center; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.desktop-sidebar { display: none; }
.bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(16px); }
.nav-item { display: flex; min-height: 52px; padding: 5px; align-items: center; justify-content: center; flex-direction: column; gap: 3px; border-radius: 12px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 600; }
.nav-item.active { color: var(--accent); background: var(--accent-soft); }
.nav-item .icon { width: 22px; height: 22px; }

.page-header { display: flex; margin-bottom: 26px; align-items: flex-start; justify-content: space-between; gap: 16px; }
.eyebrow { margin-bottom: 8px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.page-subtitle { max-width: 520px; color: var(--muted); font-size: 14px; }
.date-chip, .quiet-tag { display: inline-flex; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 600; white-space: nowrap; }
.demo-badge { display: inline-flex; width: max-content; padding: 4px 8px; border-radius: 6px; color: var(--accent-strong); background: var(--accent-soft); font-size: 10px; font-weight: 800; letter-spacing: 0.05em; white-space: nowrap; }
.section-title { display: flex; margin-bottom: 14px; align-items: center; justify-content: space-between; gap: 12px; }
.section-title p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.section-title > span { color: var(--muted); font-size: 12px; }
.card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.muted, .footnote { color: var(--muted); }
.footnote { margin: 20px 0 0; text-align: center; font-size: 12px; }
.helper-text { margin-top: 10px; color: var(--muted); text-align: center; font-size: 12px; }
.helper-text.left { text-align: left; }

.primary-button, .secondary-button, .quiet-button { display: inline-flex; min-height: 50px; padding: 0 20px; align-items: center; justify-content: center; gap: 9px; border-radius: 13px; font-weight: 750; transition: background 160ms ease, transform 160ms ease; }
.primary-button { color: #fff; background: var(--accent); box-shadow: 0 5px 14px rgba(47, 107, 87, 0.18); }
.primary-button:hover { background: var(--accent-strong); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.secondary-button { border: 1px solid var(--line); color: var(--accent); background: var(--surface); }
.secondary-button:hover { background: var(--surface-soft); }
.quiet-button { color: var(--muted); background: transparent; }
.full-width { width: 100%; }
.text-button, .back-button { display: inline-flex; min-height: 44px; padding: 0; align-items: center; gap: 5px; color: var(--accent); background: transparent; font-size: 13px; font-weight: 700; }
.text-button .icon { width: 16px; height: 16px; }
.back-button { margin: -8px 0 18px; color: var(--muted); }
.icon-button { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 12px; color: var(--accent); background: var(--surface); }

.week-card { padding: 24px; border-radius: 22px; color: #f9fffb; background: var(--accent); box-shadow: 0 14px 30px rgba(36, 83, 66, 0.15); }
.week-card .eyebrow { color: #d6e9df; }
.week-card h2 strong { font-size: 50px; line-height: 1; letter-spacing: -0.06em; }
.week-card h2 span { margin-left: 5px; color: #d6e9df; font-size: 24px; font-weight: 500; }
.week-card .quiet-tag { border-color: rgba(255,255,255,.2); color: #e1eee7; background: rgba(255,255,255,.08); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.day-statuses { display: grid; margin: 24px 0 20px; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.day-statuses > span { display: flex; padding: 10px 12px; flex-direction: column; border: 1px solid rgba(255,255,255,.17); border-radius: 12px; color: #dbece3; font-size: 12px; }
.day-statuses b { color: #fff; font-size: 13px; }
.week-card .primary-button { color: var(--accent-strong); background: #fff; box-shadow: none; }
.week-card .helper-text { color: #d6e9df; }
.quick-section, .recent-section { margin-top: 30px; }
.quick-grid { display: grid; gap: 10px; }
.quick-card { display: flex; min-height: 78px; padding: 14px 16px; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 16px; text-align: left; background: var(--surface); }
.quick-card:hover { border-color: #bdcfc4; }
.quick-card > span:nth-child(2) { flex: 1; font-weight: 750; }
.quick-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.quick-card > .icon { width: 17px; color: var(--muted); }
.quick-icon { display: flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 12px; color: var(--accent); background: var(--accent-soft); }
.record-card { display: flex; padding: 17px 0; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.record-card > div { flex: 1; }
.record-card p { color: var(--muted); font-size: 12px; }
.record-card time { color: var(--muted); font-size: 12px; }

.day-choice-list { display: grid; gap: 14px; }
.day-choice { display: grid; min-height: 132px; padding: 20px; grid-template-columns: auto 1fr; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 20px; text-align: left; background: var(--surface); box-shadow: var(--shadow); }
.day-choice:hover { border-color: #a9c4b4; transform: translateY(-1px); }
.day-code { display: flex; width: 58px; height: 64px; align-items: center; justify-content: center; border-radius: 16px; color: var(--accent); background: var(--accent-soft); font-size: 22px; font-weight: 850; }
.day-choice-copy { display: flex; flex-direction: column; }
.day-choice-copy strong { font-size: 19px; }
.day-choice-copy small { margin: 3px 0 9px; color: var(--muted); }
.day-choice-copy > span { color: var(--muted); font-size: 11px; }
.available-label { display: none; color: var(--accent); font-size: 12px; font-weight: 700; }
.available-label .icon { display: inline; width: 16px; vertical-align: middle; }
.pool-notice { display: flex; margin: 0 0 24px; padding: 13px 15px; align-items: flex-start; gap: 8px; border: 1px solid #dbe7de; border-radius: 13px; color: var(--accent-strong); background: var(--accent-soft); font-size: 12px; }
.pool-notice .icon { width: 17px; height: 17px; margin-top: 1px; }
.exercise-group { margin-bottom: 27px; }
.exercise-list { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.exercise-row { display: flex; width: 100%; min-height: 83px; padding: 14px 16px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); text-align: left; background: var(--surface); }
.exercise-row:last-child { border-bottom: 0; }
.exercise-row:hover { background: #fafbf9; }
.exercise-glyph { display: flex; width: 40px; height: 40px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 12px; color: var(--accent); background: var(--surface-soft); }
.exercise-copy { display: flex; flex: 1; flex-direction: column; }
.exercise-copy strong { font-size: 16px; }
.exercise-copy small { color: var(--muted); font-size: 11px; }
.exercise-row > .icon { width: 17px; color: var(--muted); }
.recommendation { width: fit-content; margin-top: 6px; padding: 3px 7px; border-radius: 5px; color: var(--accent-strong); background: var(--accent-soft); font-size: 10px; }
.empty-slot { padding: 14px 16px; color: var(--muted); background: #fafbf9; font-size: 12px; font-style: italic; }

.standalone .main-content { max-width: 680px; padding-top: 18px; padding-bottom: 145px; }
.workout-header { display: flex; margin-bottom: 24px; align-items: center; justify-content: space-between; gap: 8px; }
.workout-header .back-button { margin: 0; }
.workout-header > span { color: var(--muted); font-size: 12px; }
.exercise-title-block { margin-bottom: 24px; }
.exercise-title-block h1 { font-size: 34px; }
.exercise-title-block > p:last-of-type { color: var(--muted); }
.target-line { display: flex; margin-top: 16px; padding: 12px 14px; align-items: center; justify-content: space-between; border-radius: 12px; background: var(--surface-soft); font-size: 12px; }
.target-line strong { color: var(--muted); font-weight: 650; }
.set-list { display: grid; gap: 9px; }
.set-row { display: grid; padding: 13px 12px; grid-template-columns: minmax(64px, 1fr) minmax(0, .8fr) minmax(0, .6fr) 20px; align-items: end; gap: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.set-row.is-done { border-color: #d4e4d9; background: #fbfdfb; }
.set-number { min-width: 0; align-self: center; }
.set-number span { display: block; font-weight: 750; }
.set-number small { color: var(--muted); font-size: 10px; }
.set-row label { min-width: 0; color: var(--muted); font-size: 10px; }
.set-row input { width: 100%; min-width: 0; height: 40px; margin-top: 3px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-size: 18px; font-weight: 750; }
.input-with-unit { position: relative; display: block; }
.input-with-unit > span { position: absolute; right: 7px; bottom: 10px; color: var(--muted); font-size: 10px; }
.input-with-unit input { padding-right: 25px; }
.set-check { display: flex; height: 40px; align-items: center; color: var(--accent); }
.set-check .icon { width: 18px; }
.sets-section .secondary-button { margin-top: 12px; }
.workout-actions { position: fixed; z-index: 12; right: 0; bottom: 0; left: 0; display: flex; padding: 12px 20px max(12px, env(safe-area-inset-bottom)); gap: 8px; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(14px); }
.workout-actions .primary-button { flex: 1; }
.workout-footnote { margin-top: 18px; color: var(--muted); text-align: center; font-size: 11px; }
.rest-card { position: sticky; z-index: 10; bottom: 88px; margin-top: 20px; padding: 16px; border: 1px solid #cddfd3; border-radius: 17px; background: #f5faf6; box-shadow: 0 12px 35px rgba(34,54,45,.15); }
.rest-time { display: flex; align-items: center; justify-content: space-between; }
.rest-time > span { display: flex; align-items: center; gap: 7px; color: var(--accent-strong); font-size: 12px; font-weight: 700; }
.rest-time strong { color: var(--accent-strong); font-size: 32px; font-variant-numeric: tabular-nums; line-height: 1; }
.rest-controls { display: grid; margin-top: 14px; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rest-controls button { display: flex; min-height: 42px; padding: 0 7px; align-items: center; justify-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 9px; color: var(--accent-strong); background: #fff; font-size: 11px; font-weight: 700; }
.rest-controls .icon { width: 14px; height: 14px; }
.static-timer-card { display: flex; padding: 34px 22px; align-items: center; flex-direction: column; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.static-timer-card > strong { margin: 18px 0 4px; color: var(--accent-strong); font-size: 76px; line-height: 1; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.static-timer-card p { margin-bottom: 24px; color: var(--muted); font-size: 12px; }
.static-timer-card .primary-button { min-width: 180px; }
.compact-card { margin-top: 18px; }
.compact-card p { margin-top: 5px; color: var(--muted); font-size: 13px; }

.summary-hero { display: flex; margin-bottom: 20px; padding: 28px; align-items: center; flex-direction: column; border-radius: 20px; background: var(--accent-soft); text-align: center; }
.summary-check { display: flex; width: 48px; height: 48px; margin-bottom: 13px; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: var(--accent); }
.summary-hero p { margin-top: 5px; color: var(--muted); }
.summary-line { display: flex; padding: 13px 0; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.summary-sets { display: grid; margin: 12px 0 18px; gap: 8px; }
.summary-sets > span { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.summary-sets strong { color: var(--ink); }
.summaryPage .pool-notice { margin-top: 20px; }

.segmented-control { display: grid; margin-bottom: 20px; padding: 4px; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.segmented-control button { min-height: 42px; border-radius: 9px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 650; }
.segmented-control button.active { color: var(--accent-strong); background: var(--surface); box-shadow: 0 2px 8px rgba(34,54,45,.07); }
.form-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.form-grid { display: grid; gap: 18px; }
.form-grid label, .plan-exercise label { display: block; color: var(--muted); font-size: 12px; font-weight: 650; }
.form-grid input, .form-grid select, .progress-toolbar select, .filter-row select { width: 100%; height: 48px; margin-top: 6px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; }
.form-grid .toggle-line { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.toggle-line input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.draft-preview { display: flex; padding: 15px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-radius: 12px; background: var(--surface-soft); }
.draft-preview p { width: 100%; color: var(--muted); font-size: 12px; }
.field-unit { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

.plan-workspace { display: grid; gap: 18px; }
.plan-day-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan-day-tabs button { min-height: 66px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: var(--surface); }
.plan-day-tabs strong, .plan-day-tabs span { display: block; }
.plan-day-tabs strong { font-size: 17px; }
.plan-day-tabs span { font-size: 10px; }
.plan-day-tabs button.active { border-color: #a9c4b4; color: var(--accent-strong); background: var(--accent-soft); }
.plan-editor { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.plan-group { margin-top: 24px; }
.plan-group h3 { display: flex; margin-bottom: 9px; justify-content: space-between; }
.plan-group h3 span { color: var(--muted); font-size: 11px; font-weight: 500; }
.plan-exercise { display: grid; padding: 14px 0; grid-template-columns: 1fr 44px; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.plan-exercise > div small { display: block; color: var(--muted); font-size: 10px; }
.plan-exercise label { grid-column: 1 / 2; }
.plan-exercise input, .plan-exercise select { width: 100%; height: 42px; margin-top: 4px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.plan-exercise > .icon-button { grid-column: 2; grid-row: 1 / 3; }
.plan-aside { padding: 18px; border-radius: 16px; background: var(--surface-soft); }
.plan-aside h3 { margin-bottom: 10px; }
.plan-aside p { margin-top: 8px; color: var(--muted); font-size: 12px; }
.desktop-action { display: none; }

.library-tools { margin-bottom: 20px; }
.search-box { display: flex; height: 52px; padding: 0 14px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.search-box .icon { color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; }
.filter-row { display: flex; margin-top: 10px; align-items: center; justify-content: space-between; gap: 10px; }
.filter-row select { width: auto; min-width: 140px; margin: 0; }
.filter-row > span { color: var(--muted); font-size: 11px; }
.library-groups { min-width: 0; }
.library-section { margin-bottom: 28px; }
.library-section .section-title { margin-bottom: 12px; }
.library-section .section-title h2 { font-size: 21px; }
.library-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.library-card { display: flex; min-width: 0; min-height: 188px; padding: 15px; align-items: flex-start; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; text-align: left; background: var(--surface); }
.library-card:hover { border-color: #a9c4b4; box-shadow: var(--shadow); }
.library-card-top { display: flex; width: 100%; margin-bottom: 14px; align-items: center; justify-content: space-between; gap: 6px; }
.library-card-top .quiet-tag { padding: 4px 6px; font-size: 9px; }
.library-card > strong { font-size: 15px; }
.library-card > small { overflow: hidden; width: 100%; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.library-meta { margin-top: 8px; color: var(--muted); font-size: 10px; }
.animation-status { margin-top: auto; padding-top: 12px; color: var(--muted); font-size: 10px; }
.library-aside { margin-top: 20px; padding: 18px; border-radius: 16px; background: var(--surface-soft); }
.library-aside h3 { margin-bottom: 8px; }
.library-aside p { color: var(--muted); font-size: 12px; }
.empty-state { padding: 40px 0; color: var(--muted); text-align: center; }
.animation-placeholder { display: flex; min-height: 280px; padding: 30px; align-items: center; justify-content: center; flex-direction: column; border: 1px dashed #bdcec2; border-radius: 18px; color: var(--muted); background: var(--surface-soft); text-align: center; }
.animation-placeholder > .icon { width: 44px; height: 44px; margin-bottom: 16px; color: var(--accent); }
.animation-placeholder h2 { color: var(--ink); }
.animation-placeholder p { max-width: 300px; margin-top: 8px; font-size: 12px; }
.detail-layout { display: grid; gap: 18px; }
.detail-copy h2 { margin-bottom: 16px; }
.detail-copy h3 { margin: 22px 0 8px; }
.detail-copy dl { margin: 0; }
.detail-copy dl > div { display: flex; padding: 10px 0; justify-content: space-between; border-bottom: 1px solid var(--line); }
.detail-copy dt { color: var(--muted); }
.detail-copy dd { margin: 0; font-weight: 650; }
.detail-copy ol { padding-left: 20px; color: var(--muted); }

.progress-toolbar { display: flex; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.progress-toolbar .segmented-control { flex: 1; min-width: 240px; margin: 0; }
.progress-toolbar select { width: auto; min-width: 125px; margin: 0; }
.progress-grid { display: grid; gap: 14px; }
.chart-card { min-width: 0; padding: 20px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.chart-card .section-title { padding: 0 6px; }
.line-chart { width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.chart-grid path { fill: none; stroke: #e9ede9; stroke-width: 1; }
.chart-labels { fill: #7a857f; font-size: 9px; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.chart-points circle { fill: #fff; stroke: var(--accent); stroke-width: 3; }
.chart-caption { margin: 8px 6px 0; color: var(--muted); font-size: 11px; }
.volume-row { display: grid; margin: 17px 0; grid-template-columns: 45px 1fr 43px; align-items: center; gap: 10px; font-size: 12px; }
.volume-row > div { height: 8px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.volume-row i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.volume-row strong { font-size: 11px; text-align: right; }
.weight-values { display: grid; margin: 28px 0; grid-template-columns: 1fr 1fr; gap: 15px; }
.weight-values > div { display: flex; flex-direction: column; }
.weight-values strong { color: var(--accent-strong); font-size: 37px; line-height: 1.2; letter-spacing: -0.04em; }
.weight-values span { color: var(--muted); font-size: 11px; }
.calendar-card { margin-top: 14px; padding: 20px 12px; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-week span { padding: 8px 0; color: var(--muted); font-size: 10px; text-align: center; }
.calendar-day { min-height: 66px; padding: 7px 3px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); font-size: 11px; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.today { background: var(--accent-soft); }
.calendar-day .event { display: block; overflow: hidden; margin-top: 4px; padding: 2px 3px; border-radius: 3px; color: var(--accent-strong); background: var(--accent-soft); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.calendar-day .event.cardio { background: var(--warm); }
.calendar-day .event.weight { color: var(--muted); background: var(--surface-soft); }

.toast { position: fixed; z-index: 100; right: 20px; bottom: 90px; left: 20px; max-width: 420px; margin: auto; padding: 13px 18px; border-radius: 12px; color: #fff; background: var(--ink); box-shadow: var(--shadow); text-align: center; font-size: 13px; opacity: 0; transform: translateY(15px); pointer-events: none; transition: 180ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (min-width: 560px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-card { min-height: 140px; align-items: flex-start; flex-direction: column; }
  .quick-card > .icon { display: none; }
  .available-label { display: block; grid-column: 2; }
  .day-choice { grid-template-columns: auto 1fr auto; }
  .available-label { grid-column: auto; }
  .library-grid { grid-template-columns: repeat(3, 1fr); }
  .plan-exercise { grid-template-columns: minmax(140px, 1fr) 110px 110px 44px; }
  .plan-exercise label { grid-column: auto; }
  .plan-exercise > .icon-button { grid-column: auto; grid-row: auto; }
  .progress-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .app-shell { display: grid; grid-template-columns: 236px 1fr; }
  .desktop-sidebar { position: fixed; top: 0; bottom: 0; display: flex; width: 236px; padding: 28px 18px; flex-direction: column; border-right: 1px solid var(--line); background: #fbfcfa; }
  .brand { display: flex; padding: 0 8px 28px; align-items: center; gap: 11px; text-align: left; background: transparent; font-weight: 800; }
  .brand-mark { display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; color: #fff; background: var(--accent); }
  .brand small { display: block; color: var(--muted); font-size: 9px; font-weight: 500; }
  .desktop-nav { display: grid; gap: 6px; }
  .desktop-nav .nav-item { min-height: 48px; padding: 0 14px; justify-content: flex-start; flex-direction: row; gap: 12px; font-size: 13px; }
  .sidebar-note { margin-top: auto; padding: 15px; border-radius: 12px; background: var(--surface-soft); }
  .sidebar-note p { margin-top: 8px; color: var(--muted); font-size: 11px; }
  .main-content { grid-column: 2; max-width: 920px; padding: 42px 48px 70px; }
  .main-content.wide { max-width: 1380px; }
  .mobile-demo-strip, .bottom-nav { display: none; }
  .page-header { margin-bottom: 34px; }
  .week-card { padding: 30px; }
  .quick-card { min-height: 130px; }
  .standalone { display: block; }
  .standalone .main-content { max-width: 760px; padding-top: 28px; }
  .workout-actions { right: 0; left: 0; max-width: 680px; margin: auto; border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; }
  .day-choice-list { grid-template-columns: repeat(3, 1fr); }
  .day-choice { display: flex; min-height: 240px; align-items: flex-start; flex-direction: column; }
  .available-label { margin-top: auto; }
  .desktop-action { display: inline-flex; }
  .mobile-save { display: none; }
  .plan-workspace { grid-template-columns: 150px minmax(450px, 1fr); align-items: start; }
  .plan-day-tabs { grid-template-columns: 1fr; }
  .plan-day-tabs button { text-align: left; }
  .plan-aside { grid-column: 2; }
  .library-layout { display: grid; grid-template-columns: minmax(0, 1fr) 210px; align-items: start; gap: 22px; }
  .library-grid { grid-template-columns: repeat(3, 1fr); }
  .library-aside { position: sticky; top: 30px; margin: 0; }
  .detail-layout { grid-template-columns: .9fr 1.1fr; }
  .calendar-day { min-height: 82px; padding: 8px; }
  .toast { bottom: 30px; }
}

@media (min-width: 1220px) {
  .app-shell { grid-template-columns: 252px 1fr; }
  .desktop-sidebar { width: 252px; }
  .plan-workspace { grid-template-columns: 150px minmax(500px, 1fr) 210px; }
  .plan-aside { grid-column: auto; }
  .library-grid { grid-template-columns: repeat(4, 1fr); }
  .calendar-card { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

:root {
  --bg: #0b100e;
  --surface: #141b18;
  --surface-soft: #1a2420;
  --ink: #edf4ef;
  --muted: #93a29a;
  --line: rgba(220, 239, 227, 0.11);
  --accent: #96ddb8;
  --accent-strong: #c8f4dc;
  --accent-soft: rgba(127, 211, 166, 0.12);
  --warm: rgba(220, 195, 142, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

::selection { color: #0b130f; background: #96ddb8; }
html { background: var(--bg); }
body {
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% -10%, rgba(74, 139, 108, 0.16), transparent 34rem),
    radial-gradient(circle at 95% 30%, rgba(61, 100, 84, 0.09), transparent 30rem),
    var(--bg);
}
.mobile-demo-strip { color: var(--accent-strong); background: rgba(126, 207, 164, 0.08); border-bottom: 1px solid var(--line); }
.bottom-nav { border-color: var(--line); background: rgba(15, 21, 18, 0.88); box-shadow: 0 -12px 35px rgba(0,0,0,.18); }
.nav-item.active { color: var(--accent-strong); background: var(--accent-soft); }
.date-chip, .quiet-tag { border-color: var(--line); background: rgba(255,255,255,.025); }
.card, .quick-card, .day-choice, .exercise-list, .plan-editor, .library-card, .chart-card, .form-card { box-shadow: var(--shadow); }
.week-card {
  border: 1px solid rgba(164, 224, 191, 0.2);
  background: linear-gradient(135deg, #25493a 0%, #1b342a 48%, #14251f 100%);
  box-shadow: 0 22px 55px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.07);
}
.week-card .primary-button { color: #10241a; background: #c8f4dc; box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.primary-button { color: #10241a; background: var(--accent); box-shadow: 0 8px 24px rgba(91, 177, 132, 0.15); }
.primary-button:hover { color: #0d1c14; background: #b4e9cd; }
.secondary-button, .icon-button { border-color: var(--line); background: var(--surface); }
.secondary-button:hover { background: var(--surface-soft); }
.quick-card:hover, .day-choice:hover, .library-card:hover { border-color: rgba(150, 221, 184, 0.32); background: #17201c; }
.exercise-row:hover { background: #19221e; }
.empty-slot { color: var(--muted); background: #111815; }
.pool-notice { border-color: rgba(150,221,184,.16); background: rgba(127,211,166,.08); }
.target-line { background: rgba(255,255,255,.035); }
.set-row { background: var(--surface); }
.set-row.is-done { border-color: rgba(150,221,184,.2); background: rgba(127,211,166,.055); }
.set-row input, .form-grid input, .form-grid select, .plan-exercise input, .plan-exercise select, .progress-toolbar select, .filter-row select { border-color: var(--line); color: var(--ink); background: #0f1613; }
.rest-card { border-color: rgba(150,221,184,.2); background: rgba(25, 38, 31, 0.96); box-shadow: 0 18px 45px rgba(0,0,0,.38); }
.rest-controls button { border-color: var(--line); color: var(--accent-strong); background: #111915; }
.workout-actions { border-color: var(--line); background: rgba(15,21,18,.92); box-shadow: 0 -14px 35px rgba(0,0,0,.2); }
.summary-check { color: #10241a; }
.draft-preview, .plan-aside, .library-aside { background: rgba(255,255,255,.03); }
.search-box { background: var(--surface); box-shadow: inset 0 1px 0 rgba(255,255,255,.02); }
.search-box input { color: var(--ink); }
.animation-placeholder { border-color: rgba(150,221,184,.22); background: rgba(255,255,255,.025); }
.chart-grid path { stroke: rgba(220,239,227,.09); }
.chart-labels { fill: var(--muted); }
.chart-points circle { fill: var(--surface); }
.segmented-control { border-color: var(--line); background: #0f1613; }
.segmented-control button.active { color: var(--accent-strong); background: #222e28; box-shadow: 0 3px 12px rgba(0,0,0,.22); }
.calendar-day.today { background: rgba(127,211,166,.09); }
.calendar-day .event.weight { background: rgba(255,255,255,.05); }
.toast { color: #10241a; background: #d9eee1; box-shadow: 0 14px 40px rgba(0,0,0,.35); }

.page-view { animation: module-slide-forward 300ms cubic-bezier(.22,.8,.28,1) both; transform-origin: center; }
.page-view.slide-back { animation-name: module-slide-back; }
@keyframes module-slide-forward {
  from { opacity: 0; transform: translate3d(28px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes module-slide-back {
  from { opacity: 0; transform: translate3d(-28px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (min-width: 900px) {
  .desktop-sidebar { border-color: var(--line); background: rgba(15,21,18,.82); backdrop-filter: blur(22px); }
  .brand-mark { color: #10241a; }
  .workout-actions { border-color: var(--line); background: rgba(20,27,24,.95); }
}

.auth-shell { max-width: 470px; margin: 7vh auto 0; padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.auth-shell > p:not(.eyebrow) { color: var(--muted); }
.auth-mark { display: flex; width: 52px; height: 52px; margin-bottom: 24px; align-items: center; justify-content: center; border-radius: 15px; color: #10241a; background: var(--accent); }
.auth-form { margin-top: 26px; }
.auth-form textarea { width: 100%; padding: 13px; resize: vertical; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #0f1613; font-family: ui-monospace, monospace; text-transform: uppercase; }
.auth-note { margin-top: 22px; font-size: 11px; }
.recovery-code { padding: 22px 16px; border: 1px solid rgba(150,221,184,.25); border-radius: 14px; color: var(--accent-strong); background: #0f1613; font-family: ui-monospace, monospace; font-size: 20px; font-weight: 750; line-height: 1.8; text-align: center; word-break: break-all; }
.security-status { display: flex; margin-bottom: 16px; align-items: center; justify-content: space-between; }
.security-status p, .security-form > p, .security-actions p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.security-form h2 { margin-bottom: 6px; }
.security-form .form-grid { margin-top: 20px; }
.security-actions { display: flex; margin-top: 16px; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.security-actions p { width: 100%; }
.mobile-demo-strip { display: flex; align-items: center; justify-content: center; gap: 12px; }
.mobile-demo-strip button { min-height: 30px; padding: 0 5px; color: var(--accent-strong); background: transparent; font-size: 11px; font-weight: 700; }

@media (max-width: 420px) {
  .auth-shell { margin-top: 3vh; padding: 24px 20px; }
  .recovery-code { font-size: 16px; }
}

.day-choice.completed { opacity: .62; cursor: default; }
.set-number select { max-width: 72px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 10px; }
.input-with-unit select { position: absolute; right: 5px; bottom: 6px; max-width: 38px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 10px; }
.input-with-unit input { padding-right: 39px; }

.record-card { width: 100%; text-align: left; background: transparent; }
.record-card > .icon { width: 17px; color: var(--muted); }
.history-edit-list { display: grid; gap: 14px; }
.history-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.history-fields label { color: var(--muted); font-size: 11px; }
.history-fields input, .history-fields select { width: 100%; height: 44px; margin-top: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #0f1613; }
.history-actions, .history-footer { display: flex; margin-top: 14px; flex-wrap: wrap; gap: 8px; }
.history-footer { justify-content: space-between; }
.danger-button { color: #f0a8a8; }

@media (prefers-reduced-motion: reduce) {
  .page-view { animation: none; }
}
