:root {
  --bg: #f6f7f9; --card: #fff; --text: #1b1f24; --muted: #667085; --border: #d0d5dd;
  --accent: #1f6feb; --danger: #d92d20;
  color-scheme: light dark;
  font-family: system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1117; --card: #161b22; --text: #e6edf3; --muted: #8b949e; --border: #30363d; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
header { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; }
nav { display: flex; gap: 4px; overflow-x: auto; }
nav button { background: none; color: var(--text); }
nav button.active { background: var(--accent); color: #fff; }
.logout { color: var(--muted); text-decoration: none; white-space: nowrap; font-size: 14px; }
main { max-width: 640px; margin: 0 auto; padding: 12px; }
button { font: inherit; padding: 10px 14px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
button:disabled { opacity: .5; }
button.danger { background: none; color: var(--danger); }
button.link { background: none; color: var(--muted); text-decoration: underline; }
button.big { width: 100%; padding: 16px; font-size: 20px; font-weight: 600; }
input, select, textarea { font: inherit; padding: 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); width: 100%; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px; }
.row-editor { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; }
.row-editor .wide, .row-editor button { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.list, .rows { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.list li { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list li > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; }
.rows li.editing { outline: 2px solid var(--accent); border-radius: 8px; }
.actions { display: flex; gap: 4px; flex-shrink: 0; }
small, .muted { color: var(--muted); }
.error { color: var(--danger); }
.workout { display: flex; flex-direction: column; gap: 8px; min-height: 100dvh; justify-content: center; text-align: center; }
.current { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px 12px; }
.current h1 { margin: 0 0 4px; font-size: clamp(20px, 6vw, 32px); }
.target { font-size: clamp(22px, 7vw, 40px); font-weight: 700; margin: 4px 0; color: var(--accent); }
progress { width: 100%; height: 10px; accent-color: var(--accent); }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; margin-bottom: 24px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
button.secondary { background: none; color: var(--accent); }
.list li.editing { border-color: var(--accent); }
.timer { margin-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.timer p { margin: 0; }
.clock { font-size: clamp(48px, 16vw, 72px); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.phase { font-size: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.phase.work { color: #12b76a; }
.phase.rest { color: #f79009; }
.log { display: flex; flex-direction: column; gap: 8px; }
.log .notes { margin: 0; white-space: pre-wrap; }
.log ol { margin: 0; padding-left: 20px; font-size: 14px; }
