/* styles.css
   Phone first, bold and sporty, in two looks you can switch in More: Pulse (the default) and Bento.
   Section 1 holds the Pulse colours and fonts; section 12 re-skins everything for Bento.

   Sections: 1 tokens and fonts  2 base  3 buttons and forms  4 Today  5 Workout  6 Meals and tiles
             7 sheets and timers  8 Progress  9 Plans, welcome, editor, builder  10 nav, toast
             (then smaller feature blocks)  11 Pulse touches  12 Bento */

/* ---------- 1. tokens ---------- */
/* Two looks, switched in More (data-style on <html>, set by js/theme-boot.js and js/theme.js):
     Pulse (the default)  dark and sporty: deep navy, hot orange, tall condensed numbers
     Bento                bright blocks: cream paper, thick black outlines, pink / yellow / blue
   Each look has a dark and a light theme (data-theme). The Pulse tokens are here; Bento's are in section 12.
   Fonts are bundled in fonts/ (SIL Open Font License), so nothing is fetched from anyone else. */
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap; src: url('../fonts/manrope-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 600 700; font-display: swap; src: url('../fonts/manrope-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 800 900; font-display: swap; src: url('../fonts/manrope-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600 700; font-display: swap; src: url('../fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800 900; font-display: swap; src: url('../fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 400 500; font-display: swap; src: url('../fonts/space-grotesk-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 600 900; font-display: swap; src: url('../fonts/space-grotesk-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-weight: 400 900; font-display: swap; src: url('../fonts/space-mono-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #07090d;
  --surface: #12151c;
  --surface-2: #1b1f29;
  --surface-3: #232835;
  --line: rgba(255, 255, 255, 0.07);
  --text: #f3f5f8;
  --muted: #8b93a3;
  --accent: #ff6a2b;
  --accent-ink: #1a0a00;
  --accent-text: #ff8a52; /* the accent when it is used for text on the page */
  --danger: #ff7a7a;
  --warn: #ffc44d;
  --water: #a78bfa;
  --eat: #2ec4ff;
  --radius: 24px;
  --radius-sm: 16px;
  --tap: 56px;
  --nav-h: 66px;
  --nav-lift: 10px; /* the tab bar floats this far above the bottom edge */
  --base-font: 'Noto Sans', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font: 'Manrope', var(--base-font);
  --font-display: 'Barlow Condensed', var(--font); /* big titles */
  --font-num: 'Barlow Condensed', var(--font); /* big numbers */
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #efebe4;
  --surface-3: #e3ddd2;
  --line: rgba(0, 0, 0, 0.08);
  --text: #12151c;
  --muted: #5b6270;
  --accent: #e8590c;
  --accent-ink: #ffffff;
  --accent-text: #b8420a;
  --danger: #b91c1c;
  --warn: #92400e;
  --water: #6d28d9;
  --eat: #0369a1;
  color-scheme: light;
}

/* ---------- 2. base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Safe areas (notch, status bar, gesture bar). Browsers and new WebViews give env(...); the Android app on
   older WebViews gives --safe-area-inset-* instead. Take whichever is bigger. */
:root {
  --sa-top: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --sa-bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  --sa-left: max(env(safe-area-inset-left, 0px), var(--safe-area-inset-left, 0px));
  --sa-right: max(env(safe-area-inset-right, 0px), var(--safe-area-inset-right, 0px));
}
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; } /* no stretchy bounce that drags the tab bar around */
body { overscroll-behavior: none; }
/* No visible scroll bar on touch screens (it just covers the right edge). Scrolling still works. */
@media (pointer: coarse) {
  html { scrollbar-width: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
}
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 var(--font); }
body.no-scroll { overflow: hidden; }
#app {
  max-width: 560px; margin: 0 auto;
  padding: calc(12px + var(--sa-top)) 16px calc(var(--nav-h) + var(--nav-lift) + 36px + var(--sa-bottom));
}
/* While the rest timer or the workout bar is showing, make room so they never cover content. */
body.has-rest #app { padding-top: calc(98px + var(--sa-top)); }
body.has-wkbar #app { padding-bottom: calc(var(--nav-h) + var(--nav-lift) + 110px + var(--sa-bottom)); }

h1, h2 { margin: 0; }
h2 { margin-bottom: 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.icon { flex: none; }
[hidden] { display: none !important; }
input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.clock, .stat-value, .ring-pct, .water-val, .meter-val, .set-in, .dnum { font-variant-numeric: tabular-nums; }
/* Big titles and numbers use each look's display fonts */
.page-title, .date-main, .wk-title, .welcome h1 { font-family: var(--font-display); }
.clock, .stat-value, .ring-pct, .water-val, .meter-val, .set-in, .set-n, .dnum, .sum-num, .sum-hero-num, .rest-clock, .lift-now, .burn-total b, .adjust-box input, .weight-field input, .streak b { font-family: var(--font-num); }

.card { background: var(--surface); border-radius: var(--radius); padding: 18px; margin: 0 0 14px; border: 1px solid var(--line); }
.page-title { margin: 6px 2px 14px; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; }
.page-title.tight { margin: 0; font-size: 24px; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 2px 12px; }
.hint.tight { margin: 0 0 8px; }
.pill { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 700; vertical-align: middle; }
.empty { color: var(--muted); padding: 8px 0 12px; }
.msg { border-radius: 14px; padding: 12px 14px; margin: 10px 0; font-size: 14px; }
.msg ul { margin: 6px 0 0; padding-left: 18px; }
.msg.error { background: color-mix(in srgb, var(--danger) 15%, transparent); border: 1px solid var(--danger); }
.msg.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); border: 1px solid var(--warn); }

