:root {
  --bg: #0e0e0d;
  --bg-2: #151513;
  --card: #181816;
  --card-2: #1f1f1c;
  --line: #2a2a26;
  --line-2: #45453f;
  --text: #f4f1ea;
  --text-2: #c9c3b7;
  --text-3: #a9a397;
  --accent: #ff5a1f;
  --accent-2: #ff7a45;
  --accent-bg: #2a1a12;
  --accent-line: #5a2c16;
  --display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --nav-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; position: relative; }
.screen { flex: 1; padding: calc(20px + var(--safe-t)) 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.screen.has-nav { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px); }
.screen.has-footer { padding-bottom: calc(110px + var(--safe-b)); }

/* type */
.display { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .5px; line-height: 1.02; margin: 0; }
.h1 { font-size: 40px; }
.h2 { font-size: 32px; }
.h3 { font-size: 24px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-3); }
.eyebrow.accent { color: var(--accent-2); }
.mono { font-family: var(--mono); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.lead { font-size: 17px; line-height: 1.5; color: var(--text-2); margin: 0; }
.accent-text { color: var(--accent-2); }
p { margin: 0; }

/* layout */
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grow { flex: 1 1 0; min-width: 0; }
.spacer { flex: 1; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.card.tight { padding: 12px 14px; }
.card.accent { background: var(--accent); color: var(--bg); border: none; }
.card.accent .eyebrow { color: var(--bg); font-weight: 700; }
.card.soft { background: var(--accent-bg); border-color: var(--accent-line); }
.card.dashed { background: transparent; border: 1px dashed var(--line-2); }
a.card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.icon-tile { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-bg); display: flex; align-items: center; justify-content: center; flex: 0 0 44px; color: var(--accent-2); }
.stat-num { font-family: var(--display); font-size: 32px; line-height: 1.1; }

/* buttons */
.btn { min-height: 52px; border-radius: 12px; border: none; font-weight: 700; font-size: 17px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--bg); }
.btn.dark { background: var(--bg); color: var(--text); }
.btn.light { background: var(--text); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.btn.text { background: transparent; color: var(--text-3); min-height: 44px; font-weight: 600; font-size: 15px; }
.btn.danger { background: transparent; color: #ff8a8a; border: 1px solid #6a2f2f; }
.btn.block { width: 100%; }
.btn.lg { min-height: 60px; font-size: 19px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; background: transparent; border: none; color: var(--text); display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: 0 0 44px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 700; background: transparent; color: var(--text-2); border: 1px solid var(--line-2); display: inline-flex; align-items: center; }
.chip[aria-pressed="true"], .chip[aria-selected="true"], .chip.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.tag { font-size: 14px; font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; }
.badge { font-family: var(--mono); font-size: 11px; font-weight: 700; background: var(--accent); color: var(--bg); padding: 3px 7px; border-radius: 4px; }

.seg { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px; gap: 5px; }
.seg button { flex: 1; min-height: 44px; border: none; border-radius: 999px; background: transparent; color: var(--text-2); font-weight: 700; font-size: 16px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }

/* inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.input-wrap { display: flex; align-items: center; background: var(--card); border: 1px solid #3a3a35; border-radius: 10px; padding: 0 12px; height: 52px; gap: 8px; }
.input-wrap:focus-within { border-color: var(--accent-2); }
.input-wrap input { flex: 1; min-width: 0; background: transparent; border: none; font-size: 20px; font-weight: 700; outline: none; }
.input-wrap input::placeholder { color: #6f6a61; font-weight: 500; }
.input-wrap .unit { font-size: 14px; color: var(--text-3); }
.text-input { width: 100%; height: 52px; background: var(--card); border: 1px solid #3a3a35; border-radius: 10px; padding: 0 14px; font-size: 18px; }
.text-input:focus { border-color: var(--accent-2); outline: none; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; color: var(--text-2); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: 0 0 22px; }

/* progress */
.bar { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--accent); }
.steps span.now { background: #ff9a70; }

/* option cards (quiz) */
.option { width: 100%; min-height: 72px; border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; background: var(--card); border: 2px solid var(--line); text-align: left; }
.option[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent); }
.option .opt-label { font-weight: 700; font-size: 19px; display: block; }
.option .opt-desc { font-size: 14px; color: var(--text-2); display: block; margin-top: 3px; }
.option .dot { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid #5a5a52; }
.option.multi .dot { border-radius: 6px; }
.option[aria-pressed="true"] .dot { background: var(--accent); border-color: var(--accent); }

/* list rows */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #262622; }
.list-row:first-child { border-top: none; }
.num { font-family: var(--mono); font-size: 13px; color: var(--text-3); width: 18px; flex: 0 0 18px; }

.bullets { display: flex; flex-direction: column; gap: 8px; }
.bullets div { display: flex; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.bullets div::before { content: '·'; color: var(--accent-2); font-weight: 700; }

/* expandable */
.exp { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.exp > button { width: 100%; min-height: 60px; background: transparent; border: none; padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-align: left; }
.exp .exp-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.plus { font-family: var(--mono); font-size: 20px; color: var(--accent-2); }

/* week dots */
.week { display: flex; gap: 6px; }
.week > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.wdot { width: 36px; height: 36px; border-radius: 50%; background: var(--card-2); }
.wdot.done { background: var(--accent); }
.wdot.today { border: 3px solid var(--accent); background: transparent; }
.wdot.today.done { background: var(--accent); }
.wdot.planned { border: 2px dashed #5a5a52; background: transparent; }

.ready-chip { font-size: 14px; font-weight: 700; padding: 7px 12px; border-radius: 999px; background: var(--accent); color: var(--bg); border: 2px solid var(--accent); }
.ready-chip.rec { background: transparent; color: var(--text-2); border-color: #8a8a80; font-weight: 600; }

/* bottom nav */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: #121211f2; backdrop-filter: blur(8px); border-top: 1px solid #262622; display: flex; z-index: 20; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--text-3); font-size: 12px; font-weight: 600; }
.nav a[aria-current="page"] { color: var(--accent-2); font-weight: 700; }

/* sticky footer (workout / quiz) */
.footer-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; padding: 12px 20px calc(16px + var(--safe-b)); background: #0e0e0df2; backdrop-filter: blur(8px); border-top: 1px solid #262622; display: flex; gap: 10px; z-index: 20; }

/* workout */
.set-row { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--card); }
.set-row.done { background: var(--card-2); }
.set-row .set-n { font-family: var(--mono); font-size: 12px; color: var(--text-3); width: 38px; flex: 0 0 38px; }
.set-row .mini { display: flex; align-items: center; background: var(--bg); border: 1px solid #3a3a35; border-radius: 8px; height: 48px; padding: 0 8px; gap: 4px; flex: 1 1 0; min-width: 0; }
.set-row .mini:focus-within { border-color: var(--accent-2); }
.set-row .mini input { width: 100%; min-width: 0; background: transparent; border: none; font-size: 19px; font-weight: 700; outline: none; text-align: right; }
.set-row .mini span { font-size: 12px; color: var(--text-3); }
.set-row .x { color: var(--text-3); font-size: 14px; }
.set-check { width: 52px; height: 52px; border-radius: 10px; flex: 0 0 52px; display: flex; align-items: center; justify-content: center; background: transparent; color: #6a6a62; border: 2px solid var(--line-2); padding: 0; }
.set-row.done .set-check { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.rest { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border: 1px dashed #3a3a35; border-radius: 12px; min-height: 60px; }
.rest.on { border-style: solid; border-color: var(--accent-line); background: var(--accent-bg); }
.rest .clock { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--accent-2); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); transform: translateX(-50%); background: var(--text); color: var(--bg); font-weight: 700; padding: 12px 18px; border-radius: 10px; z-index: 50; font-size: 15px; max-width: calc(100% - 40px); text-align: center; box-shadow: 0 10px 30px #000a; }

/* overlay */
.overlay { position: fixed; inset: 0; background: #000000d0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sheet { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.pr-card { aspect-ratio: 4 / 5; background: var(--accent); color: var(--bg); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }

/* chart */
.chart { width: 100%; height: 110px; display: block; }

.logo { display: flex; align-items: center; gap: 10px; }
.logo span { font-family: var(--display); font-size: 22px; letter-spacing: 1px; }

.empty { padding: 32px 12px; text-align: center; color: var(--text-3); font-size: 16px; line-height: 1.5; }

@media (min-width: 520px) {
  #app { border-left: 1px solid #1c1c1a; border-right: 1px solid #1c1c1a; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* rest dock + alert */
.rest-dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + var(--safe-b)); width: calc(100% - 24px); max-width: 456px; background: #1b1411f5; backdrop-filter: blur(8px); border: 1px solid var(--accent-line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; z-index: 21; box-shadow: 0 -10px 30px #0008; }
.rest-big { font-family: var(--mono); font-size: 40px; font-weight: 700; color: var(--accent-2); line-height: 1; }
.rest-btn { min-height: 44px; font-size: 15px; padding: 0 10px; flex: 1; }
.rest-pop { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: calc(100% - 24px); max-width: 456px; background: var(--accent); color: var(--bg); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; box-shadow: 0 16px 40px #000c; animation: popin .25s ease-out; }
@keyframes popin { from { transform: translate(-50%, -20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.nav a { font-size: 11px; }
.nav a svg { width: 22px; height: 22px; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
