/* Pulse — calm, quiet UI; heart-rate zone colours are the only strong accents. */
:root {
  color-scheme: light dark;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #efefec;
  --text-1: #1d1d1f;
  --text-2: #6b6b70;
  --text-3: #9a9aa0;
  --line: rgba(29, 29, 31, 0.09);
  --line-strong: rgba(29, 29, 31, 0.16);
  --accent: #1d1d1f;
  --on-accent: #f6f6f4;
  --z1: #7f93b8;
  --z2: #2e9e6b;
  --z3: #d9a21b;
  --z4: #ee6a1f;
  --z5: #d8343c;
  --zc: var(--z1);
  --ok: #2e9e6b;
  --warn: #ee6a1f;
  --danger: #d8343c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 30px rgba(0, 0, 0, 0.05);
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #1a1b1e;
    --surface-2: #232428;
    --text-1: #f3f3f5;
    --text-2: #a1a1a8;
    --text-3: #6f6f76;
    --line: rgba(243, 243, 245, 0.08);
    --line-strong: rgba(243, 243, 245, 0.16);
    --accent: #f3f3f5;
    --on-accent: #111214;
    --z1: #93a6c8;
    --z2: #45c486;
    --z3: #e9b93a;
    --z4: #ff8a45;
    --z5: #f25c62;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font: 400 15px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
[hidden] { display: none !important; }
a { color: inherit; }
h1 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 500; letter-spacing: -0.02em; margin: 0 0 6px; line-height: 1.15; }
h2 { font-size: 15px; font-weight: 500; margin: 0 0 12px; }
p { margin: 0 0 10px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); margin-bottom: 4px; }
.lede { color: var(--text-2); font-size: 17px; }
.num, .tile-value, .bpm, .timer, .ls-value { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.mt { margin-top: 20px; }
.spacer { flex: 1; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: calc(10px + var(--safe-t)) 18px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; font-size: 17px; }
.brand svg { color: var(--z5); }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 14px; }
.nav a.active { background: var(--surface-2); color: var(--text-1); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
body.phone .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
body.phone .nav a { padding: 6px 9px; }
body.phone #layout-toggle { display: none; }
body[data-screen="live"] .topbar, body[data-screen="connecting"] .topbar { display: none; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px calc(40px + var(--safe-b)); }
body.desk main { padding: 26px 32px 48px; }
body[data-screen="live"].desk main { max-width: none; }

/* ---------- primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--text-1); }
.chip-quiet { background: transparent; color: var(--text-2); }
.chip.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); }
.chip.sync-error { color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok { background: var(--ok); }
.dot.pulse { background: var(--warn); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-1);
  font: 500 15px/1 var(--sans); padding: 12px 18px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform 0.08s ease, background 0.2s ease; -webkit-tap-highlight-color: transparent; min-height: 44px;
}
.btn:active { transform: scale(0.97); }
.btn.small { padding: 8px 14px; font-size: 13px; min-height: 34px; }
.btn.big { padding: 18px 22px; font-size: 18px; min-height: 60px; border-radius: 20px; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn.danger.armed { background: var(--danger); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.btn-row.center { justify-content: center; }
.btn-row.tight { margin: 0; gap: 4px; }
.notice { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.hint { color: var(--text-2); font-size: 14px; }
.hint.emph { color: var(--warn); }
.link { color: var(--text-2); font-size: 14px; }

.banner { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--line); background: var(--surface); }
.banner.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.banner.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--z2); }

/* ---------- 1. start ---------- */
.start-wrap { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
body.desk .start-wrap { max-width: 640px; padding-top: 4vh; }
.last-card { padding: 0; }
.last-card > *:not(a) { display: block; padding: 0 16px; }
.last-card > .eyebrow { padding-top: 14px; }
.last-card > .last-main:last-child { padding-bottom: 14px; }
.last-link { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; text-decoration: none; }
.last-main { font-size: 16px; font-weight: 500; }
.last-note { color: var(--text-2); font-size: 14px; }
.start-btn {
  appearance: none; border: 0; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 132px; border-radius: 28px; background: var(--accent); color: var(--on-accent);
  font: 500 26px/1 var(--sans); letter-spacing: -0.01em; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  -webkit-tap-highlight-color: transparent; transition: transform 0.1s ease;
}
.start-btn svg { color: var(--z5); }
.start-btn:active { transform: scale(0.98); }
body.desk .start-btn { min-height: 170px; font-size: 32px; }
.type-label { margin-bottom: -8px; }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-1); font: 500 14px/1 var(--sans); padding: 10px 14px; border-radius: 999px; cursor: pointer; min-height: 40px; }
.chip-btn.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.demo-check { margin-top: 6px; }