/* ---------- 3. buttons and forms ---------- */
.btn {
  min-height: 52px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2);
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--text);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; margin: 6px 0; }
.btn.big { min-height: 64px; font-size: 18px; border-radius: 20px; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: 0.4; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-row .btn { flex: 1 1 40%; }
.back-btn { min-height: 44px; padding: 0 14px 0 8px; }
.icon-btn { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; }
.icon-btn.small { width: 44px; height: 44px; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; flex: none; }
.round.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.link-btn { display: inline-block; margin: 4px 0 0; padding: 0; background: none; border: 0; color: var(--accent-text); font-weight: 700; min-height: 44px; }

.f { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; font-size: 13px; color: var(--muted); min-width: 0; }
.f input, .f textarea, .text-input, .date-input, .notes, .import-box {
  width: 100%; min-height: 48px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; color: var(--text); font-size: 16px;
}
.date-input { width: auto; }
.notes, .import-box { padding: 12px; resize: vertical; }
.import-box { margin: 8px 0; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 160px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 0.7fr 1fr 1fr; gap: 10px; }
.grid3.even { grid-template-columns: 1fr 1fr 1fr; }
.seg { display: flex; gap: 6px; margin: 6px 0 12px; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 45%; }
.seg button { flex: 1; min-height: 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; }
.seg button[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check-line { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.check-line input { width: 24px; height: 24px; accent-color: var(--accent); }
.steps { margin: 0 0 10px; padding-left: 20px; color: var(--muted); }
.steps li { margin: 4px 0; }
.upload-row { display: flex; gap: 8px; }
.upload-row .btn { flex: 1; padding: 0 10px; }
.status { color: var(--muted); font-size: 14px; margin: 6px 2px; }

/* ---------- 4. Today ---------- */
.home-head { padding: 2px 0 0; }
.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.head-text { min-width: 0; }
.date-main { font-size: 38px; line-height: 1.05; font-weight: 800; letter-spacing: -0.035em; }
.date-sub { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.streak { display: flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-weight: 800; flex: none; }
.streak b { font-size: 20px; }
.streak span { font-size: 13px; font-weight: 700; color: var(--text); }
.plan-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 44px; margin-top: 8px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 600; }
.plan-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.strip { display: flex; gap: 8px; overflow-x: auto; margin: 10px -16px 0; padding: 6px 16px 8px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.strip::-webkit-scrollbar { display: none; }
.chip { flex: none; width: 52px; min-height: 74px; border-radius: 20px; background: var(--surface); border: 1px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; scroll-snap-align: center; }
.chip .dow { font-size: 12px; color: var(--muted); font-weight: 700; }
.chip .dnum { font-size: 20px; font-weight: 800; }
.chip.is-today { border-color: var(--accent); }
.chip.sel { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.sel .dow { color: inherit; opacity: 0.8; }
.dot { width: 7px; height: 7px; margin-top: 2px; border-radius: 50%; background: transparent; }
.dot.part { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.dot.full { background: var(--accent); }
.dot.rest { width: 9px; height: 2px; border-radius: 2px; background: var(--muted); opacity: 0.7; }
.chip.sel .dot.part { background: color-mix(in srgb, var(--accent-ink) 55%, transparent); }
.chip.sel .dot.full, .chip.sel .dot.rest { background: var(--accent-ink); }

.hero-card {
  display: flex; align-items: center; gap: 18px; margin: 14px 0 12px; padding: 20px; border-radius: 28px; border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 70%);
}
.ring { position: relative; flex: none; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-3); stroke-width: 7; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-pct { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.ring-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hero-text { min-width: 0; }
.day-title { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 44px; padding: 0; background: none; border: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; text-align: left; }
.day-title span { overflow-wrap: anywhere; }
.hero-status { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.hero-status.good { color: var(--accent-text); font-weight: 700; }

.home-cards { display: flex; flex-direction: column; gap: 12px; }
.home-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.hc-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.hc-icon { width: 48px; height: 48px; border-radius: 16px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.hc-icon.meal { background: color-mix(in srgb, var(--eat) 16%, transparent); color: var(--eat); }
.hc-text { display: flex; flex-direction: column; min-width: 0; }
.hc-text b { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.hc-text span { color: var(--muted); font-size: 14px; }
.hc-next { margin: 10px 0 6px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.hc-next b { color: var(--text); }
.home-card .btn.wide { margin: 8px 0 0; }
.home-card .hc-top:last-child { margin-bottom: 0; }

.callout { background: var(--surface); border-left: 4px solid var(--accent); border-radius: 14px; padding: 12px 14px; margin: 14px 0 0; color: var(--muted); }
details.callout { padding: 0 14px; }
details.callout summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--text); }
details.callout p { margin: 0 0 12px; white-space: pre-line; }

.sec { margin: 26px 0 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 10px; }
.sec-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; text-transform: none; color: var(--text); }

/* ---------- 5. Workout mode ---------- */
.date-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.date-bar-title { flex: 1; min-width: 0; min-height: 52px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 6px; padding: 4px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: left; }
.date-bar-title b { font-size: 16px; }
.date-bar-title span { grid-column: 1; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-bar-title .icon { grid-column: 2; grid-row: 1 / span 2; color: var(--muted); }
.wk-title { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -0.035em; margin: 8px 0 4px; overflow-wrap: anywhere; }
.wk-meta { margin: 0 0 12px; color: var(--muted); }
.wk-progress { margin: 0 0 14px; }
.wk-progress-text { display: block; margin-bottom: 6px; font-weight: 700; font-size: 14px; color: var(--muted); }
.bar { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar.big { height: 12px; margin-top: 0; }
.bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }
.cta { box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 28%, transparent); }
.live { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; }
.live .clock { margin-left: auto; font-size: 22px; font-weight: 800; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: blink 1.4s ease-in-out infinite; flex: none; }
@keyframes blink { 50% { opacity: 0.3; } }
.done-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.done-badge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.done-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.done-text span { color: var(--muted); font-size: 14px; }
.wk-bar {
  position: fixed; left: 12px; right: 12px; z-index: 20; max-width: 536px; margin: 0 auto; bottom: calc(var(--nav-h) + var(--nav-lift) + 10px + var(--sa-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px; border-radius: 22px;
  background: var(--surface-3); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.wk-bar-time { display: flex; align-items: center; gap: 10px; }
.clock.big { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }

.empty-card { text-align: center; padding: 36px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-top: 8px; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.empty-card p { color: var(--muted); margin: 8px 0 0; }

.exlist { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ex { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ex.open { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.ex-head { width: 100%; min-height: 76px; padding: 12px 14px; display: flex; align-items: center; gap: 14px; background: none; border: 0; text-align: left; }
.ex-badge { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-3); font-weight: 800; font-size: 16px; }
.ex.done .ex-badge { background: var(--accent); color: var(--accent-ink); }
.ex-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ex-title { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ex.done .ex-title { color: var(--muted); }
.ex-sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.ex.open .ex-sub { display: none; } /* the open exercise already shows its sets, so don't repeat them */
.ex-chev { color: var(--muted); display: grid; place-items: center; transition: transform 0.2s; }
.ex.open .ex-chev { transform: rotate(180deg); }
.ex-body { padding: 0 14px 16px; }
.ex-target { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.sheet-note { margin: 0 0 6px; color: var(--muted); font-style: italic; }
.last-time { background: var(--surface-2); border-radius: 14px; padding: 10px 14px; margin: 8px 0 10px; font-size: 14px; }
.sets { margin: 8px 0 4px; }
.set-head, .set-row { display: grid; grid-template-columns: 30px 1fr 1fr 62px; gap: 8px; align-items: center; }
.set-head.timed, .set-row.timed { grid-template-columns: 30px 1fr 62px; }
.set-head { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; text-align: center; padding-bottom: 6px; }
.set-row { margin-bottom: 8px; }
.set-n { text-align: center; font-weight: 800; color: var(--muted); font-size: 18px; }
.set-in { width: 100%; min-width: 0; min-height: 64px; text-align: center; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; color: var(--text); }
.set-in::placeholder { color: var(--muted); opacity: 0.5; font-weight: 700; font-size: 18px; }
.set-in:focus { border-color: var(--accent); outline: none; }
.set-row.done .set-in { opacity: 0.6; }
.set-check { width: 62px; height: 64px; border-radius: 18px; border: 2px solid var(--surface-3); background: transparent; color: color-mix(in srgb, var(--muted) 45%, transparent); display: grid; place-items: center; }
.set-check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.set-timed { font-size: 20px; font-weight: 800; text-align: center; min-height: 64px; display: grid; place-items: center; background: var(--surface-2); border-radius: 16px; }
.set-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* ---------- 6. Meals and tiles ---------- */
.meters { display: flex; flex-direction: column; gap: 16px; margin: 6px 0 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.meter-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.meter-label { color: var(--muted); font-weight: 700; font-size: 14px; }
.meter-val { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.meter-of { color: var(--muted); font-size: 14px; }
.meter .bar { height: 12px; margin-top: 8px; }
.meter-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }

.tiles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tile { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 6px 14px 6px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.check { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; color: transparent; display: grid; place-items: center; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s; }
.tile.done .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tile-hit { flex: 1; min-width: 0; min-height: 60px; padding: 6px 0; background: none; border: 0; text-align: left; display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; }
.tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-title { font-weight: 800; font-size: 17px; overflow-wrap: anywhere; }
.tile.done .tile-title { color: var(--muted); }
.tile-sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.tile-prog { color: var(--accent-text); font-size: 13px; font-weight: 700; }
.tile-prog:empty { display: none; }
.time { display: inline-block; margin-right: 8px; font-size: 13px; font-weight: 800; color: var(--accent-text); }
.tile.water { gap: 12px; padding: 12px 14px; }
.water-icon { color: var(--water); }
.water-main { flex: 1; min-width: 0; }
.water-val { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.water-of { color: var(--muted); }
.tile.water .bar { margin-top: 8px; }
.tile.water .bar-fill { background: var(--water); }
.tile.water .bar-fill.complete { background: var(--accent); }

/* ---------- 7. sheets and timers ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 0.2s; pointer-events: auto; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-radius: 28px 28px 0 0; transform: translateY(100%); transition: transform 0.22s ease; pointer-events: auto; padding-bottom: var(--sa-bottom); box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4); }
.sheet-root.open .sheet { transform: none; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 10px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px 4px 20px; flex: none; }
.sheet-title { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; text-transform: none; color: var(--text); overflow-wrap: anywhere; }
.sheet-body { overflow-y: auto; padding: 4px 20px 20px; -webkit-overflow-scrolling: touch; }
.sheet-target { margin: 0 0 6px; color: var(--muted); }
.jump-list { list-style: none; margin: 0; padding: 0; }
.jump-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px; padding: 8px 4px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; }
.jump-list li:first-child .jump-item { border-top: 0; }
.jump-item.current .jump-label { color: var(--accent-text); font-weight: 800; }
.jump-label { overflow-wrap: anywhere; }
.jump-date { color: var(--muted); font-size: 14px; flex: none; }

.rest-bar { position: fixed; left: 12px; right: 12px; z-index: 50; max-width: 536px; margin: 0 auto; top: calc(10px + var(--sa-top)); display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 20px; background: var(--surface-3); border: 2px solid var(--accent); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.rest-bar.done { background: var(--accent); color: var(--accent-ink); animation: pulse 0.6s ease 3; }
.rest-bar.done .btn { color: var(--text); }
.rest-info { flex: 1; min-width: 0; }
.rest-title { font-size: 13px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest-clock { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -0.02em; }
@keyframes pulse { 50% { transform: scale(1.03); } }

/* ---------- 8. Progress ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats.four { grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 8px; text-align: center; }
.stat-icon { color: var(--accent); display: grid; place-items: center; }
.stat-value { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; }
.stat-value.small { font-size: 20px; }
.stat-label { font-size: 12px; color: var(--muted); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { margin: 0; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-day { aspect-ratio: 1; min-height: 40px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); font-weight: 700; font-size: 14px; color: var(--text); }
.cal-day:disabled { opacity: 0.3; cursor: default; }
.cal-day.future { color: var(--muted); }
.cal-day.is-today { border-color: var(--text); }
.lv1 { background: color-mix(in srgb, var(--accent) 25%, var(--surface-2)); }
.lv2 { background: color-mix(in srgb, var(--accent) 50%, var(--surface-2)); }
.lv3 { background: color-mix(in srgb, var(--accent) 75%, var(--surface-2)); color: var(--accent-ink); }
.lv4 { background: var(--accent); color: var(--accent-ink); }
.legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.swatch { width: 16px; height: 16px; border-radius: 5px; background: var(--surface-2); display: inline-block; }

/* ---------- 9. plans, welcome, editor, builder, data ---------- */
.plan-list { list-style: none; margin: 0 0 12px; padding: 0; }
.plan { padding: 16px; margin: 0 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.plan.active { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.plan-name { font-weight: 800; font-size: 18px; overflow-wrap: anywhere; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.plan-actions .btn { flex: 1 1 auto; }
.row-meta { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; margin: 2px 0 0; }
.row-title { font-weight: 700; overflow-wrap: anywhere; }
.options { display: flex; flex-direction: column; gap: 12px; }
.options.tight { gap: 8px; margin-bottom: 8px; }
.option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 88px; padding: 14px 16px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.option.big { min-height: 104px; }
.options.tight .option { min-height: 68px; padding: 10px 14px; }
.option.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.option.sel .icon { color: var(--accent); }
.option-icon { width: 52px; height: 52px; border-radius: 16px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.option-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.option-text b { font-size: 18px; font-weight: 800; }
.option-text span { color: var(--muted); font-size: 14px; }
.welcome { text-align: center; padding: 28px 8px 12px; }
.welcome-logo { border-radius: 20px; margin-bottom: 14px; }
.welcome h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.035em; }
.welcome p { color: var(--muted); margin: 8px auto 0; max-width: 32ch; }
.welcome-q { margin: 24px 4px 10px; }

.edit-bar { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.edit-bar .btn { min-height: 44px; padding: 0 14px; }
.block { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 0 0 12px; }
.block .f input, .block .f textarea { background: var(--surface); }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.day-list { list-style: none; margin: 0 0 8px; padding: 0; }
.day-link { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 12px 4px; min-height: var(--tap); background: none; border: 0; border-top: 1px solid var(--line); }
.day-list li:first-child .day-link { border-top: 0; }

.q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; margin: 0 0 12px; }
.q h2 { margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chipbtn { min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; }
.chipbtn[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.week-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.week-list li { display: flex; gap: 8px; align-items: baseline; font-size: 15px; }
.week-list b { color: var(--accent-text); width: 32px; flex: none; }
.week-list span { color: var(--muted); overflow-wrap: anywhere; }
.mini-list { list-style: none; margin: 0 0 12px; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.mini-list li:first-child { border-top: 0; }
.mini-list span { color: var(--muted); flex: none; }

.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv:first-of-type { border-top: 0; }
.kv-label { color: var(--muted); }
.kv-value { font-weight: 700; text-align: right; }
.good-text { color: var(--accent-text); }
.warn-text { color: var(--warn); }
.fold { margin-top: 10px; border-top: 1px solid var(--line); }
.fold summary { min-height: 52px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.nudge { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; padding: 14px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border: 1px solid var(--warn); }
.nudge p { margin: 0; font-size: 15px; }
.nudge-actions { display: flex; gap: 8px; }
.nudge-actions .btn { flex: 1; min-height: 48px; }

/* ---------- 10. tab bar and toast ---------- */
#nav { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-lift) + var(--sa-bottom)); z-index: 10; max-width: 536px; margin: 0 auto; display: flex; justify-content: space-around; padding: 0 4px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 34px -10px rgba(0, 0, 0, 0.6); }
.tab { flex: 1; max-width: 120px; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.tab.active { color: var(--accent); }
.toast { position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; max-width: calc(100vw - 32px); z-index: 60; bottom: calc(var(--nav-h) + var(--nav-lift) + 20px + var(--sa-bottom)); transform: translateY(20px); text-align: center; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 16px; font-weight: 700; opacity: 0; transition: opacity 0.25s, transform 0.25s; }
.toast.show { opacity: 1; transform: translateY(0); }

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

/* ----- Weekly / monthly summary (Progress) ----- */
.sum { margin-top: 16px; }
.sum-hero { text-align: center; padding: 6px 0 2px; }
.sum-hero-num { font-size: 56px; font-weight: 900; letter-spacing: -0.04em; line-height: 1.05; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.sum-hero-label { color: var(--muted); font-size: 14px; display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.sum-bars { display: flex; align-items: flex-end; gap: 6px; height: 84px; margin: 16px 0 4px; }
.sum-bars.month { gap: 2px; }
.sum-bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.sum-bar { width: 100%; border-radius: 6px; background: var(--surface-2); }
.sum-bar.on { background: var(--accent); }
.sum-bar-days { display: flex; gap: 6px; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.sum-bar-days span { flex: 1; text-align: center; }
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.sum-tile { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.sum-num { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sum-num small, .lift-now small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.sum-label { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sum-sub { font-size: 16px; margin: 20px 0 6px; display: flex; gap: 8px; align-items: center; }
.sum-empty { margin: 12px 0; }
.delta { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.delta.up { background: var(--accent); color: var(--accent-ink); }
.delta.down { color: var(--danger); }
.lift-list { list-style: none; margin: 0; padding: 0; }
.lift { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.lift:first-child { border-top: 0; }
.lift-name { font-weight: 700; overflow-wrap: anywhere; }
.lift-now { font-weight: 800; font-variant-numeric: tabular-nums; }
.lift.rich { row-gap: 2px; }
.lift-sub { grid-column: 1 / -1; font-size: 13px; font-weight: 500; color: var(--muted); line-height: 1.35; }
.share { position: relative; width: 56px; height: 24px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; }
.share > span { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.share em { position: relative; font-style: normal; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fact { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.fact-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.fact-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.fact-text b { line-height: 1.35; }
.fact-text span { font-size: 13px; color: var(--muted); }
.fact-text .bar { margin: 0; }
.muscles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.muscles li { display: grid; grid-template-columns: 82px 1fr 32px; gap: 10px; align-items: center; font-size: 14px; }
.muscles b { text-align: right; font-variant-numeric: tabular-nums; }
.m-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.m-bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* ----- Backup sheet and the overdue dot ----- */
.tab { position: relative; }
.tab-dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 10px; height: 10px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }
.field.stack { flex-direction: column; align-items: stretch; gap: 6px; }
.name-row { display: flex; align-items: center; gap: 6px; }
.name-row input { flex: 1; min-width: 0; min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 0 14px; font-size: 16px; }
.ext { color: var(--muted); font-weight: 700; }

/* ----- Calories in the workout summary ----- */
.burn-total { text-align: center; margin: 4px 0 8px; color: var(--muted); }
.burn-total b { color: var(--accent-text); font-size: 26px; font-weight: 900; letter-spacing: -0.02em; }
.burn-list { list-style: none; margin: 0 0 12px; padding: 0; }
.burn-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.burn-list li span:last-child { color: var(--muted); white-space: nowrap; }

/* ----- Body weight ----- */
.weight-tile { width: 100%; text-align: left; color: inherit; font: inherit; }
.weight-icon { color: var(--accent); }
.weight-cta { font-weight: 800; font-size: 20px; color: var(--accent-text); }
.weight-tile .tile-sub { color: var(--muted); font-size: 13px; }
.weight-input { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0; }
.weight-field { display: flex; align-items: baseline; gap: 6px; font-size: 20px; color: var(--muted); }
.weight-field input { width: 140px; min-height: 64px; text-align: center; font-size: 36px; font-weight: 800; letter-spacing: -0.03em; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-variant-numeric: tabular-nums; }
.weight-card { margin-top: 16px; }
.weight-hero { margin: 4px 0 10px; }
.wchart { width: 100%; height: auto; display: block; margin: 8px 0; }
.w-grid { stroke: var(--line); stroke-width: 1; }
.w-label { fill: var(--muted); font-size: 10px; }
.w-avg { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.w-dot { fill: var(--muted); opacity: 0.8; }

/* ----- Meal estimate ----- */
.est-status { margin: 6px 0 0; }

/* ----- "New version" bar ----- */
.update-banner { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--nav-lift) + 12px + var(--sa-bottom)); z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius-sm); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); font-weight: 700; }

/* ----- Notes card (Workout) ----- */
.notes-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); margin: 12px 0; overflow: hidden; }
.notes-head { display: flex; align-items: center; gap: 4px; padding-right: 8px; }
.notes-toggle { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 8px 0 16px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; }
.notes-title { font-weight: 800; }
.notes-count { color: var(--muted); font-size: 13px; flex: 1; }
.notes-toggle .chev { color: var(--muted); display: grid; transition: transform 0.2s; }
.notes-toggle .chev.up { transform: rotate(180deg); }
.notes-body { padding: 0 16px 14px; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { position: relative; padding: 8px 0 8px 18px; line-height: 1.45; border-top: 1px solid var(--line); }
.note-list li:first-child { border-top: 0; }
.note-list li::before { content: ''; position: absolute; left: 2px; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.note-label { color: var(--text); }
.note-warn { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--warn); }
.note-warn > b { color: var(--warn); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.note-warn .note-list li::before { background: var(--warn); }
.notes-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin: 12px 0; border-radius: var(--radius-sm); border: 1px dashed var(--line); background: none; color: var(--muted); font: inherit; font-weight: 700; }
.notes-edit { width: 100%; min-height: 200px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 12px; font: inherit; font-size: 16px; line-height: 1.5; margin: 8px 0; }

/* ----- Diet per day (plan builder) ----- */
.daydiets { display: grid; gap: 8px; margin: 6px 0; }
.daydiet { display: grid; grid-template-columns: 44px repeat(4, 1fr); gap: 6px; align-items: center; }
.daydiet-name { font-weight: 800; color: var(--muted); }
.daydiet button { min-height: 44px; padding: 0 1px; white-space: nowrap; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; font-size: 12px; }
.daydiet button[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.diet-tag { margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }

/* =====================================================================
   Motion and polish. Calm and quick: everything is under half a second,
   nothing loops, and it all switches off for people who ask for less motion
   (see the prefers-reduced-motion rule near the top of this file).
   ===================================================================== */
:root {
  --ease: cubic-bezier(0.22, 0.9, 0.3, 1); /* fast start, soft landing */
  --spring: cubic-bezier(0.34, 1.5, 0.64, 1); /* a small overshoot, for ticks */
  --lift: 0 1px 0 rgba(255, 255, 255, 0.045) inset, 0 14px 30px -20px rgba(0, 0, 0, 0.75);
}
:root[data-theme='light'] { --lift: 0 1px 2px rgba(15, 23, 42, 0.06), 0 14px 26px -18px rgba(15, 23, 42, 0.22); }

/* A soft glow at the top of every screen, so the page is not one flat colour. */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(100% 42% at 50% -6%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 72%); }
:root[data-theme='light'] body::before { background: radial-gradient(100% 38% at 50% -6%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 72%); }

/* Depth: cards sit slightly above the page with a faint top light. */
.card, .tile, .ex, .home-card, .notes-card, .stat, .sum-tile, .plan, .option, .callout { box-shadow: var(--lift); }
:root:not([data-theme='light']) .card, :root:not([data-theme='light']) .tile, :root:not([data-theme='light']) .ex, :root:not([data-theme='light']) .home-card { background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.032), transparent 55%); }
.btn.primary { background-image: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent)); box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
/* The glow goes on the whole ring element, not on the circle inside the SVG: a filter on an SVG shape is clipped to the SVG's square box. */
.ring-svg { overflow: visible; transition: filter 0.5s var(--ease); }
.ring.complete .ring-svg { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--accent) 60%, transparent)); }

/* ----- Press feedback: things give a little when you touch them ----- */
.btn, .tile-hit, .chip, .icon-btn, .round, .option, .set-check, .ex-head, .chipbtn, .seg button, .jump-item, .notes-toggle, .daydiet button, .plan-chip, .notes-add, .tab, .day-title, .link-btn {
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s var(--ease), background-color 0.22s var(--ease), border-color 0.22s var(--ease), color 0.22s var(--ease), box-shadow 0.22s var(--ease), opacity 0.2s;
}
.btn:active:not(:disabled), .chip:active, .icon-btn:active, .round:active, .option:active, .set-check:active, .chipbtn:active, .seg button:active, .jump-item:active, .daydiet button:active, .plan-chip:active, .notes-add:active { transform: scale(0.96); }
.tile-hit:active, .ex-head:active, .notes-toggle:active { transform: scale(0.985); }
.tab:active { transform: scale(0.92); }

/* ----- Screens glide in. The first few items rise one after another. ----- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes slide-next { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes slide-prev { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
#app.enter > * { animation: rise 0.42s var(--ease) both; }
#app.enter[data-dir='next'] > * { animation-name: slide-next; }
#app.enter[data-dir='prev'] > * { animation-name: slide-prev; }
#app.enter > *:nth-child(2) { animation-delay: 0.035s; }
#app.enter > *:nth-child(3) { animation-delay: 0.07s; }
#app.enter > *:nth-child(4) { animation-delay: 0.105s; }
#app.enter > *:nth-child(5) { animation-delay: 0.14s; }
#app.enter > *:nth-child(6) { animation-delay: 0.175s; }
#app.enter > *:nth-child(7) { animation-delay: 0.21s; }
#app.enter > *:nth-child(n + 8) { animation-delay: 0.24s; }

/* ----- Things that fill up do it smoothly ----- */
.ring-fill { transition: stroke-dashoffset 0.8s var(--ease), filter 0.4s; }
.bar-fill, .meter-fill { transition: width 0.6s var(--ease), background-color 0.3s; }

/* ----- Ticks: the check mark pops in; the set you just ticked bounces once ----- */
.check svg, .ex-badge svg { transition: transform 0.38s var(--spring), opacity 0.2s; }
.tile:not(.done) .check svg { transform: scale(0.3); opacity: 0; }
.tile.done .check svg { transform: none; opacity: 1; }
.check { transition: background-color 0.22s var(--ease), border-color 0.22s var(--ease), transform 0.3s var(--spring); }
.tile.done .check { transform: scale(1.04); }
@keyframes pop { 0% { transform: scale(0.6); } 55% { transform: scale(1.18); } 100% { transform: none; } }
.set-check.pop { animation: pop 0.4s var(--spring); }
.ex.done .ex-badge { transition: background-color 0.3s var(--ease), transform 0.3s var(--spring); }

/* ----- An exercise unfolds when it opens ----- */
@keyframes unfold { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.ex.open .ex-body { animation: unfold 0.32s var(--ease) both; }
.notes-body:not([hidden]) { animation: unfold 0.28s var(--ease) both; }
.ex { transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.ex.open { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), var(--lift); }

/* ----- Sheets and toasts ----- */
.sheet { transition: transform 0.45s var(--ease); }
.sheet-backdrop { transition: opacity 0.3s var(--ease); }
.toast { transition: opacity 0.3s var(--ease), transform 0.4s var(--spring); }

/* ----- Tab bar: a soft pill slides in behind the active tab ----- */
.tab::before { content: ''; position: absolute; top: 11px; left: 50%; width: 58px; height: 32px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 16%, transparent); transform: translateX(-50%) scale(0.4); opacity: 0; transition: transform 0.35s var(--spring), opacity 0.25s var(--ease); }
.tab.active::before { transform: translateX(-50%) scale(1); opacity: 1; }
.tab > svg, .tab > span { position: relative; }
.tab > svg { transition: transform 0.35s var(--spring); }
.tab.active > svg { transform: translateY(-1px) scale(1.06); }
.tab-dot { z-index: 2; }

/* ----- Week strip: the selected day eases in ----- */
.chip { transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.16s var(--ease); }

/* ----- Edit time and calories ----- */
.adjust-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.adjust-field { display: flex; flex-direction: column; gap: 6px; }
.adjust-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.adjust-box { display: flex; align-items: baseline; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 0 12px; min-height: 64px; }
.adjust-box:focus-within { border-color: var(--accent); }
.adjust-box input { flex: 1; min-width: 0; width: 100%; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; padding: 10px 0; }
.adjust-box input::placeholder { color: var(--muted); opacity: 0.55; font-weight: 700; }
.adjust-unit { color: var(--muted); font-weight: 700; }
.done-actions { display: flex; gap: 4px; flex: none; }
.edit-days { list-style: none; margin: 0; padding: 0; }
.edit-day { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 10px; padding: 8px 4px; background: none; border: 0; border-top: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; }
.edit-days li:first-child .edit-day { border-top: 0; }
.edit-day-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.edit-day-main small { color: var(--muted); overflow-wrap: anywhere; }
.edit-day-val { color: var(--muted); font-size: 14px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.edited-tag { font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }

/* ----- mix and match: choose exercises / meals for a day ----- */
.pick-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 4px 0 6px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 700; flex-wrap: wrap; }
.pick-btn .pill { margin-left: 2px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.home-card .pick-btn, .empty-card .pick-btn { align-self: center; margin-top: 10px; }
.pick-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.pick-chips::-webkit-scrollbar { display: none; }
.pick-chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; font-size: 14px; }
.pick-chip[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pick-search { width: 100%; min-height: 46px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 16px; }
.pick-count { font-size: 13px; color: var(--muted); margin: 10px 2px 6px; }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pick-row { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; text-align: left; min-height: 56px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.pick-row.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.pick-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: 14px; }
.pick-row.on .pick-num { background: var(--accent); color: var(--accent-ink); }
.pick-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick-text b { overflow-wrap: anywhere; }
.pick-text small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.pick-cat { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); max-width: 90px; text-align: right; overflow-wrap: anywhere; }
.pick-add { margin: 14px 0 4px; }
.pick-add summary { cursor: pointer; font-weight: 700; color: var(--accent-text); min-height: 44px; display: flex; align-items: center; }
.pick-add input { width: 100%; min-height: 46px; margin: 0 0 8px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 16px; }
.pick-actions { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 0 4px; background: linear-gradient(transparent, var(--surface) 30%); }
.pick-actions .btn { flex: 1; }

/* ----- bring in progress from another plan ----- */
.merge-list { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 8px; }
.merge-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.merge-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.merge-text b { overflow-wrap: anywhere; }
.merge-text small { color: var(--muted); font-size: 13px; }
.merge-row .btn { flex: none; }
.pick-chosen { display: flex; gap: 6px; align-items: stretch; }
.pick-chosen .pick-row { flex: 1; min-width: 0; }
.pick-moves { display: flex; flex-direction: column; gap: 4px; flex: none; }
.pick-move { flex: 1; width: 44px; min-height: 28px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.pick-move:disabled { opacity: 0.3; }
.pick-ai .pick-row { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pick-suggest { margin: 10px 0 0; }

/* ----- AI helper keys in More ----- */
.ai-block { margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.ai-block summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; cursor: pointer; }
.ai-notes { margin: 6px 0 10px; padding-left: 18px; color: var(--muted); font-size: 14px; }

/* ----- More > Library ----- */
.lib-open { margin-top: 10px; }
.lib-group { margin: 18px 0 0; }
.lib-cat { display: flex; align-items: center; gap: 8px; margin: 0 2px 8px; }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lib-row { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.lib-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lib-text b { overflow-wrap: anywhere; }
.lib-text small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.lib-row .btn { flex: none; }
.lib-row .btn[disabled] { opacity: 1; color: var(--accent); background: transparent; border-color: transparent; }

/* =====================================================================
   11. Pulse touches (the default look). Most of Pulse is just the tokens in
   section 1; these are the few places it differs in shape.
   ===================================================================== */
:root:not([data-style='bento']) .page-title,
:root:not([data-style='bento']) .date-main,
:root:not([data-style='bento']) .wk-title { text-transform: uppercase; font-weight: 800; letter-spacing: 0.005em; }
:root:not([data-style='bento']) .page-title { font-size: 40px; }
:root:not([data-style='bento']) .date-main { font-size: 50px; line-height: 0.95; }
:root:not([data-style='bento']) .wk-title { font-size: 38px; line-height: 1; }
:root:not([data-style='bento']) h2:not(.sec-title):not(.sheet-title):not(.cal-title) { letter-spacing: 0.14em; font-weight: 800; }
:root:not([data-style='bento']) .ring-pct { font-size: 38px; font-weight: 800; letter-spacing: 0; }
:root:not([data-style='bento']) .stat-value, :root:not([data-style='bento']) .meter-val, :root:not([data-style='bento']) .water-val { font-size: 36px; letter-spacing: 0; }
:root:not([data-style='bento']) .set-in { font-size: 32px; letter-spacing: 0; }
:root:not([data-style='bento']) .sum-hero-num { font-size: 66px; letter-spacing: 0; }
:root:not([data-style='bento']) .clock.big, :root:not([data-style='bento']) .rest-clock { font-size: 38px; letter-spacing: 0; }
:root:not([data-style='bento']) .hero-card { border-color: var(--line); background: var(--surface); }
:root:not([data-style='bento']) .ring-fill { stroke-width: 8; }
:root:not([data-style='bento']) .ring-track { stroke-width: 8; }
:root:not([data-style='bento']) .streak { background: color-mix(in srgb, var(--accent) 16%, var(--bg)); color: var(--accent-text); }
:root:not([data-style='bento']) .streak span { color: inherit; }
:root:not([data-style='bento']) .chip.sel { box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
:root:not([data-style='bento']) #nav { justify-content: space-between; align-items: center; padding: 8px; border-radius: 28px; }
:root:not([data-style='bento']) .tab { flex: 0 0 48px; height: 48px; border-radius: 22px; }
:root:not([data-style='bento']) .tab::before { display: none; }
/* only the open tab shows its name, in an orange pill; the others are icons (their names stay readable to screen readers) */
:root:not([data-style='bento']) .tab:not(.active) > span:not(.tab-dot) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:root:not([data-style='bento']) .tab.active { flex: 0 0 auto; flex-direction: row; gap: 6px; padding: 0 16px; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800; }
:root:not([data-style='bento']) .tab.active > svg { transform: none; }
:root:not([data-style='bento']) .tab-dot { top: 4px; left: 30px; }

/* Pulse colour code: orange = Move (workout), cyan = Eat (meals), violet = Water */
.tri-card { flex-wrap: wrap; gap: 4px 16px; }
.tri-head { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tri-head .hero-status { margin: 0 0 6px; font-size: 14px; }
.tri-track, .tri-fill { fill: none; stroke-width: 10; }
.tri-fill { stroke-linecap: round; transition: stroke-dashoffset 0.8s var(--ease); }
.tri-fill.none { stroke-linecap: butt; }
.tri-track.tri-0 { stroke: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.tri-track.tri-1 { stroke: color-mix(in srgb, var(--eat) 18%, var(--surface)); }
.tri-track.tri-2 { stroke: color-mix(in srgb, var(--water) 20%, var(--surface)); }
.tri-fill.tri-0 { stroke: var(--accent); }
.tri-fill.tri-1 { stroke: var(--eat); }
.tri-fill.tri-2 { stroke: var(--water); }
.ring.tri.complete .ring-svg { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 55%, transparent)); }
.tri-legend { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 10px; }
.tri-row small { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; }
.tri-move small { color: var(--accent-text); }
.tri-eat small { color: var(--eat); }
.tri-water small { color: var(--water); }
.tri-num { font-family: var(--font-num); font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tri-num span { color: var(--muted); }
.btn.split { justify-content: space-between; padding: 0 10px 0 22px; }
.cta-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 16px; background: rgba(0, 0, 0, 0.14); font-family: var(--font-num); font-size: 22px; font-variant-numeric: tabular-nums; }
:root[data-style='bento'] .cta-chip { background: transparent; border: 2px solid currentColor; font-size: 18px; padding: 6px 10px; border-radius: 10px; }
:root:not([data-style='bento']) .meal-card .bar-fill { background: var(--eat); }
:root:not([data-style='bento']) .meal-card .hc-next b { color: var(--eat); }
:root:not([data-style='bento']) .wk-card .hc-icon { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
:root:not([data-style='bento']) .tile.done .check { background: var(--eat); border-color: var(--eat); color: #00141c; }
:root:not([data-style='bento']) .tile .time, :root:not([data-style='bento']) .tile-prog { color: var(--eat); }
:root:not([data-style='bento']) .meter-fill { background: var(--eat); }
:root:not([data-style='bento']) .tile.water .round.primary { background: var(--water); border-color: var(--water); color: #12082a; }
:root:not([data-style='bento']) .tile.water .bar-fill.complete { background: var(--water); }
:root:not([data-style='bento']) .stat:nth-child(3n + 2) .stat-icon { color: var(--eat); }
:root:not([data-style='bento']) .stat:nth-child(3n) .stat-icon { color: var(--water); }
:root[data-theme='light']:not([data-style='bento']) .tile.done .check { color: #ffffff; }
:root[data-theme='light']:not([data-style='bento']) .tile.water .round.primary { color: #ffffff; }

/* The Look picker in More */
.style-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.style-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; min-height: 112px; text-align: left; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--surface-2); color: var(--text); }
.style-opt[aria-pressed='true'] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.style-opt b { font-size: 17px; }
.style-opt small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.style-swatch { display: flex; gap: 4px; margin-bottom: 6px; }
.style-swatch i { width: 22px; height: 22px; border-radius: 7px; }
.style-pulse .style-swatch i:nth-child(1) { background: #07090d; border: 1px solid #3a404e; }
.style-pulse .style-swatch i:nth-child(2) { background: #ff6a2b; }
.style-pulse .style-swatch i:nth-child(3) { background: #2ec4ff; border-radius: 50%; }
.style-bento .style-swatch i { border: 2px solid #111; }
.style-bento .style-swatch i:nth-child(1) { background: #ff4f8b; }
.style-bento .style-swatch i:nth-child(2) { background: #ffd23f; }
.style-bento .style-swatch i:nth-child(3) { background: #3d5afe; }
.sub-h { margin-top: 4px; }

/* =====================================================================
   12. Bento. Cream paper, thick outlines, hard offset shadows, colour blocks.
   Everything is scoped to [data-style='bento'], so Pulse never sees it.
   ===================================================================== */
:root[data-style='bento'] {
  --bg: #fff4dc;
  --surface: #ffffff;
  --surface-2: #fffaf0;
  --surface-3: #f3e6c8;
  --line: #111111;
  --ink: #111111; /* outlines and hard shadows */
  --on-block: #111111; /* text on the pink / yellow blocks */
  --text: #111111;
  --muted: #4d4636;
  --accent: #ff4f8b;
  --accent-ink: #111111;
  --accent-text: #b5124f;
  --yellow: #ffd23f;
  --blue: #3d5afe;
  --danger: #c81e1e;
  --warn: #8a5a00;
  --water: #3d5afe;
  --eat: #3d5afe;
  --bw: 2.5px;
  --hard: 4px 4px 0 var(--ink);
  --radius: 22px;
  --radius-sm: 14px;
  --lift: var(--hard);
  --font: 'Space Grotesk', var(--base-font);
  --font-display: 'Space Grotesk', var(--base-font);
  --font-num: 'Space Mono', ui-monospace, monospace;
  color-scheme: light;
}
:root[data-style='bento'][data-theme='dark'] {
  --bg: #16140f;
  --surface: #221f18;
  --surface-2: #2b271e;
  --surface-3: #3b3527;
  --line: #f5ecd6;
  --ink: #f5ecd6;
  --text: #f5ecd6;
  --muted: #c2b89f;
  --accent-text: #ff7aa8;
  --blue: #5c76ff;
  --danger: #ff8a8a;
  --warn: #ffc44d;
  --water: #8fa2ff;
  --eat: #8fa2ff;
  --hard: 4px 4px 0 #000;
  --lift: var(--hard);
  color-scheme: dark;
}

/* paper with a faint dot grid instead of the glow */
:root[data-style='bento'] body::before { background: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1.2px, transparent 1.4px) 0 0 / 22px 22px; }
:root[data-style='bento'] .page-title, :root[data-style='bento'] .date-main, :root[data-style='bento'] .wk-title { font-weight: 700; letter-spacing: -0.03em; }
:root[data-style='bento'] .date-main { font-size: 44px; }
:root[data-style='bento'] h2:not(.sec-title):not(.sheet-title):not(.cal-title) { color: var(--text); font-weight: 700; letter-spacing: 0.08em; }
:root[data-style='bento'] .ring-pct, :root[data-style='bento'] .stat-value, :root[data-style='bento'] .meter-val, :root[data-style='bento'] .water-val, :root[data-style='bento'] .sum-num, :root[data-style='bento'] .sum-hero-num, :root[data-style='bento'] .set-in, :root[data-style='bento'] .clock { font-weight: 700; letter-spacing: -0.04em; }

/* blocks: thick outline + hard shadow, no soft gradients */
:root[data-style='bento'] :is(.card, .tile, .ex, .home-card, .notes-card, .stat, .plan, .option, .q, .meters, .empty-card, .live, .done-card, .callout, .hero-card, .lib-row, .merge-row, .nudge, .date-bar-title, .sum-tile, .fact) {
  border: var(--bw) solid var(--ink); box-shadow: var(--hard); background-image: none;
}
:root[data-style='bento'] :is(.sum-tile, .lib-row, .merge-row, .date-bar-title, .fact) { box-shadow: none; }
:root[data-style='bento'] .callout, :root[data-style='bento'] .notes-card { border-left-width: 8px; }
:root[data-style='bento'] .ex.open { box-shadow: 6px 6px 0 var(--accent); border-color: var(--ink); }

/* Today: the coloured bento tiles */
:root[data-style='bento'] .hero-card { background: var(--yellow); color: var(--on-block); }
:root[data-style='bento'] .hero-card .ring-sub, :root[data-style='bento'] .hero-card .hero-status { color: var(--on-block); opacity: 0.8; }
:root[data-style='bento'] .hero-card .hero-status.good { color: var(--on-block); opacity: 1; }
:root[data-style='bento'] .hero-card .ring-track { stroke: #ffffff; stroke-width: 9; }
:root[data-style='bento'] .hero-card .ring-fill { stroke: #111111; stroke-width: 9; stroke-linecap: butt; }
:root[data-style='bento'] .ring.complete .ring-svg { filter: none; }
:root[data-style='bento'] .wk-card { background: var(--accent); color: var(--on-block); }
:root[data-style='bento'] .wk-card .hc-text span { color: var(--on-block); opacity: 0.8; }
:root[data-style='bento'] .wk-card .btn:not(.primary), :root[data-style='bento'] .wk-card .pick-btn { background: #fff4dc; color: #111111; border-color: #111111; }
:root[data-style='bento'] .wk-card .btn.primary { background: #111111; color: #fff4dc; box-shadow: 4px 4px 0 #fff4dc; }
:root[data-style='bento'] .wk-card .hc-icon { background: #fff4dc; color: #111111; border-color: #111111; }
:root[data-style='bento'] .hc-icon, :root[data-style='bento'] .option-icon, :root[data-style='bento'] .empty-icon, :root[data-style='bento'] .fact-icon { background: var(--yellow); color: #111111; border: 2px solid var(--ink); border-radius: 14px; }
:root[data-style='bento'] .hc-icon.meal { background: var(--blue); color: #ffffff; }
:root[data-style='bento'] .streak { transform: rotate(-6deg); background: var(--yellow); color: #111111; border: var(--bw) solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); }
:root[data-style='bento'] .streak span { color: #111111; }
:root[data-style='bento'] .plan-chip { border: 2px solid var(--ink); color: var(--text); background: var(--surface); }

/* week strip */
:root[data-style='bento'] .chip { border: 2px solid var(--ink); border-radius: 16px; background: var(--surface); }
:root[data-style='bento'] .chip.is-today { box-shadow: 3px 3px 0 var(--ink); }
:root[data-style='bento'] .chip.sel { background: var(--accent); color: #111111; border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
:root[data-style='bento'] .dot.part { background: var(--accent); }
:root[data-style='bento'] .dot.full { background: var(--ink); }
:root[data-style='bento'] .chip.sel .dot.full, :root[data-style='bento'] .chip.sel .dot.part { background: #111111; }

/* buttons and inputs */
:root[data-style='bento'] .btn { border: var(--bw) solid var(--ink); border-radius: 14px; background: var(--surface); }
:root[data-style='bento'] .btn.primary { background: var(--ink); background-image: none; border-color: var(--ink); color: var(--bg); box-shadow: 4px 4px 0 var(--accent); }
:root[data-style='bento'] .btn.ghost { background: transparent; }
:root[data-style='bento'] .cta { box-shadow: 4px 4px 0 var(--accent); }
:root[data-style='bento'] :is(.icon-btn, .round, .pick-btn, .pick-move, .pick-chip, .chipbtn, .seg button, .daydiet button, .set-check, .notes-add) { border: 2px solid var(--ink); }
:root[data-style='bento'] .round, :root[data-style='bento'] .icon-btn { border-radius: 14px; }
:root[data-style='bento'] :is(.seg button, .chipbtn, .pick-chip, .daydiet button)[aria-pressed='true'] { background: var(--accent); border-color: var(--ink); color: #111111; box-shadow: 3px 3px 0 var(--ink); }
:root[data-style='bento'] .round.primary { background: var(--accent); border-color: var(--ink); color: #111111; }
:root[data-style='bento'] :is(.f input, .f textarea, .text-input, .date-input, .notes, .import-box, .pick-search, .pick-add input, .name-row input, .notes-edit, .weight-field input, .adjust-box, .set-in) { border: 2px solid var(--ink); background: var(--surface-2); }
:root[data-style='bento'] .pick-btn .pill { background: var(--yellow); color: #111111; }
:root[data-style='bento'] .pill { border: 1.5px solid var(--ink); background: var(--surface); color: var(--text); }

/* workout */
:root[data-style='bento'] .ex-badge { border-radius: 12px; border: 2px solid var(--ink); background: var(--surface-2); }
:root[data-style='bento'] .ex.done .ex-badge { background: var(--accent); color: #111111; }
:root[data-style='bento'] .set-row.done { padding: 4px; margin-left: -4px; margin-right: -4px; border-radius: 14px; background: var(--yellow); }
:root[data-style='bento'] .set-row.done .set-in { opacity: 1; color: #111111; background: transparent; border-color: transparent; }
:root[data-style='bento'] .set-row.done .set-n { color: #111111; }
:root[data-style='bento'] .set-check { border-radius: 14px; color: var(--muted); }
:root[data-style='bento'] .set-check.on { background: #111111; border-color: #111111; color: var(--yellow); }
:root[data-style='bento'] .last-time { border: 2px dashed var(--ink); background: transparent; }
:root[data-style='bento'] .wk-bar { background: var(--blue); color: #ffffff; border: var(--bw) solid var(--ink); box-shadow: var(--hard); }
:root[data-style='bento'] .rest-bar { background: var(--blue); color: #ffffff; border: var(--bw) solid var(--ink); box-shadow: var(--hard); }
:root[data-style='bento'] .rest-bar .btn, :root[data-style='bento'] .wk-bar .btn { background: #fff4dc; color: #111111; border-color: #111111; box-shadow: none; }
:root[data-style='bento'] .rest-bar.done { background: var(--yellow); color: #111111; }
:root[data-style='bento'] .live-dot { background: var(--accent); }

/* meals and tiles: square ticks */
:root[data-style='bento'] .check { border-radius: 14px; border: var(--bw) solid var(--ink); }
:root[data-style='bento'] .tile.done .check { background: var(--yellow); border-color: var(--ink); color: #111111; }
:root[data-style='bento'] .tile.done { background: var(--surface-2); }
:root[data-style='bento'] .tile.water { background: var(--blue); color: #ffffff; }
:root[data-style='bento'] .tile.water :is(.water-icon, .water-of, .tile-sub) { color: #ffffff; }
:root[data-style='bento'] .tile.water .round { background: #fff4dc; color: #111111; border-color: #111111; }
:root[data-style='bento'] .tile.water .bar { background: rgba(255, 255, 255, 0.25); border-color: #111111; }
:root[data-style='bento'] .tile.water .bar-fill { background: #fff4dc; }
:root[data-style='bento'] .tile.water .bar-fill.complete { background: var(--yellow); }

/* bars: outlined tubes */
:root[data-style='bento'] .bar, :root[data-style='bento'] .m-bar { height: 16px; border: 2px solid var(--ink); border-radius: 6px; background: var(--surface); }
:root[data-style='bento'] .bar-fill, :root[data-style='bento'] .meter-fill, :root[data-style='bento'] .m-bar span { border-radius: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 16px, var(--ink) 16px 18px); }
:root[data-style='bento'] .wk-card .bar-fill { background: #111111; }

/* progress */
:root[data-style='bento'] .stat:nth-child(3n + 1) { background: var(--yellow); color: #111111; }
:root[data-style='bento'] .stat:nth-child(3n + 2) { background: var(--accent); color: #111111; }
:root[data-style='bento'] .stat:nth-child(3n + 1) :is(.stat-label, .stat-icon), :root[data-style='bento'] .stat:nth-child(3n + 2) :is(.stat-label, .stat-icon) { color: #111111; }
:root[data-style='bento'] .stat-icon { color: var(--accent-text); }
:root[data-style='bento'] .cal-day { border: 1.5px solid var(--ink); border-radius: 10px; }
:root[data-style='bento'] .cal-day.is-today { border-width: 3px; }
:root[data-style='bento'] .sum-bar { border: 2px solid var(--ink); border-radius: 6px 6px 0 0; }
:root[data-style='bento'] .delta.up { background: var(--yellow); color: #111111; border: 1.5px solid var(--ink); }
:root[data-style='bento'] .fact { background: var(--yellow); color: #111111; }
:root[data-style='bento'] .fact .fact-text span { color: #111111; opacity: 0.75; }
:root[data-style='bento'] .fact-icon { background: #ffffff; }
:root[data-style='bento'] .share > span { background: var(--accent); }

/* plans, options, pickers */
:root[data-style='bento'] .plan.active, :root[data-style='bento'] .option.sel { background: color-mix(in srgb, var(--yellow) 45%, var(--surface)); border-color: var(--ink); }
:root[data-style='bento'] .pick-row { border: 2px solid var(--ink); }
:root[data-style='bento'] .pick-row.on { background: color-mix(in srgb, var(--yellow) 50%, var(--surface)); border-color: var(--ink); }
:root[data-style='bento'] .pick-num { border: 2px solid var(--ink); border-radius: 9px; }
:root[data-style='bento'] .pick-row.on .pick-num { background: var(--accent); color: #111111; }
:root[data-style='bento'] .ai-block { border: 2px dashed var(--ink); }
:root[data-style='bento'] .style-opt { border: var(--bw) solid var(--ink); }
:root[data-style='bento'] .style-opt[aria-pressed='true'] { background: var(--yellow); color: #111111; box-shadow: var(--hard); }
:root[data-style='bento'] .style-opt[aria-pressed='true'] small { color: #111111; }
:root[data-style='bento'] .edited-tag { background: var(--yellow); color: #111111; border: 1.5px solid var(--ink); }

/* sheets, toast, banner */
:root[data-style='bento'] .sheet { border: var(--bw) solid var(--ink); border-bottom: 0; box-shadow: 0 -6px 0 var(--accent); }
:root[data-style='bento'] .sheet-grab { background: var(--ink); }
:root[data-style='bento'] .toast { background: var(--ink); color: var(--bg); border-radius: 14px; box-shadow: 4px 4px 0 var(--accent); }
:root[data-style='bento'] .update-banner { border: var(--bw) solid var(--ink); box-shadow: var(--hard); }

/* tab bar: a black slab with a pink block on the open tab */
:root[data-style='bento'] #nav { background: #111111; border: var(--bw) solid #111111; border-radius: 20px; padding: 6px; gap: 6px; box-shadow: 4px 4px 0 var(--accent); }
:root[data-style='bento'][data-theme='dark'] #nav { background: #000000; border-color: var(--ink); }
:root[data-style='bento'] .tab { height: calc(var(--nav-h) - 12px); border-radius: 14px; color: #fff4dc; border: 2px solid transparent; }
:root[data-style='bento'] .tab::before { display: none; }
:root[data-style='bento'] .tab.active { background: var(--accent); color: #111111; border-color: #111111; }
:root[data-style='bento'] .tab-dot { border-color: #111111; }

/* ----- Progress photos (Progress screen) ----- */
.ph-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ph-head h2 { margin-bottom: 2px; }
.ph-strip { display: flex; gap: 10px; overflow-x: auto; margin: 14px -18px 6px; padding: 2px 18px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.ph-strip::-webkit-scrollbar { display: none; }
.ph-item { flex: 0 0 78%; max-width: 360px; scroll-snap-align: center; }
.ph-slide { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.ph-slide img, .ph-big img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
/* the date along the bottom, like a watermark */
.ph-mark { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 34px 12px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.62)); color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); pointer-events: none; }
.ph-mark b { font-family: var(--font-num); font-size: 20px; font-weight: 800; letter-spacing: 0.02em; }
.ph-mark small { font-size: 12px; font-weight: 700; opacity: 0.88; }
.ph-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 2px 0 4px; }
.ph-pos { min-width: 64px; text-align: center; color: var(--muted); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ph-add { margin-top: 12px; }
.ph-add .btn { white-space: nowrap; padding: 0 12px; }
.ph-big { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-height: 62vh; margin: 0 auto 12px; }
.ph-big img { object-fit: contain; }
.ph-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-side { margin: 0; }
.ph-side .ph-big { margin: 0; }
.ph-side .ph-mark b { font-size: 15px; }
:root:not([data-style='bento']) .ph-mark b { text-transform: uppercase; font-size: 24px; }
:root:not([data-style='bento']) .ph-side .ph-mark b { font-size: 17px; }
/* Bento: outlined photo blocks, the date on a yellow sticker */
:root[data-style='bento'] .ph-slide, :root[data-style='bento'] .ph-big { border: var(--bw) solid var(--ink); box-shadow: var(--hard); }
:root[data-style='bento'] .ph-item { padding: 0 4px 4px 0; }
:root[data-style='bento'] .ph-mark { left: 10px; right: auto; bottom: 10px; align-items: flex-start; padding: 6px 10px; border: 2px solid #111; border-radius: 10px; background: #ffd23f; color: #111; text-shadow: none; transform: rotate(-3deg); }
:root[data-style='bento'] .ph-mark b { font-size: 16px; }
