/* Fizzy styles */

/* Always light: off-white page, white cards, Fizzyoga teal. */
:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --ink: #363b45;          /* logo wordmark slate */
  --muted: #6f7680;
  --line: #e6e8e6;
  --brand: #00adb5;        /* logo teal */
  --accent: #00838a;       /* darker teal, readable as text and on buttons */
  --accent-ink: #ffffff;
  --accent-soft: #e2f5f6;
  --done: #3f7d5c;
  --done-soft: #e3f0e8;
  --working: #b97a14;
  --working-soft: #fbefd9;
  --harder: #b5523a;
  --harder-soft: #fbe9e4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(54, 59, 69, 0.05), 0 4px 16px rgba(54, 59, 69, 0.05);
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }

button, input, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; border-radius: 12px; }
.brand h1 { transition: color 0.15s; }
.brand:hover h1 { color: var(--accent); }
.logo { display: block; width: 48px; height: 48px; }
.brand h1, .brand p { font-family: "Fira Mono", ui-monospace, Consolas, monospace; }
.brand h1 { font-size: 21px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.2; }
.brand p { color: var(--muted); font-size: 12px; letter-spacing: 0.12em; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
}
.tabs button[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

main { max-width: 1320px; margin: 0 auto; padding: 24px; }

/* ---------- Shared pieces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.col-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}
.num {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
}

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.meta { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); font-style: italic; }

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 8px;
}

.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Train: three columns ---------- */

.train {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr) minmax(280px, 370px);
  gap: 24px;
  align-items: start;
}

/* Column 1: program */

/* Each stage is a fold-out card: title and description always show, steps drop down. */
.cat {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cat.is-open { border-color: var(--accent); box-shadow: var(--shadow); }
.cat-heading { font-size: inherit; }
.cat-toggle {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
}
.cat-toggle:hover { background: var(--bg); }
.cat-text { display: grid; gap: 2px; min-width: 0; }
.cat-title { font-size: 16px; font-weight: 700; }
.cat-blurb { color: var(--muted); font-size: 13px; }
.cat-chevron {
  flex: none;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  margin: 2px 0 0 auto;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  transition: transform 0.2s;
}
.cat-chevron svg { width: 18px; height: 18px; display: block; }
.cat.is-open .cat-chevron { transform: rotate(180deg); background: var(--accent-soft); color: var(--accent); }

.stages { list-style: none; margin: 0; padding: 0 8px 10px; display: grid; gap: 4px; }

.stage {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
}
.stage:hover { background: var(--bg); border-color: var(--line); }
.stage.is-selected { background: var(--accent-soft); border-color: var(--accent); }
.stage-name { font-weight: 500; }

.dot {
  flex: none;
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid var(--line);
  color: var(--muted);
  background: var(--surface);
}
.dot-in-progress { border-color: var(--working); color: var(--working); background: var(--working-soft); }
.dot-achieved { border-color: var(--done); background: var(--done); color: var(--surface); }

/* Column 2: routine */

#routine h2 { font-size: 24px; letter-spacing: -0.01em; margin: 4px 0 10px; }

.goal {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
}

.routine-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 700;
  margin-bottom: 8px;
}
.count { font-size: 13px; color: var(--muted); font-weight: 600; }

.drills { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.drill {
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: background 0.15s, border-color 0.15s;
}
.drill:hover { border-color: var(--muted); }
.drill label {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  cursor: pointer;
}
.drill input {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 2px;
  accent-color: var(--done);
}
.drill.is-done { background: var(--done-soft); border-color: transparent; }

.drill-timer {
  display: inline-flex; align-items: center; gap: 6px;
  margin: -2px 14px 12px 46px;
  padding: 7px 14px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.drill-timer:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.drill.is-done .drill-name { text-decoration: line-through; text-decoration-color: var(--done); }

.drill-body { flex: 1; display: grid; gap: 2px; min-width: 0; }
.drill-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.drill-name { font-weight: 600; }
.dose {
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.cue { color: var(--muted); font-size: 14px; }

.alt {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.alt-tag {
  flex: none;
  min-width: 52px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 999px;
}
.alt-easier { background: var(--done-soft); color: var(--done); }
.alt-harder { background: var(--harder-soft); color: var(--harder); }

.time-guide {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}
.time-guide span { font-weight: 400; font-size: 13px; color: var(--muted); }

.intro { margin-bottom: 10px; }

.needs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 14px;
}
.needs-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-right: 4px;
}

.howto {
  margin: -6px 0 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}
.howto summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.howto ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }
.howto strong { color: var(--ink); }

.goal .ready {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--brand);
}
#progress-cards .ready { margin-bottom: 10px; }

.tip {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 14px;
}

.text-btn {
  border: 0; background: none; padding: 0;
  color: var(--muted); font-size: 13px; text-decoration: underline;
}

/* Column 3: progress cards + journal */

#progress-cards { display: grid; gap: 12px; margin-bottom: 12px; }
#progress-cards .card { padding: 16px 18px; }
#progress-cards h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.status-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.status-btn {
  flex: 1 1 auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.status-btn.is-active[data-status="not-started"] { background: var(--line); color: var(--ink); border-color: var(--line); }
.status-btn.is-active[data-status="in-progress"] { background: var(--working-soft); color: var(--working); border-color: var(--working); }
.status-btn.is-active[data-status="achieved"] { background: var(--done); color: var(--surface); border-color: var(--done); }

.next-link {
  display: grid; gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  background: transparent;
}
.next-link:hover { background: var(--accent-soft); }

.journal h3 { font-size: 16px; }
.journal .meta { margin-bottom: 12px; }
.journal label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.optional { font-weight: 400; color: var(--muted); }
.journal input, .journal textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-weight: 400;
  resize: vertical;
}
.journal input:focus, .journal textarea:focus { outline: none; border-color: var(--accent); }

.primary {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.primary:hover { filter: brightness(1.05); }
.hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 8px; }

