/* ==================================================================
   styles.css
   Mobile-first. Palette + card tokens lifted from the conference
   dashboard "blush" theme; radii / shadow / ink naming follows the
   client-portal admin design system.
   ================================================================== */

/* ---------------- tokens ---------------- */
:root {
  --canvas: #faecf0;
  --cream: #f6e1e9;
  --surface: #fffbfc;
  --ink: #331624;
  --ink-soft: #6b4a5b;
  --ink-muted: #886073;
  --accent: #db2777;
  --accent-soft: #fad4e4;
  --accent-dark: #a81d5b;
  --accent-ink: #ffffff;
  --line: #e5c8d3;
  --good: #2e7d51;
  --warn: #b26e12;
  --bad: #c0392b;
  --grid: #f3e3ea;

  /* session-type hues, same family */
  --t-strength: #db2777;
  --t-cardio: #8354ce;
  --t-hiit: #be5030;
  --t-recovery: #2e7d51;
  --t-rest: #886073;

  --shadow-soft: 0 1px 2px rgba(51, 22, 36, 0.04), 0 10px 30px rgba(219, 39, 119, 0.07);
  --shadow-pop: 0 6px 16px rgba(51, 22, 36, 0.1), 0 24px 48px rgba(168, 29, 91, 0.18);

  --r-lg: 1rem;
  --r-xl: 1.25rem;
  --r-2xl: 1.5rem;
  --r-3xl: 2rem;

  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system,
    'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ---------------- reset ---------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

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

body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  min-height: 100vh;
  min-height: 100dvh;
}

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

button {
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

svg.ico { display: block; flex: none; }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; }

::selection { background: var(--accent-soft); color: var(--ink); }

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

/* ---------------- app shell ---------------- */
.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px calc(var(--nav-h) + var(--safe-b) + 24px);
}

.view { display: none; animation: fade 0.25s ease-out; }
.view.active { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 14px;
  /* fade out across the bottom padding only. At 72% the scrim went transparent
     above the subtitle's own baseline, so scrolling content showed through it. */
  background: linear-gradient(var(--canvas) calc(100% - 14px), rgba(250, 236, 240, 0));
}

.topbar h1 {
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.topbar .sub {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 500;
  margin-top: 2px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s, color 0.15s;
}
.icon-btn:active { transform: scale(0.94); }

/* ---------------- cards ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.card + .card, .stack > * + * { margin-top: 14px; }

/* .stats lays its tiles out on a grid, where the stacking margin above is not
   spacing — it shoves every tile but the first down 14px and shortens it. */
.stats > .card + .card { margin-top: 0; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h3 { font-size: 1rem; font-weight: 800; }
.card-head p { font-size: 0.8rem; color: var(--ink-muted); margin-top: 2px; }

.section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 26px 0 10px;
}

/* icon chip — same construction as the dashboard KpiCard */
.chip {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent);
  color: color-mix(in srgb, var(--c, var(--accent)) 72%, var(--ink));
}
.chip.sm { width: 30px; height: 30px; border-radius: 10px; }

/* ---------------- hero: today's session ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-3xl);
  padding: 22px;
  color: var(--accent-ink);
  background: linear-gradient(145deg, var(--c, var(--accent)), color-mix(in srgb, var(--c, var(--accent)) 62%, #4a1030));
  box-shadow: var(--shadow-pop);
}

.hero::after {
  content: '';
  position: absolute;
  right: -70px;
  top: -70px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.11);
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 11px;
  border-radius: 999px;
}

.hero h2 {
  font-size: 1.85rem;
  margin: 14px 0 6px;
  position: relative;
}

.hero .focus {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 500;
  position: relative;
}

.hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  position: relative;
}

.hero .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  padding: 7px 12px;
  border-radius: 999px;
}

.hero .intro {
  position: relative;
  margin-top: 16px;
  font-size: 0.86rem;
  line-height: 1.6;
  opacity: 0.93;
}

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--r-lg);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  transition: transform 0.14s, box-shadow 0.2s, background 0.2s;
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.975); }
.btn.full { width: 100%; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 14px rgba(219, 39, 119, 0.32);
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-white {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 6px 18px rgba(51, 22, 36, 0.18);
  margin-top: 18px;
  position: relative;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--cream); }

.btn-done {
  background: color-mix(in srgb, var(--good) 12%, transparent);
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 28%, transparent);
}

/* still the small button, but not below the 44px minimum — these are the
   mid-workout controls (skip rest, +15s, start/pause) and the settings rows. */
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 0.85rem; border-radius: 12px; }

