:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #23272b;
  --muted: #6b7280;
  --accent: #2b6cb0;
  --accent-text: #ffffff;
  --ok: #2f855a;
  --warn: #b7791f;
  --line: #e2ded5;
  --done: #2b6cb0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --card: #1f2329;
    --text: #e8e6e1;
    --muted: #9aa0a8;
    --accent: #63a4e0;
    --accent-text: #10141a;
    --ok: #68b58c;
    --warn: #d9a441;
    --line: #32373f;
    --done: #63a4e0;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
#app { max-width: 560px; margin: 0 auto; padding: 16px; }

h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 20px 0 8px; }
a { color: var(--accent); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

button {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  padding: 12px 18px;
  cursor: pointer;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
button.big { width: 100%; padding: 16px; font-size: 1.1rem; }
button:disabled { opacity: 0.45; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > button { flex: 1; }

.exercise-text {
  font-size: 1.7rem;
  line-height: 1.35;
  font-weight: 600;
  margin: 12px 0;
}
.timer {
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  margin: 12px 0;
}
.mode-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 8px;
}

.progress { display: flex; gap: 4px; margin-bottom: 16px; }
.progress span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.progress span.done { background: var(--done); }

.calendar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.calendar div { aspect-ratio: 1; border-radius: 4px; background: var(--line); }
.calendar div.done { background: var(--done); }
.calendar div.today { outline: 2px solid var(--accent); outline-offset: 1px; }

.stages { display: inline-flex; gap: 3px; vertical-align: middle; }
.stages i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.stages i.on { background: var(--ok); }

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }

label.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  font-size: 1rem;
}
label.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }

textarea, input[type="text"] {
  font: inherit;
  width: 100%;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
textarea { min-height: 120px; }

.note-banner {
  border-left: 4px solid var(--warn);
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--card);
  border-radius: 0 10px 10px 0;
}
audio { width: 100%; margin-top: 10px; }
.nav-back { display: inline-block; margin-bottom: 10px; }
