/* ---------- tokens ---------- */
:root {
  --bg: #080b16;
  --bg-2: #0d1224;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eaeefb;
  --muted: #8e97b8;
  --faint: #5c6486;

  --greg: #38e0d0;
  --greg-soft: rgba(56, 224, 208, 0.16);
  --daniel: #ffb24d;
  --daniel-soft: rgba(255, 178, 77, 0.16);

  --good: #4ade80;
  --miss: #f2557a;
  --live: #a78bfa;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* `hidden` must beat the layout rules below (.gate is grid, .app is flex). */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Fixed backdrop layer. Painting this separately (rather than using
   background-attachment: fixed on <body>) keeps the sticky, blurred header
   from leaving repaint artifacts while scrolling. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(56, 224, 208, 0.13), transparent 60%),
    radial-gradient(980px 600px at 92% 0%, rgba(255, 178, 77, 0.11), transparent 58%),
    radial-gradient(900px 700px at 50% 110%, rgba(124, 92, 255, 0.14), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.02em; }

/* ---------- gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 24px;
  background: rgba(6, 9, 18, 0.72);
  backdrop-filter: blur(14px);
}
.gate-card {
  width: min(560px, 100%);
  padding: 42px 34px 30px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025));
  box-shadow: var(--shadow);
  animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gate-mark { font-size: 46px; line-height: 1; }
.gate-card h1 { font-size: 32px; margin: 12px 0 6px; }
.gate-card h1 span { color: var(--greg); }
.gate-sub { margin: 0 0 26px; color: var(--muted); }
.gate-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gate-foot { margin: 22px 0 0; font-size: 12.5px; color: var(--faint); }

.pick {
  display: grid; gap: 10px; justify-items: center;
  padding: 22px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.pick:hover { transform: translateY(-3px); border-color: var(--line-strong); background: var(--surface-2); }
.pick .av {
  width: 54px; height: 54px; display: grid; place-items: center;
  border-radius: 50%; font-weight: 700; font-size: 20px; color: #071018;
}
.pick .nm { font-weight: 600; font-size: 17px; }
.pick .sub { font-size: 12px; color: var(--faint); }

/* ---------- chrome ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(16px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 22, 0.76);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark { font-size: 20px; }
.brand-text span { color: var(--greg); }

.tabs {
  display: flex; gap: 4px; margin-left: auto; padding: 4px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
}
.tab {
  border: 0; background: none; color: var(--muted);
  padding: 8px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 550;
  transition: color 0.15s ease, background 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

.who {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 550;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.who:hover { border-color: var(--line-strong); background: var(--surface-2); }
.who-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--greg); }
.who svg { color: var(--faint); }

.banner {
  margin: 14px clamp(16px, 4vw, 34px) 0;
  padding: 11px 15px;
  border: 1px solid rgba(255, 178, 77, 0.3);
  border-radius: var(--r-md);
  background: rgba(255, 178, 77, 0.08);
  color: #ffd9a3; font-size: 13px;
}

.view {
  flex: 1;
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: clamp(20px, 3.5vw, 34px) clamp(16px, 4vw, 34px) 60px;
  animation: fade 0.3s ease;
}

.footer {
  padding: 18px clamp(16px, 4vw, 34px) 26px;
  color: var(--faint); font-size: 12.5px; text-align: center;
}
.dot-sep { margin: 0 8px; opacity: 0.5; }

/* ---------- shared ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 22px;
}
.section { margin-bottom: 30px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 17px; }
.section-head .hint { color: var(--faint); font-size: 12.5px; margin-left: auto; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); font-weight: 600; }
.empty { color: var(--faint); font-size: 13.5px; padding: 26px; text-align: center; }

.btn {
  border: 1px solid var(--line-strong); background: var(--surface-2);
  padding: 9px 15px; border-radius: 10px; font-size: 13.5px; font-weight: 550;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.11); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: none; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.danger { border-color: rgba(242, 85, 122, 0.4); color: #ff9ab1; background: rgba(242, 85, 122, 0.08); }

/* Destructive button waiting for its second tap. */
.btn.danger.armed, .link-btn.armed {
  background: #f2557a; border-color: #f2557a; color: #fff;
  animation: nudge 0.3s ease;
}
.link-btn.armed { padding: 3px 8px; font-size: 11.5px; font-weight: 600; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-2px); } 65% { transform: translateX(2px); } }

