:root {
  color-scheme: dark;
  --background: #111614;
  --surface: #191f1c;
  --raised: #222b25;
  --line: #334139;
  --text: #f0f3eb;
  --muted: #a6b6aa;
  --lime: #d3f875;
  --lime-dark: #202b14;
  --amber: #f1cd91;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; background: var(--background); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, summary, select { cursor: pointer; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h2 { font-size: 1.18rem; letter-spacing: -.025em; }
small { font-size: .79rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.top { border-bottom: 1px solid var(--line); background: #141a16; }
.top-inner, .shell, .tabs-inner { width: min(100% - 32px, 1024px); margin-inline: auto; }
.top-inner { height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; flex-shrink: 0; font-size: 1.16rem; font-weight: 850; letter-spacing: -.055em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; margin-right: 9px; }
.brand span { color: var(--lime); }
.profile-picker { min-width: 0; }
.profile-picker select { width: auto; max-width: min(42vw, 190px); background: var(--raised); border-color: var(--line); font-weight: 650; }
.shell { padding: clamp(24px, 5vw, 47px) 0 calc(205px + env(safe-area-inset-bottom)); }
.page-heading { margin-bottom: 23px; }
.eyebrow { display: block; color: var(--lime); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin-top: 5px; font-size: clamp(2.35rem, 8vw, 4.65rem); line-height: 1.02; letter-spacing: -.065em; font-weight: 850; }
.lead, .muted, .previous { color: var(--muted); line-height: 1.5; }
.lead { margin-top: 9px; }
.calendar { margin-bottom: 12px; }
.week-nav { display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 5px; }
.week-nav > button { border: 0; padding: 0; background: var(--surface); color: var(--muted); border-radius: 9px; font-size: 1.6rem; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 55px; border: 1px solid var(--line); padding: 3px 0; background: var(--surface); color: var(--text); border-radius: 9px; }
.day span { font-size: .69rem; color: var(--muted); }
.day strong { font-size: .94rem; font-variant-numeric: tabular-nums; }
.day.current:not([aria-pressed="true"]) { border-color: #9ab75b; }
.day[aria-pressed="true"] { border-color: var(--lime); background: var(--lime); color: var(--lime-dark); }
.day[aria-pressed="true"] span { color: #355017; }
.mode { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.mode button, .rest-options button { min-height: 42px; padding: 5px 13px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; font-weight: 650; }
.mode button span { margin-right: 3px; }
.mode button[aria-pressed="true"], .rest-options button[aria-pressed="true"] { background: #303d2b; color: var(--lime); border-color: #4a603a; }
.today-grid, .content-grid, .side { display: grid; align-items: start; gap: 14px; }
.side { gap: 14px; }
.workout { min-width: 0; display: grid; gap: 8px; }
.workout-hero { position: relative; overflow: hidden; padding: 19px; border: 1px solid #465540; border-radius: 16px; background: linear-gradient(120deg, #293a26, #1d2820 65%, #273828); }
.workout-hero::before { content: ''; pointer-events: none; position: absolute; inset: 0 0 0 65%; background: repeating-linear-gradient(130deg, transparent 0 18px, #bdf2840d 18px 19px); mask-image: linear-gradient(to right, transparent, black); }
.workout-hero > * { position: relative; }
.workout-hero h2 { font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.05; letter-spacing: -.055em; margin: 6px 0 11px; }
.workout-hero p:not(.eyebrow) { margin-top: 8px; color: #d8e5d6; line-height: 1.4; }
.workout-hero button { margin-top: 13px; }
.workout-progress { display: flex; align-items: center; gap: 12px; color: #d8e5d6; font-size: .8rem; }
.workout-progress progress { flex: 1; min-width: 45px; appearance: none; height: 7px; border: 0; border-radius: 10px; background: #121b13; }
progress::-webkit-progress-bar { background: #121b13; border-radius: 10px; }
progress::-webkit-progress-value { background: var(--lime); border-radius: 10px; }
progress::-moz-progress-bar { background: var(--lime); border-radius: 10px; }
.exercise, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.panel { padding: 17px; }
.panel h2 { margin-bottom: 13px; }
.panel p.muted { margin-bottom: 12px; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.exercise summary, .routine summary { min-height: 74px; display: flex; align-items: center; gap: 10px; padding: 11px 13px; }
.exercise-label, .routine summary > span:first-child { flex: 1; min-width: 0; }
.exercise-label strong, .routine summary strong { display: block; line-height: 1.25; }
.exercise-label small { display: block; margin-top: 4px; color: var(--muted); }
.exercise-number { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 auto; border: 1px solid var(--line); color: var(--muted); background: var(--raised); border-radius: 8px; font-size: .71rem; font-variant-numeric: tabular-nums; }
.set-count { flex: 0 0 auto; font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--muted); background: var(--raised); padding: 5px 7px; border-radius: 6px; }
.set-count.complete { background: #303d2b; color: var(--lime); }
.chevron { width: 8px; height: 8px; margin: 0 3px 3px 0; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); flex-shrink: 0; }
details[open] > summary .chevron { transform: rotate(225deg); margin-top: 5px; }
.exercise-body { border-top: 1px solid var(--line); padding: 11px 13px 15px; }
.technique { padding: 8px 10px; background: #30291f; border-radius: 7px; color: var(--amber); font-size: .83rem; line-height: 1.4; }
.previous { margin: 7px 0 10px; font-size: .8rem; }
.previous strong { color: var(--text); }
.set-head, .set-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1fr) 44px; align-items: center; text-align: center; gap: 6px; }
.set-head { color: var(--muted); font-size: .72rem; margin-bottom: 5px; }
.set-row + .set-row { margin-top: 5px; }
.set-row input[type="number"] { text-align: center; }
.set-number { font-size: .85rem; color: var(--muted); }
.check-box { display: grid; place-items: center; width: 44px; height: 44px; position: relative; cursor: pointer; flex: 0 0 auto; }
.check-box input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.check-box span { width: 26px; height: 26px; border: 1px solid #627467; border-radius: 7px; color: transparent; display: grid; place-items: center; font-weight: 900; }
.check-box input:checked + span { background: var(--lime); border-color: var(--lime); color: var(--lime-dark); }
.check-box input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 3px; }
.routine { padding: 0; }
.routine summary { padding-inline: 16px; }
.routine summary .eyebrow { font-size: .64rem; margin-bottom: 5px; }
.routine-list { padding: 0 12px 9px; }
.routine-item { display: flex; gap: 5px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.routine-item > span:last-child { padding-top: 4px; }
.routine-item strong, .routine-item small { display: block; }
.routine-item small { color: var(--muted); margin-top: 3px; line-height: 1.4; }
.routine-item .routine-note { color: var(--amber); }
.field { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 600; min-width: 0; margin-bottom: 12px; }
input:not([type="checkbox"]), select, textarea { border: 1px solid var(--line); background: #121814; color: var(--text); min-width: 0; width: 100%; max-width: 100%; border-radius: 8px; min-height: 44px; padding: 8px 10px; font-size: 1rem; }
input::placeholder, textarea::placeholder { color: #8c9a8f; }
textarea { resize: vertical; }
.fields.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.button, .text-button { min-height: 44px; padding: 8px 13px; border-radius: 9px; border: 1px solid transparent; font-weight: 750; line-height: 1.2; }
.primary { background: var(--lime); color: var(--lime-dark); }
.secondary { color: var(--text); background: var(--raised); border-color: #495a4e; }
.text-button { background: transparent; padding-inline: 4px; color: var(--lime); }
.subdued { color: var(--muted); font-size: .8rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form-message { margin-top: 8px; color: var(--lime); font-size: .86rem; }
.form-message:empty { display: none; }
.stage-plan { padding: 11px; border-radius: 9px; color: var(--lime); background: var(--raised); line-height: 1.5; }
.stage-targets { margin-top: 9px; font-size: .85rem; }
.history { margin-top: 14px; }
.log-list { padding: 0; margin: 9px 0 0; list-style: none; overflow-wrap: anywhere; }
.log-list li { display: flex; gap: 10px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: 8px 0; }
.log-list small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.45; }
.log-note { white-space: pre-wrap; }
.trend { display: grid; gap: 8px; padding: 12px; background: #121814; border-radius: 9px; }
.trend small, .totals small { color: var(--muted); display: block; }
.trend strong, .totals strong { font-size: 1.45rem; color: var(--lime); }
.bars { display: flex; gap: 4px; height: 64px; align-items: flex-end; border-bottom: 1px solid #536044; }
.bars span { flex: 1; height: var(--height); min-height: 2px; border-radius: 4px 4px 0 0; background: #8cad50; }
.bars span:last-child { background: var(--lime); }
.chart-dates { display: flex; justify-content: space-between; color: var(--muted); font-size: .67rem; }
.totals { display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.totals + .trend, .totals + .muted { margin-top: 8px; }
.totals div { background: #121814; border-radius: 9px; padding: 8px; overflow-wrap: anywhere; }
.notice { padding: 10px; border: 1px solid var(--amber); color: var(--amber); border-radius: 8px; margin-bottom: 12px; }
.tabs { z-index: 3; position: fixed; bottom: 0; inset-inline: 0; padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); background: #171e19; border-top: 1px solid var(--line); }
.tabs-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 570px; }
.tabs a { display: grid; align-content: center; justify-items: center; min-height: 54px; gap: 1px; font-weight: 700; font-size: .7rem; color: var(--muted); border-radius: 8px; }
.tabs a span { font-size: 1.23rem; line-height: 1.15; }
.tabs a[aria-current="page"] { color: var(--lime); background: #283426; }
.timer { z-index: 4; position: fixed; bottom: calc(70px + env(safe-area-inset-bottom)); right: max(12px, calc((100% - 1024px) / 2)); width: min(100% - 24px, 320px); padding: 11px; border: 1px solid #749048; background: #222f20; box-shadow: 0 8px 24px #0008; border-radius: 13px; }
.timer-main { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.timer-main small { display: block; color: #dae9cf; }
.timer-main strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; color: var(--lime); }
.rest-options { display: flex; flex-wrap: wrap; gap: 5px; }
.rest-options button { border-color: var(--line); }
.timer .rest-options { margin-top: 5px; }

@media (min-width: 740px) {
  .today-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; }
  .content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-inner, .shell { width: min(100% - 64px, 1024px); }
  .week-nav { width: min(100%, 560px); grid-template-columns: 40px minmax(0, 1fr) 40px; }
  .exercise summary, .exercise-body { padding-inline: 17px; }
  .workout-hero, .panel:not(.routine) { padding: 21px; }
}