.btn:disabled, .icon-btn:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}
.btn:disabled:active, .icon-btn:disabled:active { transform: none; }
.btn-ghost:disabled:hover { background: var(--surface); }
.btn-primary:disabled:hover { background: var(--accent); }

/* ---------------- habit rings ---------------- */
.habits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.habit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 4px 10px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.14s, border-color 0.2s;
}
.habit:active { transform: scale(0.95); }
.habit.done { border-color: color-mix(in srgb, var(--good) 45%, transparent); }

.ring { position: relative; width: 46px; height: 46px; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.ring .bg { stroke: var(--grid); }
.ring .fg { stroke: var(--accent); transition: stroke-dashoffset 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.habit.done .ring .fg { stroke: var(--good); }

.ring .glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
}
.habit.done .ring .glyph { color: var(--good); }

.habit .label { font-size: 0.68rem; font-weight: 700; color: var(--ink-soft); }
.habit .count { font-size: 0.66rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ---------------- stat tiles ---------------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.stat { padding: 15px; }
.stat .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.stat .label { font-size: 0.78rem; font-weight: 600; color: var(--ink-muted); }
.stat .value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 0.74rem; color: var(--ink-muted); margin-top: 2px; }

/* ---------------- week list ---------------- */
.day-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 13px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.14s, border-color 0.2s;
}
.day-row + .day-row { margin-top: 9px; }
.day-row:active { transform: scale(0.985); }
.day-row.today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.day-row.done { background: color-mix(in srgb, var(--good) 5%, var(--surface)); }

.day-row .info { flex: 1; min-width: 0; }
/* these are spans (a button may not contain divs), so they need blockifying —
   left inline they run together on one line and margin-top / ellipsis are dead. */
.day-row .d, .day-row .t, .day-row .f { display: block; }
.day-row .d { font-size: 0.7rem; font-weight: 800; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.day-row .t { font-weight: 800; font-size: 0.95rem; margin-top: 1px; }
.day-row .f { font-size: 0.74rem; color: var(--ink-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-row .end { color: var(--ink-muted); flex: none; }
.day-row.done .end { color: var(--good); }

/* ---------------- progress / weight ---------------- */
.weight-hero { text-align: center; padding: 22px 18px; }
.weight-hero .now { font-size: 3.1rem; font-weight: 800; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.weight-hero .now span { font-size: 1.2rem; color: var(--ink-muted); font-weight: 700; }
.weight-hero .delta { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; color: var(--good); margin-top: 4px; }

.track { margin-top: 20px; }
.track-bar { position: relative; height: 10px; border-radius: 999px; background: var(--grid); overflow: hidden; }
.track-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-dark)); transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.track-ends { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--ink-muted); font-weight: 600; margin-top: 7px; }

.chart-wrap { position: relative; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-wrap svg { display: block; min-width: 100%; }

.milestone { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.milestone + .milestone { border-top: 1px solid var(--line); }
.milestone .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--grid); border: 2px solid var(--line); flex: none; }
.milestone.hit .dot { background: var(--good); border-color: var(--good); }
.milestone.primary .dot { border-color: var(--accent); }
.milestone .m-kg { font-weight: 800; font-size: 0.95rem; font-variant-numeric: tabular-nums; min-width: 52px; }
.milestone .m-l { flex: 1; font-size: 0.82rem; color: var(--ink-soft); }
.milestone .m-w { font-size: 0.72rem; color: var(--ink-muted); font-weight: 600; }

/* ---------------- inputs ---------------- */
.field { display: flex; gap: 9px; }
.input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 15px;
  font-size: 16px; /* prevents iOS zoom on focus */
  font-weight: 600;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
}
.input::placeholder { color: var(--ink-muted); font-weight: 500; }
/* outline:none here also suppressed the global :focus-visible ring, leaving a
   keyboard user with only a 1px border tint — restore a visible ring. */
.input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------------- nutrition ---------------- */
.plate-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.plate-row + .plate-row { border-top: 1px solid var(--line); }
.plate-bar { width: 5px; align-self: stretch; border-radius: 999px; background: var(--c, var(--accent)); flex: none; }
.plate-row .p-what { font-weight: 800; font-size: 0.9rem; }
.plate-row .p-part { font-size: 0.72rem; font-weight: 700; color: var(--accent-dark); text-transform: uppercase; letter-spacing: 0.05em; }
.plate-row .p-eg { font-size: 0.78rem; color: var(--ink-muted); margin-top: 3px; }

