/* HealthStreak 1.0 — "private practice after hours"
   Palette: glacier clinic light, spruce ink, scrub teal (Kelly), vital coral (pulse), medal gold. */
:root {
  color-scheme: light;
  --glacier: #EEF3F1;
  --paper: #FFFFFF;
  --spruce: #10302B;
  --spruce-2: #3B5852;
  --chart: #8FA9A3;
  --line: #D6E2DE;
  --teal: #1F7A6D;
  --teal-soft: #DCEEEA;
  --coral: #FF5A4E;
  --coral-soft: #FFE6E3;
  --gold: #D9A441;
  --gold-soft: #F7ECD4;

  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow: 0 1px 2px rgba(16, 48, 43, .06), 0 8px 24px rgba(16, 48, 43, .08);
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--glacier);
  color: var(--spruce);
  font: 400 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
[data-icon] svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.hint { color: var(--spruce-2); font-size: 14px; margin: 0; }
.form-error { color: #B42318; min-height: 1.2em; margin: 0; font-size: 14px; }

/* ── Buttons & fields ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; cursor: pointer; transition: transform .12s ease, background .2s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--spruce); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--spruce); }
.btn-danger-ghost { background: transparent; color: #B42318; border-color: #F3C9C4; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--spruce-2); flex: none;
}
.icon-btn:hover { background: var(--teal-soft); }

.stack-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: var(--spruce-2); }
.field input, .field select, .field textarea, .times input {
  width: 100%; min-height: 46px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--paper); padding: 10px 12px; font-size: 16px; font-weight: 400; color: var(--spruce);
}
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--teal-soft); border-radius: 999px; padding: 4px; gap: 4px; }
.seg-btn { min-height: 38px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; font-size: 14px; color: var(--spruce-2); cursor: pointer; }
.seg-btn.is-active { background: var(--paper); color: var(--spruce); box-shadow: var(--shadow); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 8px; }
.chips::-webkit-scrollbar { display: none; }
.chips-wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--paper); color: var(--spruce);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.chip:active { background: var(--teal-soft); }

/* ── Sign-in ────────────────────────────────────────────── */
.join-screen { min-height: 100%; display: grid; place-items: center; padding: calc(24px + var(--safe-t)) 16px 24px; }
.join-card { width: 100%; max-width: 400px; display: grid; gap: 16px; }
.join-card h1 { font-size: 44px; font-weight: 800; }
.join-motto { margin: -8px 0 4px; color: var(--spruce-2); font-size: 18px; }
.join-mark svg { width: 120px; height: 32px; }
.join-mark polyline { fill: none; stroke: var(--coral); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 220; stroke-dashoffset: 220; animation: trace 1.6s ease-out .2s forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }

/* ── Shell ──────────────────────────────────────────────── */
.shell { height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }

/* Kelly's chart header */
.chart {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center;
  padding: calc(12px + var(--safe-t)) 16px 12px; background: var(--paper);
  border-bottom: 1px solid var(--line); position: relative; z-index: 2;
}
.portrait {
  position: relative; width: 72px; height: 88px; border-radius: 20px; border: 0; padding: 0; cursor: pointer;
  background: linear-gradient(160deg, var(--teal) 0%, var(--spruce) 100%); overflow: visible;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; border-radius: 20px; }
.portrait-fallback { display: grid; place-items: center; height: 100%; color: #fff; font: 800 34px var(--display); }
.presence { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; background: var(--chart); border: 3px solid var(--paper); }
.presence.is-online { background: #22C55E; }
.chart-body { min-width: 0; display: grid; gap: 4px; }
.chart-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.coach-name { font-size: 26px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presence-label { font-size: 11px; color: var(--spruce-2); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.ecg { width: 100%; height: 34px; display: block; }
.ecg .base { stroke: var(--line); stroke-width: 1; }
.ecg .trace { fill: none; stroke: var(--coral); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ecg .trace.is-drawing { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: trace 1.4s ease-out forwards; }
.ecg .flat { stroke: var(--chart); stroke-dasharray: 2 4; }
.ecg .today-dot { fill: var(--coral); }
.vitals { display: flex; gap: 12px; font-size: 12px; color: var(--spruce-2); flex-wrap: wrap; }
.vital b { color: var(--spruce); font-weight: 500; font-size: 13px; }
.vital.lvl b { color: var(--gold); }
.xp { height: 4px; border-radius: 4px; background: var(--gold-soft); overflow: hidden; }
.xp span { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 4px; transition: width .8s cubic-bezier(.2,.8,.2,1); }

.views { position: relative; overflow: hidden; min-height: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.is-active { display: flex; flex-direction: column; }
.pane { overflow-y: auto; padding: 18px 16px calc(24px + var(--tabbar-h)); -webkit-overflow-scrolling: touch; height: 100%; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pane-head h2 { font-size: 30px; font-weight: 800; }
.pane-sub { margin: 0; color: var(--spruce-2); font-size: 13px; }
.section-label { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--spruce-2); margin: 26px 0 10px; }

/* ── Chat ───────────────────────────────────────────────── */
#view-chat { padding-bottom: var(--tabbar-h); }
.thread { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.day-sep { align-self: center; font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--chart); margin: 8px 0 2px; }
.msg { max-width: 84%; display: grid; gap: 6px; animation: rise .28s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.msg-user { align-self: flex-end; }
.msg-user .bubble { background: var(--spruce); color: #fff; border-radius: 20px 20px 6px 20px; }
.msg-kelly, .msg-reminder { align-self: flex-start; grid-template-columns: 32px 1fr; align-items: end; }
.msg-kelly .bubble { background: var(--paper); border-radius: 20px 20px 20px 6px; box-shadow: var(--shadow); }
.mini-face { width: 32px; height: 32px; border-radius: 10px; object-fit: cover; background: linear-gradient(160deg, var(--teal), var(--spruce)); color: #fff; display: grid; place-items: center; font: 800 14px var(--display); }
.bubble { padding: 11px 15px; font-size: 16px; white-space: pre-wrap; word-wrap: break-word; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin: 0; }
.msg-meta { font: 400 11px var(--mono); color: var(--chart); display: flex; gap: 8px; align-items: center; }
.msg-user .msg-meta { justify-content: flex-end; }
.msg-failed .bubble { background: #7A2A24; }
.voice-btn { border: 0; background: var(--teal-soft); color: var(--teal); border-radius: 999px; padding: 4px 10px 4px 6px; display: inline-flex; gap: 4px; align-items: center; font: 500 11px var(--mono); cursor: pointer; }
.voice-btn [data-icon] svg { width: 16px; height: 16px; }
.voice-btn.is-playing { background: var(--teal); color: #fff; }
.action-receipt { font: 500 12px var(--mono); color: var(--teal); background: var(--teal-soft); border-radius: 8px; padding: 6px 10px; }
.event-pill { align-self: center; font: 500 12px var(--mono); background: var(--gold-soft); color: #7A5A12; border-radius: 999px; padding: 5px 12px; animation: rise .28s ease-out both; text-align: center; max-width: 92%; }
.msg-reminder .bubble { background: var(--coral-soft); border-radius: 20px 20px 20px 6px; border: 1px dashed #FFB4AC; }
.msg-reminder .remind-actions { display: flex; gap: 8px; margin-top: 8px; }
.brief-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; background: var(--spruce); color: #fff; border-radius: 18px; padding: 10px; cursor: pointer; border: 0; text-align: left; width: 100%; }
.brief-card .bc-thumb { width: 56px; height: 70px; border-radius: 12px; object-fit: cover; background: linear-gradient(160deg, var(--teal), #0B201D); }
.brief-card .bc-title { font: 700 15px var(--display); }
.brief-card .bc-sub { font: 400 11px var(--mono); opacity: .75; }
.brief-card .bc-play { width: 40px; height: 40px; border-radius: 50%; background: var(--coral); display: grid; place-items: center; }
.typing { align-self: flex-start; display: flex; gap: 8px; align-items: center; font: 400 12px var(--mono); color: var(--spruce-2); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: blip 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blip { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.away-note { align-self: center; font-size: 13px; color: var(--spruce-2); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; text-align: center; }
.thread-empty { margin: auto 0; text-align: center; display: grid; gap: 8px; padding: 24px; color: var(--spruce-2); }
.thread-empty h2 { font-size: 26px; color: var(--spruce); }

.composer-wrap { background: linear-gradient(to top, var(--glacier) 70%, transparent); padding: 6px 12px 10px; }
.composer { display: flex; align-items: flex-end; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 26px; padding: 5px 5px 5px 16px; box-shadow: var(--shadow); }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; padding: 10px 0; max-height: 132px; font-size: 16px; line-height: 1.35; }
.send-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
#micBtn.is-listening { background: var(--coral); color: #fff; }

/* ── Today: pill organizer ───────────────────────────────── */
.organizer { display: grid; gap: 12px; }
.compartment { background: var(--paper); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow); border-top: 4px solid var(--teal); }
.compartment.c-morning { border-top-color: var(--gold); }
.compartment.c-midday { border-top-color: var(--teal); }
.compartment.c-evening { border-top-color: var(--coral); }
.compartment.c-night { border-top-color: var(--spruce); }
.compartment.is-complete { background: linear-gradient(0deg, var(--teal-soft), var(--paper) 70%); }
.comp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.comp-head h3 { font: 700 18px var(--display); margin: 0; }
.comp-head span { font: 500 12px var(--mono); color: var(--spruce-2); }
.dose { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.dose:first-of-type { border-top: 0; }
.dose-time { font: 500 13px var(--mono); color: var(--spruce-2); }
.dose-name { font-weight: 700; }
.dose-sub { font-size: 13px; color: var(--spruce-2); }
.check {
  width: 48px; height: 48px; border-radius: 16px; border: 2px solid var(--line); background: var(--paper);
  display: grid; place-items: center; cursor: pointer; color: transparent; transition: all .18s ease;
}
.check.is-done { background: var(--teal); border-color: var(--teal); color: #fff; transform: rotate(-4deg); }
.check:active { transform: scale(.92); }
.cat-tag { font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--teal); }
.empty-card { background: var(--paper); border: 1px dashed var(--chart); border-radius: var(--r-lg); padding: 22px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty-card h3 { font: 700 20px var(--display); margin: 0; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge { background: var(--paper); border-radius: var(--r-md); padding: 12px; display: grid; gap: 4px; border: 1px solid var(--line); opacity: .55; }
.badge.is-earned { opacity: 1; border-color: var(--gold); background: linear-gradient(160deg, var(--gold-soft), var(--paper)); }
.badge .b-icon { font-size: 22px; filter: grayscale(1); }
.badge.is-earned .b-icon { filter: none; }
.badge strong { font: 700 15px var(--display); }
.badge small { color: var(--spruce-2); font-size: 12px; }

/* ── Stack ──────────────────────────────────────────────── */
.stack-list { display: grid; gap: 10px; }
.stack-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; background: var(--paper); border-radius: var(--r-md); padding: 10px; box-shadow: var(--shadow); border: 0; text-align: left; cursor: pointer; width: 100%; }
.stack-thumb { width: 52px; height: 52px; border-radius: 14px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; overflow: hidden; }
.stack-thumb img { width: 100%; height: 100%; object-fit: cover; }
.stack-times { font: 500 12px var(--mono); color: var(--spruce-2); text-align: right; }
.times { display: grid; gap: 8px; }
.time-row { display: grid; grid-template-columns: 1fr 44px; gap: 6px; }
.photo-pick { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; color: var(--spruce-2); font-size: 14px; }
.photo-thumb { width: 56px; height: 56px; border-radius: 14px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; overflow: hidden; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Briefs ─────────────────────────────────────────────── */
.player { background: var(--spruce); border-radius: var(--r-lg); overflow: hidden; color: #fff; margin-bottom: 16px; }
.player video { width: 100%; max-height: 62vh; background: #000; aspect-ratio: 9 / 16; object-fit: contain; }
.player .audio-stage { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px; align-items: center; }
.player .audio-stage img, .player .audio-stage .ph { width: 96px; height: 120px; border-radius: 16px; object-fit: cover; background: linear-gradient(160deg, var(--teal), #0B201D); }
.player audio { width: 100%; }
.player-body { padding: 14px; display: grid; gap: 8px; }
.player-body h3 { font: 700 20px var(--display); margin: 0; }
.transcript { font-size: 15px; line-height: 1.55; color: #D9E7E3; max-height: 220px; overflow-y: auto; white-space: pre-wrap; }
.brief-list { display: grid; gap: 8px; }
.brief-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; background: var(--paper); border-radius: var(--r-md); padding: 12px 14px; border: 0; text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.brief-row .br-date { font: 500 12px var(--mono); color: var(--spruce-2); }
.brief-row .br-title { font-weight: 700; }
.brief-row .br-kind { font: 500 11px var(--mono); color: var(--teal); }
.brief-row.is-new .br-title::after { content: " ●"; color: var(--coral); }

/* ── You ────────────────────────────────────────────────── */
.card { background: var(--paper); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 12px; margin-bottom: 14px; }
.card h3 { font: 700 18px var(--display); margin: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.device { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.device:first-child { border-top: 0; }
.device small { display: block; color: var(--spruce-2); font: 400 12px var(--mono); }
.link-code { font: 500 34px var(--mono); letter-spacing: .18em; text-align: center; color: var(--teal); background: var(--teal-soft); border-radius: var(--r-md); padding: 12px; }
.leader { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.leader:first-child { border-top: 0; }
.leader .rank { font: 700 18px var(--display); color: var(--chart); }
.leader .score { font: 500 13px var(--mono); }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: var(--shadow); }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ── Avatar sheet ───────────────────────────────────────── */
.avatar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.avatar-tile { position: relative; border: 3px solid transparent; border-radius: 18px; padding: 0; background: var(--teal-soft); aspect-ratio: 4 / 5; overflow: hidden; cursor: pointer; }
.avatar-tile img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.avatar-tile.is-selected { border-color: var(--teal); }
.avatar-tile.is-selected::after { content: "Wearing"; position: absolute; left: 6px; bottom: 6px; background: var(--teal); color: #fff; font: 500 10px var(--mono); padding: 3px 7px; border-radius: 999px; }
.avatar-tile .tile-del { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(16,48,43,.7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.avatar-tile .tile-del svg { width: 14px; height: 14px; }
.upload-btn { cursor: pointer; margin-top: 12px; }

/* ── Sheets, celebration, toast ─────────────────────────── */
.sheet { border: 0; padding: 0; width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0; border-radius: 26px 26px 0 0; background: var(--glacier); color: var(--spruce); }
.sheet::backdrop { background: rgba(16, 48, 43, .45); backdrop-filter: blur(2px); }
.sheet[open] { animation: sheet-up .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-inner { padding: 18px 16px calc(18px + var(--safe-b)); overflow-y: auto; max-height: 92dvh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h2 { font-size: 24px; }
.sheet-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.sheet-actions .btn-primary { margin-left: auto; }

.celebrate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(16, 48, 43, .55); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.celebrate-card { background: var(--paper); border-radius: 28px; padding: 28px 22px 22px; max-width: 340px; width: 100%; text-align: center; display: grid; gap: 8px; justify-items: center; animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
.medal { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; background: radial-gradient(circle at 35% 30%, #FBE6B3, var(--gold)); box-shadow: 0 0 0 6px var(--gold-soft); }
.celebrate-kicker { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 6px 0 0; }
.celebrate-card h2 { font-size: 28px; font-weight: 800; }
.celebrate-card p { margin: 0 0 8px; color: var(--spruce-2); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 84px + var(--safe-b)); transform: translate(-50%, 20px);
  background: var(--spruce); color: #fff; padding: 10px 16px; border-radius: 999px; font: 500 13px var(--mono);
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 60; max-width: calc(100% - 32px); text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── Tab bar ────────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.tab { position: relative; border: 0; background: transparent; display: grid; place-items: center; align-content: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--chart); cursor: pointer; }
.tab.is-active { color: var(--teal); }
.tab-dot { position: absolute; top: 10px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }

/* ── Desktop: Kelly's chart becomes a sidebar ───────────── */
@media (min-width: 900px) {
  .shell { grid-template-columns: 340px 1fr; grid-template-rows: 1fr; }
  .chart { grid-template-columns: 1fr; align-content: start; padding: 32px 24px; border-bottom: 0; border-right: 1px solid var(--line); height: 100dvh; gap: 18px; }
  .portrait { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 28px; }
  .portrait img { border-radius: 28px; }
  .portrait-fallback { font-size: 96px; }
  .presence { width: 24px; height: 24px; right: 14px; bottom: 14px; }
  .coach-name { font-size: 34px; }
  .ecg { height: 48px; }
  .views { height: 100dvh; }
  .tabbar { position: absolute; left: 340px; top: 0; bottom: auto; height: 60px; padding: 0; border-top: 0; border-bottom: 1px solid var(--line); grid-auto-columns: 120px; justify-content: center; }
  .tab { grid-auto-flow: column; gap: 8px; font-size: 14px; }
  .views { padding-top: 60px; }
  .view { top: 60px; } /* views are absolutely positioned, so they start below the top tab bar themselves */
  #view-chat { padding-bottom: 0; }
  .thread, .composer-wrap { width: 100%; max-width: 760px; margin: 0 auto; }
  .pane { padding: 28px 32px 40px; max-width: 900px; margin: 0 auto; width: 100%; }
  .organizer { grid-template-columns: repeat(2, 1fr); }
  .sheet { margin: auto; border-radius: 26px; }
  .toast { bottom: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* 1.1 — paste a list */
.head-actions { display: flex; gap: 8px; align-items: center; }
.paste-preview { display: grid; gap: 6px; margin: 4px 0 12px; }
.paste-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.paste-row strong { font-weight: 700; }
.paste-row .paste-times { font-family: var(--mono); font-size: 12.5px; text-align: right; white-space: nowrap; }
.paste-row .paste-sub { grid-column: 1 / -1; font-size: 13px; opacity: .75; }
.paste-row.is-warn { border-color: rgba(217,164,65,.7); }
.paste-row.is-bad { border-color: rgba(255,90,78,.7); background: rgba(255,90,78,.06); }
.portrait.is-static { cursor: default; }
.account-id { text-align: center; font-size: 12px; opacity: .7; word-break: break-all; margin-top: 12px; }

/* ── 1.2: weekdays, workouts, Kelly's plan ─────────────── */
.days-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.days-field legend { padding: 0; margin-bottom: 6px; font-weight: 700; font-size: 14px; }
.days-field legend .hint { font-weight: 400; margin-left: 6px; }
.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-chip { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font-weight: 700; color: var(--spruce-2); cursor: pointer; }
.day-chip[aria-pressed="true"] { background: var(--spruce); border-color: var(--spruce); color: #fff; }
#categorySeg .seg-btn { font-size: 13px; padding: 0 4px; }
.rest-day { text-align: left; justify-items: start; }
.workout-card { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px; border-top: 4px solid var(--coral); display: grid; gap: 10px; }
.workout-card .wk-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.workout-card h3 { font: 700 18px var(--display); margin: 0; }
.wk-list { list-style: none; margin: 0; padding: 0; display: grid; }
.wk-list li { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.wk-list li > span:nth-child(2) { font: 500 13px var(--mono); color: var(--spruce-2); text-align: right; }
.wk-list .wk-note { grid-column: 1 / -1; color: var(--spruce-2); font-size: 13px; }
.plan-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; background: var(--teal-soft); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 14px; color: var(--spruce); text-decoration: none; }
.plan-card .plan-kicker { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--teal); }
.plan-card strong { font: 700 16px var(--display); }
.plan-card .plan-dot { grid-row: span 2; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.plan-card.is-pending { background: var(--gold-soft); }
.plan-card.is-pending .plan-dot { background: var(--gold); }
.plan-card.is-pending .plan-kicker { color: #8A5F12; }
.stack-days { font: 500 11px var(--mono); color: var(--spruce-2); }
.field small.hint { font-weight: 400; }

/* ── 1.3: smart add, item facts, coach & Kelly ─────────── */
.add-ways { display: grid; gap: 10px; }
.add-way { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; cursor: pointer; font: inherit; color: inherit; min-height: 64px; }
.add-way [data-icon] { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; }
.add-way strong { font: 700 16px var(--display); }
.add-way small { color: var(--spruce-2); font-size: 13px; }
.add-way.is-off { opacity: .55; }
.add-way:active { transform: scale(.99); }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }
.inline-form input { min-height: 46px; border-radius: var(--r-sm); border: 1px solid var(--line); padding: 0 12px; background: var(--paper); min-width: 0; }
.results { display: grid; gap: 8px; }
.result { display: grid; gap: 2px; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font: inherit; color: inherit; cursor: pointer; }
.result small { color: var(--spruce-2); font-size: 13px; }
.add-busy { display: flex; align-items: center; gap: 10px; color: var(--spruce-2); padding: 12px 0; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--teal-soft); border-top-color: var(--teal); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 700; text-decoration: underline; cursor: pointer; font: inherit; }
.check-banner { border-radius: var(--r-md); padding: 12px 14px; background: var(--glacier); font-size: 14px; display: grid; gap: 6px; }
.check-banner.is-ok { background: var(--teal-soft); }
.check-banner.is-warn { background: var(--gold-soft); }
.check-banner ul { margin: 4px 0 0; padding-left: 18px; }
.check-banner .btn { justify-self: start; margin-top: 4px; }
.item-hero { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.item-image { cursor: pointer; }
.item-image .photo-thumb { width: 96px; height: 96px; border-radius: 18px; }
.item-hero-fields { display: grid; gap: 8px; min-width: 0; }
.facts { display: grid; gap: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.ing-list { display: grid; gap: 6px; }
.ing-row { display: grid; grid-template-columns: 1fr 72px 56px 36px; gap: 6px; align-items: center; }
.ing-row input { min-width: 0; min-height: 42px; border-radius: 10px; border: 1px solid var(--line); padding: 0 8px; background: var(--paper); }
.overlap { margin-top: 14px; }
.ov-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.ov-row small { grid-column: 1 / -1; color: var(--spruce-2); font-size: 13px; }
.coach-edit { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.coach-face { width: 96px; height: 96px; border-radius: 24px; overflow: hidden; background: linear-gradient(160deg, var(--teal), var(--spruce)); color: #fff; display: grid; place-items: center; font: 800 40px var(--display); }
.coach-face img { width: 100%; height: 100%; object-fit: cover; }
.coach-edit-actions { display: grid; gap: 8px; justify-items: start; }
.avatar-maker { display: grid; gap: 10px; margin: 18px 0 6px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.avatar-maker h3 { font: 700 17px var(--display); margin: 0; display: flex; align-items: center; gap: 6px; }
.avatar-maker h3 [data-icon] svg, #avatarGo [data-icon] svg { width: 18px; height: 18px; }
.avatar-maker.is-off textarea, .avatar-maker.is-off .style-chips { opacity: .5; pointer-events: none; }
.style-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.style-chips .day-chip { min-height: 38px; padding: 0 12px; }
.cand-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cand-grid[hidden] { display: none; }
.avatar-cand { padding: 0; border: 3px solid transparent; border-radius: 18px; overflow: hidden; background: var(--line); aspect-ratio: 1; cursor: pointer; }
.avatar-cand img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-cand[aria-pressed="true"] { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.avatar-cand:focus-visible { outline: 3px solid var(--spruce); outline-offset: 2px; }
.avatar-pick { display: flex; gap: 8px; }
.avatar-pick .btn { flex: 1; }
.coach-mini { display: inline-flex; align-items: center; gap: 10px; }
.kelly-hero { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.kelly-face { width: 88px; height: 88px; border-radius: 50%; overflow: hidden; border: 3px solid var(--teal); padding: 0; background: var(--teal-soft); cursor: pointer; display: grid; place-items: center; font: 800 32px var(--display); color: var(--teal); }
.kelly-face img { width: 100%; height: 100%; object-fit: cover; }
.kelly-kicker { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.kelly-hero h2 { margin: 0 0 4px; }
.office-missing { background: var(--paper); border: 1px dashed var(--chart); border-radius: var(--r-md); padding: 12px; }
.kelly-notes, .kelly-plans { display: grid; gap: 10px; margin-bottom: 8px; }
.k-note { background: var(--paper); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow); border-left: 4px solid var(--line); }
.k-note.is-new { border-left-color: var(--teal); }
.k-note h4 { margin: 2px 0 4px; font: 700 16px var(--display); }
.k-note p { margin: 0 0 6px; }
.k-date { font-size: 11px; color: var(--spruce-2); margin: 0; }
.k-plan { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--paper); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.pill-s { font: 700 12px var(--body); border-radius: 999px; padding: 3px 9px; background: var(--glacier); color: var(--spruce-2); white-space: nowrap; }
.pill-s.st-pending_approval { background: var(--gold-soft); color: #8A5F12; }
.pill-s.st-applied { background: var(--teal-soft); color: var(--teal); }
a.btn { text-decoration: none; }

/* ── 1.3.1: in-app camera ──────────────────────────────── */
.camera-sheet { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #050c0b; color: #fff; }
.camera-sheet::backdrop { background: #050c0b; }
.cam { display: grid; grid-template-rows: auto 1fr auto auto; height: 100dvh; padding: var(--safe-t) 0 var(--safe-b); }
.cam-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; }
.cam-top h2 { font: 700 17px var(--display); margin: 0; }
.cam-icon { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cam-icon[aria-pressed="true"] { background: var(--gold); color: var(--spruce); }
.cam-stage { position: relative; overflow: hidden; display: grid; place-items: center; }
.cam-stage video { width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; inset: 12% 8%; border: 2px solid rgba(255,255,255,.8); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.28); pointer-events: none; }
.cam-tip { position: absolute; bottom: 14px; left: 16px; right: 16px; margin: 0; text-align: center; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.cam-error { position: absolute; inset: auto 16px 50%; margin: 0; text-align: center; background: rgba(0,0,0,.6); padding: 12px; border-radius: 12px; }
.cam-shots { display: flex; gap: 8px; padding: 10px 16px 0; min-height: 66px; }
.cam-shots .shot { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 2px solid #fff; }
.cam-shots .shot img { width: 100%; height: 100%; object-fit: cover; }
.cam-shots .shot button { position: absolute; top: 0; right: 0; width: 22px; height: 22px; border: 0; border-radius: 0 0 0 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.cam-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px 20px 18px; }
.cam-side { justify-self: start; color: #fff; font-weight: 700; background: none; border: 0; font-size: 15px; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; }
.cam-done { justify-self: end; background: var(--teal); padding: 0 18px; border-radius: 999px; }
.cam-done:disabled { opacity: .4; }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); cursor: pointer; }
.shutter:active { background: #fff; transform: scale(.95); }
.shutter.busy { background: #fff; opacity: .6; }
.add-gallery { justify-self: center; font-size: 14px; margin: -2px 0 2px; }
.res-head { margin: 8px 0 2px; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--spruce-2); }
.result-web { border-left: 4px solid var(--teal); }
.check-banner .link-btn { justify-self: start; font-size: 14px; }

/* ── 1.3.4: Lens-style add ─────────────────────────────── */
.cam { grid-template-rows: auto auto 1fr auto auto auto; }
.cam-find { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 0 12px 10px; }
.cam-find input { min-width: 0; min-height: 46px; border-radius: 999px; border: 0; padding: 0 16px; background: rgba(255,255,255,.95); color: var(--spruce); font-size: 16px; }
.cam-find button { min-height: 46px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--teal); color: #fff; font-weight: 700; }
.cam-busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(5,12,11,.72); text-align: center; padding: 24px; }
.cam-busy p { margin: 0; font-size: 16px; max-width: 280px; }
.cam-busy .spinner { width: 36px; height: 36px; border-width: 4px; }
.cam-manual { justify-self: center; background: none; border: 0; color: #fff; text-decoration: underline; font-weight: 700; min-height: 40px; margin-bottom: 6px; cursor: pointer; }
.stack-form .sheet-actions { position: sticky; bottom: calc(-18px - var(--safe-b)); background: var(--glacier); padding: 12px 0 calc(12px + var(--safe-b)); border-top: 1px solid var(--line); z-index: 2; }
.other-matches { display: grid; gap: 6px; }

/* ── 1.3.4: ingredient details, barcode, more sides ────── */
.ing-item { display: grid; gap: 6px; }
.ing-item.is-open { background: var(--paper); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); }
.ing-more-mark { font: 700 15px var(--display); width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--teal); color: var(--teal); display: grid; place-items: center; line-height: 1; }
.ing-detail { display: grid; gap: 8px; padding: 2px 4px 6px; }
.ing-detail textarea, .ing-detail input { min-width: 0; }
.ing-detail-row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.ing-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-maker .form-error:empty { display: none; }

/* ── 1.4 Your own Coach: Talk button, live call, memory ── */
.chart-top .talk-btn { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--teal); color: #fff; font: 700 13px var(--body); cursor: pointer; }
.talk-btn[hidden] { display: none; }
.talk-btn [data-icon] svg { width: 15px; height: 15px; stroke: #fff; }
.talk-btn:focus-visible { outline: 3px solid var(--spruce); outline-offset: 2px; }

.call { border: 0; padding: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; background: radial-gradient(120% 80% at 50% 25%, #1d4a42 0%, #0c2420 60%, #071513 100%); color: #EAF4F1; }
.call::backdrop { background: #071513; }
.call-inner { min-height: 100dvh; display: grid; grid-template-rows: 1fr auto auto 1.2fr auto; justify-items: center; align-items: center; padding: max(24px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); gap: 10px; text-align: center; }
.call-face { position: relative; width: 168px; height: 168px; align-self: end; }
.call-ring { position: absolute; inset: -18px; border-radius: 50%; border: 3px solid #4fd1b9; opacity: .35; transition: transform .08s linear, opacity .08s linear; }
.call-img { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, var(--teal), var(--spruce)); display: grid; place-items: center; font: 800 64px var(--display); box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.call-img img { width: 100%; height: 100%; object-fit: cover; }
.call h2 { margin: 34px 0 0; font-size: 30px; color: #fff; }
.call-status { margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #9fd8cc; min-height: 1.4em; max-width: 30ch; }
.call-captions { align-self: start; width: 100%; max-width: 480px; display: grid; gap: 8px; text-align: left; font-size: 16px; line-height: 1.4; }
.call-captions .cap { margin: 0; color: rgba(234,244,241,.6); }
.call-captions .cap:last-child { color: #EAF4F1; }
.call-captions .cap b { display: block; font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #6fbfae; margin-bottom: 2px; }
.call-actions { display: flex; gap: 28px; }
.call-btn { width: 76px; height: 76px; border-radius: 50%; border: 0; display: grid; place-items: center; align-content: center; gap: 4px; background: rgba(255,255,255,.12); color: #fff; font: 600 12px var(--body); cursor: pointer; }
.call-btn [data-icon] svg { width: 24px; height: 24px; stroke: #fff; }
.call-btn[aria-pressed="true"] { background: #fff; color: var(--spruce); }
.call-btn[aria-pressed="true"] [data-icon] svg { stroke: var(--spruce); }
.call-end { background: var(--coral); }
.call-end [data-icon] svg { transform: rotate(135deg); }
.call-btn:focus-visible { outline: 3px solid #9fd8cc; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .call-ring { transition: none; } }

.coach-memory { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--paper); margin: 6px 0 10px; }
.coach-memory summary { cursor: pointer; font-weight: 700; }
.coach-memory ul { margin: 10px 0; padding-left: 18px; display: grid; gap: 4px; }
.coach-memory li.hint { list-style: none; margin-left: -18px; }

/* ── 1.5 Training programs ── */
.program-cta, .program-card { width: 100%; text-align: left; border: 0; border-radius: var(--r-lg); margin-bottom: 14px; font: inherit; color: var(--spruce); }
.program-cta { display: grid; gap: 4px; padding: 16px; background: linear-gradient(135deg, var(--spruce) 0%, #1d4a42 100%); color: #EAF4F1; cursor: pointer; }
.program-cta strong { font: 700 18px var(--display); color: #fff; }
.program-cta .pc-kicker { color: #9fd8cc; }
.pc-kicker { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--teal); }
.pc-sub { font-size: 14px; color: inherit; opacity: .8; }
.program-card { display: grid; gap: 0; background: var(--paper); box-shadow: var(--shadow); border-top: 4px solid var(--spruce); overflow: hidden; }
button.program-card { padding: 14px 16px; gap: 4px; cursor: pointer; }
button.program-card strong { font: 700 18px var(--display); }
.pc-top { display: grid; gap: 4px; padding: 14px 16px 12px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.pc-top strong { font: 700 19px var(--display); }
.pc-bar { display: block; height: 6px; border-radius: 99px; background: var(--teal-soft); overflow: hidden; margin-top: 6px; }
.pc-bar i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.pc-today { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.pc-type { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--spruce-2); }
.pc-session { font-weight: 700; font-size: 16px; margin: 2px 0; }
.pc-meta { font-size: 13px; color: var(--spruce-2); }
.pc-food { display: flex; gap: 16px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--glacier); font-size: 14px; }
.pc-food b { font: 700 15px var(--mono); }
.pc-food .link-btn { margin-left: auto; font-size: 14px; }
.pc-top:focus-visible, .program-cta:focus-visible, .pg-goal:focus-visible, .pg-existing:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

#programBody, #loggerBody { display: grid; gap: 14px; padding-bottom: 6px; }
.pg-step { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.pg-step legend, .pg-label { padding: 0; margin-bottom: 8px; font: 700 15px var(--display); }
.pg-goals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pg-goal { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); font: inherit; color: var(--spruce); cursor: pointer; }
.pg-goal small { color: var(--spruce-2); font-size: 12.5px; line-height: 1.3; }
.pg-goal[aria-pressed="true"] { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.pg-goal[aria-pressed="true"] small { color: #bfe3da; }
.pg-chip { min-height: 38px; padding: 0 12px; }
.days-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.days-row .pg-chip { padding: 0; }
.pg-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pg-four { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; }
.pg-stats { display: grid; gap: 10px; }
.pg-stats[hidden] { display: none; }
.pg-add-trainer input { min-width: 0; }
.pg-styles p { margin: 0 0 4px; font-size: 13px; color: var(--spruce-2); }
.pg-switch { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--teal-soft); font-size: 14px; }
.pg-switch input { width: 20px; height: 20px; accent-color: var(--teal); margin: 1px 0 0; flex: none; }
.pg-switch.is-off { opacity: .55; }
.pg-existing { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); font: inherit; color: var(--spruce); cursor: pointer; margin-bottom: 6px; }
.pg-busy { display: grid; justify-items: center; gap: 10px; padding: 48px 12px; text-align: center; }
.pg-busy .spinner { width: 36px; height: 36px; border-width: 4px; }
.pg-busy p { margin: 0; font: 700 18px var(--display); }
.pg-busy small { color: var(--spruce-2); }
.sticky-actions { position: sticky; bottom: calc(-18px - var(--safe-b, 0px)); background: var(--glacier); padding: 12px 0 calc(12px + var(--safe-b, 0px)); border-top: 1px solid var(--line); z-index: 2; }

.pg-hero { display: grid; gap: 6px; }
.pg-hero h3 { margin: 0; font-size: 26px; line-height: 1.1; }
.pg-hero p { margin: 0; }
.pg-stylesline { font-size: 14px; color: var(--spruce-2); }
.pg-section { display: grid; gap: 8px; background: var(--paper); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow); }
.pg-section h4 { margin: 0; font: 700 16px var(--display); }
.pg-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pg-tiles div { display: grid; gap: 2px; padding: 10px 6px; border-radius: 12px; background: var(--glacier); text-align: center; }
.pg-tiles b { font: 700 17px var(--mono); }
.pg-tiles span { font-size: 12px; color: var(--spruce-2); }
.pg-tips { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.pg-meals { display: grid; gap: 8px; }
.pg-meal { padding: 10px 12px; border-radius: 12px; background: var(--glacier); display: grid; gap: 2px; font-size: 14px; }
.pg-meal p { margin: 0; }
.pg-meal .mono { font-size: 12px; color: var(--spruce-2); }
.pg-phase { border-top: 1px solid var(--line); padding-top: 8px; }
.pg-phase summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.pg-phase summary .mono { font-size: 12px; color: var(--spruce-2); }
.pg-phase > p { margin: 6px 0; font-size: 14px; }
.pg-session { margin: 10px 0; }
.pg-sess-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pg-sess-head .mono { font-size: 11px; color: var(--teal); letter-spacing: .08em; }
.pg-tag { font-size: 12px; color: var(--spruce-2); background: var(--teal-soft); border-radius: 99px; padding: 1px 8px; }
.pg-session ul { list-style: none; margin: 6px 0 0; padding: 0; }
.pg-session li { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pg-session li em { font-style: normal; font-size: 12px; color: var(--coral); }
.pg-session li .mono { font-size: 12px; color: var(--spruce-2); white-space: nowrap; }
.pg-revise { box-shadow: none; background: transparent; padding: 0; }
.pg-revise .link-btn { justify-self: start; font-size: 14px; color: var(--spruce-2); }
.pg-start { align-items: end; }
.pg-start .field { margin: 0; flex: 1; }
.pg-spark { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.pg-spark > div { display: grid; }
.pg-spark .mono { font-size: 12px; color: var(--spruce-2); }

.lg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lg-unit { width: 110px; }
.lg-note { margin: 0; font-size: 14px; color: var(--spruce-2); }
.lg-ex { background: var(--paper); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 6px; }
.lg-ex-head { display: grid; gap: 2px; }
.lg-ex-head b { font: 700 16px var(--display); }
.lg-ex-head .mono { font-size: 12px; color: var(--spruce-2); }
.lg-tech { margin: 0; font-size: 13px; color: var(--coral); }
.lg-last { margin: 0; font-size: 13px; color: var(--teal); }
.lg-sets { display: grid; gap: 6px; }
.lg-set { display: grid; grid-template-columns: 22px 1fr 14px 1fr 44px; gap: 6px; align-items: center; }
.lg-set .mono { font-size: 13px; color: var(--spruce-2); text-align: center; }
.lg-set input { min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 10px; font: 600 17px var(--mono); background: var(--glacier); text-align: center; }
.lg-set.is-saved input { background: var(--teal-soft); border-color: var(--teal-soft); }
.lg-x { text-align: center; color: var(--spruce-2); }
.lg-ex .link-btn { justify-self: start; font-size: 14px; }
@media (max-width: 360px) { .pg-four { grid-template-columns: 1fr 1fr; } .pg-tiles { grid-template-columns: 1fr 1fr; } }

/* ── 1.6 Trainer wall and your material ── */
.tw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tw-tile { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; }
.tw-pick { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; cursor: pointer; background: linear-gradient(160deg, #1d4a42, var(--spruce)); color: #fff; font: inherit; text-align: left; }
.tw-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tw-pick::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,21,19,0) 45%, rgba(7,21,19,.85) 100%); }
.tw-mono { position: absolute; inset: 0 0 22% 0; display: grid; place-items: center; font: 800 34px var(--display); letter-spacing: -.02em; color: #9fd8cc; }
.tw-name { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 1; font: 700 13px/1.15 var(--display); color: #fff; }
.tw-files { position: absolute; top: 8px; left: 8px; z-index: 1; font: 600 10px var(--mono); background: rgba(255,255,255,.9); color: var(--spruce); border-radius: 99px; padding: 2px 7px; }
.tw-check { position: absolute; top: 8px; right: 8px; z-index: 1; width: 24px; height: 24px; border-radius: 50%; background: var(--teal); display: none; place-items: center; }
.tw-check svg { width: 15px; height: 15px; stroke: #fff; }
.tw-tile.is-on { box-shadow: 0 0 0 3px var(--teal); }
.tw-tile.is-on .tw-check { display: grid; }
.tw-info { position: absolute; top: 6px; right: 6px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.88); color: var(--spruce); font: 700 italic 14px Georgia, serif; cursor: pointer; }
.tw-tile.is-on .tw-info { top: auto; bottom: 34px; }
.tw-pick:focus-visible, .tw-info:focus-visible, .tw-add:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.tw-add { border: 2px dashed var(--line); background: var(--paper); display: grid; place-items: center; align-content: center; gap: 6px; cursor: pointer; color: var(--spruce-2); font: inherit; }
.tw-add .tw-name { position: static; color: var(--spruce-2); }
.tw-add [data-icon] svg { width: 26px; height: 26px; }

#trainerBody { display: grid; gap: 14px; }
.tw-hero { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.tw-photo { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, #1d4a42, var(--spruce)); }
.tw-photo img { width: 100%; height: 100%; object-fit: cover; }
.tw-photo .tw-mono { inset: 0; }
.tw-photo-actions { display: grid; gap: 8px; justify-items: start; }
.tw-style { margin: 0; font-size: 14px; color: var(--spruce-2); }
.tw-form { display: grid; gap: 10px; }
.tw-files-btn { justify-content: center; }
.tw-lib { list-style: none; margin: 0; padding: 0; display: grid; }
.tw-lib li { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.tw-lib li > div:first-child { display: grid; gap: 2px; }
.tw-lib-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.tw-lib-actions .link-btn { font-size: 14px; }
.tw-del { color: #B42318 !important; }
.tw-share { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.tw-spin { display: inline-block; width: 12px; height: 12px; border-width: 2px; vertical-align: -1px; }
.tw-lib-detail { font-size: 14px; background: var(--glacier); border-radius: 12px; padding: 4px 12px; }
.tw-lib-detail ul { margin: 0 0 8px; padding-left: 18px; }
.tw-lib-detail p { margin: 8px 0 4px; }
.pg-review h4 { font-size: 15px; }
.pg-clean { margin: 0; color: var(--teal); font-weight: 700; font-size: 14px; }
.pg-open li.is-fix { color: #B42318; }
.pg-vol { margin: 6px 0; font-size: 12px; color: var(--spruce-2); }
.tw-name small { display: block; font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #9fd8cc; margin-top: 2px; }
.pg-fixed summary { cursor: pointer; font-weight: 700; color: var(--teal); font-size: 14px; }
.pg-fixed ul { margin-top: 8px; }

/* ── 1.7 Connected AI ── */
.ai-row { align-items: center; }
#aiCard { display: grid; gap: 10px; }
#aiCard .link-btn { justify-self: start; font-size: 14px; }
.ai-today { width: 100%; display: grid; gap: 4px; text-align: left; border: 0; border-left: 4px solid var(--gold); border-radius: var(--r-md); background: var(--gold-soft); padding: 12px 14px; margin-bottom: 14px; font: inherit; color: var(--spruce); cursor: pointer; }
.ai-today strong { font: 700 16px var(--display); }
.ai-today .pc-kicker { color: #8a6a1f; }
.ai-today:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
#aiBody { display: grid; gap: 14px; }
.ai-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--spruce-2); }
.ai-url { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.ai-url code { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 600 13px var(--mono); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--spruce); }
#aiCode { font: 700 22px var(--mono); letter-spacing: .1em; text-transform: uppercase; text-align: center; }
.ai-warn { color: #8a6a1f; }
.ai-note { padding: 10px 0; border-top: 1px solid var(--line); }
.ai-note p { margin: 4px 0 0; white-space: pre-wrap; font-size: 14px; }
.ai-note.is-new b::after, .ai-acts li.is-new > div > span:last-child::after { content: " •"; color: var(--coral); }
.ai-acts { list-style: none; margin: 0; padding: 0; }
.ai-acts li { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ai-acts li > div { display: grid; gap: 2px; }
.ai-acts li.is-undone > div > span:last-child { text-decoration: line-through; color: var(--spruce-2); }

/* ── 1.7.2 always-visible ways in to the trainer wall ── */
.pc-links { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin: 2px 4px 16px; }
.pc-links .link-btn { font-size: 14px; }
#trainCard { display: grid; gap: 10px; }
#trainCard .pc-links { margin: 0; gap: 8px; }
.pg-section + .pc-links, .sheet-actions + .pc-links { margin-top: 4px; }

/* ── 1.9 Health from Dot ── */
.health-card { gap: 10px; }
.hl-top { display: grid; gap: 4px; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.hl-level { display: inline-flex; align-items: center; gap: 8px; font: 800 22px var(--display); letter-spacing: -.01em; }
.hl-level i { width: 12px; height: 12px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); }
.hl-low { color: var(--coral); } .hl-watch { color: var(--gold); } .hl-steady { color: var(--teal); } .hl-primed { color: var(--teal); }
.hl-primed i { animation: hl-beat 1.6s ease-in-out infinite; }
@keyframes hl-beat { 50% { transform: scale(1.3); } }
.hl-line { font-size: 14px; color: var(--spruce-2); }
.hl-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.hl-tile { display: grid; gap: 2px; padding: 10px 8px; border-radius: 12px; background: var(--glacier); min-width: 0; }
.hl-k { font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--spruce-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-tile b { font: 700 17px var(--mono); white-space: nowrap; }
.hl-tile b small { font: 500 11px var(--mono); color: var(--spruce-2); margin-left: 2px; }
.hl-d { font-size: 10.5px; color: var(--spruce-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.hl-cta { justify-self: start; font-size: 14px; }
.hl-promo strong { font: 700 18px var(--display); }
.hl-promo-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.hl-body { display: grid; gap: 14px; }
.hl-ready p { margin: 0; }
.hl-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.hl-row:first-of-type { border-top: 0; }
.hl-row > div { display: grid; }
.hl-row b { font: 700 15px var(--mono); text-align: right; min-width: 74px; }
.hl-row b small { font: 500 11px var(--mono); color: var(--spruce-2); }
.hl-spark polyline { fill: none; stroke: var(--teal); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.hl-spark circle { fill: var(--teal); }
.hl-prompt { display: grid; gap: 8px; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.hl-prompt p { margin: 0; font-size: 14px; color: var(--spruce); }
.hl-prompt .btn { justify-self: start; }
#aiCard .btn-ghost#aiHealth { justify-self: stretch; }
@media (max-width: 360px) { .hl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── 1.10 Arsenal ── */
.stack-seg { margin: -4px 0 16px; }
.arsenal { display: grid; gap: 6px; }
.ar-tools { display: grid; gap: 8px; }
.ar-tools .chip.is-on, .chip.is-on { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.ar-group { justify-self: start; }
.ar-group .seg-btn { padding: 0 14px; }
.ar-group-sec .section-label { margin: 16px 0 10px; display: flex; gap: 8px; align-items: baseline; }
.ar-group-sec .section-label span { color: var(--chart); }
.ar-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ar-card { display: grid; grid-template-rows: auto 1fr; padding: 0; border: 0; border-radius: var(--r-md); background: var(--paper); box-shadow: var(--shadow); overflow: hidden; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.ar-card:active { transform: scale(.98); }
.ar-card:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.ar-img { position: relative; display: block; aspect-ratio: 4 / 3; background: #fff; overflow: hidden; }
.ar-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.ar-ph { display: grid; place-items: center; height: 100%; font: 800 34px var(--display); color: var(--chart); background: var(--teal-soft); }
.ar-qty { position: absolute; right: 6px; bottom: 6px; font: 700 12px var(--mono); background: var(--spruce); color: #fff; border-radius: 99px; padding: 2px 8px; }
.ar-flag { position: absolute; left: 6px; top: 6px; font: 700 11px var(--body); background: var(--gold); color: #10302B; border-radius: 99px; padding: 3px 8px; }
.ar-card.is-draft { box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.ar-body { display: grid; gap: 1px; padding: 10px 12px 12px; align-content: start; }
.ar-cat { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.ar-body strong { font: 700 15px/1.2 var(--display); }
.ar-body small { color: var(--spruce-2); font-size: 12.5px; }
.ar-specs { font-size: 12px; color: var(--spruce-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-empty { display: grid; gap: 10px; justify-items: start; padding: 22px 18px; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); }
.ar-empty h3 { font: 800 22px/1.15 var(--display); margin: 0; }
.ar-empty p { margin: 0; color: var(--spruce-2); }
.ar-sheet { display: grid; gap: 14px; }
.ar-coachline { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
.ar-coachline p { margin: 0; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--paper); box-shadow: var(--shadow); font-size: 15px; }
.ar-photos { display: flex; gap: 10px; align-items: center; }
.ar-found { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.ar-found .ar-img { border-radius: 14px; box-shadow: var(--shadow); }
.ar-found strong { display: block; font: 700 18px/1.15 var(--display); }
.ar-found small { color: var(--spruce-2); }
.ar-q legend { font: 700 15px var(--body); }
.ar-other { min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); padding: 0 12px; }
.ar-qtyrow { display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.ar-stepper { display: flex; align-items: center; gap: 6px; background: var(--teal-soft); border-radius: 999px; padding: 2px; }
.ar-stepper .icon-btn { font: 700 22px var(--body); color: var(--spruce); }
.ar-stepper b { min-width: 26px; text-align: center; font: 700 18px var(--mono); }
.ar-hero { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: center; }
.ar-hero h3 { margin: 2px 0; font: 800 21px/1.15 var(--display); }
.ar-hero p { margin: 0; }
.ar-img-lg { border-radius: 16px; box-shadow: var(--shadow); cursor: pointer; }
.ar-photo-btn { position: absolute; left: 0; right: 0; bottom: 0; font: 600 11px var(--body); text-align: center; padding: 4px; background: rgba(16,48,43,.7); color: #fff; }
.ar-desc { margin: 0; font-size: 15px; }
.ar-specs-edit { display: grid; gap: 6px; }
.ar-spec { display: grid; grid-template-columns: 1fr 1.4fr; gap: 6px; }
.ar-spec input { min-width: 0; min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); padding: 0 10px; }
/* coach chat: photos and gear cards */
.composer-photo { cursor: pointer; align-self: center; }
.msg-photo { max-width: 220px; max-height: 260px; border-radius: 16px; object-fit: cover; justify-self: end; box-shadow: var(--shadow); }
.gear-card { display: grid; grid-template-columns: 64px 1fr; row-gap: 6px; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); text-align: left; font: inherit; color: inherit; cursor: pointer; box-shadow: var(--shadow); }
.gear-card .ar-img { aspect-ratio: 1; border-radius: 10px; grid-row: span 2; align-self: start; }
.gear-card strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gear-card strong { font: 700 15px var(--display); }
.gear-card small { color: var(--spruce-2); }
.gear-go { justify-self: start; font: 700 13px var(--body); color: var(--on-accent, #fff); background: var(--teal); border-radius: 99px; padding: 7px 12px; }
/* typing and photos during a Talk call */
.call-type { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; margin-bottom: 8px; width: 100%; max-width: 480px; align-items: center; }
.call-type input { min-width: 0; min-height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: #fff; padding: 0 16px; font-size: 16px; }
.call-type input::placeholder { color: rgba(234,244,241,.55); }
.call-mini { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.call-mini [data-icon] svg { stroke: #fff; }
.call-inner { grid-template-rows: 1fr auto auto 1.2fr auto auto; }
/* toast with an action */
.toast.has-action { pointer-events: auto; display: flex; gap: 12px; align-items: center; }
.toast-action { border: 0; background: none; color: var(--gold); font: 700 13px var(--body); text-decoration: underline; cursor: pointer; padding: 0; }
@media (min-width: 900px) { .ar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ── 1.11 Labs ── */
#labsCard { display: grid; gap: 10px; }
.lb-pill { font: 700 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--coral); border: 1px solid currentColor; border-radius: 99px; padding: 3px 9px; }
.lb-body { display: grid; gap: 14px; }
.lb-upload { display: grid; gap: 6px; justify-items: start; }
.lb-status { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); font-size: 14px; }
.lb-status.failed { background: var(--coral-soft); }
.lb-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; width: 100%; padding: 9px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.pg-section h4 + .lb-row { border-top: 0; }
.lb-name { font-weight: 700; font-size: 14.5px; }
.lb-val { font: 700 15px var(--mono); text-align: right; white-space: nowrap; }
.lb-val small { font: 500 11px var(--mono); color: var(--spruce-2); }
.lb-flag { display: inline-block; font: 700 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; border-radius: 99px; padding: 2px 7px; margin-left: 4px; vertical-align: 1px; }
.lb-flag.lb-low, .lb-flag.lb-high, .lb-flag.lb-abnormal { background: var(--gold-soft); color: #8A5F12; }
.lb-flag.lb-critical { background: var(--coral); color: #fff; }
.lb-more { grid-column: 1 / -1; display: grid; gap: 8px; padding-top: 6px; }
.lb-bar { position: relative; display: block; height: 10px; border-radius: 99px; background: var(--line); margin: 6px 4px; }
.lb-zone { position: absolute; top: 0; bottom: 0; background: var(--teal-soft); border-radius: 99px; box-shadow: inset 0 0 0 1px var(--teal); }
.lb-dot { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--teal); border: 2px solid var(--paper); }
.lb-dot.lb-low, .lb-dot.lb-high, .lb-dot.lb-abnormal { background: var(--gold); }
.lb-dot.lb-critical { background: var(--coral); }
.lb-hist { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; }
.lb-hist b { font: 600 13px var(--mono); text-align: right; }
.lb-report { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.lb-report > div:first-child { display: grid; }
.lb-actions { display: flex; gap: 12px; }
.lb-actions .link-btn { font-size: 14px; }
.lb-note { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--coral-soft); }
.lb-note p { margin: 0; font-size: 14px; }
.hl-labs { justify-self: start; font-size: 14px; }
html[data-dark] .lb-flag.lb-low, html[data-dark] .lb-flag.lb-high, html[data-dark] .lb-flag.lb-abnormal { color: var(--gold); }

/* ── 1.11.1 Launch splash: the heartbeat ── */
:root { --pulse: var(--coral); }
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; overflow: hidden; cursor: pointer;
  background: var(--glacier); color: var(--spruce); transition: opacity .45s ease, transform .45s cubic-bezier(.4,0,.2,1), filter .45s ease; }
.splash.is-out { opacity: 0; transform: scale(1.06); filter: blur(6px); pointer-events: none; }
.sp-glow { position: absolute; left: 50%; top: 42%; width: 140vmax; height: 140vmax; transform: translate(-50%, -50%) scale(.2); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--pulse) 30%, transparent) 0%, transparent 45%); opacity: 0; }
.sp-stage { position: relative; width: min(92vw, 560px); display: grid; justify-items: center; gap: 10px; margin-top: -6vh; }
.sp-trace { position: relative; width: 100%; aspect-ratio: 400 / 120; }
.sp-trace svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sp-base { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 6; vector-effect: non-scaling-stroke; opacity: .7; }
.sp-line { fill: none; stroke: var(--pulse); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1000; stroke-dashoffset: 1000; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--pulse) 55%, transparent)); }
.sp-ring { position: absolute; left: 52.5%; top: 5%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid var(--pulse); opacity: 0; }
.sp-word { margin: -14px 0 0; font: 800 clamp(40px, 12vw, 68px)/1 var(--display); letter-spacing: -.03em; display: flex; overflow: hidden; padding: 0 4px 8px; }
.sp-w { display: inline-flex; }
.sp-accent { color: var(--pulse); }
.sp-l { display: inline-block; transform: translateY(105%) rotate(6deg); opacity: 0; }
.sp-hello { margin: 0; font: 500 14px var(--mono); letter-spacing: .04em; color: var(--spruce-2); opacity: 0; transform: translateY(8px); }
.sp-hello b { color: var(--spruce); font-weight: 700; }
.sp-motto { position: absolute; left: 24px; right: 24px; bottom: calc(36px + var(--safe-b)); margin: 0; text-align: center; font-size: 14px; color: var(--spruce-2); opacity: 0; }

.splash.is-playing .sp-line { animation: sp-draw 1.35s cubic-bezier(.35,.1,.25,1) .15s forwards; }
.splash.is-playing .sp-glow { animation: sp-glow 1.6s ease-out .62s forwards; }
.splash.is-playing .sp-stage { animation: sp-thump .5s cubic-bezier(.3,1.6,.5,1) .66s; }
.splash.is-playing .sp-ring { animation: sp-ring 1s cubic-bezier(.2,.7,.3,1) .68s forwards; }
.splash.is-playing .sp-ring2 { animation-delay: .86s; }
.splash.is-playing .sp-l { animation: sp-rise .6s cubic-bezier(.2,1.2,.4,1) forwards; animation-delay: calc(.95s + var(--i) * 38ms); }
.splash.is-playing .sp-hello { animation: sp-fade .5s ease-out 1.35s forwards; }
.splash.is-playing .sp-motto { animation: sp-fade .7s ease-out 1.7s forwards; }
.splash.is-still .sp-line { stroke-dashoffset: 0; }
.splash.is-still .sp-l, .splash.is-still .sp-hello, .splash.is-still .sp-motto { opacity: 1; transform: none; }
@keyframes sp-draw { 0% { stroke-dashoffset: 1000; } 40% { stroke-dashoffset: 610; } 58% { stroke-dashoffset: 330; } 100% { stroke-dashoffset: 0; } }
@keyframes sp-glow { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 18% { opacity: 1; } 100% { opacity: .35; transform: translate(-50%, -50%) scale(1); } }
@keyframes sp-thump { 0% { transform: scale(1); } 35% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes sp-ring { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(9); } }
@keyframes sp-rise { to { transform: none; opacity: 1; } }
@keyframes sp-fade { to { opacity: 1; transform: none; } }

/* ── 1.12 Family ── */
#familyCard { display: grid; gap: 10px; }
.fm-list { display: grid; }
.fm-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.fm-row:first-child { border-top: 0; }
.fm-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font: 800 18px var(--display); }
.fm-go { font-size: 22px; color: var(--chart); }
.fm-tag { font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--coral); border: 1px solid currentColor; border-radius: 99px; padding: 1px 6px; }
.fm-invites { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--glacier); }
.fm-invites code { font: 600 13px var(--mono); }
.fm-code { font: 700 34px var(--mono); letter-spacing: .14em; text-align: center; color: var(--teal); background: var(--teal-soft); border-radius: var(--r-md); padding: 14px; }
.fm-scopes { display: grid; gap: 8px; }
.fm-scopes[disabled] { opacity: .5; }
.fm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.paused-note { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: var(--glacier); text-align: center; }
.paused-note h2 { font: 800 26px var(--display); margin: 0 0 8px; }
.paused-note p { color: var(--spruce-2); max-width: 32ch; margin: 0 auto; }

/* ── 1.13 Roster: Choose Your Coach (fighter-select), recruiting, the roster card ── */
.coach-switch { align-self: center; display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; margin-left: -2px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--spruce); cursor: pointer; }
.coach-switch [data-icon] svg { width: 16px; height: 16px; }
.chart-top .coach-name { min-width: 0; }
.rs-initial { display: grid; place-items: center; font: 800 1em/1 var(--display); color: var(--spruce);
  background: linear-gradient(160deg, color-mix(in srgb, var(--pulse) 26%, var(--paper)), var(--glacier)); }
.rs-initial > [data-icon] { display: grid; place-items: center; width: 100%; height: 100%; }
.rs-initial [data-icon] svg { width: 40%; height: 40%; stroke: var(--pulse); }

html.cs-open, html.cs-open body { overflow: hidden; }
.cs { position: fixed; inset: 0; z-index: 90; background: var(--glacier); color: var(--spruce); overflow: hidden; opacity: 0;
  transition: opacity .32s ease, transform .38s cubic-bezier(.4,0,.2,1), filter .38s ease; }
.cs.is-in { opacity: 1; }
.cs.is-out { opacity: 0; transform: scale(1.04); filter: blur(6px); pointer-events: none; }
.cs-frame { position: relative; z-index: 1; height: 100%; height: 100dvh; max-width: 520px; margin: 0 auto; display: grid; grid-template-rows: auto 1fr auto auto; gap: 14px;
  padding: calc(14px + var(--safe-t)) 16px calc(18px + var(--safe-b)); }
.cs-top { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.cs-kicker, .cs-count { font: 600 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--spruce-2); white-space: nowrap; }
.cs-count { letter-spacing: .08em; }
.cs-rule { flex: 1; border-top: 1px dashed var(--line); }
.cs-x { margin-right: -8px; }
.cs-hero { display: grid; place-items: center; min-height: 0; }
.cs-card { display: grid; justify-items: center; text-align: center; gap: 6px; width: 100%; }
.cs-portrait { position: relative; height: min(44dvh, 380px); aspect-ratio: 4 / 5; max-width: 76vw; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 28px 60px -28px color-mix(in srgb, var(--pulse) 70%, transparent), 0 0 0 1px var(--line); }
.cs-portrait:has(img)::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(to top, rgba(0,0,0,.42), transparent); pointer-events: none; }
.cs-face { width: 100%; height: 100%; object-fit: cover; font-size: clamp(72px, 22vw, 140px); }
.cs-face-add { border: 2px dashed color-mix(in srgb, var(--pulse) 60%, var(--line)); border-radius: inherit; background: var(--paper); color: var(--pulse); }
.cs-beat { position: absolute; left: 0; right: 0; bottom: 8%; width: 100%; height: 22%; z-index: 1; overflow: visible; }
.cs-beat path { fill: none; stroke: var(--pulse); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--pulse) 70%, transparent)); stroke-dasharray: 1000; stroke-dashoffset: 0; }
.cs-name { margin: 10px 0 0; font-size: clamp(42px, 13vw, 76px); line-height: .95; letter-spacing: -.035em; max-width: 100%; overflow: hidden; display: flex; justify-content: center; padding-bottom: 4px; }
.cs-name span { display: inline-block; white-space: pre; }
.cs-line { margin: 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font: 600 12px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--spruce-2); }
.cs-focus { color: var(--pulse); }
.cs-dot { opacity: .5; }
.cs-bond { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: min(220px, 60vw); margin: 4px 0 2px; }
.cs-bond i { height: 6px; border-radius: 2px; background: var(--line); position: relative; overflow: hidden; }
.cs-bond i.is-full { background: var(--pulse); }
.cs-bond i.is-part::after { content: ""; position: absolute; inset: 0; width: var(--p); background: var(--pulse); }
.cs-blurb { margin: 2px 0 0; max-width: 34ch; color: var(--spruce-2); font-size: 15px; line-height: 1.4; min-height: 2.8em; }
.cs-rail { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 2px 4px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; justify-content: safe center; }
.cs-rail::-webkit-scrollbar { display: none; }
.cs-tile { position: relative; flex: 1 1 0; min-width: 48px; max-width: 66px; display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; scroll-snap-align: center;
  transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.cs-tface { width: 100%; max-width: 58px; aspect-ratio: 1; height: auto; border-radius: 16px; object-fit: cover; font-size: 24px; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s ease, filter .2s ease; filter: saturate(.75) brightness(.95); }
.cs-tname { max-width: 100%; font: 600 11px/1.1 var(--mono); letter-spacing: .04em; color: var(--spruce-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-tile[aria-selected="true"] { transform: translateY(-4px); }
.cs-tile[aria-selected="true"] .cs-tface { filter: none; box-shadow: 0 0 0 2px var(--glacier), 0 0 0 4px var(--pulse), 0 10px 24px -8px color-mix(in srgb, var(--pulse) 70%, transparent); }
.cs-tile[aria-selected="true"] .cs-tname { color: var(--spruce); }
.cs-tile:focus-visible { outline: none; }
.cs-tile:focus-visible .cs-tface { box-shadow: 0 0 0 2px var(--glacier), 0 0 0 4px var(--teal); }
.cs-tile-add .cs-tface { background: transparent; box-shadow: none; border: 2px dashed var(--line); color: var(--spruce-2); font-size: 26px; }
.cs-tile-gpt .cs-tface { border-radius: 50%; }
.cs-lead { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 1; padding: 2px 6px; border-radius: 999px; background: var(--pulse); color: var(--glacier);
  font: 700 9px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.cs-go { min-height: 54px; font-size: 17px; }
/* the one orchestrated moment: slide in, the beat draws, the name rises, the bond fills */
.cs-card.is-enter .cs-portrait { animation: cs-slide .5s cubic-bezier(.2,.9,.3,1) both; }
.cs-card.is-enter .cs-beat path { stroke-dashoffset: 1000; animation: sp-draw .9s cubic-bezier(.35,.1,.25,1) .18s forwards; }
.cs-card.is-enter .cs-name span { animation: cs-rise .5s cubic-bezier(.2,1.2,.4,1) both; animation-delay: calc(.12s + var(--k) * 28ms); }
.cs-card.is-enter .cs-line, .cs-card.is-enter .cs-blurb { animation: cs-fade .4s ease-out .3s both; }
.cs-card.is-enter .cs-bond i { animation: cs-pip .3s ease-out both; animation-delay: calc(.35s + var(--k) * 30ms); }
.cs.is-lock .cs-portrait { animation: cs-lock .42s cubic-bezier(.3,1.6,.5,1); }
.cs.is-lock .cs-go { transform: scale(.97); }
@keyframes cs-slide { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 48px)) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes cs-rise { from { opacity: 0; transform: translateY(70%) rotate(5deg); } to { opacity: 1; transform: none; } }
@keyframes cs-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cs-pip { from { transform: scaleY(0); } to { transform: none; } }
@keyframes cs-lock { 0% { transform: scale(1); } 40% { transform: scale(1.05); box-shadow: 0 0 0 6px color-mix(in srgb, var(--pulse) 45%, transparent), 0 28px 60px -28px var(--pulse); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .cs, .cs-tile { transition: none; } }
@media (min-width: 700px) { .cs-name { font-size: 76px; } }

.roster-card .rs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.roster-card .rs-head h3 { margin: 0; }
.rs-count { font-size: 12px; color: var(--spruce-2); }
.rs-list { display: grid; gap: 6px; margin: 12px 0; }
.rs-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: transparent; text-align: left; cursor: pointer; }
.rs-row.is-active { border-color: color-mix(in srgb, var(--pulse) 60%, var(--line)); box-shadow: inset 3px 0 0 var(--pulse); }
.rs-face { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; font-size: 18px; }
.rs-who small { color: var(--spruce-2); }
.rs-lead { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--pulse) 18%, transparent); color: var(--spruce);
  font: 700 10px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; vertical-align: 2px; }
.rs-go { color: var(--spruce-2); font-size: 22px; }
.rs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.rc-focus { display: grid; align-content: start; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); text-align: left; cursor: pointer; }
.rc-focus small { color: var(--spruce-2); font-size: 13px; line-height: 1.35; }
.rc-focus em { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; font-style: normal; color: var(--spruce-2); }
.rc-focus[aria-checked="true"] { border-color: var(--pulse); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pulse) 35%, transparent); }
@media (max-width: 360px) { .rc-grid { grid-template-columns: 1fr; } }
.focus-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.focus-pick { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); cursor: pointer; font-weight: 600; font-size: 14px; }
.focus-pick[aria-checked="true"] { background: var(--spruce); color: var(--glacier); border-color: var(--spruce); }
.coach-adv { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; margin: 4px 0 12px; }
.coach-adv summary { cursor: pointer; font-weight: 700; }
.coach-adv[open] summary { margin-bottom: 10px; }
.mem-h { margin: 12px 0 4px; font-size: 14px; }
.mem-h small { font-weight: 400; color: var(--spruce-2); }
.coach-roster-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
.handoff-chip { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 3px 14px 3px 3px; border: 1px solid color-mix(in srgb, var(--pulse) 55%, var(--line));
  border-radius: 999px; background: var(--paper); color: var(--spruce); font-weight: 700; font-size: 14px; cursor: pointer; }
.handoff-chip img, .handoff-chip > span:first-child { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--glacier); font: 800 13px var(--display); }

/* ── 1.14 Sleep: the night sky (always night, in every skin; the skin's accent tints the aurora and the glow) ── */
:root { --sl-sky0: #04061a; --sl-sky1: #0b1026; --sl-sky2: #141c45; --sl-ink: #eef1ff; --sl-ink2: #aab2da; --sl-ink3: #737ca8;
  --sl-line: rgba(160, 175, 255, .14); --sl-panel: rgba(255, 255, 255, .035);
  --st-awake: #f4a35e; --st-rem: #8ee3ff; --st-core: #4c9bff; --st-deep: #5b50ec; --st-asleep: #7d8cff; }
.sl-awake { --c: var(--st-awake); } .sl-rem { --c: var(--st-rem); } .sl-core { --c: var(--st-core); } .sl-deep { --c: var(--st-deep); } .sl-asleep { --c: var(--st-asleep); }

/* Today card */
.sl-card { position: relative; overflow: hidden; width: 100%; display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 14px; margin: 0 0 14px; padding: 16px 16px 16px 14px;
  border: 0; border-radius: var(--r-lg); text-align: left; color: var(--sl-ink); cursor: pointer; isolation: isolate;
  background: radial-gradient(120% 150% at 0% 0%, color-mix(in srgb, var(--pulse) 22%, #1b2560) 0%, var(--sl-sky1) 55%, var(--sl-sky0) 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 18px 40px -22px rgba(20, 24, 80, .7); transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.sl-card:active { transform: scale(.985); }
.sl-card-sky { position: absolute; inset: 0; z-index: -1; opacity: .9;
  background-image: radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 38% 12%, #fff 50%, transparent 51%), radial-gradient(1.4px 1.4px at 66% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 16%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 92% 64%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 52% 72%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 24% 84%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 74% 88%, #fff 50%, transparent 51%);
  animation: sl-twinkle 4s ease-in-out infinite alternate; }
@keyframes sl-twinkle { from { opacity: .45; } to { opacity: 1; } }
.sl-card-moon { position: relative; width: 64px; height: 64px; filter: drop-shadow(0 0 14px rgba(255,244,214,.35)); animation: sl-bob 6s ease-in-out infinite; }
.sl-card-moon .sl-moon-svg { width: 100%; height: 100%; }
.sl-z { position: absolute; left: 70%; top: 0; font: 800 12px/1 var(--display); color: #dfe6ff; text-shadow: 0 0 8px rgba(160,180,255,.9); opacity: 0; animation: sl-zc 3.6s ease-out infinite; }
.sl-z2 { animation-delay: 1.2s; font-size: 15px; } .sl-z3 { animation-delay: 2.4s; font-size: 19px; }
@keyframes sl-zc { 0% { opacity: 0; transform: translate(0, 6px) scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(26px, -34px) scale(1.15) rotate(12deg); } }
.sl-card-body { display: grid; gap: 4px; min-width: 0; }
.sl-card-body small { color: var(--sl-ink2); font-size: 13px; }
.sl-kicker { font: 600 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--pulse) 55%, var(--sl-ink2)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-card-big { font: 800 34px/1 var(--display); letter-spacing: -.03em; }
.sl-card-big .sl-u, .sl-big .sl-u { font-size: .5em; font-weight: 600; margin: 0 .12em 0 .04em; color: var(--sl-ink2); letter-spacing: 0; }
.sl-strip { position: relative; display: flex; height: 7px; margin-top: 6px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.07); }
.sl-strip i { display: block; height: 100%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.sl-strip:has(i[style*="left"]) i { position: absolute; top: 0; }
.sl-strip-none { opacity: .4; }
.sl-card-streak { display: grid; justify-items: center; align-self: start; padding: 6px 8px; border-radius: 14px; background: rgba(255,255,255,.06); }
.sl-card-streak b { font: 800 24px/1 var(--display); }
.sl-card-streak small { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sl-ink2); }
.sl-card-empty { grid-template-columns: 72px 1fr; }
.sl-card-empty strong { font: 800 22px/1.1 var(--display); }

/* The Sleep screen */
html dialog.sheet.sl-sheet { max-width: 640px; max-height: 96dvh; color: var(--sl-ink); color-scheme: dark; backdrop-filter: none; -webkit-backdrop-filter: none; background-color: var(--sl-sky1);
  background-image: radial-gradient(90% 50% at 50% 0%, var(--sl-sky2) 0%, transparent 70%), linear-gradient(180deg, var(--sl-sky0) 0%, var(--sl-sky1) 45%, #0a0f2a 100%); }
html dialog.sheet.sl-sheet .icon-btn { color: var(--sl-ink); background: rgba(255,255,255,.06); }
html dialog.sl-sheet::backdrop { background: rgba(2, 3, 14, .7); backdrop-filter: blur(4px); }
.sl-inner { position: relative; max-height: 96dvh; padding-top: 10px; overscroll-behavior: contain; }
.sl-stars { position: absolute; left: 0; top: 0; width: 100%; height: 460px; pointer-events: none; }
.sl-aurora { position: absolute; left: -20%; right: -20%; top: -80px; height: 420px; pointer-events: none; filter: blur(50px); opacity: .55;
  background: radial-gradient(40% 50% at 30% 40%, color-mix(in srgb, var(--pulse) 55%, transparent), transparent 70%), radial-gradient(35% 45% at 72% 30%, rgba(91, 80, 236, .7), transparent 70%);
  animation: sl-aurora 14s ease-in-out infinite alternate; }
@keyframes sl-aurora { from { transform: translateX(-4%) scaleY(1); } to { transform: translateX(5%) scaleY(1.15); } }
.sl-content { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.sl-content > * { min-width: 0; }
.sl-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; }
.sl-x { color: var(--sl-ink); }
.sl-nav { display: flex; align-items: center; justify-content: center; gap: 6px; }
.sl-title { margin: 0; font: 700 18px/1.2 var(--display); letter-spacing: -.01em; min-width: 0; text-align: center; }
.sl-arrow { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.07); color: var(--sl-ink); font-size: 22px; line-height: 1; cursor: pointer; }
.sl-arrow:disabled { opacity: .25; cursor: default; }
.sl-phase { grid-column: 1 / -1; justify-self: center; margin-top: 2px; font: 600 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--sl-ink3); }

.sl-hero { display: grid; justify-items: center; text-align: center; gap: 4px; }
.sl-stage3d { position: relative; width: 100%; height: 240px; display: grid; place-items: center; perspective: 800px; }
.sl-orbit { position: relative; width: 210px; height: 210px; transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.sl-moon { position: absolute; inset: 21%; border-radius: 50%; animation: sl-bob 7s ease-in-out infinite; }
.sl-moon-svg { position: relative; z-index: 1; width: 100%; height: 100%; display: block; }
.sl-moon-glow { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 244, 214, .28) 0%, color-mix(in srgb, var(--pulse) 18%, transparent) 40%, transparent 68%); }
.sl-craters { animation: sl-librate 18s ease-in-out infinite alternate; }
@keyframes sl-librate { from { transform: translateX(-3px) translateY(1px); } to { transform: translateX(3px) translateY(-1px); } }
@keyframes sl-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.sl-ring { position: absolute; inset: -8%; transform: perspective(700px) rotateX(74deg) rotateZ(-16deg); }
.sl-ring-front { z-index: 2; clip-path: inset(50% 0 0 0); }
.sl-ring-spin { width: 100%; height: 100%; animation: sl-spin 48s linear infinite; }
.sl-ring svg { width: 100%; height: 100%; overflow: visible; }
.sl-track { fill: none; stroke: rgba(170, 185, 255, .14); stroke-width: 1.4; }
.sl-arc { fill: none; stroke: var(--c); stroke-width: 3.4; stroke-linecap: round; filter: drop-shadow(0 0 3px var(--c)); }
@keyframes sl-spin { to { transform: rotate(360deg); } }
.sl-zs { position: absolute; left: 60%; top: 26%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.sl-zz { position: absolute; left: 0; top: 0; font: 800 var(--sz, 18px)/1 var(--display); color: #e3e9ff; text-shadow: 0 0 10px rgba(150, 175, 255, .95), 0 0 24px color-mix(in srgb, var(--pulse) 50%, transparent);
  opacity: 0; animation: sl-zz var(--dur, 4s) cubic-bezier(.3,.6,.4,1) forwards; }
@keyframes sl-zz { 0% { opacity: 0; transform: translate(0, 10px) scale(.3) rotate(0); } 14% { opacity: 1; }
  50% { transform: translate(calc(var(--dx) * .35), -60px) scale(.9) rotate(calc(var(--rot) * -.6)); } 100% { opacity: 0; transform: translate(var(--dx), -130px) scale(1.25) rotate(var(--rot)); } }
.sl-total { display: grid; gap: 2px; margin-top: -8px; }
.sl-big { font: 800 clamp(52px, 15vw, 72px)/.95 var(--display); letter-spacing: -.04em; text-shadow: 0 0 30px rgba(140, 160, 255, .35); }
.sl-big .sl-num { display: inline-block; }
.sl-sub { margin: 4px 0 0; font: 500 14px var(--mono); letter-spacing: .04em; color: var(--sl-ink2); }
.sl-goal { margin: 2px 0 0; color: var(--sl-ink2); font-size: 14px; }
.sl-goal b { color: var(--sl-ink); }
.sl-hero.is-enter .sl-orbit { animation: sl-rise .9s cubic-bezier(.2,.9,.25,1) backwards; }
.sl-hero.is-enter .sl-ring { animation: sl-ringin 1.2s cubic-bezier(.2,.9,.25,1) .15s backwards; }
.sl-hero.is-enter .sl-big .sl-num, .sl-hero.is-enter .sl-big .sl-u { animation: sl-num .6s cubic-bezier(.2,1.3,.4,1) both; }
.sl-hero.is-enter .sl-big > :nth-child(2) { animation-delay: .06s; } .sl-hero.is-enter .sl-big > :nth-child(3) { animation-delay: .12s; } .sl-hero.is-enter .sl-big > :nth-child(4) { animation-delay: .18s; }
.sl-hero.is-enter .sl-sub, .sl-hero.is-enter .sl-goal { animation: cs-fade .5s ease-out .35s both; }
@keyframes sl-rise { from { opacity: 0; transform: translateY(40px) scale(.7); } to { opacity: 1; transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); } }
@keyframes sl-ringin { from { opacity: 0; transform: perspective(700px) rotateX(74deg) rotateZ(-200deg) scale(.6); } }
@keyframes sl-num { from { opacity: 0; transform: translateY(60%) rotateX(-70deg); } to { opacity: 1; transform: none; } }

.sl-sources { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.sl-src { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--sl-line); background: rgba(255,255,255,.04); color: var(--sl-ink2); font: 600 13px var(--body); cursor: pointer; }
.sl-src i { font-style: normal; color: color-mix(in srgb, var(--pulse) 60%, #ffd77a); margin-right: 5px; }
.sl-src[aria-selected="true"] { background: var(--sl-ink); color: var(--sl-sky1); border-color: var(--sl-ink); }
.sl-from { margin: 0; text-align: center; font: 500 12px var(--mono); color: var(--sl-ink3); letter-spacing: .04em; }
.sl-panel { padding: 16px 14px; border-radius: 22px; background: var(--sl-panel); border: 1px solid var(--sl-line); }
.sl-panel h3 { margin: 0 0 12px; font: 700 15px/1.2 var(--display); letter-spacing: .01em; }
.sl-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sl-panel-head h3 { margin: 0; }
.sl-hint { margin: 8px 0 0; font-size: 13px; color: var(--sl-ink3); }

.sl-hyp { display: grid; grid-template-columns: 52px 1fr; gap: 8px; }
.sl-hyp-rows { display: grid; grid-template-rows: repeat(4, 28px); padding-top: 8px; height: var(--h); }
.sl-hyp-rows span { display: flex; align-items: center; gap: 6px; font: 600 11px var(--mono); letter-spacing: .04em; color: var(--sl-ink2); }
.sl-hyp-rows i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); box-shadow: 0 0 6px var(--c); }
.sl-hyp-plot { position: relative; min-width: 0; }
.sl-hyp-plot svg { display: block; width: 100%; height: var(--h); overflow: visible; }
.sl-grid { stroke: rgba(170, 185, 255, .07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sl-tick { stroke: rgba(170, 185, 255, .1); stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.sl-step { fill: none; stroke: rgba(230, 236, 255, .3); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.sl-blk { fill: var(--c); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 70%, transparent)); cursor: pointer; transition: opacity .15s; }
.sl-hyp-plot:hover .sl-blk:not(.is-on), .sl-hyp-plot:has(.is-on) .sl-blk:not(.is-on) { opacity: .45; }
.sl-hyp-x { position: relative; height: 16px; margin-top: 4px; }
.sl-hyp-x span { position: absolute; transform: translateX(-50%); font: 500 10px var(--mono); color: var(--sl-ink3); }
.sl-tip { position: absolute; z-index: 2; width: 140px; padding: 6px 8px; border-radius: 10px; background: #f3f5ff; color: #0b1026; font: 500 12px/1.3 var(--body); text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); pointer-events: none; }
.sl-content.is-enter .sl-hyp-plot svg { animation: sl-scan 1.6s cubic-bezier(.4,0,.2,1) .2s both; }
@keyframes sl-scan { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.sl-compo { display: flex; gap: 2px; height: 22px; border-radius: 8px; overflow: hidden; }
.sl-compo i { background: var(--c); }
.sl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.sl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,.05); font-size: 13px; color: var(--sl-ink2); }
.sl-chip i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.sl-chip b { color: var(--sl-ink); font-weight: 700; }
.sl-chip small { color: var(--sl-ink3); }
.sl-vitals { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; margin-top: 12px; }
.sl-vitals div { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); }
.sl-vitals span { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sl-ink3); }
.sl-vitals b { font: 700 18px var(--display); }
.sl-vitals small { font: 500 11px var(--body); color: var(--sl-ink2); margin-left: 2px; }

.sl-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.06); }
.sl-seg button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--sl-ink2); font: 600 12px var(--body); cursor: pointer; }
.sl-seg button[aria-selected="true"] { background: var(--sl-ink); color: var(--sl-sky1); }
.sl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 14px; }
.sl-stats div { display: grid; gap: 2px; }
.sl-stats span { font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sl-ink3); }
.sl-stats b { font: 800 22px/1.1 var(--display); letter-spacing: -.02em; }
.sl-stats small { color: var(--sl-ink2); font-size: 12px; font-weight: 500; }
.sl-h4 { margin: 14px 0 8px; font: 700 13px var(--body); color: var(--sl-ink); }
.sl-h4 small { font-weight: 500; color: var(--sl-ink3); margin-left: 4px; }
.sl-bars { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.sl-bars.is-30 { gap: 2px; }
.sl-goal-line { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--goalpx)); border-top: 1.5px dashed color-mix(in srgb, var(--pulse) 70%, #fff); z-index: 1; pointer-events: none; }
.sl-goal-line em { position: absolute; right: 0; top: -17px; font: 600 10px var(--mono); font-style: normal; color: color-mix(in srgb, var(--pulse) 60%, #fff); }
.sl-bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; }
.sl-bar-stack { width: min(24px, 100%); display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 5px 5px 2px 2px; overflow: hidden; transform-origin: bottom; }
.sl-bar-stack i { display: block; background: var(--c); min-height: 2px; }
.sl-bar-x { height: 14px; font: 500 10px var(--mono); color: var(--sl-ink3); }
.sl-bar.is-none::before { content: ""; width: 6px; height: 6px; margin-bottom: 4px; border-radius: 50%; background: rgba(255,255,255,.12); }
.sl-bar:hover .sl-bar-stack, .sl-bar:focus-visible .sl-bar-stack { filter: brightness(1.25); box-shadow: 0 0 14px rgba(140, 160, 255, .5); }
.sl-content.is-enter .sl-bar-stack { animation: sl-grow .7s cubic-bezier(.2,1.1,.3,1) both; animation-delay: var(--d, 0ms); }
@keyframes sl-grow { from { transform: scaleY(0); } }
.sl-legend { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--sl-ink2); }
.sl-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sl-legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.sl-wins { position: relative; display: flex; gap: 6px; height: 170px; padding-left: 52px;
  background: linear-gradient(to bottom, rgba(170,185,255,.08) 1px, transparent 1px) 52px 0 / calc(100% - 52px) 25% repeat-y; }
.sl-wins.is-30 { gap: 2px; }
.sl-wins-y span { position: absolute; left: 0; transform: translateY(-50%); font: 500 10px var(--mono); color: var(--sl-ink3); }
.sl-wins-y span:first-child { transform: none; }
.sl-bedgoal { position: absolute; left: 52px; right: 0; border-top: 1.5px dashed color-mix(in srgb, var(--pulse) 70%, #fff); z-index: 1; pointer-events: none; }
.sl-win { position: relative; flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.sl-win i { position: absolute; left: 50%; width: min(14px, 80%); transform: translateX(-50%); border-radius: 999px; opacity: .5;
  background: linear-gradient(180deg, var(--st-deep), var(--st-core) 55%, var(--st-rem)); }
.sl-win.is-goal i { opacity: 1; box-shadow: 0 0 12px rgba(120, 140, 255, .55); }
.sl-win:hover i, .sl-win:focus-visible i { opacity: 1; filter: brightness(1.2); }
.sl-content.is-enter .sl-win i { animation: sl-drop .8s cubic-bezier(.2,1,.3,1) both; animation-delay: var(--d, 0ms); }
@keyframes sl-drop { from { opacity: 0; clip-path: inset(0 0 100% 0); } }

.sl-streak-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.sl-streak-n { display: grid; }
.sl-streak-n b { font: 800 56px/.9 var(--display); letter-spacing: -.04em; background: linear-gradient(180deg, #fff, #b9c3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sl-streak-n span { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sl-ink2); }
.sl-streak-best { text-align: right; font: 700 14px var(--body); }
.sl-streak-best small { font-weight: 500; color: var(--sl-ink3); }
.sl-moons { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin: 14px 0; }
.sl-mini { aspect-ratio: 1; border-radius: 50%; border: 1px dashed rgba(170,185,255,.22); }
.sl-mini.is-off { border: 1px solid rgba(170,185,255,.35); background: rgba(255,255,255,.04); }
.sl-mini.is-on { border: 0; background: radial-gradient(circle at 35% 30%, #fffbea, #d9d1b6 60%, #9d957c); box-shadow: 0 0 10px rgba(255, 240, 200, .45); }
.sl-content.is-enter .sl-mini { animation: sl-pop .4s cubic-bezier(.3,1.6,.5,1) both; animation-delay: calc(.2s + var(--k) * 35ms); }
@keyframes sl-pop { from { transform: scale(0); } }
.sl-goals { display: grid; gap: 10px; }
.sl-stepper { display: flex; align-items: center; gap: 10px; }
.sl-stepper span, .sl-bedtime span { flex: 1; font-size: 14px; color: var(--sl-ink2); }
.sl-stepper button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--sl-line); background: rgba(255,255,255,.05); color: var(--sl-ink); font-size: 18px; cursor: pointer; }
.sl-stepper b { min-width: 72px; text-align: center; font: 700 16px var(--display); }
.sl-bedtime { display: flex; align-items: center; gap: 10px; }
.sl-sheet input[type="time"], .sl-sheet input[type="date"], .sl-sheet select { min-height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--sl-line); background: rgba(255,255,255,.06); color: var(--sl-ink); font: 600 14px var(--body); }
.sl-switch { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--sl-ink2); }
.sl-switch input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--st-core); flex: none; }
.sl-table-wrap { overflow-x: auto; margin: 0 -4px; }
.sl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sl-table th, .sl-table td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--sl-line); white-space: nowrap; }
.sl-table thead th { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sl-ink3); }
.sl-table th[scope="row"], .sl-table thead th:first-child { text-align: left; }
.sl-table tr.is-main th, .sl-table tr.is-main td { color: var(--sl-ink); font-weight: 700; }
.sl-table td { color: var(--sl-ink2); }
.sl-table em { font: 600 9px var(--mono); font-style: normal; letter-spacing: .1em; text-transform: uppercase; padding: 1px 5px; border-radius: 999px; background: color-mix(in srgb, var(--pulse) 30%, transparent); color: var(--sl-ink); }
.sl-agree { margin: 10px 0 0; padding: 0 0 0 18px; color: var(--sl-ink2); font-size: 13px; }
.sl-agree b { color: var(--sl-ink); }
.sl-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--sl-ink2); }
.sl-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; }
.sl-add label { display: grid; gap: 4px; font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sl-ink3); }
.sl-add input { width: 100%; }
.sl-add .btn { grid-column: 1 / -1; justify-self: start; color: var(--sl-ink); border-color: var(--sl-line); background: transparent; }
@media (prefers-reduced-motion: reduce) {
  .sl-card-sky, .sl-card-moon, .sl-moon, .sl-craters, .sl-ring-spin, .sl-aurora, .sl-z { animation: none !important; }
  .sl-z { opacity: .8; }
}

/* ── 1.15 Game on: rank emblem, XP, coins, streaks, quests, league, celebrations ── */
.gm-bronze, .gm-r-bronze { --m1: #f3bd8f; --m2: #b8703f; --m3: #6b3a1b; }
.gm-silver, .gm-r-silver { --m1: #f7f9fc; --m2: #a9b4c4; --m3: #586374; }
.gm-gold, .gm-r-gold { --m1: #fff3b0; --m2: #f0b52e; --m3: #9a600a; }
.gm-platinum, .gm-r-platinum { --m1: #dcfff9; --m2: #57cbb9; --m3: #1d6b62; }
.gm-diamond, .gm-r-diamond { --m1: #e6f6ff; --m2: #5ca9ff; --m3: #2640a6; }
.gm-legend, .gm-r-legend { --m1: #ffd6f4; --m2: #c25cff; --m3: #4a1b8a; }

.gm-emblem { display: inline-grid; place-items: center; width: 64px; height: 64px; perspective: 400px; flex: none; }
.gm-emblem-xl { width: 150px; height: 150px; }
.gm-gem { position: relative; width: 100%; height: 100%; display: grid; place-items: center; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: linear-gradient(150deg, var(--m1) 0%, var(--m2) 48%, var(--m3) 100%); transform-style: preserve-3d; animation: gm-sway 6s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--m3) 45%, transparent)); }
.gm-face { position: absolute; inset: 15%; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: radial-gradient(circle at 35% 30%, var(--m1) 0%, var(--m2) 55%, var(--m3) 120%); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.gm-shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.65) 45%, transparent 60%); background-size: 250% 100%; animation: gm-shine 4.5s ease-in-out infinite; mix-blend-mode: soft-light; }
.gm-gem b { position: relative; font: 900 22px/1 var(--display); color: #fff; text-shadow: 0 1px 0 var(--m3), 0 2px 6px rgba(0,0,0,.35); letter-spacing: -.02em; }
.gm-emblem-xl .gm-gem b { font-size: 50px; }
.gm-legend .gm-gem { animation: gm-sway 6s ease-in-out infinite, gm-hue 8s linear infinite; }
.gm-emblem.is-spin .gm-gem { animation: gm-spin 1.1s cubic-bezier(.2,.8,.2,1); }
@keyframes gm-sway { 0%, 100% { transform: rotateY(-14deg) rotateX(4deg); } 50% { transform: rotateY(14deg) rotateX(-4deg); } }
@keyframes gm-shine { 0%, 60% { background-position: 150% 0; } 100% { background-position: -100% 0; } }
@keyframes gm-spin { from { transform: rotateY(0) scale(1); } 50% { transform: rotateY(360deg) scale(1.12); } to { transform: rotateY(720deg) scale(1); } }
@keyframes gm-hue { to { filter: hue-rotate(360deg) drop-shadow(0 6px 10px rgba(0,0,0,.3)); } }

.gm-card { position: relative; overflow: hidden; display: grid; gap: 14px; margin: 0 0 14px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--m2) 16%, transparent) 0%, transparent 60%), var(--paper); box-shadow: var(--shadow); }
.gm-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.gm-emblem-btn { padding: 0; border: 0; background: none; cursor: pointer; }
.gm-rankbox { display: grid; gap: 6px; min-width: 0; }
.gm-kicker { font: 700 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--spruce-2); }
.gm-rankbox .gm-kicker { color: color-mix(in srgb, var(--m3) 70%, var(--spruce)); font-size: 12px; }
.gm-xpbar { position: relative; height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--m2) 14%, var(--glacier)); overflow: hidden; }
.gm-xpbar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--m2), var(--m1)); box-shadow: 0 0 10px color-mix(in srgb, var(--m2) 60%, transparent); transition: width .8s cubic-bezier(.2,.9,.3,1); }
.gm-xpbar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); background-size: 60px 100%; background-repeat: no-repeat; animation: gm-bar 2.6s ease-in-out infinite; }
@keyframes gm-bar { from { background-position: -60px 0; } to { background-position: calc(100% + 60px) 0; } }
.gm-rankbox small { font-size: 12px; color: var(--spruce-2); }
.gm-rankbox small b { color: var(--spruce); }
.gm-coins { display: grid; justify-items: center; gap: 2px; }
.gm-coins b { font: 800 16px/1 var(--display); }
.gm-coin { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c4, #f2c234 55%, #b07b0c); box-shadow: inset 0 0 0 3px rgba(255,255,255,.35), inset 0 -2px 0 rgba(0,0,0,.2), 0 2px 6px rgba(176,123,12,.4);
  animation: gm-coinflip 5s ease-in-out infinite; }
@keyframes gm-coinflip { 0%, 80% { transform: rotateY(0); } 90% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
.gm-streaks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gm-streak { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; background: var(--glacier); color: var(--spruce-2); }
.gm-streak b { font: 800 15px/1 var(--display); color: var(--spruce); }
.gm-streak small { font-size: 12px; }
.gm-streak [data-icon] svg { width: 16px; height: 16px; }
.gm-streak.is-live [data-icon] { color: #ff7a2f; }
.gm-streak.is-live:nth-child(2) [data-icon] { color: #6f8cff; }
.gm-streak.is-live:nth-child(3) [data-icon] { color: var(--teal); }
.gm-streak.is-frozen { box-shadow: inset 0 0 0 1.5px #8fd6ff; background: color-mix(in srgb, #8fd6ff 18%, var(--glacier)); }
.gm-streaks.is-triple .gm-streak.is-live { animation: gm-glow 2.4s ease-in-out infinite; }
@keyframes gm-glow { 50% { box-shadow: 0 0 0 2px color-mix(in srgb, #ff7a2f 40%, transparent), 0 0 14px color-mix(in srgb, #ff7a2f 35%, transparent); } }
.gm-freeze { display: inline-flex; align-items: center; gap: 3px; padding: 6px 10px; border-radius: 999px; background: var(--glacier); }
.gm-freeze i { width: 12px; height: 14px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: color-mix(in srgb, var(--spruce-2) 25%, transparent); }
.gm-freeze i.is-on { background: linear-gradient(160deg, #e9f8ff, #7fd0ff 60%, #3a8de0); box-shadow: 0 0 8px #7fd0ff; }
.gm-freeze small { margin-left: 3px; font-size: 12px; color: var(--spruce-2); }
.gm-triple { padding: 5px 10px; border-radius: 999px; font: 800 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #fff;
  background: linear-gradient(90deg, #ff7a2f, #6f8cff, var(--teal), #ff7a2f); background-size: 300% 100%; animation: gm-rainbow 4s linear infinite; }
@keyframes gm-rainbow { to { background-position: 300% 0; } }
.gm-quests { display: grid; gap: 8px; }
.gm-qhead { display: flex; align-items: center; justify-content: space-between; }
.gm-pips { display: inline-flex; gap: 5px; }
.gm-pips i { width: 11px; height: 11px; transform: rotate(45deg); border-radius: 2px; background: var(--line); }
.gm-pips i.is-on { background: linear-gradient(135deg, var(--m1), var(--m2)); box-shadow: 0 0 8px var(--m2); }
.gm-quest { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); background: var(--glacier); }
.gm-qface { width: 36px; height: 36px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--m2) 22%, var(--paper)); font: 800 14px var(--display); }
.gm-qface img { width: 100%; height: 100%; object-fit: cover; }
.gm-qbody { display: grid; gap: 2px; min-width: 0; }
.gm-qbody strong { font-size: 15px; line-height: 1.25; }
.gm-qbody small { font-size: 12px; color: var(--spruce-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-qbar { height: 5px; margin-top: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.gm-qbar i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.gm-qxp { display: grid; justify-items: end; gap: 2px; }
.gm-qxp b { font: 800 14px var(--display); color: color-mix(in srgb, var(--m3) 60%, var(--spruce)); }
.gm-qxp small { font: 600 11px var(--mono); color: var(--spruce-2); }
.gm-check { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 900; font-size: 13px; animation: gm-pop .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes gm-pop { from { transform: scale(0); } }
.gm-quest.is-done { background: color-mix(in srgb, var(--teal) 12%, var(--glacier)); }
.gm-quest.is-done strong { color: var(--spruce-2); }
.gm-quest.is-missed { opacity: .5; }
.gm-pending { margin: 0; font-size: 12px; color: var(--spruce-2); }
.gm-chest { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); border: 1.5px dashed var(--line); font-size: 13px; color: var(--spruce-2); }
.gm-chest b { color: var(--spruce); }
.gm-chest-ico { width: 22px; height: 18px; border-radius: 4px 4px 3px 3px; background: linear-gradient(#c98a3a 0 40%, #8a5520 40% 46%, #b5772f 46%); box-shadow: inset 0 0 0 1.5px #6b3f14; position: relative; }
.gm-chest-ico::after { content: ""; position: absolute; left: 50%; top: 35%; width: 5px; height: 6px; transform: translateX(-50%); background: #ffd75e; border-radius: 1px; }
.gm-chest.is-open { border-style: solid; border-color: color-mix(in srgb, #f0b52e 70%, transparent); background: color-mix(in srgb, #f0b52e 12%, transparent); }

.gm-league .gm-lhead { display: flex; align-items: baseline; justify-content: space-between; }
.gm-league .gm-lhead h3 { margin: 0; }
.gm-league .gm-lhead span { font-size: 12px; color: var(--spruce-2); }
.gm-board { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
.gm-board li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); }
.gm-board li.is-me { background: var(--glacier); box-shadow: inset 3px 0 0 var(--teal); }
.gm-place { font: 900 20px var(--display); color: var(--spruce-2); text-align: center; }
.gm-board li:first-child .gm-place { color: #e0a81e; }
.gm-who { display: grid; gap: 2px; min-width: 0; }
.gm-who small { font-size: 12px; color: var(--spruce-2); }
.gm-crown { margin-right: 4px; display: inline-block; animation: gm-bob 2.4s ease-in-out infinite; }
@keyframes gm-bob { 50% { transform: translateY(-2px) rotate(-6deg); } }
.gm-lbar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 3px; }
.gm-lbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), color-mix(in srgb, var(--teal) 50%, #8fe3d6)); }
.gm-lxp { display: flex; align-items: center; gap: 6px; }
.gm-lxp b { font: 800 16px var(--display); }
.gm-lxp small { font-size: 11px; color: var(--spruce-2); }
.gm-duel { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--spruce); cursor: pointer; }
.gm-duel [data-icon] svg { width: 17px; height: 17px; }
.gm-duels { display: grid; gap: 6px; margin-bottom: 10px; }
.gm-duel-row { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); background: var(--glacier); font-size: 14px; }
.gm-duel-row [data-icon] svg { width: 18px; height: 18px; }
.gm-duel-act { display: flex; align-items: center; gap: 8px; }
.gm-vs { display: grid; gap: 4px; }
.gm-vs small { font-size: 12px; color: var(--spruce-2); }
.gm-vsbars { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--spruce-2); }
.gm-vstrack { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.gm-vsbars i { display: block; height: 100%; border-radius: 999px; min-width: 4px; }
.gm-vsbars .gm-me { background: var(--teal); } .gm-vsbars .gm-them { background: var(--coral); }
.gm-vsbars em { font: 700 12px var(--mono); font-style: normal; }
.gm-duel-row.is-won { background: color-mix(in srgb, #f0b52e 18%, var(--glacier)); }
.gm-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.gm-kind { display: grid; gap: 4px; justify-items: start; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--paper); text-align: left; cursor: pointer; }
.gm-kind small { font-size: 12px; color: var(--spruce-2); }
.gm-kind[aria-checked="true"] { border-color: var(--teal); box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 35%, transparent); }

/* celebrations */
.gm-banner { position: fixed; z-index: 120; left: 50%; top: calc(10px + var(--safe-t)); display: flex; align-items: center; gap: 10px; max-width: min(92vw, 420px); padding: 8px 14px 8px 8px; border-radius: 999px;
  background: var(--spruce); color: var(--glacier); box-shadow: 0 16px 40px rgba(0,0,0,.3); transform: translate(-50%, -140%); transition: transform .45s cubic-bezier(.2,1.3,.4,1); }
.gm-banner.is-in { transform: translate(-50%, 0); }
.gm-bface { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--teal); font: 800 14px var(--display); flex: none; }
.gm-bface img { width: 100%; height: 100%; object-fit: cover; }
.gm-banner small { display: block; font: 700 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.gm-banner strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-banner > b { margin-left: auto; padding: 4px 10px; border-radius: 999px; background: linear-gradient(135deg, #ffe58a, #f0b52e); color: #4a2f00; font: 800 13px var(--display); flex: none; }
.gm-spark { position: fixed; z-index: 121; width: 7px; height: 7px; border-radius: 2px; pointer-events: none; animation: gm-spark .9s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes gm-spark { to { transform: translate(var(--x), var(--y)) rotate(200deg); opacity: 0; } }
.gm-stage { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 24px; background: rgba(6, 8, 20, .72); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s ease; }
.gm-stage.is-in { opacity: 1; }
.gm-stage.is-out { opacity: 0; }
.gm-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.gm-rings { position: absolute; left: 50%; top: 42%; width: 0; height: 0; pointer-events: none; }
.gm-rings i { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; border: 3px solid var(--m2); opacity: 0; animation: gm-ring 1.4s cubic-bezier(.2,.7,.3,1) forwards; }
.gm-rings i:nth-child(2) { animation-delay: .18s; } .gm-rings i:nth-child(3) { animation-delay: .36s; }
@keyframes gm-ring { from { transform: scale(.3); opacity: .9; } to { transform: scale(4.2); opacity: 0; } }
.gm-stage-card { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; color: #fff; max-width: 360px; }
.gm-art { margin-bottom: 8px; }
.gm-stage.is-in .gm-art { animation: gm-arrive 1.1s cubic-bezier(.2,.9,.25,1) both; }
.gm-art-emblem.is-in .gm-art .gm-gem { animation: gm-spin 1.4s cubic-bezier(.2,.8,.2,1) .1s, gm-sway 6s ease-in-out 1.5s infinite; }
@keyframes gm-arrive { from { transform: scale(.2) translateY(60px); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } to { transform: none; } }
.gm-skicker { font: 700 12px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--m1); }
.gm-stitle { margin: 0; font: 900 clamp(34px, 10vw, 52px)/1 var(--display); letter-spacing: -.03em; text-shadow: 0 4px 30px color-mix(in srgb, var(--m2) 80%, transparent); }
.gm-ssub { margin: 4px 0 14px; color: rgba(255,255,255,.8); }
.gm-stage.is-in .gm-skicker, .gm-stage.is-in .gm-stitle, .gm-stage.is-in .gm-ssub, .gm-stage.is-in .gm-sgo { animation: cs-fade .5s ease-out both; }
.gm-stage.is-in .gm-stitle { animation-delay: .35s; } .gm-stage.is-in .gm-ssub { animation-delay: .5s; } .gm-stage.is-in .gm-sgo { animation-delay: .7s; }
.gm-sgo { min-width: 160px; }
.gm-bigchest { position: relative; display: block; width: 120px; height: 100px; perspective: 500px; }
.gm-bigchest .gm-box { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; border-radius: 6px 6px 12px 12px; background: linear-gradient(#b5772f, #7d4a17); box-shadow: inset 0 0 0 4px #5b3510, inset 0 -10px 0 rgba(0,0,0,.18); }
.gm-bigchest .gm-box::after { content: ""; position: absolute; left: 50%; top: 4px; width: 18px; height: 22px; transform: translateX(-50%); border-radius: 3px; background: linear-gradient(#ffe58a, #e0a81e); }
.gm-bigchest .gm-lid { position: absolute; left: 0; right: 0; top: 0; height: 42%; border-radius: 40px 40px 6px 6px; background: linear-gradient(#d39444, #a2652a); box-shadow: inset 0 0 0 4px #5b3510; transform-origin: 50% 100%; z-index: 2; }
.gm-bigchest .gm-glow { position: absolute; left: 10%; right: 10%; top: 26%; height: 30%; border-radius: 50%; background: radial-gradient(#fff6c4, rgba(255,215,94,0) 70%); opacity: 0; z-index: 1; }
.gm-stage.is-in .gm-bigchest .gm-lid { animation: gm-lid .9s cubic-bezier(.3,1.4,.5,1) .5s both; }
.gm-stage.is-in .gm-bigchest .gm-glow { animation: gm-shinebox 1.2s ease-out .6s both; }
@keyframes gm-lid { to { transform: rotateX(-110deg) translateY(-6px); } }
@keyframes gm-shinebox { 40% { opacity: 1; transform: scale(1.8) translateY(-20px); } to { opacity: .8; transform: scale(1.4) translateY(-14px); } }
.gm-bigflame { position: relative; display: block; width: 100px; height: 130px; }
.gm-bigflame i { position: absolute; left: 50%; bottom: 4px; width: 84px; height: 84px; margin-left: -42px; border-radius: 0 50% 50% 50%; transform-origin: 50% 50%; transform: rotate(-135deg);
  background: radial-gradient(circle at 70% 70%, #fff3b0 0%, #ffb02e 38%, #ff5a1f 78%); box-shadow: 0 0 40px rgba(255, 110, 30, .6); animation: gm-flicker 1.1s ease-in-out infinite alternate; }
.gm-bigflame i:nth-child(2) { width: 56px; height: 56px; margin-left: -28px; bottom: 6px; background: radial-gradient(circle at 70% 70%, #fff8d0, #ffc94a 55%, #ff8a2a); box-shadow: none; animation-duration: .8s; }
.gm-bigflame i:nth-child(3) { width: 28px; height: 28px; margin-left: -14px; bottom: 8px; background: radial-gradient(circle at 65% 65%, #fff, #fff3b0); box-shadow: none; animation-duration: .6s; }
@keyframes gm-flicker { from { transform: rotate(-135deg) scale(1); } to { transform: rotate(-131deg) scale(1.07, 1.12); } }
.gm-bigice { display: block; font-size: 110px; line-height: 1; color: #bfe9ff; text-shadow: 0 0 30px #7fd0ff, 0 0 60px #3a8de0; animation: gm-turn 6s linear infinite; }
@keyframes gm-turn { to { transform: rotate(360deg); } }
.gm-bigtrophy { display: block; font-size: 110px; line-height: 1; filter: drop-shadow(0 10px 30px rgba(240,181,46,.6)); }
@media (prefers-reduced-motion: reduce) {
  .gm-gem, .gm-shine, .gm-coin, .gm-triple, .gm-crown, .gm-xpbar i::after, .gm-streaks.is-triple .gm-streak.is-live, .gm-bigflame i, .gm-bigice { animation: none !important; }
  .gm-banner { transition: none; }
}

/* ── 1.16 Assemble: Your Coaching Team (always a dark stage; the skin's accent lights it) ── */
.cs-team { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--spruce); font: 700 12px var(--body); cursor: pointer; }
.tm { position: fixed; inset: 0; z-index: 92; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto auto; color: #f3f5ff; opacity: 0;
  background: radial-gradient(70% 45% at 50% 0%, color-mix(in srgb, var(--pulse) 30%, #0e1430) 0%, transparent 70%), linear-gradient(180deg, #070912 0%, #0c1022 55%, #05060c 100%);
  transition: opacity .35s ease, transform .4s cubic-bezier(.4,0,.2,1); padding: calc(10px + var(--safe-t)) 16px calc(16px + var(--safe-b)); }
.tm.is-in { opacity: 1; }
.tm.is-out { opacity: 0; transform: scale(1.04); }
.tm-beams { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; }
.tm-beams i { position: absolute; top: -10%; left: 50%; width: 46vmax; height: 120%; transform-origin: 50% 0; opacity: .38; filter: blur(14px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--pulse) 70%, #fff) 0%, transparent 80%); clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%); }
.tm-beams i:nth-child(1) { margin-left: -23vmax; transform: rotate(18deg); animation: tm-sweep 9s ease-in-out infinite alternate; }
.tm-beams i:nth-child(2) { margin-left: -23vmax; transform: rotate(0deg); opacity: .22; }
.tm-beams i:nth-child(3) { margin-left: -23vmax; transform: rotate(-18deg); animation: tm-sweep 11s ease-in-out infinite alternate-reverse; }
@keyframes tm-sweep { from { rotate: -6deg; } to { rotate: 6deg; } }
.tm-top { position: relative; z-index: 2; display: grid; justify-items: center; text-align: center; padding-top: 6px; }
.tm-x { position: absolute; right: -6px; top: 0; color: #fff; background: rgba(255,255,255,.08); }
.tm-kicker { font: 700 11px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: color-mix(in srgb, var(--pulse) 60%, #fff); }
.tm-title { margin: 4px 0 0; font: 900 clamp(30px, 9vw, 54px)/.95 var(--display); letter-spacing: -.02em; text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #d9def0 45%, #8f97b8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(0,0,0,.6)); }
.tm-title span { display: block; font-size: .45em; letter-spacing: .3em; }
.tm-stage { position: relative; z-index: 1; min-height: 0; perspective: 1100px; perspective-origin: 50% 30%; touch-action: pan-y; cursor: grab; user-select: none; }
.tm-stage:active { cursor: grabbing; }
.tm-floor { position: absolute; left: 50%; bottom: 4%; width: min(94vw, 760px); aspect-ratio: 1; transform: translate(-50%, 50%) rotateX(78deg); pointer-events: none; }
.tm-floor i { position: absolute; inset: 0; border-radius: 50%; }
.tm-floor-grid { background: repeating-radial-gradient(circle, rgba(170, 185, 255, .12) 0 1px, transparent 1px 34px), repeating-conic-gradient(rgba(170, 185, 255, .1) 0 1deg, transparent 1deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 45%, transparent 70%); mask: radial-gradient(circle, #000 45%, transparent 70%); }
.tm-floor-ring { inset: 14%; border: 2px solid color-mix(in srgb, var(--pulse) 80%, #fff); box-shadow: 0 0 30px color-mix(in srgb, var(--pulse) 70%, transparent), inset 0 0 40px color-mix(in srgb, var(--pulse) 40%, transparent); }
.tm-floor-spot { inset: 30%; background: radial-gradient(circle, color-mix(in srgb, var(--pulse) 55%, #fff) 0%, transparent 65%); opacity: .6; }
.tm-figs { position: absolute; inset: 0; transform-style: preserve-3d; }
.tm-fig { position: absolute; left: 50%; bottom: 6%; height: min(52vh, 460px); aspect-ratio: 2 / 3; padding: 0; border: 0; background: none; cursor: pointer; transform-origin: 50% 100%;
  transition: opacity .35s ease, filter .35s ease; }
.tm-fig:focus-visible { outline: 2px solid var(--pulse); outline-offset: 6px; border-radius: 12px; }
.tm-hero { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; pointer-events: none; filter: drop-shadow(0 18px 24px rgba(0,0,0,.65));
  -webkit-box-reflect: below -4px linear-gradient(transparent 84%, rgba(255,255,255,.2)); }
.tm-fig.is-front .tm-hero { filter: drop-shadow(0 18px 24px rgba(0,0,0,.65)) drop-shadow(0 0 18px color-mix(in srgb, var(--pulse) 45%, transparent)); }
.tm-holo { position: absolute; inset: 0 18%; display: grid; grid-template-rows: 24% 1fr; justify-items: center; }
.tm-holo-face { align-self: end; width: 52%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; display: grid; place-items: center; border: 2px solid color-mix(in srgb, var(--pulse) 70%, #fff);
  box-shadow: 0 0 24px color-mix(in srgb, var(--pulse) 60%, transparent); background: #141a35; font: 900 48px var(--display); }
.tm-holo-face img { width: 100%; height: 100%; object-fit: cover; }
.tm-holo-body { width: 100%; height: 94%; margin-top: 3%;
  clip-path: polygon(30% 0, 70% 0, 100% 10%, 100% 46%, 86% 48%, 82% 30%, 76% 52%, 72% 100%, 54% 100%, 50% 62%, 46% 100%, 28% 100%, 24% 52%, 18% 30%, 14% 48%, 0 46%, 0 10%);
  background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--pulse) 40%, transparent) 0 2px, transparent 2px 5px), linear-gradient(180deg, color-mix(in srgb, var(--pulse) 45%, transparent), transparent 95%);
  animation: tm-flicker 3s steps(2) infinite; }
@keyframes tm-flicker { 0%, 92%, 100% { opacity: .85; } 94% { opacity: .5; } 96% { opacity: .9; } }
.tm-scan { position: absolute; left: -8%; right: -8%; height: 18px; top: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--pulse) 80%, #fff), transparent); filter: blur(2px); }
.tm-fig.is-busy .tm-scan { opacity: .9; animation: tm-scan 1.6s ease-in-out infinite alternate; }
@keyframes tm-scan { from { top: 0; } to { top: 96%; } }
.tm-fig.is-new { animation: tm-flash 1s ease-out; }
@keyframes tm-flash { 0% { filter: brightness(3) blur(2px); } 100% { filter: none; } }
.tm.is-in .tm-figs.is-enter .tm-fig { animation: tm-rise .9s cubic-bezier(.2,.9,.25,1) backwards; animation-delay: calc(.15s + var(--k) * 120ms); }
@keyframes tm-rise { from { translate: 0 90px; opacity: 0; } }
.tm-plate { position: relative; z-index: 2; display: grid; justify-items: center; gap: 8px; text-align: center; }
.tm-name { display: flex; justify-content: center; font: 900 clamp(38px, 12vw, 64px)/1 var(--display); letter-spacing: -.03em; text-transform: uppercase; text-shadow: 0 6px 30px color-mix(in srgb, var(--pulse) 60%, transparent); }
.tm-name span { display: inline-block; white-space: pre; animation: cs-rise .5s cubic-bezier(.2,1.2,.4,1) both; animation-delay: calc(var(--k) * 30ms); }
.tm-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tm-tags span { padding: 4px 10px; border-radius: 999px; font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; background: rgba(255,255,255,.08); color: #d8dcf0; }
.tm-tags .tm-focus { background: color-mix(in srgb, var(--pulse) 30%, transparent); color: #fff; }
.tm-tags .tm-lead { background: linear-gradient(135deg, #ffe58a, #f0b52e); color: #4a2f00; }
.tm-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tm .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.04); }
.tm .btn-primary { background: #fff; color: #0b0e1c; }
.tm .link-btn { color: color-mix(in srgb, var(--pulse) 50%, #fff); }
.tm-fine { margin: 0; max-width: 34ch; font-size: 13px; color: #aab2d0; }
.tm-dots { position: relative; z-index: 2; display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.tm-dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.25); cursor: pointer; }
.tm-dots button[aria-selected="true"] { width: 26px; border-radius: 999px; background: var(--pulse); }
@media (prefers-reduced-motion: reduce) { .tm-beams i, .tm-holo-body, .tm.is-in .tm-fig, .tm-name span { animation: none !important; } }

.tm-banner { position: relative; overflow: hidden; width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin: 0 0 14px; padding: 14px 16px; border: 0; border-radius: var(--r-lg);
  color: #fff; text-align: left; cursor: pointer; isolation: isolate;
  background: radial-gradient(80% 120% at 30% 0%, color-mix(in srgb, var(--pulse) 40%, #121838) 0%, transparent 70%), linear-gradient(135deg, #0b0f22, #161c3c); box-shadow: 0 16px 34px -20px rgba(10, 14, 40, .8); }
.tm-banner::after { content: ""; position: absolute; inset: -40% auto -40% -30%; width: 40%; transform: rotate(18deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent); animation: tm-gleam 5s ease-in-out infinite; z-index: -1; }
@keyframes tm-gleam { 0%, 60% { left: -40%; } 100% { left: 130%; } }
.tm-banner-faces { display: flex; }
.tm-banner-faces span { width: 44px; height: 52px; margin-left: -12px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: #1d2550; border: 2px solid #0b0f22; font: 900 18px var(--display); }
.tm-banner-faces span:first-child { margin-left: 0; }
.tm-banner-faces img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(1.9); transform-origin: 50% 12%; }
.tm-banner-faces img.is-face { transform: none; }
.tm-banner-text { display: grid; gap: 2px; }
.tm-banner-text small { font: 700 10px var(--mono); letter-spacing: .26em; text-transform: uppercase; color: color-mix(in srgb, var(--pulse) 55%, #fff); }
.tm-banner-text strong { font: 900 20px/1.1 var(--display); letter-spacing: -.01em; text-transform: uppercase; }
.tm-banner-go { font-size: 26px; opacity: .8; }
.roster-card .tm-banner { margin: -2px 0 14px; }

/* Celebrity Trainers: the sign at the top of the wall */
.ct-sign { position: relative; display: grid; justify-items: center; gap: 4px; margin: 2px 0 14px; padding: 16px 14px 14px; text-align: center; border-radius: 16px;
  background: linear-gradient(180deg, #1a1208, #0e0a05); color: #fff3d6; border: 2px solid #c9a24a; box-shadow: 0 0 0 4px #1a1208, 0 0 24px rgba(240, 181, 46, .35); }
.ct-bulbs { position: absolute; inset: 5px; border-radius: 12px; pointer-events: none;
  background: radial-gradient(circle, #ffe9a8 0 2px, transparent 2.5px) 0 0 / 14px 14px; -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); padding: 4px;
  animation: ct-chase 1.2s steps(2) infinite; filter: drop-shadow(0 0 3px #ffd75e); }
@keyframes ct-chase { 50% { background-position: 7px 7px; } }
.ct-badge { padding: 3px 10px; border-radius: 999px; background: #8b1d1d; color: #ffe6c2; font: 800 10px var(--mono); letter-spacing: .22em; text-transform: uppercase; }
.ct-title { font: 900 26px/1.05 var(--display); letter-spacing: .02em; text-transform: uppercase; background: linear-gradient(180deg, #fff6d8, #f0c45a 55%, #a87a1c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ct-fine { max-width: 42ch; font-size: 11.5px; line-height: 1.4; color: #d9c9a2; }
@media (prefers-reduced-motion: reduce) { .ct-bulbs, .tm-banner::after { animation: none; } }

/* ── 1.17 Studio: the Coach Studio (a backstage preview over the skin's own sheet) ── */
html dialog.sheet.st-sheet { max-width: 640px; max-height: 96dvh; }
.st-inner { max-height: 96dvh; padding-top: 12px; }
.st-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 6px; }
.st-title { margin: 0; font: 800 20px/1 var(--display); letter-spacing: -.01em; text-align: center; }
.st-preview { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; margin: 4px 0 12px; padding: 14px 12px 12px; border-radius: 20px; overflow: hidden; isolation: isolate; color: #f3f5ff;
  background: radial-gradient(70% 60% at 50% 0%, color-mix(in srgb, var(--pulse) 32%, #0e1430) 0%, transparent 72%), linear-gradient(180deg, #080b18, #0e1226 70%, #06070e); }
.st-stage { position: relative; width: min(100%, 280px); height: 230px; display: grid; place-items: end center; }
.st-ring { position: absolute; left: 50%; bottom: 2px; width: 230px; height: 46px; translate: -50% 0; border-radius: 50%; z-index: -1;
  border: 2px solid color-mix(in srgb, var(--pulse) 80%, #fff); box-shadow: 0 0 22px color-mix(in srgb, var(--pulse) 60%, transparent), inset 0 0 26px color-mix(in srgb, var(--pulse) 40%, transparent);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--pulse) 40%, transparent), transparent); }
.st-hero { height: 222px; width: auto; max-width: 100%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 12px 16px rgba(0,0,0,.6)); animation: st-idle 6s ease-in-out infinite; }
@keyframes st-idle { 50% { translate: 0 -3px; } }
.st-holo { height: 210px; aspect-ratio: 2 / 3; display: grid; grid-template-rows: 30% 1fr; justify-items: center; }
.st-holo > span { align-self: end; width: 52%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #141a35; font: 900 36px var(--display);
  border: 2px solid color-mix(in srgb, var(--pulse) 70%, #fff); box-shadow: 0 0 18px color-mix(in srgb, var(--pulse) 60%, transparent); }
.st-holo img { width: 100%; height: 100%; object-fit: cover; }
.st-holo > i { width: 70%; height: 92%; margin-top: 4%; clip-path: polygon(30% 0, 70% 0, 100% 10%, 100% 46%, 86% 48%, 82% 30%, 76% 52%, 72% 100%, 54% 100%, 50% 62%, 46% 100%, 28% 100%, 24% 52%, 18% 30%, 14% 48%, 0 46%, 0 10%);
  background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--pulse) 40%, transparent) 0 2px, transparent 2px 5px); opacity: .8; }
.st-face { position: absolute; left: 0; bottom: 10px; width: 64px; height: 64px; border-radius: 18px; overflow: hidden; display: grid; place-items: center; background: #1d2550; border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 8px 18px rgba(0,0,0,.45); font: 900 24px var(--display); rotate: -4deg; }
.st-face img { width: 100%; height: 100%; object-fit: cover; }
.st-id { display: grid; justify-items: center; margin-top: 8px; text-align: center; }
.st-id strong { font: 900 26px/1 var(--display); letter-spacing: -.02em; text-transform: uppercase; }
.st-id small { margin-top: 4px; font: 700 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: color-mix(in srgb, var(--pulse) 55%, #fff); }
.st-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.st-tabs button { min-height: 36px; border: 0; border-radius: 10px; background: none; color: inherit; font: 700 13px var(--body); cursor: pointer; }
.st-tabs button[aria-selected="true"] { background: var(--spruce); color: var(--glacier); }
.st-body { display: grid; gap: 14px; min-width: 0; }
.st-sec { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.st-sec h3 { margin: 0; font: 800 16px var(--display); }
.st-sec h3 small { display: block; margin-top: 2px; font: 400 12.5px var(--body); color: var(--spruce-2); }
.st-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-row .upload-btn { margin-top: 0; }
.upload-btn.is-disabled { opacity: .5; pointer-events: none; }
.st-opts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.st-opts > span { font: 700 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--spruce-2); }
.st-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.st-chip { flex: none; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: inherit; font: 600 13px var(--body); cursor: pointer; }
.st-chip[aria-checked="true"] { background: var(--pulse); border-color: var(--pulse); color: #fff; }
.st-describe { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.st-describe[hidden], .st-upmode[hidden] { display: none; }
.st-describe textarea { width: 100%; min-height: 64px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--glacier); color: inherit; font: inherit; resize: vertical; }
.st-upmode { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--pulse) 10%, transparent); }
.st-upmode > span { width: 100%; font-weight: 700; font-size: 14px; }
.st-busy { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--paper); border: 1px dashed var(--pulse); font-weight: 600; }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.st-cand { padding: 0; border: 2px solid transparent; border-radius: 14px; overflow: hidden; background: #0d1124; cursor: pointer; aspect-ratio: 1; }
.st-grid.is-hero .st-cand { aspect-ratio: 2 / 3; background: radial-gradient(70% 50% at 50% 100%, color-mix(in srgb, var(--pulse) 35%, #0d1124), #0d1124); }
.st-cand img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-grid.is-hero .st-cand img { object-fit: contain; object-position: 50% 100%; }
.st-cand[aria-pressed="true"] { border-color: var(--pulse); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pulse) 30%, transparent); }
.st-remove { font-size: 13px; }
.st-save2 { margin-top: 14px; }
.st-voices { display: grid; gap: 8px; }
.st-voice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: stretch; }
.st-play { width: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: inherit; font-size: 15px; cursor: pointer; }
.st-play.is-playing { background: var(--pulse); color: #fff; border-color: var(--pulse); animation: st-pulse 1s ease-in-out infinite; }
@keyframes st-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--pulse) 25%, transparent); } }
.st-vpick { display: grid; justify-items: start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: inherit; text-align: left; cursor: pointer; }
.st-vpick small { color: var(--spruce-2); }
.st-voice.is-on .st-vpick { border-color: var(--pulse); box-shadow: inset 4px 0 0 var(--pulse); }
.st-mem { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 4px; }
@media (prefers-reduced-motion: reduce) { .st-hero, .st-play.is-playing { animation: none; } }

/* lineup = Choose Your Coach (1.17) */
.tm-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; }
.tm-links .mono { font-size: 11px; opacity: .75; margin-left: 4px; }
.tm .btn-ghost [data-icon] svg { width: 16px; height: 16px; vertical-align: -3px; }
.tm.is-lock .tm-fig.is-front { animation: tm-flash .4s ease-out; }

/* ── 1.17 Your Dr.: the invite-only upgrade (a gag: nothing is charged) ── */
.dr { display: grid; justify-items: center; gap: 10px; max-width: 420px; margin: 8px auto 0; text-align: center; }
.dr-seal { position: relative; width: 112px; height: 112px; display: grid; place-items: center; margin-bottom: 4px; }
.dr-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, var(--gold), #fff3cf, var(--gold), #9c6e1c, var(--gold)); animation: dr-spin 12s linear infinite;
  -webkit-mask: radial-gradient(closest-side, transparent 84%, #000 86%); mask: radial-gradient(closest-side, transparent 84%, #000 86%); }
@keyframes dr-spin { to { rotate: 360deg; } }
.dr-steth { width: 80px; height: 80px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #22463f, #0c201c); color: #f7ecd4; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 14px 30px -12px rgba(16,48,43,.6); }
.dr-steth svg { width: 40px; height: 40px; stroke: currentColor; }
.dr-lock { position: absolute; right: 4px; bottom: 6px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #3b2600; border: 3px solid var(--glacier); }
.dr-lock svg { width: 16px; height: 16px; stroke: currentColor; }
.dr-kicker { margin: 0; font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.dr-title { margin: 0; font-size: clamp(34px, 10vw, 48px); line-height: .95; letter-spacing: -.03em; }
.dr-pitch { margin: 0; max-width: 34ch; color: var(--spruce-2); }
.dr-ticket { position: relative; width: 100%; display: grid; gap: 8px; margin-top: 6px; padding: 18px 20px; border-radius: 18px; text-align: left; color: #fff8e6;
  background: linear-gradient(135deg, #142f2a, #0b1b18); box-shadow: 0 18px 36px -20px rgba(16,48,43,.7), inset 0 0 0 1px rgba(217,164,65,.5); }
.dr-ticket::before, .dr-ticket::after { content: ""; position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--glacier); }
.dr-ticket::before { left: -9px; } .dr-ticket::after { right: -9px; }
.dr-ticket-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dr-ticket-row:first-child { padding-bottom: 10px; border-bottom: 1px dashed rgba(217,164,65,.45); font-weight: 700; }
.dr-price { font: 900 34px/1 var(--display); letter-spacing: -.02em; background: linear-gradient(180deg, #fff6d8, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dr-small { font-size: 13px; color: #cdbf9c; }
.dr-small span:last-child { color: #fff8e6; font-weight: 600; }
.dr-offer { margin: 6px 0 0; font: 800 17px/1.3 var(--display); }
.dr-go { margin-top: 4px; }
.dr-status { margin: 0; }
.dr-fine { margin: 6px 0 0; max-width: 38ch; font-size: 12px; color: var(--spruce-2); }
@media (prefers-reduced-motion: reduce) { .dr-ring { animation: none; } }

/* ── 1.19 Soundtrack: the Sound card on You ── */
.snd-now { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; margin: 10px 0 4px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--pulse) 10%, var(--paper)); border: 1px solid var(--line); }
.snd-now strong { display: block; }
.snd-now small { display: block; opacity: .7; font-size: 12.5px; }
.snd-eq { display: flex; align-items: flex-end; gap: 3px; width: 22px; height: 20px; }
.snd-eq i { flex: 1; height: 30%; border-radius: 2px; background: var(--pulse); opacity: .45; }
.snd-now.is-on .snd-eq i { opacity: 1; animation: snd-eq .9s ease-in-out infinite alternate; }
.snd-now.is-on .snd-eq i:nth-child(2) { animation-duration: .7s; animation-delay: -.2s; }
.snd-now.is-on .snd-eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: -.5s; }
.snd-now.is-on .snd-eq i:nth-child(4) { animation-duration: .8s; animation-delay: -.3s; }
@keyframes snd-eq { from { height: 20%; } to { height: 100%; } }
.snd-vol input[type="range"] { width: 100%; accent-color: var(--pulse); }
@media (prefers-reduced-motion: reduce) { .snd-now.is-on .snd-eq i { animation: none; height: 70%; } }
.st-aicut { justify-self: center; font-size: 13px; margin-top: 6px; }

/* 1.20: the "new home" banner on the old address */
.move-bar { position: fixed; left: 50%; top: calc(8px + var(--safe-t)); transform: translateX(-50%); z-index: 95; width: min(560px, calc(100vw - 24px)); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 16px; background: var(--spruce); color: var(--glacier); box-shadow: 0 12px 30px -12px rgba(0,0,0,.45); font-size: 14px; }
.move-bar .btn-primary { background: var(--glacier); color: var(--spruce); flex: none; }

/* 1.21 Voice notes */
.chart-top .vn-btn[disabled] { opacity: .7; cursor: progress; }
.vn-bubble { display: grid; gap: 8px; min-width: min(260px, 70vw); }
.vn-kicker { margin: 0; font-size: 11px; letter-spacing: .04em; opacity: .75; }
.voice-btn.vn-card { justify-content: flex-start; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 16px; font: 700 13px var(--body); }
.vn-card .vn-play { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); flex: none; }
.vn-card .vn-play svg { width: 16px; height: 16px; stroke: #fff; fill: #fff; }
.vn-card.is-playing .vn-play { background: #fff; }
.vn-card.is-playing .vn-play svg { stroke: var(--teal); fill: var(--teal); }
.vn-wave { display: inline-flex; align-items: center; gap: 3px; height: 22px; flex: 1; }
.vn-wave i { display: block; width: 3px; height: var(--h); border-radius: 2px; background: currentColor; opacity: .55; }
.vn-card.is-playing .vn-wave i { animation: vn-bounce .9s ease-in-out infinite; animation-delay: calc(var(--h) * 37ms); opacity: .9; }
@keyframes vn-bounce { 50% { transform: scaleY(.45); } }
.vn-words summary { cursor: pointer; font-size: 12px; opacity: .7; }
.vn-words p { margin: 6px 0 0; line-height: 1.45; }
.vn-row { align-items: center; }
.vn-row > span { display: grid; gap: 2px; }
.vn-row small { opacity: .7; font-size: 12px; }
.vn-time[hidden] { display: none; }
.vn-circle { color: var(--teal); }
@media (prefers-reduced-motion: reduce) { .vn-card.is-playing .vn-wave i { animation: none; } }
.st-fish { display: grid; gap: 8px; padding: 12px; margin-bottom: 12px; border-radius: 14px; border: 1px solid var(--pulse); background: color-mix(in srgb, var(--pulse) 7%, transparent); }
.st-fish-k { margin: 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--pulse); }
.st-fish-row { display: flex; gap: 8px; flex-wrap: wrap; }
.st-fish input { font-family: var(--mono); font-size: 13px; }
.fm-tag.fm-circle { background: color-mix(in srgb, var(--pulse) 14%, transparent); color: var(--pulse); }
.fm-circle-sec h4 { color: var(--pulse); }
.chart-top .vn-btn { white-space: nowrap; flex: none; }
.st-engine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--pulse) 10%, transparent); }
.st-engine button { min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: inherit; font: 600 13px var(--body); cursor: pointer; }
.st-engine button[aria-checked="true"] { background: var(--pulse); color: #fff; }
.st-engine button:disabled { opacity: .4; cursor: not-allowed; }
.st-engine button:focus-visible { outline: 2px solid var(--pulse); outline-offset: 2px; }

/* 1.22 Fine-tune and coach sharing */
.st-tune { margin: 6px 0 12px; border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; }
.st-tune[open] { padding-bottom: 12px; }
.st-tune summary { cursor: pointer; padding: 12px 0; font-weight: 700; list-style: none; display: flex; align-items: baseline; gap: 8px; }
.st-tune summary::-webkit-details-marker { display: none; }
.st-tune summary::after { content: "▾"; margin-left: auto; opacity: .6; transition: transform .2s; }
.st-tune[open] summary::after { transform: rotate(180deg); }
.st-tune summary small { font-weight: 400; opacity: .65; }
.st-sliders { display: grid; gap: 10px; margin-bottom: 12px; }
.st-slider { display: grid; gap: 2px; }
.st-sl-k { font-size: 13px; font-weight: 600; }
.st-slider.is-tuned .st-sl-k { color: var(--pulse); }
.st-sl-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; gap: 8px; }
.st-sl-row small { font-size: 11px; opacity: .7; }
.st-sl-row small:last-child { text-align: right; }
.st-sl-row input[type=range] { width: 100%; accent-color: var(--pulse); }
.st-share { margin: 4px 0 12px; }
.st-share.is-open { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--pulse); background: color-mix(in srgb, var(--pulse) 7%, transparent); }
.st-share-list { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-shares { display: grid; gap: 8px; margin-bottom: 12px; }
.rs-share { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--pulse); background: color-mix(in srgb, var(--pulse) 6%, transparent); }
.rs-share .rs-face { width: 48px; height: 48px; }
.rs-share small { display: block; opacity: .75; }
.rs-share-acts { grid-column: 1 / -1; display: flex; gap: 8px; }

/* 1.23 Bio: the "Good for" line, the quick card and the Bio page */
.stack-wrap, .ar-cell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-width: 0; align-content: start; }
.ar-cell > .ar-card { width: 100%; min-width: 0; }
.bio-slot:empty { display: none; }
.bio-chip { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; min-height: 32px; margin-top: -6px; padding: 10px 12px 6px; border: 0; border-radius: 0 0 var(--r-md) var(--r-md);
  background: color-mix(in srgb, var(--teal) 9%, var(--paper)); color: var(--spruce, inherit); font: 500 12px var(--body); text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: var(--shadow); }
.bio-chip:focus-visible, .bio-open:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.bio-chip-k { font-weight: 700; color: var(--teal); }
.bio-chip-i { flex: none; width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--teal); color: #fff; font: 700 10px/1 Georgia, serif; font-style: italic; }
.ar-cell .bio-chip { margin-top: -8px; padding-top: 12px; font-size: 11px; }
.bio-open { display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 10px; padding: 8px 12px; border: 1px solid var(--teal); border-radius: 999px; background: transparent; color: var(--teal); font: 600 13px var(--body); cursor: pointer; }
.bio-open[hidden] { display: none; }
.bio-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.bio-tags span { padding: 4px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font: 600 12px var(--body); }
.bio-peek-sum { margin: 0 0 8px; line-height: 1.45; font-size: 15px; }
.bio-fine { margin: 6px 0; font-size: 11.5px; line-height: 1.4; opacity: .7; }
.bio-page .sheet-inner { max-width: 640px; }
.bio-kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }
.bio-disclaimer { margin: 8px 0 14px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--coral, #e0745b) 10%, transparent); border-left: 3px solid var(--coral, #e0745b); font-size: 12.5px; line-height: 1.45; }
.bio-sec { margin: 0 0 18px; }
.bio-sec h3 { margin: 0 0 6px; font-size: 15px; }
.bio-sec p { margin: 0; line-height: 1.5; }
.bio-bens { display: grid; gap: 10px; }
.bio-ben { padding: 10px 12px; border-radius: 12px; background: var(--glacier, color-mix(in srgb, var(--teal) 6%, transparent)); }
.bio-ben-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.bio-ben p { font-size: 14px; }
.bio-ev { flex: none; padding: 2px 8px; border-radius: 999px; font: 700 10.5px var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.ev-strong { background: #1f7a4d; color: #fff; }
.ev-moderate { background: #3f8f9a; color: #fff; }
.ev-early { background: #d9a441; color: #2b2010; }
.ev-traditional { background: #8a7aa8; color: #fff; }
.bio-parts { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 14px; }
.bio-parts dt { font-weight: 700; }
.bio-parts dd { margin: 0; }
.bio-list { margin: 0; padding-left: 18px; line-height: 1.5; font-size: 14px; }
.bio-warn h3 { color: var(--coral, #c2553d); }
.bio-src { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; word-break: break-word; }
.bio-src a { color: var(--teal); }
.bio-wait { display: grid; justify-items: center; gap: 10px; padding: 24px 8px; text-align: center; }
#bioNote { width: 100%; box-sizing: border-box; margin-bottom: 8px; }

/* ── 1.24 Arcade: PLAYER 1, lock-in, Select Your Mission, MISSION COMPLETE ── */
.sp-p1 { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px; width: fit-content; max-width: 92%; margin: 16px auto 0; padding: 8px 18px; border-radius: 999px; opacity: 0;
  background: var(--spruce, #0f2b2a); color: #fff; font: 700 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; transform: scale(2.4); }
.sp-p1-k { color: color-mix(in srgb, var(--pulse) 70%, #fff); }
.sp-p1 strong { font-family: var(--display); font-size: 15px; letter-spacing: .02em; }
.sp-p1-go { flex-basis: 100%; text-align: center; font-size: 11px; letter-spacing: .3em; opacity: .8; }
.splash.is-playing .sp-p1 { animation: arc-slam .42s cubic-bezier(.2,1.4,.5,1) 1.95s forwards; }
.splash.is-playing .sp-p1-go { animation: arc-blink 1s steps(2) 2.4s infinite; }
.splash.is-still .sp-p1 { opacity: 1; transform: none; }
@keyframes arc-slam { 0% { opacity: 0; transform: scale(2.4); } 60% { opacity: 1; transform: scale(.94); } 100% { opacity: 1; transform: scale(1); } }
@keyframes arc-blink { 50% { opacity: .15; } }

.tm-locked { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; text-align: center; pointer-events: none; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 60%); animation: arc-flashbg .9s ease-out forwards; }
.tm-locked span { font: 900 clamp(36px, 12vw, 72px)/1 var(--display); text-transform: uppercase; color: #fff; text-shadow: 0 0 24px var(--pulse); animation: arc-slam .4s cubic-bezier(.2,1.4,.5,1) both; }
.tm-locked b { margin-top: 6px; font: 800 14px var(--mono); letter-spacing: .5em; text-transform: uppercase; color: color-mix(in srgb, var(--pulse) 70%, #fff); animation: arc-slam .4s cubic-bezier(.2,1.4,.5,1) .12s both; }
@keyframes arc-flashbg { 0% { background-color: rgba(255,255,255,.55); } 25% { background-color: transparent; } }

.arc { position: fixed; inset: 0; z-index: 93; overflow: auto; display: grid; grid-template-rows: auto auto auto 1fr auto; align-content: start; gap: 10px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px)); color: #f3f5ff;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--pulse) 38%, #0b0e1c), #07080f 70%); opacity: 0; transition: opacity .3s ease; }
.arc.is-in { opacity: 1; }
.arc.is-out { opacity: 0; pointer-events: none; transition: opacity .35s ease, transform .35s ease; transform: scale(1.04); }
.arc > * { position: relative; max-width: 620px; width: 100%; justify-self: center; }
.arc-bg { position: fixed; inset: 0; pointer-events: none; max-width: none; }
.arc-grid { position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%; transform: perspective(420px) rotateX(62deg); transform-origin: 50% 100%;
  background-image: linear-gradient(color-mix(in srgb, var(--pulse) 45%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--pulse) 45%, transparent) 1px, transparent 1px);
  background-size: 44px 44px; opacity: .35; animation: arc-run 2.4s linear infinite; mask-image: linear-gradient(to top, #000 20%, transparent); -webkit-mask-image: linear-gradient(to top, #000 20%, transparent); }
@keyframes arc-run { to { background-position: 0 44px, 0 0; } }
.arc-glow { position: absolute; left: 50%; top: 18%; width: 80vmin; height: 80vmin; margin-left: -40vmin; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--pulse) 40%, transparent), transparent 65%); filter: blur(20px); }
.arc-scan { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px); }
.arc-top { display: flex; align-items: center; gap: 10px; font: 700 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.arc-p1 b { padding: 2px 6px; margin-right: 4px; border-radius: 4px; background: var(--pulse); color: #0b0e1c; }
.arc-stats { opacity: .8; }
.arc-x { margin-left: auto; min-height: 32px; padding: 0 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; background: rgba(255,255,255,.06); color: #fff; font: 600 12px var(--body); cursor: pointer; }
.arc-coach { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: end; gap: 12px; min-height: 150px; }
.arc-fig { position: relative; height: 170px; display: grid; place-items: end center; }
.arc-fig::after { content: ""; position: absolute; bottom: -4px; left: 8%; right: 8%; height: 14px; border-radius: 50%; background: radial-gradient(color-mix(in srgb, var(--pulse) 70%, transparent), transparent 70%); }
.arc-hero { max-height: 170px; max-width: 112px; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(0,0,0,.5)); }
.arc-face { width: 96px; height: 96px; border-radius: 22px; object-fit: cover; box-shadow: 0 0 0 3px var(--pulse), 0 10px 30px rgba(0,0,0,.5); }
.arc-init { width: 96px; height: 96px; border-radius: 22px; display: grid; place-items: center; background: var(--pulse); color: #0b0e1c; font: 900 44px var(--display); }
.arc-bubble { position: relative; align-self: center; padding: 12px 40px 12px 14px; border-radius: 18px 18px 18px 4px; background: #fff; color: #0b0e1c; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.arc-name { display: block; font: 800 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--pulse) 70%, #000); }
.arc-bubble p { margin: 2px 0 0; min-height: 1.3em; font: 800 clamp(19px, 5.4vw, 24px)/1.2 var(--display); }
.arc-hear { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--pulse) 18%, #fff); cursor: pointer; font-size: 13px; }
.arc-title { margin: 8px 0 2px; font: 900 clamp(26px, 8vw, 40px)/.95 var(--display); text-transform: uppercase; letter-spacing: -.01em; text-shadow: 0 0 24px color-mix(in srgb, var(--pulse) 60%, transparent); }
.arc-title span { display: block; font-size: .42em; letter-spacing: .4em; color: color-mix(in srgb, var(--pulse) 65%, #fff); }
.arc-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; perspective: 800px; }
.arc-tile { position: relative; display: grid; gap: 3px; align-content: start; min-height: 112px; padding: 14px 12px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; text-align: left; cursor: pointer; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.03)); color: #fff; font: inherit; box-shadow: 0 8px 24px rgba(0,0,0,.3);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.arc-tile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 76px; }
.arc-tile:hover, .arc-tile:focus-visible { transform: translateY(-3px); border-color: var(--pulse); box-shadow: 0 0 0 2px var(--pulse), 0 12px 30px rgba(0,0,0,.4); outline: none; }
.arc-tile:active { transform: scale(.97); }
.arc-ico { font-size: 28px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.arc-t { font: 800 17px/1.15 var(--display); }
.arc-s { font-size: 12.5px; line-height: 1.3; opacity: .82; }
.arc-xp { justify-self: start; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.12); font: 700 11px var(--mono); color: #ffe27a; }
.arc-now { position: absolute; top: 10px; right: 10px; padding: 3px 8px; border-radius: 999px; background: var(--pulse); color: #0b0e1c; font: 800 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.arc-tile.is-now { border-color: var(--pulse); background: linear-gradient(160deg, color-mix(in srgb, var(--pulse) 38%, transparent), rgba(255,255,255,.04)); animation: arc-pulse 1.6s ease-in-out infinite; }
@keyframes arc-pulse { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--pulse) 70%, transparent), 0 0 34px color-mix(in srgb, var(--pulse) 60%, transparent); } }
.arc-tile.is-done { opacity: .62; }
.arc-tile.is-done .arc-s { color: #9ef0c0; opacity: 1; }
.arc-foot { display: flex; justify-content: center; }
.arc .link-btn { color: color-mix(in srgb, var(--pulse) 55%, #fff); }
/* The entrance: the coach steps in, the question types, the tiles flip up one by one. */
.arc.is-intro .arc-fig { animation: arc-step .6s cubic-bezier(.2,1.2,.4,1) .1s both; }
.arc.is-intro .arc-bubble { animation: arc-pop .4s cubic-bezier(.2,1.4,.5,1) .35s both; }
.arc.is-intro .arc-title { animation: arc-slam .45s cubic-bezier(.2,1.4,.5,1) .55s both; }
.arc.is-intro .arc-tile { animation: arc-flip .5s cubic-bezier(.2,1.2,.4,1) both; animation-delay: calc(.7s + var(--d) * 90ms); }
.arc.is-intro .arc-tile.is-now { animation: arc-flip .5s cubic-bezier(.2,1.2,.4,1) both, arc-pulse 1.6s ease-in-out infinite; animation-delay: calc(.7s + var(--d) * 90ms), 1.4s; }
@keyframes arc-step { from { opacity: 0; transform: translateX(-60px) scale(.9); } }
@keyframes arc-pop { from { opacity: 0; transform: scale(.6); transform-origin: 0 100%; } }
@keyframes arc-flip { from { opacity: 0; transform: rotateX(-80deg) translateY(30px); } }
.arc.is-go .arc-tile:not(.is-picked) { opacity: .25; transform: scale(.96); transition: all .25s ease; }
.arc-tile.is-picked { animation: arc-pick .5s ease-out forwards !important; z-index: 2; }
@keyframes arc-pick { 30% { transform: scale(1.06); box-shadow: 0 0 0 4px #fff, 0 0 60px var(--pulse); } 100% { transform: scale(1.12); opacity: 0; } }

.arc-done { position: fixed; inset: 0; z-index: 94; display: grid; place-items: center; padding: 24px; color: #fff; text-align: center; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--pulse) 55%, #0b0e1c), #06070d 75%); opacity: 0; transition: opacity .25s ease; }
.arc-done.is-in { opacity: 1; }
.arc-done-in { position: relative; display: grid; gap: 10px; justify-items: center; max-width: 520px; }
.arc-done-k { margin: 0; font: 800 12px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: color-mix(in srgb, var(--pulse) 60%, #fff); }
.arc-done-t { margin: 0; font: 900 clamp(42px, 14vw, 84px)/.9 var(--display); letter-spacing: -.02em; }
.arc-done-t span { display: inline-block; animation: arc-letter .5s cubic-bezier(.2,1.6,.4,1) both; animation-delay: calc(var(--k) * 45ms + .1s); text-shadow: 0 4px 0 color-mix(in srgb, var(--pulse) 70%, #000), 0 0 30px var(--pulse); }
@keyframes arc-letter { from { opacity: 0; transform: translateY(-60px) scale(1.6) rotate(-8deg); } }
.arc-done-xp { margin: 0; display: flex; gap: 14px; align-items: baseline; justify-content: center; flex-wrap: wrap; font: 800 22px var(--mono); color: #ffe27a; animation: arc-slam .4s cubic-bezier(.2,1.4,.5,1) .75s both; }
.arc-done-xp span { font-size: 14px; color: #fff; }
.arc-done-say { margin: 0; max-width: 34ch; font: 600 16px/1.4 var(--body); opacity: 0; animation: sp-fade .5s ease-out 1s forwards; }
.arc-done-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; opacity: 0; animation: sp-fade .4s ease-out 1.2s forwards; }
.arc-done .btn-primary { background: #fff; color: #0b0e1c; }
.arc-done .btn-ghost { color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.4); }
.arc-burst { position: absolute; left: 50%; top: 42%; width: 0; height: 0; }
.arc-burst i { position: absolute; width: 10px; height: 26px; border-radius: 4px; background: var(--pulse); transform: rotate(calc(var(--k) * 25.7deg)) translateY(0); opacity: 0;
  animation: arc-ray .9s cubic-bezier(.1,.8,.3,1) .15s forwards; }
.arc-burst i:nth-child(3n) { background: #ffe27a; } .arc-burst i:nth-child(3n+1) { background: #fff; }
@keyframes arc-ray { 0% { opacity: 1; transform: rotate(calc(var(--k) * 25.7deg)) translateY(0); } 100% { opacity: 0; transform: rotate(calc(var(--k) * 25.7deg)) translateY(-46vmin); } }
.arc-pref select { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .arc-grid, .arc-tile.is-now, .arc-done-t span, .arc-burst i { animation: none !important; }
  .arc.is-intro * { animation: none !important; }
  .arc-done-say, .arc-done-acts, .arc-done-xp { animation: none; opacity: 1; }
}
