/* ==========================================================
   Trainer — styles
   Dark mode, mobile-first, big tap targets.
   ========================================================== */

:root {
  --bg: #0e1013;
  --surface: #171a1f;
  --surface-2: #1f232a;
  --border: #2a2f37;
  --text: #eceef1;
  --muted: #9aa3ae;
  --faint: #6b7380;
  --accent: #ff7a3d;
  --accent-soft: rgba(255, 122, 61, 0.14);
  --good: #3ecf8e;
  --warn: #f5c451;
  --bad: #ff5c6c;

  /* zone colours */
  --z0: #8b95a3;
  --z1: #7fa7d9;
  --z2: #3ecf8e;
  --z3: #f5c451;
  --z4: #ff8a3d;
  --z5: #ff5c6c;
  --z6: #c084fc;

  --radius: 16px;
  --radius-sm: 10px;
  --tap: 48px;
  --topbar-h: 52px;
  --tabbar-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }
b, strong { font-weight: 650; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) 8px 0;
  display: grid; grid-template-columns: 88px 1fr 88px; align-items: center;
  background: rgba(14, 16, 19, 0.88);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar > * { grid-row: 1; }
.topbar h1 {
  grid-column: 2; margin: 0; text-align: center;
  font-size: 17px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-btn {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: var(--tap); min-width: var(--tap); padding: 0 8px;
  background: none; border: 0; color: var(--accent); font: inherit; font-size: 17px;
  cursor: pointer;
}
.topbar-btn.back { grid-column: 1; justify-self: start; }
.topbar-btn.overview { grid-column: 1; grid-row: 1; justify-self: start; justify-content: center; }
.topbar-btn.gear { grid-column: 3; justify-self: end; color: var(--muted); justify-content: center; }
.topbar-btn.gear.active { color: var(--accent); }

/* ---------- main view ---------- */
.view {
  max-width: 640px; margin: 0 auto;
  /* every page is at least as tall as the screen, so the iPhone keeps
     the bottom tab bar in place on short pages (like Goals) too */
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--topbar-h) + var(--safe-top) + 16px) 16px calc(var(--tabbar-h) + var(--safe-bottom) + 28px);
}
.loading, .empty { color: var(--muted); text-align: center; padding: 48px 16px; }

/* ---------- skeletons: grey shapes where numbers are still loading ---------- */
.skel { display: grid; gap: 10px; padding: 4px 0; }
.skel i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%) 0 0 / 300% 100%; animation: sk 1.4s ease-in-out infinite; }
.skel i:nth-child(odd) { width: 72%; }
.skel i.sk-chart { width: 100%; height: 120px; border-radius: var(--radius-sm); }
.skel-page { display: grid; gap: 14px; }
.skel-page .card { display: grid; margin: 0; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .skel i { animation: none; } }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(14, 16, 19, 0.92);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--border);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--faint); font-size: 11px; font-weight: 550;
}
.tabbar a.active { color: var(--accent); }

