/* Layout: one narrow column of exercise cards, like a training card clipped to a board; fixed tab bar at the bottom. */
:root {
  --bg: #e9ecef;          /* cool concrete */
  --surface: #f8f9fa;
  --ink: #15191e;
  --muted: #5b6570;
  --line: #cfd5db;
  --accent: #1d5fd1;      /* 20 kg plate blue */
  --accent-ink: #ffffff;
  --done: #1f8a4c;
  --done-bg: #e2f2e8;
  --warn: #b4401f;
  --warn-bg: #f8e4dc;
  --field: #ffffff;
  --font-display: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-data: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101317; --surface: #191d23; --ink: #e8ecf0; --muted: #96a1ad; --line: #2b323b;
    --accent: #5b95ff; --accent-ink: #0b1220; --done: #4cc782; --done-bg: #15281e;
    --warn: #ff8a65; --warn-bg: #2e1a14; --field: #0f1216; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101317; --surface: #191d23; --ink: #e8ecf0; --muted: #96a1ad; --line: #2b323b;
  --accent: #5b95ff; --accent-ink: #0b1220; --done: #4cc782; --done-bg: #15281e;
  --warn: #ff8a65; --warn-bg: #2e1a14; --field: #0f1216; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--font-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 560px; margin: 0 auto; padding-block: 12px 24px; display: flex; flex-direction: column; gap: 12px; }
main > section, main > header, main > details, main > p { margin: 0; }
h1, h2 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; line-height: 1.25; }
.ph { margin-top: 8px; }
.sh { margin-bottom: 4px; }
.eyebrow { margin: 0 0 4px; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.lede { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }
.lede.small { font-size: 0.92rem; }
.fine { font-size: 0.82rem; color: var(--muted); margin: 0; }
.lock::before { content: ""; display: inline-block; width: 0.7em; height: 0.8em; margin-right: 6px; border: 2px solid currentColor; border-radius: 2px; vertical-align: -1px; }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.callout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 0.92rem; margin: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 1rem var(--font-body); cursor: pointer; text-align: center; }
.btn.block { display: flex; width: 100%; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--warn); border-color: var(--warn); }
.btn.warn, .mini.warn { background: var(--warn); color: #fff; border-color: var(--warn); }
.btn:focus-visible, .chk:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, .tabs button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.btnrow .btn { flex: 1 1 auto; }
.mini { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 6px 10px; font: 600 0.8rem var(--font-body); cursor: pointer; }

/* welcome + setup */
.welcome { display: flex; flex-direction: column; gap: 14px; padding-top: 18vh; }
.welcome h1 { font-size: 2.1rem; }
.setup { display: flex; flex-direction: column; gap: 12px; }
.slist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.srow { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.srow + .srow { border-top: 1px solid var(--line); }
.sname { font-weight: 600; }
.calc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calc .lbl { font-size: 0.82rem; color: var(--muted); min-width: 4.6em; }
.calc .lbl + input + .lbl { min-width: 0; margin-left: 6px; }
.calc input { width: 5.2em; }
.unit, .u { color: var(--muted); font-size: 0.8rem; }
.tag { display: inline-block; font: 700 0.68rem var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); vertical-align: 2px; }
.tag.soft { background: transparent; color: var(--muted); border: 1px solid var(--line); text-transform: none; letter-spacing: 0; font-weight: 600; }

/* inputs */
input, select, textarea { font: 600 1.05rem var(--font-data); color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 44px; font-variant-numeric: tabular-nums; }
input::placeholder { color: var(--muted); opacity: 0.8; font-weight: 500; }
textarea { width: 100%; font: 1rem var(--font-body); resize: vertical; }

/* today */
.dayhead { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.deload { color: var(--warn); }
.switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.switch label { font-size: 0.82rem; color: var(--muted); }
.switch select { min-height: 36px; padding: 4px 8px; font: 600 0.9rem var(--font-body); max-width: 100%; }
.prog { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 10px; }
.prog i { display: block; height: 100%; width: 0; background: var(--done); transition: width 0.25s ease; }

.drawer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.drawer summary { padding: 12px 14px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.2rem; margin-left: 8px; }
.drawer[open] summary::after { content: "\2212"; }
.cnt { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.drawer ul, .finl { list-style: none; margin: 0; padding: 0 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.drawer li, .finl li { display: flex; flex-direction: column; font-size: 0.92rem; }
.drawer li span, .finl li span { color: var(--muted); font-size: 0.85rem; }
.finl { padding: 8px 0 0; }

.ex { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.ex.complete { border-color: var(--done); }
.ex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ex-head h2 { min-width: 0; }
.meta { margin: 0; color: var(--muted); font-size: 0.88rem; }
.prop { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pw { font: 700 2.2rem/1 var(--font-data); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pu { color: var(--muted); font-weight: 600; }
.why { color: var(--muted); font-size: 0.85rem; margin-left: 6px; }
.why.solo { margin: 2px 0 0; }
.plates { margin: 0; font: 600 0.8rem var(--font-data); color: var(--accent); font-variant-numeric: tabular-nums; }

.sets { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.set { display: grid; grid-template-columns: 1.4em minmax(0, 1fr) auto auto minmax(0, 0.8fr) auto 48px; align-items: center; gap: 6px; }
.set .n { color: var(--muted); font: 700 0.85rem var(--font-data); text-align: center; }
.set input { width: 100%; text-align: center; }
.set .x { color: var(--muted); }
.set .dist { grid-column: span 2; color: var(--muted); font-size: 0.85rem; }
.set.done input { background: var(--done-bg); border-color: transparent; }
.chk { width: 48px; height: 44px; border-radius: 10px; border: 2px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.chk svg { width: 22px; height: 22px; fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chk[aria-pressed="true"] { background: var(--done); border-color: var(--done); }
.chk[aria-pressed="true"] svg { stroke: #fff; }
.note { margin: 4px 0 0; font-size: 0.85rem; color: var(--muted); }
.last { margin: 2px 0 0; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.wrap-up { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.wrap-up label { font-weight: 600; font-size: 0.9rem; }
.count { margin: 0; color: var(--muted); font-size: 0.88rem; text-align: center; font-variant-numeric: tabular-nums; }

/* history */
.hist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-top: 10px; }
.hist header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hist ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hist li { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; }
.hist li span { min-width: 0; }
.hist li b { font: 600 0.9rem var(--font-data); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.empty { padding-top: 12vh; }

/* settings */
.settings { display: flex; flex-direction: column; gap: 20px; }
.group { display: flex; flex-direction: column; gap: 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; min-height: 44px; border: 0; background: transparent; color: var(--ink); font: 600 0.92rem var(--font-body); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }

/* tab bar, timer, toast */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 4px; background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px max(16px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.tabs button { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--muted); font: 600 0.72rem var(--font-body); padding: 6px 0; cursor: pointer; border-radius: 10px; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--accent); }
.timer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 25; display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 8px 8px 8px 18px; box-shadow: 0 6px 24px rgba(0,0,0,0.25); max-width: calc(100% - 32px); }
.timer .tl { font-size: 0.8rem; opacity: 0.8; }
.timer .tt { font: 700 1.3rem var(--font-data); font-variant-numeric: tabular-nums; min-width: 3.2em; }
.timer button { border: 0; border-radius: 999px; padding: 8px 12px; font: 600 0.85rem var(--font-body); background: var(--surface); color: var(--ink); cursor: pointer; }
.timer.up { background: var(--done); color: #fff; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 30; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 0.9rem; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,0.25); }
@media (prefers-reduced-motion: reduce) { .prog i { transition: none; } }
@media (max-width: 360px) { .set { grid-template-columns: 1.2em minmax(0,1fr) auto minmax(0,0.8fr) 44px; } .set .u { display: none; } .chk { width: 44px; } }
