:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #1c2421;
  --muted: #5f6b66;
  --line: #dde3e0;
  --accent: #0f766e;
  --accent-text: #ffffff;
  --green: #1f8a4c;
  --yellow: #b7791f;
  --red: #c53030;
  --alert-bg: #fdecec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111614;
    --card: #1a201e;
    --text: #e6ece9;
    --muted: #9aa7a1;
    --line: #2c3532;
    --accent: #2dd4bf;
    --accent-text: #062b27;
    --alert-bg: #3a1f1f;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; color: var(--text); text-decoration: none; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.card.narrow { max-width: 380px; margin: 40px auto; }
h1 { font-size: 1.4rem; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 16px 0 8px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.pre { white-space: pre-line; }
.explanation { background: var(--bg); border-radius: 8px; padding: 12px; }
.alert { background: var(--alert-bg); color: var(--red); border-radius: 8px; padding: 10px 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
label { display: block; }
input:not([type=radio]):not([type=checkbox]), textarea {
  width: 100%; padding: 10px; margin-top: 4px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text);
}
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; }
legend { font-weight: 600; padding: 0 4px; }
.choice { padding: 6px 0; }
.scale { display: flex; flex-wrap: wrap; gap: 6px 14px; }
button { font: inherit; cursor: pointer; border-radius: 8px; padding: 10px 14px; border: 1px solid transparent; }
button.primary { background: var(--accent); color: var(--accent-text); }
button.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
button.link { background: none; border: none; color: var(--accent); padding: 4px 0; text-decoration: underline; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 16px; margin: 0; }
.stats dt { color: var(--muted); font-size: 0.85rem; }
.stats dd { margin: 0; }
.weeks { list-style: none; padding: 0; margin: 12px 0 0; }
.weeks li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.activities { padding-left: 18px; }
.badge { display: inline-block; font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.chips .badge { margin: 0 4px 4px 0; }
.status-draft_ready, .status-awaiting_feedback { border-color: var(--accent); color: var(--accent); }
.status-failed { border-color: var(--red); color: var(--red); }
.status-published { border-color: var(--green); color: var(--green); }
.light-green { color: var(--green); }
.light-yellow { color: var(--yellow); }
.light-red { color: var(--red); }
.workout { border-top: 1px solid var(--line); padding-top: 4px; }
.workout ol { margin: 0 0 8px; padding-left: 20px; }