.meal { display: flex; gap: 12px; padding: 13px 0; }
.meal + .meal { border-top: 1px solid var(--line); }
.meal .m-time { font-size: 0.72rem; font-weight: 800; color: var(--ink-muted); width: 62px; flex: none; padding-top: 2px; }
.meal .m-name { font-weight: 800; font-size: 0.88rem; }
.meal .m-food { font-size: 0.8rem; color: var(--ink-soft); margin-top: 2px; line-height: 1.45; }
.meal .m-macros { display: flex; gap: 12px; margin-top: 5px; font-size: 0.72rem; font-weight: 700; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ---------------- accordion ---------------- */
.acc { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.acc + .acc { margin-top: 10px; }

.acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 15px;
}
.acc-head .a-t { flex: 1; font-weight: 800; font-size: 0.94rem; }
.acc-head .a-c { color: var(--ink-muted); transition: transform 0.25s; }
.acc.open .a-c { transform: rotate(180deg); }

.acc-body { display: none; padding: 0 15px 15px; }
.acc.open .acc-body { display: block; }
.acc-body .a-intro { font-size: 0.83rem; color: var(--ink-muted); line-height: 1.6; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

.g-item { padding: 12px 0; }
.g-item + .g-item { border-top: 1px solid var(--line); }
.g-item .g-t { font-weight: 800; font-size: 0.87rem; margin-bottom: 4px; }
.g-item .g-d { font-size: 0.83rem; color: var(--ink-soft); line-height: 1.6; }

/* ---------------- notes / callouts ---------------- */
.note {
  display: flex;
  gap: 11px;
  padding: 13px 14px;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--c, var(--accent)) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 24%, transparent);
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.note .ico { color: var(--c, var(--accent)); margin-top: 1px; }
.note b { color: var(--ink); font-weight: 800; }

/* ---------------- bottom nav ---------------- */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 6px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px;
  border-radius: 12px;
  color: var(--ink-muted);
  font-size: 0.63rem;
  font-weight: 700;
  transition: color 0.18s, background 0.18s;
}
.nav-btn.active { color: var(--accent); background: var(--accent-soft); }
.nav-btn:active { transform: scale(0.94); }

/* ==================================================================
   workout player — full-screen takeover
   ================================================================== */
.player {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  background: var(--canvas);
  height: 100vh;
  height: 100dvh;
}
.player.open { display: flex; }

/* on mobile the shell simply fills the screen; on desktop it becomes a modal */
.p-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.p-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  flex: none;
}

.p-progress { flex: 1; height: 6px; border-radius: 999px; background: var(--grid); overflow: hidden; }
.p-progress i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.35s ease; }

.p-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px 20px;
}

.p-block {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-soft);
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
}

.p-name { font-size: 2rem; margin: 14px 0 8px; letter-spacing: -0.035em; }

.p-target {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-dark);
}

.p-muscles { font-size: 0.78rem; color: var(--ink-muted); font-weight: 600; margin-top: 6px; }

.p-steps { list-style: none; padding: 0; margin: 20px 0 0; counter-reset: s; }
.p-steps li {
  position: relative;
  counter-increment: s;
  padding: 0 0 0 38px;
  margin-bottom: 15px;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.p-steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: -1px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

/* "Watch the movement" — the optional outbound demo link, shown under the form
   cues. Deliberately quieter than the numbered steps: surface fill and a hairline
   rule rather than a filled button, so it is there when she is unsure about a
   movement without competing with the instructions themselves. */
.demo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.demo-link span { flex: 1; }
.demo-link .ico { color: var(--accent); }
.demo-link .ico:last-child { color: var(--ink-muted); }
.demo-link:hover { background: var(--cream); border-color: var(--accent-soft); }
.demo-link:active { transform: scale(0.985); }

/* inside a guide search result the card already supplies the padding above it */
.card > .demo-link { margin-top: 11px; }

.p-extras { margin-top: 18px; display: grid; gap: 10px; }

/* set tracker */
.sets { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 20px; }
.sets .lbl { font-size: 0.74rem; font-weight: 800; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.07em; width: 100%; }
.set-dot {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ink-muted);
  transition: background 0.2s, border-color 0.2s;
  /* a read-only round counter, not a control — it used to shrink on press
     like a button and then do nothing at all. */
  user-select: none;
  -webkit-user-select: none;
}
.set-dot.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* timer */
.timer { text-align: center; padding: 26px 18px; }
.timer .t-lbl { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-muted); }
.timer .t-val { font-size: 4.2rem; font-weight: 800; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; line-height: 1.05; margin: 6px 0 4px; }
.timer .t-next { font-size: 0.84rem; color: var(--ink-muted); font-weight: 600; }
.timer .t-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.timer.rest .t-val { color: var(--good); }
.timer.work .t-val { color: var(--accent); }

