:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #14171f;
  --muted: #5d6475;
  --border: #dde1e8;
  --accent: #ff5a1f;
  --accent-ink: #ffffff;
  --good: #1f9d55;
  --warn: #d98b00;
  --bad: #d63a3a;
  --info: #3b6fd8;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1f232c;
    --text: #eef0f5;
    --muted: #9aa1b2;
    --border: #2a2f3a;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --text: #eef0f5;
  --muted: #9aa1b2;
  --border: #2a2f3a;
  --shadow: none;
  color-scheme: dark;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.15rem;
}

h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- chrome ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.brand svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0 16px;
  max-width: 1100px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}

.tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.tabs button[aria-selected='true'] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 16px 3rem;
  outline: none;
}

/* ---------- building blocks ---------- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
}

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

@media (max-width: 860px) {
  .span-8, .span-6, .span-4 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.stat {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat small {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.2rem;
}

.muted {
  color: var(--muted);
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: -0.25rem 0 0.5rem;
}

.pill {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
}

.pill.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.pill.info { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.85rem; }

.btn:focus-visible,
.tabs button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.spacer { flex: 1; }

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

/* ---------- readiness ---------- */

.readiness {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.ring {
  --pct: 0;
  --ring: var(--muted);
  width: 108px;
  height: 108px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--surface-2) 0);
}

.ring span {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.band-go { --ring: var(--good); }
.band-steady { --ring: var(--info); }
.band-easy { --ring: var(--warn); }
.band-rest { --ring: var(--bad); }

/* ---------- load gauge ---------- */

.gauge {
  position: relative;
  height: 10px;
  border-radius: 999px;
  margin: 0.9rem 0 0.4rem;
  background: linear-gradient(
    to right,
    var(--info) 0 40%,
    var(--good) 40% 65%,
    var(--warn) 65% 75%,
    var(--bad) 75% 100%
  );
}

.gauge i {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--text);
  transform: translateX(-50%);
}

.gauge-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- charts ---------- */

.chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart text {
  fill: var(--muted);
  font-size: 11px;
  font-family: inherit;
}

.chart .bar { fill: var(--accent); }
.chart .bar.current { fill: color-mix(in srgb, var(--accent) 55%, transparent); }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .line-acute { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart .line-chronic { fill: none; stroke: var(--info); stroke-width: 2.5; stroke-dasharray: 5 4; }

.legend {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.legend span::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
  background: var(--c);
}

/* ---------- lists ---------- */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
}

.list li:first-child { border-top: 0; }

.sport-dot {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  background: var(--surface-2);
}

.list .main { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { font-size: 0.85rem; color: var(--muted); }
.list .side { text-align: right; font-variant-numeric: tabular-nums; }

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 0.35rem;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.progress.done i { background: var(--good); }

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-top: 1px solid var(--border);
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-top: 0;
}

td.num,
th.num { text-align: right; }

.table-wrap { overflow-x: auto; }

/* ---------- forms ---------- */

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.75rem;
  min-width: 0;
}

input,
select,
textarea {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.5rem 0.6rem;
  width: 100%;
  min-width: 0;
}

input[type='range'] {
  padding: 0;
  accent-color: var(--accent);
  background: none;
  border: 0;
}

.scale-ends {
  display: flex;
  justify-content: space-between;
  font-weight: 400;
  font-size: 0.75rem;
}

.grid-2,
.grid-3,
.scales {
  display: grid;
  gap: 0 0.75rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.scales { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 520px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .scales { grid-template-columns: 1fr; }
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.75rem;
}

legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0 0.3rem;
}

.exercise-row {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1.2fr auto;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  align-items: center;
}

@media (max-width: 520px) {
  .exercise-row { grid-template-columns: 1fr 1fr 1fr auto; }
  .exercise-row input[name='ex-name'] { grid-column: 1 / -1; }
}

dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  background: var(--surface);
  color: var(--text);
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.45);
  backdrop-filter: blur(2px);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 1rem);
  opacity: 0;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  #toast { transition: none; }
}

/* Charts scale down with their viewBox on small screens; enlarge labels to compensate. */
@media (max-width: 520px) {
  .chart text { font-size: 20px; }
}

/* ======================================================================
   v2: coach/athlete perspectives, body map, messaging, video
   ====================================================================== */

:root {
  --mild: #e7b416;
  --sore: #f07c1f;
  --pain: #d63a3a;
}

.page-title { font-size: 1.5rem; }
.small { font-size: 0.8rem; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clickable { cursor: pointer; }
.clickable:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.only-mobile { display: none; }
.pain-text { color: var(--pain); font-weight: 600; }

@media (max-width: 520px) {
  .hide-sm { display: none; }
}

/* ---------- top bar controls ---------- */

.topbar { flex-wrap: wrap; }

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-controls select { width: auto; max-width: 11rem; padding: 0.45rem 0.5rem; }

.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.segmented button {
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: 7px;
  cursor: pointer;
}

.segmented button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: color-mix(in srgb, var(--info) 18%, var(--surface-2));
  color: var(--info);
}

.avatar.coach { background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); color: var(--accent); }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }

/* ---------- soreness chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

button.chip { cursor: pointer; }
.chip.lvl-1 { background: color-mix(in srgb, var(--mild) 22%, transparent); border-color: color-mix(in srgb, var(--mild) 50%, transparent); }
.chip.lvl-2 { background: color-mix(in srgb, var(--sore) 22%, transparent); border-color: color-mix(in srgb, var(--sore) 55%, transparent); }
.chip.lvl-3 { background: color-mix(in srgb, var(--pain) 20%, transparent); border-color: var(--pain); color: var(--pain); }

.note {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

/* ---------- body map ---------- */

.bodymap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  max-width: 420px;
  margin: 0 auto;
}

.body-fig { margin: 0; text-align: center; }
.body-svg { width: 100%; height: auto; max-height: 360px; display: block; }

.body-svg .area {
  fill: var(--surface-2);
  stroke: color-mix(in srgb, var(--muted) 45%, transparent);
  stroke-width: 1.2;
  transition: fill 0.12s;
}

.body-svg.interactive .area { cursor: pointer; }
.body-svg.interactive .area:hover { fill: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); }
.body-svg.interactive .area:focus-visible { outline: none; stroke: var(--accent); stroke-width: 2.5; }
.body-svg .area.lvl-1,
.body-svg.interactive .area.lvl-1:hover { fill: var(--mild); }
.body-svg .area.lvl-2,
.body-svg.interactive .area.lvl-2:hover { fill: var(--sore); }
.body-svg .area.lvl-3,
.body-svg.interactive .area.lvl-3:hover { fill: var(--pain); }

.body-fig figcaption {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 1.2rem;
  margin-top: 0.2rem;
}

.body-fig figcaption strong { color: var(--text); font-weight: 600; }

.body-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.6rem 0;
}

.body-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 0.3rem;
  vertical-align: -2px;
}

.body-legend .lvl-1 { background: var(--mild); }
.body-legend .lvl-2 { background: var(--sore); }
.body-legend .lvl-3 { background: var(--pain); }

dialog.wide { width: min(880px, calc(100vw - 32px)); }

.checkin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
}

@media (max-width: 760px) {
  .checkin-layout { grid-template-columns: 1fr; }
}

/* ---------- coach: roster ---------- */

.roster {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.roster-card { display: flex; flex-direction: column; gap: 0.7rem; border-left-width: 4px; }
.roster-card.status-bad { border-left-color: var(--bad); }
.roster-card.status-warn { border-left-color: var(--warn); }
.roster-card.status-info { border-left-color: var(--info); }
.roster-card.status-ok { border-left-color: var(--good); }
.roster-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.roster-metrics { flex-wrap: nowrap; }

.mini-ring {
  --pct: 0;
  --ring: var(--muted);
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--surface-2) 0);
}

.mini-ring span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); }
.dot.ok { background: var(--good); }
.dot.info { background: var(--info); }

.flag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }

/* ---------- messaging ---------- */

.chat-card,
.inbox {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: min(72vh, 720px);
  min-height: 420px;
}

.inbox { flex-direction: row; }

.thread-list {
  width: 290px;
  flex: none;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.thread-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0.9rem;
  cursor: pointer;
}

.thread-item .main { flex: 1; min-width: 0; }
.thread-item:hover { background: var(--surface-2); }
.thread-item.active { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

.chat-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.chat-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.thread {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--bg);
}

.day-sep {
  align-self: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin: 0.4rem 0;
}

.bubble {
  max-width: min(78%, 480px);
  padding: 0.5rem 0.75rem 0.35rem;
  border-radius: 16px;
  line-height: 1.4;
  word-wrap: break-word;
}

.bubble.theirs { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.bubble time { display: block; font-size: 0.68rem; opacity: 0.7; text-align: right; margin-top: 0.15rem; }
.bubble video { display: block; width: 100%; max-width: 320px; border-radius: 10px; margin: 0.15rem 0 0.35rem; background: #000; }

.composer { border-top: 1px solid var(--border); padding: 0.6rem; background: var(--surface); }
.composer textarea { resize: none; min-height: 40px; max-height: 160px; line-height: 1.4; }
.composer .attach { padding: 0.45rem 0.6rem; font-size: 1.05rem; line-height: 1; }
.attach-preview { margin: 0 0 0.4rem 0.2rem; }

@media (max-width: 700px) {
  .only-mobile { display: inline-flex; }
  .thread-list { width: 100%; border-right: 0; }
  .inbox .chat-pane { display: none; }
  .inbox.has-selection .thread-list { display: none; }
  .inbox.has-selection .chat-pane { display: flex; }
}

/* ---------- video ---------- */

.video-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.video-tile { margin: 0; }
.video-tile video { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; display: block; }
.video-tile figcaption { display: flex; flex-direction: column; margin-top: 0.3rem; min-width: 0; }
.video-chip { margin: 0.35rem 0.35rem 0 0; }
#video-player { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }

.file-pick { flex-direction: row; align-items: center; gap: 0.6rem; flex-wrap: wrap; cursor: pointer; }
.file-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-pick:focus-within .btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-name { font-weight: 400; }

label.check { flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 500; color: var(--text); }
label.check input { width: auto; }

/* ======================================================================
   v3: form analysis
   ====================================================================== */

.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
@media (max-width: 960px) {
  .span-7, .span-5 { grid-column: span 12; }
}

.sport-dot.lg { width: 52px; height: 52px; font-size: 1.6rem; border-radius: 14px; }
.stack { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.stack label { margin-bottom: 0; }
.banner { padding: 0.6rem 0.9rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.9rem; }
.banner.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }

.inline-select { flex-direction: row; align-items: center; gap: 0.4rem; margin: 0; font-size: 0.8rem; }
.inline-select select { width: auto; padding: 0.35rem 0.5rem; }

.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---------- list ---------- */

.exercise-strip { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.25rem 0 1rem; scrollbar-width: thin; }

.exercise-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 96px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.6rem;
  cursor: pointer;
}
.exercise-chip span { font-size: 1.5rem; }
.exercise-chip:hover { border-color: var(--accent); }

.analysis-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.analysis-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- analyze dialog ---------- */

.exercise-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 0.5rem; }
.exercise-opt { margin: 0; cursor: pointer; }
.exercise-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.exercise-opt span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.6rem 0.4rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.82rem;
  text-align: center;
}
.exercise-opt b { font-size: 1.4rem; font-weight: 400; }
.exercise-opt input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.exercise-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.video-pick { display: flex; flex-direction: column; gap: 0.2rem; margin: 0.5rem 0; max-height: 180px; overflow-y: auto; }
#analyze-dialog details { margin: 0.5rem 0; }
#analyze-dialog summary { cursor: pointer; color: var(--muted); }
#analyze-progress { margin: 0.75rem 0; }

/* ---------- player ---------- */

.player {
  position: relative;
  width: 100%;
  max-height: 70vh;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.player .overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.player.virtual .overlay { pointer-events: auto; }
.player-note { position: absolute; top: 0.4rem; left: 0.6rem; right: 0.6rem; z-index: 2; color: #ddd; margin: 0; }
.virtual-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.6));
}
.virtual-bar input { accent-color: var(--accent); background: none; border: 0; padding: 0; }
.virtual-bar .btn { min-width: 2.4rem; }

.player-controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.6rem; }
.player-controls label.check { margin: 0; font-size: 0.85rem; }
.small-seg button { padding: 0.2rem 0.55rem; font-size: 0.8rem; }

/* ---------- results ---------- */

.status-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--muted); margin-top: 0.3rem; align-self: flex-start; }
.status-dot.good { background: var(--good); }
.status-dot.warn { background: var(--warn); }
.status-dot.bad { background: var(--bad); }
.status-dot.info { background: var(--info); }
.list.checks li { align-items: flex-start; }

.rep-strip { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }
.rep-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 64px;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.rep-btn small { font-weight: 700; font-size: 0.95rem; }
.rep-btn.good small { color: var(--good); }
.rep-btn.warn small { color: var(--warn); }
.rep-btn.bad small { color: var(--bad); }
.rep-btn[aria-pressed='true'] { border-color: var(--accent); }