/* ---------- headings & text ---------- */
.page-head { margin: 4px 2px 18px; }
.page-head .eyebrow { color: var(--accent); font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; }
.page-head h2 { margin: 2px 0 0; font-size: 28px; line-height: 1.15; font-weight: 750; letter-spacing: -0.01em; }
.page-head .sub { color: var(--muted); margin-top: 6px; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.week-total { text-align: right; flex: none; }
.week-total .v { font-size: 20px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.week-total .l { font-size: 12px; color: var(--muted); font-weight: 600; }

.section { margin: 26px 0 0; }
.section > h3 {
  margin: 0 2px 10px; font-size: 13px; font-weight: 650; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

/* ---------- cards ---------- */
.card {
  display: block; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.card.warn { border-color: rgba(245, 196, 81, 0.4); color: var(--warn); font-size: 14px; }
.card.error { border-color: rgba(255, 92, 108, 0.45); background: rgba(255, 92, 108, 0.08); }
.card.success { border-color: rgba(62, 207, 142, 0.45); background: rgba(62, 207, 142, 0.08); }
a.card:active, .tap:active { transform: scale(0.985); background: var(--surface-2); }
a.card, .tap { transition: transform 0.12s ease, background 0.12s ease; }

.chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 26px; line-height: 1; }

/* workout card */
.workout { padding-right: 36px; border-left: 4px solid var(--tcol, var(--z0)); }
.wk-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 600; }
.wk-title { font-size: 20px; font-weight: 700; margin-top: 4px; line-height: 1.25; }
.wk-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 6px; }
.wk-purpose { margin-top: 8px; font-size: 15px; color: var(--text); opacity: 0.85; }

.t-rest     { --tcol: #6b7380; }
.t-easy     { --tcol: var(--z2); }
.t-tempo    { --tcol: var(--z3); }
.t-hard     { --tcol: var(--z5); }
.t-long     { --tcol: var(--z1); }
.t-strength { --tcol: var(--z6); }
.t-run      { --tcol: #f472b6; }
.t-swim     { --tcol: #22d3ee; }
.t-other    { --tcol: var(--z0); }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 13px; font-weight: 650;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.zone { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 750; color: #0e1013; background: var(--zc, var(--z0)); }
.z0 { --zc: var(--z0); } .z1 { --zc: var(--z1); } .z2 { --zc: var(--z2); } .z3 { --zc: var(--z3); }
.z4 { --zc: var(--z4); } .z5 { --zc: var(--z5); } .z6 { --zc: var(--z6); }

/* block banner */
.block-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.block-banner .name { font-weight: 700; font-size: 17px; }
.block-banner .focus { color: var(--muted); font-size: 14px; }
.light-badge { background: rgba(127, 167, 217, 0.16); color: var(--z1); }

/* coach note */
.note {
  background: linear-gradient(180deg, rgba(255, 122, 61, 0.1), rgba(255, 122, 61, 0.03));
  border: 1px solid rgba(255, 122, 61, 0.3);
  border-radius: var(--radius); padding: 16px; white-space: pre-wrap;
}
.note .who { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em; }

.cue { border-left: 3px solid var(--accent); padding: 10px 14px; background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic; }

/* fuel */
.fuel { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fuel-row { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px 14px; background: var(--surface); }
.fuel-k { color: var(--muted); font-size: 14px; font-weight: 650; }
.fuel-v .big { font-weight: 700; }
.fuel-title { font-size: 14px; color: var(--muted); margin: 0 2px 8px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.stat .v { font-size: 20px; font-weight: 750; }
.stat .l { font-size: 12px; color: var(--muted); }

/* meals */
.meal-list { list-style: none; margin: 12px 0 0; padding: 0; }
.meal-list li { padding: 10px 0; border-top: 1px solid var(--border); }
.meal-list li:first-child { border-top: 0; padding-top: 0; }
.meal-list .lbl { display: block; font-size: 13px; color: var(--muted); font-weight: 650; }
.day-type { text-transform: capitalize; }

/* ---------- workout steps ---------- */
.steps { display: grid; gap: 8px; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; border-left: 4px solid var(--zc, var(--border));
}
.step-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-title { font-weight: 700; flex: 1 1 auto; }
.step-dur { color: var(--muted); font-size: 14px; white-space: nowrap; }
.step-targets { margin-top: 6px; font-size: 15px; display: grid; gap: 2px; }
.step-rest { margin-top: 6px; font-size: 14px; color: var(--z1); }
.step.group { background: var(--surface-2); border-left-color: var(--accent); }
.step.group > .group-body { display: grid; gap: 8px; margin-top: 10px; }
.step.group .step { background: var(--surface); }
.step.inline { padding: 8px 12px; }
.total-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-top: 4px; }

/* zone table */
.zone-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.zone-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 0 6px 6px; }
.zone-table td { padding: 10px 6px; border-top: 1px solid var(--border); vertical-align: top; }
.zone-table tr.hl td { background: var(--accent-soft); }
.zone-table .feel { color: var(--muted); font-size: 13px; }

/* ---------- agenda ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 11px; color: var(--faint); font-weight: 650; padding-bottom: 2px; }
.cal .wk-label { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 650; margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.cal-day {
  min-height: 52px; border-radius: 10px; background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding: 6px 0;
  font-size: 14px; font-weight: 650; border: 1px solid transparent;
}
.cal-day.out { opacity: 0.35; }
.cal-day.light { background: rgba(127, 167, 217, 0.1); }
.cal-day.today { border-color: var(--accent); color: var(--accent); }
.cal-day.past { opacity: 0.6; }
.dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tcol, var(--z0)); }

.week-nav { display: grid; grid-template-columns: var(--tap) 1fr var(--tap); align-items: center; gap: 8px; margin-bottom: 10px; }
.week-nav .label { text-align: center; font-weight: 650; }
.week-nav .label small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }

.day-row { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; padding: 12px 36px 12px 12px; min-height: 64px; }
.day-row .date { text-align: center; line-height: 1.1; }
.day-row .date .d { font-size: 22px; font-weight: 750; }
.day-row .date .w { font-size: 12px; color: var(--muted); font-weight: 650; text-transform: uppercase; }
.day-row.today { border-color: var(--accent); }
.day-row.today .date { color: var(--accent); }
.day-row .items { display: grid; gap: 4px; }
.day-row .item { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.day-row .item .dot { flex: none; }
.day-row .item .dur { color: var(--muted); font-weight: 500; font-size: 14px; margin-left: auto; white-space: nowrap; }

/* ---------- goals ---------- */
.goal { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.goal .title { font-size: 19px; font-weight: 700; }
.goal .metric { color: var(--text); opacity: 0.85; margin-top: 2px; }
.goal .date { color: var(--muted); font-size: 14px; margin-top: 6px; }
.countdown { text-align: center; min-width: 92px; padding: 10px 8px; background: var(--accent-soft); border-radius: 14px; }
.countdown .n { font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.countdown .u { font-size: 12px; color: var(--accent); font-weight: 650; margin-top: 4px; }
.countdown.past { background: var(--surface-2); }
.countdown.past .n, .countdown.past .u { color: var(--muted); }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; grid-column: 1 / -1; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- food ---------- */
.targets-grid { display: grid; gap: 8px; }
.target-row { display: grid; grid-template-columns: 90px repeat(3, 1fr); gap: 6px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.target-row.head { background: none; border: 0; padding-top: 0; padding-bottom: 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.target-row .n { font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.target-row.head .n { font-weight: 650; }
.target-row .dt { font-weight: 700; text-transform: capitalize; }
.target-row.hl { border-color: var(--accent); }

details.card { padding: 0; }
details.card > summary {
  list-style: none; cursor: pointer; padding: 14px 40px 14px 16px; min-height: var(--tap);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; font-weight: 650;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "›"; position: absolute; right: 16px; color: var(--faint); font-size: 24px; transition: transform 0.15s; }
details.card[open] > summary::after { transform: rotate(90deg); }
details.card > .inner { padding: 0 16px 16px; }
details.card.today { border-color: var(--accent); }

.shop { list-style: none; margin: 0; padding: 0; }
.shop li { border-top: 1px solid var(--border); }
.shop li:first-child { border-top: 0; }
.shop label { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 6px 2px; cursor: pointer; }
.shop input { position: absolute; opacity: 0; pointer-events: none; }
.shop .box { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--faint); display: grid; place-items: center; }
.shop .box svg { width: 18px; height: 18px; stroke-width: 3; opacity: 0; color: #0e1013; }
.shop input:checked + .box { background: var(--good); border-color: var(--good); }
.shop input:checked + .box svg { opacity: 1; }
.shop input:checked ~ .txt { color: var(--faint); text-decoration: line-through; }
.shop .qty { color: var(--muted); font-size: 14px; margin-left: auto; }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field > .lbl { display: block; font-weight: 650; margin: 0 2px 8px; }
.field > .lbl small { color: var(--muted); font-weight: 500; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.row-3 .mini { display: block; font-size: 12px; color: var(--muted); margin: 0 2px 4px; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"], textarea {
  width: 100%; min-height: var(--tap);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; font: inherit; font-size: 16px; /* 16px stops iPhone zooming in */
  -webkit-appearance: none; appearance: none;
}
input[type="date"] { display: block; }
input::-webkit-date-and-time-value { text-align: left; }
textarea { min-height: 110px; resize: vertical; line-height: 1.4; }
textarea.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; min-height: 180px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.seg { display: grid; gap: 6px; }
.seg-2 { grid-template-columns: repeat(2, 1fr); }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg-5, .seg-10 { grid-template-columns: repeat(5, 1fr); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: var(--tap); padding: 4px 6px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 650; font-size: 15px;
}
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #140a05; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg-hint { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin: 4px 2px 0; }

/* buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 52px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 650; font-size: 17px; cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #140a05; }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 40px; font-size: 15px; width: auto; padding: 8px 14px; border-radius: 10px; }
.btn.icon { width: var(--tap); min-height: var(--tap); padding: 0; font-size: 22px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stack { display: grid; gap: 10px; }

/* check-in history */
.ci-item .ci-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ci-item .ci-date { font-weight: 700; }
.ci-item .ci-body { color: var(--muted); font-size: 14px; margin-top: 6px; white-space: pre-wrap; }
.ci-actions { display: flex; gap: 8px; margin-top: 10px; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.status-yes { background: var(--good); } .status-partly { background: var(--warn); } .status-no { background: var(--bad); }

/* settings */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
.msg { margin-top: 12px; font-size: 15px; }
.msg ul { margin: 6px 0 0; padding-left: 20px; }
.msg pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: 8px; border-radius: 8px; font-size: 12px; margin: 8px 0 0; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #f3f4f6; color: #111; font-weight: 650; font-size: 15px;
  padding: 12px 18px; border-radius: 14px; max-width: calc(100% - 32px); text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Today: the daily quest ---------- */
.gamebar {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
.gb { text-align: center; }
.gb-v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; gap: 6px; }
.gb-ic { display: inline-flex; }
.gb-ic svg.ic { width: 20px; height: 20px; stroke-width: 2; }
.gb-streak { color: #fb923c; }
.gb-xp { color: #facc15; }
.gb-lvl { color: #fbbf24; }
.gb-l { font-size: 12px; color: var(--muted); font-weight: 600; }
.gb-bar { grid-column: 1 / -1; }
.gb-bar .progress { height: 10px; margin-top: 4px; }
.gb-bar .progress > span { background: linear-gradient(90deg, var(--accent), #ffb03d); transition: width 0.5s ease; }
.gb-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 600; }

.quest-card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #221a16, var(--surface) 55%);
  border: 1px solid rgba(255, 122, 61, 0.45); border-radius: 22px;
  padding: 20px 18px 18px; scroll-margin-top: calc(var(--topbar-h) + var(--safe-top) + 12px);
  box-shadow: 0 10px 40px rgba(255, 122, 61, 0.08);
  animation: pop-in 0.28s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.q-count { font-size: 12px; font-weight: 750; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
.q-head { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.q-head h3 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 800; }
.q-icon { font-size: 36px; line-height: 1; flex: none; }
.q-icon.big { font-size: 64px; text-align: center; margin-top: 8px; }
.q-sub { color: var(--muted); margin-top: 4px; }
.q-text { font-size: 18px; margin-top: 12px; line-height: 1.4; }
.q-steps { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.q-steps li { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 15px; }
.q-fuel { margin-top: 12px; font-size: 15px; color: var(--muted); }
.quest-card form { margin-top: 16px; }
.st-label { text-transform: none; letter-spacing: 0; }
.st-label.st-done { color: var(--good); } .st-label.st-half { color: var(--warn); } .st-label.st-no { color: var(--bad); }

.answers { display: grid; gap: 8px; margin-top: 18px; }
.answers-1 { grid-template-columns: 1fr; }
.answers-3 { grid-template-columns: repeat(3, 1fr); }
.ans {
  min-height: 60px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface-2);
  color: var(--text); font: inherit; font-weight: 750; font-size: 16px; cursor: pointer; padding: 6px;
}
.ans:active { transform: scale(0.96); }
.ans-done { border-color: rgba(62, 207, 142, 0.5); }
.ans-half { border-color: rgba(245, 196, 81, 0.5); }
.ans-no { border-color: rgba(255, 92, 108, 0.45); }
.ans-done.sel { background: var(--good); border-color: var(--good); color: #06140d; }
.ans-half.sel { background: var(--warn); border-color: var(--warn); color: #1a1405; }
.ans-no.sel { background: var(--bad); border-color: var(--bad); color: #1a0508; }
.btn.later { margin-top: 10px; background: none; border-color: transparent; color: var(--muted); min-height: 44px; font-size: 16px; }

.stepper { display: grid; grid-template-columns: var(--tap) 1fr var(--tap); gap: 8px; align-items: center; }
.stepper-val { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.stepper-val input { text-align: center; font-size: 28px; font-weight: 800; padding: 6px; max-width: 120px; }
.stepper-val span { color: var(--muted); font-weight: 600; }

.route { display: grid; gap: 6px; }
.route-item {
  display: grid; grid-template-columns: 30px 30px 1fr; gap: 10px; align-items: center; width: 100%;
  min-height: 56px; padding: 8px 12px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--text); font: inherit;
}
.route-item:active { transform: scale(0.985); }
.route-item.current { border-color: var(--accent); background: var(--accent-soft); }
.ri-mark {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.st-done .ri-mark { background: var(--good); color: #06140d; border-color: var(--good); }
.st-half .ri-mark { background: var(--warn); color: #1a1405; border-color: var(--warn); }
.st-no .ri-mark { background: var(--bad); color: #1a0508; border-color: var(--bad); }
.route-item.st-done .ri-text, .route-item.st-no .ri-text { opacity: 0.6; }
.ri-icon { font-size: 22px; text-align: center; }
.ri-text { min-width: 0; }
.ri-text b { display: block; font-size: 15px; }
.ri-text small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.done-card { text-align: center; border-color: rgba(62, 207, 142, 0.5); background: linear-gradient(180deg, #13241c, var(--surface) 60%); }
.done-card h3 { margin: 8px 0 0; font-size: 28px; font-weight: 800; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti span {
  position: absolute; top: -30px; left: calc(8% + var(--i) * 11%); font-size: 22px;
  animation: fall 1.8s ease-in calc(var(--i) * 0.12s) both;
}
@keyframes fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(260px) rotate(300deg); opacity: 0; } }

/* ---------- Food: shopping toggle ---------- */
.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 10px; }
.toggle button { min-height: 42px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.toggle button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.day-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.day-chips::-webkit-scrollbar { display: none; }
.day-chips button {
  flex: 1 0 44px; min-height: 54px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 750; font-size: 17px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.day-chips button small { font-size: 11px; color: var(--muted); font-weight: 650; }
.day-chips button.is-today { border-color: rgba(255, 122, 61, 0.5); }
.day-chips button.on { background: var(--accent); border-color: var(--accent); color: #140a05; }
.day-chips button.on small { color: #140a05; }
.shop-cat { color: var(--muted); font-size: 13px; font-weight: 700; margin: 12px 2px 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.shop-cat:first-child { margin-top: 0; }

/* ---------- Goals: progress ---------- */
.goal-bar { height: 8px; margin-top: 4px; }
.goal-prog { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 600; margin-top: -4px; }

@media (min-width: 700px) {
  .view { padding-left: 24px; padding-right: 24px; }
}

/* ---------- Intervals.icu look: week summary, day rows, power charts ---------- */
.wk-sum { padding: 14px; }
.wk-top-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 16px; }
.wk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px; font-size: 14px; margin-bottom: 8px; }
.wk-grid > div { display: flex; justify-content: space-between; gap: 6px; }
.wk-grid span { color: var(--muted); }
.wk-grid b { font-weight: 700; white-space: nowrap; }
.c-fit { color: #4fb3ff; } .c-fat { color: #b48cff; } .c-good { color: var(--good); } .c-bad { color: var(--bad); } .c-neutral { color: var(--muted); }
.wk-sports { border-top: 1px solid var(--border); padding-top: 10px; display: grid; gap: 8px; }
.wk-sport { display: grid; grid-template-columns: 22px 68px 1fr 42px; gap: 8px; align-items: center; font-size: 13px; min-height: 22px; }
.wk-sic { display: flex; color: var(--muted); }
.wk-sic .ic { width: 20px; height: 20px; }
.pbar-row { display: grid; grid-template-columns: 38px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; margin: 3px 0; }
.pbar-l { color: var(--muted); }
.pbar { position: relative; height: 20px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.pbar i { position: absolute; inset: 0 auto 0 0; background: #2f7d8c; border-radius: 10px; }
.pbar em { position: relative; display: block; text-align: center; font-style: normal; font-weight: 700; font-size: 12px; line-height: 20px; color: var(--text); }
.pbar-p { text-align: right; color: #4fc3d1; font-weight: 650; }
details.explain { margin-top: 10px; font-size: 13px; color: var(--muted); }
details.explain summary { cursor: pointer; font-weight: 650; }
details.explain p { margin: 8px 0 0; line-height: 1.45; }

.day-row { align-items: start; }
.day-row.past { opacity: 0.8; }
.day-row .date { padding-top: 2px; }
.day-row .item-wrap { display: grid; gap: 4px; }
.day-live { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.day-live.big { font-size: 14px; gap: 8px 16px; padding: 12px 14px; }
.wellness { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.wellness b { color: var(--text); font-weight: 650; }
.wx { display: inline-flex; align-items: center; gap: 6px; }
.wx b { color: var(--text); font-weight: 650; }
.wx small { color: var(--faint); }
.wind-arrow { display: inline-block; font-weight: 800; color: var(--text); }
.mini { margin: 6px 0 2px 30px; }
.mini-meta { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.load-ic .ic { width: 14px; height: 14px; display: block; }
.mini-meta b { color: var(--text); font-weight: 650; }
.pchart { display: block; width: 100%; height: 34px; border-radius: 4px; background: var(--surface-2); }
.pchart.big { height: auto; background: transparent; }
.pchart text { font-size: 11px; fill: var(--muted); }
.pchart .grid { stroke: var(--border); stroke-width: 1; }
.pchart .ftp { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.pchart-wrap { margin-top: 14px; }
.pchart .mhit { fill: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg.pchart:has(.mhit) { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.pchart.has-sel polygon:not(.sel) { opacity: 0.4; }
.pblock { margin-top: 8px; min-height: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.act { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: center; background: rgba(62, 207, 142, 0.08); border: 1px solid rgba(62, 207, 142, 0.3); border-radius: var(--radius-sm); padding: 6px 8px; margin-top: 4px; }
.act-name { font-weight: 650; font-size: 14px; color: var(--good); }
.act-meta { font-size: 12.5px; color: var(--muted); }
.zrows { display: grid; gap: 6px; margin-top: 12px; }
.zrow { display: grid; grid-template-columns: 34px 1fr 52px 48px; gap: 8px; align-items: center; font-size: 13px; }
.zbar { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.zbar i { display: block; height: 100%; }
.zbar i.z0 { background: var(--z0); } .zbar i.z1 { background: var(--z1); } .zbar i.z2 { background: var(--z2); }
.zbar i.z3 { background: var(--z3); } .zbar i.z4 { background: var(--z4); } .zbar i.z5 { background: var(--z5); } .zbar i.z6 { background: var(--z6); }
.pchart, .pchart * { stroke: none; }
.pchart .grid { stroke: var(--border); } .pchart .ftp { stroke: var(--muted); }

/* ---------- icons and the shared workout look ---------- */
svg.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; stroke-width: 1.8; }
.sess + .sess { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.sess-head { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; }
.sess-ic { display: flex; color: var(--tcol, var(--muted)); }
.sess-ic .ic { width: 22px; height: 22px; }
.sess-title { font-weight: 650; line-height: 1.25; }
.sess .dur { color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap; }
.day-row .items { gap: 8px; }
.card.workout .sess-title { font-size: 17px; }
.rest-card { display: flex; align-items: center; gap: 14px; min-height: 118px; }
.rest-ic { display: flex; color: var(--muted); }
.rest-ic .ic { width: 34px; height: 34px; stroke-width: 1.5; }
.q-icon .ic { width: 36px; height: 36px; }
.ri-icon .ic { width: 20px; height: 20px; }
.act-ic { display: flex; color: var(--good); }
.act-ic .ic { width: 20px; height: 20px; }

/* ==========================================================
   Design polish (v1.7): depth, colour and rhythm.
   Everything below only changes the look; remove this block
   to get the previous look back.
   ========================================================== */
:root {
  --bg: #0a0c0f;
  --surface: #14171c;
  --surface-2: #1c2027;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f1f3f5;
  --muted: #98a1ad;
  --faint: #626b78;
  --accent-2: #ffa24d;
  --accent-soft: rgba(255, 122, 61, 0.13);
  --card-bg: linear-gradient(180deg, #171a20 0%, #121519 100%);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --radius: 18px;
  --radius-sm: 12px;
}

body {
  background:
    radial-gradient(120% 420px at 50% -160px, rgba(255, 122, 61, 0.11), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  letter-spacing: -0.005em;
}
::selection { background: rgba(255, 122, 61, 0.35); }

/* top and bottom bars: glass */
.topbar { background: rgba(10, 12, 15, 0.72); border-bottom-color: var(--border); }
.topbar h1 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.tabbar { background: rgba(10, 12, 15, 0.8); border-top-color: var(--border); }
.tabbar a { gap: 3px; font-size: 10.5px; font-weight: 650; letter-spacing: 0.01em; transition: color 0.15s; }
.tabbar a svg { width: 52px; height: 30px; padding: 3px 14px; border-radius: 15px; transition: background 0.2s; }
.tabbar a.active svg { background: var(--accent-soft); }

/* headings */
.page-head { margin: 6px 2px 20px; }
.page-head .eyebrow { font-size: 12px; font-weight: 750; letter-spacing: 0.12em; }
.page-head h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.025em; }
.page-head .sub { font-size: 15px; }
.section { margin-top: 30px; }
.section > h3 { font-size: 12px; font-weight: 750; letter-spacing: 0.1em; color: var(--faint); margin-bottom: 12px; }
.week-total .v { display: inline-flex; align-items: center; gap: 6px; font-size: 21px; letter-spacing: -0.01em; }
.week-total .v .ic { width: 20px; height: 20px; stroke-width: 2.2; }

/* cards: soft depth instead of flat boxes */
.card, .gamebar, .route-item, .target-row:not(.head), .step, .fuel {
  background: var(--card-bg);
  border-color: var(--border);
  box-shadow: var(--card-shadow);
}
a.card:active, .tap:active { background: var(--surface-2); }
.chev { color: var(--faint); font-size: 24px; right: 12px; }

/* workout cards: a soft glow of the sport colour instead of a hard stripe */
.workout {
  border-left: 1px solid var(--border);
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--tcol, var(--z0)) 13%, transparent) 0%, transparent 42%),
    var(--card-bg);
}
.workout::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--tcol, var(--z0));
}
.sess-ic {
  width: 30px; height: 30px; border-radius: 9px; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--tcol, var(--muted)) 16%, transparent);
}
.sess-ic .ic { width: 19px; height: 19px; stroke-width: 2; }
.sess-head { grid-template-columns: 30px 1fr auto; gap: 10px; }
.card.workout .sess-title { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.sess .dur { font-variant-numeric: tabular-nums; font-weight: 600; }
.mini { margin-left: 40px; }
.pchart { border-radius: 6px; }
.rest-card .rest-ic {
  width: 52px; height: 52px; border-radius: 16px; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04); color: #a5b4fc;
}
.rest-card .rest-ic .ic { width: 28px; height: 28px; }

/* agenda */
.week-nav .btn.icon { border-radius: 14px; }
.week-nav .label { font-size: 16px; }
.day-row { padding: 14px 34px 14px 12px; }
.day-row .date .d { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.day-row .date .w { font-size: 11px; letter-spacing: 0.08em; color: var(--faint); }
.day-row.today {
  border-color: rgba(255, 122, 61, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 122, 61, 0.25), 0 10px 30px -12px rgba(255, 122, 61, 0.35);
}
.day-row.today .date .w { color: var(--accent); }
.day-row.past { opacity: 0.72; }
.cal { gap: 5px; }
.cal-day { background: rgba(255, 255, 255, 0.035); border-radius: 12px; font-variant-numeric: tabular-nums; }
.cal-day.today { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); border-color: transparent; }
.cal-day.light { background: rgba(127, 167, 217, 0.08); }
.dot { width: 7px; height: 7px; box-shadow: 0 0 6px color-mix(in srgb, var(--tcol, var(--z0)) 60%, transparent); }

/* week summary */
.pbar { height: 22px; border-radius: 11px; background: rgba(255, 255, 255, 0.05); }
.pbar i { background: linear-gradient(90deg, #22798a, #34a3b5); border-radius: 11px; }
.pbar em { line-height: 22px; }
.wk-sic { color: var(--text); opacity: 0.75; }

/* chips and zones */
.chip { padding: 4px 10px; font-size: 12.5px; background: rgba(255, 255, 255, 0.05); border-color: var(--border); gap: 5px; }
.chip .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.chip.accent { background: var(--accent-soft); }
.zone { border-radius: 7px; padding: 2px 8px; letter-spacing: 0.02em; }
.day-type.dt-rest { background: rgba(165, 180, 252, 0.12); color: #a5b4fc; border-color: transparent; }
.day-type.dt-easy { background: rgba(62, 207, 142, 0.13); color: var(--good); border-color: transparent; }
.day-type.dt-hard { background: rgba(255, 92, 108, 0.13); color: var(--bad); border-color: transparent; }
.day-type.dt-long { background: rgba(251, 191, 36, 0.14); color: #fbbf24; border-color: transparent; }

/* workout page: steps tinted by their zone */
.step {
  border-left: 1px solid var(--border); position: relative; overflow: hidden;
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--zc, transparent) 11%, transparent), transparent 55%),
    var(--card-bg);
}
.step::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--zc, var(--border-strong)); }
.step.group { background: rgba(255, 255, 255, 0.025); }
.step.group::before { background: var(--accent); }
.total-row { background: linear-gradient(90deg, rgba(255, 122, 61, 0.16), rgba(255, 122, 61, 0.06)); border: 1px solid rgba(255, 122, 61, 0.25); }
.stat { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); }
.stat .v { letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.note { box-shadow: var(--card-shadow); }
.cue { background: var(--card-bg); }

/* buttons */
.btn { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.05); transition: transform 0.12s, background 0.15s; }
.btn .ic { width: 20px; height: 20px; stroke-width: 2.1; }
.btn.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: transparent; color: #1a0b03;
  box-shadow: 0 8px 22px -8px rgba(255, 122, 61, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.seg span { background: rgba(255, 255, 255, 0.04); border-color: var(--border); transition: background 0.12s; }
.seg input:checked + span { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #1a0b03; box-shadow: 0 6px 16px -8px rgba(255, 122, 61, 0.7); }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], textarea { background: rgba(255, 255, 255, 0.04); border-color: var(--border-strong); }

/* Today: scoreboard and quest */
.gamebar { padding: 16px 14px 14px; }
.gb-v { font-size: 22px; letter-spacing: -0.02em; }
.gb-ic {
  width: 30px; height: 30px; border-radius: 10px; align-items: center; justify-content: center;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.gb-ic svg.ic { width: 18px; height: 18px; }
.gb-l { margin-top: 4px; font-size: 11.5px; letter-spacing: 0.02em; }
.gb-bar .progress { height: 8px; margin-top: 12px; }
.gb-bar .progress > span { box-shadow: 0 0 12px rgba(255, 140, 61, 0.55); }
.quest-card {
  background:
    radial-gradient(140% 90% at 0% 0%, rgba(255, 122, 61, 0.16), transparent 55%),
    var(--card-bg);
  border-color: rgba(255, 122, 61, 0.35);
  box-shadow: 0 18px 50px -20px rgba(255, 122, 61, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.done-card {
  background: radial-gradient(140% 90% at 50% 0%, rgba(62, 207, 142, 0.16), transparent 60%), var(--card-bg);
  border-color: rgba(62, 207, 142, 0.4);
}
.q-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(255, 122, 61, 0.14); color: var(--accent-2);
}
.q-icon .ic { width: 28px; height: 28px; stroke-width: 1.9; }
.q-icon.big { width: 84px; height: 84px; border-radius: 26px; margin: 8px auto 0; background: rgba(62, 207, 142, 0.14); color: var(--good); }
.q-icon.big .ic { width: 46px; height: 46px; }
.q-head h3 { letter-spacing: -0.02em; }
.q-steps li { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); }
.q-fuel { display: flex; gap: 8px; align-items: flex-start; }
.q-fuel-ic { flex: none; display: flex; color: var(--accent-2); }
.q-fuel-ic .ic { width: 18px; height: 18px; }
.ans { background: rgba(255, 255, 255, 0.04); }
.route-item.current { background: linear-gradient(90deg, rgba(255, 122, 61, 0.14), rgba(255, 122, 61, 0.04)); border-color: rgba(255, 122, 61, 0.45); }
.ri-icon { display: flex; justify-content: center; color: var(--muted); }
.route-item.current .ri-icon { color: var(--accent-2); }
.ri-mark { background: rgba(255, 255, 255, 0.05); border-color: var(--border-strong); }
/* confetti: little coloured paper strips */
.confetti span {
  width: 8px; height: 14px; border-radius: 2px; top: -20px;
  background: hsl(calc(var(--i) * 47 + 10) 90% 62%);
}

/* goals */
.goal .title { font-size: 18px; letter-spacing: -0.015em; }
.countdown {
  background: radial-gradient(120% 120% at 30% 0%, rgba(255, 162, 77, 0.22), rgba(255, 122, 61, 0.08));
  border: 1px solid rgba(255, 122, 61, 0.25); border-radius: 16px;
}
.countdown .n { letter-spacing: -0.03em; background: linear-gradient(180deg, #ffc27a, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.countdown .n .ic { width: 30px; height: 30px; stroke: var(--accent); }
.countdown.past { border-color: var(--border); background: rgba(255, 255, 255, 0.04); }
.countdown.past .n { background: none; color: var(--muted); }
.progress { background: rgba(255, 255, 255, 0.06); }
.progress > span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* food */
details.card > summary { min-height: 54px; }
details.card[open] { border-color: var(--border-strong); }
.target-row.hl { border-color: rgba(255, 122, 61, 0.5); box-shadow: 0 0 0 1px rgba(255, 122, 61, 0.2); }
.toggle { background: rgba(255, 255, 255, 0.05); }
.toggle button.on { background: var(--surface-2); }
.shop .box { transition: background 0.15s, border-color 0.15s; }

/* weather and wellness icons */
.wx-ic, .wl-ic { display: inline-flex; font-style: normal; }
.wx-ic .ic { width: 17px; height: 17px; stroke-width: 2; }
.wl-ic .ic { width: 14px; height: 14px; stroke-width: 2.1; margin-right: 3px; }
.wx-sun { color: #fbbf24; } .wx-cloud { color: #a7b0bd; } .wx-rain { color: #60a5fa; }
.wl-sleep { color: #a5b4fc; } .wl-heart { color: #fb7185; } .wl-breath { color: #67e8f9; }
.wellness > span, .wx-rainmm { display: inline-flex; align-items: center; gap: 2px; }
.wx-rainmm { color: #60a5fa; }
.wx-rainmm .ic { width: 13px; height: 13px; stroke-width: 2.2; }

/* activity done */
.act { background: linear-gradient(100deg, rgba(62, 207, 142, 0.12), rgba(62, 207, 142, 0.03)); border-color: rgba(62, 207, 142, 0.25); }

/* toast */
.toast { background: rgba(241, 243, 245, 0.96); border-radius: 999px; padding: 11px 20px; }

/* planned vs done */
.st-chip { flex: none; display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.st-chip.st-done { background: rgba(62, 207, 142, 0.16); color: var(--good); }
.st-chip.st-partly { background: rgba(245, 196, 81, 0.16); color: var(--warn); }
.st-chip.st-skipped { background: rgba(255, 92, 108, 0.15); color: var(--bad); }
.st-chip.st-open { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.cmp { padding-right: 16px; }
.cmp .sess-head { margin-bottom: 10px; }
.cmp-grid { display: grid; gap: 2px; }
.cmp-row { display: grid; grid-template-columns: 1fr 88px 88px; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--border); font-size: 14px; }
.cmp-row > span:first-child { color: var(--muted); }
.cmp-row b { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.cmp-row .cmp-done { color: var(--text); }
.cmp-h { border-top: 0; padding: 0 0 2px; font-size: 11px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.cmp-h span { text-align: right; }
.cmp-note { margin: 2px 4px 0; font-size: 12.5px; }

/* completed sessions: green, ticked off, with the follow score */
.sess-ic { position: relative; }
.sess-check {
  position: absolute; right: -5px; bottom: -5px; width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center; background: var(--good); color: #06140d;
  box-shadow: 0 0 0 2px #14171c;
}
.sess-check .ic { width: 11px; height: 11px; stroke-width: 3.4; }
.is-partly .sess-check { background: var(--warn); }
.sess.is-done .sess-title, .sess.is-partly .sess-title { color: var(--text); }
.sess.is-done .mini, .sess.is-partly .mini { opacity: 0.45; }
.sess.is-skipped { opacity: 0.6; }
.sess.is-skipped .sess-title { text-decoration: line-through; text-decoration-color: rgba(255, 92, 108, 0.6); }
.card.workout.card-done {
  --tcol: var(--good);
  border-color: rgba(62, 207, 142, 0.35);
  background:
    linear-gradient(105deg, rgba(62, 207, 142, 0.16) 0%, transparent 55%),
    var(--card-bg);
  box-shadow: 0 10px 30px -16px rgba(62, 207, 142, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.card.workout.card-partly { --tcol: var(--warn); border-color: rgba(245, 196, 81, 0.35); }
.card.workout.card-skipped { border-color: rgba(255, 92, 108, 0.25); }
.card.workout.card-done .sess-ic, .card.workout.card-partly .sess-ic { color: var(--tcol); }

.done-strip {
  display: flex; align-items: center; gap: 10px; margin: 10px 0 0 40px; padding: 8px 10px;
  border-radius: 12px; background: rgba(62, 207, 142, 0.08); border: 1px solid rgba(62, 207, 142, 0.2);
}
.done-strip.st-partly { background: rgba(245, 196, 81, 0.08); border-color: rgba(245, 196, 81, 0.22); }
.done-strip.st-skipped { background: rgba(255, 92, 108, 0.07); border-color: rgba(255, 92, 108, 0.2); }
.ds-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ds-txt { font-size: 13px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.ds-score { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.day-row .ring { --sz: 38px !important; }

/* score ring */
.ring { position: relative; flex: none; width: var(--sz); height: var(--sz); display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .ring-bg { stroke: rgba(255, 255, 255, 0.08); }
.ring .ring-fg { stroke: var(--rc); stroke-linecap: round; filter: drop-shadow(0 0 3px var(--rc)); }
.ring b { position: relative; font-size: calc(var(--sz) * 0.34); font-weight: 800; color: var(--rc); font-variant-numeric: tabular-nums; }
.sc-top { --rc: #3ecf8e; } .sc-good { --rc: #a3e635; } .sc-mid { --rc: #f5c451; } .sc-low { --rc: #ff5c6c; }
.cmp-score { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------- the game bar (HUD), stuck to the top of Today ---------- */
.hud {
  position: relative;
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px;
  border-radius: 20px; border: 1px solid rgba(255, 162, 77, 0.28);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 122, 61, 0.22), transparent 60%),
    radial-gradient(100% 140% at 100% 100%, rgba(250, 204, 21, 0.10), transparent 60%),
    rgba(20, 18, 20, 0.86);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  box-shadow: 0 14px 40px -14px rgba(0, 0, 0, 0.8), 0 0 30px -12px rgba(255, 122, 61, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.quest-card { scroll-margin-top: calc(var(--topbar-h) + var(--safe-top) + 112px); }
.hud-wrap {
  position: sticky; top: calc(var(--topbar-h) + var(--safe-top)); z-index: 15;
  margin: -16px -16px 14px; padding: 8px 12px 14px;
  background: linear-gradient(180deg, #0a0c0f 0%, #0a0c0f 72%, rgba(10, 12, 15, 0));
}
.hud-lvl { position: relative; width: 56px; height: 56px; display: grid; place-items: center; }
.hud-lvl svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud-lvl circle { fill: none; stroke-width: 4.5; }
.hud-lvl .hl-bg { stroke: rgba(255, 255, 255, 0.08); }
.hud-lvl .hl-fg { stroke: url(#hudGrad); stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(255, 140, 61, 0.7)); transition: stroke-dasharray 0.6s ease; }
.hl-num { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.hl-num small { font-size: 8.5px; font-weight: 800; letter-spacing: 0.12em; color: var(--accent-2); }
.hl-num b { font-size: 21px; font-weight: 900; letter-spacing: -0.03em; margin-top: 1px; }
.hud-mid { min-width: 0; }
.hud-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.hud-top b { font-weight: 800; letter-spacing: -0.01em; }
.hud-top span { color: var(--muted); font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hud-steps { display: flex; gap: 3px; margin-top: 6px; }
.hud-steps i { flex: 1; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.09); transition: background 0.3s; }
.hud-steps .hs-done { background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 8px rgba(255, 140, 61, 0.6); }
.hud-steps .hs-half { background: var(--warn); opacity: 0.8; }
.hud-steps .hs-no { background: rgba(255, 92, 108, 0.45); }
.hud-foot { margin-top: 5px; font-size: 11px; color: var(--muted); font-weight: 650; }
.hud-stats { display: grid; gap: 5px; }
.hud-pill {
  display: grid; grid-template-columns: 16px auto 1fr; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); min-width: 92px;
}
.hud-pill .ic { width: 16px; height: 16px; stroke-width: 2.1; }
.hud-pill b { font-size: 15px; font-weight: 850; font-variant-numeric: tabular-nums; }
.hud-pill small { font-size: 10.5px; color: var(--muted); font-weight: 650; }
.hp-streak { color: var(--faint); }
.hp-streak b { color: var(--text); }
.hp-streak.lit { color: #fb923c; background: rgba(251, 146, 60, 0.12); }
.hp-streak.lit .ic { animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; filter: drop-shadow(0 0 4px rgba(251, 146, 60, 0.8)); }
.hp-xp { color: #facc15; background: rgba(250, 204, 21, 0.1); }
.hp-xp b { color: #fde68a; }
.hud.bump .hp-xp { animation: xp-pop 0.7s ease; }
.hud.bump .hud-lvl { animation: xp-pop 0.7s ease; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.08, 0.94) rotate(-3deg); } 60% { transform: scale(0.95, 1.07) rotate(2deg); } }
@keyframes xp-pop { 0% { transform: scale(1); } 35% { transform: scale(1.14); box-shadow: 0 0 22px rgba(250, 204, 21, 0.6); } 100% { transform: scale(1); } }

/* The game bar is a link to the Progress page */
a.hud { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
a.hud:active { transform: scale(0.985); }

/* Scrolled down: the game bar shrinks to one line (ring, level, step bar, streak and XP) */
.hud-wrap, .hud, .hud-lvl, .hl-num b, .hl-num small, .hud-steps, .hud-steps i, .hud-foot, .hud-stats, .hud-pill, .hud-pill b, .hud-pill small, .hud-pill .ic {
  transition: all 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hud-lvl svg { transition: none; }
.hl-num small { display: block; max-height: 10px; overflow: hidden; }
.hud-foot { max-height: 16px; overflow: hidden; }
.hud-pill small { display: inline-block; max-width: 48px; overflow: hidden; white-space: nowrap; }
.hud-wrap.compact { padding-top: 4px; padding-bottom: 10px; }
.compact .hud { grid-template-columns: 36px 1fr auto; gap: 10px; padding: 6px 10px 6px 7px; border-radius: 16px; }
.compact .hud-lvl { width: 36px; height: 36px; }
.compact .hl-num small { max-height: 0; opacity: 0; }
.compact .hl-num b { font-size: 15px; margin-top: 0; }
.compact .hud-steps { margin-top: 4px; }
.compact .hud-steps i { height: 4px; }
.compact .hud-foot { max-height: 0; margin-top: 0; opacity: 0; }
.compact .hud-stats { gap: 3px; }
.compact .hud-pill { min-width: 0; padding: 1px 8px 1px 6px; grid-template-columns: 13px auto 0; gap: 4px; }
.compact .hud-pill .ic { width: 13px; height: 13px; }
.compact .hud-pill b { font-size: 12.5px; }
.compact .hud-pill small { max-width: 0; opacity: 0; }

/* A link that jumps to a spot (like #settings/icu) lights it up briefly */
.go-target { scroll-margin-top: calc(var(--topbar-h) + var(--safe-top) + 12px); }
.go-target.flash > .card { animation: go-flash 1.6s ease; }
@keyframes go-flash { 0%, 60% { box-shadow: 0 0 0 2px var(--accent), 0 0 24px -4px var(--accent); } 100% { box-shadow: var(--card-shadow); } }

/* ---------- Progress page (tap the game bar) ---------- */
.prog-hero { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; padding: 18px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255, 122, 61, 0.2), transparent 60%), var(--card-bg); border-color: rgba(255, 162, 77, 0.28); }
.prog-ring { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.prog-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.prog-ring circle { fill: none; stroke-width: 9; }
.prog-ring .pr-bg { stroke: rgba(255, 255, 255, 0.08); }
.prog-ring .pr-fg { stroke: url(#progGrad); stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 140, 61, 0.6)); }
.pr-num { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.pr-num small { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; color: var(--accent-2); }
.pr-num b { font-size: 40px; font-weight: 900; letter-spacing: -0.04em; margin-top: 2px; }
.prog-hero-txt { min-width: 0; }
.prog-big { font-size: 28px; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.prog-big span { font-size: 14px; font-weight: 650; color: var(--muted); letter-spacing: 0; }
.prog-bar { height: 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); margin: 8px 0 8px; overflow: hidden; }
.prog-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px rgba(255, 140, 61, 0.6); }
.prog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.prog-tile { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px 14px; margin: 0; }
.prog-tile .pt-ic { grid-row: span 2; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.prog-tile .pt-ic .ic { width: 19px; height: 19px; }
.prog-tile b { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.prog-tile small { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.pt-streak.lit .pt-ic { color: #fb923c; background: rgba(251, 146, 60, 0.14); }
.pt-streak.lit .pt-ic .ic { animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.pt-best .pt-ic { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.pt-xp .pt-ic { color: #facc15; background: rgba(250, 204, 21, 0.1); }
.pt-perfect .pt-ic { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.prog-chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; }
.pc-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.pc-val { font-size: 9.5px; color: var(--muted); font-weight: 700; height: 12px; font-variant-numeric: tabular-nums; }
.pc-bar { width: 100%; max-width: 16px; height: 84px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); display: flex; align-items: flex-end; overflow: hidden; }
.pc-bar i { display: block; width: 100%; border-radius: 6px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.pc-col.today .pc-bar { box-shadow: inset 0 0 0 1.5px rgba(255, 162, 77, 0.55); }
.pc-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.pc-col.on .pc-dot { background: #fb923c; box-shadow: 0 0 6px rgba(251, 146, 60, 0.8); }
.pc-day { font-size: 10px; color: var(--faint); font-weight: 700; }
.pc-col.today .pc-day { color: var(--accent-2); }
.prog-rules { list-style: none; margin: 0; padding: 0; }
.prog-rules li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.prog-rules li:last-child { border-bottom: 0; }
.prog-rules b { text-align: right; color: var(--accent-2); }
@media (max-width: 360px) { .prog-hero { grid-template-columns: 96px 1fr; } .prog-ring { width: 96px; height: 96px; } .pr-num b { font-size: 32px; } }

/* ---------- Step list behind a button in the step card ---------- */
.btn.route-toggle {
  width: 100%; margin-top: 12px; justify-content: space-between; min-height: 48px; padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04); border-color: var(--border); color: var(--text); font-size: 15px; font-weight: 700;
}
.btn.route-toggle small { margin-left: 6px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.btn.route-toggle .rt-chev { font-size: 22px; line-height: 1; color: var(--muted); transform: rotate(90deg); transition: transform 0.25s ease; }
.btn.route-toggle.open .rt-chev { transform: rotate(-90deg); }
.route-in { margin-top: 10px; animation: route-in 0.28s ease; }
@keyframes route-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Planned / Done switch on finished sessions ---------- */
.mini-meta { flex-wrap: wrap; }
.num-toggle { margin-left: auto; display: inline-flex; padding: 2px; gap: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); }
.num-toggle button {
  appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 750;
  padding: 4px 10px; min-height: 26px; border-radius: 999px; cursor: pointer; transition: background 0.2s, color 0.2s;
}
.num-toggle button.sel { background: #3ecf8e; color: #062016; }
.num-toggle button[data-mode="plan"].sel { background: var(--text); color: var(--bg, #0a0c0f); }
.h-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.h-toggle .num-toggle { text-transform: none; letter-spacing: 0; }
.h-toggle .num-toggle button { font-size: 12.5px; padding: 6px 14px; min-height: 32px; }
.done-stats { border-color: rgba(62, 207, 142, 0.35); }
.done-stats .ds-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-width: 0; }
.done-stats .ds-head .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Month calendar with scores (Progress page) ---------- */
.mc-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; margin-bottom: 10px; }
.mc-label { text-align: center; line-height: 1.25; }
.mc-label b { display: block; font-size: 16px; }
.mc-label small { color: var(--muted); font-size: 12px; font-weight: 600; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mc-dow { text-align: center; font-size: 10.5px; font-weight: 800; color: var(--faint); padding-bottom: 2px; }
.mc-day {
  aspect-ratio: 1 / 1.12; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 3px; padding-top: 5px; background: rgba(255, 255, 255, 0.025); color: inherit; text-decoration: none; min-width: 0;
}
.mc-day.out { background: none; }
.mc-day.has { background: rgba(255, 255, 255, 0.05); }
a.mc-day:active { transform: scale(0.94); }
.mc-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.mc-num { font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1; }
.mc-day.today .mc-num { color: var(--accent-2); }
.mc-score {
  min-width: 30px; padding: 3px 0; border-radius: 8px; text-align: center; font-size: 14px; font-weight: 850; font-variant-numeric: tabular-nums;
  color: var(--rc); background: color-mix(in srgb, var(--rc) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 40%, transparent);
}
.mc-mark { font-size: 13px; font-weight: 800; line-height: 1.6; }
.mc-mark .ic { width: 15px; height: 15px; }
.mc-skip { color: #ff5c6c; opacity: 0.8; }
.mc-done { color: #3ecf8e; }
.mc-plan { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); margin-top: 6px; }
.mc-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.mc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mc-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--rc); }
.mc-legend i.mc-plan { margin: 0; border-radius: 50%; background: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  .route-in { animation: none !important; }
  .quest-card, .confetti span, .hp-streak.lit .ic, .pt-streak.lit .pt-ic .ic, .hud.bump .hp-xp, .hud.bump .hud-lvl, .go-target.flash > .card { animation: none !important; }
  .hud-wrap, .hud, .hud * { transition: none !important; }
}
.mc-rest { color: #8b9cf7; opacity: 0.85; }
.mc-legend .mc-rest { color: var(--muted); opacity: 1; }
.mc-legend .mc-rest .ic { width: 12px; height: 12px; color: #8b9cf7; }

/* "When" choices of a workout (slots), above the fuel line */
.q-slots { display: grid; gap: 6px; margin-top: 12px; }
.q-slot { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font-size: 14px; line-height: 1.4; }
.q-slot b { font-weight: 750; }
.q-slot-ic { color: var(--accent-2); display: grid; place-items: center; height: 20px; }
.q-slot-ic .ic { width: 17px; height: 17px; }

/* ==========================================================
   v1.13.0
   ========================================================== */

/* ---------- "Mark done" on session cards ---------- */
.sess-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.mark-btn {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid rgba(62, 207, 142, 0.45); background: rgba(62, 207, 142, 0.06);
  color: var(--good); font: inherit; font-size: 13.5px; font-weight: 750; cursor: pointer; transition: transform 0.12s, background 0.15s;
}
.mark-btn .ic { width: 15px; height: 15px; stroke-width: 3; }
.mark-btn.on { background: var(--good); border-color: var(--good); color: #06140d; }
.mark-btn:active { transform: scale(0.95); }

/* ---------- Agenda: date + weather on top, sessions full width below ---------- */
.day-row { display: block; padding: 12px 14px 14px; min-height: 0; }
.day-row .dr-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; min-height: 30px; }
.day-row .date { display: flex; align-items: baseline; gap: 6px; text-align: left; padding: 0; flex: none; }
.day-row .date .d { font-size: 22px; }
.day-row .day-live { flex: 1; min-width: 0; margin: 0; }
.day-row .dr-chev { margin-left: auto; color: var(--faint); font-size: 24px; line-height: 1; flex: none; }
.day-row .items { display: grid; gap: 8px; }

/* ---------- Day complete: full screen ---------- */
.cel {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
  background: radial-gradient(120% 80% at 50% 30%, rgba(255, 122, 61, 0.28), transparent 60%), rgba(8, 9, 12, 0.94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transition: opacity 0.22s ease; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; overflow: hidden;
}
.cel.in { opacity: 1; }
.cel.out { opacity: 0; transition-duration: 0.25s; }
.cel .confetti span { left: calc(3% + var(--i) * 6.9%); animation: fall-far 2.6s ease-in calc(var(--i) * 0.05s) both; }
@keyframes fall-far { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(420deg); opacity: 0.6; } }
.cel-title { font-size: 32px; font-weight: 900; letter-spacing: -0.03em; background: linear-gradient(180deg, #ffd27a, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent;
  transform: translateY(10px) scale(0.92); opacity: 0; transition: transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.3s; }
.cel.in .cel-title { transform: none; opacity: 1; }
.cel-stage { display: grid; gap: 14px; width: min(340px, 100%); margin-top: 26px; }
.cel-stat {
  display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center;
  padding: 14px 18px; border-radius: 22px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0; transform: translateY(18px) scale(0.94);
  transition: opacity 0.3s ease, transform 0.42s cubic-bezier(0.2, 1.3, 0.4, 1), border-color 0.3s, background 0.3s;
}
.cel-stat.on { opacity: 1; transform: none; }
.cel-stat.now { border-color: rgba(255, 162, 77, 0.55); background: rgba(255, 122, 61, 0.1); }
.cel-ic { grid-row: span 3; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; }
.cel-ic .ic { width: 30px; height: 30px; stroke-width: 2.2; }
.cs-steps .cel-ic { background: rgba(255, 162, 77, 0.14); color: var(--accent-2); }
.cs-xp .cel-ic { background: rgba(250, 204, 21, 0.12); color: #facc15; }
.cs-streak .cel-ic { background: rgba(251, 146, 60, 0.14); color: #fb923c; }
.cel-num { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.cel-num b { font-size: 44px; font-weight: 900; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.cs-xp .cel-num b { color: #fde68a; }
.cel-num span { font-size: 17px; font-weight: 750; color: var(--muted); }
.cel-lbl { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 3px; }
.cel-bar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); margin-top: 8px; overflow: hidden; }
.cel-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #facc15); transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cel-dots { display: flex; gap: 6px; margin-top: 26px; }
.cel-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); transition: background 0.2s; }
.cel-dots i.on { background: var(--accent); }
.cel-hint { margin-top: 10px; font-size: 12px; font-weight: 650; color: var(--faint); }

/* ---------- New activity: full screen stats ---------- */
.acel { justify-content: flex-start; overflow-y: auto; padding-top: calc(40px + var(--safe-top)); }
.acel-x { position: absolute; top: calc(10px + var(--safe-top)); right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; z-index: 2; }
.acel-head { display: flex; align-items: center; gap: 14px; width: min(420px, 100%); }
.acel-head .si .ic { width: 38px; height: 38px; }
.acel .cel-title { font-size: 24px; line-height: 1.15; background: none; color: var(--text); }
.acel-date { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 3px; }
.acel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(420px, 100%); margin-top: 22px; }
.acel-stat { grid-template-columns: 1fr; grid-template-rows: auto; row-gap: 6px; padding: 12px 14px; border-radius: 18px; }
.acel-stat .cel-ic { grid-row: auto; width: 36px; height: 36px; border-radius: 12px; background: rgba(255, 162, 77, 0.12); color: var(--accent-2); }
.acel-stat .cel-ic .ic { width: 20px; height: 20px; }
.acel-stat .cel-num b { font-size: 30px; }
.acel-stat .cel-num span { font-size: 14px; }
.acel-stat .cel-lbl { margin-top: 0; }
.acel-stat .cel-lbl small { display: block; font-size: 12px; font-weight: 650; color: var(--faint); margin-top: 2px; }
.acel-stat.now .cel-num b { color: #fde68a; }
.as-score, .as-best { grid-column: 1 / -1; }
.as-score .cel-ic { width: auto; height: auto; background: none; justify-self: start; }
.acel-btns .btn { white-space: nowrap; }
.as-best .cel-ic { background: rgba(250, 204, 21, 0.14); color: #facc15; }
.acel-best { margin: 2px 0 0; padding-left: 18px; font-size: 14px; font-weight: 700; color: #fde68a; }
.acel-btns { display: flex; gap: 10px; margin-top: 18px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 0.25s, transform 0.3s; }
.acel.done .acel-btns { opacity: 1; transform: none; pointer-events: auto; }
.acel.done .cel-hint { display: none; }
.chip-btn { cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 650; }

/* ---------- The day in one card (Today when finished, Progress, XP history) ---------- */
.day-sum-wrap { scroll-margin-top: calc(var(--topbar-h) + var(--safe-top) + 112px); }
.day-sum { padding: 16px; }
.day-sum.complete {
  background: radial-gradient(130% 90% at 0% 0%, rgba(255, 122, 61, 0.16), transparent 55%), var(--card-bg);
  border-color: rgba(255, 162, 77, 0.3);
}
.sm-head { display: flex; align-items: center; gap: 12px; }
.sm-medal { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 122, 61, 0.14); color: var(--accent-2); }
.sm-medal .ic { width: 26px; height: 26px; }
.sm-ttl { min-width: 0; flex: 1; }
.sm-ttl b { display: block; font-size: 19px; font-weight: 850; letter-spacing: -0.02em; }
.sm-ttl small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.sm-replay { appearance: none; border: 1px solid rgba(255, 122, 61, 0.35); background: var(--accent-soft); border-radius: 999px; padding: 6px 12px; min-height: 32px;
  font: inherit; font-size: 12.5px; font-weight: 750; color: var(--accent-2); white-space: nowrap; cursor: pointer; }
.sm-more summary { list-style: none; cursor: pointer; padding: 6px 0 0 28px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sm-more summary::-webkit-details-marker { display: none; }
.sm-more[open] summary { display: none; }
.sm-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 14px; }
.sm-stats > div { padding: 10px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); text-align: center; }
.sm-stats b { display: block; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sm-stats b small { font-size: 12px; color: var(--muted); font-weight: 700; margin-left: 1px; }
.sm-stats span { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.sm-x b { color: #fde68a; }
.sm-f b { color: #fb923c; }
.sm-sec { margin-top: 14px; }
.sm-sec h4 { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.sm-good h4 { color: var(--good); } .sm-better h4 { color: var(--warn); } .sm-open h4 { color: var(--faint); }
.sm-list { list-style: none; margin: 0; padding: 0; }
.sm-list li { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: start; padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; line-height: 1.35; }
.sm-list li:first-child { border-top: 0; }
.sm-mark { font-weight: 900; text-align: center; }
.sm-done .sm-mark { color: var(--good); } .sm-half .sm-mark { color: var(--warn); } .sm-no .sm-mark { color: var(--bad); }
.sm-txt small { display: block; color: var(--muted); font-size: 12px; }
.sm-xp { font-size: 12.5px; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.sm-no .sm-xp { color: var(--faint); }

/* ---------- Progress ---------- */
.help-btn {
  appearance: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.04);
  color: var(--muted); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; flex: none; margin-bottom: 4px;
}
.help-btn.on { background: var(--accent-soft); border-color: rgba(255, 122, 61, 0.5); color: var(--accent-2); }
.help-pop { animation: route-in 0.25s ease; }
.hp-head { display: flex; align-items: center; justify-content: space-between; margin: -6px -6px 6px 0; }
.hp-head .btn.icon { min-height: 36px; width: 36px; font-size: 22px; background: none; border: 0; color: var(--muted); }
.h-link { color: var(--accent-2); font-size: 12px; text-decoration: none; letter-spacing: 0.04em; }
.prog-chart-card { color: inherit; text-decoration: none; }
.pc-val { height: 24px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; line-height: 1.05; }
.pc-val b { font-size: 10px; color: var(--text); font-weight: 800; }
.pc-val small { font-size: 8.5px; color: var(--faint); font-weight: 700; }
.pc-bar { position: relative; background: none; }
.pc-max { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
.pc-bar i { position: relative; }
.mc-day { border: 0; font: inherit; color: inherit; cursor: default; }
button.mc-day { cursor: pointer; transition: transform 0.12s, background 0.15s, box-shadow 0.15s; -webkit-tap-highlight-color: transparent; }
button.mc-day:active { transform: scale(0.94); }
.mc-day.sel { background: rgba(255, 122, 61, 0.24); box-shadow: inset 0 0 0 2px var(--accent); }
.mc-day.sel .mc-num { color: #ffd2b0; }
.cal-sum { margin-top: 12px; padding: 12px; border-radius: 14px; background: rgba(255, 122, 61, 0.07); border: 1px solid rgba(255, 122, 61, 0.28); animation: route-in 0.25s ease; }
.cs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cs-head .btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.cs-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 5px 0; font-size: 14px; font-weight: 600; }
.cs-ic { display: flex; color: var(--tcol, var(--muted)); }
.cs-ic .ic { width: 18px; height: 18px; }
.cs-row .mc-score { min-width: 34px; font-size: 13px; }

/* XP history */
.xp-scroll { position: relative; overflow-x: auto; margin: 0 -6px; padding: 0 6px 6px; scrollbar-width: none; }
.xp-scroll::-webkit-scrollbar { display: none; }
.xp-chart { display: grid; gap: 4px; align-items: end; width: max-content; }
.xp-col { appearance: none; border: 0; background: none; color: inherit; font: inherit; padding: 4px 0; border-radius: 8px; cursor: pointer; }
.xp-col.sel { background: rgba(255, 122, 61, 0.16); box-shadow: inset 0 0 0 1.5px var(--accent); }
.xp-col .pc-bar { max-width: 14px; }
.xc-m { height: 12px; font-size: 9.5px; font-weight: 800; color: var(--accent-2); text-transform: uppercase; }
.xw-row { display: grid; grid-template-columns: 1fr 70px auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); }
.xw-row:first-child { border-top: 0; padding-top: 0; }
.xw-t b { display: block; font-size: 14px; }
.xw-t small { color: var(--muted); font-size: 12px; }
.xw-bar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.xw-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.xw-v { font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }
.xw-v small { color: var(--faint); font-size: 11px; }

/* ---------- More page ---------- */
.more-row, .ci-open { display: flex; align-items: center; gap: 14px; padding: 14px 40px 14px 14px; color: inherit; text-decoration: none; }
.mr-ic { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.mr-ic .ic { width: 22px; height: 22px; }
.mr-txt { min-width: 0; }
.mr-txt b { display: block; font-size: 16.5px; }
.mr-txt small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.mr-goals .mr-ic { color: var(--accent-2); background: var(--accent-soft); }
.mr-check .mr-ic { color: var(--good); background: rgba(62, 207, 142, 0.12); }
.mr-prog .mr-ic { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.ci-open .mr-ic { color: var(--accent-2); background: var(--accent-soft); }
.ci-all { display: flex; align-items: center; gap: 10px; color: var(--good); font-weight: 700; }
.quest-card.flash { animation: go-flash 1.6s ease; }

/* ---------- Food ---------- */
.icon-btn {
  position: relative; width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-strong); color: var(--text); margin-bottom: 2px;
}
.icon-btn .ic { width: 24px; height: 24px; }
.icon-btn:active { transform: scale(0.95); }
.ib-badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #140a05; font-size: 11.5px; font-weight: 850; display: grid; place-items: center; }
.section > h3 .btn.small { text-transform: none; letter-spacing: 0; font-size: 13.5px; min-height: 34px; padding: 6px 12px; gap: 6px; }
.section > h3 .btn.small.on { background: var(--accent-soft); border-color: rgba(255, 122, 61, 0.45); color: var(--accent-2); }
.meal-cal { margin-bottom: 12px; }
.mcal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-top: 5px; }
.mcal-dot.dt-rest { background: #a5b4fc; } .mcal-dot.dt-easy { background: var(--good); } .mcal-dot.dt-hard { background: var(--bad); } .mcal-dot.dt-long { background: #fbbf24; }
.mc-legend .mcal-dot { margin: 0; }
.meal-rows { padding: 6px 16px; }
.meal-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--border); }
.meal-row:first-child { border-top: 0; }
.mrw-ic { display: flex; color: var(--accent-2); padding-top: 1px; }
.mrw-ic .ic { width: 22px; height: 22px; }
.mrw-body b { display: block; }
.mrw-body div { color: var(--muted); font-size: 14.5px; margin-top: 2px; line-height: 1.4; }
.meal-row .st-label { font-size: 13px; font-weight: 750; }

/* shopping list: 3 tiles per row with a picture */
.shop-card { padding: 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shop-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 12px 6px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  cursor: pointer; transition: transform 0.12s, background 0.2s, border-color 0.2s; -webkit-tap-highlight-color: transparent;
}
.shop-tile:active { transform: scale(0.96); }
.shop-tile input { position: absolute; opacity: 0; pointer-events: none; }
.st-pic { display: flex; justify-content: center; align-items: center; font-size: 38px; line-height: 1.1; height: 46px; }
.st-pic.two { font-size: 30px; }
.st-pic.two span + span { margin-left: -4px; }
.st-name { font-size: 13px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.st-qty { font-size: 11.5px; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.st-tick { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--faint); display: grid; place-items: center; }
.st-tick svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 3.2; opacity: 0; color: #06140d; }
.shop-tile.on { background: rgba(62, 207, 142, 0.08); border-color: rgba(62, 207, 142, 0.4); }
.shop-tile.on .st-tick { background: var(--good); border-color: var(--good); }
.shop-tile.on .st-tick svg { opacity: 1; }
.shop-tile.on .st-pic, .shop-tile.on .st-name, .shop-tile.on .st-qty { opacity: 0.45; }
.shop-tile.on .st-name { text-decoration: line-through; }
.shop-cat + .shop-grid, .shop-grid + .shop-cat { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .cel, .cel-title, .cel-stat, .cel-bar i, .acel-btns, .cal-sum, .help-pop { transition: none !important; animation: none !important; }
  .cel .confetti { display: none; }
}

/* Block calendar (Agenda): days are buttons now (tap once to select, again to open) */
button.cal-day { appearance: none; font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cal-day.sel { opacity: 1; background: rgba(255, 122, 61, 0.24); box-shadow: inset 0 0 0 2px var(--accent); color: #ffd2b0; }

/* ==========================================================
   v1.14.0
   ========================================================== */

/* ---------- Session icons in calendars ---------- */
.sess-ics { display: flex; gap: 1px; justify-content: center; align-items: center; min-height: 15px; }
.sess-ics small { font-size: 9px; font-weight: 800; color: var(--muted); margin-left: 1px; }
.si { display: inline-flex; font-style: normal; color: var(--sc, var(--muted)); }
.si .ic { width: 14px; height: 14px; stroke-width: 2.1; vertical-align: 0; }
.sess-ics.rest { color: #8b9cf7; opacity: 0.7; }
.sess-ics.rest .ic { width: 13px; height: 13px; }
.cal-day .sess-ics .ic { width: 15px; height: 15px; }
.mc-day { aspect-ratio: auto; min-height: 56px; gap: 2px; }
.mc-score.sm { min-width: 24px; padding: 1px 0; border-radius: 6px; font-size: 11px; }
.mc-mark { line-height: 1.2; }
.mc-mark .ic { width: 13px; height: 13px; }
.sport-legend { margin-top: 8px; }
.sport-legend .si .ic { width: 13px; height: 13px; }

/* ---------- Me page ---------- */
.me-upd { margin: 2px 4px 14px; }
.icon-btn.spin .ic { animation: me-spin 0.9s linear infinite; }
@keyframes me-spin { to { transform: rotate(360deg); } }
.me-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.me-chips::-webkit-scrollbar { display: none; }
.me-chip {
  appearance: none; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.04); color: var(--muted);
  font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.me-chip .si { color: var(--sc); }
.me-chip.on { background: var(--text); border-color: var(--text); color: #0e1013; }
.me-chip.on .si { color: #0e1013; }
.me-seg, .me-ranges { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); margin-bottom: 10px; }
.me-ranges { overflow-x: auto; scrollbar-width: none; }
.me-ranges::-webkit-scrollbar { display: none; }
.me-seg button, .me-ranges button {
  appearance: none; flex: 1 0 auto; min-height: 34px; padding: 4px 10px; border: 0; border-radius: 9px; background: none;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.me-seg button.on, .me-ranges button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.me-card { color: inherit; text-decoration: none; }
.me-ttl { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.me-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin: 8px 0 6px; }
.me-stat b { display: block; font-size: 18px; font-weight: 850; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.me-stat span { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.me-change { font-size: 13px; font-weight: 800; text-align: right; }
.me-change small { display: block; font-size: 11px; color: var(--muted); font-weight: 650; }
.me-change.up { color: var(--good); } .me-change.down { color: var(--bad); }
.me-card > .me-change { text-align: left; margin-bottom: 4px; }
.me-fit-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.me-big { display: block; font-size: 40px; font-weight: 900; letter-spacing: -0.04em; line-height: 1; color: var(--accent-2); }

/* charts */
svg.mchart { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; stroke: none; }
.mchart .mg { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.mchart .mg.base { stroke-dasharray: none; }
.mchart .ml, .mchart .mx { fill: var(--faint); font-size: 9.5px; font-weight: 700; }
.mchart .mline { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.mchart .mline2 { fill: none; stroke: rgba(165, 180, 252, 0.55); stroke-width: 1.5; stroke-dasharray: 3 3; }
.mchart .marea { stroke: none; }
.mchart .mdot { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.mchart .mdot.now { fill: var(--accent); }
.mchart .mdot.sel { fill: var(--accent); stroke: #ffd2b0; stroke-width: 2.5; }
.mchart .mmark { stroke: var(--bg); stroke-width: 1.5; }
.mchart .mbar { fill: rgba(255, 122, 61, 0.55); }
.mchart .mbar.sel { fill: var(--accent); }
.mchart .msel { stroke: rgba(255, 162, 77, 0.6); stroke-width: 1.2; stroke-dasharray: 2 3; }
.mchart .mhit { fill: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* full-screen graph detail: value bubble, zero line, form zone names, sub-headings */
.mchart .mtip { fill: var(--text); font-size: 10.5px; font-weight: 800; }
.mchart .mg.zero { stroke: var(--faint); stroke-dasharray: none; }
.mchart .mband { fill: var(--faint); font-size: 8.5px; font-weight: 700; }
.me-sub { margin-top: 14px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
/* time in zones */
.tz-stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 12px 0 4px; background: var(--border); }
.tz-stack i { display: block; height: 100%; }
.tz-list { margin-top: 8px; }
.tz-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 26% 86px; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.tz-row:first-child { border-top: 0; }
.tz-id { font-weight: 800; color: var(--zc); }
.tz-name { font-size: 13px; font-weight: 600; min-width: 0; }
.tz-name small { display: block; color: var(--faint); font-size: 11px; font-weight: 500; }
.tz-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.tz-bar i { display: block; height: 100%; border-radius: 4px; background: var(--zc); }
.tz-time { white-space: nowrap; text-align: right; font-weight: 700; font-size: 13px; }
.tz-time small { display: block; color: var(--faint); font-size: 11px; font-weight: 600; }
/* power curve models */
.pm-row { padding: 7px 0; border-top: 1px solid var(--border); }
.pm-row:first-child { border-top: 0; padding-top: 0; }
.pm-row b { display: block; font-size: 13px; }
/* sideways slides on a graph pick points; up/down still scrolls the page */
svg.mchart:has(.mhit) { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.me-key { display: flex; gap: 14px; margin-top: 8px; font-size: 11.5px; color: var(--muted); font-weight: 650; }
.me-key span { display: inline-flex; align-items: center; gap: 5px; }
.me-key i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.me-key .k-fit { background: var(--accent); }
.me-key .k-fat { background: rgba(165, 180, 252, 0.7); }
.me-key .k-dot { width: 8px; height: 8px; border-radius: 50%; background: conic-gradient(#ff8a3d 0 33%, #f472b6 33% 66%, #22d3ee 66%); }

/* streak */
.me-stk-top { display: flex; align-items: center; gap: 14px; }
.me-stk-ic { width: 48px; height: 48px; flex: none; border-radius: 15px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); color: var(--faint); }
.me-stk-ic .ic { width: 28px; height: 28px; }
.me-stk-ic.lit { color: #fb923c; background: rgba(251, 146, 60, 0.14); }
.me-stk-ic.lit .ic { animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.me-stk-top b { display: block; font-size: 24px; font-weight: 900; letter-spacing: -0.02em; }
.me-stk-top small { color: var(--muted); font-size: 13px; }
.stk-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; margin-top: 14px; }
.stk { display: grid; place-items: center; color: rgba(255, 255, 255, 0.14); }
.stk .ic { width: 20px; height: 20px; }
.stk.on { color: #fb923c; }
.stk.now { border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

/* full streak history: one flame per week, a row of 13 weeks (a quarter) */
.stk-year { padding: 10px 0; border-top: 1px solid var(--border); }
.stk-year:first-child { border-top: 0; padding-top: 0; }
.stk-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; }
button.stk { appearance: none; border: 0; background: none; padding: 4px 0; border-radius: 8px; cursor: pointer; font: inherit; -webkit-tap-highlight-color: transparent; }
.stk-grid .stk .ic { width: 18px; height: 18px; }
.stk.run { color: #fdba74; }
.stk.sel { background: rgba(255, 122, 61, 0.18); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* × that closes a calendar summary */
.cs-acts { display: flex; align-items: center; gap: 6px; }
.cs-x { appearance: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.05); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; }

/* Today: you as an athlete */
.ath-form { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; text-decoration: none; color: inherit; }
.ath-zone { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; color: var(--fz); }
.ath-fv { font-weight: 800; color: var(--fz); font-variant-numeric: tabular-nums; }
.ath-tip { margin: 6px 0 4px; font-size: 14px; color: var(--muted); }
a.ath-tile { display: block; padding: 10px 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); text-decoration: none; color: inherit; text-align: center; }
a.ath-tile:active { background: rgba(255, 122, 61, 0.14); }
.ath-tile b { font-size: clamp(14px, 4.1vw, 18px); }

.ath-warn { margin: 6px 0 4px; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; color: #fde68a; background: rgba(250, 204, 21, 0.10); }
.ath-plan { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0 4px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; color: #fecaca; background: rgba(239, 68, 68, 0.12); text-decoration: none; }
.ath-plan .ic { flex: none; width: 18px; height: 18px; color: #f87171; margin-top: 1px; }
.rec-v { color: var(--rc); }

/* morning check-in: sleep that came from the watch */
.sleep-auto { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.sleep-auto b { font-size: 17px; }

/* training log */
.lg-card { padding: 12px 12px 6px; }
.lg-week { padding: 6px 0 10px; border-top: 1px solid var(--border); }
.lg-week:first-child { border-top: 0; padding-top: 0; }
.lg-week.flash { animation: go-flash 1.6s ease; border-radius: 12px; }
.lg-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin: 4px 2px 6px; }
.lg-head b { font-size: 14px; }
.lg-head span { font-size: 12px; color: var(--muted); font-weight: 650; }
.lg-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.lg-day { appearance: none; border: 0; background: none; color: inherit; font: inherit; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; border-radius: 10px; min-height: 76px; }
button.lg-day { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.lg-day:active { transform: scale(0.94); }
.lg-day.sel { background: rgba(255, 122, 61, 0.16); box-shadow: inset 0 0 0 1.5px var(--accent); }
.lg-dow { font-size: 10px; font-weight: 800; color: var(--faint); }
.lg-c { width: var(--sz); height: var(--sz); border-radius: 50%; background: rgba(255, 255, 255, 0.12); margin: auto 0; flex: none; }
.lg-c.on { background: var(--lgc, var(--accent)); }
.lg-d { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.lg-day.today .lg-d { color: var(--accent-2); }
.lg-week .cal-sum { margin: 6px 0 2px; }

@media (prefers-reduced-motion: reduce) {
  .icon-btn.spin .ic, .me-stk-ic.lit .ic, .lg-week.flash { animation: none !important; }
}

/* ==========================================================
   v1.15.0
   ========================================================== */

/* ---------- Me: profile (like Strava) ---------- */
.me-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.prof { padding: 18px 16px 16px; }
.prof-top { display: flex; align-items: center; gap: 16px; }
.prof-pic { width: 76px; height: 76px; flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgba(252, 82, 0, 0.75); }
.prof-ini { display: grid; place-items: center; background: linear-gradient(135deg, #fc5200, #ffa24d); color: #1a0b03; font-size: 28px; font-weight: 900; letter-spacing: -0.02em; }
.prof-pic.big { width: 104px; height: 104px; font-size: 38px; }
.prof-id { min-width: 0; }
.prof-id h2 { margin: 0; font-size: 26px; font-weight: 850; letter-spacing: -0.02em; line-height: 1.1; overflow-wrap: anywhere; }
.prof-id q { display: block; margin-top: 6px; font-size: 14.5px; font-style: italic; color: var(--muted); line-height: 1.35; quotes: "“" "”"; }
.prof-add { display: inline-block; margin-top: 6px; font-size: 13.5px; color: var(--accent-2); text-decoration: none; font-weight: 650; }
.prof-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); text-align: center; }
.prof-stats > div + div { border-left: 1px solid var(--border); }
.prof-stats b { display: inline-flex; align-items: center; gap: 3px; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.prof-stats b .ic { width: 19px; height: 19px; color: var(--faint); }
.prof-stats b.lit .ic { color: #fb923c; }
.prof-stats span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 650; }
.prof-edit { width: 100%; margin-top: 14px; }
.prof-pick { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.prof-pick .stack { flex: 1; }
.prof-pick label.btn { cursor: pointer; }

/* ---------- Agenda: week summary at a glance ---------- */
.wk-top-row { margin-bottom: 12px; }
.wk-big { display: flex; align-items: baseline; gap: 8px; }
.wk-big b { font-size: 30px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.wk-big span { color: var(--muted); font-size: 14px; font-weight: 650; }
.wk-big em, .wk-lrow em { margin-left: auto; font-style: normal; font-weight: 850; font-size: 15px; color: #60a5fa; }
.wk-bar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.wk-bar i { display: block; height: 100%; border-radius: inherit; }
.wk-time .wk-bar { margin-top: 10px; height: 12px; }
.b-time i { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.b-sport i { background: linear-gradient(90deg, #22798a, #34a3b5); }
.b-load i { background: linear-gradient(90deg, #d97706, #fbbf24); }
.wk-load { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 12px; border-radius: 14px; background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.25); }
.wk-lic { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.wk-lic .ic { width: 20px; height: 20px; }
.wk-lmain { flex: 1; min-width: 0; }
.wk-lrow { display: flex; align-items: baseline; gap: 6px; margin-bottom: 7px; }
.wk-lrow b { font-size: 16px; color: #fde68a; }
.wk-lrow span { color: var(--muted); font-size: 13px; font-weight: 600; }
.wk-lrow em { color: #fbbf24; }
.wk-sports2 { display: grid; gap: 10px; margin-top: 14px; }
.wk-sp { display: grid; grid-template-columns: 22px 72px 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; }
.wk-spl { color: var(--muted); font-weight: 650; }
.wk-spv { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk-spv small { color: var(--faint); font-weight: 600; }
.wk-fit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.wk-fit > div { padding: 9px 6px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); text-align: center; }
.wk-fit b { display: block; font-size: 20px; font-weight: 850; }
.wk-fit span { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.f-fit b { color: #4fb3ff; } .f-fat b { color: #b48cff; }
.f-form.c-good b { color: var(--good); } .f-form.c-bad b { color: var(--bad); } .f-form.c-neutral b { color: var(--text); }
.wk-extra { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.wk-extra span { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); font-size: 13.5px; color: var(--muted); font-weight: 650; }
.wk-extra b { color: var(--text); font-weight: 800; }

/* ---------- Food: meal lines with food pictures ---------- */
.meal-list .ml-li { display: block; }
.ml-ics { display: flex; flex-wrap: wrap; gap: 2px; font-size: 26px; line-height: 1.15; margin: 2px 0 4px; }
.ml-li .lbl { color: var(--text); font-size: 15px; font-weight: 750; }
.ml-txt { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.mrw-body .ml-ics { font-size: 24px; margin: 4px 0 2px; }

/* ---------- Settings: panels behind a plain button ---------- */
.btn.more-btn { justify-content: space-between; font-size: 16px; color: var(--text); }
.btn.more-btn span { color: var(--muted); font-size: 22px; line-height: 1; }
.topbar-btn.gear.active { color: var(--accent); }

/* ---------- v1.15.1: FTP graph ---------- */
.mchart .mtest { fill: #fbbf24; stroke: var(--bg); stroke-width: 2.5; }
.mchart .mtest-l { fill: #fde68a; font-size: 10px; font-weight: 800; }
.me-key .k-set { background: repeating-linear-gradient(90deg, rgba(165, 180, 252, 0.8) 0 3px, transparent 3px 6px); }
.me-key .k-test { width: 10px; height: 10px; border-radius: 50%; background: #fbbf24; }
.me-big small { font-size: 18px; font-weight: 800; color: var(--muted); }

/* ---------- Laptop / desktop (1000px+): sidebar instead of bottom tabs, wider content.
   Phones never get this wide, so the iPhone layout above stays exactly the same. ---------- */
@media (min-width: 1000px) {
  :root { --side-w: 232px; }
  .topbar { padding-left: calc(var(--side-w) + 16px); padding-right: 16px; }
  .tabbar {
    inset: calc(var(--topbar-h) + var(--safe-top)) auto 0 0; width: var(--side-w); height: auto;
    grid-template-columns: 1fr; grid-auto-rows: 48px; align-content: start; gap: 4px;
    padding: 16px 12px; border-top: 0; border-right: 1px solid var(--border);
  }
  .tabbar a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px; border-radius: 12px; font-size: 15px; color: var(--muted); }
  .tabbar a svg { width: 24px; height: 24px; padding: 0; border-radius: 0; background: none; }
  .tabbar a.active { background: var(--accent-soft); color: var(--accent); }
  .tabbar a.active svg { background: none; }
  .view { max-width: 780px; padding: calc(var(--topbar-h) + 28px) 32px 48px; }
  body { padding-left: var(--side-w); }
}
@media (min-width: 1000px) and (hover: hover) {
  .tabbar a:not(.active):hover { background: var(--surface-2); color: var(--text); }
  a.card { transition: border-color 0.15s, background-color 0.15s; }
  a.card:hover { border-color: rgba(255, 122, 61, 0.45); }
  .btn:hover, .topbar-btn:hover { filter: brightness(1.12); }
}

/* ---------- pull to refresh ---------- */
.ptr {
  position: fixed; left: 50%; top: calc(var(--topbar-h) + var(--safe-top) - 34px); z-index: 19;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  opacity: 0; transform: translate(-50%, 0); pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s;
}
.ptr svg { width: 20px; height: 20px; }
.ptr.ready { color: var(--accent); }
.ptr.spin { opacity: 1; color: var(--accent); }
.ptr.spin svg { display: none; }
.ptr.spin::after {
  content: ''; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--accent-soft); border-top-color: var(--accent);
  animation: ptr-spin 0.7s linear infinite;
}
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ptr.spin::after { animation-duration: 2s; } }
.btn.more-btn span small { font-size: 14px; margin-right: 8px; vertical-align: 3px; }

/* ---------- Agenda: the week at a glance ---------- */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 8px; margin-bottom: 12px; }
.ws-day { display: grid; justify-items: center; gap: 2px; padding: 6px 0 7px; border-radius: 10px; color: var(--muted); text-decoration: none; }
.ws-day .w { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.ws-day .d { font-size: 15px; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; }
.ws-day.today { background: var(--accent-soft); }
.ws-day.today .w, .ws-day.today .d { color: var(--accent); }
.ws-ic { display: flex; gap: 1px; height: 18px; align-items: center; }
.ws-ic i { display: grid; color: var(--tcol); }
.ws-ic svg { width: 16px; height: 16px; }
.ws-ic .ws-rest { width: 4px; height: 4px; border-radius: 50%; background: var(--line, #2a2f37); }
.ws-day.done .ws-ic::after { content: '✓'; font-size: 12px; font-weight: 800; color: #4ade80; margin-left: 2px; }
.ws-day:active { background: var(--surface-2); }

/* ---------- the eye in a card corner: shows the explanation ---------- */
.info-wrap { position: relative; }
.info-eye {
  position: absolute; top: 6px; right: 6px; z-index: 1; width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--muted); padding: 0; cursor: pointer;
}
.info-eye svg { width: 18px; height: 18px; }
.info-eye.on { color: var(--accent); background: var(--accent-soft); }

/* Food: shopping list and Month buttons side by side in the section title */
.h-btns { display: flex; gap: 8px; }
/* "You as an athlete" tiles: every label on one line, so all tiles are the same size */
.ath-tile span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ath-tile b.warn-v { color: #f59e0b; }

/* New FTP / personal best screen (after a ride's stats) */
.rcel { justify-content: center; }
.rcel .rc-title { font-size: 32px; background: linear-gradient(180deg, #ffd27a, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rcel .acel-stat { width: min(420px, 100%); margin-top: 18px; }
.rc-ftp .cel-num b { font-size: 52px; color: #fde68a; }
.rc-pb .cel-ic { background: rgba(250, 204, 21, 0.14); color: #facc15; }
.rc-msg { min-height: 1.4em; margin-top: 12px; font-size: 13px; font-weight: 650; color: var(--muted); text-align: center; }