.p-foot {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.p-foot .btn { flex: 1; }
.p-foot .btn.narrow { flex: 0 0 56px; padding: 0; }

/* completion */
.p-done { text-align: center; padding: 40px 20px; }
.p-done .big { width: 88px; height: 88px; border-radius: 50%; background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); display: grid; place-items: center; margin: 0 auto 22px; }
.p-done h2 { font-size: 1.9rem; }
.p-done p { color: var(--ink-muted); margin-top: 8px; font-size: 0.92rem; line-height: 1.6; }

/* ---------------- option cards (cardio / rest days) ---------------- */
.opt {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.14s, border-color 0.2s;
}
.opt + .opt { margin-top: 10px; }
.opt:active { transform: scale(0.99); }
.opt.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.opt .o-head { display: flex; align-items: center; gap: 10px; }
.opt .o-name { font-weight: 800; font-size: 0.98rem; flex: 1; }
.opt .o-tag { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-dark); background: var(--accent-soft); padding: 4px 9px; border-radius: 999px; }
.opt ul { margin: 12px 0 0; padding-left: 18px; }
.opt li { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.6; margin-bottom: 4px; }
.opt .o-note { font-size: 0.79rem; color: var(--ink-muted); margin-top: 10px; line-height: 1.55; font-style: italic; }

/* ---------------- sheet (settings) ---------------- */
.sheet-bg {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(51, 22, 36, 0.4);
  backdrop-filter: blur(3px);
  display: none;
}
.sheet-bg.open { display: block; animation: fade 0.2s; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 91;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-3xl) var(--r-3xl) 0 0;
  padding: 10px 18px calc(24px + var(--safe-b));
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.sheet.open { transform: none; }
.sheet .grab { width: 42px; height: 4px; border-radius: 999px; background: var(--line); margin: 6px auto 18px; }

.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; }
.row + .row { border-top: 1px solid var(--line); }
.row .r-l { flex: 1; }
.row .r-t { font-weight: 700; font-size: 0.9rem; }
.row .r-d { font-size: 0.76rem; color: var(--ink-muted); margin-top: 2px; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  transform: translate(-50%, 20px);
  z-index: 120;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty { text-align: center; padding: 34px 18px; color: var(--ink-muted); font-size: 0.87rem; line-height: 1.6; }

.hide { display: none !important; }

/* ==================================================================
   tablet / desktop — the mobile layout stays the source of truth,
   this just uses the extra width instead of stretching it.
   ================================================================== */
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .hero h2 { font-size: 2.2rem; }
  .habits { gap: 12px; }
  .habit { padding: 16px 8px 13px; }
  .ring { width: 54px; height: 54px; }
  .habit .label { font-size: 0.74rem; }
}

@media (min-width: 900px) {
  body { --nav-h: 0px; }

  .app {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    padding: 0 28px 60px;
    max-width: 1240px;
  }

  .app > .topbar,
  .app > main { grid-column: 2; }

  /* bottom bar becomes a left rail */
  .nav {
    position: sticky;
    top: 24px;
    grid-column: 1;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 14px;
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-2xl);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    backdrop-filter: none;
  }

  .nav::before {
    content: 'Your Plan';
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-muted);
    padding: 4px 12px 12px;
  }

  .nav-btn {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 11px 12px;
    font-size: 0.88rem;
    border-radius: var(--r-lg);
  }

  .topbar { padding-top: 30px; background: none; position: static; }
  .topbar h1 { font-size: 1.75rem; }

  .two-col { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
  .two-col > * { margin-top: 0 !important; }

  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .grid-2 > .acc + .acc,
  .grid-2 > .day-row + .day-row { margin-top: 0; }

  .hero { padding: 30px; }
  .hero h2 { font-size: 2.5rem; }
  .card { padding: 22px; }

  /* the player is a centred modal rather than a full takeover */
  .player { inset: 0; padding: 32px; background: rgba(51, 22, 36, 0.45); backdrop-filter: blur(6px); }
  .player.open { display: grid; place-items: center; }

  .p-shell {
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--canvas);
    border-radius: var(--r-3xl);
    overflow: hidden;
    box-shadow: var(--shadow-pop);
  }

  .p-top { padding: 18px 22px 14px; }
  .p-body { padding: 4px 22px 22px; }
  .p-foot { padding: 14px 22px; }
  .p-name { font-size: 2.3rem; }

  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; max-width: calc(100vw - 40px); border-radius: var(--r-2xl); transform: translate(-50%, -46%); opacity: 0; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }

  .toast { bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .nav, .p-foot, .topbar .icon-btn { display: none; }
}
