:root {
  color-scheme: dark;
  --bg: #090b0d;
  --surface: #111417;
  --surface-2: #171b1f;
  --line: #282e33;
  --muted: #8c969d;
  --text: #f4f7f8;
  --accent: #37d39a;
  --accent-dim: #163a2d;
  --blue: #73a7ff;
  font-family: "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); padding: env(safe-area-inset-top) 0 calc(112px + env(safe-area-inset-bottom)); }
button, input { font: inherit; }
button { color: inherit; }
.topbar, main { width: min(100%, 760px); margin-inline: auto; padding-inline: 18px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; padding-bottom: 18px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; letter-spacing: 0; }
h2 { font-size: 29px; line-height: 1.05; letter-spacing: 0; }
h3 { font-size: 20px; letter-spacing: 0; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 1.3px; margin-bottom: 6px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; font-weight: 800; font-size: 18px; }
.status-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 0; margin-bottom: 16px; }
.status-strip > div:first-child { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.status-strip strong { color: var(--text); }
.progress-track { height: 4px; border-radius: 4px; background: #22272b; overflow: hidden; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .3s ease; }
.day-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 12px; }
.day-tab { min-width: 0; height: 48px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 750; }
.day-tab.active { border-color: var(--accent); color: var(--text); background: var(--accent-dim); }
.day-hero { display: flex; justify-content: space-between; gap: 16px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.tags span { padding: 5px 7px; border: 1px solid #343b40; border-radius: 5px; color: #c1c8cc; font-size: 10px; font-weight: 750; }
.day-stats { text-align: right; white-space: nowrap; }
.day-stats strong { display: block; font-size: 18px; }
.day-stats span { color: var(--muted); font-size: 11px; }
.session-actions { min-height: 58px; display: flex; gap: 12px; align-items: center; margin: 14px 0 24px; }
.primary-button, .finish-button { border: 0; border-radius: 7px; font-weight: 800; }
.primary-button { height: 46px; padding: 0 20px; background: var(--accent); color: #07110d; }
.primary-button:disabled { background: #28322e; color: #7f8e87; }
.session-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 12px; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.exercise-list { display: grid; gap: 9px; }
.exercise { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 11px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.video-thumb { width: 48px; height: 48px; position: relative; border: 0; border-radius: 7px; overflow: hidden; background: #20262a; padding: 0; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; background: #0007; font-size: 13px; }
.exercise-main { min-width: 0; }
.exercise-title { font-weight: 780; font-size: 14px; overflow-wrap: anywhere; }
.exercise-note { color: var(--muted); font-size: 11px; line-height: 1.3; margin-top: 4px; }
.prescription { display: flex; gap: 9px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.set-dots { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.set-dot { width: 28px; height: 28px; border: 1px solid #3a4247; border-radius: 6px; background: var(--surface-2); color: #aeb6ba; font-size: 11px; font-weight: 800; }
.set-dot.done { background: var(--accent); color: #07110d; border-color: var(--accent); }
.log-inputs { display: grid; gap: 6px; width: 64px; }
.log-inputs input { width: 64px; height: 30px; border: 1px solid var(--line); background: #0c0f11; color: var(--text); border-radius: 5px; padding: 0 7px; font-size: 11px; }
.finish-button { width: 100%; height: 52px; margin-top: 16px; background: var(--text); color: #0a0c0e; }
.rest-timer { position: fixed; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); max-width: 520px; margin: auto; display: flex; align-items: center; justify-content: space-between; background: #eff5f2; color: #0c1612; padding: 12px 15px; border-radius: 8px; box-shadow: 0 12px 40px #0009; z-index: 30; }
.rest-timer span { display: block; font-size: 11px; color: #56625c; }
.rest-timer strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.rest-timer button { border: 0; background: #dce6e1; color: #14221b; border-radius: 6px; padding: 9px 13px; font-weight: 750; }
dialog { width: min(calc(100% - 24px), 680px); border: 1px solid var(--line); border-radius: 8px; background: #0d1012; color: var(--text); padding: 12px; }
dialog::backdrop { background: #000c; backdrop-filter: blur(5px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; min-height: 45px; }
.video-dialog video { display: block; width: 100%; max-height: 72vh; background: #000; border-radius: 6px; }
.guide-list { display: grid; gap: 9px; max-height: 70vh; overflow: auto; }
.guide-item { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 9px; }
.guide-item img { width: 72px; height: 48px; object-fit: cover; border-radius: 5px; }
.guide-item span { color: var(--muted); font-size: 12px; }
.toast { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: #eaf3ef; color: #111a16; padding: 10px 14px; border-radius: 7px; z-index: 50; font-size: 13px; font-weight: 700; }
.hidden { display: none !important; }
@media (max-width: 460px) {
  .topbar, main { padding-inline: 13px; }
  .day-hero { padding: 16px; }
  .exercise { grid-template-columns: 44px minmax(0, 1fr); }
  .video-thumb { width: 44px; height: 44px; }
  .log-inputs { grid-column: 2; grid-template-columns: 1fr 1fr; width: 100%; }
  .log-inputs input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
