/*
  VOICE   calm night-time dashboard, the athlete's own instrument panel
  IDEA    a recovery app at 6 am: one big ring, quiet glass tiles, colour = metric
  PICTURE concentric macro rings + sparklines, each metric keeps one hue everywhere
  COLOUR  deep indigo night, teal energy, violet protein, coral carbs, amber fat, blue steps
  TYPE    Lexend for numbers and headings, Inter for text
*/
:root {
  color-scheme: dark;
  --bg: #08071a; --bg2: #0e0c24;
  --card: rgba(255, 255, 255, 0.04); --card2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.08); --line2: rgba(255, 255, 255, 0.16);
  --ink: #f3f2fb; --mute: #a4a1c0; --dim: #6f6c8c;
  --teal: #34e0c8; --violet: #9384ff; --coral: #ff5a74; --amber: #ffb648; --pink: #ff5cb0; --blue: #4aa8ff; --green: #5ce38f;
  --kcal: var(--teal); --pro: var(--violet); --carb: var(--coral); --fat: var(--amber);
  --r: 22px; --r-sm: 14px;
  --display: "Lexend", ui-sans-serif, system-ui, sans-serif;
  --text: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; min-width: 0; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; }
body {
  font: 15px/1.5 var(--text); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(60% 40% at 10% 0%, rgba(147, 132, 255, 0.14), transparent 70%),
    radial-gradient(50% 35% at 95% 8%, rgba(52, 224, 200, 0.09), transparent 70%),
    linear-gradient(180deg, var(--bg2), var(--bg) 40%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3, .num { font-family: var(--display); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.num { font-variant-numeric: tabular-nums; }

#app { display: flex; flex-direction: column; height: 100%; max-width: 760px; margin: 0 auto; }

/* ---------- header ---------- */
.top { padding: calc(10px + var(--safe-t)) 16px 6px; }
.top-row { display: flex; align-items: center; gap: 10px; }
.hello { flex: 1; }
.hello h1 { font-size: 20px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-line { background: none; border: 0; padding: 0; color: var(--mute); font-size: 13px; display: flex; align-items: center; gap: 6px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-line::before { flex: none; }
.sync-line::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.sync-line.ok::before { background: var(--teal); }
.sync-line.err::before { background: var(--coral); }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--ink); flex: none; }
.icon-btn.sm { width: 32px; height: 36px; border: 0; background: none; font-size: 22px; color: var(--mute); }
.date-step { display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; height: 44px; padding: 0 2px; }
.date-label { background: none; border: 0; font: 500 14px var(--display); min-width: 74px; padding: 0 2px; white-space: nowrap; }
.tabs { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px; }
.tabs button { position: relative; z-index: 1; height: 36px; border: 0; background: none; color: var(--mute); font-size: 12px; letter-spacing: -0.01em; padding: 0; font-weight: 500; border-radius: 12px; }
.tabs button.on { color: var(--ink); }
.tab-ink { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 7); border-radius: 12px; background: var(--card2); border: 1px solid var(--line2); transition: transform .25s ease; }

/* ---------- pager ---------- */
.pager { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.pager::-webkit-scrollbar { display: none; }
.page > * { flex: none; }
.page { flex: 0 0 100%; height: 100%; overflow-y: auto; scroll-snap-align: start; scroll-snap-stop: always; padding: 8px 16px calc(150px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; }

/* ---------- cards ---------- */
.card { position: relative; border-radius: var(--r); padding: 16px; border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in oklab, var(--tone, transparent) 15%, transparent), transparent 60%), var(--card); }
.card.tight { padding: 12px 14px; }
.card h2 { font-size: 17px; }
.card h3 { font-size: 15px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--mute); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone, var(--mute)); flex: none; }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: color-mix(in oklab, var(--tone, var(--teal)) 16%, transparent); color: var(--tone, var(--teal)); white-space: nowrap; }
.big { font: 500 clamp(28px, 8vw, 36px)/1.05 var(--display); }
.unit { font-size: 15px; color: var(--mute); margin-left: 3px; font-family: var(--text); }
.sub { color: var(--mute); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.spark { display: block; width: 100%; height: 38px; margin-top: 10px; }
.square { aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: space-between; }
.pill { height: 36px; padding: 0 14px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill.primary { background: var(--teal); color: #04221d; border-color: transparent; }
.pill.ghost { background: none; }
.pill.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 10px; }
.empty { border: 1px dashed var(--line2); border-radius: var(--r); padding: 16px; color: var(--mute); background: none; }

/* ---------- today hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 8px 0 0; }
.rings { width: min(76vw, 300px); aspect-ratio: 1; position: relative; }
.rings svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.rings circle { fill: none; stroke-linecap: round; }
.rings .arc { transition: stroke-dashoffset .6s ease; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center .num { font-size: clamp(36px, 11vw, 50px); line-height: 1; }
.ring-center .sub { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; }
.headline { font: 500 clamp(20px, 5.4vw, 24px)/1.25 var(--display); text-align: center; text-wrap: balance; margin: 14px 4px 4px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 13px; color: var(--mute); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.macro-bars { display: grid; gap: 10px; margin-top: 12px; }
.mbar { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.mbar .track { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.mbar .fill { height: 100%; border-radius: 99px; background: var(--tone); }
.mbar .v { font-variant-numeric: tabular-nums; color: var(--mute); white-space: nowrap; }
.mbar .v b { color: var(--ink); font-weight: 500; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 10px; border-radius: 10px; background: color-mix(in oklab, var(--tone) 14%, transparent); color: var(--tone); font: 500 15px var(--display); white-space: nowrap; }
.chip small { font: 12px var(--text); color: var(--mute); }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.wday { border: 1px solid var(--line); background: none; border-radius: 12px; padding: 8px 2px; text-align: center; font-size: 12px; color: var(--mute); display: grid; gap: 6px; justify-items: center; min-height: 64px; }
.wday b { font: 500 15px var(--display); color: var(--ink); }
.wday.today { border-color: var(--teal); }
.wday.sel { background: var(--card2); }
.wday .pips { display: flex; gap: 3px; height: 6px; }
.wday .pips i { width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }

/* ---------- chat ---------- */
.msgs { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 20px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; }
.logtag { align-self: flex-end; margin: -6px 6px 2px; font-size: 12px; color: var(--muted, #9aa); letter-spacing: .02em; }
.logtag.logged { color: var(--teal); }
.logtag.pending { opacity: .7; font-style: italic; }
.logtag.inline { display: inline-block; margin: 4px 0 0; }
.msg.user { align-self: flex-end; background: var(--violet); color: #0c0830; border-bottom-right-radius: 6px; }
.msg.coach { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.typing { color: var(--mute); }
.meal-card b { white-space: nowrap; }
.meal-card { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; white-space: normal; }
.quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.quick button { flex: none; }

/* ---------- food ---------- */
.items { display: grid; gap: 8px; margin-top: 10px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); }
.item .name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .mac { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.grams { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--mute); }
.grams input { width: 64px; height: 36px; text-align: right; border-radius: 10px; border: 1px solid var(--line2); background: rgba(0, 0, 0, 0.3); padding: 0 8px; font-size: 16px; }
.x { width: 36px; height: 36px; border: 0; background: none; color: var(--dim); font-size: 18px; border-radius: 10px; }
.x:hover { color: var(--coral); }
.macro-line { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.macro-line b { font-weight: 500; }

/* ---------- training ---------- */
.day-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.day-row:first-child { border-top: 0; }
.day-row .d { text-align: center; color: var(--mute); font-size: 12px; }
.day-row .d b { display: block; font: 500 18px var(--display); color: var(--ink); }
.day-row.today .d b { color: var(--teal); }
.sess { border-radius: 12px; padding: 8px 10px; background: color-mix(in oklab, var(--tone) 10%, transparent); border-left: 3px solid var(--tone); margin-bottom: 6px; font-size: 14px; }
.sess.acc { margin-left: 14px; }
.sess.done { opacity: .55; }
.sess .parts { margin: 4px 0 0; padding-left: 16px; color: var(--mute); font-size: 13px; }
.sess-head { display: flex; align-items: center; gap: 8px; }
.sess-head span { flex: 1; }
.tick { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line2); background: none; flex: none; display: grid; place-items: center; font-size: 14px; }
.tick.on { background: var(--tone); color: #08071a; border-color: transparent; }
.lift { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; width: 100%; }
.lift:first-of-type { border-top: 0; }
.lift .track { height: 5px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.lift .track i { display: block; height: 100%; background: var(--amber); border-radius: 99px; }

/* ---------- body ---------- */
.fig { position: relative; height: 220px; margin-top: 10px; }
.fig svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hist { display: grid; gap: 6px; margin-top: 8px; }
.hist-row { display: grid; grid-template-columns: 88px repeat(3, minmax(0, 1fr)) 36px; gap: 6px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.hist-row .k { color: var(--mute); }

/* ---------- forms ---------- */
.field { display: grid; gap: 4px; font-size: 12px; color: var(--mute); }
.field input, .field select, .field textarea { height: 44px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(0, 0, 0, 0.3); padding: 0 12px; font-size: 16px; color: var(--ink); width: 100%; }
.field textarea { height: auto; padding: 10px 12px; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stack-gap { display: grid; gap: 12px; }

/* ---------- dock ---------- */
.dock { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 760px; padding: 10px 12px calc(10px + var(--safe-b)); background: linear-gradient(0deg, var(--bg) 55%, transparent); z-index: 20; display: grid; gap: 8px; }
.command { display: flex; align-items: flex-end; gap: 8px; padding: 6px; border-radius: 22px; background: rgba(22, 20, 46, 0.92); border: 1px solid var(--line2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.command textarea { flex: 1; resize: none; border: 0; background: none; outline: none; padding: 11px 4px; font-size: 16px; line-height: 1.35; max-height: 120px; }
.command textarea::placeholder { color: var(--dim); }
.command .cam { cursor: pointer; border: 0; background: var(--card2); }
.send { width: 44px; height: 44px; border-radius: 16px; border: 0; background: var(--teal); color: #04221d; display: grid; place-items: center; flex: none; }
.send:disabled { opacity: .5; }
.staging { border-radius: var(--r); padding: 14px; background: rgba(22, 20, 46, 0.96); border: 1px solid color-mix(in oklab, var(--teal) 45%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); max-height: 46vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.staging h3 { font-size: 15px; }
.attach-row { display: flex; gap: 8px; }
.attach-row img { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line2); }

/* ---------- sheet & toast ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(4, 3, 14, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 760px; max-height: 92vh; background: var(--bg2); border: 1px solid var(--line2); border-bottom: 0; border-radius: 26px 26px 0 0; display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 19px; }
.sheet-body { overflow-y: auto; padding: 14px 16px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.sheet-body > *, .staging > * { flex: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.seg button { height: 36px; border: 0; border-radius: 10px; background: none; color: var(--mute); font-size: 13px; }
.seg button.on { background: var(--card2); color: var(--ink); }
.status-list { display: grid; gap: 8px; }
.status-list div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.toast { position: fixed; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 60; padding: 10px 16px; border-radius: 999px; background: #1b1840; border: 1px solid var(--line2); font-size: 14px; max-width: 90vw; }
.food-pick { display: grid; gap: 6px; max-height: 40vh; overflow-y: auto; }
.food-pick button { text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.food-pick button.on { border-color: var(--teal); }

@media (min-width: 640px) { .page { padding-left: 20px; padding-right: 20px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- goals, plan, garmin ---------- */
.tag { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); color: var(--mute); white-space: nowrap; flex: none; text-transform: none; }
.tag.hot { display: inline-block; margin-top: 4px; background: color-mix(in oklab, var(--coral) 22%, transparent); color: var(--coral); }
.why { margin-top: 4px; font-size: 12px; color: var(--mute); font-style: italic; }
.goal { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.goal:first-child { border-top: 0; }
.goal-main { background: none; border: 0; padding: 0; text-align: left; display: grid; gap: 6px; }
.goal-main .num { font-size: 18px; white-space: nowrap; }
.goal .track { height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; }
.goal .track i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.goal-side { display: grid; gap: 4px; justify-items: end; }
.goal-side .spark { height: 28px; margin: 0; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; margin: 12px 0 6px; }
.bars i { flex: 1; min-width: 2px; background: linear-gradient(180deg, var(--violet), color-mix(in oklab, var(--violet) 40%, transparent)); border-radius: 3px 3px 0 0; }
button.card { color: inherit; font: inherit; }
.sess-head .tag { flex: none; }

/* ---------- timing bar ---------- */
.tbar { position: relative; margin-top: 10px; }
.tbar-track { display: flex; gap: 1px; height: 14px; border-radius: 99px; overflow: hidden; }
.tbar-track i { flex: 1; }
.tbar-pref { position: absolute; top: -3px; width: 3px; height: 20px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 6px rgba(255,255,255,.6); }
.tbar-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--mute); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* =====================================================================
   Frosted glass (approved design): cards are frosted panes over soft
   coloured light, with a faint top highlight and a gentle aero glow on
   primary controls. Less reflective, more translucent.
   ===================================================================== */
:root {
  --bg: #05040f; --bg2: #0b0926;
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.065) 100%);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  --frost: blur(40px) saturate(135%) brightness(1.06);
  --mute: #c9c6ea; --dim: #8e8ab4;
  --r: 24px;
}
html, body { background: var(--bg); }
body { background: radial-gradient(130% 80% at 50% -10%, #1a1452 0%, #0b0926 48%, #05040f 100%) fixed; }
.orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orbs i { position: absolute; border-radius: 50%; filter: blur(60px); }
.orbs i:nth-child(1) { width: 300px; height: 300px; left: -90px; top: 14vh; background: rgba(56, 230, 207, 0.45); }
.orbs i:nth-child(2) { width: 280px; height: 280px; right: -110px; top: 4vh; background: rgba(147, 132, 255, 0.55); }
.orbs i:nth-child(3) { width: 260px; height: 260px; left: 15%; top: 56vh; background: rgba(255, 90, 140, 0.30); }
.orbs i:nth-child(4) { width: 220px; height: 220px; right: -60px; top: 72vh; background: rgba(255, 182, 72, 0.28); }
@media (min-width: 760px) { .orbs i { width: 480px !important; height: 480px !important; } }
#app { position: relative; z-index: 1; }

.card, .gtile, .tabs, .date-step, .icon-btn:not(.sm), .seg, .command, .staging, .sheet {
  background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
  backdrop-filter: var(--frost); -webkit-backdrop-filter: var(--frost);
}
.card { background: radial-gradient(120% 90% at 100% 0%, color-mix(in oklab, var(--tone, transparent) 14%, transparent), transparent 60%), var(--glass); }
.card::before, .gtile::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(140% 90% at 50% 0%, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 70%); pointer-events: none; }
.card > *, .gtile > * { position: relative; }
button.card, .gtile { transition: transform .15s ease, box-shadow .2s ease; }
button.card:active, .gtile:active { transform: scale(0.98); }
@media (hover: hover) { button.card:hover, .gtile:hover { box-shadow: var(--glass-shadow), 0 0 0 1px color-mix(in oklab, var(--tone, #fff) 35%, transparent), 0 0 26px -6px color-mix(in oklab, var(--tone, #fff) 55%, transparent); } }
.tabs { border-radius: 18px; }
.tab-ink { background: rgba(255, 255, 255, 0.14); border: 0; border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 16px rgba(147, 132, 255, 0.5); }
.tabs button.on { font-weight: 600; }
.icon-btn:not(.sm) { border-radius: 16px; }
.pill { background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.pill.ghost { background: rgba(255, 255, 255, 0.04); }
.pill.primary, .send {
  background: radial-gradient(120% 120% at 50% 0%, #8ff5e6 0%, #38e6cf 45%, #13a89b 100%); color: #04221d; border: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 0 18px rgba(56, 230, 207, 0.55), 0 6px 18px -4px rgba(0, 0, 0, 0.5);
}
.send { border-radius: 18px; }
.seg { border-radius: 16px; }
.seg button.on { background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.dock { background: none; }
.command { border-radius: 28px; padding: 7px; box-shadow: var(--glass-shadow), 0 0 30px -6px rgba(147, 132, 255, 0.55), 0 20px 40px -14px rgba(0, 0, 0, 0.7); }
.command .cam { background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 18px; }
.staging { background: linear-gradient(180deg, rgba(30, 26, 70, 0.78), rgba(20, 17, 50, 0.82)); border-color: color-mix(in oklab, var(--teal) 45%, transparent); }
.sheet-wrap { background: rgba(4, 3, 14, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sheet { background: linear-gradient(180deg, rgba(34, 29, 82, 0.80), rgba(14, 12, 38, 0.88)); border-bottom: 0; }
.field input, .field select, .field textarea { background: rgba(0, 0, 0, 0.25); border-color: rgba(255, 255, 255, 0.16); }
.big, .gtile-val { text-shadow: 0 0 18px color-mix(in oklab, var(--tone, #b9fff3) 45%, transparent); }
.chip, .badge { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22); }
@media (prefers-reduced-transparency: reduce) {
  .card, .gtile, .tabs, .date-step, .icon-btn:not(.sm), .seg, .command, .staging, .sheet { backdrop-filter: none; -webkit-backdrop-filter: none; background: #17143a; }
  .orbs { display: none; }
}

/* ---------- Garmin tiles ---------- */
.gtiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 600px) { .gtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .gtile { aspect-ratio: auto; min-height: 190px; } }
.gtile { position: relative; aspect-ratio: 1; border-radius: var(--r); padding: 14px; overflow: hidden; text-align: left; color: inherit; font: inherit; display: flex; flex-direction: column; gap: 2px;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in oklab, var(--tone, transparent) 16%, transparent), transparent 60%), var(--glass); }
.gtile-val { font: 500 clamp(24px, 7vw, 30px)/1.1 var(--display); margin-top: 6px; white-space: nowrap; }
.gtile-val .unit { font-size: 13px; }
.gtile .spark { margin-top: auto; }
.gtile .sub { line-height: 1.35; }
.gbar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin-top: 8px; }
.gbar b { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, color-mix(in oklab, var(--tone) 70%, #000), var(--tone)); box-shadow: 0 0 10px var(--tone); }
.gtile .gbar + .spark { margin-top: auto; }
.tlight { display: inline-flex; gap: 4px; padding: 4px 6px; border-radius: 99px; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.tlight i { width: 10px; height: 10px; border-radius: 50%; opacity: .22; }
.tlight i.red { background: var(--coral); } .tlight i.amber { background: var(--amber); } .tlight i.green { background: var(--green); }
.tlight i.on { opacity: 1; box-shadow: 0 0 10px currentColor; }
.tlight i.red.on { color: var(--coral); } .tlight i.amber.on { color: var(--amber); } .tlight i.green.on { color: var(--green); }
.ghero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; text-align: left; color: inherit; font: inherit; }
.ghero-ring { position: relative; flex: none; display: grid; place-items: center; }
.ghero-ring .sring { transform: rotate(-90deg); display: block; }
.ghero-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ghero-num .num { font-size: 38px; line-height: 1; text-shadow: 0 0 18px color-mix(in oklab, var(--tone) 60%, transparent); }
.ghero-advice { margin: 8px 0 10px; font: 500 15px/1.3 var(--display); text-wrap: balance; }
.gparts { display: grid; gap: 6px; }
.gparts div { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 12.5px; color: var(--mute); }
.gparts small { color: var(--dim); }
.gparts i { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.gparts b { display: block; height: 100%; background: var(--tone); border-radius: 99px; }
@media (max-width: 370px) { .ghero { grid-template-columns: 1fr; justify-items: center; } }
.gwarn { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; color: inherit; font: inherit; padding: 12px 14px; }
.gwarn > span:nth-child(2) { display: flex; flex-direction: column; }
.gwarn-icon { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #120d2a; background: var(--tone); box-shadow: 0 0 16px color-mix(in oklab, var(--tone) 70%, transparent); }
.gwarn.warning { box-shadow: var(--glass-shadow), 0 0 0 1px color-mix(in oklab, var(--coral) 45%, transparent), 0 0 28px -4px color-mix(in oklab, var(--coral) 55%, transparent); }
.chev { color: var(--dim); font-size: 22px; }
.gdetail-head { display: flex; align-items: center; justify-content: space-between; }
.gdetail-title { display: flex; align-items: center; gap: 10px; font-size: 24px; }
.gdetail-title .dot { width: 10px; height: 10px; box-shadow: 0 0 10px var(--tone); }
.gchart { width: 100%; min-height: 120px; }
.gchart svg { display: block; }
.gstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px 12px; margin-top: 10px; }
.gstats > div { display: flex; flex-direction: column; }
.gstats b { font-size: 19px; font-weight: 500; }
.gstats small { color: var(--dim); font-size: 11.5px; }
.gtable { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.gtable th { text-align: left; color: var(--dim); font-weight: 500; padding: 4px 6px 6px 0; }
.gtable td { padding: 7px 6px 7px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); vertical-align: top; }
.gtable td small { display: block; color: var(--dim); font-size: 11.5px; }
.gtable tfoot td { font-weight: 600; }
.gtable tr.flag td { color: var(--coral); }
.wstrip { display: flex; gap: 2px; height: 26px; margin: 10px 0 6px; }
.wstrip i { flex: 1; border-radius: 3px; background: rgba(255, 255, 255, 0.08); }
.wstrip i.clear { background: color-mix(in oklab, var(--green) 55%, transparent); }
.wstrip i.watch { background: var(--amber); }
.wstrip i.warning { background: var(--coral); box-shadow: 0 0 8px var(--coral); }
.gsched { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gsched > div { display: flex; flex-direction: column; }
.gsched b { font-size: 26px; font-weight: 500; }
.gsched small { color: var(--dim); font-size: 11.5px; line-height: 1.3; }

/* ---------- home: two ring panels ---------- */
.hero2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.ringbox { container-type: inline-size; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: inherit; font: inherit; min-width: 0; }
.ringbox .rings { width: 100%; max-width: 260px; }
.ringbox .ring-center { padding: 0 22%; }
.ringbox .ring-center .num { font-size: clamp(16px, 14cqi, 38px); white-space: nowrap; }
.ringbox .ring-center .sub { font-size: clamp(10.5px, 5.4cqi, 13px); margin-top: 3px; white-space: nowrap; }
.ringkey { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; font-size: 11.5px; color: var(--mute); }
.ringkey span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ringkey span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 6px var(--tone); }
@media (hover: hover) { .ringbox:hover .rings { filter: brightness(1.08); } }

/* ---------- effort rating ---------- */
.rpe-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.rpe-row button { height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.16); color: var(--ink); font: 600 14px var(--display);
}
.rpe-row button:nth-child(1) { --c: #5ce38f } .rpe-row button:nth-child(2) { --c: #7fe081 } .rpe-row button:nth-child(3) { --c: #a5dc72 } .rpe-row button:nth-child(4) { --c: #cfd665 }
.rpe-row button:nth-child(5) { --c: #ffcc5a } .rpe-row button:nth-child(6) { --c: #ffb648 } .rpe-row button:nth-child(7) { --c: #ff9a4d } .rpe-row button:nth-child(8) { --c: #ff7d57 }
.rpe-row button:nth-child(9) { --c: #ff6363 } .rpe-row button:nth-child(10) { --c: #ff4f74 }
.rpe-row button { background: color-mix(in oklab, var(--c) 18%, transparent); }
.rpe-row button.on, .rpe-row button:active { background: var(--c); color: #160c22; box-shadow: 0 0 14px var(--c); }
.sess-btn { display: block; width: 100%; text-align: left; color: inherit; font: inherit; cursor: pointer; border-top: 0; border-right: 0; border-bottom: 0; }
.tag[style*="--tone"] { background: color-mix(in oklab, var(--tone) 20%, transparent); color: var(--tone); }

/* ---------- plan ---------- */
.phase-list { display: grid; gap: 6px; }
.phase { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; padding: 8px 10px; border-radius: 14px; border-left: 3px solid var(--tone); background: color-mix(in oklab, var(--tone) 8%, transparent); }
.phase small { grid-column: 1 / -1; color: var(--dim); }
.phase.now { box-shadow: 0 0 0 1px color-mix(in oklab, var(--tone) 50%, transparent), 0 0 18px -6px var(--tone); }
.phase.done { opacity: .55; }
.phase-edit { padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); display: grid; gap: 6px; }
.weekbars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 120px; align-items: end; }
.weekbars > div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; }
.weekbars i { width: 100%; border-radius: 8px 8px 3px 3px; background: color-mix(in oklab, var(--amber) 45%, transparent); }
.weekbars .high i { background: var(--green); box-shadow: 0 0 12px color-mix(in oklab, var(--green) 60%, transparent); }
.weekbars .break i { background: var(--amber); }
.weekbars span { font-size: 11.5px; color: var(--mute); }
.weekbars small { font-size: 10.5px; color: var(--dim); }

/* ---------- beta: brand, page glows, check-in ---------- */
.brand { display: block; font: 600 11px/1 var(--text); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-bottom: 3px; }
.brand b { font-weight: 700; color: #0b0926; background: linear-gradient(90deg, var(--teal), var(--violet)); padding: 1px 6px; border-radius: 99px; margin-left: 2px; letter-spacing: .06em; }
/* each page tints the light behind the glass; colours cross-fade as you swipe */
body { --o1: rgba(56, 230, 207, 0.45); --o2: rgba(147, 132, 255, 0.55); --o3: rgba(255, 90, 140, 0.30); --o4: rgba(255, 182, 72, 0.28); }
body[data-page="coach"] { --o1: rgba(147, 132, 255, 0.55); --o2: rgba(255, 92, 176, 0.42); --o3: rgba(74, 168, 255, 0.30); --o4: rgba(147, 132, 255, 0.30); }
body[data-page="today"] { --o1: rgba(56, 230, 207, 0.45); --o2: rgba(147, 132, 255, 0.55); --o3: rgba(255, 90, 140, 0.30); --o4: rgba(255, 182, 72, 0.28); }
body[data-page="food"] { --o1: rgba(255, 182, 72, 0.45); --o2: rgba(255, 90, 116, 0.42); --o3: rgba(147, 132, 255, 0.30); --o4: rgba(56, 230, 207, 0.25); }
body[data-page="training"] { --o1: rgba(147, 132, 255, 0.55); --o2: rgba(74, 168, 255, 0.45); --o3: rgba(255, 182, 72, 0.30); --o4: rgba(255, 90, 116, 0.25); }
body[data-page="body"] { --o1: rgba(92, 227, 143, 0.42); --o2: rgba(56, 230, 207, 0.45); --o3: rgba(255, 92, 176, 0.28); --o4: rgba(147, 132, 255, 0.30); }
body[data-page="calendar"] { --o1: rgba(255, 182, 72, 0.42); --o2: rgba(74, 168, 255, 0.42); --o3: rgba(147, 132, 255, 0.34); --o4: rgba(56, 230, 207, 0.24); }
body[data-page="garmin"] { --o1: rgba(74, 168, 255, 0.48); --o2: rgba(56, 230, 207, 0.45); --o3: rgba(147, 132, 255, 0.32); --o4: rgba(92, 227, 143, 0.24); }
.orbs i { transition: background-color 1.4s ease; will-change: transform; }
.orbs i:nth-child(1) { background: var(--o1); animation: drift1 28s ease-in-out infinite alternate; }
.orbs i:nth-child(2) { background: var(--o2); animation: drift2 34s ease-in-out infinite alternate; }
.orbs i:nth-child(3) { background: var(--o3); animation: drift3 31s ease-in-out infinite alternate; }
.orbs i:nth-child(4) { background: var(--o4); animation: drift4 37s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(40px, 30px) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-36px, 24px) scale(0.94); } }
@keyframes drift3 { to { transform: translate(30px, -34px) scale(1.06); } }
@keyframes drift4 { to { transform: translate(-28px, -20px) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .orbs i { animation: none !important; transition: none; } }
.ci-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 8px; }
.ci-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.ci-chips button { height: 34px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.06); color: var(--mute); font-size: 11.5px; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-chips button.on { background: color-mix(in oklab, var(--teal) 35%, transparent); color: var(--ink); border-color: color-mix(in oklab, var(--teal) 60%, transparent); box-shadow: 0 0 12px -2px var(--teal); }

/* today's schedule */
.sched { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.sched-row { display: grid; grid-template-columns: 62px 24px minmax(0, 1fr) 18px; align-items: center; gap: 6px; padding: 6px 4px; border-radius: 10px; }
.sched-row.work { background: color-mix(in srgb, var(--tone, var(--teal)) 10%, transparent); }
.sched-row.meal { opacity: .78; font-size: 14px; }
.sched-row.past { opacity: .5; }
.sched-row .t { font-weight: 600; font-size: 13px; }
.sched-row .s { color: var(--teal); text-align: right; }

/* ---------- calendar ---------- */
:root { --slate: #8fa3c8; }
@media (max-width: 380px) { .tabs button { font-size: 10.5px; } }
.cal-head { display: flex; flex-direction: column; gap: 10px; }
.cal-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.cal-seg button { height: 36px; border: 0; border-radius: 999px; background: none; color: var(--mute); font-size: 14px; }
.cal-seg button.on { background: var(--ink); color: #0c0830; font-weight: 600; }
.cal-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.cal-nav .icon-btn { width: 44px; height: 44px; font-size: 20px; }
.cal-title { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cal-title b { font-family: var(--display); font-weight: 500; font-size: 18px; }
.cal-title span { font-size: 12px; color: var(--mute); }
.cal-title .t-test, .t-test { color: var(--amber); font-style: normal; }
.cal-tools { justify-content: center; flex-wrap: wrap; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow span { text-align: center; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding-bottom: 4px; }
.cal-cell { height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 7px 0; border-radius: 14px; border: 1px solid transparent; background: rgba(255,255,255,0.03); color: var(--ink); }
.cal-cell.out { color: var(--dim); }
.cal-cell.out .dots i { opacity: .35; }
.cal-cell.test { background: rgba(255,182,72,0.09); }
.cal-cell.sel { background: rgba(147,132,255,0.28); }
.cal-cell.today { border: 1.5px solid var(--teal); }
.cal-cell .n { font-size: 15px; }
.cal-cell.today .n, .cal-cell.sel .n { font-weight: 600; }
.cal-cell .dots { display: flex; gap: 3px; height: 6px; align-items: center; }
.cal-cell .dots i, .cal-legend i, .cal-li i { width: 6px; height: 6px; border-radius: 50%; background: var(--tone); display: inline-block; }
.cal-cell .dots i.ring, .cal-legend i.ring { background: none; border: 1.5px solid var(--mute); box-sizing: border-box; width: 7px; height: 7px; }
.cal-cell .bar { width: 22px; height: 3px; border-radius: 2px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--mute); margin-top: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend b { width: 14px; height: 4px; border-radius: 2px; background: var(--tone); display: inline-block; }
.cal-legend em { width: 12px; height: 10px; border-radius: 3px; background: rgba(255,182,72,0.22); display: inline-block; }
.cal-legend u { width: 10px; height: 10px; border-radius: 3px; border: 1.5px dashed var(--mute); box-sizing: border-box; display: inline-block; }
.cal-legend s { width: 12px; height: 2px; background: rgba(243,242,251,0.55); display: inline-block; }
.cal-legend i.sl { width: 12px; height: 10px; border-radius: 3px; background: rgba(147,132,255,0.2); }
.cal-legend i.dia { width: 7px; height: 7px; border-radius: 0; transform: rotate(45deg); background: var(--coral); }
.cal-day h3 { font-size: 17px; }
.cal-list { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 12px; }
.cal-li { display: grid; grid-template-columns: 62px 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 26px; font-size: 13.5px; }
.cal-li .t { color: var(--mute); font-size: 13px; }
.cal-li i { width: 8px; height: 8px; }
.cal-li .s { color: var(--teal); font-size: 12px; }
.cal-li.skipped .l, .cal-row.skipped b { text-decoration: line-through; color: var(--dim); }
/* week grid */
.cal-week { padding: 12px 10px; }
.cal-wgrid { display: grid; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-wgrid.body { position: relative; margin-top: 6px; }
.cal-wh { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0; border: 0; border-radius: 12px; background: rgba(255,255,255,0.03); color: var(--ink); }
.cal-wh span { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.cal-wh b { font-family: var(--display); font-weight: 500; font-size: 15px; }
.cal-wh i { width: 16px; height: 3px; border-radius: 2px; background: var(--tone); margin-top: 2px; }
.cal-wh.today { background: rgba(52,224,200,0.14); outline: 1.5px solid var(--teal); }
.cal-hours { position: relative; }
.cal-hours span { position: absolute; right: 3px; font-size: 10px; color: var(--dim); }
.cal-col { position: relative; border-radius: 8px; background: rgba(255,255,255,0.025); overflow: hidden; }
.cal-col.today { background: rgba(52,224,200,0.05); overflow: visible; }
.cal-sleep { position: absolute; left: 0; right: 0; background: rgba(147,132,255,0.14); }
.cal-meal { position: absolute; left: 5px; right: 5px; height: 2px; border-radius: 1px; background: rgba(243,242,251,0.35); }
.cal-meal.done { background: rgba(243,242,251,0.7); }
.cal-blk { position: absolute; left: 1px; right: 1px; box-sizing: border-box; border-radius: 6px; padding: 2px 3px; font-size: 9px; line-height: 1.1; overflow: hidden; color: var(--tone); background: color-mix(in srgb, var(--tone) 15%, transparent); border: 1.5px dashed var(--tone); }
.cal-blk.done { background: var(--tone); color: #0c0830; border: 0; }
.cal-blk.skipped { opacity: .35; text-decoration: line-through; }
.cal-blk.drag { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.cal-blk.dragging { z-index: 5; box-shadow: 0 0 0 2px var(--ink), 0 8px 24px rgba(0,0,0,.5); cursor: grabbing; overflow: visible; }
.cal-blk.dragging::after { content: attr(data-label); position: absolute; left: 50%; top: -20px; transform: translateX(-50%); font-size: 11px; color: var(--ink); background: #0e0c24; border: 1px solid var(--line2); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.cal-now { position: absolute; left: -2px; right: -2px; height: 2px; background: var(--teal); box-shadow: 0 0 8px var(--teal); z-index: 3; }
.cal-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cal-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cal-stats .card { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; }
.cal-stats b { font-family: var(--display); font-weight: 500; font-size: 18px; }
.cal-stats span { font-size: 11px; color: var(--mute); }
.cal-stat { padding: 8px !important; }
.cal-stat span { font-size: 10px !important; letter-spacing: .08em; text-transform: uppercase; }
.cal-stat b { font-size: 15px !important; }
.cal-stat i { display: block; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 4px; }
.cal-stat i u { display: block; height: 3px; background: var(--tone); }
/* day timeline */
.cal-timeline { padding: 6px 14px; }
.cal-row { display: grid; grid-template-columns: 58px 12px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cal-row:last-child { border-bottom: 0; }
.cal-row > .t { color: var(--mute); font-size: 13px; padding-top: 1px; }
.cal-row > i { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--tone); box-sizing: border-box; }
.cal-row > i.hollow { background: none; border: 2px solid var(--tone); }
.cal-row div { display: flex; flex-direction: column; gap: 2px; }
.cal-row div b { font-weight: 500; font-size: 14px; }
.cal-row div span { font-size: 12px; color: var(--mute); line-height: 1.35; }
.cal-row .tag { font-size: 11px; white-space: nowrap; padding: 2px 8px; border-radius: 999px; color: var(--mute); background: rgba(255,255,255,0.06); }
.cal-row .tag.done, .cal-row .tag.logged { color: var(--teal); background: rgba(52,224,200,0.12); }
.cal-row .tag.Garmin { color: var(--amber); background: rgba(255,182,72,0.12); }
.cal-row .tag.sleep { color: var(--violet); background: rgba(147,132,255,0.14); }
.cal-row .tag.missed { color: var(--coral); background: rgba(255,90,116,0.1); }
.cal-row > .pill { grid-column: 3 / -1; justify-self: start; margin-top: 2px; }
.cal-nowline { display: flex; align-items: center; gap: 8px; height: 20px; font-size: 11px; color: var(--teal); }
.cal-nowline span:first-child { width: 58px; }
.cal-nowline i { flex: 1; height: 2px; background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.cal-actions { flex-wrap: wrap; justify-content: center; align-items: flex-end; }
.cal-off { margin: 0; min-width: 130px; }
/* year */
.cal-year { display: flex; flex-direction: column; gap: 3px; padding: 10px 10px; }
.cal-yh, .cal-ym { display: grid; grid-template-columns: 58px minmax(0, 1fr) 46px 48px; gap: 8px; align-items: center; }
.cal-yh span { font-size: 10px; color: var(--dim); text-align: right; letter-spacing: .06em; text-transform: uppercase; }
.cal-ym { height: 34px; padding: 0 6px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; }
.cal-ym.now { background: rgba(52,224,200,0.08); outline: 1px solid rgba(52,224,200,0.35); }
.cal-ym .m { font-size: 13px; }
.cal-ym.now .m { color: var(--teal); }
.cal-ym .k, .cal-ym .b { font-size: 12px; text-align: right; }
.cal-ym .k { color: var(--mute); }
.cal-ym .track { position: relative; height: 16px; border-radius: 5px; background: rgba(255,255,255,0.05); overflow: hidden; }
.cal-ym .track i { position: absolute; top: 0; bottom: 0; background: var(--tone); opacity: .9; }
.cal-ym .track i.proj { opacity: .55; background-image: repeating-linear-gradient(135deg, rgba(8,7,26,0.35) 0 3px, transparent 3px 7px); }
.cal-ym .track b { position: absolute; top: 3px; width: 10px; height: 10px; margin-left: -5px; box-sizing: border-box; }
.cal-ym .track b.test { width: 8px; height: 8px; top: 4px; margin-left: -4px; transform: rotate(45deg); background: var(--coral); outline: 1.5px solid var(--bg); }
.cal-ym .track b.break { border-radius: 50%; border: 2px solid var(--ink); background: var(--bg); }
.cal-ym .track em { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }

/* ---------- desktop layout (≥1100 px): sidebar nav, page in the middle, coach rail on the right ---------- */
.rail-toggle, .drop-hint { display: none; }
@media (min-width: 1100px) {
  body { --rail: 380px; }
  body.rail-min { --rail: 64px; }
  #app { max-width: none; margin: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr) var(--rail); grid-template-rows: auto minmax(0, 1fr); height: 100%; transition: grid-template-columns .25s ease; }
  .top { display: contents; }
  .top-row { grid-column: 2; grid-row: 1; padding: 22px 28px 10px; }
  .top-row .brand { display: none; }
  .tabs { grid-column: 1; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 26px 16px 24px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: rgba(8, 7, 26, 0.35); box-shadow: none; }
  .tabs::before { content: 'WODCAL  β'; font-family: var(--display); font-weight: 600; letter-spacing: .08em; font-size: 19px; padding: 0 10px 18px; color: var(--ink); white-space: pre; }
  .tabs button { height: 42px; text-align: left; padding: 0 14px; font-size: 14px; border-radius: 12px; letter-spacing: 0; }
  .tabs button:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }
  .tabs button.on { background: rgba(255, 255, 255, 0.10); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 18px rgba(147, 132, 255, 0.35); }
  .tab-ink { display: none; }
  .pager { display: contents; }
  .page { grid-column: 2; grid-row: 2; display: none; height: auto; min-height: 0; overflow-y: auto; scroll-snap-align: none; padding: 6px 28px 48px; }
  .page.on { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); grid-auto-rows: max-content; align-items: start; align-content: start; gap: 16px; }
  #page-calendar.on > *, #page-food.on > * { flex: none; }
  .rail-toggle { background: rgba(14, 12, 36, 0.9) !important; }
  .page.on > * { margin: 0; min-width: 0; }
  .page.on > .hero, .page.on > .quick, .page.on > .row, .page.on > p, .page.on > .sub, .page.on > h2 { grid-column: 1 / -1; }
  #page-calendar.on, #page-food.on { display: flex; flex-direction: column; gap: 14px; }
  #page-calendar.on > *, #page-food.on > * { margin: 0; }
  #page-calendar .cal-head { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  #page-calendar .cal-seg { width: 360px; }
  #page-calendar .cal-nav { flex: 1 1 320px; max-width: 480px; }
  .cal-wgrid.body { height: 612px !important; }
  .gtiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  /* the coach is always on the right */
  #page-coach { grid-column: 3; grid-row: 1 / span 2; display: flex !important; flex-direction: column; gap: 12px; columns: auto; overflow-y: auto; padding: 64px 18px 210px; border-left: 1px solid var(--line); background: rgba(8, 7, 26, 0.45); }
  #page-coach > * { margin: 0; }
  #page-coach .msg { max-width: 92%; font-size: 14px; }
  #page-coach .quick { flex-wrap: wrap; overflow: visible; }
  .dock { left: auto; right: 0; transform: none; width: var(--rail); max-width: none; padding: 10px 14px 18px; background: linear-gradient(0deg, rgba(8, 7, 26, 0.96) 70%, transparent); }
  .staging { max-height: 60vh; overflow-y: auto; }
  .rail-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; position: fixed; top: 18px; right: calc(var(--rail) - 50px); z-index: 30; width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.06); color: var(--mute); transition: right .25s ease; }
  .rail-toggle .rt-label { display: none; }
  body.rail-min #page-coach, body.rail-min .dock { display: none !important; }
  body.rail-min .rail-toggle { right: 10px; top: 18px; width: 44px; height: auto; padding: 12px 0; flex-direction: column; border-color: rgba(147, 132, 255, 0.4); background: rgba(147, 132, 255, 0.16); color: var(--violet); }
  body.rail-min .rail-toggle .rt-ico { transform: rotate(180deg); }
  body.rail-min .rail-toggle .rt-label { display: block; writing-mode: vertical-rl; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
  .drop-hint:not([hidden]) { display: flex; position: fixed; inset: 16px; z-index: 50; border: 2px dashed var(--teal); border-radius: 24px; background: rgba(8, 7, 26, 0.7); align-items: center; justify-content: center; font-family: var(--display); font-size: 22px; color: var(--teal); pointer-events: none; }
  .orbs i:nth-child(1) { width: 520px; height: 520px; }
  .orbs i:nth-child(2) { width: 480px; height: 480px; }
}

.why-line { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; }

.help-item { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.help-item summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.help-item summary::before { content: '›'; color: var(--mute); transition: transform .2s; display: inline-block; width: 12px; }
.help-item[open] summary::before { transform: rotate(90deg); }
.help-item p { margin: 8px 0 0 18px; line-height: 1.5; }
.help-src { margin: 8px 0 0 18px; padding-left: 16px; font-size: 13px; }
.help-src a { color: var(--teal); }

.wx { font-size: 11.5px; color: var(--mute); margin-left: 4px; }
.wx.bad { color: var(--amber); }

.prog-row { border-top: 1px solid var(--line); padding: 8px 0; }
.prog-row summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.prog-row p { margin: 6px 0 0; line-height: 1.45; }

.stream-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.stream-toggle button { height: 36px; border: 0; border-radius: 999px; background: none; color: var(--mute); font-size: 14px; }
.stream-toggle button.on { background: var(--ink); color: #0c0830; font-weight: 600; }
@media (min-width: 1100px) { .page.on > .stream-toggle { grid-column: 1 / -1; max-width: 360px; } }

.part-head { font-weight: 600; margin-top: 10px; color: var(--ink); }
.part-head + div { margin-top: 2px; }

.class-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.class-toggles .stream-toggle { flex: 1 1 200px; }
.stream-toggle.n3 { grid-template-columns: repeat(3, 1fr); }

.lc .lc-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.lc .lc-row:first-child { border-top: 0; }
.lc .lc-row > label, .lc .lc-row > span { font-size: 13px; color: var(--ink); font-weight: 500; }
.lc input { height: 38px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255,255,255,0.06); padding: 0 10px; font-size: 15px; color: var(--ink); box-sizing: border-box; }
.lc .rpe-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.lc .rpe-row button { height: 34px; padding: 0; font-size: 13px; }

/* body map (0.10) */
.bm-card { --bm-none: rgba(160, 178, 230, 0.26); }
.bm-card .class-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.bm-card .stream-toggle.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1 1 220px; }
.bm-card .stream-toggle.n2 { flex: 1 1 140px; }
.bm-figs { display: flex; justify-content: center; gap: 12px; margin-top: 12px; }
.bm-figs figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 0 1 170px; }
.bm-figs figcaption { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.bm-fig { width: 100%; max-width: 170px; height: auto; aspect-ratio: 200 / 420; }
.bm-fig .bm-base { fill: rgba(214, 222, 245, 0.16); }
.bm-fig .bm-m { stroke: var(--bg2); stroke-width: 1.3; cursor: pointer; transition: fill .2s; }
.bm-fig .bm-m:hover { stroke: var(--mute); }
.bm-fig .bm-m.sel { stroke: var(--ink); stroke-width: 2.2; }
.bm-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--mute); }
.bm-legend span { display: flex; align-items: center; gap: 6px; }
.bm-legend i { width: 10px; height: 10px; border-radius: 3px; }
.bm-detail { margin-top: 12px; padding: 14px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); }
.bm-detail h3 { margin: 0; font: 500 19px/1.2 var(--display); }
.bm-num { margin: 6px 0 0; } .bm-num b { font: 500 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.bm-bar { position: relative; height: 8px; border-radius: 4px; background: var(--card2); margin-top: 10px; }
.bm-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; }
.bm-bar u { position: absolute; top: -3px; bottom: -3px; border: 1px dashed rgba(243, 242, 251, 0.55); border-radius: 4px; }
.bm-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.bm-facts div { padding: 8px 10px; border-radius: 12px; background: var(--card); display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.bm-facts .sub { font-size: 11px; }
.bm-items { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.bm-items li { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.bm-tip { margin: 10px 0 0; font-size: 13px; line-height: 1.45; }
.bm-chips { margin-top: 12px; } .bm-chips > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bm-chip { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 0; font-size: 12px; font-weight: 600; color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); }
.bm-all { margin-top: 10px; } .bm-all summary { cursor: pointer; }
.bm-all > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.bm-row { position: relative; display: flex; justify-content: space-between; gap: 6px; min-height: 44px; align-items: center; padding: 0 10px 4px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 13px; text-align: left; overflow: hidden; }
.bm-row.on { border-color: var(--ink); }
.bm-row i { position: absolute; left: 0; bottom: 0; height: 3px; }

/* class heart-rate timeline (0.10) */
.hrt { width: 100%; height: auto; margin-top: 8px; }
.hrt-line { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linejoin: round; pointer-events: none; }
.hrt-band { cursor: pointer; }
.hrt-z { stroke: rgba(255, 255, 255, 0.14); stroke-dasharray: 4 4; pointer-events: none; }
.hrt-zl, .hrt-t, .hrt-n { fill: var(--mute); font-size: 11px; pointer-events: none; }
.hrt-n { font-weight: 600; fill: var(--ink); }
.hrt-detail { margin-top: 8px; padding: 12px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); }
.hrt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.hrt-stats div { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 10px; background: var(--card); }
.hrt-stats .sub { font-size: 11px; }
.hrt-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.hrt-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: none; text-align: left; font-size: 13px; }
.hrt-row .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: color-mix(in srgb, var(--tone) 30%, transparent); }
.hrt-row .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrt-row.on { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 10%, transparent); }
.hrt-detail .between { gap: 8px; align-items: flex-start; } .hrt-detail .badge { flex: none; }
@media (min-width: 1100px) {
  .bm-card { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .bm-card > .between, .bm-card > p.sub, .bm-card > .class-toggles { grid-column: 1 / -1; }
  .bm-card > .bm-figs, .bm-card > .bm-legend, .bm-card > .bm-chips { grid-column: 1; }
  .bm-card > .bm-detail { grid-column: 2; grid-row: 4 / span 4; margin-top: 12px; }
  .bm-card > .bm-all { grid-column: 1 / -1; }
  .bm-fig { max-width: 230px; } .bm-figs figure { flex-basis: 230px; }
}

/* who answered (0.12.4) */
.msg-src { display: flex; align-items: center; gap: 6px; margin: -2px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--tone, var(--mute)); white-space: normal; }
.msg-src .ava { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--tone, var(--mute)) 22%, transparent); border: 1px solid color-mix(in srgb, var(--tone, var(--mute)) 45%, transparent); }
.src-rules, .src-builtin { --tone: var(--teal); }
.src-device-rules, .src-device { --tone: var(--violet); }
.src-gemini { --tone: var(--blue); }
.src-none { --tone: var(--amber); }

/* ---------- 0.15: five tabs at the bottom on phones, sections inside Train and Progress ---------- */
.tabs button svg { display: block; }
@media (max-width: 1099px) {
  .tabs { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 760px; margin: 0; z-index: 21; border-radius: 22px 22px 0 0; padding: 6px 6px calc(4px + var(--safe-b)); background: rgba(20, 18, 44, 0.94); border-bottom: 0; }
  .tabs button { height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; }
  .tabs button.on { color: var(--teal); font-weight: 600; }
  .tab-ink { display: none; }
  .dock { bottom: calc(64px + var(--safe-b)); padding-bottom: 8px; background: none; }
  .page { padding-bottom: calc(220px + var(--safe-b)); }
}
@media (min-width: 1100px) {
  .tabs button { display: flex; align-items: center; gap: 12px; }
  .page.on > .subnav { grid-column: 1 / -1; justify-self: start; }
}
.subnav { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); align-self: flex-start; }
.subnav button { height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--mute); font-size: 13px; }
.subnav button.on { background: var(--ink); color: #0c0830; font-weight: 600; }

/* goals */
.goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; grid-auto-flow: row dense; }
.page.on > .goal-grid { grid-column: 1 / -1; }
.goal-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 150px; padding: 12px; border-radius: 16px; text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; }
.goal-card.open { grid-column: 1 / -1; border-color: rgba(243, 242, 251, 0.4); }
.goal-card .badge { font-size: 11px; }
.goal-name { font-size: 13px; font-weight: 600; line-height: 1.3; min-height: 34px; }
.goal-now { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.goal-now b { font-family: var(--display); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.goal-bar { display: block; width: 100%; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); }
.goal-bar i { display: block; height: 5px; border-radius: 3px; background: var(--tone); }
.goal-eta { font-size: 11px; line-height: 1.35; }
.goal-detail { display: flex; flex-direction: column; gap: 8px; width: 100%; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.45; }
.goal-talk { display: flex; align-items: center; gap: 12px; text-align: left; border-color: rgba(52, 224, 200, 0.45); background: rgba(52, 224, 200, 0.08); color: var(--ink); font: inherit; }
.page.on > .goal-talk, .page.on > .goal-fit { grid-column: 1 / -1; }
.gd { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; white-space: normal; }
.gd-draft { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 14px; border: 1px dashed rgba(243, 242, 251, 0.3); background: rgba(255, 255, 255, 0.03); }
.gd-check { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent); background: color-mix(in srgb, var(--tone) 8%, transparent); font-size: 13px; line-height: 1.45; }
.gd-check .badge { font-size: 11px; }
.gd-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 52px; padding: 8px 12px; border-radius: 12px; text-align: left; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--ink); font: inherit; font-size: 13px; }
.gd-opt.on { border-color: var(--teal); background: rgba(52, 224, 200, 0.1); }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); margin: 6px 0; }
label.check input { width: 20px; height: 20px; accent-color: var(--teal); }
.planned-tag { font-size: 11px; color: var(--violet, #b9a9ff); }
.planned-box { margin-top: 8px; padding: 10px 12px; border-radius: 14px; border: 1px dashed rgba(185, 169, 255, 0.45); background: rgba(147, 132, 255, 0.07); }
@media (min-width: 1100px) {
  #page-goals.on > * { grid-column: 1 / -1; }
  #page-goals .goal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.plan-svg { display: block; max-width: 620px; margin: 0 auto; }