/* ---------- 2. connecting ---------- */
.connect-wrap { max-width: 460px; margin: 0 auto; padding-top: 8vh; text-align: center; }
.pulse-ring { position: relative; width: 140px; height: 140px; margin: 0 auto 22px; display: grid; place-items: center; color: var(--z5); }
.pulse-ring::before, .pulse-ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--z5); opacity: 0; animation: ring 2s ease-out infinite; }
.pulse-ring::after { animation-delay: 1s; }
.pulse-ring svg { width: 70px; height: 70px; animation: beat 0.9s ease-in-out infinite; }
@keyframes ring { 0% { transform: scale(0.55); opacity: 0.7; } 100% { transform: scale(1.15); opacity: 0; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.12); } 40% { transform: scale(0.98); } }
.steps { list-style: none; padding: 0; margin: 20px auto; text-align: left; display: inline-flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 16px; }
.step-icon { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; position: relative; }
.steps li.active { color: var(--text-1); }
.steps li.active .step-icon { border-color: var(--z2); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.steps li.done { color: var(--text-1); }
.steps li.done .step-icon { background: var(--z2); border-color: var(--z2); }
.steps li.done .step-icon::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 3. live ---------- */
.live-grid { display: grid; gap: 14px; }
.live-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: calc(4px + var(--safe-t)); }
.live-status { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 4px; }
.live-type { font-size: 14px; }
.bpm-wrap { display: flex; align-items: baseline; gap: 8px; line-height: 0.9; }
.bpm { font-size: clamp(96px, 34vw, 170px); font-weight: 500; letter-spacing: -0.05em; color: var(--zc); transition: color 0.6s ease; }
.bpm-unit { font-size: 20px; color: var(--text-2); }
.zone-pill { display: inline-block; padding: 7px 16px; border-radius: 999px; background: color-mix(in srgb, var(--zc) 16%, transparent); color: var(--zc); font-weight: 600; font-size: 16px; transition: all 0.6s ease; }
.live-pct { font-size: 13px; min-height: 18px; }
.timer-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 4px; }
.timer-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.timer { font-size: clamp(34px, 10vw, 48px); font-weight: 500; letter-spacing: -0.02em; font-family: var(--mono); }
.paused-tag { display: none; color: var(--warn); font-weight: 600; font-size: 14px; }
body.paused .paused-tag { display: block; }
body.paused .timer { color: var(--text-3); }
.chart { width: 100%; height: 200px; display: block; }
.chart-live { height: 190px; }
.chart-tall { height: 300px; }
.chart-card { padding: 10px 8px 6px; }
.live-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.live-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 8px; text-align: center; }
.ls-label { display: block; font-size: 12px; color: var(--text-2); }
.ls-value { display: block; font-size: 22px; font-weight: 500; }
.zonebar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.zonebar span { transition: width 0.6s ease; }
.zonebar.big { height: 18px; margin-bottom: 14px; }
.zone-legend { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; }
.zone-legend > div { display: grid; grid-template-columns: 12px 1fr auto 52px; gap: 8px; align-items: center; }
.zl-range { color: var(--text-3); font-size: 12px; }
.zl-time { text-align: right; font-variant-numeric: tabular-nums; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.zone-legend .sw { margin: 0; }
.live-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 16px; position: sticky; bottom: calc(8px + var(--safe-b)); }
.live-controls .btn { box-shadow: var(--shadow); }