.compare-svg { width: 100%; height: auto; max-height: 420px; display: block; }
.compare-key { display: flex; gap: 1rem; justify-content: center; font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }
.compare-key i { display: inline-block; width: 22px; height: 0; border-top: 3px solid var(--text); margin-right: 0.35rem; vertical-align: middle; }
.compare-key i.dashed { border-top: 3px dashed #22c55e; }
.compare-legend { margin: 0.6rem 0 0; padding-left: 1.4rem; font-size: 0.88rem; }
.compare-legend li { margin-bottom: 0.35rem; }
.compare-legend li::marker { font-weight: 700; }
.compare-legend li.bad::marker { color: var(--bad); }
.compare-legend li.warn::marker { color: var(--warn); }

.cue { border-radius: 10px; padding: 0.6rem 0.8rem; margin-bottom: 0.6rem; }
.cue.coach { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-left: 3px solid var(--accent); }
.suggestions { margin: 0; padding-left: 1.3rem; }
.suggestions li { margin-bottom: 0.75rem; }
.suggestions li.bad::marker { color: var(--bad); font-weight: 700; }
.suggestions li.warn::marker { color: var(--warn); font-weight: 700; }

.notes-form .grid-3 { grid-template-columns: 1fr 1fr 2fr; }
@media (max-width: 520px) {
  .notes-form .grid-3 { grid-template-columns: 1fr 1fr; }
}
.span-all { grid-column: 1 / -1; }
@media (min-width: 521px) {
  .notes-form .span-all { grid-column: auto; }
}
.list.comments li { align-items: flex-start; }
.time-chip { flex: none; font-variant-numeric: tabular-nums; min-width: 3.2rem; text-align: center; }

.msg-analysis {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-width: 220px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  margin: 0.15rem 0 0.35rem;
  cursor: pointer;
}
.msg-analysis .main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.msg-analysis .sport-dot { width: 32px; height: 32px; }

/* ======================================================================
   v4: training plans
   ====================================================================== */

.avatar.sm { width: 30px; height: 30px; font-size: 0.72rem; }
.plan-today { border-left: 4px solid var(--accent); }
.plan-due { flex-wrap: nowrap; padding: 0.5rem 0; }
.plan-due + .plan-due { border-top: 1px solid var(--border); }

/* ---------- coach calendar ---------- */

.plan-cal { min-width: 820px; table-layout: fixed; }
.plan-cal th:first-child { width: 170px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.plan-cal th, .plan-cal td { vertical-align: top; padding: 0.4rem; }
.plan-cal thead th { text-align: center; }
.plan-cal thead th:first-child { text-align: left; }
.plan-cal .is-today { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.plan-cal td { border-left: 1px solid var(--border); }

.cal-chip {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.3rem 0.4rem;
  margin-bottom: 0.3rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-chip small { display: block; font-weight: 500; color: var(--muted); }
.cal-chip.completed { border-left-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.cal-chip.skipped { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.cal-chip.missed { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.cal-chip.today { border-left-color: var(--info); background: color-mix(in srgb, var(--info) 12%, var(--surface)); }
.cal-chip.upcoming { border-left-color: var(--muted); }

.cal-add {
  display: block;
  width: 100%;
  font: inherit;
  color: var(--muted);
  background: none;
  border: 1px dashed transparent;
  border-radius: 7px;
  cursor: pointer;
  padding: 0.1rem;
}
td:hover .cal-add, .cal-add:focus-visible { border-color: var(--border); color: var(--text); }
.cal-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.75rem; font-size: 0.78rem; color: var(--muted); }
.cal-legend i.cal-chip { display: inline-block; width: 16px; height: 12px; padding: 0; margin: 0 0.3rem 0 0; vertical-align: -1px; }

/* ---------- library ---------- */

.template-card { display: flex; flex-direction: column; }
.block-summary { list-style: none; margin: 0.6rem 0 0; padding: 0; font-size: 0.82rem; }
.block-summary li { display: flex; gap: 0.35rem; padding: 0.15rem 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.block-summary li .muted { overflow: hidden; text-overflow: ellipsis; }

/* ---------- builder ---------- */

.block-card { margin-bottom: 1rem; }
.block-head { flex-wrap: wrap; margin-bottom: 0.6rem; }
.block-icon { font-size: 1.3rem; }
.item-row { border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem; margin-bottom: 0.5rem; background: var(--bg); }
.item-main { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.4rem; }
.item-main .group-in { width: 3.4rem; flex: none; text-align: center; text-transform: uppercase; }
.item-main .name-in { flex: 1; font-weight: 600; }
.item-move { display: flex; flex: none; }
.item-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0 0.5rem; align-items: end; }
.item-fields label { margin-bottom: 0.4rem; font-size: 0.75rem; }
.item-fields input, .item-fields select { padding: 0.4rem 0.45rem; }
.item-fields label.check { align-self: center; }
.notes-in { font-size: 0.85rem; padding: 0.4rem 0.55rem; }
.quick-add { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.quick-add .chip { cursor: pointer; }
.chip-custom { border-style: dashed; }
.add-block .row { gap: 0.4rem; }
.builder-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0;
  margin-top: 1rem;
  background: linear-gradient(transparent, var(--bg) 30%);
}

/* ---------- athlete session ---------- */

.session-block { margin-bottom: 1rem; }
.session-item { padding: 0.75rem 0; border-top: 1px solid var(--border); }
.session-block h3 + .session-item { border-top: 0; }
.session-item.complete .main strong::after { content: ' ✓'; color: var(--good); }
.item-num {
  flex: none;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.3rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--surface-2);
}
.session-item .main { flex: 1; }
.actual { color: var(--good); font-weight: 600; margin-top: 0.2rem; }

.set-table { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.6rem 0 0 2.6rem; }
.set-row { display: flex; align-items: center; gap: 0.5rem; }
.set-row > .muted { width: 3rem; flex: none; }
.set-row label { flex-direction: row; align-items: center; gap: 0.3rem; margin: 0; font-weight: 400; }
.set-row input { width: 4.6rem; padding: 0.4rem; text-align: center; }
.set-row input:disabled { opacity: 0.8; }
.set-row.done input { border-color: color-mix(in srgb, var(--good) 60%, var(--border)); }
.set-check {
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.set-check[aria-pressed='true'], .set-row.done .set-check.static { background: var(--good); border-color: var(--good); color: #fff; }
.set-check.static { cursor: default; }
.set-bubbles { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 0 2.6rem; }
.set-bubble {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
}
span.set-bubble { cursor: default; }
.set-bubble[aria-pressed='true'], .set-bubble.on { background: var(--good); border-color: var(--good); color: #fff; }
.result-card { margin-bottom: 1rem; border-left: 4px solid var(--good); }
.finish-card { border-top: 4px solid var(--accent); }
@media (max-width: 520px) {
  .set-table, .set-bubbles { margin-left: 0; }
}

#rest-timer {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.6rem 0.8rem 0.6rem 1rem;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.25);
  font-weight: 600;
}
#rest-timer strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
#rest-timer.done { background: var(--good); color: #fff; }

/* ---------- assign dialog ---------- */

.athlete-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.1rem 0.75rem; margin-top: 0.3rem; }
.day-pick { margin: 0; cursor: pointer; }
.day-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-pick span { display: inline-block; padding: 0.35rem 0.6rem; border-radius: 8px; border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 0.82rem; }
.day-pick input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.actual.muted { color: var(--muted); font-weight: 500; }
.plan-cal tbody th { text-transform: none; letter-spacing: normal; color: var(--text); font-size: 0.88rem; font-weight: 600; }

/* ======================================================================
   v5: programs, generator, live session tools
   ====================================================================== */

.title-input { font-size: 1.4rem; font-weight: 700; background: transparent; border: 1px solid transparent; padding: 0.2rem 0.4rem; margin-left: -0.4rem; }
.title-input:hover, .title-input:focus { border-color: var(--border); background: var(--surface); }
.week-tabs { display: flex; gap: 0.3rem; overflow-x: auto; margin-bottom: 0.4rem; }
.week-tabs button { font: inherit; font-weight: 600; font-size: 0.85rem; padding: 0.35rem 0.7rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; }
.week-tabs button[aria-selected='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.program-week { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.prog-block { margin-top: 0.6rem; }
.prog-items { list-style: none; margin: 0.2rem 0 0; padding: 0; font-size: 0.85rem; }
.prog-items li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.2rem 0; border-top: 1px dashed var(--border); }
.prog-items li:first-child { border-top: 0; }
.prog-why { display: block; color: var(--muted); font-size: 0.75rem; line-height: 1.3; margin-top: 0.1rem; }
.prog-warnings { margin-bottom: 1rem; border-left: 3px solid var(--accent); }
.prog-warnings ul { list-style: none; margin: 0.3rem 0 0.4rem; padding: 0; }
.prog-warnings li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.4rem 0; border-top: 1px solid var(--border); font-size: 0.88rem; }
.prog-warnings li:first-child { border-top: 0; }
.prog-warnings li .btn { flex: none; }
.prog-items li .muted { text-align: right; }
.progress i.indeterminate { width: 40%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .progress i.indeterminate { animation: none; width: 100%; opacity: 0.5; } }
.groups-in { margin-top: 0.3rem; font-size: 0.8rem; padding: 0.3rem 0.45rem; }

.adjust-card { border-left: 4px solid var(--warn); margin-bottom: 1rem; }
.adjust-card.recover { border-left-color: var(--bad); }
.adjust-card ul { margin: 0.4rem 0 0.6rem; padding-left: 1.2rem; }
.info-banner { background: color-mix(in srgb, var(--info) 12%, transparent); border: 1px solid color-mix(in srgb, var(--info) 35%, transparent); }
.info-banner .btn { margin-left: 0.5rem; }
.session-item.flag-bad { background: color-mix(in srgb, var(--bad) 6%, transparent); }
.session-item.flag-warn { background: color-mix(in srgb, var(--warn) 6%, transparent); }
.flag-note { margin-top: 0.2rem; font-weight: 600; }
.flag-bad .flag-note { color: var(--bad); }
.flag-warn .flag-note { color: var(--warn); }
.item-tools { display: flex; gap: 0.15rem; flex: none; }
.item-tools .btn { padding: 0.25rem 0.5rem; }

/* plate calculator */
.plate-calc { margin: 0.5rem 0 0 2.6rem; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.bar-graphic { display: flex; align-items: center; height: 64px; }
.bar-graphic .sleeve { width: 44px; height: 10px; background: #9ca3af; border-radius: 3px; }
.bar-graphic .plate { width: 16px; height: var(--h); background: var(--c); color: #fff; border-radius: 3px; margin-left: 2px; font-size: 0.55rem; font-weight: 700; writing-mode: vertical-rl; display: grid; place-items: center; }
@media (max-width: 520px) { .plate-calc { margin-left: 0; } }

/* interval timer */
#interval-timer {
  position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 60;
  min-width: 220px; padding: 0.8rem 1rem; border-radius: 16px; color: #fff; background: #1f2937;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.3); display: flex; flex-direction: column; gap: 0.3rem;
}
#interval-timer strong { font-size: 2rem; font-variant-numeric: tabular-nums; }
#interval-timer.work { background: var(--accent); }
#interval-timer.rest { background: var(--info); }
#interval-timer.done { background: var(--good); }
#interval-timer .btn { background: rgb(255 255 255 / 0.9); color: #111; border: 0; }

/* how-to & swap sheet */
#howto { width: min(560px, calc(100vw - 32px)); }
#howto canvas { width: 100%; height: auto; border-radius: 12px; display: block; margin: 0.5rem 0 0.25rem; }
.cue-list { margin: 0.25rem 0 1rem; padding-left: 1.3rem; }
.cue-list li { margin-bottom: 0.3rem; }
.swap-list { display: flex; flex-direction: column; gap: 0.4rem; }
.swap-opt { display: flex; flex-direction: column; align-items: flex-start; text-align: left; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 0.55rem 0.7rem; cursor: pointer; }
.swap-opt:hover { border-color: var(--accent); }

/* focus mode */
body.focus-open { overflow: hidden; }
#focus-mode {
  position: fixed; inset: 0; z-index: 55; background: var(--bg); display: flex; flex-direction: column;
  padding: calc(0.75rem + env(safe-area-inset-top)) 16px calc(0.75rem + env(safe-area-inset-bottom));
}
.focus-top { display: flex; justify-content: space-between; align-items: center; }
.focus-body { flex: 1; overflow-y: auto; max-width: 640px; width: 100%; margin: 0 auto; text-align: center; padding: 1rem 0; }
.focus-body h2 { font-size: 1.8rem; margin: 0.5rem 0; }
.focus-rx { font-size: 1.15rem; font-weight: 600; margin: 0.25rem 0 0.5rem; }
.focus-cues { list-style: none; padding: 0; margin: 0.75rem 0; color: var(--muted); }
.focus-cues li::before { content: '• '; color: var(--accent); }
.focus-body .plate-calc { justify-content: center; margin: 0.5rem 0; }
.focus-sets { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0 0.5rem; }
.focus-set { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 1.4rem; font-weight: 800; cursor: pointer; }
.focus-set[aria-pressed='true'] { background: var(--good); border-color: var(--good); color: #fff; }
.focus-nav { display: flex; gap: 0.75rem; max-width: 640px; width: 100%; margin: 0 auto; }
.focus-nav .btn { flex: 1; padding: 0.9rem; font-size: 1.05rem; }

/* ======================================================================
   v6: progress, performance, team wall, celebrations
   ====================================================================== */

.badge-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.badge-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.15rem; padding: 0.7rem 0.5rem; border-radius: 12px; border: 1px dashed var(--border); opacity: 0.45; filter: grayscale(1); }
.badge-item.earned { opacity: 1; filter: none; border-style: solid; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.badge-icon { font-size: 1.8rem; }
.test-entry { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; max-height: 360px; overflow-y: auto; }
.test-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0; padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.test-row > span { display: flex; flex-direction: column; color: var(--text); font-weight: 500; }
.test-row input { width: 7rem; flex: none; }
.good-text { color: var(--good); font-weight: 600; }
.wall li { align-items: flex-start; }
.wall-icon { font-size: 1.3rem; flex: none; }
.btn.reacted { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); border-color: var(--accent); }

.celebrate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgb(0 0 0 / 0.35); overflow: hidden; }
.celebrate-card { position: relative; z-index: 2; background: var(--surface); color: var(--text); border-radius: 18px; padding: 1.25rem 1.5rem; text-align: center; display: flex; flex-direction: column; gap: 0.35rem; box-shadow: 0 20px 60px rgb(0 0 0 / 0.35); max-width: min(420px, calc(100vw - 32px)); }
.celebrate-card strong { font-size: 1.25rem; }
.celebrate-emoji { font-size: 2.6rem; }
.celebrate-card .btn { align-self: center; margin-top: 0.5rem; }
.confetti { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2.6s ease-in forwards; }
@keyframes fall { to { top: 110%; transform: translateX(40px) rotate(720deg); } }

/* ======================================================================
   v7: health, recovery, weekly report
   ====================================================================== */

.injury-list { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.injury-card { border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: 12px; padding: 0.75rem 0.9rem; background: var(--surface); }
.injury-card.out { border-left-color: var(--bad); }
.injury-card.cleared { border-left-color: var(--good); }
.injury-card + .injury-card { margin-top: 0.6rem; }
.injury-list .injury-card + .injury-card { margin-top: 0; }
.rtp { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--border); }
.rtp-stages { margin: 0.4rem 0 0; padding-left: 1.3rem; }
.rtp-stages li { padding: 0.35rem 0; display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.rtp-stages li.done { opacity: 0.75; }
.rtp-stages li.current { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 8px; padding: 0.4rem 0.5rem; }
.rtp-action { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; flex: none; }
.fuel-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.fuel-row .stat { font-size: 1.35rem; }
.tip { display: flex; gap: 0.6rem; padding: 0.5rem 0; border-top: 1px solid var(--border); }
.tip > span { font-size: 1.3rem; }
.tip.private { background: color-mix(in srgb, #ec4899 8%, transparent); border-radius: 8px; padding: 0.5rem; border-top: 0; margin-top: 0.4rem; }
.report-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.report-summary div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem; display: flex; flex-direction: column; }
.report-summary strong { font-size: 1.5rem; }
.report-summary span { color: var(--muted); font-size: 0.8rem; }
.report-table td { vertical-align: top; }

@media print {
  .topbar, .tabs, .no-print, #toast, #rest-timer, #interval-timer { display: none !important; }
  body, .card, .report-summary div { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  main { padding: 0; max-width: none; }
  .report-table { font-size: 11px; }
}

/* ---------- form trends, rep speed, telestrator ---------- */
.trend-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.velocity { margin-top: 0.6rem; }
.vel-bars { display: flex; gap: 6px; align-items: flex-end; height: 70px; margin-top: 0.3rem; }
.vel-bar { flex: 1; max-width: 40px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.vel-bar i { display: block; width: 100%; background: var(--good); border-radius: 4px 4px 0 0; min-height: 2px; }
.vel-bar.warn i { background: var(--warn, #f59e0b); }
.vel-bar.bad i { background: var(--pain); }
.vel-bar span { font-size: 0.7rem; color: var(--muted); }
#form-player { position: relative; }
.draw-layer { position: absolute; inset: 0; z-index: 5; cursor: crosshair; touch-action: none; outline: 2px dashed rgba(250, 204, 21, 0.7); outline-offset: -2px; }
.draw-toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.5rem 0; }
.draw-toolbar .swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 2px solid var(--border, #ccc); cursor: pointer; }
.draw-toolbar .swatch[aria-pressed='true'] { outline: 3px solid var(--accent, #2563eb); outline-offset: 1px; }
.draw-toolbar .draw-note { flex: 1; min-width: 140px; }

/* ---------- platform ---------- */
.skip-link { position: absolute; left: 0.5rem; top: -3rem; z-index: 1000; background: var(--accent, #ff5a1f); color: #fff; padding: 0.5rem 0.9rem; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 0.5rem; }
#staff-switch { width: auto; max-width: 220px; }
.wizard fieldset { margin-bottom: 1rem; }
:focus-visible { outline: 3px solid var(--accent, #ff5a1f); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }

/* ---------- in-app confirm / prompt ---------- */
#app-dialog { width: min(440px, calc(100vw - 32px)); }
#app-dialog h2 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.app-dialog-msg { margin: 0 0 1rem; color: var(--text); line-height: 1.45; white-space: pre-line; }
.btn-danger-solid { background: var(--pain); border-color: var(--pain); color: #fff; }
.btn-danger-solid:hover { filter: brightness(1.08); }
.copy-box { width: 100%; font: 0.8rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }

/* ---------- welcome / modes ---------- */
.welcome { max-width: 900px; margin: 1.5rem auto; text-align: center; }
.welcome .page-title { font-size: 1.9rem; }
.mode-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 1.5rem 0; text-align: left; }
.mode-card { display: flex; flex-direction: column; gap: 0.4rem; padding: 1.25rem; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: transform 0.12s, border-color 0.12s; }
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-2px); border-color: var(--accent); }
.mode-card.primary { border: 2px solid var(--accent); }
.mode-card strong { font-size: 1.1rem; }
.mode-card span:not(.mode-icon) { color: var(--muted); font-size: 0.92rem; line-height: 1.4; }
.mode-icon { font-size: 1.8rem; }
.mode-opt { align-items: flex-start; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.chip.cert { background: color-mix(in srgb, var(--good) 14%, transparent); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.chip.cert.expired { background: color-mix(in srgb, var(--warn) 14%, transparent); text-decoration: line-through; }
.chip-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 0.25rem; font-size: 0.8rem; }

/* ---------- movement screen ---------- */
.screen-item .step-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; flex: none; }
.screen-form .card { margin-bottom: 1rem; }
.grade-pick { border: 0; padding: 0; margin: 0.4rem 0; }
.grade-pick legend { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.3rem; }
.grade-opt { display: flex; flex-direction: row; gap: 0.5rem; align-items: flex-start; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 10px; margin: 0 0 0.35rem; cursor: pointer; font-weight: 400; color: var(--text); font-size: 0.9rem; }
.grade-opt > span { flex: 1; }
.grade-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.grade-opt input { margin-top: 0.2rem; width: auto; }
.grade-opt strong { display: inline-block; min-width: 1.1rem; }
.pain-check { margin-top: 0.5rem; }
.screen-score { display: flex; gap: 1rem; align-items: center; }
.big-ring { --pct: 0; --ring: var(--muted); width: 104px; height: 104px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--surface-2) 0); }
.big-ring span { width: 84px; height: 84px; border-radius: 50%; background: var(--surface); display: flex; align-items: baseline; justify-content: center; padding-top: 26px; box-sizing: border-box; font-size: 1.6rem; font-weight: 800; }
.big-ring small { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.big-ring.band-great, .big-ring.band-good { --ring: var(--good); }
.big-ring.band-fair { --ring: var(--warn); }
.big-ring.band-limited, .big-ring.band-pain { --ring: var(--bad); }
.cat-bar { margin-bottom: 0.75rem; }
.cat-bar .bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 0.3rem; }
.cat-bar .bar i { display: block; height: 100%; border-radius: 6px; background: var(--good); }
.cat-bar .bar i.warn { background: var(--warn); }
.cat-bar .bar i.bad { background: var(--bad); }
.priorities { padding-left: 1.2rem; margin: 0; }
.priorities li { margin-bottom: 0.9rem; }
.chip-btn { cursor: pointer; font: inherit; font-size: 0.8rem; }
.score-dots { letter-spacing: 1px; color: var(--muted); }
.score-dots.s3 { color: var(--good); }
.score-dots.s2 { color: var(--warn); }
.score-dots.s1, .score-dots.s0 { color: var(--bad); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { margin: 0.2rem 0; }

/* ---------- movement screen demos ---------- */
.demo-thumb { float: right; margin: 0 0 0.5rem 0.75rem; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: pointer; display: flex; flex-direction: column; color: var(--text); font: inherit; }
.demo-thumb canvas { display: block; width: 176px; height: 128px; }
.demo-thumb span { font-size: 0.78rem; font-weight: 700; padding: 0.3rem 0.5rem; text-align: center; border-top: 1px solid var(--border); }
.demo-thumb:hover, .demo-thumb:focus-visible { border-color: var(--accent); }
.screen-item::after { content: ''; display: block; clear: both; }
.demo-canvas { display: block; width: 100%; height: 360px; border-radius: 12px; }
.demo-grades li { margin: 0.2rem 0; }
@media (max-width: 560px) {
  .demo-thumb { float: none; margin: 0 0 0.6rem; width: 100%; }
  .demo-thumb canvas { width: 100%; height: 150px; }
}

/* ---------- help & FAQ ---------- */
.faq-search input { width: 100%; }
.faq-cats { margin: 0.6rem 0 0.9rem; }
.faq-cats .chip-btn[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #111); }
.faq-group { margin-bottom: 0.9rem; }
.faq-item { border-top: 1px solid var(--border); padding: 0.1rem 0; }
.faq-item:first-of-type { border-top: 0; }
.faq-group .card-head + .faq-item { border-top: 0; }
.faq-item > summary { cursor: pointer; list-style: none; display: flex; gap: 0.5rem; align-items: baseline; padding: 0.6rem 0; font-weight: 600; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::before { content: '›'; color: var(--muted); transition: transform 0.2s; }
.faq-item[open] > summary::before { transform: rotate(90deg); }
.faq-item p { margin: 0 0 0.6rem 1rem; line-height: 1.5; }
.faq-item .btn { margin: 0 0 0.7rem 1rem; }
/* recap note typing indicator */
.ai-typing { display: inline-flex; gap: 4px; } .ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: aiDot 1s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: 0.15s; } .ai-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- weekly summary ---------- */
.sum-headline { font-size: 1.1rem; font-weight: 700; margin: 0.1rem 0 0.6rem; }
.sum-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.sum-stat { background: var(--surface-2); border-radius: 12px; padding: 0.55rem 0.7rem; display: flex; flex-direction: column; }
.sum-stat strong { font-size: 1.25rem; } .sum-stat span { font-size: 0.78rem; color: var(--muted); } .sum-stat small { font-size: 0.72rem; color: var(--muted); }
.sum-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 0.75rem; }
.sum-cols h4 { margin: 0 0 0.35rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.sum-list li { margin: 0.3rem 0; font-size: 0.92rem; line-height: 1.4; }
@media (max-width: 640px) { .sum-stats { grid-template-columns: repeat(2, 1fr); } .sum-cols { grid-template-columns: 1fr; } }

/* ---------- calendar ---------- */
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mg-head { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-align: center; padding: 0.2rem 0; }
.mg-day { min-height: 84px; border: 1px solid var(--border); border-radius: 8px; padding: 0.25rem; display: flex; flex-direction: column; gap: 2px; cursor: pointer; overflow: hidden; background: var(--surface); }
.mg-day.out { opacity: 0.45; } .mg-day.today { border-color: var(--accent); } .mg-day.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.mg-num { font-size: 0.78rem; font-weight: 700; }
.mg-dot { font-size: 0.7rem; display: flex; gap: 2px; align-items: center; border-radius: 5px; padding: 0 3px; background: var(--surface-2); white-space: nowrap; overflow: hidden; }
.mg-dot em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.mg-dot.game, .mg-dot.meet { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.mg-dot.session { background: color-mix(in srgb, var(--good) 15%, transparent); }
i.mg-dot { display: inline-block; width: 10px; height: 10px; padding: 0; margin-right: 2px; vertical-align: middle; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.6rem; color: var(--muted); }
.att-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 40vh; overflow-y: auto; }
.att-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
@media (max-width: 640px) { .mg-day { min-height: 54px; } .mg-dot em { display: none; } }

/* ---------- wellness ---------- */
.fuel-rings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.fuel-ring { display: flex; align-items: center; gap: 0.6rem; }
.mini-ring.big { width: 58px; height: 58px; --ring: var(--accent); } .mini-ring.big span { width: 46px; height: 46px; font-size: 0.8rem; }
.fuel-ring.protein .mini-ring { --ring: var(--good); } .fuel-ring.carbs .mini-ring { --ring: var(--warn, #f59e0b); } .fuel-ring.water .mini-ring { --ring: #3b82f6; }
@media (max-width: 720px) { .fuel-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.meal { border-bottom: 1px solid var(--border); padding: 0.5rem 0; } .meal:last-child { border-bottom: 0; }
.meal ul { margin: 0.25rem 0 0; }
.food-results { max-height: 300px; overflow-y: auto; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 0.75rem; align-items: end; }
.bar { height: 8px; border-radius: 5px; background: var(--surface-2); overflow: hidden; position: relative; margin: 0.25rem 0; }
.bar i { display: block; height: 100%; background: var(--good); border-radius: 5px; }
.breath-stage { position: relative; height: 220px; display: grid; place-items: center; }
.breath-circle { width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #7dd3fc, #3b82f6 60%, #1e40af); transform: scale(0.45); transition: transform 0.12s linear; box-shadow: 0 0 40px rgba(59, 130, 246, 0.35); }
.breath-text { position: absolute; text-align: center; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45); display: flex; flex-direction: column; }
.breath-text span { font-size: 1.6rem; font-weight: 800; }
.routine { padding-left: 1.2rem; } .routine li { margin: 0.25rem 0; }
.visual-text { font-size: 1.15rem; line-height: 1.5; min-height: 4.5em; }
.rate { display: flex; gap: 0.15rem; flex-wrap: wrap; } .rate label { margin: 0; } .rate input { position: absolute; opacity: 0; pointer-events: none; }
.rate span { display: grid; place-items: center; width: 28px; height: 28px; font-size: 0.85rem; border-radius: 50%; border: 1px solid var(--border); cursor: pointer; color: var(--text); font-weight: 600; }
.rate input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.rate input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.seg-radio { margin: 0; } .seg-radio input { position: absolute; opacity: 0; } .seg-radio span { display: inline-block; padding: 0.3rem 0.65rem; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg-radio input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* ---------- challenges ---------- */
.section-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.25rem 0 0.5rem; }
.ch-bar { height: 12px; overflow: visible; } .ch-bar i { background: var(--accent); }
.ch-bar .pace { position: absolute; top: -3px; width: 2px; height: 18px; background: var(--text); opacity: 0.55; border-radius: 1px; }
.ch-mini { padding: 0.35rem 0; }
.leaderboard { list-style: none; padding: 0; margin: 0; }
.leaderboard li { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: 0.25rem 0.6rem; align-items: center; padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.leaderboard li .bar { grid-column: 2 / -1; margin: 0; }
.leaderboard li.me { background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 8px; }
.leaderboard .rank { text-align: center; font-weight: 800; } .leaderboard .val { font-weight: 700; }

/* ---------- recruiting profile ---------- */
.profile-hero { display: flex; gap: 1rem; align-items: center; margin-bottom: 0.75rem; }
.avatar.xl { width: 76px; height: 76px; font-size: 1.7rem; background: var(--accent); color: #fff; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: 0.5rem; }
.profile-facts span { display: flex; flex-direction: column; } .profile-facts small { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.profile-bio { font-size: 1.02rem; line-height: 1.55; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 1.5rem; }
.profile-page h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1rem 0 0.4rem; }
.profile-page footer { margin-top: 1.25rem; }
@media print { .profile-page { box-shadow: none !important; border: 0 !important; } }

/* ---------- live coach ---------- */
.live-stage { position: relative; background: #0b0d12; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; width: min(100%, calc(62vh * 16 / 9)); margin: 0 auto; }
.live-stage video, .live-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.live-stage video.mirror { transform: scaleX(-1); }
.live-hud { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 0.75rem; padding: 0.75rem; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); color: #fff; }
.live-reps { display: flex; flex-direction: column; align-items: center; background: rgba(255, 255, 255, 0.12); border-radius: 12px; padding: 0.3rem 0.9rem; }
.live-reps span { font-size: 2.4rem; font-weight: 800; line-height: 1; } .live-reps small { font-size: 0.7rem; opacity: 0.8; }
.live-cue { font-size: 1.15rem; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.live-log { max-height: 160px; overflow-y: auto; padding-left: 1.2rem; margin: 0.6rem 0 0; }
.live-log li.bad { color: var(--bad); } .live-log li.warn { color: var(--warn, #d97706); } .live-log li.good { color: var(--good); }
@media (max-width: 640px) { .live-stage { aspect-ratio: 3 / 4; width: 100%; } }
#live-set {
  position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; gap: 0.5rem; overflow-y: auto;
  padding: calc(0.75rem + env(safe-area-inset-top)) 16px calc(0.75rem + env(safe-area-inset-bottom));
}
#live-set .live-stage { width: min(100%, calc(70vh * 16 / 9)); }
.form-fix { text-align: left; margin: 0.5rem 0; }
.pill.hold { background: color-mix(in srgb, var(--warn, #d97706) 18%, var(--surface)); }
.pill.next-load.up { background: color-mix(in srgb, var(--good, #16a34a) 18%, var(--surface)); }
.pill.next-load.down { background: color-mix(in srgb, var(--warn, #d97706) 18%, var(--surface)); }
.profile-page .pill { white-space: nowrap; }
/* keep visually hidden radios inside their labels so they never widen the page */
.rate label, .seg-radio { position: relative; }
.rate input, .seg-radio input { width: 1px; height: 1px; left: 0; top: 0; margin: 0; }

/* =====================================================================
   v6 design system: modern, dark-first "glass + glow"
   Overrides earlier styles. Light theme stays available in Settings.
   ===================================================================== */
:root {
  --bg: #f4f6fb;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-2: rgba(15, 23, 42, 0.045);
  --text: #0c111d;
  --muted: #5b6478;
  --border: rgba(15, 23, 42, 0.09);
  --accent: #ff5a1f;
  --accent-2: #ff2e7e;
  --cyan: #0ea5e9;
  --grad: linear-gradient(135deg, #ff7a2b 0%, #ff2e7e 100%);
  --grad-cool: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
  --good: #16a34a;
  --warn: #d97706;
  --bad: #e11d48;
  --pain: var(--bad);
  --info: #2563eb;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -16px rgba(16, 24, 40, 0.18);
  --glow: 0 0 0 1px rgba(255, 90, 31, 0.25), 0 8px 30px -6px rgba(255, 60, 90, 0.45);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --side-w: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #06080c; --surface: rgba(20, 24, 33, 0.62); --surface-solid: #11151d; --surface-2: rgba(255, 255, 255, 0.05);
    --text: #eef2f9; --muted: #8b94a8; --border: rgba(255, 255, 255, 0.08);
    --good: #22c55e; --warn: #f59e0b; --bad: #fb4570; --info: #38bdf8; --cyan: #22d3ee;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #06080c; --surface: rgba(20, 24, 33, 0.62); --surface-solid: #11151d; --surface-2: rgba(255, 255, 255, 0.05);
  --text: #eef2f9; --muted: #8b94a8; --border: rgba(255, 255, 255, 0.08);
  --good: #22c55e; --warn: #f59e0b; --bad: #fb4570; --info: #38bdf8; --cyan: #22d3ee;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

body { font-family: var(--font); font-size: 15px; letter-spacing: -0.005em; background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .page-title, .hero-title, .stat, .brand span { font-family: var(--font-display); }

/* ambient background: soft glows + a faint tech grid */
.bg-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-fx::before { content: ''; position: absolute; inset: -20%; background:
  radial-gradient(40% 35% at 15% 10%, rgba(255, 106, 43, 0.16), transparent 70%),
  radial-gradient(35% 35% at 90% 20%, rgba(255, 46, 126, 0.12), transparent 70%),
  radial-gradient(45% 40% at 70% 100%, rgba(34, 211, 238, 0.10), transparent 70%); }
.bg-fx::after { content: ''; position: absolute; inset: 0; opacity: 0.5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); }
:root[data-theme='light'] .bg-fx::after { opacity: 0.6; }

/* ---------- app shell ---------- */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); display: flex; flex-direction: column; gap: 0.5rem; padding: 1.1rem 0.85rem; z-index: 20;
  background: color-mix(in srgb, var(--surface-solid) 70%, transparent); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border-right: 1px solid var(--border); }
.content { margin-left: var(--side-w); min-width: 0; }
.brand { display: flex; align-items: center; gap: 0.55rem; font-size: 1.22rem; padding: 0.2rem 0.5rem 0.8rem; letter-spacing: -0.02em; }
.brand strong { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand svg { width: 30px; height: 30px; fill: none; stroke: url(#brand-g); stroke: var(--accent); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 8px rgba(255, 90, 31, 0.55)); }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.62rem 0.8rem; border-radius: 12px; border: 0; background: transparent; color: var(--muted); font: 600 0.93rem/1 var(--font); cursor: pointer; text-align: left; transition: background 0.15s, color 0.15s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current='page'] { color: var(--text); background: linear-gradient(90deg, rgba(255, 106, 43, 0.16), rgba(255, 46, 126, 0.06)); box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.22); }
.nav-item[aria-current='page']::before { content: ''; position: absolute; left: -0.85rem; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px rgba(255, 90, 31, 0.8); }
.nav-item .badge, .tab-item .badge, .more-item .badge { margin-left: auto; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.side-controls { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.side-controls .segmented { width: 100%; } .side-controls .segmented button { flex: 1; }
.side-controls select { width: 100%; max-width: none; }
.btn-log { width: 100%; justify-content: center; }
.topbar { display: none; }
.tabs { display: none; }

main { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.75rem 4rem; }
.subnav { position: sticky; top: 0; z-index: 15; max-width: 1180px; margin: 0 auto; padding: 0.9rem 1.75rem 0; }
.subnav:empty { display: none; }
.pill-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--surface-solid) 75%, transparent); border: 1px solid var(--border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.pill-tabs button { border: 0; background: transparent; color: var(--muted); font: 600 0.86rem var(--font); padding: 0.45rem 0.95rem; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.pill-tabs button:hover { color: var(--text); }
.pill-tabs button[aria-selected='true'] { color: #fff; background: var(--grad); box-shadow: 0 4px 18px -4px rgba(255, 60, 90, 0.6); }

.bottombar, .more-sheet { display: none; }
body.no-nav .sidebar, body.no-nav .bottombar { display: none !important; }
body.no-nav .content { margin-left: 0; }
body.no-nav .topbar { display: flex !important; }

/* ---------- phones & small tablets ---------- */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .content { margin-left: 0; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 25; max-width: none; padding: 0.6rem 16px; gap: 0.5rem; flex-wrap: nowrap;
    background: color-mix(in srgb, var(--surface-solid) 72%, transparent); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border-bottom: 1px solid var(--border); }
  .topbar .brand { padding: 0; font-size: 1.08rem; }
  .topbar .brand svg { width: 26px; height: 26px; }
  .topbar-controls { flex-wrap: nowrap; gap: 0.4rem; min-width: 0; }
  .top-controls { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
  .top-controls .segmented button { padding: 0.32rem 0.55rem; font-size: 0.78rem; }
  .top-controls select { max-width: 7.5rem; padding: 0.35rem 0.45rem; font-size: 0.82rem; }
  .icon-btn { flex: none; }
  .subnav { top: 57px; padding: 0.7rem 16px 0; }
  main { padding: 1rem 16px calc(88px + env(safe-area-inset-bottom)); }
  .bottombar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; padding: 6px; border-radius: 22px;
    background: color-mix(in srgb, var(--surface-solid) 78%, transparent); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); border: 1px solid var(--border); box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.55); }
  .tab-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; border: 0; background: none; color: var(--muted); font: 600 0.68rem var(--font); cursor: pointer; border-radius: 14px; }
  .tab-item .ico { width: 22px; height: 22px; }
  .tab-item[aria-current='page'] { color: var(--text); }
  .tab-item[aria-current='page'] .ico { stroke: var(--accent); filter: drop-shadow(0 0 6px rgba(255, 90, 31, 0.7)); }
  .tab-item .badge { position: absolute; top: 0; left: 56%; margin: 0; }
  .more-sheet { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(3px); }
  .more-sheet[hidden] { display: none; }
  .more-panel { position: absolute; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 10px 14px 16px; border-radius: 24px; background: var(--surface-solid); border: 1px solid var(--border); animation: sheetUp 0.22s ease-out; }
  .more-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 0 auto 12px; }
  .more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .more-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 600 0.8rem var(--font); cursor: pointer; }
  .more-item .ico { width: 24px; height: 24px; stroke: var(--accent); }
  .more-item .badge { position: absolute; top: 6px; right: 8px; }
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- surfaces & type ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); padding: 1.1rem 1.2rem; transition: border-color 0.2s, transform 0.2s; }
.card.clickable:hover, .clickable.card:hover { transform: translateY(-2px); border-color: rgba(255, 106, 43, 0.35); }
.card-head h3 { font: 600 0.98rem/1.3 var(--font-display); text-transform: none; letter-spacing: -0.01em; color: var(--text); margin: 0; }
.card h3 { letter-spacing: -0.01em; }
.page-title { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; margin: 0.2rem 0 0.9rem; }
.muted { color: var(--muted); }
.stat { font-family: var(--font-mono); font-weight: 700; letter-spacing: -0.03em; }
.grid { gap: 1rem; }
dialog { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7); }
dialog::backdrop { background: rgba(3, 5, 9, 0.6); backdrop-filter: blur(6px); }

/* buttons, inputs, pills */
.btn { display: inline-flex; align-items: center; gap: 0.45rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-weight: 600; transition: transform 0.12s, background 0.15s, box-shadow 0.15s, border-color 0.15s; }
.btn:hover { background: color-mix(in srgb, var(--text) 9%, transparent); border-color: color-mix(in srgb, var(--text) 16%, transparent); }
.btn:active { transform: scale(0.98); }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 20px -8px rgba(255, 60, 90, 0.7); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); box-shadow: var(--glow); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--bad); }
.btn-glow { box-shadow: var(--glow); }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.icon-btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 18px -6px rgba(255, 60, 90, 0.8); }
.icon-btn .ico { width: 20px; height: 20px; }
input, select, textarea { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-family: var(--font); transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(255, 106, 43, 0.6); box-shadow: 0 0 0 3px rgba(255, 106, 43, 0.18); }
select option { background: var(--surface-solid); color: var(--text); }
.segmented { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.segmented button[aria-pressed='true'] { background: var(--surface-solid); color: var(--text); box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.35); }
.badge { background: var(--grad); color: #fff; box-shadow: 0 0 10px rgba(255, 60, 90, 0.55); font-family: var(--font-mono); }
.pill { border-radius: 999px; font-weight: 600; letter-spacing: 0.01em; }
.chip { border-radius: 999px; background: var(--surface-2); border-color: var(--border); }
.list li { border-color: var(--border); }
table th { color: var(--muted); font-weight: 600; }
.sport-dot { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.avatar { background: var(--grad-cool); color: #fff; border: 0; font-family: var(--font-display); }
.avatar.coach { background: var(--grad); color: #fff; }
.banner { border-radius: 14px; backdrop-filter: blur(10px); }
#toast { background: var(--surface-solid); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6); }
@media (max-width: 860px) { #toast { bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* rings glow with their band colour */
.ring, .mini-ring, .big-ring { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--ring, var(--accent)) 45%, transparent)); }
.ring span, .mini-ring span, .big-ring span { background: var(--surface-solid); font-family: var(--font-mono); }

/* ---------- home hero ---------- */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.55fr) 210px minmax(0, 1fr); gap: 1.5rem; align-items: center; padding: 1.6rem 1.7rem; margin-bottom: 1rem; border-radius: 26px; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface-solid) 88%, transparent), color-mix(in srgb, var(--surface-solid) 60%, transparent)); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.hero::before { content: ''; position: absolute; width: 420px; height: 420px; right: -120px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 70, 90, 0.28), transparent 65%); pointer-events: none; }
.hero::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(255, 122, 43, 0.5), transparent 35%, transparent 65%, rgba(34, 211, 238, 0.35)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.eyebrow { font: 600 0.72rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.hero-title { font-size: 2.3rem; line-height: 1.08; letter-spacing: -0.035em; margin: 0.35rem 0 0.4rem; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--muted); margin: 0 0 1rem; max-width: 34rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.qa { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.55rem 0.85rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 600 0.85rem var(--font); cursor: pointer; transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s; }
.qa .ico { width: 18px; height: 18px; stroke: var(--accent); }
.qa:hover { transform: translateY(-1px); border-color: rgba(255, 106, 43, 0.45); box-shadow: 0 6px 20px -10px rgba(255, 60, 90, 0.7); }
.hero-gauge { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; position: relative; z-index: 1; }
.gauge-ring { --pct: 0; --ring: var(--accent); width: 176px; height: 176px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(from 220deg, var(--ring) 0, color-mix(in srgb, var(--ring) 60%, #fff) calc(var(--pct) * 1%), var(--surface-2) 0); filter: drop-shadow(0 0 22px color-mix(in srgb, var(--ring) 55%, transparent)); animation: ringIn 0.9s ease-out; }
.gauge-ring > div { width: 146px; height: 146px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--surface-solid) 92%, #fff 4%), var(--surface-solid)); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35); }
.gauge-ring strong { font: 700 3rem/1 var(--font-mono); letter-spacing: -0.05em; }
.gauge-ring span { font: 600 0.68rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-top: 4px; }
.gauge-ring.band-go { --ring: var(--good); } .gauge-ring.band-steady { --ring: var(--cyan); } .gauge-ring.band-easy { --ring: var(--warn); } .gauge-ring.band-rest { --ring: var(--bad); } .gauge-ring.empty { --ring: var(--muted); }
.gauge-label { font: 600 0.95rem var(--font-display); }
@keyframes ringIn { from { transform: scale(0.85) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.hero-session { position: relative; z-index: 1; padding: 1rem 1.1rem; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-start; }
.session-name { font: 700 1.2rem/1.2 var(--font-display); letter-spacing: -0.02em; }
.hero-session .btn { margin-top: 0.5rem; }
@media (max-width: 1080px) { .hero { grid-template-columns: minmax(0, 1fr) 190px; } .hero-session { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; } .hero-session .btn { margin: 0 0 0 auto; } }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; padding: 1.2rem; gap: 1rem; border-radius: 22px; }
  .hero-title { font-size: 1.8rem; }
  .hero-gauge { order: -1; flex-direction: row; justify-content: flex-start; gap: 1rem; }
  .gauge-ring { width: 118px; height: 118px; } .gauge-ring > div { width: 96px; height: 96px; } .gauge-ring strong { font-size: 2.1rem; }
  .quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); } .qa { flex-direction: column; justify-content: center; padding: 0.6rem 0.3rem; font-size: 0.74rem; text-align: center; }
  .hero-session .btn { margin: 0.3rem 0 0; width: 100%; justify-content: center; }
  .page-title { font-size: 1.55rem; }
}

/* welcome / modes */
.mode-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; backdrop-filter: blur(16px); }
.mode-card.primary { border: 1px solid transparent; background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--grad) border-box; box-shadow: var(--glow); }
.welcome .page-title { font-size: 2.6rem; background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 60%, transparent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* page transition */
.view-enter { animation: viewIn 0.32s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view-enter, .gauge-ring, .more-panel { animation: none !important; } .card, .btn, .qa { transition: none !important; } }

@media print {
  .sidebar, .bottombar, .subnav, .topbar, .bg-fx, .more-sheet { display: none !important; }
  .content { margin: 0 !important; }
  .card, .hero { backdrop-filter: none !important; background: #fff !important; }
}
@media (max-width: 480px) {
  .topbar .brand span { display: none; }
  .top-controls select { max-width: 9rem; }
}

/* =====================================================================
   Smart features: why breakdowns, quick check-in, voice log, risk, adapt, partners, goals
   ===================================================================== */
button.gauge-ring { border: 0; padding: 0; cursor: pointer; color: var(--text); font: inherit; }
button.gauge-ring:hover { transform: scale(1.02); }
button.gauge-ring:focus-visible { outline: 3px solid rgba(255, 106, 43, 0.6); outline-offset: 4px; }
.gauge-ring span { transition: color 0.15s; }
button.gauge-ring:hover span { color: var(--accent); }

.risk-chip { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 600 0.75rem var(--font); cursor: pointer; }
.risk-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.risk-chip.risk-moderate i { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.risk-chip.risk-high i { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.risk-chip:hover { border-color: rgba(255, 106, 43, 0.45); }
.risk-line { font-weight: 600; }
.risk-line.risk-moderate { color: var(--warn); } .risk-line.risk-high { color: var(--bad); }

.risk-card .risk-meter { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.4rem; }
.risk-score { display: flex; flex-direction: column; align-items: flex-start; min-width: 4.5rem; }
.risk-score strong { font: 700 2rem/1 var(--font-mono); }
.risk-score span { font: 600 0.72rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.risk-track { flex: 1; height: 10px; border-radius: 10px; background: color-mix(in srgb, var(--text) 8%, transparent); position: relative; overflow: hidden; }
.risk-track i { position: absolute; inset: 0 auto 0 0; border-radius: 10px; }
.risk-card.risk-low .risk-track i { background: var(--good); } .risk-card.risk-moderate .risk-track i { background: var(--warn); } .risk-card.risk-high .risk-track i { background: var(--bad); }
.risk-card.risk-high { border-color: color-mix(in srgb, var(--bad) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--bad) 25%, transparent), 0 16px 40px -20px var(--bad); }
.risk-card.risk-moderate { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.risk-factors { list-style: none; padding: 0; margin: 0.3rem 0 0; display: grid; gap: 0.25rem; font-size: 0.9rem; }
.risk-factors b { font-family: var(--font-mono); color: var(--warn); margin-right: 0.2rem; }
.risk-high .risk-factors b { color: var(--bad); }

/* why dialog */
#app-dialog.wide { width: min(600px, calc(100vw - 24px)); }
.why-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.why-head h2 { margin: 0.15rem 0 0; font-size: 1.35rem; }
.why-big { flex: none; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font: 700 1.6rem var(--font-mono); color: #fff; background: var(--grad); box-shadow: var(--glow); }
.why-big.band-go, .why-big.tone-good, .why-big.risk-low { background: linear-gradient(135deg, #22c55e, #10b981); box-shadow: 0 0 24px -4px #22c55e; }
.why-big.band-steady { background: linear-gradient(135deg, #22d3ee, #3b82f6); box-shadow: 0 0 24px -4px #22d3ee; }
.why-big.band-easy, .why-big.tone-warn, .why-big.risk-moderate { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 0 24px -4px #f59e0b; }
.why-big.band-rest, .why-big.tone-bad, .why-big.risk-high { background: linear-gradient(135deg, #fb4570, #e11d48); box-shadow: 0 0 24px -4px #fb4570; }
.why-big .ico-lg { width: 34px; height: 34px; stroke: #fff; }
.why-sub { font: 600 0.78rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 1rem 0 0.4rem; }
.why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.why-row { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; align-items: center; padding: 0.6rem 0.75rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.why-main { display: flex; flex-direction: column; min-width: 0; }
.why-val { font: 700 0.92rem var(--font-mono); text-align: right; }
.why-val.small { font: 500 0.8rem var(--font); max-width: 16rem; color: var(--muted); }
.why-bar { grid-column: 1 / -1; height: 5px; border-radius: 5px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.why-bar i { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.why-row.tone-warn .why-bar i { background: var(--warn); } .why-row.tone-bad .why-bar i { background: var(--bad); }
.why-row.tone-good .why-main strong::after, .why-row.tone-warn .why-main strong::after, .why-row.tone-bad .why-main strong::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 0.45rem; vertical-align: middle; background: var(--good); }
.why-row.tone-warn .why-main strong::after { background: var(--warn); } .why-row.tone-bad .why-main strong::after { background: var(--bad); }
.why-reasons { margin: 0 0 0.5rem; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.why-tip { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 1rem; padding: 0.75rem 0.9rem; border-radius: 14px; background: linear-gradient(135deg, rgba(255, 122, 43, 0.12), rgba(255, 46, 126, 0.08)); border: 1px solid rgba(255, 106, 43, 0.25); }
.why-tip .ico { stroke: var(--accent); flex: none; margin-top: 1px; }

/* quick check-in */
.qc-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.qc-head h2 { margin: 0.15rem 0 0; }
.qc-preview { margin-left: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--ring, var(--accent)); box-shadow: 0 0 18px -4px var(--ring, var(--accent)); transition: border-color 0.2s, box-shadow 0.2s; flex: none; }
.qc-preview strong { font: 700 1.5rem/1 var(--font-mono); }
.qc-preview span { font: 600 0.55rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.qc-preview.band-go { --ring: var(--good); } .qc-preview.band-steady { --ring: var(--cyan); } .qc-preview.band-easy { --ring: var(--warn); } .qc-preview.band-rest { --ring: var(--bad); }
.qc-row { border: 0; padding: 0; margin: 0.75rem 0 0; }
.qc-row legend { font: 600 0.78rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.4rem; padding: 0; }
.qc-opts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.qc-opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0.55rem 0.2rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; text-align: center; margin: 0; transition: transform 0.1s, border-color 0.15s, background 0.15s; }
.qc-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.qc-opt:hover { transform: translateY(-1px); }
.qc-opt:has(input:checked) { border-color: transparent; background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; box-shadow: 0 6px 18px -10px rgba(255, 60, 90, 0.9); }
.qc-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.qc-emo { font-size: 1.35rem; line-height: 1.2; font-weight: 700; font-family: var(--font-mono); }
.qc-txt { font-size: 0.68rem; color: var(--muted); font-weight: 600; }

/* voice log */
.voice h2 { margin: 0.15rem 0 0; }
.voice-stage { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.mic-btn { width: 64px; height: 64px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--grad); color: #fff; cursor: pointer; box-shadow: var(--glow); }
.mic-btn .ico { width: 28px; height: 28px; stroke: #fff; }
.mic-btn:disabled { background: var(--surface-2); box-shadow: none; cursor: not-allowed; }
.mic-btn:disabled .ico { stroke: var(--muted); }
.mic-btn.listening { animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 60, 90, 0.6); } 50% { box-shadow: 0 0 0 16px rgba(255, 60, 90, 0); } }
.voice-preview { margin-top: 0.5rem; padding: 0.8rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.voice-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; margin: 0; }
.voice-dl dt { font: 600 0.68rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.voice-dl dd { margin: 0.1rem 0 0; font-weight: 600; }
.voice-ex { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.3rem; }
.voice-ex li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0.6rem; border-radius: 10px; background: color-mix(in srgb, var(--text) 4%, transparent); }
.voice-ex span { font-family: var(--font-mono); font-size: 0.85rem; }
.dialog-title-row { margin-bottom: 0.75rem; }

/* adaptive plan */
.adapt-banner, .nudge-banner { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.75rem 1rem; margin-bottom: 1rem; border: 1px solid var(--border); background: var(--surface); }
.adapt-banner > .ico { stroke: var(--accent); flex: none; }
.adapt-banner .main, .nudge-banner .main { display: flex; flex-direction: column; flex: 1; min-width: 12rem; }
.adapt-banner { background: linear-gradient(135deg, rgba(255, 122, 43, 0.14), rgba(255, 46, 126, 0.06)); border-color: rgba(255, 106, 43, 0.3); }
.adapt-banner.adapt-deload { background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(99, 102, 241, 0.06)); border-color: rgba(34, 211, 238, 0.3); }
.adapt-banner.adapt-deload > .ico { stroke: var(--cyan); }
.nudge-banner { background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(34, 211, 238, 0.06)); border-color: rgba(34, 197, 94, 0.3); }
.nudge-emoji { font-size: 1.5rem; animation: wave 1.6s ease-in-out 2; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } }
.adapt-card h3 .ico { width: 18px; height: 18px; stroke: var(--accent); vertical-align: -3px; }
.adapted-tag { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.55rem; border-radius: 999px; border: 1px solid rgba(255, 106, 43, 0.35); background: rgba(255, 106, 43, 0.1); color: var(--accent); font: 600 0.72rem var(--font); cursor: pointer; }
.adapted-tag .ico { width: 13px; height: 13px; }
.switch { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--border); position: relative; cursor: pointer; transition: background 0.2s; margin: 0; padding: 0; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.2s, background 0.2s; }
.switch input:checked { background: var(--grad); border-color: transparent; }
.switch input:checked::after { transform: translateX(16px); background: #fff; }

/* partners */
.pt-cols { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.pt-col { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; text-align: center; padding: 0.7rem 0.4rem; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.pt-stat { display: flex; align-items: baseline; gap: 0.3rem; }
.pt-stat b { font: 700 1.3rem var(--font-mono); }
.pt-stat span { font-size: 0.75rem; color: var(--muted); }
.pt-vs { font: 700 0.8rem var(--font-mono); color: var(--muted); text-transform: uppercase; }
.nudge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.nudge-btn { border-radius: 999px; }
.partner-card select { width: 100%; }

/* goals */
.focus-picker { text-align: center; }
.focus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.6rem; margin-top: 1rem; }
.focus-opt { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 1.1rem 0.6rem; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 600 0.9rem var(--font); cursor: pointer; transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s; }
.focus-opt:hover { transform: translateY(-2px); border-color: rgba(255, 106, 43, 0.45); box-shadow: 0 10px 30px -14px rgba(255, 60, 90, 0.8); }
.focus-opt.on { border-color: transparent; background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.focus-icon { font-size: 1.8rem; }
.focus-tag { display: inline-flex; align-items: center; gap: 0.25rem; text-transform: none; letter-spacing: 0; font-family: var(--font); color: var(--text); }

/* advanced settings */
.advanced { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0; }
.advanced > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.2rem; font: 600 0.98rem var(--font-display); }
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before { content: '›'; font-size: 1.3rem; line-height: 1; color: var(--muted); transition: transform 0.2s; }
.advanced[open] > summary::before { transform: rotate(90deg); }
.advanced > .grid { padding: 0 1rem 1rem; }
.advanced .card { box-shadow: none; background: var(--surface-2); backdrop-filter: none; -webkit-backdrop-filter: none; }

@media (max-width: 640px) {
  .qc-opts { gap: 4px; }
  .qc-emo { font-size: 1.15rem; }
  .qc-txt { font-size: 0.6rem; }
  .why-row { grid-template-columns: 1fr; }
  .why-val { text-align: left; }
  .hero-gauge .risk-chip { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .mic-btn.listening, .nudge-emoji { animation: none; } }
.dialog-actions { flex-wrap: wrap; }

/* =====================================================================
   Sports science: evidence, normal ranges, performance data, age & growth, import
   ===================================================================== */
.ev-grade { display: inline-flex; align-items: center; padding: 0.1rem 0.5rem; border-radius: 999px; font: 700 0.68rem var(--font-mono); letter-spacing: 0.02em; border: 1px solid currentColor; white-space: nowrap; }
.ev-A { color: var(--good); } .ev-B { color: var(--cyan); } .ev-C { color: var(--warn); }
.ev-chip { display: inline-flex; align-items: center; gap: 0.15rem; margin-left: 0.3rem; padding: 0.05rem 0.4rem; border-radius: 999px; border: 1px solid currentColor; background: transparent; font: 700 0.66rem var(--font-mono); cursor: pointer; vertical-align: 1px; }
.ev-chip:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.ev-refs { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.ev-refs li { padding: 0.55rem 0.7rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.88rem; line-height: 1.4; }
.ev-details { margin-top: 0.6rem; border: 1px solid var(--border); border-radius: 14px; padding: 0.2rem 0.8rem 0.6rem; background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.ev-details > summary { cursor: pointer; padding: 0.5rem 0; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; list-style: none; }
.ev-details > summary::-webkit-details-marker { display: none; }
.ev-details > summary::before { content: '›'; color: var(--muted); transition: transform 0.2s; }
.ev-details[open] > summary::before { transform: rotate(90deg); }
.ev-rule + .ev-rule { margin-top: 0.8rem; }
.ev-block { margin: 1rem 0; }
.sci-cta { background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), rgba(99, 102, 241, 0.06)), var(--surface); border-color: rgba(34, 211, 238, 0.25); }
.sci-cta .main { flex: 1; min-width: 14rem; }

.nr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.nr-list li { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 0.6rem; align-items: center; }
.nr-main { display: flex; flex-direction: column; min-width: 0; }
.nr-bar { grid-column: 1 / -1; position: relative; height: 8px; border-radius: 8px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.nr-bar.building { height: auto; background: none; font-size: 0.72rem; color: var(--muted); }
.nr-band { position: absolute; left: 33.3%; width: 33.4%; top: 0; bottom: 0; border-radius: 8px; background: color-mix(in srgb, var(--good) 30%, transparent); }
.nr-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); border: 2px solid var(--surface-solid); }
.nr-dot.worse { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.nr-dot.better { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

.pf-block + .pf-block { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.pf-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.spark { width: 100%; height: 54px; display: block; }
.spark-band { fill: color-mix(in srgb, var(--good) 16%, transparent); }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-dot { fill: var(--accent); }
.pf-table { width: 100%; font-size: 0.88rem; }
.pf-table td { padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.pf-table td:nth-child(2), .pf-table td:nth-child(3) { text-align: right; font-family: var(--font-mono); }
.pf-table .bad-t { color: var(--bad); font-weight: 700; } .pf-table .warn-t { color: var(--warn); font-weight: 700; }
.pf-vbt { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.pf-vbt li { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding: 0.45rem 0.6rem; border-radius: 10px; background: var(--surface-2); }

.age-focus { margin: 0 0 0.75rem; padding-left: 1.1rem; display: grid; gap: 0.25rem; }
.mat-box { padding: 0.8rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.mat-box.mat-circa { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.growth-form { margin-top: 0.6rem; align-items: flex-end; gap: 0.5rem; }
.growth-form label { flex: 1; min-width: 6.5rem; margin: 0; font-size: 0.78rem; }
.import-card .row { gap: 0.5rem; }

/* =====================================================================
   Goals: grouped picker, target, progress ring, effects
   ===================================================================== */
.goal-group { font: 600 0.75rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 1.1rem 0 0.5rem; text-align: left; }
.focus-picker .focus-grid, .card .focus-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 0; }
.focus-opt { text-align: center; }
.focus-desc { font: 500 0.74rem var(--font); color: var(--muted); }
button.focus-tag { border: 1px solid rgba(255, 106, 43, 0.35); background: rgba(255, 106, 43, 0.1); border-radius: 999px; padding: 0.12rem 0.55rem; cursor: pointer; font: 600 0.72rem var(--font); color: var(--text); text-transform: none; letter-spacing: 0; }
button.focus-tag:hover { border-color: var(--accent); }

.goal-card .goal-top { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.goal-main { flex: 1; min-width: 14rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.goal-title { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; }
.goal-progress { margin: 0; color: var(--muted); }
.goal-progress strong { color: var(--text); font-family: var(--font-mono); }
.goal-ring { --pct: 0; --ring: var(--accent); width: 92px; height: 92px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), color-mix(in srgb, var(--text) 8%, transparent) 0); filter: drop-shadow(0 0 12px color-mix(in srgb, var(--ring) 45%, transparent)); }
.goal-ring > div { width: 74px; height: 74px; border-radius: 50%; background: var(--surface-solid); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.goal-ring strong { font: 700 1.25rem/1 var(--font-mono); }
.goal-ring span { font: 600 0.55rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 3px; }
.goal-ring.reached { --ring: var(--good); } .goal-ring.behind { --ring: var(--warn); } .goal-ring.no-target, .goal-ring.no-data { --ring: var(--muted); }
.goal-target { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 0.6rem 0.8rem; align-items: end; }
.goal-target label { margin: 0; }
.goal-effects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.55rem; }
.goal-effects li { display: flex; gap: 0.7rem; padding: 0.75rem 0.85rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.goal-effects .ge-icon { font-size: 1.3rem; line-height: 1.2; }
.goal-effects div { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.88rem; }
.goal-effects span { color: var(--muted); }
.goal-picker-inline { margin-top: 0.4rem; padding-top: 0.2rem; border-top: 1px solid var(--border); }
.goal-picker-inline .eyebrow, .goal-picker-inline .page-title { display: none; }
@media (max-width: 640px) {
  .goal-target { grid-template-columns: 1fr; }
  .focus-picker .focus-grid, .card .focus-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Staff certifications & approvals */
.chip.cert.self { background: color-mix(in srgb, var(--info) 12%, transparent); border-color: color-mix(in srgb, var(--info) 35%, transparent); border-style: dashed; }
.chip.cert.expiring { background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.chip-btn { font: inherit; font-size: 0.75rem; padding: 0.05rem 0.45rem; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; }
.chip-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.banner.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.prescribed-by { margin-top: 0.15rem; }
.prescribed-by .verified, .muted .verified { color: var(--good); font-weight: 700; }
.approval.approved, .approval.returned { opacity: 0.8; }
.approval details summary { cursor: pointer; }
.staff-ctl select, .staff-ctl .btn { width: auto; margin: 0; }
.chip.cert { flex-wrap: wrap; row-gap: 0.15rem; }
.chip.cert .small { white-space: nowrap; }

/* Pro mode: denser, data-first */
body.pro .grid { gap: 0.7rem; }
body.pro .card { padding: 0.85rem 1rem; }
body.pro .page-title { font-size: 1.5rem; }
body.pro .stat { font-size: 1.6rem; }

/* Jump testing and left/right asymmetry */
.jump-tips { margin: 0.2rem 0 0.6rem; padding-left: 1.1rem; }
.jump-best { display: flex; gap: 1.5rem; align-items: flex-end; margin: 0.6rem 0; }
.jump-best .big { font-size: 1.8rem; font-weight: 800; font-family: var(--font-mono); }
.pf-table tr.best td { font-weight: 700; }
.pf-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.8rem; }
.asym-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.asym-list li { padding: 0.45rem 0.6rem; border-radius: 10px; background: var(--surface-2); }
.asym-list .bad-t { color: var(--bad); } .asym-list .warn-t { color: var(--warn); }
.lsi { display: inline-block; width: 80px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; vertical-align: middle; }
.lsi i { display: block; height: 100%; background: var(--good); }
.lsi i.lsi-warn { background: var(--warn); } .lsi i.lsi-bad { background: var(--bad); }
.jump-table th, .jump-table td { text-align: right; font-family: var(--font-mono); padding: 0.3rem 0.4rem; }
.jump-table th:first-child, .jump-table td:first-child { text-align: left; }
.fv-scale { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--bad), var(--warn) 30%, var(--good) 45%, var(--good) 55%, var(--warn) 70%, var(--bad)); margin: 0.4rem 0 0.2rem; }
.fv-band { position: absolute; left: 45%; width: 10%; top: -3px; bottom: -3px; border: 2px solid var(--text); border-radius: 4px; opacity: 0.5; }
.fv-dot { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--surface); border: 3px solid var(--text); }
.fv-axis { display: flex; justify-content: space-between; }
.fv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.4rem; }
.fv-stats div { display: flex; flex-direction: column; padding: 0.4rem 0.6rem; border-radius: 10px; background: var(--surface-2); }
.fv-entry input { width: 100%; }
.fv-out { min-height: 2.5rem; margin-top: 0.5rem; }
.rts-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.rts-item { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.45rem 0.6rem; border-radius: 10px; background: var(--surface-2); }
.rts-item .main { flex: 1; min-width: 0; }
.rts-icon { width: 1.4rem; height: 1.4rem; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; background: var(--border); }
.rts-met .rts-icon, .rts-signed .rts-icon { background: var(--good); color: #fff; }
.rts-not .rts-icon { background: var(--bad); color: #fff; }
.rts-strength { gap: 0.35rem; margin-top: 0.35rem; flex-wrap: wrap; }
.rts-strength input { padding: 0.3rem 0.5rem; }
.warn-t { color: var(--warn); }

.known-list { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .3rem; font-size: .9rem; }
.cue.warn { background: color-mix(in srgb, var(--warn, #d97706) 12%, var(--surface)); border-left: 3px solid var(--warn, #d97706); }
.talk-examples { gap: .35rem; }
.talk-result ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.cycle-bar { display: flex; gap: 3px; margin-top: .75rem; border-radius: 10px; overflow: hidden; }
.cycle-seg { display: flex; flex-direction: column; padding: .4rem .5rem; font-size: .78rem; min-width: 0; background: var(--surface-2, color-mix(in srgb, var(--text) 8%, var(--surface))); opacity: .75; }
.cycle-seg strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cycle-seg span { color: var(--muted); }
.cycle-seg.on { opacity: 1; outline: 2px solid var(--accent); outline-offset: -2px; }
.cycle-seg.accumulate { background: color-mix(in srgb, #3b82f6 22%, var(--surface)); }
.cycle-seg.intensify { background: color-mix(in srgb, #f59e0b 24%, var(--surface)); }
.cycle-seg.peak { background: color-mix(in srgb, #ef4444 24%, var(--surface)); }
.cycle-seg.taper { background: color-mix(in srgb, #10b981 24%, var(--surface)); }
.team-prog + .team-prog { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.team-table { width: 100%; border-collapse: collapse; margin-top: .4rem; font-size: .88rem; }
.team-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding: .3rem .4rem; }
.team-table td { padding: .4rem; border-top: 1px solid var(--border); vertical-align: top; }
.pill.done { background: color-mix(in srgb, var(--muted) 16%, transparent); }
@media (max-width: 560px) { .team-table th:nth-child(4), .team-table td:nth-child(4) { display: none; } }
.welcome-cloud { max-width: 34rem; margin: 0 auto; }
.cloud-codes { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin: .5rem 0; }
.cloud-codes > div { display: flex; flex-direction: column; }
.cloud-codes code, .cloud-invites code { font-family: 'JetBrains Mono', monospace; font-size: 1.05rem; letter-spacing: .08em; font-weight: 700; }
.cloud-invites summary { cursor: pointer; font-weight: 600; margin: .4rem 0; }

/* ---------- sign in / create account ---------- */
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; max-width: 1040px; min-height: calc(100vh - 6rem); margin: 0 auto; padding: 2rem 1.25rem; }
.auth-brand { display: inline-flex; align-items: center; gap: .55rem; font: 700 1.3rem var(--font-display); letter-spacing: -.02em; }
.auth-brand strong { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-brand svg { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 10px rgba(255, 90, 31, .6)); }
.auth-title { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -.035em; margin: 1.6rem 0 1rem; }
.auth-title span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-lead { color: var(--muted); font-size: 1.05rem; line-height: 1.55; max-width: 30rem; margin: 0 0 1.6rem; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.auth-points li { display: flex; gap: .8rem; align-items: flex-start; }
.auth-points strong { display: block; font-size: .95rem; }
.auth-points small { color: var(--muted); font-size: .85rem; }
.auth-dot { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, rgba(255, 122, 43, .18), rgba(255, 46, 126, .12)); box-shadow: inset 0 0 0 1px rgba(255, 106, 43, .28); }
.auth-panel { position: relative; padding: 1.8rem; border-radius: 22px; backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); box-shadow: var(--shadow), 0 30px 80px -40px rgba(255, 60, 90, .45); }
.auth-panel::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(160deg, rgba(255, 122, 43, .55), transparent 40%, transparent 70%, rgba(34, 211, 238, .35)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.auth-panel-title { margin: 0 0 .2rem; font-size: 1.45rem; letter-spacing: -.02em; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 1.1rem; }
.auth-tabs button { border: 0; background: transparent; color: var(--muted); font: 600 .9rem var(--font); padding: .55rem; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.auth-tabs button[aria-selected='true'] { background: var(--surface-solid, var(--surface)); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .2), inset 0 0 0 1px var(--border); }
.auth-form { display: grid; gap: .85rem; text-align: left; }
.auth-field { display: grid; gap: .35rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.auth-field input { font: inherit; font-weight: 400; color: var(--text); padding: .75rem .85rem; border-radius: 12px; }
.auth-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 31, .22); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 4.2rem; }
.pw-peek { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font: 600 .78rem var(--font); padding: .35rem .5rem; border-radius: 8px; cursor: pointer; }
.pw-peek:hover { color: var(--text); background: var(--surface-2); }
.pw-meter { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: -.4rem; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .2s, background .2s; }
.pw-meter[data-level='0'] span, .pw-meter[data-level='1'] span { width: 25%; background: var(--bad); }
.pw-meter[data-level='2'] span { width: 50%; background: var(--warn); }
.pw-meter[data-level='3'] span { width: 75%; background: var(--good); }
.pw-meter[data-level='4'] span { width: 100%; background: var(--grad); }
.auth-forgot { justify-self: end; margin-top: -.4rem; }
.btn-lg { padding: .8rem 1rem; font-size: 1rem; border-radius: 12px; }
.auth-form .btn-primary { background: var(--grad); border: 0; box-shadow: var(--glow); }
.auth-error { margin: 0; padding: .6rem .75rem; border-radius: 10px; font-size: .88rem; color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.auth-switch { margin: .2rem 0 0; text-align: center; font-size: .88rem; color: var(--muted); }
.auth-or { display: flex; align-items: center; gap: .75rem; margin: 1.2rem 0; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-alt { display: grid; gap: .6rem; justify-items: center; }
#cloud-card .auth-tabs { max-width: 22rem; }
#cloud-card .auth-form { max-width: 22rem; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 1.5rem; min-height: 0; padding: 1rem 0 2rem; }
  .auth-title { margin: 1rem 0 .6rem; }
  .auth-lead { margin-bottom: 0; }
  .auth-points { display: none; }
  .auth-panel { padding: 1.3rem; }
}
.join-form { display: grid; gap: .5rem; margin-top: .4rem; }
.join-form input { font: inherit; }
.coach-steps .steps { margin: .2rem 0 0; padding-left: 1.2rem; display: grid; gap: .7rem; line-height: 1.6; }
.big-code { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; letter-spacing: .08em; padding: .1rem .45rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.btn-block { width: 100%; justify-content: center; }
.mode-card.primary form input { font: inherit; }
body:has(.auth-wrap) .topbar { display: none !important; }
.btn-google { gap: .6rem; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.btn-google:hover { background: #f6f7f8; }
.auth-tabs + .btn-google + .auth-or { margin: 1rem 0; }
/* getting started */
.guide-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: .1rem 0 .8rem; }
.guide-bar span { display: block; height: 100%; background: var(--grad, var(--accent)); border-radius: inherit; transition: width .3s; }
.guide-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; }
.guide-steps li { display: flex; gap: .75rem; align-items: flex-start; padding: .55rem .4rem; border-radius: 12px; }
.guide-steps li.next { background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.guide-steps li.done strong { color: var(--muted); text-decoration: line-through; font-weight: 500; }
.guide-check { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; border: 2px solid var(--border); margin-top: .05rem; }
.guide-steps li.done .guide-check { background: var(--good); border-color: var(--good); color: #fff; }
.guide-steps li.next .guide-check { border-color: var(--accent); }
.guide-body { flex: 1; min-width: 0; }
.guide-body p { margin: .2rem 0 0; line-height: 1.45; }
.guide-steps .btn { flex: none; align-self: center; }
@media (max-width: 560px) { .guide-steps li { flex-wrap: wrap; } .guide-body { flex-basis: calc(100% - 24px - .75rem); } .guide-steps .btn { margin-left: calc(24px + .75rem); align-self: flex-start; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.parent-approve input[type='checkbox'] { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }

/* ---------- Body view (balance map, prevention, timeline, check-ups) ---------- */
.brief-line { display: flex; align-items: center; gap: 0.55rem; width: 100%; text-align: left; margin: 0 0 1rem; padding: 0.7rem 0.9rem; border-radius: var(--radius, 14px); border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; }
.brief-line > span:nth-child(2) { flex: 1; }
.brief-line svg { width: 18px; height: 18px; flex: none; }
.body-head { margin-bottom: 0.8rem; }
.balance-map .bodymap { max-width: 360px; margin: 0 auto; }
.balance-map .area { cursor: pointer; }
.mini-map { width: 140px; flex: none; }
.mini-map .bodymap { gap: 0.2rem; }
.mini-map figcaption { display: none; }
.area-detail { margin-top: 0.6rem; padding: 0.6rem 0.7rem; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.finding-list, .evidence { margin: 0.35rem 0 0; padding-left: 1.1rem; font-size: 0.88rem; }
.finding-list li, .evidence li { margin: 0.15rem 0; }
.src { display: inline-block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; opacity: 0.7; margin-right: 0.25rem; }
.prio-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.55rem; }
.prio-list .rank { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; font-size: 0.78rem; font-weight: 700; background: color-mix(in srgb, var(--accent, #ff7a3d) 22%, transparent); }
.chain-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.chain-list .chain { padding: 0.55rem 0.7rem; border-radius: 10px; border: 1px dashed var(--border); }
.region-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.3rem; font-size: 0.9rem; }
.spark rect { fill: color-mix(in srgb, var(--text) 25%, transparent); }
.spark rect.now { fill: var(--info); }
.spark.warn rect.now { fill: var(--warn); }
.spark.bad rect.now { fill: var(--bad); }
.pain-dots { display: flex; gap: 0.25rem; margin: 0.3rem 0; }
.pain-dots .pd { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 6px; font-size: 0.78rem; font-weight: 700; }
.pain-dots .pd.lvl-1 { background: color-mix(in srgb, var(--good) 22%, transparent); }
.pain-dots .pd.lvl-2 { background: color-mix(in srgb, var(--warn) 28%, transparent); }
.pain-dots .pd.lvl-3 { background: color-mix(in srgb, var(--bad) 28%, transparent); }
.warn-row { border-left: 3px solid var(--bad); padding-left: 0.6rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.timeline .tl-month { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.65; margin-top: 0.5rem; }
.timeline .tl-item { display: flex; gap: 0.6rem; align-items: flex-start; padding-left: 0.2rem; }
.timeline .tl-icon { width: 1.6rem; text-align: center; flex: none; }
.timeline .tl-injury, .timeline .tl-pain { border-left: 3px solid var(--bad); }
.timeline .tl-soreness, .timeline .tl-pain-monitor { border-left: 3px solid var(--warn); }
.timeline .tl-cleared { border-left: 3px solid var(--good); }
.chip.active { background: color-mix(in srgb, var(--info) 22%, transparent); border-color: var(--info); }
.trend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.8rem; }
.trend { padding: 0.5rem 0.6rem; border-radius: 10px; background: color-mix(in srgb, var(--text) 4%, transparent); color: var(--info); }
.trend strong, .trend .muted { color: var(--text); }
.trend-line circle { fill: currentColor; }
.trend-line .axis { font-size: 9px; fill: var(--muted, #888); }
.good-t { color: var(--good); }
.cite { opacity: 0.7; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
fieldset.q { border: 0; padding: 0.2rem 0; margin: 0 0 0.4rem; }
.yb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin: 0.6rem 0; text-align: center; }
.yb-stats div { padding: 0.6rem; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, transparent); display: grid; }
.yb-stats strong { font-size: 1.3rem; }
.yb-stats span { font-size: 0.78rem; opacity: 0.7; }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } .mini-map { width: 110px; } .yb-stats { grid-template-columns: repeat(2, 1fr); } }
@media print { .segmented, .brief-line, [data-body], .sidebar, #bottombar { display: none !important; } }
.region-list li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: nowrap; }
.spark { width: 120px; height: 28px; flex: none; display: block; }
.rc-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.rc-table th { text-align: left; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.7; padding: 0.3rem 0.4rem; }
.rc-table td { padding: 0.35rem 0.4rem; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }

/* ---------- video quality, camera tests, explain, tours ---------- */
.conf { display: inline-block; font-size: .7rem; padding: .05rem .4rem; border-radius: 999px; margin-left: .35rem; vertical-align: middle; border: 1px solid var(--border); color: var(--muted); }
.conf-high { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.conf-medium { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.conf-low { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.explain-btn { background: none; border: 0; color: var(--muted); font-size: .9em; cursor: pointer; padding: 0 .2rem; margin-left: .15rem; line-height: 1; vertical-align: baseline; }
.explain-btn:hover, .explain-btn:focus-visible { color: var(--accent); }
.explain-demo { display: flex; gap: .6rem; flex-wrap: wrap; margin: .4rem 0; }
.explain-demo figure { margin: 0; text-align: center; }
.explain-demo canvas { background: #12151c; border-radius: 8px; width: 240px; max-width: 100%; height: auto; display: block; }
.film-guide { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: .4rem 0; }
.film-guide .film-diagram { width: 240px; max-width: 100%; flex: 0 0 auto; }
.film-guide > p { flex: 1 1 14rem; }
.film-diagram .fd-bg { fill: color-mix(in srgb, var(--accent) 6%, transparent); stroke: var(--border); }
.film-diagram .fd-person { fill: color-mix(in srgb, var(--good) 25%, transparent); stroke: var(--good); stroke-width: 1.5; }
.film-diagram .fd-line { stroke: var(--good); stroke-width: 1.5; fill: none; }
.film-diagram .fd-dash { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1.2; }
.film-diagram .fd-phone { fill: var(--accent); }
.film-diagram .fd-text { font: 600 10px system-ui, sans-serif; fill: currentColor; }
.film-diagram .fd-text.muted { font-weight: 400; fill: var(--muted); }
.film-guide-wrap { margin: .3rem 0; }
.cam-filled { color: var(--good); margin: .35rem 0 0; }
.ycalc { margin: .4rem 0; }
.ycalc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .4rem; align-items: end; margin: .35rem 0; }
.ycalc-row > strong { grid-column: 1 / -1; font-size: .85rem; }
.extra-tests > summary { cursor: pointer; padding: .2rem 0; }
.extra-tests[open] > summary { margin-bottom: .6rem; }
.bp-row { display: grid; grid-template-columns: 8rem 1fr 3rem; gap: .5rem; align-items: center; margin: .3rem 0; font-size: .9rem; }
.bp-bar { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 25%, transparent), color-mix(in srgb, var(--good) 25%, transparent) 50%, color-mix(in srgb, var(--accent) 25%, transparent)); }
.bp-bar b { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.bp-bar i { position: absolute; top: -4px; width: 12px; height: 16px; margin-left: -6px; border-radius: 4px; background: var(--accent); }
.bp-scale { display: grid; grid-template-columns: 8rem 1fr 1fr 1fr 3rem; gap: .5rem; }
.bp-scale span:nth-child(1) { grid-column: 2; }
.bp-scale span:nth-child(2) { text-align: center; }
.bp-scale span:nth-child(3) { text-align: right; }
.ghost-canvas { width: 100%; max-width: 640px; height: auto; background: #12151c; border-radius: 10px; display: block; }
.ghost-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.ghost-legend i { display: inline-block; width: 1.4rem; height: 0; border-top: 4px solid; vertical-align: middle; margin-right: .3rem; }
.ghost-legend .g-old { border-color: rgba(160, 160, 170, .8); border-top-style: dashed; }
.ghost-legend .g-new { border-color: #22c55e; }
.live-outline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; stroke: rgba(255, 255, 255, .55); color: rgba(255, 255, 255, .8); transition: opacity .4s; }
.live-outline text { font: 4px system-ui, sans-serif; fill: currentColor; stroke: none; }
.live-stage.framed .live-outline { opacity: 0; }
.tour-target { position: relative; z-index: 60; outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); }
.tour-pop { position: fixed; z-index: 70; background: var(--surface-solid, var(--surface)); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: .8rem .9rem; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
.tour-pop p { margin: .3rem 0 .6rem; font-size: .92rem; }
.dot.good { background: var(--good); }

/* Exercise how-to demos */
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: underline dotted var(--muted); text-underline-offset: 3px; }
.link-btn:hover, .link-btn:focus-visible { color: var(--accent); }
.howto-canvas { height: 260px; margin-top: 0.5rem; }
.howto-controls { margin-top: 0.4rem; gap: 0.5rem; }
.howto-cues { list-style: none; padding: 0; margin: 0.6rem 0 0.25rem; }
.howto-cues li { margin: 0.2rem 0; }
.howto-avoid { margin: 0.4rem 0 0; color: var(--bad); }

/* ---------- app shell: banners, sync pill, install steps ---------- */
.app-banner {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: calc(100vw - 1.5rem);
  padding: 0.55rem 0.6rem 0.55rem 0.9rem;
  border-radius: 14px;
  background: var(--surface-solid, var(--surface));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.9rem;
}
.app-banner > span { flex: 1; }
#error-banner { border-color: color-mix(in srgb, var(--bad) 60%, transparent); }
#update-banner { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
@media (max-width: 860px) {
  .app-banner { bottom: calc(5.2rem + env(safe-area-inset-bottom)); }
}
body.focus-open .app-banner { display: none; }

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 0;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.sync-pill .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.sync-pill.good .dot { background: var(--good); }
.sync-pill.warn { color: var(--warn); }
.sync-pill.bad { color: var(--bad); }
.sync-pill.info .dot { background: var(--accent); animation: sync-pulse 1.2s ease-in-out infinite; }
@keyframes sync-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .sync-pill.info .dot { animation: none; } }
#role-bar .sync-pill { margin: 0 0.4rem 0 0; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { #role-bar .sync-pill [data-sync-text] { display: none; } }

.install-steps { margin: 0.25rem 0 0; padding-left: 1.2rem; }
.install-steps li { margin: 0.2rem 0; }

/* =====================================================================
   v7 design system: "Instrument"
   Quiet graphite, hairline borders, one signal colour (Motiq orange) for the main action,
   ice blue for data, monospace numbers. No gradients or glow. Camera screens use the HUD look
   (cyan on black, corner brackets) further down. Overrides everything above.
   ===================================================================== */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f0f2f5;
  --text: #0b0d10;
  --muted: #5f6672;
  --border: #e2e5ea;
  --border-strong: #cfd4db;
  --accent: #f04d0f;
  --accent-2: var(--accent);
  --accent-ink: #ffffff;
  --data: #1f7fd1;
  --cyan: #0e9ab8;
  --good: #11a36a;
  --warn: #c98200;
  --bad: #e5384b;
  --info: #1f7fd1;
  --grad: linear-gradient(var(--accent), var(--accent));
  --grad-cool: linear-gradient(var(--surface-2), var(--surface-2));
  --glow: none;
  --radius: 10px;
  --shadow: none;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: var(--font);
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --side-w: 232px;
  --hud-bg: #020407; --hud-line: #0f2a33; --hud-ink: #dff8ff; --hud-mute: #5f8792; --hud-cyan: #38f2ff; --hud-amber: #ffb547;
  --hud-font: 'Chakra Petch', ui-sans-serif, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #08090b; --surface: #0f1114; --surface-solid: #0f1114; --surface-2: #15181c;
    --text: #edeff2; --muted: #9aa1ab; --border: #202329; --border-strong: #2c3037;
    --accent: #ff5a1f; --accent-ink: #120702; --data: #8fd0ff; --cyan: #8fd0ff;
    --good: #3ddc97; --warn: #ffb020; --bad: #ff4d5e; --info: #8fd0ff;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #08090b; --surface: #0f1114; --surface-solid: #0f1114; --surface-2: #15181c;
  --text: #edeff2; --muted: #9aa1ab; --border: #202329; --border-strong: #2c3037;
  --accent: #ff5a1f; --accent-ink: #120702; --data: #8fd0ff; --cyan: #8fd0ff;
  --good: #3ddc97; --warn: #ffb020; --bad: #ff4d5e; --info: #8fd0ff;
  color-scheme: dark;
}

body { font: 14.5px/1.5 var(--font); letter-spacing: -0.006em; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .page-title, .hero-title, .brand span { font-family: var(--font); }
.stat, .num, .big, .gauge-ring strong, .risk-score strong, .why-val, .pt-stat b, .ring span, .mini-ring span, .big-ring span, time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.bg-fx { display: none; }

/* emoji drawn as icons (src/icons.js) */
.ei { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.16em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h3 .ei, h2 .ei, .card-head .ei { color: var(--muted); }
.ico { stroke-width: 1.7; }

/* ---------- shell ---------- */
.sidebar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; border-right: 1px solid var(--border); padding: 1rem 0.75rem; gap: 0.7rem; }
.brand { font: 600 1.08rem var(--font); letter-spacing: -0.02em; padding: 0.1rem 0.5rem 0.2rem; gap: 0.5rem; }
.brand strong { background: none; color: inherit; }
.brand svg { width: 24px; height: 24px; stroke: var(--accent); filter: none; stroke-width: 3; }
.side-search { display: flex; align-items: center; gap: 0.55rem; width: 100%; padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); font: 500 0.86rem var(--font); cursor: pointer; }
.side-search:hover { border-color: var(--border-strong); color: var(--text); }
.side-search .ico { width: 16px; height: 16px; }
.side-search kbd, .search-box kbd { margin-left: auto; font: 500 0.68rem var(--font-mono); padding: 1px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); }
.side-nav { gap: 1px; }
.nav-item { padding: 0.5rem 0.6rem; border-radius: 7px; font: 500 0.9rem/1 var(--font); gap: 0.65rem; }
.nav-item .ico { width: 18px; height: 18px; }
.nav-item:hover { background: var(--surface-2); }
.nav-item[aria-current='page'] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); color: var(--text); }
.nav-item[aria-current='page']::before { display: none; }
.nav-item[aria-current='page'] .ico { color: var(--accent); }
.badge { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; border-radius: 5px; font: 500 0.68rem var(--font-mono); min-width: 1.3rem; padding: 0.05rem 0.3rem; }
.side-controls { background: var(--surface); border-radius: 10px; padding: 0.6rem; }
.btn-log { border-radius: 8px; }

main { max-width: 1200px; padding: 1.25rem 1.75rem 4rem; }
.subnav { background: var(--bg); padding: 0 1.75rem; max-width: none; border-bottom: 1px solid var(--border); }
.subnav:empty { display: none; }
.pill-tabs { background: none; border: 0; border-radius: 0; padding: 0; gap: 1.2rem; backdrop-filter: none; -webkit-backdrop-filter: none; display: flex; max-width: 1200px; margin: 0 auto; }
.pill-tabs button { border-radius: 0; padding: 0.85rem 0 0.75rem; font: 500 0.88rem var(--font); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pill-tabs button[aria-selected='true'] { background: none; color: var(--text); box-shadow: none; border-bottom-color: var(--accent); }

@media (max-width: 860px) {
  .topbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid var(--border); padding: 0.55rem 16px; }
  .topbar-controls { margin-left: auto; display: flex; align-items: center; gap: 0.45rem; }
  .subnav { top: 53px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
  .pill-tabs { gap: 1.1rem; }
  main { padding: 1rem 16px calc(84px + env(safe-area-inset-bottom)); }
  .bottombar { left: 0; right: 0; bottom: 0; border-radius: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; border-top: 1px solid var(--border); box-shadow: none; }
  .tab-item { font: 500 0.66rem var(--font); }
  .tab-item .ico { width: 21px; height: 21px; }
  .tab-item[aria-current='page'] .ico { stroke: var(--accent); filter: none; }
  .more-panel { left: 0; right: 0; bottom: 0; border-radius: 16px 16px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .more-item { border-radius: 10px; background: var(--surface); }
  .more-item .ico { stroke: currentColor; color: var(--muted); }
  .more-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .more-controls select { flex: 1; min-width: 0; }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 1rem 1.1rem; }
.card .card { background: var(--surface-2); border-color: transparent; }
.card.clickable:hover, .clickable.card:hover { transform: none; border-color: var(--border-strong); }
.card-head h3 { font: 600 0.92rem/1.3 var(--font); letter-spacing: -0.01em; }
h3 { font: 500 0.7rem/1.2 var(--font-mono); letter-spacing: 0.1em; color: var(--muted); }
.page-title { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; }
.eyebrow, .why-sub { font: 500 0.68rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat { font-weight: 500; letter-spacing: -0.04em; }
.stat small { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0; text-transform: uppercase; }
dialog { background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.55); }
dialog::backdrop { background: rgba(3, 4, 6, 0.6); backdrop-filter: blur(3px); }
.banner { border-radius: 8px; backdrop-filter: none; border: 1px solid var(--border); background: var(--surface); }

/* buttons, inputs, pills */
.btn { border-radius: 8px; background: var(--surface); border: 1px solid var(--border-strong); font-weight: 500; box-shadow: none; }
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-primary, .btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: none; filter: none; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-glow { box-shadow: none; }
.icon-btn { border-radius: 8px; background: var(--surface); border-color: var(--border-strong); width: 36px; height: 36px; }
.icon-btn .ico { width: 18px; height: 18px; }
.icon-btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
input, select, textarea { border-radius: 8px; background: var(--surface); border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
:focus-visible { outline-color: var(--accent); }
.segmented { border-radius: 8px; background: var(--surface-2); }
.segmented button { border-radius: 6px; }
.segmented button[aria-pressed='true'] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.pill { border-radius: 5px; font: 500 0.7rem/1.5 var(--font-mono); letter-spacing: 0.02em; padding: 0.08rem 0.45rem; background: transparent; border: 1px solid var(--border-strong); color: var(--muted); white-space: nowrap; }
.pill.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 38%, transparent); background: color-mix(in srgb, var(--good) 7%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 38%, transparent); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 38%, transparent); background: color-mix(in srgb, var(--bad) 7%, transparent); }
.pill.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 38%, transparent); background: color-mix(in srgb, var(--info) 7%, transparent); }
.chip, .chip-btn { border-radius: 6px; }
.avatar, .avatar.coach { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); font: 600 0.75rem var(--font-mono); }
.sport-dot { border-radius: 8px; color: var(--muted); }
#toast { border-radius: 10px; border-color: var(--border-strong); }
.switch input:checked + span::before, .switch input:checked { accent-color: var(--accent); }
input[type='checkbox'], input[type='radio'], input[type='range'] { accent-color: var(--accent); }

/* rings: flat, no glow */
.ring, .mini-ring, .big-ring, .goal-ring { filter: none; }
.goal-ring { --ring: var(--data); }
.gauge-ring { filter: none; animation: none; }

/* banners and tags without gradients */
.adapt-banner, .adapt-banner.adapt-deload, .nudge-banner, .sci-cta { background: var(--surface); border-color: var(--border); }
.why-tip { background: var(--surface-2); border: 1px solid var(--border); }
.adapted-tag, button.focus-tag { border-radius: 5px; border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: transparent; color: var(--warn); font: 500 0.7rem var(--font-mono); }
button.focus-tag { color: var(--text); border-color: var(--border-strong); }
.qc-opt:has(input:checked), .focus-opt.on { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid var(--accent); }
.focus-opt:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }
.mode-card { border-radius: 12px; backdrop-filter: none; }
.mode-card.primary { background: var(--surface); border: 1px solid var(--accent); box-shadow: none; }
.welcome .page-title { background: none; color: var(--text); -webkit-background-clip: initial; background-clip: initial; }
.grad-text { background: none; color: inherit; -webkit-background-clip: initial; background-clip: initial; }
.risk-chip { border-radius: 6px; font: 500 0.72rem var(--font-mono); background: transparent; }
.risk-chip i, .risk-chip.risk-moderate i, .risk-chip.risk-high i, .nr-dot, .nr-dot.worse, .nr-dot.better { box-shadow: none; }
.risk-card.risk-high { box-shadow: none; }
.why-big, .why-big.band-go, .why-big.tone-good, .why-big.risk-low, .why-big.band-steady, .why-big.band-easy, .why-big.tone-warn, .why-big.risk-moderate, .why-big.band-rest, .why-big.tone-bad, .why-big.risk-high {
  border-radius: 12px; box-shadow: none; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text); font-weight: 500; }
.why-big.band-go, .why-big.tone-good, .why-big.risk-low { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.why-big.band-steady { color: var(--info); border-color: color-mix(in srgb, var(--info) 45%, transparent); }
.why-big.band-easy, .why-big.tone-warn, .why-big.risk-moderate { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.why-big.band-rest, .why-big.tone-bad, .why-big.risk-high { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.why-big .ico-lg { stroke: currentColor; }
.why-row { border-radius: 8px; }
.brief-line { border-radius: 8px; }
.tour-target { outline-width: 2px; }
.list li { border-color: var(--border); }
.vel-bar i { background: var(--data); }

/* ---------- Home ---------- */
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; margin: 0.2rem 0 1rem; }
.home-greet { min-width: 0; }
.home-head .hero-title { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.035em; margin: 0.35rem 0 0.25rem; line-height: 1.1; }
.home-head .hero-sub { margin: 0; max-width: 40rem; font-size: 0.92rem; }
.home-head .quick-actions { gap: 0.4rem; }
.qa { border-radius: 8px; background: var(--surface); border-color: var(--border-strong); padding: 0.45rem 0.7rem; font: 500 0.82rem var(--font); }
.qa .ico { width: 16px; height: 16px; stroke: currentColor; color: var(--muted); }
.qa:hover { transform: none; box-shadow: none; border-color: var(--border-strong); background: var(--surface-2); }

.updates { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 0.9rem; overflow: hidden; }
.updates .banner { margin: 0; border: 0; border-radius: 0; background: transparent; padding: 0.5rem 0.8rem; display: flex; align-items: center; gap: 0.7rem; font-size: 0.86rem; }
.updates .banner + .banner { border-top: 1px solid var(--border); }
.updates .banner .main { display: flex; flex-wrap: wrap; gap: 0 0.5rem; align-items: baseline; min-width: 0; flex: 1; }
.updates .banner .main strong { font-weight: 600; }
.updates .banner .main > span { color: var(--muted); }
.updates .banner > .ico, .updates .banner .nudge-emoji { width: 16px; height: 16px; flex: none; color: var(--muted); font-size: 1rem; }
.updates .btn-sm { padding: 0.2rem 0.55rem; font-size: 0.78rem; }

.bento { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 0.75rem; margin-bottom: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.95rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.tile-session { grid-row: span 2; }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-height: 1.4rem; flex-wrap: wrap; min-width: 0; }
.tile-head .pill { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tile-head .eyebrow { display: inline-flex; align-items: center; gap: 0.3rem; }
.tile .session-name { font: 600 1.4rem/1.15 var(--font); letter-spacing: -0.03em; margin: 0; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; color: var(--muted); font-size: 0.85rem; }
.tile-meta > * + *::before { content: '·'; margin-right: 0.6rem; color: var(--border-strong); }
.block-list { list-style: none; margin: 0.15rem 0 0; padding: 0; display: grid; gap: 4px; }
.block-list li { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; padding: 0.5rem 0.65rem; border-radius: 7px; background: var(--surface-2); }
.block-list .t, .block-list .v { font-size: 0.74rem; color: var(--muted); }
.block-list .what { display: flex; flex-direction: column; min-width: 0; }
.block-list .what b { font-weight: 500; font-size: 0.88rem; }
.block-list .what span { color: var(--muted); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 0.2rem; }
.big-num, button.big-num, button.big-num.gauge-ring { all: unset; box-sizing: border-box; display: flex; align-items: baseline; gap: 0.35rem; cursor: pointer; color: var(--text); width: auto; height: auto; border-radius: 6px; background: none; filter: none; }
.big-num:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.big-num strong { font: 500 2.6rem/1 var(--font-mono); letter-spacing: -0.05em; }
.big-num small { font: 500 0.78rem var(--font-mono); color: var(--muted); letter-spacing: 0; text-transform: uppercase; }
.big-num.band-go strong { color: var(--text); }
.big-num:hover strong { color: var(--accent); }
.spark { width: 100%; height: 46px; display: block; }
.spark-area { fill: color-mix(in srgb, var(--data) 12%, transparent); }
.spark-line { fill: none; stroke: var(--data); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark-end { fill: var(--accent); }
.spark-empty { height: 46px; display: flex; align-items: center; }
.tile-scale { display: flex; justify-content: space-between; gap: 0.5rem; font: 0.7rem var(--font-mono); color: var(--muted); white-space: nowrap; }
.tile-scale span:last-child { overflow: hidden; text-overflow: ellipsis; }
.tile-foot { display: flex; }
.zone-bar { position: relative; display: grid; grid-template-columns: 40fr 25fr 10fr 25fr; gap: 3px; margin-top: 0.3rem; }
.zone-bar i { height: 6px; border-radius: 1px; }
.zone-bar .z-low { background: color-mix(in srgb, var(--data) 35%, var(--surface-2)); }
.zone-bar .z-ok { background: var(--good); }
.zone-bar .z-high { background: var(--warn); }
.zone-bar .z-bad { background: var(--bad); }
.zone-bar b { position: absolute; top: -4px; width: 2px; height: 14px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.meter { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-top: 0.3rem; }
.meter i { display: block; height: 100%; background: var(--data); }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; align-items: end; height: 58px; }
.week-bars i { display: block; background: var(--surface-2); border-top: 2px solid var(--data); border-radius: 2px 2px 0 0; min-height: 4px; }
.week-bars i.today { border-top-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
.week-bars i.future { border-top-color: var(--border-strong); }
.week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; font: 0.66rem var(--font-mono); color: var(--muted); }
@media (max-width: 1080px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-session { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 640px) {
  .home-head { margin-top: 0; }
  .home-head .hero-title { font-size: 1.45rem; }
  .home-head .quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .home-head .qa { flex-direction: column; gap: 0.3rem; padding: 0.55rem 0.2rem; font-size: 0.72rem; text-align: center; justify-content: center; }
  .bento { gap: 0.6rem; }
  .tile { padding: 0.85rem; }
  .big-num strong { font-size: 2rem; }
  .tile-goal, .tile-week { grid-column: 1 / -1; }
  .updates .banner .main { flex-direction: column; gap: 0; }
}

/* ---------- search ---------- */
#search-dialog { width: min(600px, calc(100vw - 24px)); padding: 0; margin-top: 12vh; overflow: hidden; }
.search-box { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); }
.search-box .ico { width: 18px; height: 18px; color: var(--muted); }
.search-box input { flex: 1; border: 0; background: transparent; box-shadow: none; padding: 0.2rem 0; font-size: 1rem; }
.search-box input:focus { box-shadow: none; }
#search-results { list-style: none; margin: 0; padding: 0.4rem; max-height: min(420px, 60vh); overflow-y: auto; }
#search-results li { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border-radius: 7px; cursor: pointer; }
#search-results li .ico { width: 16px; height: 16px; color: var(--muted); }
#search-results li small { margin-left: auto; font: 0.7rem var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
#search-results li[aria-selected='true'], #search-results li:hover { background: var(--surface-2); }
#search-results li[aria-selected='true'] .ico { color: var(--accent); }
#search-results li.empty { cursor: default; }

/* ---------- sign in ---------- */
.auth-brand { font: 600 1.25rem var(--font); }
.auth-brand strong, .auth-title span { background: none; color: inherit; -webkit-background-clip: initial; background-clip: initial; }
.auth-title span { color: var(--accent); }
.auth-title { font-weight: 600; letter-spacing: -0.045em; }
.auth-brand svg { filter: none; }
.auth-dot { border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: none; color: var(--muted); }
.auth-panel { border-radius: 14px; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; background: var(--surface); border: 1px solid var(--border); }
.auth-panel::before { display: none; }
.auth-tabs { border-radius: 8px; }
.auth-tabs button { border-radius: 6px; font-weight: 500; }
.auth-field input { border-radius: 8px; }
.auth-field input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.pw-meter[data-level='4'] span { background: var(--good); }

/* =====================================================================
   HUD: camera screens (live coach, form check player, jump test readout)
   ===================================================================== */
.hud { position: relative; background-color: var(--hud-bg); color: var(--hud-ink); border: 1px solid var(--hud-line); border-radius: 4px; }
.hud::before, .hud::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--hud-cyan); z-index: 3; pointer-events: none; }
.hud::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.hud::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.live-stage.hud, .player.hud { overflow: hidden; }
.live-stage.hud { background-image: linear-gradient(rgba(56, 242, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(56, 242, 255, 0.05) 1px, transparent 1px); background-size: 28px 28px; }
.hud-tag { position: absolute; top: 10px; left: 14px; z-index: 3; font: 500 0.66rem var(--font-mono); letter-spacing: 0.16em; color: var(--hud-cyan); }
.live-outline { color: var(--hud-cyan); stroke: var(--hud-cyan); }
.live-outline text { fill: var(--hud-mute); stroke: none; font-family: var(--font-mono); }
.live-hud { background: linear-gradient(transparent, rgba(2, 4, 7, 0.88)); }
.live-reps { font-family: var(--hud-font); color: var(--hud-cyan); background: rgba(2, 4, 7, 0.7); border: 1px solid var(--hud-line); border-radius: 2px; }
.live-reps span, #live-count { font: 600 3rem/1 var(--hud-font); color: var(--hud-cyan); }
.live-reps small { font: 500 0.7rem var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--hud-mute); }
.live-cue { font: 600 1.05rem var(--hud-font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--hud-ink); border-left: 2px solid var(--hud-cyan); padding-left: 0.6rem; }
.player.hud video { display: block; }
.player-controls { font-family: var(--font-mono); }
.jump-best.hud { padding: 0.9rem 1rem; display: flex; gap: 1.5rem; flex-wrap: wrap; background-image: linear-gradient(rgba(56, 242, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(56, 242, 255, 0.05) 1px, transparent 1px); background-size: 22px 22px; }
.jump-best.hud .muted { color: var(--hud-mute); font: 500 0.66rem var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; }
.jump-best.hud .big { font: 600 2.4rem/1 var(--hud-font); color: var(--hud-cyan); }
.jump-best.hud > div > div:last-child { font-family: var(--font-mono); }
@media (prefers-reduced-motion: reduce) { .hud * { animation: none !important; } }
.live-stage.hud .live-outline { opacity: 0.75; }
.live-stage.hud .live-outline text { display: none; }
.live-stage.hud.framed .live-outline { opacity: 0; }

/* ---------- Camera check, replay, calibration, validity (v7) ---------- */
dialog.camcheck { width: min(980px, 96vw); }
.cc-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 1rem; margin-top: .75rem; }
@media (max-width: 720px) { .cc-body { grid-template-columns: 1fr; } }
.cc-stage { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; }
.cc-stage video, .cc-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cc-stage video.mirror { transform: scaleX(-1); }
.cc-stage .hud-tag { position: absolute; top: .5rem; left: .5rem; z-index: 2; }
.cc-big { position: absolute; left: 0; right: 0; bottom: 1rem; text-align: center; font-family: 'Chakra Petch', var(--font-mono, monospace); font-size: clamp(1.2rem, 3vw, 2rem); letter-spacing: .2em; color: var(--hud-cyan, #38f2ff); text-shadow: 0 0 12px rgba(56, 242, 255, .5); pointer-events: none; }
.cc-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.cc-rows li { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem .55rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.cc-rows li i { flex: none; width: .6rem; height: .6rem; border-radius: 50%; margin-top: .35rem; background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.cc-rows li.ok i { background: var(--good); box-shadow: 0 0 8px var(--good); }
.cc-rows li div { display: flex; flex-direction: column; gap: .1rem; font-size: .85rem; }
.cc-rows li span { color: var(--muted); font-size: .8rem; }
.cc-actions { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.cc-actions .btn-primary { flex: 1; }

.replay-stage { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.replay-stage video { display: block; width: 100%; max-height: 60vh; background: #000; }
.replay-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.replay-bar .rep-strip { flex: 1; margin: 0; }
#replay-dialog { width: min(760px, 96vw); }

.calib-panel { margin-top: .5rem; padding: .6rem .7rem; border: 1px dashed var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
#form-player.calibrating { cursor: crosshair; outline: 2px solid var(--accent); outline-offset: 2px; }
.calib-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid var(--accent); background: rgba(255, 90, 31, .25); box-shadow: 0 0 10px var(--accent); pointer-events: none; z-index: 5; }

.btn-xs { padding: .15rem .5rem; font-size: .75rem; min-height: 0; line-height: 1.4; }
.btn-xs.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.checks li { align-items: flex-start; }
.label-btns { display: flex; gap: .25rem; align-items: center; flex: none; margin-left: auto; }
@media (max-width: 560px) { .label-btns .muted { display: none; } }

.jump-rel { margin-top: .6rem; }
.jump-ref { margin-top: .5rem; }
.jump-ref label { display: flex; flex-direction: column; gap: .25rem; max-width: 18rem; margin-top: .4rem; }

/* ---------- Wearables ---------- */
.wear-list { margin: 0; }
.wear-row { display: flex; align-items: center; gap: .7rem; }
.wear-row .main { flex: 1; min-width: 0; }
.wear-row .pill { margin-left: .3rem; }
.wear-logo { flex: none; width: 2rem; height: 2rem; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-mono, 'Geist Mono', monospace); font-weight: 700; font-size: .85rem; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.wear-whoop { color: #f5f5f5; background: #111; }
.wear-garmin { color: #7cc8ff; }
.wear-oura { color: #d9c7a1; }
.wear-polar { color: #ff4d5e; }
.wear-coach .fv-stats div span:last-child:not(:first-child) { margin-top: .1rem; }
.wear-spark { margin-top: .6rem; display: flex; flex-direction: column; gap: .2rem; }
.wear-spark .spark { width: 100%; height: 40px; }
.wear-coach .bad-t, .jump-rel .bad-t { color: var(--bad); }

/* Swap reasons, set RPE, session feel, training feedback card */
button.chip[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.swap-reasons { gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.set-row .set-rpe select { width: 3.7rem; padding: 0.4rem 0.2rem; text-align: center; }
.set-row .set-rpe small { display: none; }
.set-row .set-check { margin-left: auto; flex: none; }
@media (max-width: 420px) { .set-row input { width: 3.6rem; } .set-row > .muted { width: 2.6rem; } .set-row label small { font-size: 0.7rem; } }
.feel-pick { border: 0; padding: 0; margin: 0.2rem 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.feel-pick legend { font-size: 0.85rem; margin-bottom: 0.3rem; width: 100%; }
.feel-pick .day-pick { flex: 1 1 auto; }
.fb-meter { display: grid; grid-template-columns: 5.5rem 1fr auto; align-items: center; gap: 0.5rem; font-size: 0.85rem; margin: 0.35rem 0; }
.fb-meter .bar { height: 0.5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; position: relative; }
.fb-meter .bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.fb-meter .bar i.over { background: var(--bad, #e5484d); }
.fb-meter .num { font-variant-numeric: tabular-nums; font-family: var(--mono, ui-monospace, monospace); }
.fb-list { list-style: none; margin: 0.3rem 0 0; padding: 0; font-size: 0.85rem; }
.fb-list li { padding: 0.25rem 0; border-top: 1px solid var(--border); }
.fb-list li:first-child { border-top: 0; }
.cc-big:has(.cc-line) { top: 0; bottom: 0; }
.cc-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.result-big { display: flex; align-items: baseline; gap: 0.6rem; margin-top: 0.6rem; }
.result-big .num { font-family: var(--mono, ui-monospace, monospace); font-size: 2.2rem; font-weight: 700; }
.td-steps { display: flex; gap: 0.3rem; flex-wrap: wrap; margin: 0.4rem 0 0.8rem; }
.td-steps span { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.td-steps span.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.td-steps span.done { color: var(--text); }
.td-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.td-table th, .td-table td { padding: 0.35rem 0.3rem; border-top: 1px solid var(--border); text-align: left; }
.td-table input { width: 100%; min-width: 3.6rem; padding: 0.35rem; }
.td-table td.best { font-family: var(--mono, ui-monospace, monospace); white-space: nowrap; }
.td-scroll { overflow-x: auto; margin: 0 -0.25rem; padding: 0 0.25rem; }

/* Exercise library, animated thumbnails and the 3D demo viewer */
.ex-thumb { display: block; flex: none; width: 64px; height: 52px; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.ex-thumb:hover { outline: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.ex-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item-thumb { width: 56px; height: 46px; margin-right: 0.6rem; }
.prog-thumb { display: inline-block; vertical-align: middle; width: 40px; height: 32px; margin-right: 0.45rem; border-radius: 7px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.75rem; }
.lib-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.2s, transform 0.2s; }
.lib-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); transform: translateY(-2px); }
.lib-thumb { width: 100%; height: 150px; border-radius: 0; }
.lib-body { padding: 0.7rem 0.8rem 0.8rem; display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.lib-body h3 { margin: 0; font-size: 0.98rem; }
.lib-actions { display: flex; gap: 0.4rem; align-items: center; margin-top: auto; padding-top: 0.5rem; flex-wrap: wrap; }
.lib-count { margin: 0.4rem 0 0.6rem; }
#lib-search { display: flex; gap: 0.5rem; }
#lib-search input { flex: 1; min-width: 0; }
#lib-search select { width: auto; max-width: 45%; }
@media (max-width: 520px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; } .lib-thumb { height: 110px; } .lib-body { padding: 0.55rem; } .lib-body h3 { font-size: 0.88rem; } }
.demo-stage { position: relative; }
.v3d-canvas { margin-top: 0.75rem; background: radial-gradient(120% 90% at 50% 20%, color-mix(in srgb, var(--accent) 7%, var(--surface-2)), var(--surface-2)); cursor: grab; }
.v3d-canvas:active { cursor: grabbing; }
.v3d-hint { position: absolute; left: 0.75rem; bottom: 0.6rem; font: 500 0.72rem var(--font-mono, ui-monospace, monospace); color: var(--muted); letter-spacing: 0.02em; pointer-events: none; }
.demo-controls { flex-wrap: wrap; gap: 0.5rem; }
.v3d-views button { min-width: 2.6rem; }
.body3d-wrap { position: relative; }
.body3d { display: block; width: 100%; height: 380px; border-radius: 12px; background: radial-gradient(110% 80% at 50% 25%, color-mix(in srgb, var(--accent) 6%, var(--surface-2)), var(--surface-2)); cursor: grab; touch-action: none; }
.balance-map-card .card-head .segmented { margin-left: 0.5rem; }
.replay-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 0.8rem; }
.replay-3d-btn { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.cube { display: inline-block; width: 0.9em; height: 0.9em; vertical-align: -0.1em; border: 1.6px solid currentColor; border-radius: 2px; transform: rotate(45deg) skew(-8deg, -8deg); }
.replay-legend { position: absolute; top: 1.3rem; left: 0.8rem; display: flex; gap: 0.8rem; color: var(--muted); font-family: var(--font-mono, ui-monospace, monospace); }
.replay-legend i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; vertical-align: -0.05em; margin-right: 0.3rem; }
.replay-legend i.you { background: #dfe7f2; }
.replay-legend i.model { background: var(--cyan, #22d3ee); opacity: 0.7; }

/* ---------- motion: view transitions, springing cards, readiness core ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.26s; animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); }
::view-transition-new(root) { animation-name: vtIn; }
::view-transition-old(root) { animation-name: vtOut; }
@keyframes vtIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes vtOut { to { opacity: 0; } }
@keyframes springIn { 0% { opacity: 0; transform: translateY(14px) scale(0.985); } 60% { opacity: 1; transform: translateY(-2px) scale(1.002); } 100% { transform: none; } }
.fresh > section, .fresh > .grid > *, .fresh .bento > *, .fresh .tiles > *, .fresh .lib-grid > * { animation: springIn 0.55s cubic-bezier(0.2, 0.8, 0.25, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }

.ready-row { display: flex; align-items: center; gap: 1rem; }
.ready-spark { flex: 1; min-width: 0; }
.ready-core { all: unset; box-sizing: border-box; position: relative; width: 112px; height: 112px; flex: none; display: grid; place-items: center; cursor: pointer; border-radius: 50%; --ring: var(--accent); }
.ready-core.band-go { --ring: var(--good); } .ready-core.band-steady { --ring: var(--cyan, #38f2ff); } .ready-core.band-easy { --ring: var(--warn); } .ready-core.band-rest { --ring: var(--bad); } .ready-core.empty { --ring: var(--muted); }
.ready-core svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ready-core circle { fill: none; }
.rc-track { stroke: color-mix(in srgb, var(--text) 9%, transparent); stroke-width: 7; }
.rc-arc { stroke: var(--ring); stroke-width: 7; stroke-linecap: round; stroke-dasharray: var(--pct) 100; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ring) 70%, transparent)); transition: stroke-dasharray 0.6s; }
.rc-orbit { stroke: color-mix(in srgb, var(--ring) 55%, transparent); stroke-width: 1; stroke-dasharray: 2 6; transform-origin: 60px 60px; animation: orbit 14s linear infinite; }
.rc-glow { fill: color-mix(in srgb, var(--ring) 9%, transparent); transform-origin: 60px 60px; animation: corePulse 3.2s ease-in-out infinite; }
.ready-core > span { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.ready-core strong { font: 500 2.3rem/1 var(--font-mono); letter-spacing: -0.05em; color: var(--text); }
.ready-core small { font: 500 0.66rem var(--font-mono); color: var(--muted); text-transform: uppercase; margin-top: 3px; }
.ready-core:hover strong { color: var(--accent); }
.ready-core:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fresh .rc-arc { animation: arcIn 1s cubic-bezier(0.2, 0.8, 0.25, 1) both; }
@keyframes arcIn { from { stroke-dasharray: 0 100; } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes corePulse { 0%, 100% { transform: scale(0.94); opacity: 0.7; } 50% { transform: scale(1.04); opacity: 1; } }
@media (max-width: 640px) { .ready-row { gap: 0.6rem; } .ready-core { width: 84px; height: 84px; } .ready-core strong { font-size: 1.7rem; } }

/* scan effect while a video is analysed */
.scan-box { position: relative; border-radius: 10px; overflow: hidden; background: #07090c; border: 1px solid var(--border); margin-bottom: 0.6rem; aspect-ratio: 16 / 9; }
.scan-canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.scan-line { position: absolute; left: 0; right: 0; height: 36%; top: -36%; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--cyan, #38f2ff) 22%, transparent) 85%, color-mix(in srgb, var(--cyan, #38f2ff) 80%, transparent) 99%, transparent); animation: scanSweep 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite; pointer-events: none; }
.scan-box::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(color-mix(in srgb, var(--cyan, #38f2ff) 8%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--cyan, #38f2ff) 8%, transparent) 1px, transparent 1px); background-size: 24px 24px; pointer-events: none; }
.scan-tag { position: absolute; left: 10px; top: 8px; font: 600 0.62rem var(--font-mono); letter-spacing: 0.14em; color: var(--cyan, #38f2ff); z-index: 1; }
@keyframes scanSweep { to { top: 100%; } }

/* command bar */
#search-results .cmd-row { background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
#search-results .cmd-row small { color: var(--accent); }

@media (prefers-reduced-motion: reduce) { .fresh *, .rc-orbit, .rc-glow, .scan-line, .rc-arc { animation: none !important; } ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; } }

/* builder: steps as the program comes together, then the week assembles */
.build-steps { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.35rem; font: 500 0.82rem var(--font-mono); }
.build-steps li { display: flex; align-items: center; gap: 0.55rem; color: var(--muted); opacity: 0.35; transition: opacity 0.2s, color 0.2s; }
.build-steps li::before { content: ''; width: 0.7rem; height: 0.7rem; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.build-steps li.on { opacity: 1; color: var(--text); }
.build-steps li.on::before { border-color: var(--accent); border-top-color: transparent; animation: spin 0.6s linear infinite; }
.build-steps li.done::before { animation: none; background: var(--good); border-color: var(--good); box-shadow: 0 0 8px color-mix(in srgb, var(--good) 60%, transparent); }
.program-week.assembling > .program-session { animation: springIn 0.55s cubic-bezier(0.2, 0.8, 0.25, 1) both; animation-delay: calc(var(--i, 0) * 110ms); }
.program-week.assembling .prog-items li { animation: itemIn 0.35s ease-out both; animation-delay: calc(var(--i, 0) * 110ms + 180ms); }
@keyframes itemIn { from { opacity: 0; transform: translateX(-8px); } }

/* season timeline: drag the line between blocks */
.cycle-bar.editable { overflow: visible; gap: 0; position: relative; }
.cycle-bar.editable .cycle-seg { transition: flex 0.18s cubic-bezier(0.2, 0.8, 0.25, 1); }
.cycle-bar.editable .cycle-seg:first-child { border-radius: 10px 0 0 10px; } .cycle-bar.editable .cycle-seg:last-child { border-radius: 0 10px 10px 0; }
.cycle-handle { flex: none; width: 14px; margin: 0 -5px; position: relative; z-index: 1; cursor: ew-resize; touch-action: none; display: grid; place-items: center; outline: none; }
.cycle-handle::before { content: ''; width: 3px; height: 70%; border-radius: 3px; background: var(--muted); transition: background 0.15s, box-shadow 0.15s; }
.cycle-handle:hover::before, .cycle-handle:focus-visible::before, .dragging .cycle-handle::before { background: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent); }
.dragging, .dragging * { cursor: ew-resize !important; user-select: none; }
@media (prefers-reduced-motion: reduce) { .program-week.assembling *, .build-steps li::before { animation: none !important; } }

/* what's new */
.wn-head { display: flex; align-items: center; gap: 0.6rem; margin: 0.25rem 0 0.5rem; }
.wn-head h3 { margin: 0; }
.wn-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.6rem 1rem; }
.wn-list li { display: flex; gap: 0.6rem; align-items: flex-start; }
.wn-list p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.85rem; }
.wn-ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.wn-ic svg { width: 17px; height: 17px; }

/* =====================================================================
   Recover tab, recovery battery, routine player, breathing pacer, camera heart rate
   ===================================================================== */
.bad-text { color: var(--bad); font-weight: 600; }
.section-label { font: 600 0.78rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 1.4rem 0 0.6rem; }
.battery { flex: none; vertical-align: middle; }
.battery .bat-shell { fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0.55; }
.battery .bat-tip { fill: currentColor; opacity: 0.55; }
.battery .bat-fill { fill: currentColor; }
.battery.tone-good { color: var(--good); } .battery.tone-info { color: var(--data, var(--info)); } .battery.tone-warn { color: var(--warn); } .battery.tone-bad { color: var(--bad); } .battery.tone-muted { color: var(--muted); }
.rec-chip { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 0.2rem 0.6rem 0.2rem 0.4rem; font: 500 0.78rem var(--font-mono); cursor: pointer; }
.rec-chip:hover { border-color: var(--border-strong); }
.tile-foot { gap: 0.4rem; flex-wrap: wrap; }
.rec-tabs { flex-wrap: wrap; }
.rec-score-row { display: flex; align-items: center; gap: 1.2rem; margin: 0.2rem 0 0.8rem; }
.rec-big { display: flex; flex-direction: column; }
.rec-big strong { font-size: 2.8rem; line-height: 1; letter-spacing: -0.04em; }
.rec-big small { color: var(--muted); font-size: 0.78rem; }
.rec-big.tone-good strong { color: var(--good); } .rec-big.tone-info strong { color: var(--data, var(--info)); } .rec-big.tone-warn strong { color: var(--warn); } .rec-big.tone-bad strong { color: var(--bad); }
.rec-action { border-top: 1px solid var(--border); padding-top: 0.7rem; }
.rec-flow { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; margin-top: 0.6rem; font-family: var(--font-mono); }
.flow-down { color: var(--warn); } .flow-up { color: var(--good); }
.rec-body .bodymap { max-width: 320px; margin: 0 auto; }
.body-svg .area.picked { stroke: var(--accent); stroke-width: 2.5; fill: color-mix(in srgb, var(--accent) 25%, var(--surface-2)); }
.routine-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.routine-list li { display: flex; align-items: center; gap: 0.6rem; }
.routine-list li > span { display: flex; flex-direction: column; min-width: 0; }
.routine-list .ex-thumb { width: 52px; height: 42px; }
.routine-card details summary { cursor: pointer; color: var(--muted); }
.rec-why { margin: 0 0 0.4rem; padding-left: 1.1rem; }
.rec-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.3rem; margin: 0.3rem 0 0.6rem; }
.rec-dots span { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; color: var(--muted); }
.rec-dots i { width: 100%; max-width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.rec-dots .on i { background: color-mix(in srgb, var(--good) 70%, transparent); border-color: var(--good); }
.rec-dots .today i { outline: 2px solid var(--accent); outline-offset: 1px; }
.rec-streaks { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; color: var(--muted); }
.rec-streaks strong { color: var(--text); }
.rec-drivers { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.rec-drivers li { display: flex; flex-direction: column; gap: 0.05rem; padding-left: 0.6rem; border-left: 2px solid var(--border-strong); }
.rec-fix { color: var(--muted); }
.rev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.6rem; }
.rev-cell { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.rev-cell strong { font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rev-focus { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.25rem; }
.mob-plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.8rem; }
.mob-item { border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem; display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.rom-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.rom-chart { margin: 0; }
.rom-chart svg { width: 100%; height: auto; display: block; }
.rom-chart polyline { fill: none; stroke-width: 2; }
.rom-left { stroke: var(--data, var(--info)); fill: var(--data, var(--info)); }
.rom-right { stroke: var(--accent); fill: var(--accent); }
polyline.rom-left, polyline.rom-right { fill: none; }
.rom-norm { stroke: var(--good); stroke-dasharray: 4 4; opacity: 0.7; }
.rom-label { font: 10px var(--font-mono); fill: var(--muted); }
.key { display: inline-block; width: 10px; height: 3px; border-radius: 2px; vertical-align: middle; margin-left: 0.4rem; }
.key-left { background: var(--data, var(--info)); } .key-right { background: var(--accent); }
.stage-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.3rem; margin-bottom: 0.6rem; }
.stage-bar span { display: flex; flex-direction: column; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.82rem; color: var(--muted); }
.stage-bar span.on { border-color: var(--accent); color: var(--text); }
.stage-bar span.done { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--text); }
.stage-bar small { font-family: var(--font-mono); font-size: 0.7rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip.suggested { border-color: var(--accent); }
.sleep-chart { width: 100%; height: auto; margin: 0.8rem 0 0.4rem; }
.sleep-chart rect.ok { fill: var(--data, var(--info)); }
.sleep-chart rect.short { fill: color-mix(in srgb, var(--warn) 80%, transparent); }
.sleep-chart .need { stroke: var(--good); stroke-dasharray: 4 4; }
.rec-tips { margin: 0.4rem 0 0.6rem; padding-left: 1.1rem; display: grid; gap: 0.25rem; }
.pacer-stage { position: relative; height: 250px; display: grid; place-items: center; }
.pacer-ring { --s: 0.35; width: 210px; height: 210px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--data, var(--info)) 70%, transparent); background: color-mix(in srgb, var(--data, var(--info)) 12%, transparent); transform: scale(var(--s)); transition: transform 0.15s linear, border-color 0.4s; display: grid; place-items: center; }
.pacer-ring[data-kind='hold'] { border-color: var(--warn); }
.pacer-ring[data-kind='out'] { border-color: var(--good); }
.pacer-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--data, var(--info)); }
.pacer-text { position: absolute; text-align: center; display: flex; flex-direction: column; }
.pacer-text span { font-size: 1.8rem; font-weight: 700; }
.pattern-list { display: grid; gap: 0.4rem; }
.pattern { display: grid; grid-template-columns: 1fr auto; gap: 0 0.6rem; text-align: left; border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.65rem; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.pattern span:nth-child(2) { grid-column: 1; }
.pattern span:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); }
.pattern.on { border-color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.4rem; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.6rem 0.3rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: 500 0.78rem var(--font); cursor: pointer; text-align: center; }
.tool.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.tool-ico { font-size: 1.3rem; }
.rec-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.rec-log li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center; }
.rec-log li > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.timeline > li { display: grid; grid-template-columns: 88px 1fr; gap: 0.6rem; position: relative; }
.timeline > li > div { border-left: 2px solid var(--border-strong); padding-left: 0.7rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.timeline ul { margin: 0; padding-left: 1rem; }
.tl-at { font-size: 0.78rem; color: var(--accent); padding-top: 0.1rem; }
#routine-player { width: min(560px, 96vw); }
.rp-stage .rp-canvas { width: 100%; height: 260px; display: block; border-radius: 10px; background: var(--surface-2); }
.rp-now { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.7rem; }
.rp-now > div:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.rp-name { font-size: 1.2rem; }
.rp-clock { font-size: 2.6rem; font-weight: 600; letter-spacing: -0.03em; }
.hr-row { display: flex; gap: 0.4rem; align-items: center; }
.hr-row input { flex: 1; min-width: 0; }
#camera-hr { width: min(520px, 96vw); }
.hr-wave { width: 100%; height: 90px; display: block; background: var(--surface-2); border-radius: 8px; margin: 0.4rem 0; }
.hr-big { font-size: 2rem; }
@media (max-width: 640px) {
  .timeline > li { grid-template-columns: 1fr; }
  .rp-stage .rp-canvas { height: 210px; }
  .rec-big strong { font-size: 2.3rem; }
}

/* ---------- Demo player: study controls (v0.3) ---------- */
.demo-tag { position: absolute; right: 0.75rem; top: 1.3rem; font: 600 0.72rem var(--font-mono, ui-monospace, monospace); color: var(--accent); letter-spacing: 0.03em; pointer-events: none; text-transform: uppercase; }
.demo-tag:empty { display: none; }
.demo-scrub { display: flex; align-items: center; gap: 0.35rem; margin: 0.5rem 0 0.25rem; }
.demo-scrub input[type='range'] { flex: 1; accent-color: var(--accent); min-width: 0; }
.demo-study { flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.chip-toggle { border: 1px solid var(--border-strong, var(--border)); background: transparent; color: var(--muted); border-radius: 999px; padding: 0.3rem 0.7rem; font: inherit; font-size: 0.8rem; cursor: pointer; }
.chip-toggle[aria-pressed='true'] { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chip-toggle[aria-pressed='true']::before { content: '✓ '; color: var(--accent); }
.demo-read { min-height: 1.3em; margin: 0.5rem 0 0; font-variant-numeric: tabular-nums; }
.demo-scrub .btn { font-size: 1.2rem; line-height: 1; padding: 0.2rem 0.6rem; }
.vs-panel { margin-top: 0.6rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.vs-list { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.85rem; }
.vs-gap { display: inline-block; min-width: 3.2rem; color: var(--accent); font-weight: 700; }

/* ---------- Display modes, accent and team colours (v0.3) ---------- */
:root[data-display='black'] {
  --bg: #000000; --surface: #07080a; --surface-solid: #07080a; --surface-2: #0d0f12;
  --border: #1a1d22; --border-strong: #262a30;
}
:root[data-display='contrast'] {
  --bg: #000000; --surface: #000000; --surface-solid: #000000; --surface-2: #111111;
  --text: #ffffff; --muted: #d0d4da; --border: #8a9099; --border-strong: #c9ced6;
  --good: #4dffb0; --warn: #ffd23f; --bad: #ff6b78; --data: #9fdcff; --cyan: #9fdcff;
}
:root[data-display='contrast'] a, :root[data-display='contrast'] .link { text-decoration: underline; }
:root[data-display='contrast'] :focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
:root[data-display='contrast'] .muted, :root[data-display='contrast'] .hint { color: var(--muted); }
.accent-pick { display: flex; flex-wrap: wrap; gap: 0.45rem; border: 0; padding: 0; margin: 0.2rem 0 0.4rem; }
.accent-pick legend { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; padding: 0; }
.swatch { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.6rem 0.3rem 0.35rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 0.8rem; margin: 0; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; left: 0; top: 0; }
.swatch i { width: 1.1rem; height: 1.1rem; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.swatch:has(input:checked) { border-color: var(--text); background: var(--surface-2); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand .team-logo { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; margin-left: auto; }
.brand-preview { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem; border: 1px solid var(--border); border-radius: 10px; }
.brand-preview img { width: 44px; height: 44px; object-fit: contain; }
.brand-preview .chip { background: var(--team, var(--accent)); color: var(--accent-ink); padding: 0.25rem 0.6rem; border-radius: 6px; font-weight: 600; font-size: 0.8rem; }
.accent-pick .swatch { flex-direction: row; align-items: center; font-weight: 500; color: var(--text); }
#brand-form input[type='color'] { height: 2.4rem; padding: 0.2rem; width: 100%; cursor: pointer; }

/* ---------- Session notes (v0.3) ---------- */
.note-btn { position: relative; white-space: nowrap; }
.note-btn.has-new { color: var(--accent); }
.note-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.note-btn .note-dot { position: absolute; top: 3px; right: 3px; }
.note-list { list-style: none; padding: 0; margin: 0 0 0.75rem; display: grid; gap: 0.5rem; max-height: 46vh; overflow: auto; }
.note { padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.note.coach { border-left: 3px solid var(--accent); }
.note.athlete { border-left: 3px solid var(--data); }
.note p { margin: 0.2rem 0 0; white-space: pre-wrap; }
.note-meta { font-size: 0.78rem; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; margin-left: 0.4rem; }
.notes-card { margin-bottom: 1rem; }
.rec-score .card-head .note-btn { margin-left: auto; }
.note p, .note-meta { font-style: normal; }
.profile-logo { width: 56px; height: 56px; object-fit: contain; margin-left: auto; }
.profile-hero[style*='--team'] { border-bottom: 3px solid var(--team); padding-bottom: 0.75rem; }
.profile-hero[style*='--team'] .avatar { background: var(--team); color: #fff; }

/* ---------- Motiq 1.0: builder upgrades ---------- */
.btn-icon { font: inherit; background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 0 0.35rem; line-height: 1.4; cursor: pointer; margin-left: 0.25rem; }
.btn-icon:hover, .btn-icon:focus-visible { color: var(--text); border-color: var(--accent); }
.equip-profiles .chip[aria-pressed='true'] { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.compare-table ul.plain { list-style: none; margin: 0; padding: 0; }
.compare-table li.diff { color: var(--accent); font-weight: 600; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.report-card { border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.75rem; }
.report-card:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.report-card h4 { margin: 0.75rem 0 0.25rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 0.5rem; }
.stat-row > div { background: var(--surface-2); border-radius: 10px; padding: 0.5rem 0.65rem; display: flex; flex-direction: column; gap: 0.15rem; }
.stat-row strong { font-size: 1.15rem; }
.lift-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.lift-tile:hover, .lift-tile:focus-visible { border-color: var(--accent); }
.lift-tile strong { font-size: 1.4rem; }
.lift-chart { width: 100%; max-width: 640px; height: auto; margin: 0.75rem 0; }
.lift-chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.lift-chart circle { fill: var(--accent); }
.lift-chart .axis { stroke: var(--border); }
.lift-chart .lbl { fill: var(--muted); font-size: 9px; font-family: var(--mono, monospace); }
.lift-profile h4 { margin: 1rem 0 0.25rem; }

/* Motiq 1.0 form checker upgrades */
.band-bars { display: grid; gap: 0.35rem; }
.band-bar { display: grid; grid-template-columns: 5.5rem 1fr 2.2rem 3.5rem; align-items: center; gap: 0.5rem; }
.band-bar .bar { height: 8px; border-radius: 4px; background: var(--line, rgba(127,127,127,.2)); overflow: hidden; }
.band-bar .bar i { display: block; height: 100%; background: var(--good); border-radius: inherit; }
.band-bar.off .bar i { background: var(--warn); }
.rep-timeline td { white-space: nowrap; }
.review-queue { margin-bottom: 1rem; }
.banner.danger { border-color: var(--bad); }

/* Motiq 1.0 coach and team tools */
.cc-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line, rgba(127,127,127,.2)); margin: .25rem 0 .5rem; }
.cc-bar i { display: block; height: 100%; }
.cc-bar i.good { background: var(--good); }
.cc-bar i.warn { background: var(--warn); }
.cc-bar i.none { background: rgba(127,127,127,.35); }
.cc-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: var(--muted); }
.cc-legend b { color: var(--text, inherit); }
.cc-todo { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .25rem; }
.cc-todo li { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; padding: .45rem .5rem; border-radius: 8px; }
.cc-todo li:hover { background: rgba(127,127,127,.08); }
.announce-card { margin-bottom: 1rem; }
.announce-card textarea { width: 100%; }
.announce-list .tally { display: grid; gap: .25rem; margin-top: .4rem; }
.announce-list .band-bar { grid-template-columns: minmax(4rem, 8rem) 1fr 2rem minmax(0, 8rem); }
.announce-banner .main { display: flex; flex-direction: column; }

/* Motiq 1.0 legal */
.legal-links { text-align: center; color: var(--muted); margin: 1rem 0 0; }
.legal-links a { color: inherit; }
.legal-fields { border: 0; padding: 0; margin: 0; }
.legal-fields legend { padding: 0; margin-bottom: .25rem; color: var(--muted); }
.legal-fields select { flex: 1; min-width: 0; }
.auth-form .check a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Motiq 1.0 plans and beta */
.beta-badge { font: 600 10px/1 var(--font-mono, ui-monospace, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px solid currentColor; border-radius: 4px; padding: 3px 5px; margin-left: 6px; align-self: center; }
.feedback-fab { position: fixed; right: 16px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line, rgba(127,127,127,.3)); background: var(--card, #15171c); color: var(--text, inherit); font: inherit; font-size: 13px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.feedback-fab:hover { border-color: var(--accent); }
.feedback-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.no-nav .feedback-fab { display: none; }
@media (max-width: 860px) { .feedback-fab { bottom: calc(env(safe-area-inset-bottom, 0px) + 78px); right: 12px; padding: 10px; } .feedback-fab span { display: none; } }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin: .5rem 0 1rem; }
.plans-grid .plan { border: 1px solid var(--line, rgba(127,127,127,.3)); border-radius: 12px; padding: .9rem; display: flex; flex-direction: column; gap: .3rem; }
.plans-grid .plan.current { border-color: var(--accent); }
.plans-grid .plan h4 { margin: 0; }
.plans-grid .plan ul { margin: .25rem 0 .5rem; padding-left: 1.1rem; flex: 1; }
.upgrade-card { border-style: dashed; }

/* =====================================================================
   v8 design system: "Fusion"
   Thermal's glowing body figure, Holo's frosted glass over a soft aurora, Telemetry's numbers.
   Colour rules: cool tones (blue, cyan, violet) for everything normal, including how hard you trained.
   Amber means "watch this" and rose means "needs attention"; nothing else on screen is warm.
   Overrides everything above.
   ===================================================================== */
:root {
  --bg: #eef1f8;
  --surface: rgba(255, 255, 255, 0.62);
  --surface-solid: #ffffff;
  --surface-2: rgba(232, 236, 248, 0.75);
  --text: #0c1020;
  --muted: #5a6280;
  --border: rgba(60, 72, 120, 0.13);
  --border-strong: rgba(60, 72, 120, 0.24);
  --accent: #0a86b0;
  --accent-2: #6b4fe0;
  --accent-ink: #ffffff;
  --data: #3a62e0;
  --cyan: #0a86b0;
  --good: #0d9b78;
  --warn: #b86e00;
  --bad: #d1365a;
  --info: #3a62e0;
  --mild: #8f74f0;
  --sore: #d98a00;
  --pain: #d1365a;
  --glass-hi: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 14px 34px -22px rgba(30, 40, 90, 0.35);
  --aurora-1: rgba(80, 110, 255, 0.22);
  --aurora-2: rgba(0, 200, 255, 0.18);
  --aurora-3: rgba(150, 110, 255, 0.18);
  --body-rest: rgba(70, 90, 160, 0.16);
  --body-line: rgba(70, 90, 160, 0.35);
  --radius: 18px;
  --font: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: var(--font);
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-num: 'Barlow Condensed', 'Arial Narrow', ui-sans-serif, sans-serif;
  --hud-bg: #05070d; --hud-line: rgba(127, 232, 255, 0.18); --hud-ink: #e6f6ff; --hud-mute: #7f8db0; --hud-cyan: #7fe8ff; --hud-amber: #ffb547;
  --hud-font: var(--font-num);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #070a12; --surface: rgba(255, 255, 255, 0.055); --surface-solid: #0e1220; --surface-2: rgba(255, 255, 255, 0.07);
    --text: #eaf0ff; --muted: #8d98bd; --border: rgba(255, 255, 255, 0.1); --border-strong: rgba(255, 255, 255, 0.18);
    --accent: #7fe8ff; --accent-2: #9b7bff; --accent-ink: #061018; --data: #8fb2ff; --cyan: #7fe8ff;
    --good: #5cf2c8; --warn: #ffb547; --bad: #ff6b8a; --info: #8fb2ff;
    --mild: #a98bff; --sore: #ffb547; --pain: #ff6b8a;
    --glass-hi: rgba(255, 255, 255, 0.16); --glass-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.8);
    --aurora-1: rgba(47, 75, 255, 0.28); --aurora-2: rgba(0, 212, 255, 0.16); --aurora-3: rgba(138, 92, 255, 0.22);
    --body-rest: rgba(140, 160, 230, 0.12); --body-line: rgba(160, 180, 255, 0.28);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #070a12; --surface: rgba(255, 255, 255, 0.055); --surface-solid: #0e1220; --surface-2: rgba(255, 255, 255, 0.07);
  --text: #eaf0ff; --muted: #8d98bd; --border: rgba(255, 255, 255, 0.1); --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #7fe8ff; --accent-2: #9b7bff; --accent-ink: #061018; --data: #8fb2ff; --cyan: #7fe8ff;
  --good: #5cf2c8; --warn: #ffb547; --bad: #ff6b8a; --info: #8fb2ff;
  --mild: #a98bff; --sore: #ffb547; --pain: #ff6b8a;
  --glass-hi: rgba(255, 255, 255, 0.16); --glass-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.8);
  --aurora-1: rgba(47, 75, 255, 0.28); --aurora-2: rgba(0, 212, 255, 0.16); --aurora-3: rgba(138, 92, 255, 0.22);
  --body-rest: rgba(140, 160, 230, 0.12); --body-line: rgba(160, 180, 255, 0.28);
  color-scheme: dark;
}
/* True black and high contrast stay flat and solid (no glass, no aurora). */
:root[data-display='black'] {
  --bg: #000000; --surface: #07080c; --surface-solid: #07080c; --surface-2: #0e1016;
  --border: #1b1e26; --border-strong: #2a2e38; --aurora-1: transparent; --aurora-2: transparent; --aurora-3: transparent;
}
:root[data-display='contrast'] {
  --bg: #000000; --surface: #000000; --surface-solid: #000000; --surface-2: #111111;
  --text: #ffffff; --muted: #d0d4da; --border: #8a9099; --border-strong: #c9ced6;
  --good: #4dffb0; --warn: #ffd23f; --bad: #ff6b78; --data: #9fdcff; --cyan: #9fdcff; --accent: #9fefff;
  --aurora-1: transparent; --aurora-2: transparent; --aurora-3: transparent;
}

body { font: 15px/1.5 var(--font); letter-spacing: 0; background: var(--bg); color: var(--text); }
.bg-fx { display: block; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 45% at 12% -5%, var(--aurora-1), transparent 65%), radial-gradient(55% 40% at 105% 40%, var(--aurora-2), transparent 65%), radial-gradient(60% 45% at -5% 105%, var(--aurora-3), transparent 65%); }
.stat, .big-num strong, .rec-big strong, .rp-clock, .hr-big, .jump-best .big, .why-big, .ready-core strong, .rev-cell strong, .pacer-text span { font-family: var(--font-num); font-style: italic; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.num, time, .tile-scale, .tile-meta .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* glass surfaces */
.card, .tile, .updates, .side-controls, .auth-panel, .mode-card, .banner, .brief-line, .vs-panel {
  background: linear-gradient(160deg, var(--glass-hi), transparent 42%), var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi);
}
.card .card, .tile .card { background: var(--surface-2); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-color: var(--border); }
.updates .banner { box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; }
:root[data-display] .card, :root[data-display] .tile, :root[data-display] .updates, :root[data-display] .side-controls, :root[data-display] .banner { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
dialog { background: var(--surface-solid); border-radius: 22px; border: 1px solid var(--border-strong); }
dialog::backdrop { background: rgba(4, 6, 14, 0.55); backdrop-filter: blur(6px); }

/* type */
h1, h2, h3, .page-title, .hero-title { font-family: var(--font); }
.page-title { font-weight: 300; font-size: 1.9rem; letter-spacing: -0.03em; }
.card-head h3 { font: 500 0.95rem/1.3 var(--font); letter-spacing: -0.005em; color: var(--text); }
h3 { font: 500 0.68rem/1.2 var(--font-mono); letter-spacing: 0.12em; color: var(--muted); }
.eyebrow, .why-sub { font: 500 0.66rem var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* buttons, inputs, pills */
.btn { border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); font-weight: 500; padding-inline: 1rem; }
.btn:hover { background: var(--surface-2); }
.btn-sm { padding-inline: 0.7rem; }
.btn-primary, .btn-primary:hover { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 35%, var(--accent-2))); border: 0; color: var(--accent-ink); font-weight: 600; box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost, .btn-ghost:hover { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.icon-btn { border-radius: 999px; background: var(--surface); }
.icon-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border: 0; }
input, select, textarea { border-radius: 12px; background: var(--surface); border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.segmented { border-radius: 999px; background: var(--surface-2); padding: 3px; }
.segmented button { border-radius: 999px; }
.segmented button[aria-pressed='true'] { background: var(--surface-solid); box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--border-strong); }
.pill { border-radius: 999px; padding: 0.08rem 0.55rem; font: 500 0.68rem/1.5 var(--font-mono); }
.chip, .chip-btn, .qa, .rec-chip, .risk-chip { border-radius: 999px; }
.avatar, .avatar.coach { border-radius: 50%; }

/* shell: desktop sidebar */
.sidebar { background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-right: 1px solid var(--border); }
.brand { font: 600 1.15rem var(--font); letter-spacing: -0.02em; }
.brand svg { stroke: var(--accent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 70%, transparent)); }
.side-search { border-radius: 999px; background: var(--surface); }
.nav-item { border-radius: 12px; padding: 0.55rem 0.7rem; font: 500 0.92rem/1 var(--font); }
.nav-item[aria-current='page'] { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 85%); box-shadow: inset 2px 0 0 var(--accent); }
.nav-item[aria-current='page'] .ico { color: var(--accent); filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 70%, transparent)); }
/* Today, Train, Form and Recover are the main four; the rest sit under a quiet divider. */
.side-nav .nav-item:nth-child(5) { margin-top: 0.7rem; position: relative; }
.side-nav .nav-item:nth-child(5)::after { content: ''; position: absolute; top: -0.4rem; left: 0.7rem; right: 0.7rem; height: 1px; background: var(--border); }
.side-nav .nav-item:nth-child(n + 5) { font-size: 0.86rem; color: var(--muted); }
.side-nav .nav-item:nth-child(n + 5)[aria-current='page'] { color: var(--text); }
.subnav { background: transparent; }
.pill-tabs button[aria-selected='true'] { border-bottom-color: var(--accent); }

/* shell: phones get a floating glass dock */
@media (max-width: 860px) {
  .topbar { background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); }
  .subnav { background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
  main { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .bottombar { left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 24px; padding: 6px; border: 1px solid var(--border-strong);
    background: color-mix(in srgb, var(--surface-solid) 72%, transparent); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7), inset 0 1px 0 var(--glass-hi); }
  .tab-item { font: 500 0.62rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; border-radius: 18px; padding: 7px 0 5px; }
  .tab-item[aria-current='page'] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); }
  .tab-item[aria-current='page'] .ico { stroke: var(--accent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 80%, transparent)); }
  .more-panel { background: var(--surface-solid); border-radius: 24px 24px 0 0; }
  .more-item { border-radius: 16px; }
  #toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* Home: Telemetry strips and numbers inside glass */
.home-head .hero-title { font-weight: 300; font-size: 2.1rem; letter-spacing: -0.035em; }
.qa { background: var(--surface); }
.qa:hover { background: var(--surface-2); }
.tile { padding: 1rem 1.05rem; gap: 0.65rem; }
.tile .session-name { font: italic 700 1.9rem/1 var(--font-num); text-transform: uppercase; letter-spacing: 0.005em; }
.block-list li { position: relative; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); padding-left: 0.85rem; overflow: hidden; }
.block-list li::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.block-list li:nth-child(3n + 2)::before { background: var(--accent-2); }
.block-list li:nth-child(3n + 3)::before { background: var(--data); }
.block-list .what b { font: italic 700 1rem/1.1 var(--font-num); text-transform: uppercase; letter-spacing: 0.02em; }
.big-num strong { font-size: 3rem; line-height: 0.9; }
.big-num:hover strong { color: var(--accent); }
.spark-line { stroke: var(--accent); }
.spark-area { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.spark-end { fill: var(--accent); filter: drop-shadow(0 0 4px var(--accent)); }
.zone-bar i { height: 6px; border-radius: 3px; }
.zone-bar .z-low { background: color-mix(in srgb, var(--data) 45%, transparent); }
.zone-bar .z-ok { background: var(--accent); }
.zone-bar b { box-shadow: 0 0 6px var(--text); }
.week-bars i { border-radius: 6px 6px 2px 2px; border-top: 0; background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent-2) 40%, transparent)); }
.week-bars i.today { background: linear-gradient(var(--accent-2), color-mix(in srgb, var(--accent-2) 30%, transparent)); box-shadow: 0 0 12px -2px var(--accent-2); }
.week-bars i.future { background: var(--surface-2); }
.meter i, .vel-bar i { background: linear-gradient(90deg, var(--data), var(--accent)); }

/* Today grid: session | body | readiness + load, then goal and week */
.bento { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr) minmax(0, 1fr); }
.tile-session { grid-row: span 2; }
.tile-body { grid-row: span 2; }
.tile-week { grid-column: span 2; }
@media (max-width: 1080px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-session { grid-column: 1 / -1; grid-row: auto; }
  .tile-body { grid-row: span 2; }
  .tile-week { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .tile-body { grid-row: auto; }
  .home-head .hero-title { font-size: 1.7rem; }
  .big-num strong { font-size: 2.5rem; }
}

/* The body figure */
.tile-body { align-items: stretch; }
.fx-body { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; border-radius: 14px; padding: 0.4rem 0.2rem 0.2rem; min-height: 0;
  background: radial-gradient(60% 55% at 50% 45%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 75%); }
.fx-body:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fx-fig { display: grid; justify-items: center; gap: 0.15rem; min-width: 0; }
.fx-fig small { font: 500 0.6rem var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.fx-svg { width: 100%; max-width: 128px; height: auto; max-height: 250px; display: block; overflow: visible; }
.fx-area { fill: var(--body-rest); stroke: var(--body-line); stroke-width: 0.8; }
.fx-area.on { fill: var(--fx); fill-opacity: var(--fo); stroke: color-mix(in srgb, var(--fx) 60%, transparent); }
.fx-area.watch { stroke: var(--warn); stroke-width: 2.6; }
.fx-area.focus { stroke: var(--bad); stroke-width: 2.8; }
.fx-scale { display: grid; gap: 0.25rem; }
.fx-scale i { display: block; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #3b6bff, #00c8ff, #7f8dff, #b07bff, #d98bff); }
.fx-scale div { display: flex; justify-content: space-between; font: 500 0.62rem var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.fx-flag { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.7rem 0.4rem 0.45rem; border-radius: 999px; font-size: 0.82rem;
  color: var(--text); background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.fx-flag i { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 700 0.7rem var(--font-mono); font-style: normal; background: var(--warn); color: #120a00; }
.fx-flag.focus { background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.fx-flag.focus i { background: var(--bad); color: #fff; }
.fx-flag .fx-more { margin-left: auto; color: var(--muted); font: 500 0.72rem var(--font-mono); }
.fx-flag:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fx-clear { font-size: 0.82rem; color: var(--muted); }
@media (max-width: 640px) { .fx-svg { max-height: 200px; } }

/* readiness ring in the Fusion colours */
.ready-core .rc-arc { stroke: var(--accent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent)); }
.ready-core.band-easy .rc-arc { stroke: var(--warn); }
.ready-core.band-rest .rc-arc { stroke: var(--bad); }
.ready-core strong { font-size: 2.6rem; }

/* body maps elsewhere: tightness is cool violet; only sore and pain are warm */
.body-svg .area { fill: var(--body-rest); stroke: var(--body-line); }

/* HUD camera screens: cyan brackets, glass readouts */
.hud { border-radius: 18px; border-color: var(--hud-line); }
.hud::before, .hud::after { border-color: var(--hud-cyan); filter: drop-shadow(0 0 4px var(--hud-cyan)); }
.hud::before { top: 8px; left: 8px; } .hud::after { bottom: 8px; right: 8px; }
.live-reps { border-radius: 14px; background: rgba(8, 12, 24, 0.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.14); }
.live-reps span, #live-count { font: italic 700 3.2rem/1 var(--font-num); text-shadow: 0 0 14px rgba(127, 232, 255, 0.5); }
.live-cue { font: italic 700 1.15rem var(--font-num); border-left-color: var(--hud-cyan); }
.jump-best.hud .big { font: italic 700 2.6rem/1 var(--font-num); text-shadow: 0 0 14px rgba(127, 232, 255, 0.45); }

/* motion: one signature (the body breathes), smooth surfaces, all off for reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .fx-svg g { animation: fx-breathe 6s ease-in-out infinite; transform-origin: 50% 50%; }
  @keyframes fx-breathe { 50% { opacity: 0.86; } }
  .fx-area.watch, .fx-area.focus { animation: fx-pulse 2.4s ease-in-out infinite; }
  @keyframes fx-pulse { 50% { stroke-opacity: 0.45; } }
  #view.enter > * { animation: fx-rise 0.42s var(--ease) both; }
  #view.enter > *:nth-child(2) { animation-delay: 0.03s; } #view.enter > *:nth-child(3) { animation-delay: 0.06s; } #view.enter > *:nth-child(4) { animation-delay: 0.09s; }
  @keyframes fx-rise { from { opacity: 0.001; transform: translateY(6px); } }
  .btn, .tile, .card, .nav-item, .tab-item, .fx-flag { transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
  .btn:active, .tab-item:active, .qa:active { transform: scale(0.97); }
}
@media (prefers-reduced-motion: reduce) {
  .fx-svg g, .fx-area, #view > * { animation: none !important; }
}

/* Fusion: notices that aren't problems stay cool */
.adapted-tag { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, transparent); background: color-mix(in srgb, var(--accent-2) 10%, transparent); border-radius: 999px; }
.feedback-fab { background: color-mix(in srgb, var(--surface-solid) 70%, transparent); color: var(--text); border: 1px solid var(--border-strong); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 999px; box-shadow: var(--glass-shadow); }
.pill.new { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
@media (max-width: 640px) { .home-head .qa { border-radius: 16px; } }
/* form-check exercise picker: glass tiles that light up like a HUD target */
.exercise-chip { position: relative; border-radius: 16px; background: linear-gradient(160deg, var(--glass-hi), transparent 45%), var(--surface); border: 1px solid var(--border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.exercise-chip:hover, .exercise-chip:focus-visible { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 8px 24px -12px color-mix(in srgb, var(--accent) 60%, transparent); }
.exercise-chip .ei, .exercise-chip > span { color: var(--accent); }

/* Evidence coverage, P grade and review badges (accuracy update) */
.ev-P { color: var(--muted); }
.ev-coverage { display: flex; height: 8px; border-radius: 999px; overflow: hidden; gap: 2px; margin-top: .6rem; }
.ev-bar { background: currentColor; min-width: 2px; }
.ev-review { display: inline-flex; align-items: center; padding: .05rem .45rem; border-radius: 999px; font-size: .68rem; border: 1px dashed currentColor; white-space: nowrap; }
.ev-review-good { color: var(--good); } .ev-review-cyan { color: var(--cyan); } .ev-review-warn { color: var(--warn); } .ev-review-bad { color: var(--bad, #ff6b6b); } .ev-review-muted { color: var(--muted); }
.ev-refs a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.sr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .8rem 0; }
.sr-stats > div { padding: .6rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: grid; }
.sr-stats strong { font: 700 1.3rem var(--font-mono); }
.sr-stats span { font-size: .75rem; color: var(--muted); }
.sr-kinds { display: grid; gap: .35rem; }
.sr-kind { display: grid; grid-template-columns: 9rem 1fr 3.5rem; align-items: center; gap: .5rem; font-size: .82rem; }
.sr-meter { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.sr-meter > i { display: block; height: 100%; background: var(--cyan); border-radius: inherit; }
.sr-data { list-style: none; padding: 0; margin: .8rem 0; display: grid; gap: .6rem; }
.sr-data li { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .6rem; align-items: center; padding: .7rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.sr-data li > i { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-style: normal; font-size: .8rem; }
.sr-data li.done > i { background: var(--good); border-color: var(--good); color: #000; }
.sr-data li > div { display: grid; gap: .2rem; }
@media (max-width: 560px) { .sr-stats { grid-template-columns: repeat(2, 1fr); } .sr-kind { grid-template-columns: 6.5rem 1fr 3rem; } }
.guideline-card, .needs-card { margin-bottom: 1rem; }
.guideline-card > summary, .needs-card > summary { cursor: pointer; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; list-style: none; }
.guideline-card > summary::-webkit-details-marker, .needs-card > summary::-webkit-details-marker { display: none; }
.guideline-list { list-style: none; padding: 0; margin: .7rem 0 0; display: grid; gap: .4rem; }
.guideline-list li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .4rem; align-items: start; font-size: .9rem; }
.guideline-list li.ok > span { color: var(--good); }
.good-text { color: var(--good); } .warn-text { color: var(--warn); }
.needs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .6rem; margin-top: .7rem; }
.needs-grid p { margin: .2rem 0 0; font-size: .9rem; }
.warmup-pick { margin-bottom: 1rem; }
.warmup-pick .segmented button[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- accuracy update: camera data points, recording options, trust labels ---------- */
.status-dot.na { background: transparent; border: 2px dashed var(--muted); box-sizing: border-box; }
li.not-measured .main > strong { opacity: .75; }
.trust { display: inline-block; font-size: .66rem; letter-spacing: .02em; padding: .04rem .38rem; border-radius: 999px; margin-left: .35rem; vertical-align: middle; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.trust-measured { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.trust-estimated { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); }
.trust-rule { color: var(--muted); border-style: dashed; }
.dp-list li { padding: .35rem 0; }
.two-phone { margin: .2rem 0 .7rem; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.rep-pairs { display: flex; flex-wrap: wrap; gap: .3rem; }
.bt-stage { position: relative; max-width: 640px; margin: .5rem auto; }
.bt-stage canvas { width: 100%; height: auto; border-radius: 8px; background: #000; cursor: crosshair; display: block; }
.rep-sync { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .5rem 0; }
.rep-sync figure { margin: 0; }
.rep-sync video { width: 100%; border-radius: 8px; background: #000; display: block; }
@media (max-width: 560px) { .rep-sync { grid-template-columns: 1fr; } }
.coach-film-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .2rem .8rem; border: 1px solid var(--border); border-radius: 10px; padding: .5rem .7rem; max-height: 14rem; overflow: auto; }
.cc-who { display: block; margin-bottom: .5rem; }
.cc-opts { margin-top: .6rem; border-top: 1px solid var(--border); padding-top: .4rem; }
.cc-opts summary { cursor: pointer; }
.cc-opt { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .45rem 0; flex-wrap: wrap; font-size: .85rem; }
.cc-opt select, .cc-opt input[type=range] { flex: 1; min-width: 8rem; }
.cc-opts .segmented button:disabled { opacity: .35; cursor: not-allowed; }
.cc-grid { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.cc-grid i { position: absolute; background: rgba(255, 255, 255, .22); }
.cc-grid i:nth-child(1), .cc-grid i:nth-child(2) { top: 0; bottom: 0; width: 1px; }
.cc-grid i:nth-child(1) { left: 33.33%; } .cc-grid i:nth-child(2) { left: 66.66%; }
.cc-grid i:nth-child(3), .cc-grid i:nth-child(4) { left: 0; right: 0; height: 1px; }
.cc-grid i:nth-child(3) { top: 33.33%; } .cc-grid i:nth-child(4) { top: 66.66%; }
.cc-grid b { position: absolute; left: 20%; right: 20%; top: 50%; height: 2px; margin-top: -1px; background: var(--hud-amber, #ffb547); box-shadow: 0 0 8px rgba(255, 181, 71, .6); transition: transform .15s linear; }
.cc-grid b.ok { background: var(--hud-cyan, #38f2ff); box-shadow: 0 0 8px rgba(56, 242, 255, .6); }
.cc-count { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; font-family: 'Chakra Petch', var(--font-mono, monospace); font-size: clamp(4rem, 16vw, 9rem); font-weight: 700; color: var(--hud-cyan, #38f2ff); text-shadow: 0 0 30px rgba(56, 242, 255, .6); background: rgba(2, 4, 7, .35); pointer-events: none; }
.cc-count.pop { animation: cc-pop .9s ease-out; }
@keyframes cc-pop { from { transform: scale(1.25); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cc-count.pop { animation: none; } }

/* Motiq 1.2.1: links from the sign-in screen to the landing page and its full demo */
.auth-tour { margin: 1.2rem 0 0; }
.auth-tour a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-tour a:hover { text-decoration: underline; }

/* Evidence grades: C ("Emerging") is not a warning, so it stays cool; amber is only for real flags. */
.ev-C { color: var(--info); }

/* Demo team banner and the link back to the home page */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .8rem; margin: .8rem clamp(.8rem, 3vw, 2rem) 0; padding: .55rem .6rem .55rem .9rem; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface-2); font-size: .88rem; }
.demo-bar-actions { display: inline-flex; gap: .4rem; }
.side-home { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; padding: .35rem .5rem; color: var(--muted); font-size: .85rem; text-decoration: none; border-radius: 10px; }
.side-home:hover { color: var(--text); background: var(--surface-2); }
.side-home svg { width: 16px; height: 16px; }
a.more-item { text-decoration: none; color: inherit; }

/* Evidence: two grades + sport relevance */
.ev-grades { display: grid; gap: .35rem; margin: .5rem 0 .6rem; }
.ev-grade-row { display: grid; grid-template-columns: 9.5rem auto 1fr; gap: .5rem; align-items: center; }
.ev-grade-k { font-size: .8rem; color: var(--muted); }
@media (max-width: 520px) { .ev-grade-row { grid-template-columns: auto 1fr; } .ev-grade-row .muted { grid-column: 1 / -1; } }
.rel-chip { display: inline-flex; padding: .1rem .5rem; border-radius: 999px; font: 700 .68rem var(--font-mono); border: 1px solid currentColor; white-space: nowrap; }
.rel-high { color: var(--good); } .rel-medium { color: var(--info); } .rel-low { color: var(--muted); }
.rel-table { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .25rem; }
.rel-table li { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; }
.lib-tags { display: flex; gap: .3rem; margin: .1rem 0 .2rem; flex-wrap: wrap; }

/* Live coach audio picker */
.voice-pick { display: inline-flex; align-items: center; gap: .35rem; }
.voice-pick select { padding: .3rem .5rem; font-size: .85rem; }
.voice-settings { display: grid; gap: .5rem; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 12px; padding: .6rem .8rem; }
.voice-settings .btn { justify-self: start; }

/* Test group page */
.pilot-weeks { display: flex; gap: .6rem; align-items: flex-end; height: 110px; margin-top: 1rem; }
.pilot-weeks > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .2rem; }
.pilot-weeks i { display: block; width: 100%; max-width: 54px; min-height: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2, var(--accent))); }
.pilot-fb .segmented { margin: .2rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Measure tools */
.level-readout { display: flex; align-items: center; gap: 1rem; margin: .6rem 0; }
.level-dial { position: relative; width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--line, rgba(255,255,255,.15)); flex: none; background: radial-gradient(circle, rgba(255,255,255,.04), transparent 70%); }
.level-dial::before { content: ''; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 1px; background: var(--line, rgba(255,255,255,.2)); }
.level-dial i { position: absolute; left: calc(50% - 2px); top: 8px; width: 4px; height: 40px; border-radius: 2px; background: var(--accent); transform-origin: 50% 40px; transition: transform .08s linear; }
.level-num { font-size: 2.6rem; line-height: 1; }
.measure-stage { position: relative; margin-top: .6rem; border-radius: 12px; overflow: hidden; background: #000; }
.measure-stage img, .measure-stage video { display: block; width: 100%; height: auto; }
.measure-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: manipulation; }
.measure-stage input[type=range] { position: relative; z-index: 1; width: 100%; display: block; background: var(--card, #111); }

/* Segmented control built from radio labels (Measure tools, feedback, Test group) */
.segmented:has(> label) { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; }
.segmented > label { position: relative; flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: .25rem; min-height: 34px; padding: .35rem .6rem; margin: 0; border-radius: 9px; cursor: pointer; font-size: .85rem; text-align: center; color: var(--muted); }
.segmented > label > input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented > label:has(input:checked) { background: var(--surface-solid); color: var(--text); box-shadow: 0 2px 10px -2px rgba(0, 0, 0, .35); }
.segmented > label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Small-phone fixes (iPhone SE, 320 px) */
.injury-list { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.segmented { max-width: 100%; flex-wrap: wrap; }
@media (max-width: 380px) {
  #view .row > svg.spark { flex: 1 1 60px; min-width: 0; width: auto; max-width: 120px; }
  #view .row { min-width: 0; }
}
#view .row > svg.spark { flex: 1 1 60px; min-width: 0; width: auto; max-width: 120px; }
.rts-item { flex-wrap: wrap; }

/* Form checker: the one fix to work on first */
.top-fix { margin: 0 0 0.75rem; border-left: 4px solid var(--warn); background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 10%, transparent), transparent 60%), var(--surface, transparent); }
.top-fix.bad { border-left-color: var(--bad); background: linear-gradient(90deg, color-mix(in srgb, var(--bad) 10%, transparent), transparent 60%), var(--surface, transparent); }
.top-fix-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
.top-fix-head h3 { margin: 0; }
.top-fix-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bad); }
.top-fix:not(.bad) .top-fix-tag { color: var(--warn); }
.top-fix-cue { font-size: 1.05rem; margin: 0.4rem 0 0; }