/* ---------- My Progress page ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat .value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.stat .meta { font-weight: 600; }

.category-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.category-progress h3 { font-size: 16px; }
.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin: 10px 0 12px;
}
.bar span { display: block; height: 100%; background: var(--done); border-radius: inherit; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip-in-progress { background: var(--working-soft); color: var(--working); border-color: transparent; }
.chip-achieved { background: var(--done-soft); color: var(--done); border-color: transparent; }

.section-title { font-size: 18px; margin-bottom: 12px; }

.history { display: grid; gap: 12px; }
.entry-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 6px;
}
.entry-head h3 { font-size: 16px; }
.entry-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px 20px;
}
.delete-btn {
  flex: none;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}
.delete-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Restart progress ---------- */

.reset-card { margin-top: 32px; display: grid; gap: 8px; justify-items: start; }
.reset-card h3 { font-size: 16px; }
.reset-open {
  margin-top: 4px;
  padding: 10px 16px;
  border: 1px solid var(--harder);
  border-radius: 10px;
  background: var(--surface);
  color: var(--harder);
  font-weight: 700;
}
.reset-open:hover { background: var(--harder-soft); }

.reset-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 22px;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(54, 59, 69, 0.3);
}
.reset-dialog::backdrop { background: rgba(54, 59, 69, 0.45); }
.reset-dialog h2 { font-size: 20px; margin-bottom: 4px; }
.reset-option {
  display: flex; align-items: flex-start; gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.reset-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.reset-option input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.reset-option > span { display: grid; gap: 2px; }
.reset-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.reset-actions button { padding: 11px 16px; border-radius: 10px; font-weight: 700; }
.btn-secondary { border: 1px solid var(--line); background: var(--surface); }
.btn-danger { border: 0; background: var(--harder); color: #ffffff; }

/* ---------- Footer + toast ---------- */

.footer {
  max-width: 1320px;
  margin: 16px auto 0;
  padding: 16px 24px 110px; /* room for the floating timer button */
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 30;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Floating timer ---------- */
/* Its own look: see-through black (75%) with red, so it stands out over the light page. */

.timer-fab,
.timer-panel {
  --t-bg: rgba(0, 0, 0, 0.75);
  --t-text: #ffffff;
  --t-soft: rgba(255, 255, 255, 0.78);
  --t-line: rgba(255, 255, 255, 0.2);
  --t-fill: rgba(255, 255, 255, 0.08);
  --t-red: #ff3b30;        /* big numbers and progress bar */
  --t-red-light: #ff8a80;  /* small red text, easy to read on black */
  --t-red-deep: #d32f2f;   /* Start button and selected mode */
  --t-amber: #ffb340;      /* get-ready countdown */
  color-scheme: dark;
  color: var(--t-text);
  background: var(--t-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.timer-fab:focus-visible,
.timer-panel :focus-visible { outline-color: var(--t-red-light); }

.timer-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px;
  border: 1px solid var(--t-line);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.timer-fab-icon { font-size: 20px; line-height: 1; }
.timer-fab.is-live { color: var(--t-red-light); border-color: var(--t-red); }

.timer-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  width: min(360px, calc(100vw - 24px));
  padding: 16px 18px 18px;
  border: 1px solid var(--t-line);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.timer-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.timer-modes {
  display: flex; gap: 2px;
  padding: 3px;
  background: var(--t-fill);
  border: 1px solid var(--t-line);
  border-radius: 999px;
}
.timer-modes button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--t-soft);
}
.timer-modes button[aria-pressed="true"] { background: var(--t-red-deep); color: #ffffff; }
.timer-modes button:disabled { cursor: default; opacity: 0.6; }
.timer-close {
  flex: none;
  width: 36px; height: 36px;
  border: 1px solid var(--t-line);
  border-radius: 50%;
  background: var(--t-fill);
  color: var(--t-text);
}

.timer-drill { text-align: center; font-size: 14px; font-weight: 700; color: var(--t-red-light); }
.timer-phase { text-align: center; color: var(--t-soft); font-size: 14px; font-weight: 600; min-height: 1.5em; }

.timer-face { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 8px; }
.timer-display {
  min-width: 4.2ch;
  text-align: center;
  font-size: 64px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--t-red);
}
.timer-panel[data-phase="ready"] .timer-display { color: var(--t-amber); }
.timer-panel[data-phase="paused"] .timer-display { color: var(--t-soft); }
.timer-panel[data-phase="done"] .timer-display { color: var(--t-text); }
.timer-adjust {
  flex: none;
  width: 48px; height: 48px;
  border: 1px solid var(--t-line);
  border-radius: 50%;
  background: var(--t-fill);
  color: var(--t-text);
  font-size: 13px;
  font-weight: 700;
}
.timer-panel[data-mode="stopwatch"] .timer-adjust { visibility: hidden; }

.timer-bar { height: 6px; margin-bottom: 14px; border-radius: 999px; background: var(--t-line); overflow: hidden; }
.timer-bar span { display: block; width: 0; height: 100%; background: var(--t-red); transition: width 0.1s linear; }

.timer-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 14px; }
.timer-panel[data-mode="stopwatch"] .timer-presets { display: none; }
.timer-presets button {
  padding: 7px 13px;
  border: 1px solid var(--t-line);
  border-radius: 999px;
  background: var(--t-fill);
  font-size: 13px;
  font-weight: 600;
  color: var(--t-soft);
}
.timer-presets button.is-active { border-color: var(--t-red); background: rgba(255, 59, 48, 0.2); color: var(--t-red-light); }
.timer-presets button:disabled { cursor: default; opacity: 0.45; }

.timer-controls { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.timer-main {
  padding: 15px;
  border: 0;
  border-radius: 12px;
  background: var(--t-red-deep);
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
}
.timer-main:hover { background: #e53935; }
.timer-secondary {
  padding: 15px;
  border: 1px solid var(--t-line);
  border-radius: 12px;
  background: var(--t-fill);
  color: var(--t-text);
  font-weight: 600;
}
.timer-extra {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  border: 1px dashed var(--t-red-light);
  border-radius: 12px;
  background: rgba(255, 59, 48, 0.15);
  color: var(--t-red-light);
  font-weight: 700;
}

.timer-options { display: grid; gap: 6px; margin-top: 14px; font-size: 13px; color: var(--t-soft); }
.timer-options label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.timer-options input { width: 16px; height: 16px; accent-color: var(--t-red-deep); }

@media (max-width: 720px) {
  .timer-panel { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .timer-fab { right: 16px; bottom: 16px; }
  .timer-display { font-size: 56px; }
  /* Show messages at the top on phones so they don't cover the timer. */
  #toast { top: 16px; bottom: auto; transform: translate(-50%, -20px); }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 1080px) {
  .train { grid-template-columns: minmax(230px, 260px) minmax(0, 1fr); }
  .train > .col:last-child { grid-column: 1 / -1; }
  .train > .col:last-child #progress-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* ---------- Home ---------- */

.home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 1120px; margin: 0 auto; }
/* Let sideways-scrolling rows (stage chips, badges) scroll instead of stretching the page. */
.home > *,
.home-bottom > * { min-width: 0; }

/* The welcome banner */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  padding: 40px 44px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 85% 50%, rgba(0, 173, 181, 0.2), transparent 55%),
    linear-gradient(135deg, var(--accent-soft), var(--surface) 65%);
}
.home-hero h2 { margin: 8px 0 14px; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.08; letter-spacing: -0.02em; }
.home-hero p { max-width: 54ch; font-size: 17px; color: var(--muted); }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.home-hero-actions .primary { width: auto; padding: 13px 24px; font-size: 16px; }
.btn-ghost {
  display: inline-flex; align-items: center;
  padding: 12px 22px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.btn-ghost:hover { background: var(--accent-soft); }
.home-hero-art {
  display: grid; place-items: center;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 10px 40px rgba(0, 131, 138, 0.15);
}
.home-hero-art img { width: 130px; height: 130px; }

.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.home-continue h3 { font-size: 20px; margin: 4px 0; }
.home-overall { margin-top: 14px; }
.home-overall .bar { margin: 6px 0 0; }
.home-how h3 { font-size: 16px; }
.home-how ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 10px; color: var(--muted); }
.home-how strong { color: var(--ink); }
.home .section-title { margin: 12px 0 -6px; scroll-margin-top: 90px; }

@media (max-width: 720px) {
  .tabs button { padding: 8px 14px; }
  .home { gap: 16px; }
  .home-hero { grid-template-columns: 1fr; padding: 24px 20px; }
  .home-hero-art { display: none; }
  .home-hero h2 { font-size: 28px; }
  .home-hero p { font-size: 15px; }
  .home-hero-actions > * { flex: 1 1 100%; justify-content: center; }
}

/* ---------- Home: streak, journey map, milestones, celebrations ---------- */

/* Soft light streaks gliding across the hero */
.home-hero { position: relative; overflow: hidden; isolation: isolate; }
.home-hero > :not(.light) { position: relative; z-index: 1; }
.light {
  position: absolute;
  left: 0;
  z-index: 0;
  width: 180px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 173, 181, 0.55) 60%, rgba(255, 255, 255, 0.95));
  box-shadow: 0 0 10px rgba(0, 173, 181, 0.35);
  opacity: 0;
  animation: light-sweep 8s ease-in-out infinite;
}
.l1 { top: 38%; animation-duration: 7s; animation-delay: -1s; }
.l2 { top: 58%; width: 240px; animation-duration: 9s; animation-delay: -4s; }
.l3 { top: 78%; width: 140px; height: 3px; animation-duration: 8s; animation-delay: -6s; }
.l4 { top: 94%; animation-duration: 10s; animation-delay: -2.5s; }
.l5 { top: 66%; width: 120px; animation-duration: 11s; animation-delay: -8s; }
@keyframes light-sweep {
  0%   { transform: rotate(-12deg) translateX(-260px); opacity: 0; }
  15%  { opacity: 1; }
  75%  { opacity: 0.85; }
  100% { transform: rotate(-12deg) translateX(1400px); opacity: 0; }
}

/* Fizzy, the handstand buddy: his speech bubble and name tag */
.hero-intro { margin-bottom: 2px; }
.fizzy-says { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; }
.fizzy-avatar {
  flex: none;
  width: 42px; height: 42px;
  padding: 5px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(0, 131, 138, 0.18);
}
.home-hero .fizzy-bubble,
.progress-hero .fizzy-bubble,
.travel-hero .fizzy-bubble {
  max-width: 46ch;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 4px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
.home-hero-art { position: relative; }
.fizzy-tag {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-family: "Fira Mono", ui-monospace, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Streak and this week */
.home-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.streak,
.week {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  color: var(--muted);
}
.streak strong,
.week strong { color: var(--ink); }
.streak svg { width: 20px; height: 20px; color: #c5cad0; }
.streak.is-live { border-color: #fcd9b0; background: #fff7ed; color: var(--ink); }
.streak.is-live svg { color: #ea580c; fill: #fdba74; }
.week { gap: 10px; }
.week > span:first-child { white-space: nowrap; }
.week-dots { display: inline-flex; gap: 4px; }
.wd {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}
.wd.is-done { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.wd.is-today:not(.is-done) { border: 2px solid var(--accent); color: var(--accent); }
.wd.is-future { opacity: 0.5; }

/* Up next card with a progress ring */
.home-continue { border-top: 4px solid var(--stage); }
.home-continue .eyebrow { color: var(--stage-deep); }
.up-next { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; flex: none; width: 68px; height: 68px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: var(--stage-soft); }
.ring-fill { stroke: var(--stage); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.ring-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 800; }

/* Tip of the day */
.home-tip { display: flex; align-items: flex-start; gap: 14px; }
.home-tip p { margin-top: 4px; font-weight: 600; }

/* Journey and milestones sit side by side on wide screens */
.home-bottom { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 4px; }
.home-section .section-title { margin: 0 0 12px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-head .section-title { margin: 0; }

.journey-chips { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.journey-chip {
  flex: none;
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
}
.journey-chip small { font-weight: 600; color: var(--muted); }
.journey-chip.is-active { background: var(--stage-deep); border-color: var(--stage-deep); color: #ffffff; }
.journey-chip.is-active small { color: rgba(255, 255, 255, 0.85); }

.journey-card { border-top: 4px solid var(--stage); }
.journey-card > .eyebrow { color: var(--stage-deep); }
.journey-card h3 { font-size: 18px; margin: 2px 0 6px; }
.journey-map { position: relative; margin: 8px 0 4px; }
.journey-path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.journey-path path {
  fill: none;
  stroke: var(--stage);
  stroke-opacity: 0.45;
  stroke-width: 4;
  stroke-dasharray: 2 10;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.journey-steps { list-style: none; margin: 0; padding: 0; }
.jstep { position: absolute; transform: translateY(-50%); }
.jstep.label-right { margin-left: -28px; }
.jstep.label-left { margin-right: -28px; }
.jnode { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; text-align: left; }
.label-left .jnode { flex-direction: row-reverse; text-align: right; }
.jcircle {
  flex: none;
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 4px 0 rgba(54, 59, 69, 0.08);
  transition: transform 0.15s;
}
.jnode:hover .jcircle { transform: scale(1.06); }
.jcircle svg { width: 26px; height: 26px; stroke-width: 3; }
.jstep-in-progress .jcircle { border-color: var(--stage); background: var(--stage-soft); color: var(--stage-deep); }
.jstep-achieved .jcircle { border-color: var(--stage-deep); background: var(--stage-deep); color: #ffffff; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15); }
.is-here .jcircle {
  width: 68px; height: 68px;
  margin: -6px;
  border: 4px solid var(--stage);
  background: #ffffff;
  animation: here-pulse 2s ease-in-out infinite;
}
.is-here .jcircle img { width: 40px; height: 40px; }
@keyframes here-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--stage) 45%, transparent); }
  50%      { box-shadow: 0 0 0 12px color-mix(in srgb, var(--stage) 0%, transparent); }
}
.jlabel { display: grid; gap: 3px; max-width: 118px; }
.jname { font-size: 13px; font-weight: 700; line-height: 1.25; }
.jstep-not-started:not(.is-here) .jname { font-weight: 600; color: var(--muted); }
.jhere {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--stage-deep);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.label-left .jhere { justify-self: end; }

.journey-finish {
  display: flex; align-items: center; gap: 14px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--stage-soft);
}
.journey-finish > div { display: grid; gap: 1px; }
.journey-finish .eyebrow { color: var(--stage-deep); }

/* Badge medals */
.medal {
  position: relative;
  flex: none;
  display: grid; place-items: center;
  width: 60px; height: 60px;
  border-radius: 50%;
  color: #ffffff;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.45), transparent 45%),
    linear-gradient(145deg, var(--medal), var(--medal-deep));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--medal-deep) 35%, transparent), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.medal svg { width: 28px; height: 28px; }
.medal.is-locked { background: var(--line); color: #aab0b7; box-shadow: none; }
.medal-lock {
  position: absolute; right: -3px; bottom: -3px;
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
}
.medal-lock svg { width: 12px; height: 12px; }
.medal-lg { width: 104px; height: 104px; }
.medal-lg svg { width: 48px; height: 48px; }

.badges {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 108px;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.badge {
  display: grid; justify-items: center; align-content: start; gap: 6px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
  scroll-snap-align: start;
}
.badge-name { font-size: 13px; font-weight: 800; line-height: 1.2; }
.badge-how { font-size: 11px; line-height: 1.3; color: var(--muted); }
.badge:not(.is-earned) .badge-name { color: var(--muted); }
.badge.is-earned .badge-how { color: var(--done); font-weight: 700; }
@media (min-width: 980px) {
  .badges { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); overflow: visible; }
}

/* A burst of light streaks when you save a session, finish your drills or achieve a step */
.light-burst { position: fixed; inset: 0; z-index: 60; overflow: hidden; pointer-events: none; }
.light-burst span {
  position: absolute;
  bottom: -140px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(to top, transparent, var(--c) 50%, #ffffff);
  box-shadow: 0 0 12px var(--c);
  opacity: 0;
  animation: light-rise var(--d) cubic-bezier(0.15, 0.7, 0.3, 1) var(--delay) forwards;
}
@keyframes light-rise {
  0%   { transform: rotate(var(--angle)) translateY(0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: rotate(var(--angle)) translateY(calc(-100vh - 200px)); opacity: 0; }
}

/* Celebration pop-up */
.celebrate {
  width: min(380px, calc(100vw - 40px));
  padding: 28px 24px 22px;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 24px 70px rgba(54, 59, 69, 0.35);
}
.celebrate::backdrop { background: rgba(54, 59, 69, 0.5); }
.celebrate-badge { display: grid; place-items: center; margin-bottom: 14px; }
.celebrate h2 { font-size: 26px; margin: 4px 0 8px; }
.celebrate .primary { margin-top: 20px; }
.celebrate[open] .medal { animation: pop-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pop-in {
  from { transform: scale(0.3) rotate(-20deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

@media (max-width: 720px) {
  .home-stats > * { flex: 1 1 auto; justify-content: center; }
  .wd { width: 20px; height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .light { display: none; }
  .is-here .jcircle,
  .celebrate[open] .medal { animation: none; }
}

/* ---------- Phones: current-step bar and step picker ---------- */

.step-bar,
.picker-head { display: none; }

@media (max-width: 720px) {
  /* Flex instead of grid so the step bar can stay pinned while scrolling. */
  .train { display: flex; flex-direction: column; gap: 24px; }
  .col-title .num { display: none; }

  .step-bar {
    display: flex;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 15;
    margin: -16px -16px 0;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 12px rgba(54, 59, 69, 0.06);
  }
  .step-nav {
    flex: none;
    width: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    font-size: 24px;
    line-height: 1;
  }
  .step-nav:disabled { cursor: default; opacity: 0.35; }
  .step-current {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 1px;
    padding: 7px 12px;
    text-align: left;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: var(--accent-soft);
  }
  .step-current .eyebrow { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .step-current-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 700; }
  .step-current-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .step-picker { display: none; }
  .step-picker.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    overflow-y: auto;
    padding: 0 16px 32px;
    background: var(--bg);
  }
  .step-picker .col-title { display: none; }
  .picker-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 -16px 12px;
    padding: 14px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .picker-head h2 { font-size: 18px; }
  .picker-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--bg); }
  .stage { padding: 12px 10px; }
  body.picker-open { overflow: hidden; }

  /* Leave room for the pinned step bar when jumping to the routine. */
  #routine { scroll-margin-top: 84px; }

  /* Smaller round timer button; it still shows the time while running. */
  .timer-fab:not(.is-live) { width: 56px; height: 56px; padding: 0; justify-content: center; }
  .timer-fab:not(.is-live) #timer-fab-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
}

@media (max-width: 720px) {
  main { padding: 16px; }
  .topbar { padding: 12px 16px; position: static; }
  .card { padding: 16px; }
  #routine h2 { font-size: 21px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat:last-child { grid-column: 1 / -1; }
}

/* ---------- Notes shortcut (Train) ---------- */

.routine-head-right { display: inline-flex; align-items: center; gap: 10px; }
.notes-jump {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.notes-jump:hover { border-color: var(--accent); }
.notes-cta {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.notes-cta:hover { background: #d3eff1; }
#journal { scroll-margin-top: 96px; }
#journal h3:focus { outline: none; }

/* ---------- Your name ---------- */

.name-dialog {
  width: min(400px, calc(100vw - 40px));
  padding: 28px 24px 20px;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 24px 70px rgba(54, 59, 69, 0.35);
}
.name-dialog::backdrop { background: rgba(54, 59, 69, 0.5); }
.name-dialog .fizzy-avatar { display: block; width: 84px; height: 84px; margin: 0 auto 12px; padding: 12px; }
.name-dialog h2 { font-size: 24px; margin-bottom: 4px; }
.name-dialog input {
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 16px; /* 16px stops phones zooming in */
  text-align: center;
}
.name-dialog input:focus { outline: none; border-color: var(--accent); }
.name-actions { display: flex; flex-direction: row-reverse; gap: 8px; margin-top: 14px; }
.name-actions > * { flex: 1; }
.name-actions .btn-secondary { padding: 12px; border-radius: 12px; font-weight: 700; }

/* ---------- You & your data (My Progress) ---------- */

.data-title { margin-top: 32px; }
.data-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.data-grid .card { display: grid; gap: 8px; justify-items: start; }
.data-grid h3 { font-size: 16px; }
.data-grid .reset-card { margin-top: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.btn-outline {
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
}
.btn-outline:hover { background: var(--accent-soft); }

/* ---------- My Progress: summary, charts, stages, history ---------- */

.progress-page { --chart: #008f96; } /* chart marks: brand teal that stands out on white */
.progress-page .section-title { margin-top: 28px; }
.progress-page .section-head { margin-top: 28px; }
.progress-page .section-head .section-title { margin-top: 0; }

.progress-hero { display: grid; gap: 20px; }
.progress-hero-main { display: flex; align-items: center; gap: 28px; }
.progress-hero h2 { margin: 4px 0; font-size: 26px; letter-spacing: -0.01em; }
.big-ring { position: relative; flex: none; width: 132px; height: 132px; }
.big-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.big-ring circle { fill: none; stroke-width: 12; }
.big-ring .ring-track { stroke: var(--accent-soft); }
.big-ring .ring-fill { stroke: var(--chart); stroke-linecap: round; }
.big-ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.big-ring-text strong { font-size: 30px; font-weight: 700; line-height: 1.1; }
.big-ring-text span { font-size: 11px; color: var(--muted); }
.progress-hero .stats { margin: 0; }
.progress-hero .stat { padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.progress-hero .stat .value { font-size: 26px; }
.stat .value svg { width: 22px; height: 22px; margin-right: 4px; vertical-align: -2px; color: #ea580c; fill: #fdba74; }

.progress-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 16px; }
.chart-card h3 { font-size: 16px; }
.chart-sub { margin: 2px 0 12px; }
.chart-box { position: relative; min-height: 190px; }
.chart-box svg { display: block; overflow: visible; }
.chart-box .grid { stroke: var(--line); stroke-width: 1; }
.chart-box .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-box .tick.is-now { fill: var(--ink); font-weight: 700; }
.chart-box .goal-line { stroke: var(--ink); stroke-opacity: 0.5; stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-box .bar { fill: var(--chart); }
.chart-box .bar.is-hover { filter: brightness(1.15); }
.chart-box .value-label { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart-box .hit,
.chart-box .point-hit { fill: transparent; outline: none; }
.chart-box .hit:focus-visible { fill: rgba(0, 143, 150, 0.08); }
.chart-box .point-hit:focus-visible { fill: rgba(0, 143, 150, 0.15); }
.chart-box .line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .area { fill: var(--chart); opacity: 0.1; }
.chart-box .dot { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.chart-box .crosshair { stroke: var(--muted); stroke-width: 1; }
.chart-tip {
  position: absolute;
  z-index: 2;
  display: grid;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--ink);
  color: #ffffff;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.chart-tip .tip-value { font-size: 14px; font-weight: 700; }
.chart-tip .tip-label { color: rgba(255, 255, 255, 0.8); }
.chart-empty {
  display: grid; place-items: center;
  min-height: 170px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.chart-table table { width: 100%; margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart-table th,
.chart-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.chart-table th:last-child,
.chart-table td:last-child { text-align: right; }

.stage-card { border-top: 4px solid var(--stage); }
.stage-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.stage-card .eyebrow { color: var(--stage-deep); }

.entry { border-left: 4px solid var(--stage, var(--line)); }
.entry .eyebrow { color: var(--stage-deep, var(--accent)); }
.hold-chip {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .progress-hero-main { flex-direction: column; align-items: flex-start; gap: 16px; }
  .big-ring { width: 112px; height: 112px; }
  .progress-hero h2 { font-size: 22px; }
  .progress-charts { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Badge pill beside your name ---------- */

.hero-greeting { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.progress-hero .hero-greeting h2 { margin: 4px 0; }
.badge-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px;
  border: 1.5px solid #f3d27a;
  border-radius: 999px;
  background: #fff8e1;
  color: #6b4a0f;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(224, 179, 63, 0.25);
}
.badge-pill > span:first-child { font-size: 20px; line-height: 1; }
.badge-pill strong { color: var(--ink); font-size: 17px; }
.badge-pill[aria-expanded="true"] { border-color: #e0b33f; background: #fff3cc; }
.badge-pill:hover { border-color: #e0b33f; }
.new-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px; height: 14px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #f97316;
  animation: new-pulse 1.6s ease-in-out infinite;
}
@keyframes new-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
}
.badge { position: relative; }
.badge.is-new { border-color: #f97316; }
.badge-new {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 8px;
  border-radius: 999px;
  background: #c2410c;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badges { padding-top: 10px; }
.next-badge { margin: -6px 0 8px; }
#progress-badges-title { scroll-margin-top: 90px; }

/* The accomplishments card that opens from the badge pill */
.badge-pop {
  position: absolute;
  z-index: 45;
  width: min(340px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 16px 48px rgba(54, 59, 69, 0.22);
  animation: pop-fade 0.15s ease-out;
}
@keyframes pop-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.bp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bp-head strong { font-size: 15px; }
.bp-stats { margin: 6px 0 12px; color: var(--muted); font-size: 13px; }
.bp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 260px; overflow-y: auto; }
.bp-list li { display: flex; align-items: center; gap: 10px; }
.bp-list li > span { display: grid; gap: 1px; min-width: 0; }
.bp-list strong { font-size: 14px; }
.medal-sm { width: 38px; height: 38px; }
.medal-sm svg { width: 19px; height: 19px; }
.bp-new {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: #c2410c;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.bp-next { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.bp-next strong { color: var(--ink); }
.bp-all { width: 100%; margin-top: 10px; }
@media (max-width: 720px) {
  .badge-pill { padding: 6px 14px; font-size: 14px; }
  .badge-pill strong { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .badge-pop { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .new-dot { animation: none; }
}

/* ---------- Travel mode ---------- */

.top-actions { display: flex; align-items: center; gap: 10px; }
.travel-btn,
.rest-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}
.travel-btn:hover,
.rest-btn:hover { border-color: var(--accent); }
.rest-btn.is-resting { background: #efeaf8; border-color: #b9a6d9; color: #4c3d82; }
.travel-btn[aria-pressed="true"],
.rest-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #ffffff; }

.travel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 880px; margin: 0 auto; }
.travel-hero { background: linear-gradient(135deg, #e7f0fe, var(--surface) 70%); }
.travel-hero h2 { margin: 6px 0 8px; font-size: clamp(24px, 3.2vw, 32px); letter-spacing: -0.01em; }
.travel-hero > p { max-width: 60ch; color: var(--muted); }
/* minmax(0, 1fr) lets the sideways-scrolling session row scroll instead of widening the page. */
.travel-picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.travel-picker > * { min-width: 0; }
.travel-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.travel-sessions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.travel-rotate { margin: 0; }
/* position: relative keeps the hidden screen-reader text inside the row, so it can't widen the page on phones. */
.travel-session-list { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.travel-session {
  display: grid; align-content: start; justify-items: start; gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}
.travel-session:hover { border-color: var(--accent); }
.travel-session.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.ts-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; }
.ts-num { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.ts-next {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ts-name { font-size: 14px; font-weight: 700; line-height: 1.25; }

/* Intensity: five rising bars, filled for Gentle (1) to Intense (5) */
.intensity { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.int-bars { display: inline-flex; align-items: flex-end; gap: 2px; }
.int-bars i { display: block; width: 3px; border-radius: 1px; background: var(--line); }
.int-bars i:nth-child(1) { height: 4px; }
.int-bars i:nth-child(2) { height: 6px; }
.int-bars i:nth-child(3) { height: 8px; }
.int-bars i:nth-child(4) { height: 10px; }
.int-bars i:nth-child(5) { height: 12px; }
.intensity-1 .int-bars i:nth-child(-n+1),
.intensity-2 .int-bars i:nth-child(-n+2),
.intensity-3 .int-bars i:nth-child(-n+3),
.intensity-4 .int-bars i:nth-child(-n+4),
.intensity-5 .int-bars i { background: var(--accent); }
.ts-level {
  padding: 0 6px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* "Builds on" link from a travel session to its program step */
.builds-on {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  width: 100%;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.builds-on:hover { background: var(--accent-soft); }
.builds-on .meta { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.travel-option {
  display: grid; justify-items: start; gap: 2px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
}
.travel-option:hover { border-color: var(--accent); }
.travel-option.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.travel-emoji { font-size: 24px; line-height: 1.2; }
.travel-option-name { font-weight: 700; line-height: 1.25; }
.travel-routine h2 { margin: 4px 0 10px; font-size: 22px; }
.travel-finish { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.travel-finish label { font-size: 14px; font-weight: 600; }
.travel-finish textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-size: 16px;
  resize: vertical;
}
.travel-finish textarea:focus { outline: none; border-color: var(--accent); }
.entry-quick { border-left-color: var(--ink); }

/* ---------- Rest days ---------- */

.rest-hero { background: linear-gradient(135deg, #efeaf8, var(--surface) 70%); }
.rest-hero .eyebrow { color: #5b4b99; }
.rest-status h3 { font-size: 18px; }
.rest-now { margin: 4px 0; font-size: 20px; }
.rest-reasons { display: grid; gap: 8px; margin: 12px 0; }
.rest-reason {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.rest-reason:hover { border-color: #9d8fce; }
.rest-reason:has(input:checked) { border-color: #7c6bb0; background: #efeaf8; }
.rest-reason input { flex: none; width: 18px; height: 18px; accent-color: #6b5aa3; }
.rest-emoji { font-size: 24px; line-height: 1; }
.rest-reason > span:last-child { display: grid; gap: 1px; }
.rest-days { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 12px; }
.rest-days-label { font-weight: 600; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--bg); font-size: 20px; font-weight: 700; }
.stepper button:disabled { cursor: default; opacity: 0.35; }
.stepper output { min-width: 80px; text-align: center; font-weight: 700; }
.rest-advice {
  margin: 8px 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--working-soft);
  color: #6b4a0f;
  font-size: 14px;
}
.rest-status .btn-row { margin-top: 8px; }
.rest-status .btn-row .primary { width: auto; padding: 12px 22px; }
.rest-status .primary:disabled { cursor: default; opacity: 0.5; }
.rest-summary { margin-top: 14px; }
.rest-routine-note { margin-bottom: 12px; padding: 10px 14px; border-radius: 10px; background: #efeaf8; color: #3f3470; font-size: 14px; }
.comeback { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: #efeaf8; color: #3f3470; font-size: 14px; }
.wd.is-rest { background: #efeaf8; border: 1.5px dashed #9d8fce; color: #5b4b99; }

/* Narrow laptops and tablets: slimmer tabs so the header stays on one line. */
@media (min-width: 721px) and (max-width: 1100px) {
  .tabs button { padding: 8px 13px; }
}
@media (min-width: 721px) and (max-width: 900px) {
  .topbar { padding-left: 16px; padding-right: 16px; }
  .brand { gap: 10px; }
}
@media (max-width: 1100px) {
  /* Rest and Travel become small tiles on phones and narrow screens: emoji on top, label underneath. */
  .travel-btn .top-btn-text { max-width: 54px; white-space: normal; text-align: center; line-height: 1; } /* "Travel/ Vacay" on two lines */
  .top-actions { gap: 6px; }
  .travel-btn,
  .rest-btn {
    flex-direction: column; justify-content: center; gap: 1px;
    min-width: 58px; height: 50px; padding: 4px 6px;
    border-radius: 14px;
    font-size: 18px; line-height: 1.1;
  }
  .top-btn-text { font-size: 10.5px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
}
@media (min-width: 721px) and (max-width: 860px) {
  /* Small tablets: a little tighter again so the four tabs, Rest day and Travel share one line. */
  .tabs button { padding: 8px 9px; font-size: 14px; }
  .top-actions { gap: 5px; }
  .travel-btn,
  .rest-btn { min-width: 52px; }
}
@media (max-width: 360px) {
  /* Very small phones: tighter tiles so the header never pushes the page sideways. */
  .top-actions { gap: 4px; }
  .travel-btn,
  .rest-btn { min-width: 50px; padding: 4px; }
  .top-btn-text { font-size: 10px; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: nowrap; }
  /* Travel/Vacay on phones: three compact trip tiles, and the five sessions scroll sideways. */
  .travel-groups .travel-option { padding: 10px; }
  .travel-groups .meta { display: none; }
  .travel-option-name { font-size: 13px; }
  .travel-session-list {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
}

/* ---------- Home: your roadmap, with Ask your coach beside it ---------- */

.home-roadmap .section-title { margin: 0 0 12px; }
.home-roadmap-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.home-roadmap-grid > * { min-width: 0; }
@media (min-width: 900px) {
  /* Wide screens: the coach card sits beside the map and stays in view while you scroll. */
  .home-roadmap-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); }
  .home-coach { position: sticky; top: 100px; }
}

/* ---------- WhatsApp your coach ---------- */

.wa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  border: 0;
  border-radius: 12px;
  background: #0e7a3e; /* WhatsApp green, darkened so the white text is easy to read (5.4:1) */
  color: #ffffff;
  font-weight: 700;
}
.wa-btn:hover { background: #0b6a35; }
.wa-icon { flex: none; width: 18px; height: 18px; }

.coach-card { display: flex; align-items: flex-start; gap: 14px; }
.coach-icon {
  flex: none;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #e3f4ea;
  color: #0e7a3e;
}
.coach-icon .wa-icon { width: 22px; height: 22px; }
.coach-card .eyebrow { color: #0e7a3e; }
.coach-card p { margin: 4px 0 12px; font-weight: 600; }

.coach-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

.ask-coach-link {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid #b9e0c8;
  border-radius: 12px;
  background: #f1faf4;
  color: #0e7a3e;
  font-weight: 700;
}
.ask-coach-link:hover { border-color: #0e7a3e; }

.rest-coach {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.rest-coach-reason { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; cursor: pointer; }
.rest-coach-reason input { width: 18px; height: 18px; accent-color: #0e7a3e; }

@media (max-width: 720px) {
  .coach-card .wa-btn,
  .coach-share .wa-btn,
  .rest-coach .wa-btn { width: 100%; }
}

/* ---------- Install Fizzyoga on the home screen ---------- */

.install-card { display: flex; align-items: flex-start; gap: 14px; }
.install-icon { flex: none; width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 2px 10px rgba(54, 59, 69, 0.18); }
.install-card p { margin: 4px 0 10px; }
.install-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.install-btn { width: auto; padding: 10px 18px; }
.install-steps { display: grid; gap: 4px; margin: 0 0 10px; padding-left: 18px; color: var(--muted); font-size: 14px; }
.install-steps strong { color: var(--ink); }

/* ---------- Sideways rows: ‹ › arrows and edge fades when there's more to swipe ---------- */

.scroller { position: relative; }
.scroller::before,
.scroller::after {
  content: "";
  position: absolute; top: 0; bottom: 0; z-index: 1;
  width: 44px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.scroller::before { left: 0; background: linear-gradient(to right, var(--bg) 20%, rgba(247, 247, 244, 0)); }
.scroller::after { right: 0; background: linear-gradient(to left, var(--bg) 20%, rgba(247, 247, 244, 0)); }
.scroller.can-left::before,
.scroller.can-right::after { opacity: 1; }
.scroller-btn {
  position: absolute; top: 50%; z-index: 2;
  display: grid; place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 3px 10px rgba(54, 59, 69, 0.2);
  transform: translateY(-50%);
}
.scroller-btn svg { width: 20px; height: 20px; }
.scroller-btn:hover { border-color: var(--accent); }
.scroller-btn.prev { left: 0; }
.scroller-btn.next { right: 0; }
.scroller-chips { margin-bottom: 12px; }
.scroller-chips .journey-chips { margin-bottom: 0; }

/* ---------- Ask Fizzy (instant help) and the safety welcome ---------- */

.help-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -4px 0 16px; }
.help-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px 6px 6px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.help-btn:hover { background: #d2eeef; }
.help-btn img,
.help-link img { flex: none; width: 28px; height: 28px; padding: 3px; border-radius: 50%; background: #ffffff; }
.safety-note { margin: 0; color: var(--muted); font-size: 13px; }
.help-link {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
}
.help-link:hover { background: var(--accent-soft); }

.help-dialog {
  width: min(440px, calc(100vw - 24px));
  height: min(640px, calc(100vh - 48px));
  height: min(640px, calc(100dvh - 48px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(54, 59, 69, 0.3);
}
.help-dialog::backdrop { background: rgba(54, 59, 69, 0.5); }
.help-inner { display: flex; flex-direction: column; height: 100%; }
.help-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.help-head .fizzy-avatar { width: 44px; height: 44px; }
.help-head > div { flex: 1; min-width: 0; }
.help-head h2 { font-size: 18px; }
.help-close {
  flex: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
}
.help-log { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto; background: var(--bg); }
.help-msg { max-width: 90%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.45; }
.help-msg p { margin: 0; }
.help-msg p + p { margin-top: 6px; }
.help-msg strong { display: block; margin-bottom: 4px; }
.help-msg p strong { display: inline; margin: 0; }
.help-fizzy { align-self: flex-start; border: 1px solid var(--line); border-bottom-left-radius: 4px; background: var(--surface); }
.help-me { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--accent); color: #ffffff; }
.help-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.help-chip {
  padding: 7px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}
.help-chip:hover { background: var(--accent-soft); }
.help-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.help-actions .btn-outline,
.help-actions .wa-btn { padding: 8px 12px; font-size: 13px; }
.help-typing { color: var(--muted); font-style: italic; }
.help-form { display: flex; gap: 8px; padding: 12px 16px 8px; border-top: 1px solid var(--line); }
.help-form input {
  flex: 1; min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 16px; /* 16px stops phones zooming in */
}
.help-form input:focus { outline: none; border-color: var(--accent); }
.help-form .primary { width: auto; padding: 11px 18px; }
.help-foot { padding: 0 16px 12px; font-size: 12px; text-align: center; }
@media (max-width: 720px) {
  /* Phones: a sheet that rises from the bottom of the screen */
  .help-dialog {
    width: 100vw; max-width: 100vw;
    height: 88vh; height: 88dvh; max-height: 88dvh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }
}

.safety-list { display: grid; gap: 8px; margin: 14px 0 4px; padding-left: 18px; color: var(--muted); font-size: 14px; text-align: left; }
.safety-list strong { color: var(--ink); }

/* ---------- My Journey page ---------- */

.journey-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 760px; margin: 0 auto; }
.journey-page > * { min-width: 0; }
.journey-page .section-title { margin: 4px 0 12px; }
.journey-head { border-top: 4px solid var(--stage); }
.journey-head .eyebrow { color: var(--stage-deep); }
.journey-head h2 { margin: 4px 0; font-size: 24px; letter-spacing: -0.01em; }
.journey-head .primary { width: auto; margin-top: 18px; padding: 13px 24px; font-size: 16px; }
.journey-head .hint { margin-top: 10px; text-align: left; }
@media (max-width: 720px) {
  .journey-head h2 { font-size: 21px; }
  .journey-head .primary { width: 100%; }
  .journey-head .hint { text-align: center; }
}

/* ---------- Shorter pages on phones ---------- */

/* Session history: "Show all" button */
.history-more { width: 100%; margin-top: 12px; }

/* "You & your data" folds open and closed */
.data-section { margin-top: 32px; }
.data-summary {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  cursor: pointer;
  list-style: none;
}
.data-summary::-webkit-details-marker { display: none; }
.data-section .data-title { margin: 0; }
.data-hint { flex: 1; }
.data-section[open] .data-hint { visibility: hidden; }
.data-chevron { flex: none; width: 20px; height: 20px; color: var(--muted); transition: transform 0.2s; }
.data-section[open] .data-chevron { transform: rotate(180deg); }

/* Easier / harder toggle: phones only (computers always show both options) */
.alts-toggle { display: none; }

@media (max-width: 720px) {
  /* Train: Easier / Harder open on tap, and ticked drills shrink to one line. */
  .drill .alt { display: none; }
  .drill.show-alts .alt { display: flex; }
  .alts-toggle {
    display: inline-flex; align-items: center; gap: 4px;
    margin: -2px 0 12px 46px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
  }
  .alts-toggle::after { content: "▾"; transition: transform 0.15s; }
  .alts-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
  .alts-toggle + .drill-timer { margin-left: 6px; }
  .drill.is-done .cue,
  .drill.is-done .alt,
  .drill.is-done .alts-toggle,
  .drill.is-done .drill-timer { display: none; }

  /* My Progress: compact hero (ring beside your name, stats three across). */
  .progress-hero { gap: 16px; }
  .progress-hero-main { flex-direction: row; align-items: flex-start; gap: 14px; }
  .big-ring { width: 84px; height: 84px; }
  .big-ring-text strong { font-size: 20px; }
  .big-ring-text span { font-size: 9px; }
  .progress-hero h2 { font-size: 20px; }
  .progress-hero .fizzy-says { display: none; } /* Home already shows Fizzy's message */
  /* Six small columns: three short numbers on top, the two streaks (wider) underneath. */
  .progress-hero .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  .progress-hero .stats .stat,
  .progress-hero .stats .stat:last-child { grid-column: span 2; }
  .progress-hero .stats .stat:nth-child(3),
  .progress-hero .stats .stat:nth-child(4) { grid-column: span 3; order: 1; }
  .progress-hero .stat { padding: 10px; }
  .progress-hero .stat .value { font-size: 20px; white-space: nowrap; }
  .progress-hero .stat .meta { font-size: 12px; line-height: 1.25; }

  /* My Progress: stage cards without the step list (Home's journey map shows every step). */
  .category-progress { gap: 8px; }
  .stage-card .chips { display: none; }
  .stage-card-head { margin-bottom: 0; }

  /* Session history: skip the long "Done:" drill list. */
  .entry-done { display: none; }

  /* "You & your data" becomes a tidy tap-to-open row. */
  .data-summary { margin-bottom: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .data-section[open] .data-summary { margin-bottom: 12px; }
  .data-hint { font-size: 12px; }
}

/* ---------- Tab icons and the phone tab bar ---------- */

.tab-icon { display: none; }

@media (max-width: 720px) {
  /* On phones the tabs become a bar pinned to the bottom of the screen. */
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
    box-shadow: 0 -4px 16px rgba(54, 59, 69, 0.06);
  }
  .tabs button {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.15;
    text-align: center; /* longer names like "Progress report" wrap onto two neat lines */
  }
  .tabs button[aria-selected="true"] { background: transparent; color: var(--accent); }
  .tab-icon { display: block; width: 52px; height: 30px; padding: 4px 13px; border-radius: 999px; }
  .tabs button[aria-selected="true"] .tab-icon { background: var(--accent-soft); }

  /* Keep the timer and the page's last bits clear of the tab bar. */
  .timer-fab { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .timer-panel { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: 170px; }
}