/* phone live: fit one screen without scrolling */
body.phone .bpm { font-size: clamp(88px, 30vw, 150px); }
body.phone .timer { font-size: 38px; }
body.phone .live-hero { gap: 2px; }
body.phone .chart-live { height: 150px; }
body.phone .live-grid { gap: 10px; }
body.phone .live-stats .ls-value { font-size: 20px; }
body.phone .live-stats > div { padding: 8px 4px; }
body.phone .zone-legend { grid-template-columns: repeat(5, 1fr); gap: 4px; font-size: 11px; margin-top: 8px; }
body.phone .zone-legend > div { grid-template-columns: auto 1fr; gap: 4px; text-align: left; }
body.phone .zone-legend .zl-full { display: none; }
body.phone .zone-legend .zl-range { display: none; }
body.phone .zone-legend .zl-time { grid-column: 1 / -1; text-align: left; font-size: 13px; }
body.phone #screen-live .card { padding: 10px 12px; }
body.phone #screen-live .chart-card { padding: 6px 4px 2px; }
body.phone .live-controls { margin-top: 10px; gap: 8px; }
body.phone .live-controls .btn.big { font-size: 17px; padding: 14px 10px; min-height: 56px; }
body.phone .tile { padding: 12px 14px; }
body.phone .tile-value { font-size: 26px; }

/* desk live: readable from ~6 ft */
body.desk .live-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; min-height: calc(100dvh - 190px); gap: 32px; }
body.desk .live-hero { justify-content: center; }
body.desk .bpm { font-size: min(36vh, 22vw); }
body.desk .bpm-unit { font-size: 3vh; }
body.desk .zone-pill { font-size: 3.4vh; padding: 1vh 2.6vh; }
body.desk .timer { font-size: 9vh; }
body.desk .timer-label, body.desk .live-pct, body.desk .live-type { font-size: 2vh; }
body.desk .chart-live { height: 38vh; }
body.desk .ls-label { font-size: 1.8vh; }
body.desk .ls-value { font-size: 5vh; }
body.desk .zonebar { height: 2.4vh; }
body.desk .zone-legend { font-size: 2vh; grid-template-columns: repeat(5, 1fr); }
body.desk .zone-legend > div { grid-template-columns: auto 1fr; white-space: nowrap; min-width: 0; }
body.desk .zone-legend .zl-name { overflow: hidden; text-overflow: ellipsis; }
body.desk .zone-legend .zl-range { display: none; }
body.desk .zone-legend .zl-time { grid-column: 1 / -1; text-align: left; font-size: 2.6vh; }
body.desk .live-controls { max-width: 900px; margin: 18px auto 0; }
body.desk .live-status .chip { font-size: 1.8vh; }

/* ---------- 4. notes ---------- */
.notes-wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.mic-btn { appearance: none; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 72px; border-radius: 22px; border: 1px dashed var(--line-strong); background: var(--surface); color: var(--text-1); font: 500 18px/1 var(--sans); cursor: pointer; }
.mic-btn svg { color: var(--z5); }
.mic-btn.on { border-style: solid; border-color: var(--z5); background: color-mix(in srgb, var(--z5) 8%, var(--surface)); }
textarea { width: 100%; font: 400 16px/1.5 var(--sans); color: var(--text-1); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 14px; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--z2) 60%, transparent); outline-offset: 1px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { display: inline-block; padding: 6px 11px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 500; }
.pchip-exercise { background: color-mix(in srgb, var(--z2) 14%, transparent); }
.pchip-effort, .pchip-energy { background: color-mix(in srgb, var(--z3) 18%, transparent); }
.pchip-sleep { background: color-mix(in srgb, var(--z1) 20%, transparent); }
.pchip-flag { background: color-mix(in srgb, var(--z4) 16%, transparent); color: var(--z4); }
.picked .eyebrow { margin-bottom: 10px; }