input[type="text"], input[type="number"], select {
  font: inherit; color: var(--text);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px;
  outline: none;
}
input:focus, select:focus { border-color: var(--greg); }
select option { background: #131a30; }

/* ---------- hero (today) ---------- */
.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(22px, 3vw, 30px);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(56, 224, 208, 0.07) 55%, transparent);
  margin-bottom: 30px;
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -90px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,92,255,0.28), transparent 68%);
  pointer-events: none;
}
.hero-grid { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-copy { flex: 1 1 300px; min-width: 260px; }
.hero-status { font-size: clamp(24px, 3.4vw, 33px); font-weight: 680; letter-spacing: -0.03em; margin: 8px 0 6px; }
.hero-sub { color: var(--muted); font-size: 14px; margin: 0; }
.hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }

.cta {
  border: 0; border-radius: 14px;
  padding: 14px 26px; font-size: 15px; font-weight: 650; color: #06121a;
  background: linear-gradient(135deg, #6ff2e2, #38e0d0);
  box-shadow: 0 10px 26px rgba(56, 224, 208, 0.28);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.15s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(56, 224, 208, 0.36); }
.cta:active { transform: translateY(0); }
.cta[disabled] { opacity: 0.42; cursor: not-allowed; box-shadow: none; transform: none; filter: grayscale(0.5); }
.cta.done { background: linear-gradient(135deg, #7bf0a5, #4ade80); box-shadow: 0 10px 26px rgba(74, 222, 128, 0.25); }

.stepper {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: rgba(0,0,0,0.22);
}
.stepper button { width: 30px; height: 30px; border: 0; background: none; border-radius: 8px; color: var(--muted); font-size: 17px; line-height: 1; }
.stepper button:hover { background: var(--surface-2); color: var(--text); }
.stepper .val { min-width: 66px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }

/* progress ring */
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring-mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-pct { font-size: 25px; font-weight: 680; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ring-lbl { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px; }

/* ---------- slot grid ---------- */
.ex-block { margin-bottom: 26px; }
.ex-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ex-head .ico { font-size: 18px; }
.ex-head .nm { font-weight: 600; font-size: 15px; }
.ex-head .tgt { font-size: 12.5px; color: var(--faint); }
.ex-head .cnt { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.slot {
  position: relative; overflow: hidden;
  display: grid; gap: 5px; justify-items: center;
  padding: 15px 8px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: center;
  transition: transform 0.14s ease, border-color 0.15s ease, background 0.15s ease;
}
.slot:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.slot .hh { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.slot .st { font-size: 11px; color: var(--faint); }
.slot .mark { font-size: 17px; line-height: 1; height: 20px; display: grid; place-items: center; }

.slot.done { background: rgba(74, 222, 128, 0.11); border-color: rgba(74, 222, 128, 0.34); }
.slot.done .st { color: #8ef0b3; }

/* An hour logged above target — a make-up set. */
.slot.done.over { background: rgba(74, 222, 128, 0.2); border-color: rgba(74, 222, 128, 0.55); }
.slot.done.over .mark { color: #8ef0b3; font-size: 14px; font-weight: 700; }

/* Nothing logged and the day is still short: reps owed, not a permanent miss. */
.slot.open { background: rgba(255, 178, 77, 0.08); border-color: rgba(255, 178, 77, 0.3); }
.slot.open .st { color: #ffd9a3; }
.slot.open .mark { color: #ffd9a3; }

/* Nothing logged here, but the reps were made up in another hour. */
.slot.covered { background: rgba(255, 255, 255, 0.03); border-color: var(--line); opacity: 0.75; }
.slot.covered .st { color: var(--muted); }
.slot.covered .mark { color: #8ef0b3; font-size: 14px; }
.slot.covered:hover { opacity: 1; }

.makeup-note { font-size: 12px; color: #ffd9a3; }
.slot.live { border-color: var(--live); background: rgba(167, 139, 250, 0.12); box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.13); }
.slot.live .st { color: #c9b8ff; }
.slot.live::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  border: 1px solid rgba(167, 139, 250, 0.5);
  animation: pulse 2.1s ease-out infinite;
}
.slot.upcoming { opacity: 0.55; }
.slot.upcoming:hover { opacity: 0.85; }

/* ---------- scoreboard ---------- */
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; }
.vs-mid { display: grid; place-items: center; color: var(--faint); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; }

.player {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; background: var(--surface);
  position: relative; overflow: hidden;
}
.player.lead { border-color: var(--line-strong); }
.player.lead::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, var(--tint), transparent 45%);
}
.player-top { display: flex; align-items: center; gap: 12px; position: relative; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #071018; flex: none; }
.player-name { font-weight: 650; font-size: 16px; }
.player-role { font-size: 11.5px; color: var(--faint); }
.crown { margin-left: auto; font-size: 19px; }

.big-num { font-size: 40px; font-weight: 700; letter-spacing: -0.035em; margin: 16px 0 2px; font-variant-numeric: tabular-nums; position: relative; }
.big-lbl { font-size: 12px; color: var(--faint); position: relative; }

.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; position: relative; }
.mini { padding: 11px; border-radius: var(--r-sm); background: rgba(0,0,0,0.22); border: 1px solid var(--line); text-align: center; }
.mini .v { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.mini .l { font-size: 10.5px; color: var(--faint); margin-top: 2px; }

.bar-track { height: 8px; border-radius: 999px; background: rgba(0,0,0,0.3); overflow: hidden; margin-top: 14px; position: relative; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }

.range-pills { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.range-pills button { border: 0; background: none; color: var(--muted); padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 550; }
.range-pills button.on { background: var(--surface-2); color: var(--text); }

.range-note {
  margin: -4px 0 14px; font-size: 12.5px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.range-note strong { color: var(--muted); font-weight: 600; }

/* ---------- history ---------- */
.chart-card { padding: 20px; }
.chart-card svg { width: 100%; height: auto; display: block; overflow: visible; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

.heat-scroll { overflow-x: auto; padding-bottom: 6px; }
.heat { display: flex; gap: 4px; min-width: max-content; }
.heat-col { display: grid; grid-template-rows: repeat(5, 1fr); gap: 4px; }
.heat-cell { width: 15px; height: 15px; border-radius: 4px; background: rgba(255,255,255,0.05); }
.heat-rows { display: grid; grid-template-rows: repeat(5, 1fr); gap: 4px; margin-right: 6px; font-size: 9.5px; color: var(--faint); }
.heat-rows span { height: 15px; line-height: 15px; }
.heat-key { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 11.5px; color: var(--faint); }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); font-weight: 600; padding: 0 12px 10px; white-space: nowrap; }
.tbl td { padding: 11px 12px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr:hover td { background: rgba(255,255,255,0.022); }
.tbl .num { text-align: right; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }

/* ---------- personal dashboard ---------- */
.stat-row { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.stat .v { font-size: 26px; font-weight: 680; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat .v .u { font-size: 14px; color: var(--faint); font-weight: 500; margin-left: 3px; }
.stat .l { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.stat-row .btn { margin-left: auto; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); padding: 18px;
}
.tile .v { font-size: 27px; font-weight: 680; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile .v .u { font-size: 15px; color: var(--faint); font-weight: 500; }
.tile .l { font-size: 11.5px; color: var(--faint); margin-top: 3px; }

.form-grid { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.field .opt { text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 400; opacity: 0.75; }

.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }

.fine { font-size: 12px; color: var(--faint); line-height: 1.55; margin: 12px 0 0; }
.fine.warn { color: #ffd9a3; }

.weight-log { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.weight-log .tbl td { padding: 9px 12px; }
.weight-log .tbl th { padding-bottom: 8px; }

/* Collapsible section header — a whole-width button that looks like a heading. */
.collapse-head {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 12px 16px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.collapse-head:hover { border-color: var(--line-strong); background: var(--surface-2); }
.collapse-head h2 { font-size: 15px; flex: none; }
.collapse-head .chev { color: var(--faint); flex: none; transition: transform 0.18s ease; }
.collapse-head .chev.open { transform: rotate(90deg); }
.collapse-head .collapse-sub {
  color: var(--faint); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.collapse-head .collapse-cue {
  margin-left: auto; flex: none;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.collapse-head:hover .collapse-cue { color: var(--greg); }

@media (max-width: 560px) {
  .collapse-head .collapse-sub { display: none; }
}

.add-activity { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

/* An activity row expanded into its edit form. */
.set-row.editing {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  margin: 8px 0;
}
.set-row.editing .save-bar { margin-top: 14px; padding-top: 14px; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding-bottom: 9px; }
.check input { width: 16px; height: 16px; accent-color: var(--greg); }

.fixed-met {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(0, 0, 0, 0.25); font-size: 13.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* history pager */
.pager { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pg {
  width: 30px; height: 30px; border-radius: 9px; line-height: 1; font-size: 17px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.pg:hover:not([disabled]) { border-color: var(--line-strong); color: var(--text); background: var(--surface-2); }
.pg[disabled] { opacity: 0.32; cursor: not-allowed; }
.pg-label { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 128px; text-align: center; }

.setup-prompt { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.setup-copy { flex: 1 1 260px; }
.setup-copy h3 { font-size: 19px; margin: 6px 0 0; }
.setup-copy .fine { margin-top: 8px; max-width: 52ch; }

.link-btn {
  border: 0; background: none; color: var(--faint);
  padding: 2px 6px; border-radius: 6px; font-size: 13px; line-height: 1;
}
.link-btn:hover { color: #ff9ab1; background: rgba(242, 85, 122, 0.1); }

/* ---------- settings ---------- */
.set-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 15px 0; border-top: 1px solid var(--line);
}
.set-row:first-of-type { border-top: 0; }
.set-row .ico { font-size: 20px; }
.set-row .meta { flex: 1 1 160px; min-width: 140px; }
.set-row .meta .nm { font-weight: 600; }
.set-row .meta .sub { font-size: 12px; color: var(--faint); }
.set-row input[type="number"] { width: 84px; }
.set-row input[type="text"] { width: 150px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.day-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.day { width: 44px; padding: 8px 0; text-align: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; }
.day.on { background: var(--greg-soft); border-color: rgba(56,224,208,0.45); color: var(--greg); }
.save-bar { display: flex; gap: 10px; align-items: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.save-bar .note { font-size: 12.5px; color: var(--faint); margin-right: auto; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(14px);
  z-index: 60; padding: 12px 20px; border-radius: 12px;
  background: rgba(14, 19, 36, 0.96); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); font-size: 13.5px; font-weight: 550;
  opacity: 0; transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.good { border-color: rgba(74, 222, 128, 0.45); }
.toast.bad { border-color: rgba(242, 85, 122, 0.5); }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0% { opacity: 0.9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.06); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.13); } 100% { transform: scale(1); } }
.pop { animation: pop 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 780px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .tabs { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .tab { flex: 1; text-align: center; padding: 9px 6px; }
  .who { margin-left: auto; }
  .vs { grid-template-columns: 1fr; }
  .vs-mid { padding: 4px 0; }
  .slots { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .gate-choices { grid-template-columns: 1fr; }

  /* Let the exercise header wrap as whole words, with the tally on its own line. */
  .ex-head { flex-wrap: wrap; row-gap: 4px; }
  .ex-head .nm, .ex-head .tgt { white-space: nowrap; }
  .ex-head .cnt { margin-left: 0; flex-basis: 100%; }
  /* Stacked hero: don't let the copy block stretch to fill leftover height. */
  .hero-grid { flex-direction: column-reverse; align-items: stretch; gap: 20px; }
  .hero-copy { flex: 0 0 auto; min-width: 0; }
  .ring { margin: 0 auto; }
}
