:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #ece9e3;
  --text: #1d2125;
  --muted: #5c6268;
  --warn: #a14a05;
  --warn-soft: #fdecd3;
  --border: #dedad3;
  --accent: #2f7d4f;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe2;
  --ok: #1f9d55;
  --ok-soft: #dcf3e5;
  --danger: #c93a3a;
  --danger-soft: #f9e0e0;
  --hard: #7c3aed;
  --hard-soft: #ede4fd;
  --measure: #0e7c86;
  --measure-soft: #d9f1f3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .04);
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416;
    --surface: #1c1f22;
    --surface-2: #262a2e;
    --text: #eceae6;
    --muted: #a8aeb4;
    --warn: #f6b15c;
    --warn-soft: #3a2a12;
    --border: #30353a;
    --accent: #52c486;
    --accent-ink: #08190f;
    --accent-soft: #163322;
    --ok: #3ccf7d;
    --ok-soft: #173826;
    --danger: #ff6b6b;
    --danger-soft: #3d1c1c;
    --hard: #a78bfa;
    --hard-soft: #2b2342;
    --measure: #39c2cc;
    --measure-soft: #143236;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); text-decoration: none; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; margin-top: 1.5rem; }
h3 { font-size: 1rem; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.topbar .wrap { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.topbar .back { display: inline-flex; padding: 8px; margin-left: -8px; color: var(--text); }
.topbar .title { font-weight: 700; font-size: 1.05rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.brand svg { color: var(--accent); }

main.wrap { padding-top: 16px; }

/* Bottom nav */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .wrap { display: grid; grid-template-columns: repeat(4, 1fr); height: var(--nav-h); padding: 0; }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: .72rem; font-weight: 600;
}
.tabbar a.active { color: var(--accent); }

/* Cards & lists */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: 4px; }

.session-link {
  display: flex; align-items: center; gap: 12px; color: var(--text);
}
.session-link .body { flex: 1; min-width: 0; }
.session-link .name { font-weight: 650; display: block; }
.session-link .meta { color: var(--muted); font-size: .85rem; display: block; }
.session-link .chev { color: var(--muted); }

.kind-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--accent); }
.kind-dot.hard { background: var(--hard); }
.kind-dot.measure { background: var(--measure); }
.kind-dot.done { background: var(--ok); }
.kind-dot.skipped { background: transparent; border: 2px solid var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  vertical-align: middle;
}
.badge.hard { background: var(--hard-soft); color: var(--hard); }
.badge.measure { background: var(--measure-soft); color: var(--measure); }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 8px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 0 8px; }
.section-title h2 { margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 650; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn.icon { width: 44px; padding: 0; }
.btn.sm.icon { width: 36px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
form.inline { display: inline; margin: 0; }

.fab {
  position: fixed; right: 16px; z-index: 25;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(232, 87, 42, .35);
}
/* The + opens a small menu: the + turns into a ×, the page dims and the
   options rise from the button one after the other, with a little bounce. */
button.fab { border: 0; cursor: pointer; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s; }
button.fab svg { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
button.fab:active { transform: scale(.92); }
.fab.open svg { transform: rotate(135deg); }
.fab-backdrop {
  position: fixed; inset: 0; z-index: 24; background: rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease;
}
.fab-backdrop.open { opacity: 1; }
.fab-menu {
  position: fixed; right: 16px; z-index: 25; display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px + 56px + 14px);
}
.fab-item {
  display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  opacity: 0; transform: translateY(24px) scale(.6); transform-origin: right bottom;
  transition: opacity .2s ease, transform .2s ease;
  transition-delay: calc((1 - var(--i)) * 30ms);
}
.fab-menu.open .fab-item {
  opacity: 1; transform: none;
  transition: opacity .25s ease, transform .45s cubic-bezier(.34, 1.56, .64, 1);
  transition-delay: calc(var(--i) * 60ms);
}
.fab-item-label {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px;
  font-weight: 650; box-shadow: 0 4px 16px rgba(0, 0, 0, .15); white-space: nowrap;
}
.fab-item-icon {
  width: 48px; height: 48px; margin-right: 4px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); font-size: 1.4rem; box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
}
.fab-item:active .fab-item-icon, .fab-item:active .fab-item-label { transform: scale(.95); }
@media (prefers-reduced-motion: reduce) {
  button.fab, button.fab svg, .fab-backdrop, .fab-item, .fab-menu.open .fab-item { transition: none; }
}

/* Forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], input[type=email],
select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
/* Grid cells may shrink: date inputs on phones have a wide built-in minimum
   and would spill out of the card. */
.grid-2 > *, .grid-3 > * { min-width: 0; }
input[type=date] { min-width: 0; max-width: 100%; }

.check { display: flex; align-items: center; gap: 10px; font-weight: 500; padding: 8px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
/* An option with a title and an explanation below: the radio by the title. */
.check.option { align-items: flex-start; }
.check.option input { margin: 1px 0 0; }

/* Chip toggles (checkbox / radio styled as pills) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-weight: 600; cursor: pointer; user-select: none;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:disabled + span { opacity: .35; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.choice-card { display: block; position: relative; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card .card { cursor: pointer; margin: 0; }
.choice-card input:checked + .card { border-color: var(--accent); outline: 2px solid var(--accent); }

/* Flash */
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 600; }
.flash.success { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--danger-soft); color: var(--danger); }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h1 { margin: 0; font-size: 1.25rem; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; padding: 4px 0; }
.cal .day {
  aspect-ratio: 1 / 1.1; min-height: 48px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 6px 2px 4px; color: var(--text); position: relative;
}
.cal .day.other { opacity: .4; }
.cal .day.today .num { background: var(--accent); color: var(--accent-ink); }
.cal .day.selected { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.cal .day.drop-target { background: var(--accent-soft); }
.cal .num { font-size: .85rem; font-weight: 700; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cal .dots { display: flex; gap: 3px; margin-top: auto; flex-wrap: wrap; justify-content: center; }
.cal .dots .kind-dot { width: 7px; height: 7px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--muted); margin: 10px 0; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.draggable { cursor: grab; }
.draggable.dragging { opacity: .5; }

/* Exercises */
.exercise { position: relative; }
.exercise.done { opacity: .7; }
.exercise.done .ex-name { text-decoration: line-through; text-decoration-color: var(--ok); }
.ex-top { display: flex; gap: 10px; align-items: flex-start; }
.ex-check { margin: 0; }
.ex-check button {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border);
  background: transparent; display: flex; align-items: center; justify-content: center;
  color: transparent; cursor: pointer; padding: 0;
}
.exercise.done .ex-check button { background: var(--ok); border-color: var(--ok); color: #fff; }
.ex-name { font-weight: 650; }
.ex-meta { font-size: .88rem; color: var(--muted); }
.ex-load { font-size: .88rem; margin-top: 2px; }
.ex-notes { font-size: .88rem; color: var(--muted); margin-top: 6px; white-space: pre-line; }
.ex-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.cat { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.cat.dedos { color: var(--hard); }
.cat.core, .cat.fuerza { color: #c77700; }
.cat.movilidad, .cat.antagonistas, .cat.vuelta_calma { color: var(--measure); }

details.more summary { list-style: none; cursor: pointer; }
details.more summary::-webkit-details-marker { display: none; }

/* Climbs */
.climb-list { display: flex; flex-wrap: wrap; gap: 6px; }
.climb-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 10px; padding: 4px 4px 4px 10px; font-weight: 700;
  background: var(--surface-2);
}
.climb-pill.project { background: transparent; border: 1px dashed var(--border); color: var(--muted); }
.climb-pill .x { border: 0; background: transparent; color: var(--muted); font-size: 1rem; padding: 2px 6px; cursor: pointer; }
.climb-pill small { font-weight: 500; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 1.35rem; }
.stat span { font-size: .75rem; color: var(--muted); }

/* Fatigue modal */
dialog {
  border: 0; border-radius: 20px; padding: 0; width: min(440px, calc(100vw - 32px));
  background: var(--surface); color: var(--text);
}
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.dialog-body { padding: 20px; }
.fatigue-value { text-align: center; margin: 12px 0 4px; }
.fatigue-value b { font-size: 3.2rem; line-height: 1; display: block; }
.fatigue-value span { font-weight: 700; }
input[type=range].fatigue {
  width: 100%; height: 36px; -webkit-appearance: none; appearance: none; background: transparent;
}
input[type=range].fatigue::-webkit-slider-runnable-track {
  height: 12px; border-radius: 999px;
  background: linear-gradient(90deg, #2bb673, #b6d334, #f5c518, #f08a24, #e03c31);
}
input[type=range].fatigue::-moz-range-track {
  height: 12px; border-radius: 999px;
  background: linear-gradient(90deg, #2bb673, #b6d334, #f5c518, #f08a24, #e03c31);
}
input[type=range].fatigue::-webkit-slider-thumb {
  -webkit-appearance: none; width: 32px; height: 32px; margin-top: -10px; border-radius: 50%;
  background: #fff; border: 3px solid var(--text); box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
input[type=range].fatigue::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid var(--text);
}
.scale-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.fatigue-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 6px; color: #fff; font-weight: 800; font-size: .8rem; }

/* Charts */
.chart-box { position: relative; height: 220px; }
.chart-box.short { height: 150px; }
.chart-sub { font-size: .8rem; font-weight: 700; color: var(--muted); margin: 10px 0 4px; }
/* Routine calendar: weeks as columns, Monday to Sunday as rows */
.habit { display: flex; gap: 6px; }
.habit-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; font-size: .65rem; color: var(--muted); }
.habit-days span { line-height: 1; display: flex; align-items: center; }
.habit-grid { flex: 1; max-width: 400px; display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
.habit-grid i, .habit-legend i { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--surface-2); }
.habit-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.habit-legend span { display: inline-flex; align-items: center; gap: 4px; }
.habit-legend i { width: 12px; height: 12px; border-radius: 3px; }
.h-done { background: var(--ok) !important; }
.h-partial { background: color-mix(in srgb, var(--ok) 40%, var(--surface-2)) !important; }
.h-missed { background: color-mix(in srgb, var(--danger) 35%, var(--surface-2)) !important; }
.h-future, .h-before { background: transparent !important; }
.h-today { box-shadow: inset 0 0 0 2px var(--accent); }

/* Login */
/* Pages without the bottom tab bar don't need the space reserved for it. */
body.no-nav { padding-bottom: 0; }
/* No elastic bounce on the login: on iOS it feels like the page scrolls. */
html:has(body.no-nav), body.no-nav { overscroll-behavior-y: none; }
body.no-nav main.wrap { padding-top: 0; }
.login {
  min-height: 100vh;
  min-height: 100dvh; /* visible height on mobile, excluding the browser's URL bar */
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
}
.login .card { width: 100%; max-width: 380px; padding: 28px 24px 24px; }
.login .brand { justify-content: center; font-size: 1.5rem; margin-bottom: 2px; }
.login-tagline { text-align: center; color: var(--muted); margin: 0 0 22px; }
.flash.message, .flash.info { background: var(--surface-2); color: var(--text); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
td, th { padding: 8px 4px; border-bottom: 1px solid var(--border); text-align: left; font-size: .92rem; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (min-width: 720px) {
  .cal .day { aspect-ratio: auto; min-height: 76px; }
}

input[type=range]:focus:not(:focus-visible),
input[type=checkbox]:focus:not(:focus-visible),
input[type=radio]:focus:not(:focus-visible) { outline: none; }

/* Checklists (warm-up) */
.checklist { list-style: none; margin: 10px 0 4px; padding: 0; }
.checklist-item { margin: 0; }
.checklist-item button {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  background: none; border: 0; padding: 8px 0; text-align: left;
  font: inherit; color: var(--text); cursor: pointer;
}
.checklist li + li .checklist-item button { border-top: 1px solid var(--border); }
.checklist-item .box {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px;
  border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
  color: transparent;
}
.checklist-item.done .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist-item.done .text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--ok); }
.checklist-count { margin-bottom: 2px; }

/* Plan overview */
.plan-hero h2 { font-size: 1.35rem; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 14px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.stat-row-4 { grid-template-columns: repeat(4, 1fr); }
.stat-row-4 .stat b { font-size: 1.15rem; }
.stat b small { font-size: .75rem; color: var(--muted); font-weight: 600; }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.dot-s { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--surface-2); border: 2px solid var(--border); flex: none; }
.dot-s.done { background: var(--ok); border-color: var(--ok); }
.dot-s.missed { background: transparent; border-color: var(--danger); }
.dot-s.today { background: var(--accent); border-color: var(--accent); }
.dot-s.hard { border-radius: 50%; }
.legend .dot-s { width: 10px; height: 10px; }
details.week { padding: 0; }
details.week summary { list-style: none; }
details.week summary::-webkit-details-marker { display: none; }
.week-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.week.current { border-color: var(--accent); outline: 1px solid var(--accent); }
.week-num { font-weight: 800; color: var(--muted); width: 30px; }
.week.current .week-num { color: var(--accent); }
.week-title { font-weight: 650; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.week-dots { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.week-dots .small { margin-left: 6px; }
.week-sessions { border-top: 1px solid var(--border); padding: 4px 14px 8px; }
.week-session { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text); }
.week-session + .week-session { border-top: 1px solid var(--border); }
.week-session .name { display: block; font-weight: 600; }
.week-session .small { display: block; }
@media (max-width: 380px) { .stat-row-4 { grid-template-columns: repeat(2, 1fr); } }

/* Library picker (new session) */
.picker-cats { margin-bottom: 8px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-btn {
  flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip-btn.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.picker-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.picker-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0; font-weight: 500; cursor: pointer; }
.picker-row + .picker-row { border-top: 1px solid var(--border); }
.picker-row input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.picker-name { display: block; font-weight: 600; }
.picker-meta { display: block; font-size: .8rem; color: var(--muted); }
.picker-selected ol { margin: 0; padding-left: 22px; }
.picker-selected li { padding: 2px 0; }
.picker-selected li > * { vertical-align: middle; }
.picker-selected li .x { border: 0; background: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 0 6px; }

/* Quick adjust steppers */
.steppers { margin-top: 8px; }
.stepper { display: grid; grid-template-columns: 1fr 36px 64px 36px; grid-template-rows: auto auto; column-gap: 6px; align-items: center; padding: 6px 0; }
.stepper + .stepper { border-top: 1px solid var(--border); }
.stepper-label { font-weight: 600; font-size: .9rem; }
.stepper input { min-height: 36px; padding: 4px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .btn.icon { font-size: 1.2rem; }
.stepper-hint { grid-column: 1; grid-row: 2; margin-top: -4px; }
.stepper-hint:empty { display: none; }
.stepper-status { min-height: 1.2em; margin-top: 4px; text-align: right; }
button.picker-row { width: 100%; background: none; border: 0; border-left: 3px solid transparent; text-align: left; font: inherit; color: var(--text); }
button.picker-row + .picker-row, label.picker-row + .picker-row { border-top: 1px solid var(--border); }
.picker-row.selected { background: var(--accent-soft); }
button.picker-row.selected { border-left-color: var(--accent); }
.ex-finger { font-size: .88rem; font-weight: 700; color: var(--hard); margin-top: 2px; }
.ex-finger:empty { display: none; }
.finger-fields { margin-bottom: 14px; }
.notice { background: var(--accent-soft); border-color: transparent; font-size: .92rem; }

/* Exercise videos */
.video-frame { position: relative; aspect-ratio: 16 / 9; margin-top: 8px; border-radius: 12px; overflow: hidden; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-search { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--muted); }

/* Legal pages */
.legal { max-width: 640px; padding-bottom: 24px; }
.legal h2 { font-size: 1.05rem; margin-top: 1.6rem; }
.legal p, .legal li { line-height: 1.55; }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 6px; }
.legal-link { text-align: center; margin-top: 16px; }
.legal-box { max-height: 50vh; max-height: 50dvh; overflow-y: auto; }
.legal-box .legal h1 { font-size: 1.2rem; }
.accept-form .check { align-items: flex-start; }
.accept-form .check input { margin-top: 2px; flex: none; }

/* Exercise library (profile) */
.lib-toolbar { display: grid; gap: 8px; margin-bottom: 12px; }
.lib-list { padding: 0 14px; }
.lib-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.lib-row + .lib-row { border-top: 1px solid var(--border); }
.lib-row.off .lib-text { opacity: .5; }
.lib-name { font-weight: 600; }
.lib-meta { font-size: .8rem; color: var(--muted); }
.lib-text { min-width: 0; }
.switch { position: relative; flex: none; width: 46px; height: 28px; margin: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); transition: background .15s; pointer-events: none; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .slider { background: var(--ok); border-color: var(--ok); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch .slider, .switch .slider::after { transition: none; } }
.brand-mark { border-radius: 22%; flex: none; }

/* Install the app */
.install-icon {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.install-banner { display: flex; align-items: center; gap: 10px; padding: 12px; }
.install-banner .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.install-banner .btn.icon { margin-left: -4px; color: var(--muted); }
.install-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.install-head img { border-radius: 13px; flex: none; }
.install-head h2 { margin: 0 0 2px; }
.install-head p { margin: 0; }
.install-steps { margin: 4px 0 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.45; }
.install-steps + .install-steps { margin-top: 14px; }
.key {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: -3px;
  min-width: 24px; height: 22px; padding: 0 5px; border-radius: 6px;
  border: 1px solid var(--border); color: var(--accent); font-weight: 700;
}
.install [data-install-native] { margin-bottom: 14px; }
.install [data-install-inapp] { margin: 14px 0 0; }

/* 1-10 ratings */
.rating { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.rating legend { font-weight: 700; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.rating legend .hint { font-weight: 400; display: inline; }
.rating-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.rating-scale label { position: relative; }
.rating-scale input { position: absolute; opacity: 0; pointer-events: none; }
.rating-scale span {
  display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: .9rem; cursor: pointer;
}
.rating-scale input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rating-scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rating + .scale-labels, .rating .scale-labels { margin-top: 4px; }
.ratings-line { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); }
.ratings-line b { color: var(--text); }
.wellness-card summary { list-style: none; cursor: pointer; }
.wellness-card summary::-webkit-details-marker { display: none; }
.last-load { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.last-load .btn { min-height: 28px; padding: 0 8px; color: var(--accent); }
.load-suggest { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; line-height: 1.35; }
.load-suggest .btn { min-height: 28px; padding: 0 8px; color: var(--accent); }
.objectives { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg); white-space: pre-line; font-size: .92rem; }
.week-notes textarea { min-height: 0; }

/* Coach viewing an athlete */
.coach-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px max(16px, calc((100% - 720px) / 2)); background: var(--measure); color: #fff; font-size: .9rem;
}
.coach-bar span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.coach-bar .btn { min-height: 32px; background: rgba(255,255,255,.18); border-color: transparent; color: #fff; }
.coach-code { font-size: 2rem; font-weight: 800; letter-spacing: .18em; text-align: center; margin: 6px 0; font-variant-numeric: tabular-nums; }
.push-prompt { display: flex; align-items: center; gap: 10px; padding: 12px; }
.push-prompt .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wellness-card h2 { font-size: 1.15rem; }

/* Gym colour circuit */
.swatch { width: 18px; height: 18px; border-radius: 50%; flex: none; border: 1px solid rgba(0,0,0,.18); display: inline-block; }
.color-grid { display: grid; gap: 6px; }
.color-row { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.color-row select { width: auto; min-width: 96px; }
.color-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.color-picks label { position: relative; }
.color-picks input { position: absolute; opacity: 0; pointer-events: none; }
.color-picks span {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: .88rem; cursor: pointer;
}
.color-picks span small { color: var(--muted); font-weight: 500; }
.color-picks input:checked + span { border-color: var(--text); box-shadow: 0 0 0 2px var(--text) inset; }
.color-picks input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.climb-pill .swatch { width: 12px; height: 12px; }

/* Post-session analysis */
.analysis h3 { margin-bottom: 8px; }
.ai-text { margin: 0 0 4px; line-height: 1.5; }
.ai-note { margin-bottom: 10px; }
.feedback { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
.feedback li { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; line-height: 1.4; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.feedback li.warn { background: rgba(245, 181, 24, .18); }
.feedback li.good { background: var(--ok-soft); }
.feedback .ico { flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.typing::after { content: '…'; animation: typing 1.2s steps(4) infinite; display: inline-block; width: 1em; overflow: hidden; vertical-align: bottom; }
@keyframes typing { from { width: 0; } to { width: 1em; } }
@media (prefers-reduced-motion: reduce) { .typing::after { animation: none; } }
.coach-comment { border-left: 4px solid var(--measure); }
.coach-comment h3 { display: flex; align-items: center; gap: 6px; color: var(--measure); margin-bottom: 8px; }
.adjustments { border-top: 1px solid var(--border); margin-top: 12px; }
.adjustment { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.adjustment:last-child { border-bottom: 0; }
.adjustment .grow { min-width: 0; }
.adjustment a { color: var(--text); font-weight: 600; }
.badge.pct { background: rgba(245, 181, 24, .2); color: var(--text); margin-left: 4px; }
.ex-climbs { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); display: grid; gap: 6px; }
.ex-climb-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ex-climb-add select { width: auto; min-height: 36px; padding: 4px 8px; font-size: .9rem; }
.color-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.color-dot:active { transform: scale(.92); }

/* Other activities */
.kind-dot.activity { background: #2a78d6; }
.kind-dot.routine { background: #8a5cd0; }
.activity-emoji { width: 28px; text-align: center; font-size: 1.25rem; flex: none; }
.calc-big { font-size: 1.05rem; font-weight: 700; margin: 4px 0 0; }
.presets { display: grid; gap: 8px; }
.preset { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.preset.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.time-fit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 2px 0 10px; font-size: .9rem; }
.time-fit select { width: auto; min-height: 34px; padding: 2px 8px; }
.exercise.skipped { padding: 10px 14px; }

/* Daily readiness */
.readiness-card summary { display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer; }
.readiness-card summary::-webkit-details-marker { display: none; }
.readiness-score { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 1.3rem; font-weight: 800; color: #fff; }
/* Fixed dark steps: white digits stay readable in light and dark mode. */
.readiness-card.good .readiness-score { background: #1f8a4c; }
.readiness-card.warn .readiness-score { background: #a86f00; }
.readiness-card.bad .readiness-score { background: #c0392b; }
.readiness-card .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.readiness-label { font-weight: 800; }
.readiness-factors { list-style: none; padding: 0; margin: 12px 0 8px; display: grid; gap: 4px; font-size: .9rem; }
.readiness-factors li { display: flex; justify-content: space-between; gap: 10px; }
.readiness-factors b.down { color: var(--danger); }
.readiness-factors b.up { color: var(--ok); }
.rating-scale.from-zero { grid-template-columns: repeat(11, 1fr); gap: 3px; }
.rating-scale.from-zero span { font-size: .82rem; }

/* Pain evolution */
.pain-bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; }
.pain-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.pain-bar span { width: 100%; max-width: 18px; border-radius: 4px 4px 0 0; }
.pain-bar span.high { background: #c0392b; }
.pain-bar span.low { background: #1f8a4c; }
.pain-bar small { font-size: .65rem; color: var(--muted); margin-top: 2px; }

/* Achievements and summary */
.achievements { display: grid; gap: 8px; }
.achievement { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.achievement .grow { display: flex; flex-direction: column; min-width: 0; }
.achievement .a-emoji { font-size: 1.6rem; }
.achievement.locked { opacity: .55; }
.achievement.locked .a-emoji { filter: grayscale(1); }
.summary-list { margin: 12px 0; padding-left: 18px; display: grid; gap: 6px; }

/* Offline */
.offline-bar { position: sticky; top: 0; z-index: 30; background: #3a3f44; color: #fff; padding: 8px 16px; font-size: .85rem; text-align: center; }
.offline-toast { position: fixed; left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 60; margin: 0 auto; max-width: 520px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
button.offline-toast { display: block; font: inherit; font-weight: 600; text-align: center; cursor: pointer; border: 0; }
/* In the full-screen timer: a small pill between the corner buttons. */
body:has(#timer) .offline-bar { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  max-width: 56%; border-radius: 999px; padding: 4px 12px; font-size: .75rem; z-index: 100; pointer-events: none; }

/* Themed days: change the theme or swap the day */
.theme-card { padding: 10px 14px; margin-bottom: 10px; }
.theme-card summary { list-style: none; cursor: pointer; }
.theme-card summary::-webkit-details-marker { display: none; }
.theme-h { margin: 14px 0 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.theme-grid .btn { justify-content: flex-start; text-align: left; }
.theme-hard { color: var(--hard); font-size: .7em; }
.week-swap { display: grid; gap: 4px; }
.week-swap .btn { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; align-items: center;
  justify-content: stretch; text-align: left; min-height: 40px; border: 1px solid var(--border, var(--surface-2)); }
.week-swap .btn .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.week-swap .btn.current { background: var(--accent-soft); }
.week-swap .btn:disabled { opacity: .55; }
.swap-tag { font-size: .75rem; color: var(--accent); font-weight: 600; }

/* Confirmation dialog (replaces the browser's confirm()) */
.confirm-dialog { width: min(380px, calc(100vw - 32px)); text-align: center; }
.confirm-dialog[open] { animation: confirm-in .16s ease-out; }
.confirm-dialog::backdrop { background: rgba(20, 22, 24, .55); backdrop-filter: blur(2px); }
@keyframes confirm-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.confirm-dialog .dialog-body { padding: 24px 20px 18px; }
.confirm-icon {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.4rem;
  background: var(--accent-soft); color: var(--accent);
}
.confirm-dialog.danger .confirm-icon { background: var(--danger-soft); color: var(--danger); }
.confirm-title { margin: 0 0 6px; font-size: 1.15rem; line-height: 1.3; }
.confirm-msg { margin: 0 0 4px; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { .confirm-dialog[open] { animation: none; } }
.confirm-dialog .confirm-ok.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Library picker: one line on what each exercise is, a detail sheet, tuning */
.picker-item { display: flex; align-items: center; }
.picker-item + .picker-item { border-top: 1px solid var(--border); }
.picker-item .picker-row { flex: 1; min-width: 0; border-top: 0 !important; }
.picker-item.selected { background: var(--accent-soft); }
.picker-item.selected .picker-row.selected { background: none; }
.picker-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: .8rem; color: var(--muted); font-weight: 400; margin-top: 2px; line-height: 1.35; }
.picker-info { flex: none; align-self: stretch; border: 0; border-left: 1px solid var(--border); background: none;
  color: var(--accent); padding: 0 14px; min-width: 48px; cursor: pointer; display: grid; place-items: center; }
.picker-info:hover { background: var(--accent-soft); }

.ex-sheet { margin: auto auto 0; width: min(560px, 100vw); max-width: 100vw; max-height: 88vh;
  border-radius: 20px 20px 0 0; padding: 0; }
.ex-sheet[open] { animation: sheet-up .2s ease-out; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ex-sheet[open] { animation: none; } }
.ex-sheet-body { padding: 10px 20px calc(18px + env(safe-area-inset-bottom)); }
.ex-sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 0 auto 12px; }
.ex-sheet h2 { margin: 2px 0 12px; font-size: 1.25rem; }
.ex-sheet h3 { margin: 16px 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ex-sheet p { margin: 0 0 8px; line-height: 1.5; }
.ex-sheet .pre { white-space: pre-line; }
.ex-sheet-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 0; }
.ex-sheet-params div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.ex-sheet-params dt { font-size: .72rem; color: var(--muted); }
.ex-sheet-params dd { margin: 2px 0 0; font-weight: 800; font-size: 1.05rem; }
.ex-sheet-list { margin: 6px 0 8px; padding-left: 20px; line-height: 1.5; }
.ex-sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 16px;
  position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; }

.picker-selected li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.sel-head { display: flex; align-items: center; gap: 6px; }
.sel-name { display: block; font-weight: 600; }
.sel-sum { display: block; font-size: .78rem; color: var(--muted); }
.sel-adjust { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.sel-adjust label { margin: 0; font-size: .75rem; color: var(--muted); font-weight: 600; }
.sel-adjust input { width: 100%; margin-top: 2px; }
.sel-info { flex: none; border: 0; background: none; color: var(--accent); width: 40px; height: 40px;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer; }
.sel-info:hover { background: var(--accent-soft); }

/* Cycle card: symptoms of the day and end of the period */
.cycle-symptoms, .cycle-end { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.cycle-symptoms .chips { margin-top: 6px; flex-wrap: wrap; }
.cycle-end label { display: block; margin-bottom: 6px; }

/* First-time tutorial */
.tour { width: min(460px, calc(100vw - 24px)); max-height: min(680px, calc(100dvh - 24px)); padding: 0;
  display: none; flex-direction: column; }
.tour[open] { display: flex; animation: confirm-in .2s ease-out; }
.tour::backdrop { background: rgba(20, 22, 24, .6); backdrop-filter: blur(2px); }
.tour-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 0 20px; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); cursor: pointer; transition: width .2s; }
.tour-dots i.on { width: 22px; border-radius: 4px; background: var(--accent); }
.tour-step { padding: 8px 22px 4px; overflow-y: auto; flex: 1; }
.tour-art { font-size: 3rem; line-height: 1; margin: 6px 0 10px; }
.tour-step h2 { margin: 0 0 8px; font-size: 1.3rem; }
.tour-step p, .tour-step li { line-height: 1.5; font-size: .95rem; }
.tour-step p { margin: 0 0 10px; }
.tour-step ul { margin: 0 0 10px; padding-left: 20px; }
.tour-step li { margin-bottom: 4px; }
.tour-tip { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: .88rem !important; color: var(--muted); }
.tour-ctas { display: grid; gap: 8px; margin-top: 4px; }
.tour-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); }
@media (prefers-reduced-motion: reduce) { .tour[open] { animation: none; } .tour-dots i { transition: none; } }

/* Help / FAQ */
.help-intro { margin-bottom: 12px; }
.help-search { width: 100%; margin-bottom: 8px; }
.help-section h2 { margin: 20px 0 8px; font-size: 1.05rem; }
.help-q { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 6px; }
.help-q summary { list-style: none; cursor: pointer; padding: 12px 40px 12px 14px; font-weight: 600; position: relative; }
.help-q summary::-webkit-details-marker { display: none; }
.help-q summary::after { content: "+"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 1.3rem; font-weight: 700; }
.help-q[open] summary::after { content: "–"; }
.help-a { padding: 0 14px 12px; color: var(--text); line-height: 1.5; font-size: .94rem; }
.help-a p { margin: 0 0 8px; }
.help-a ul { margin: 0 0 8px; padding-left: 20px; }
.help-a li { margin-bottom: 4px; }

/* Gym colours editor */
.palette { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.palette-row { display: grid; grid-template-columns: 40px 1fr auto; grid-template-areas: "sw name name" "sw grade tools";
  gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.palette-row input[type=color] { grid-area: sw; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer; align-self: center; }
.palette-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.palette-row input[type=color]::-webkit-color-swatch { border: 1px solid var(--border); border-radius: 50%; }
.palette-row input[type=color]::-moz-color-swatch { border: 1px solid var(--border); border-radius: 50%; }
.palette-row [name=color_name] { grid-area: name; }
.palette-row select { grid-area: grade; }
.palette-tools { grid-area: tools; display: flex; }
.gym-block { border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin: 0 0 10px; }
.gym-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.gym-head input { flex: 1; font-weight: 600; }
@media (min-width: 560px) {
  .palette-row { grid-template-columns: 40px 1fr 140px auto; grid-template-areas: "sw name grade tools"; }
}

/* Plan overview: modify the plan / "I'm injured" */
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.plan-actions .btn.active { background: var(--accent-soft); border-color: var(--accent); }
.injury-panel { margin-top: 8px; }
.injury-panel select { width: 100%; margin: 4px 0 6px; }
.objectives.injury-box { white-space: normal; }

/* Choose a password */
.pw-title { font-size: 1.2rem; margin: 4px 0 8px; }
.pw-meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .2s; background: var(--danger); }
.pw-meter i.ok { background: var(--hard); }
.pw-meter i.good { background: var(--ok); }
@media (prefers-reduced-motion: reduce) { .pw-meter i { transition: none; } }
.login.stacked { flex-direction: column; }

/* Quick climb logging: tap a colour or pick a grade, then Intentado / Hecho */
.ex-climb-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ex-climb-add select { width: auto; flex: 1 1 140px; }
.quick-colors { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gym-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.quick-color { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; min-height: 44px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; }
.quick-color small { color: var(--muted); font-weight: 500; }
.quick-color:active { transform: scale(.96); }
.quick-grade { width: 100%; }
.climb-quick { width: min(340px, calc(100vw - 32px)); text-align: center; }
.climb-quick[open] { animation: confirm-in .15s ease-out; }
.climb-quick::backdrop { background: rgba(20, 22, 24, .5); }
.climb-quick-what { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.25rem; margin: 4px 0 16px; }
.climb-quick-what .swatch { width: 26px; height: 26px; }
.climb-quick-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.climb-quick-main .btn { min-height: 64px; font-size: 1.1rem; }
.climb-quick-more { display: flex; justify-content: space-between; margin-top: 10px; }
.climb-quick-msg { margin: 8px 0 0; color: var(--danger) !important; }
@media (prefers-reduced-motion: reduce) { .climb-quick[open] { animation: none; } }

/* Daily routines */
.routine-block { margin: 18px 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.routine-progress { font-weight: 700; margin: 4px 0 8px; }
.routine-item .ex-top { display: flex; align-items: flex-start; gap: 10px; }
.routine-item.done { opacity: .7; }
.routine-item.done .ex-name { text-decoration: line-through; }
.routine-dose { color: var(--accent); font-weight: 700; font-size: .92rem; margin-top: 2px; }
.check-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface);
  color: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.check-btn[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.routine-timer { flex: none; font-variant-numeric: tabular-nums; }
.routine-timer.running { background: var(--accent); color: #fff; border-color: var(--accent); }
.routine-item-row { display: flex; align-items: center; gap: 4px; padding: 8px 10px; margin-bottom: 6px; }
.day-on { color: var(--text); margin-right: 2px; }
.day-off { color: var(--border); margin-right: 2px; font-weight: 400; }
.session-link.paused { opacity: .6; }
/* A saved routine to pick for a day: the whole card is the button */
.pick-routine { padding: 0; }
.pick-routine .pick-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px;
  background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }

/* Exercise picker: muscle chips and the muscles in the detail sheet */
.picker-muscles { margin-top: -2px; }
.picker-muscles .chip-btn { font-size: .8rem; padding: 4px 10px; }
.ex-sheet-muscles { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-sheet-muscles a { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; text-decoration: none; }

/* Climbs: boulder / route switch, and routes in the list */
.climb-kinds { margin-bottom: 10px; }
.climb-pill.route { border-style: dashed; }

/* Holidays */
.cal .day.holiday { background: color-mix(in srgb, #e0a526 16%, transparent); }
.legend-holiday { color: inherit; text-decoration: none; }
.holiday-card { display: block; color: inherit; text-decoration: none; }
.vacation-row.past { opacity: .6; }