/* ---------- 5/6. session + dashboard ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
select, input[type="text"], input[type="number"], input[type="url"], input[type="email"], input[type="password"] {
  font: 400 15px/1.2 var(--sans); color: var(--text-1); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 10px 12px; min-height: 42px; width: 100%;
}
.head-actions select { width: auto; border-radius: 999px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 14px 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.tile-label { font-size: 13px; color: var(--text-2); }
.tile-value { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; }
.tile-unit { font-size: 12px; color: var(--text-3); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
.grid-2 > .card + .card { margin-top: 0; }
body.desk .grid-2 { grid-template-columns: 1fr 1fr; }
.zone-rows { display: grid; gap: 8px; }
.zone-row { display: grid; grid-template-columns: 12px 1fr auto 56px 44px; gap: 8px; align-items: center; font-size: 14px; }
.zone-row .sw { margin: 0; }
.zone-row .num { text-align: right; }
.notes-text { white-space: pre-wrap; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--text-2); font: 500 13px/1 var(--sans); padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text-1); box-shadow: var(--shadow); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--text-2); font-size: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--surface-2); }
.table.compact td { padding: 6px; }
.ellipsis { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.patterns ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.empty { text-align: center; padding: 28px 16px; }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* ---------- 8. settings ---------- */
.settings { display: grid; gap: 14px; max-width: 760px; }
.settings .card + .card { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; flex: 1; min-width: 120px; }
.field.grow { flex: 3; }
.field-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field-row > .btn { margin-bottom: 10px; }
.zones-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.inline { display: flex; gap: 8px; }

/* ---------- 7. coach ---------- */
.coach {
  position: fixed; z-index: 40; right: 0; top: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
  display: flex; flex-direction: column; padding: calc(14px + var(--safe-t)) 14px calc(12px + var(--safe-b));
  animation: slidein 0.22s ease-out;
}
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.coach-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.coach-title { font-weight: 500; }
.coach-ctx { margin: 10px 0; font-size: 13px; color: var(--text-2); }
.coach-ctx summary { cursor: pointer; }
.coach-ctx pre { white-space: pre-wrap; font: 400 12px/1.45 var(--mono); background: var(--surface-2); padding: 10px; border-radius: 10px; max-height: 30vh; overflow: auto; color: var(--text-1); }
.coach-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.45; }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin: 0; }
.msg ul { margin: 4px 0; padding-left: 18px; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.msg.error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.typing i { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--text-3); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; } .typing i:nth-child(3) { animation-delay: 0.4s; }
.coach-form { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.coach-form textarea { min-height: 46px; max-height: 140px; padding: 10px 12px; }
.coach-setup { padding: 10px 0; }
body.coach-open.desk main { margin-right: 440px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px);
  background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 60; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- coach workout-log status ---------- */
.coach-log-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.coach-log-status:empty { display: none; }
.coach-chip { padding: 4px 10px; font-size: 12.5px; }
.coach-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); display: inline-block; }
.coach-chip.coach-sent .dot { background: var(--ok); }
.coach-chip.coach-sending .dot, .coach-chip.coach-pending .dot { background: var(--warn); animation: blink 1s infinite; }
.coach-chip.coach-failed { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.coach-chip.coach-failed .dot { background: var(--danger); }
.coach-log-error { flex-basis: 100%; overflow-wrap: anywhere; }
.coach-takeaway .msg-body p { margin: 0 0 6px; }
.btn-link { appearance: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.warn-text { color: var(--warn); }
.msg.user.log { background: var(--surface-2); color: var(--text-1); font-size: 13px; }
.msg.user.log summary { cursor: pointer; font-weight: 500; }
.msg.user.log details div { margin-top: 6px; }
