/* Seemless Fit: "Teal & Paper" look.
   Warm paper background, ink text, teal gradient for the one main action, gold only for rewards.
   Text uses the phone's own system font (San Francisco on iPhone, Roboto on Android, Segoe UI on Windows):
   simple to read and nothing extra to download. Cards are flat with a thin ink edge,
   buttons have a pressable bottom edge, and small hand-drawn touches (squiggles, stickers) keep it human. */

:root {
  --bg: #f6f1ea; --card: #fffcf8; --card-2: #efe8df; --line: #e4dacd; --ink-edge: #d9cdbd;
  --text: #1f1a17; --muted: #665a50;
  --g1: #2dd4bf; --g2: #0d9488; --g3: #134e4a; --accent: #0f766e; --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--card)); --accent-2: var(--g1);
  --grad: linear-gradient(135deg, var(--g3) 0%, var(--g2) 48%, var(--g1) 100%);
  --grad-soft: linear-gradient(135deg, var(--g1), var(--g2) 60%, var(--g3));
  --official: #fffcf8; --official-bg: #1f1a17; --verified: #1d7a46; --verified-bg: #dcf2e3;
  --community: #1f5f8b; --community-bg: #e1eef7; --disputed: #a14a0b; --disputed-bg: #fde8cf;
  --estimated: #6b6159; --estimated-bg: #ece5dc;
  --protein: #1d8a5a; --carbs: #e09a1a; --fat: #7a5cd6;
  --gold: #9a5800; --gold-grad: linear-gradient(135deg, #ffe08a 0%, #f5a623 55%, #e5701a 100%); --gold-soft: #fdf0cf;
  --electron: #f5a623;
  --radius: 20px; --radius-s: 14px;
  --shadow: 0 1px 0 var(--ink-edge), 0 8px 24px -14px rgba(60, 30, 10, .25);
  --press: 0 3px 0 var(--g3);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --display: var(--font);
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14100e; --card: #1f1a17; --card-2: #2a231f; --line: #342b26; --ink-edge: #0b0807;
    --text: #f7efe7; --muted: #ab9e93; --accent: #2dd4bf; --accent-ink: #fff;
    --official: #1f1a17; --official-bg: #f7efe7; --verified: #7be0a6; --verified-bg: #143524;
    --community: #8ec7ee; --community-bg: #16303f; --disputed: #ffb56b; --disputed-bg: #43260c;
    --estimated: #c5b9ae; --estimated-bg: #2e2723;
    --protein: #5fd39a; --carbs: #ffc14d; --fat: #a996ff;
    --gold: #ffc24a; --gold-soft: rgba(245, 166, 35, .16); --electron: #fff;
    --shadow: 0 1px 0 var(--ink-edge); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14100e; --card: #1f1a17; --card-2: #2a231f; --line: #342b26; --ink-edge: #0b0807;
  --text: #f7efe7; --muted: #ab9e93; --accent: #2dd4bf; --accent-ink: #fff;
  --official: #1f1a17; --official-bg: #f7efe7; --verified: #7be0a6; --verified-bg: #143524;
  --community: #8ec7ee; --community-bg: #16303f; --disputed: #ffb56b; --disputed-bg: #43260c;
  --estimated: #c5b9ae; --estimated-bg: #2e2723;
  --protein: #5fd39a; --carbs: #ffc14d; --fat: #a996ff;
  --gold: #ffc24a; --gold-soft: rgba(245, 166, 35, .16); --electron: #fff;
  --shadow: 0 1px 0 var(--ink-edge); color-scheme: dark;
}

/* ---- main colour choices (Me → Appearance) ---- */
:root[data-accent="purple"] { --g1: #c084fc; --g2: #7c3aed; --g3: #4c1d95; --accent: #7c3aed; }
:root[data-accent="blue"] { --g1: #38bdf8; --g2: #2563eb; --g3: #1e3a8a; --accent: #2563eb; }
:root[data-accent="red"] { --g1: #ff7a45; --g2: #e8352b; --g3: #b3152b; --accent: #d92f25; }
:root[data-accent="pink"] { --g1: #fb7fb5; --g2: #db2777; --g3: #831843; --accent: #db2777; }
@media (prefers-color-scheme: dark) {
  :root[data-accent="purple"]:not([data-theme="light"]) { --accent: #b197fc; }
  :root[data-accent="blue"]:not([data-theme="light"]) { --accent: #60a5fa; }
  :root[data-accent="red"]:not([data-theme="light"]) { --accent: #ff5a47; }
  :root[data-accent="pink"]:not([data-theme="light"]) { --accent: #f472b6; }
}
:root[data-theme="dark"][data-accent="purple"] { --accent: #b197fc; }
:root[data-theme="dark"][data-accent="blue"] { --accent: #60a5fa; }
:root[data-theme="dark"][data-accent="red"] { --accent: #ff5a47; }
:root[data-theme="dark"][data-accent="pink"] { --accent: #f472b6; }
.acc-red { background: linear-gradient(135deg, #b3152b, #e8352b 50%, #ff7a45); }
.acc-purple { background: linear-gradient(135deg, #4c1d95, #7c3aed 50%, #c084fc); }
.acc-blue { background: linear-gradient(135deg, #1e3a8a, #2563eb 50%, #38bdf8); }
.acc-teal { background: linear-gradient(135deg, #134e4a, #0d9488 50%, #2dd4bf); }
.acc-pink { background: linear-gradient(135deg, #831843, #db2777 50%, #fb7fb5); }

/* ---- base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15.5px/1.5 var(--font); font-weight: 450;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: var(--font); }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-family: var(--display); }
h1 { font-size: 27px; font-weight: 800; letter-spacing: -.6px; }
h2 { font-size: 17.5px; font-weight: 750; letter-spacing: -.25px; }
h3 { font-size: 15.5px; font-weight: 700; }
p { margin: 0; }
small, .muted { color: var(--muted); }
#view { max-width: 640px; margin: 0 auto; padding: 0 16px; position: relative; z-index: 1; }

/* ---- header ---- */
.head { display: flex; align-items: center; gap: 10px; padding: calc(16px + env(safe-area-inset-top)) 0 14px; }
.head h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--card); color: var(--text);
  box-shadow: var(--shadow); border: 1px solid var(--line); flex: none; }
.brandbar { display: flex; align-items: center; gap: 8px; padding-top: calc(12px + env(safe-area-inset-top)); }
.brandbar + .head { padding-top: 8px; }
.brandname { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.5px; color: var(--text); }
.brandbar small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.brand-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.top-btn { height: 38px; min-width: 38px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 700; font-size: 13.5px; }
.top-btn svg { width: 20px; height: 20px; }
.top-av { width: 38px; height: 38px; border-radius: 50%; padding: 2px; background: var(--grad); display: grid; place-items: center; overflow: hidden; }
.top-av span { width: 100%; height: 100%; border-radius: 50%; background: var(--card); display: grid; place-items: end center; overflow: hidden; }
.atom { flex: none; }
.atom .electron { fill: var(--electron); }
.brand .atom { filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--g2) 35%, transparent)); }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12px; margin: 26px 0 10px; }

/* ---- tab bar: floating, with a raised + in the middle ---- */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; pointer-events: none;
  padding: 0 12px calc(10px + env(safe-area-inset-bottom)); }
#tabs:empty { display: none; }
#tabs .tabs-inner { pointer-events: auto; display: flex; align-items: center; width: 100%; max-width: 560px; background: var(--card);
  border: 1px solid var(--line); border-radius: 24px; padding: 6px 4px; box-shadow: 0 1px 0 var(--ink-edge), 0 14px 34px -12px rgba(40, 20, 10, .35); }
#tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 3px; color: var(--muted);
  font-size: 10.5px; font-weight: 700; border-radius: 16px; position: relative; min-width: 0; }
#tabs a span { white-space: nowrap; }
#tabs a.on { color: var(--text); }
#tabs a.on::after { content: ''; position: absolute; bottom: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
#tabs svg { width: 23px; height: 23px; }
#tabs a.on svg { color: var(--accent); }
#tabs .fab { flex: none; width: 56px; height: 56px; margin: -26px 4px 0; border-radius: 20px; background: var(--grad); color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 0 var(--g3), 0 12px 24px -8px color-mix(in srgb, var(--g2) 60%, transparent); transform: rotate(-4deg); min-height: 0; padding: 0; }
#tabs .fab svg { width: 28px; height: 28px; }
#tabs .fab:active { transform: rotate(-4deg) translateY(3px); box-shadow: 0 1px 0 var(--g3); }

/* ---- cards & lists ---- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; margin-bottom: 12px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px dashed var(--line); color: var(--text); }
.item:first-child { border-top: 0; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 700; overflow-wrap: anywhere; }
.item-sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.item-meta:empty { display: none; }
.item-cal { text-align: right; font-family: var(--display); font-weight: 800; font-size: 18px; white-space: nowrap; }
.item-cal small { display: block; font-family: var(--font); font-weight: 600; font-size: 11px; }
.thumb { width: 46px; height: 46px; flex: none; border-radius: 15px; display: grid; place-items: center; font-size: 24px; background: var(--card-2); }
.thumb.t1 { background: #fde3d6; } .thumb.t2 { background: #fdf0c9; } .thumb.t3 { background: #dff1e4; } .thumb.t4 { background: #e3ecfb; } .thumb.t5 { background: #f4e2f4; }
:root[data-theme="dark"] .thumb, :root[data-theme="dark"] .thumb[class*=" t"] { background: var(--card-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .thumb[class*=" t"] { background: var(--card-2); } }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 10px; }
.section-title h2 { font-size: 19px; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.loading { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 70px 0; color: var(--muted); }

/* ---- badges: little stickers ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 750; white-space: nowrap; }
.b-official { color: var(--official); background: var(--official-bg); }
.b-verified { color: var(--verified); background: var(--verified-bg); }
.b-community { color: var(--community); background: var(--community-bg); }
.b-disputed { color: var(--disputed); background: var(--disputed-bg); }
.b-estimated { color: var(--estimated); background: var(--estimated-bg); }
.b-plain { color: var(--muted); background: var(--card-2); }
.b-healthy { color: var(--verified); background: var(--verified-bg); }

/* ---- buttons & inputs ---- */
button, .btn { font: inherit; font-weight: 700; border: 0; cursor: pointer; border-radius: 14px; padding: 11px 16px; background: var(--card-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; text-align: center;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background-color .2s, color .2s; }
.btn { box-shadow: 0 2px 0 var(--line); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--press); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--g3); }
button:active, .btn:active, .chip:active { transform: scale(.97); }
.btn-small { padding: 6px 12px; min-height: 36px; font-size: 13.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--accent); padding: 6px 8px; min-height: 34px; box-shadow: none; }
.btn-danger { color: #b42318; }
:root[data-theme="dark"] .btn-danger { color: #ff8a7a; }
.btn.on-verify { background: var(--verified-bg); color: var(--verified); }
.btn.on-dispute { background: var(--disputed-bg); color: var(--disputed); }
.btn.on, .btn-small.on { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
button:disabled { opacity: .45; cursor: default; }
.icon-btn { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); flex: none; box-shadow: none; }
label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 5px; }
input, select, textarea { font: inherit; font-size: 16px; width: 100%; padding: 12px 13px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); font-weight: 550; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.search { position: relative; margin-bottom: 12px; }
.search input { padding-left: 42px; border-radius: 18px; background: var(--card); min-height: 50px; box-shadow: var(--shadow); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); }

/* ---- chips & segmented control ---- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--card); color: var(--text); font-size: 13.5px; font-weight: 700;
  border: 1.5px solid var(--line); min-height: 0; box-shadow: none; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg { display: flex; background: var(--card-2); border-radius: 16px; padding: 4px; margin-bottom: 12px; }
.seg button { flex: 1; background: transparent; min-height: 38px; padding: 6px 4px; font-size: 13.5px; color: var(--muted); border-radius: 12px; box-shadow: none; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 0 var(--ink-edge), 0 4px 10px -6px rgba(0, 0, 0, .25); }

/* ---- Today ---- */
.head.hello { gap: 12px; align-items: flex-end; padding-bottom: 6px; }
.hello h1 { white-space: normal; line-height: 1.05; }
.hello h1 small { display: block; font-family: var(--font); font-size: 13.5px; font-weight: 650; letter-spacing: 0; margin-bottom: 4px; }
.squiggle { display: block; width: 92px; height: 10px; margin-top: 4px; color: var(--accent); }
.hello-av { flex: none; display: block; line-height: 0; margin: -6px 0 -10px; }
.streak { padding: 7px 12px; border-radius: 12px; background: var(--card); color: var(--muted); font-weight: 800; font-size: 14px; border: 1px solid var(--line);
  white-space: nowrap; transform: rotate(3deg); box-shadow: var(--shadow); }
.streak.lit { background: var(--gold-grad); color: #3a2003; border-color: transparent; box-shadow: 0 3px 0 #c56a12; }

/* stories row (Instagram-style quick actions) */
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 12px 2px 14px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; background: none; padding: 0; min-height: 0; box-shadow: none;
  color: var(--text); font-size: 11.5px; font-weight: 700; border-radius: 0; }
.story i { width: 62px; height: 62px; border-radius: 50%; padding: 2.5px; background: var(--grad); display: grid; place-items: center; font-style: normal; }
.story i b { width: 100%; height: 100%; border-radius: 50%; background: var(--card); border: 2.5px solid var(--bg); display: grid; place-items: center; font-size: 26px; }
.story.done i { background: var(--gold-grad); }
.story.plain i { background: var(--line); }

/* the big calorie card */
.cal-hero { background: var(--grad); color: #fff; border: 0; box-shadow: 0 4px 0 var(--g3), 0 18px 34px -18px color-mix(in srgb, var(--g2) 70%, transparent);
  position: relative; overflow: hidden; }
.cal-hero::before { content: ''; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.cal-hero::after { content: ''; position: absolute; left: -40px; bottom: -90px; width: 180px; height: 180px; border-radius: 50%; background: rgba(0, 0, 0, .07); }
.cal-hero > * { position: relative; z-index: 1; }
.cal-hero .icon-btn { color: rgba(255, 255, 255, .85); }
.cal-hero .muted, .cal-hero small { color: rgba(255, 255, 255, .78); }
.cal-hero .bar { background: rgba(255, 255, 255, .22); }
.cal-hero .macro b { color: #fff; }
.datebar { display: flex; align-items: center; justify-content: space-between; }
.datebar strong { font-family: var(--display); font-size: 16px; font-weight: 750; }
.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 136px; height: 136px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .big { font-family: var(--display); font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.stats { flex: 1; display: grid; gap: 9px; }
.stat { display: flex; justify-content: space-between; font-size: 14px; }
.stat b { font-weight: 800; }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.macro b { font-family: var(--display); font-size: 17px; }
.macro small { display: block; font-size: 12px; }
.bar { height: 7px; background: var(--card-2); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.bar i.grad { background: var(--grad-soft); }
.ring-arc { animation: ring-in .9s var(--ease) both; }
@keyframes ring-in { from { stroke-dasharray: var(--from, 0px) 999px; } } /* D-081: from where it was a moment ago */
.big-add { width: 100%; margin: 4px 0 14px; min-height: 54px; font-size: 16.5px; border-radius: 18px; }
.notice { background: var(--accent-soft); color: var(--text); border-radius: 16px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 35%, transparent); }
.notice a { font-weight: 750; }
.card.meal { padding: 14px 16px; }
.card.meal .card-head { margin-bottom: 4px; }
.meal-item { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px dashed var(--line); }
.meal-item:first-of-type { border-top: 0; }
.add-mini { width: 32px; height: 32px; min-height: 32px; margin-left: 6px; color: var(--accent); font-size: 18px; background: var(--accent-soft); border-radius: 11px; }
.empty-line { font-size: 13px; padding: 2px 0; }
.water { display: flex; gap: 4px; flex: 1; flex-wrap: nowrap; min-width: 0; }
.water span { flex: 1; min-width: 0; max-width: 34px; height: 32px; border-radius: 6px 6px 11px 11px; border: 2px solid var(--line); }
.water span.full { background: linear-gradient(180deg, #7cc7ff, #2f8ae0); border-color: transparent; }
.water span.pop { animation: glass-pop .35s var(--ease); }
@keyframes glass-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .water span.pop { animation: none; } }
.water-btn:active { transform: scale(.92); }
.water-btn { width: 40px; height: 40px; min-height: 40px; font-size: 20px; background: var(--card-2); color: var(--text); border-radius: 13px; }
.row > .water-btn { flex: none; width: 40px; }
.water-btn.on { background: var(--accent-soft); color: var(--accent); }
.level { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 8px; font-size: 12px; font-weight: 800; background: var(--gold-soft); color: var(--gold); }
.rank { width: 30px; text-align: center; font-family: var(--display); font-weight: 800; color: var(--muted); flex: none; }
.rank.top { color: var(--gold); }
.hero { background: linear-gradient(140deg, #2a1712 0%, color-mix(in srgb, var(--g3) 80%, #2a1712) 45%, var(--g2) 85%, var(--g1) 100%); color: #fff; border: 0; }
.hero small, .hero .muted { color: rgba(255, 255, 255, .78); }
.hero .bar { background: rgba(255, 255, 255, .2); }
.hero .bar i, .hero .bar i.grad { background: #fff; }
.hero .bar i.gold { background: var(--gold-grad); }
.gold-text { color: #ffd166; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* energy balance & activity */
.eb-row { display: grid; grid-template-columns: 1fr auto 1fr auto 1.2fr; align-items: center; gap: 4px; text-align: center; }
.eb-row small { display: block; font-size: 12px; }
.eb-row b { font-family: var(--display); font-size: 20px; font-weight: 800; }
.eb-op { color: var(--muted); font-weight: 800; }
.eb-res { border-radius: 14px; padding: 6px 4px; background: var(--card-2); }
.eb-res.deficit { background: var(--grad); color: #fff; }
.eb-res.deficit small { color: rgba(255, 255, 255, .85); }
.eb-res.surplus { background: var(--gold-soft); color: var(--gold); }
.eb-verdict { font-weight: 800; margin: 10px 0 2px; font-size: 14.5px; }
.eb-verdict.deficit { color: var(--accent); }
.eb-verdict.surplus { color: var(--gold); }
.eb-week { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; }
.deficit-text { color: var(--accent); font-size: 17px; }
.surplus-text { color: var(--gold); font-size: 17px; }
.steps-box { display: block; width: 100%; text-align: left; background: var(--card-2); border-radius: 16px; padding: 12px 14px; min-height: 0; margin-bottom: 6px; font-weight: 500; box-shadow: none; }
.steps-n { font-size: 26px; font-weight: 900; }
.act-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.act-tiles > div { display: flex; flex-direction: column; align-items: center; background: var(--card); border-radius: 14px; padding: 10px 4px 8px; }
.act-ico { font-size: 18px; line-height: 1; margin-bottom: 4px; }
.act-tiles b { font-family: var(--display); font-size: 20px; font-weight: 800; line-height: 1.15; }
.act-tiles small { color: var(--muted); font-size: 11.5px; }
.sync-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.sync-row .btn { flex: 1 1 140px; font-size: 13px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; background: var(--card-2); padding: 9px 10px; border-radius: 10px; }
.steps-list { padding-left: 34px; }
.steps-list li { margin: 8px 0; font-size: 14.5px; line-height: 1.5; }
.guide-step { display: flex; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.guide-step:first-of-type { border-top: 0; }
.guide-n { width: 28px; height: 28px; flex: none; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; transform: rotate(-4deg); }
.guide-step p { font-size: 14px; line-height: 1.5; margin-top: 3px; color: var(--text); }

/* ---- detail screens ---- */
.big-cal { font-family: var(--display); font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -1.5px; }
.macro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.macro-grid div { background: var(--card-2); border-radius: 14px; padding: 10px; text-align: center; }
.macro-grid b { display: block; font-family: var(--display); font-size: 18px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.actions > * { flex: 1; }
.actions > .btn { white-space: nowrap; }
.steps { white-space: pre-wrap; }
.comment { padding: 10px 0; border-top: 1px dashed var(--line); }
.comment:first-child { border-top: 0; }
.comment-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.comment-head b { color: var(--text); }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 60px 32px; gap: 5px; align-items: center; margin-bottom: 6px; }
.set-row input { padding: 9px 7px; }
.set-row input[data-f="exercise"] { text-overflow: ellipsis; }
.day-box { border: 1.5px dashed var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; }
.ex-row { display: grid; grid-template-columns: 1fr 54px 70px 34px; gap: 6px; margin-bottom: 6px; }
.ex-row input { padding: 9px 8px; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.kv:first-child { border-top: 0; }
.url { font-family: ui-monospace, Consolas, monospace; font-size: 14.5px; font-weight: 650; overflow-wrap: anywhere; }
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.legend span { white-space: nowrap; }

/* ---- bottom sheet ---- */
#sheet .bg { position: fixed; inset: 0; background: rgba(28, 16, 10, .45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
#sheet .panel { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; border-radius: 26px 26px 0 0; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom); position: relative; }
#sheet .panel::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4.5px; margin-left: -20px; border-radius: 9px; background: var(--line); }
#sheet .panel-head { display: flex; align-items: center; gap: 8px; padding: 22px 16px 10px; }
#sheet .panel-head h2 { flex: 1; font-size: 20px; }
#sheet .panel-body { overflow-y: auto; padding: 0 16px 18px; }
body.locked { overflow: hidden; }

/* ---- toast & buddy pop ---- */
#toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; pointer-events: none; }
#toast div { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 650; max-width: 86vw; text-align: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22); animation: view-in .25s var(--ease) both; }
#toast div.err { background: #b42318; color: #fff; }
#buddy { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; pointer-events: none; }
.buddy-pop { display: flex; align-items: flex-end; gap: 6px; animation: pop-in 1.9s var(--ease) both; }
.bubble { background: var(--grad); color: #fff; font-weight: 800; font-size: 14px; padding: 9px 13px; border-radius: 18px 18px 18px 4px; margin-bottom: 40px;
  box-shadow: 0 3px 0 var(--g3); white-space: nowrap; }
.bubble.gold { background: var(--gold-grad); color: #3a2003; box-shadow: 0 3px 0 #c56a12; }
@keyframes pop-in { 0% { opacity: 0; transform: translateY(30px) scale(.8); } 14% { opacity: 1; transform: translateY(0) scale(1.04); } 22% { transform: scale(1); }
  82% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(16px); } }

/* ---- sign-in & tour ---- */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 0 40px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.brand h1 { font-size: 36px; letter-spacing: -1.2px; }
.tagline { color: var(--muted); margin-bottom: 22px; font-size: 15px; }
.welcome { display: flex; align-items: flex-end; gap: 10px; margin: 4px 0 14px; }
.welcome .bubble { margin-bottom: 52px; }
.tour { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.tour-top { display: flex; align-items: center; justify-content: space-between; }
.tour-slide { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 10px 6px;
  animation: view-in .35s var(--ease) both; }
.tour-slide h1 { font-size: 30px; max-width: 340px; }
.tour-slide p { font-size: 16px; line-height: 1.55; max-width: 340px; }
.tour-av { position: relative; padding: 18px; }
.tour-av::before { content: ''; position: absolute; inset: 10px; border-radius: 42% 58% 55% 45% / 50% 44% 56% 50%; background: var(--accent-soft); z-index: -1; transform: rotate(-8deg); }
.tour-dots { display: flex; justify-content: center; gap: 8px; margin: 12px 0 18px; }
.tour-dots span { width: 8px; height: 8px; border-radius: 99px; background: var(--line); transition: width .3s var(--ease), background .3s; }
.tour-dots span.on { width: 26px; background: var(--grad); }

/* ---- add-food sheet ---- */
.quick3 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.quick3 button { flex-direction: column; gap: 6px; min-height: 82px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; color: var(--text); border-radius: 18px; }
.quick3 button svg { color: var(--accent); }
/* "Type what you ate" (D-020) */
.typed-box textarea { min-height: 64px; }
.typed-item .card-head { align-items: flex-start; }
.typed-item .grid2 { align-items: end; }
.typed-cal { padding-bottom: 6px; font-size: 15px; }
.typed-cal .muted { font-size: 12.5px; margin-top: 2px; }
.typed-note { font-size: 12.5px; margin: 8px 0 4px; overflow-wrap: anywhere; }
.typed-total { position: sticky; bottom: 0; z-index: 1; }
.item.pick { width: 100%; border-radius: 0; background: none; text-align: left; font-weight: normal; box-shadow: none; }
.upload { cursor: pointer; }
.preview { width: 100%; max-height: 260px; object-fit: cover; border-radius: 16px; margin-top: 12px; display: block; }
.cal-input { width: 76px; flex: none; text-align: right; padding: 8px; }
.busy { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- food & restaurants ---- */
.scan-btn { width: 42px; height: 42px; min-height: 42px; background: var(--card); color: var(--accent); box-shadow: var(--shadow); border: 1px solid var(--line); border-radius: 14px; }
.item-wrap { display: flex; align-items: center; border-top: 1px dashed var(--line); padding-right: 10px; }
.item-wrap:first-child { border-top: 0; }
.item-wrap .item { flex: 1; border-top: 0; }
.rest-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.rest-row::-webkit-scrollbar { display: none; }
.rest-card { flex: none; width: 112px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 10px; box-shadow: var(--shadow); color: var(--text); text-align: center; }
.rest-card .logo { width: 48px; height: 48px; margin: 0 auto 8px; border-radius: 16px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 20px; color: #fff; background: var(--grad); transform: rotate(-3deg); }
.rest-card b { display: block; font-size: 13.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest-card small { font-size: 11.5px; }

/* ---- settings folds ---- */
details.fold { padding: 0; }
details.fold > summary { list-style: none; cursor: pointer; padding: 15px 16px; font-weight: 750; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '›'; margin-left: auto; color: var(--muted); font-size: 20px; transition: transform .25s var(--ease); }
details.fold[open] > summary::after { transform: rotate(90deg); }
details.fold > :not(summary) { margin-left: 16px; margin-right: 16px; max-width: calc(100% - 32px); }
details.fold[open] { padding-bottom: 16px; }
details.fold[open] > :not(summary) { animation: view-in .28s var(--ease) both; }
.accents { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.acc { flex-direction: column; gap: 4px; background: none; padding: 6px 2px; min-height: 0; border-radius: 14px; box-shadow: none; }
.acc small { font-size: 10.5px; color: var(--muted); font-weight: 700; line-height: 1.2; }
.acc-dot { width: 34px; height: 34px; border-radius: 50%; display: block; }
.acc.on { background: var(--card-2); }
.acc.on .acc-dot { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- help ---- */
.brandbar .help-btn { width: 38px; height: 38px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; color: var(--text);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 15px; }
.help-link { display: flex; align-items: center; gap: 12px; color: var(--text); }
.help-link > div { flex: 1; }
.help-q { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; font-size: 18px; flex: none; transform: rotate(-4deg); }
.help-hero { display: flex; align-items: center; gap: 12px; }
.faq > summary { font-weight: 700; font-size: 15px; }
.faq-a { font-size: 14.5px; line-height: 1.6; color: var(--text); }
.faq-a a { font-weight: 750; }

/* ---- rewards: gold + truck-art border ---- */
.truck { position: relative; overflow: hidden; padding-top: 28px; }
.truck::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 14px; background-size: 40px 14px; background-repeat: repeat-x;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='14'%3E%3Crect width='40' height='14' fill='%23e11d48'/%3E%3Cpath d='M0 14 Q5 7 10 14 Q15 7 20 14 Q25 7 30 14 Q35 7 40 14Z' fill='%23facc15'/%3E%3Ccircle cx='10' cy='5' r='3.4' fill='%2306b6d4'/%3E%3Ccircle cx='10' cy='5' r='1.3' fill='%23fff'/%3E%3Ccircle cx='30' cy='5' r='3.4' fill='%2322c55e'/%3E%3Ccircle cx='30' cy='5' r='1.3' fill='%23fff'/%3E%3Ccircle cx='20' cy='3' r='1.5' fill='%23fff'/%3E%3Ccircle cx='0' cy='3' r='1.5' fill='%23fff'/%3E%3Ccircle cx='40' cy='3' r='1.5' fill='%23fff'/%3E%3C/svg%3E"); }

/* ---- chibi buddy ---- */
.av { overflow: visible; display: block; }
/* D-053: a soft sticker outline around the whole buddy, so dark hair or fur never melts into a dark background. */
:root { --av-rim: rgba(255, 255, 255, .92); }
:root[data-theme="dark"] { --av-rim: rgba(255, 249, 242, .86); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --av-rim: rgba(255, 249, 242, .86); } }
.av-rim { fill: var(--av-rim); stroke: var(--av-rim); }
.av [transform] { transform-box: view-box; } /* rotate(a cx cy) in the drawing means the drawing's own coordinates */
.av.still *, .av.still .av-eyes { animation: none !important; }
.av * { transform-box: fill-box; }
.av-body { transform-origin: 50% 100%; }
.av-head { transform-origin: 50% 90%; }
.av-arm-l, .av-arm-r { transform-origin: 50% 8%; }
.av-eyes { transform-origin: 50% 50%; animation: av-blink 4.2s infinite; }
.av-shadow { transform-origin: 50% 50%; }
.av.idle .av-body { animation: av-bob 2.6s ease-in-out infinite; }
.av.idle .av-head { animation: av-tilt 5.2s ease-in-out infinite; }
.av.idle .av-arm-l { animation: av-sway 2.6s ease-in-out infinite; }
.av.idle .av-arm-r { animation: av-sway 2.6s ease-in-out infinite reverse; }
.av.idle .av-shadow { animation: av-shadow 2.6s ease-in-out infinite; }
.av.lift .av-body { animation: av-squat 1.1s var(--ease) infinite; }
.av.lift .av-arm-r { animation: av-curl 1.1s ease-in-out infinite; }
.av.lift .av-arm-l { animation: av-sway 1.1s ease-in-out infinite; }
.av.lift .av-shadow { animation: av-shadow 1.1s ease-in-out infinite; }
.av.cheer .av-body { animation: av-hop .9s var(--ease) infinite; }
.av.cheer .av-arm-l { animation: av-wave-l .45s ease-in-out infinite alternate; }
.av.cheer .av-arm-r { animation: av-wave-r .45s ease-in-out infinite alternate; }
.av.cheer .av-shadow { animation: av-shadow-hop .9s var(--ease) infinite; }
@keyframes av-bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-3px) scale(1.01, .99); } }
@keyframes av-tilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-4deg); } 60% { transform: rotate(3deg); } }
@keyframes av-sway { 0%, 100% { transform: rotate(4deg); } 50% { transform: rotate(-4deg); } }
@keyframes av-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes av-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.9); opacity: .8; } }
@keyframes av-squat { 0%, 100% { transform: translateY(0) scale(1, 1); } 45% { transform: translateY(3px) scale(1.04, .95); } 70% { transform: translateY(-2px) scale(.98, 1.02); } }
@keyframes av-curl { 0%, 100% { transform: rotate(0); } 45%, 60% { transform: rotate(-150deg); } }
@keyframes av-hop { 0%, 100% { transform: translateY(0) scale(1.05, .95); } 15% { transform: translateY(0) scale(.95, 1.06); } 45% { transform: translateY(-14px) scale(1, 1); } 75% { transform: translateY(0) scale(1.06, .94); } }
@keyframes av-wave-l { from { transform: rotate(140deg); } to { transform: rotate(170deg); } }
@keyframes av-wave-r { from { transform: rotate(-140deg); } to { transform: rotate(-170deg); } }
@keyframes av-shadow-hop { 0%, 100%, 75% { transform: scaleX(1); } 45% { transform: scaleX(.6); opacity: .5; } }
.av-stage { display: flex; justify-content: center; padding: 6px 0 0; background: none; border: 0; min-height: 0; box-shadow: none; }
.buddy-card { display: flex; align-items: center; gap: 14px; }
.buddy-card .av-stage { padding: 0; flex: none; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%; border: 2px solid var(--line); box-shadow: none; }
.sw.on { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- motion ---- */
#dust { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#view.enter { animation: view-in .32s var(--ease) both; }
/* Transitions only slide, so text stays readable even if a browser pauses animations. */
@keyframes view-in { from { transform: translateY(8px); } to { transform: none; } }
@keyframes sheet-in { from { transform: translateY(40px); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 360px) {
  #tabs a span { font-size: 9.5px; }
  #tabs .fab { width: 50px; height: 50px; }
  h1 { font-size: 24px; }
}

/* ---- exercise library ---- */
.ex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.ex-card { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 8px 8px 10px; min-height: 0; text-align: left; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); color: var(--text); font-weight: 500; }
.ex-card img, .ex-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #fff; display: grid; place-items: center; font-size: 30px; margin-bottom: 4px; }
.ex-card b { font-size: 13.5px; line-height: 1.25; }
.ex-card small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.ex-anim { position: relative; border-radius: 18px; overflow: hidden; background: #fff; aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.ex-anim img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ex-anim.flip img:nth-child(2) { animation: ex-flip 2.4s steps(1) infinite; }
@keyframes ex-flip { 0% { opacity: 0; } 50% { opacity: 1; } }
.ex-steps li { font-size: 14px; }
.kv.howto { width: 100%; background: none; border-radius: 0; min-height: 0; padding: 8px 0; font-weight: 500; box-shadow: none; color: var(--text); text-align: left; }
.kv.howto small { font-size: 11.5px; font-weight: 600; }
.seg[data-effort] { margin-bottom: 4px; }

/* ---- barcode & QR scanner ---- */
.scan-box { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin-bottom: 10px; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 22% 10%; border-radius: 16px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .38); }
.scan-frame::before { content: ""; position: absolute; inset: 0; border: 3px solid #fff; border-radius: 16px; opacity: .9; }
.scan-frame i { position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; background: var(--g1); box-shadow: 0 0 12px var(--g1); animation: scan-line 1.8s ease-in-out infinite alternate; }
@keyframes scan-line { from { top: 12%; } to { top: 88%; } }
@media (prefers-reduced-motion: reduce) { .scan-frame i { animation: none; } }
.scan-hint { position: absolute; left: 0; right: 0; bottom: 8px; margin: 0; text-align: center; color: #fff; font-size: 13.5px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.scan-torch { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, .45); color: #fff; }
.scan-torch[aria-pressed="true"] { background: #fff; }
.macro-grid:has(> div:nth-child(4)) { grid-template-columns: repeat(4, 1fr); }
.qr-box { background: #fff; border-radius: var(--radius); padding: 14px; max-width: 280px; margin: 0 auto; }
.qr-box svg { display: block; width: 100%; height: auto; }

/* ---- leaderboard ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.you-card { border: 2px solid var(--accent); }
.you-row { display: flex; align-items: center; gap: 12px; }
.you-rank { font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1.1; }
.you-rank small { font-size: 14px; font-weight: 600; color: var(--muted); }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 14px 0 12px; }
.pod { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; background: var(--card); border-radius: var(--radius-s);
  padding: 12px 6px 10px; box-shadow: var(--shadow); min-width: 0; }
.pod.p1 { padding-top: 16px; padding-bottom: 18px; background: var(--gold-soft); }
.pod.me { outline: 2px solid var(--accent); }
.pod b { font-size: 13.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 100%; }
.pod .medal { font-size: 24px; margin-top: -10px; }
.pod-val { font-family: var(--display); font-weight: 800; font-size: 18px; }
.pod-val small, .item-cal small { font-weight: 600; }
.lb-list { padding: 0; margin: 0; list-style: none; }
.lb-list .item.me { background: var(--accent-soft); }
.lb-list .item svg { flex: none; }

/* ---- pain relief & stretching ---- */
.warn-card > summary { color: var(--disputed); }
.flags { margin: 4px 0 8px; padding-left: 20px; font-size: 14px; line-height: 1.55; }
.flags li { margin-bottom: 4px; }
.area-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.area { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px; background: var(--card); border-radius: var(--radius-s);
  box-shadow: var(--shadow); color: var(--text); text-align: center; text-decoration: none; min-height: 96px; justify-content: center; }
.area span { font-size: 28px; line-height: 1.1; }
.area b { font-size: 13.5px; line-height: 1.2; }
.area small { font-size: 11.5px; color: var(--muted); }
.area:active { transform: scale(.97); }
.rec-ex { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.rec-ex:not(:has(.rec-img)) { grid-template-columns: 1fr; }
.rec-ex h3 { font-size: 16px; margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rec-ex p { font-size: 14px; line-height: 1.5; margin: 0 0 4px; }
.rec-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.rec-img { width: 96px; height: 96px; object-fit: cover; border-radius: 14px; background: var(--card-2); }
.rec-img.big { width: 100%; height: auto; max-height: 230px; aspect-ratio: 4 / 3; }
.pain-scale { display: grid; gap: 6px; margin: 8px 0; }
.ps { display: grid; grid-template-columns: 48px 1fr; column-gap: 10px; padding: 8px 10px; border-radius: 12px; font-size: 13.5px; }
.ps b { grid-row: span 2; font-size: 16px; align-self: center; }
.ps small { color: var(--muted); }
.ps0 { background: var(--verified-bg); } .ps1 { background: var(--gold-soft); } .ps2 { background: var(--disputed-bg); }
.hold { text-align: center; margin: 12px 0 8px; }
.hold span { display: block; font-family: var(--display); font-size: 52px; font-weight: 800; line-height: 1; color: var(--accent); }
.hold small { color: var(--muted); }
.guide-top { display: grid; gap: 6px; margin-bottom: 10px; font-size: 13px; }
.guide-done { text-align: center; display: grid; gap: 8px; justify-items: center; }
.guide-done .btn-block { width: 100%; }

/* ---- tutorial ---- */
.podium.n1 { grid-template-columns: minmax(0, 170px); justify-content: center; }
.podium.n2 { grid-template-columns: repeat(2, minmax(0, 170px)); justify-content: center; }
.menu-sec { font-size: 15px; margin: 16px 4px 8px; display: flex; align-items: baseline; gap: 6px; }
.menu-sec small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.copy-meal { width: 100%; justify-content: flex-start; text-align: left; color: var(--accent); font-weight: 650; padding: 8px 0; min-height: 40px; }

/* ---- keyboard focus: a clear ring on whatever has focus (mouse and touch taps don't show it) ---- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.panel:focus { outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* ---- packaged product label ---- */
.pack-info { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.pack-info h3 { font-size: 15px; margin: 0 0 6px; }
table.nut { width: 100%; border-collapse: collapse; font-size: 14px; }
table.nut td { padding: 4px 0; border-bottom: 1px solid var(--line); }
table.nut td:last-child { text-align: right; font-weight: 650; }

/* ---------- Photo logging (on the phone) and offline mode (D-022) ---------- */
.quick3.three { grid-template-columns: repeat(3, 1fr); }
.photo-card .photo-note { font-size: 12.5px; margin-top: 10px; }
.photo-card.compact { display: flex; gap: 8px; padding: 10px; }
.photo-card.compact .upload { flex: 1; margin-top: 0 !important; min-height: 44px; font-size: 14px; }
.photo-card.compact .photo-note { display: none; }
.photo-preview { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 18px; margin: 4px 0 10px; background: var(--card-2); }
.photo-unsure { font-size: 13.5px; margin: -4px 2px 8px; }
.guess .bar { margin-top: 6px; }
.seg.wrap { flex-wrap: wrap; gap: 2px; }
.seg.wrap button { flex: 1 1 30%; }
/* A calm pill at the top when offline or syncing. */
.net-pill { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 55; pointer-events: none;
  background: var(--card); color: var(--muted); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; font-weight: 650; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  animation: pill-in .25s ease-out; }
.net-pill.off::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d97706; margin-right: 7px; vertical-align: 1px; }
.net-pill[hidden] { display: none; }
@keyframes pill-in { from { opacity: 0; transform: translate(-50%, -6px); } }
@media (prefers-reduced-motion: reduce) { .net-pill { animation: none; } }
.offline-stats { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 14px; margin-top: 10px; }
.offline-stats b { text-align: right; }

/* ---------- guided tour with your buddy (tour.js, D-023) ---------- */
#tour { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.tour-block { position: absolute; inset: 0; pointer-events: auto; }
.tour-spot { position: fixed; left: 50%; top: 50%; width: 0; height: 0; border-radius: 16px; pointer-events: none; box-shadow: 0 0 0 200vmax rgba(18, 11, 7, .58); }
.tour-spot.on::after { content: ''; position: absolute; inset: -3px; border-radius: inherit; border: 2.5px solid var(--g1);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--g1) 22%, transparent), 0 0 22px color-mix(in srgb, var(--g1) 50%, transparent); animation: spot-pulse 1.9s ease-in-out infinite; }
@keyframes spot-pulse { 0%, 100% { opacity: .95; } 50% { opacity: .5; } }
.tour-fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tp { position: absolute; border-radius: 50%; will-change: transform, opacity; pointer-events: none; }
.tp.puff { filter: blur(.4px); }
.tp.star { border-radius: 0; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.tp.spark { border-radius: 0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.tp.conf { border-radius: 2px; }
.tp.ring { border: 2px solid; background: transparent; }
.tb { position: fixed; left: 0; top: 0; width: 64px; height: 74px; will-change: transform; pointer-events: none; }
.tb-squash { width: 100%; height: 100%; transform-origin: 50% 92%; will-change: transform; }
.tb .fx { display: none; }
.tb[data-face=smile] .fx-smile, .tb[data-face=talk] .fx-talk, .tb[data-face=happy] .fx-happy,
.tb[data-face=wow] .fx-wow, .tb[data-face=wink] .fx-wink, .tb[data-face=think] .fx-think { display: inline; }
.av-talk { transform-origin: 50% 0; animation: av-talk .19s ease-in-out infinite alternate; }
@keyframes av-talk { from { transform: scaleY(.22); } to { transform: scaleY(1); } }
.tour-bubble { position: fixed; left: 0; top: 0; pointer-events: auto; background: var(--card); color: var(--text); border-radius: 22px;
  padding: 16px 16px 12px; border: 1px solid var(--line); box-shadow: 0 2px 0 var(--ink-edge), 0 22px 50px -14px rgba(0, 0, 0, .55); overflow: hidden; }
.tour-bubble[hidden] { display: none; }
.tour-prog { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--card-2); }
.tour-prog i { display: block; height: 100%; background: var(--grad); border-radius: 0 4px 4px 0; }
.tour-kicker { display: block; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.tour-say h2 { font-size: 18.5px; line-height: 1.25; }
.tour-say p { font-size: 14.5px; line-height: 1.55; margin-top: 4px; }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tour-gap { flex: 1; }
.tour-actions .btn-small { min-height: 40px; padding: 8px 14px; }
.tour-actions .tour-skip { color: var(--muted); padding-left: 2px; padding-right: 4px; }
.tut-hero { display: flex; gap: 12px; align-items: center; }
.tour-actions button { white-space: nowrap; }
.tour-actions.stack { flex-direction: column; align-items: stretch; gap: 6px; }
.tour-row { display: flex; align-items: center; gap: 8px; }
/* Dark mode: the logo text uses the bright end of the gradient so the first letters stay readable on the dark background. */
:root[data-theme="dark"] .grad-text { background: linear-gradient(135deg, var(--g2) 0%, var(--g1) 55%, color-mix(in srgb, var(--g1) 55%, #fff) 100%); -webkit-background-clip: text; background-clip: text; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="dark"]) .grad-text { background: linear-gradient(135deg, var(--g2) 0%, var(--g1) 55%, color-mix(in srgb, var(--g1) 55%, #fff) 100%); -webkit-background-clip: text; background-clip: text; } }

/* ---------- exercise illustrations (figures.js, D-026) ---------- */
.fig { background: var(--card-2); border-radius: 14px; overflow: hidden; }
.fig svg { display: block; width: 100%; height: auto; }
.fig .fg-floor { stroke: var(--line); stroke-width: 2; }
.fig .fg-mat { fill: color-mix(in srgb, var(--g1) 22%, var(--card-2)); }
.fig .fg-prop, .fig .fg-prop path { fill: none; stroke: color-mix(in srgb, var(--muted) 70%, transparent); stroke-width: 4; stroke-linecap: round; }
.fig .fg-prop-strong { stroke: var(--muted); stroke-linecap: round; }
.fig .fg-towel { fill: color-mix(in srgb, var(--gold, #f5a623) 55%, var(--card-2)); }
.fig .fg-table { fill: color-mix(in srgb, var(--muted) 45%, var(--card-2)); }
.fig line { stroke-linecap: round; }
.fig .fg-near { stroke: var(--g2); }
.fig .fg-far { stroke: color-mix(in srgb, var(--g2) 45%, var(--card-2)); }
.fig .fg-body { stroke: var(--g3); }
.fig .fg-near-fill { fill: var(--g2); stroke: none; }
.fig .fg-far-fill { fill: color-mix(in srgb, var(--g2) 45%, var(--card-2)); }
.fig .fg-head { fill: var(--g3); }
.fig .fg-eye { fill: var(--card); }
.fig .fg-nail { fill: color-mix(in srgb, var(--card) 70%, transparent); }
.fig .fg-palm { fill: color-mix(in srgb, var(--g1) 60%, var(--card)); }
.fig .fg-glow { fill: #f59e0b; }
.fig .fg-ghost { opacity: .28; }
:root[data-theme="dark"] .fig .fg-body, :root[data-theme="dark"] .fig .fg-head { stroke: var(--g1); fill: var(--g1); }
:root[data-theme="dark"] .fig .fg-body { fill: none; }
:root[data-theme="dark"] .fig .fg-eye { fill: var(--bg); }
:root[data-theme="dark"] .fig .fg-near { stroke: var(--g2); }
:root[data-theme="dark"] .fig .fg-near-fill { fill: var(--g2); }
.rec-ex .fig { width: 112px; flex: none; align-self: flex-start; }
.fig.big { width: 100%; max-width: 420px; margin: 0 auto; }

/* ---------- clearer exercise guides + women's health (D-026, D-027) ---------- */
.rec-ex { grid-template-columns: 112px 1fr; }
.rec-ex:not(:has(.rec-img)):not(:has(.fig)) { grid-template-columns: 1fr; }
.rec-ex .rec-img { width: 112px; height: 112px; }
.rec-ex .fig { width: 112px; }
.rec-body { min-width: 0; }
.rec-ex h3 .rec-num { margin: 0; }
.steps { margin: 4px 0 0; padding-left: 20px; font-size: 14.5px; line-height: 1.55; }
.steps li { margin-bottom: 3px; padding-left: 2px; }
.steps li::marker { color: var(--accent); font-weight: 800; }
.steps.big { font-size: 15.5px; line-height: 1.6; }
.rec-ex p.rec-tip, .rec-tip { font-size: 13.5px; line-height: 1.5; background: var(--accent-soft); border-radius: 10px; padding: 8px 10px; margin: 8px 0 4px; }
.rec-ex p.rec-dose, .rec-dose { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
@media (max-width: 400px) { .rec-ex { grid-template-columns: 1fr; } .rec-ex .rec-img { width: 100%; max-width: 280px; height: auto; aspect-ratio: 4 / 3; } .rec-ex .fig { width: 100%; max-width: 320px; } }
.guide-top { grid-template-columns: 1fr auto; align-items: center; }
.guide-top .voice-btn { min-height: 34px; }
.guide-visual { display: grid; place-items: center; }
.guide-visual .fig.big { width: 100%; }
.cycle-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: inherit; border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.cycle-card h2 { margin-top: 2px; }
.cycle-hero h2 { font-size: 22px; margin-top: 2px; }
.cycle-hero form input { flex: 1; }
.pf-stage { position: relative; display: grid; place-items: center; height: 230px; margin: 6px 0 10px; }
.pf-ring { width: 160px; height: 160px; border-radius: 50%; background: color-mix(in srgb, var(--g1) 16%, var(--card-2)); transition: transform .9s var(--ease), background-color .4s; }
.pf-stage.on .pf-ring { transform: scale(1.16); background: color-mix(in srgb, #f59e0b 38%, var(--card-2)); }
.pf-word { position: absolute; top: 74px; font-size: 22px; font-weight: 800; text-align: center; }
.pf-count { position: absolute; top: 108px; font-size: 40px; font-weight: 800; color: var(--accent); }
.pf-stage small { position: absolute; bottom: 0; }
@media (prefers-reduced-motion: reduce) { .pf-ring { transition: none; } .pf-stage.on .pf-ring { transform: none; } }
.fig .fg-spine { fill: none; stroke: var(--g3); stroke-linecap: round; }
:root[data-theme="dark"] .fig .fg-spine { stroke: var(--g1); }

/* ---------- polish pass (D-028): contrast and tap targets ---------- */
:root { --accent-strong: color-mix(in srgb, var(--accent) 74%, #000); }
:root[data-theme="dark"] { --accent-strong: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent-strong: var(--accent); } }
.btn.on, .btn-small.on, .add-mini, .rec-num { color: var(--accent-strong); }
.add-mini { width: 40px; height: 40px; min-height: 40px; }
.check { min-height: 44px; }
.check input { width: 22px; height: 22px; flex: none; }
.empty a { display: inline-block; padding: 8px 2px; font-weight: 700; }
/* Add food: search first; while searching, results sit right under the box */
[data-pick] > [data-sv-top] .search { margin-bottom: 12px; }
[data-pick].searching > .quick3, [data-pick].searching > .typed-box { display: none; }
.typed-box { padding: 12px 14px; }
.typed-box label { margin: 0 0 6px; font-size: 13.5px; }
.typed-row { display: flex; gap: 8px; align-items: flex-end; }
.typed-row textarea { flex: 1; min-height: 46px; resize: none; line-height: 1.4; padding-top: 12px; padding-bottom: 12px; }
.typed-row button { flex: none; min-height: 46px; padding: 0 14px; }
.typed-row textarea { overflow: hidden; font-size: 16px; }
.amt-note { font-size: 13px; margin: -2px 0 8px; }
.amt-chips { margin-bottom: 10px; }
.amt-chips .chip { min-width: 52px; min-height: 40px; justify-content: center; font-size: 15px; }
.amt-total { margin-top: 14px; font-size: 15px; }
.amt-total b { font-size: 24px; }
/* Long titles wrap onto two lines instead of being cut off ("Beef biryani (homemade)") */
.head:not(.hello) h1 { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.15; }
.head:not(.hello) h1:has(> small) { display: block; }
.dur-chips { margin: -4px 0 6px; }
.dur-chips .chip { min-height: 38px; }
.setup-hello { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.setup-hello p { font-size: 14.5px; }
.su-height { display: grid; grid-template-columns: 1.3fr auto 1fr 1fr; gap: 8px; align-items: center; }
.empty.miss { padding: 20px 8px; }
.miss-actions { display: grid; gap: 8px; margin-top: 12px; }
.miss-actions .btn { text-align: left; }
.meal-item .icon-btn.confirm { width: auto; padding: 0 12px; background: var(--disputed-bg, #fde8e8); color: var(--disputed, #b42318); font-size: 13px; font-weight: 800; border-radius: 12px; }
.ftin { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.ftin span { flex: 1; }
.ftin input { width: 70px; flex: none; }
/* Shortcut circles on Today scroll sideways: fade the edge so it's clear there are more */
.stories { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.stories::after { content: ''; flex: 0 0 48px; } /* room to scroll the last circle clear of the fade */
.item-wrap { display: flex; align-items: center; gap: 6px; }
.item-wrap > :first-child { flex: 1; min-width: 0; }
.hp-btn { flex: none; width: 40px; height: 40px; opacity: .45; filter: grayscale(1); }
.hp-btn.on { opacity: 1; filter: none; background: var(--accent-soft); }
/* Text size (Me → Appearance): the whole app scales, so text, buttons and tap targets all grow together */
:root[data-text="large"] :is(#view, #tabs, #sheet, #toast, #buddy, .net-pill) { zoom: 1.12; }
:root[data-text="xl"] :is(#view, #tabs, #sheet, #toast, #buddy, .net-pill) { zoom: 1.25; }
.stat b { white-space: nowrap; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 72px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 6px 12px; font-size: 13px; background: var(--card-2); color: var(--text); box-shadow: none; }
/* Buddy customiser: keep the preview in view while choosing glasses, hats and outfits further down */
[data-ed] > .av-stage { position: sticky; top: 0; z-index: 2; background: var(--card); margin: -4px -16px 4px; padding: 12px 16px 6px; box-shadow: 0 10px 14px -14px rgba(0, 0, 0, .5); }
/* A soft circle behind the buddy so dark hair stands out on dark backgrounds */
.av-stage, .hello-av, .buddy-card .av-stage { background-image: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--g1) 20%, transparent) 0 44%, transparent 45%); background-repeat: no-repeat; }
.hello-av { border-radius: 50%; }
.back-today { display: block; margin: 4px auto 0; min-height: 32px; padding: 4px 12px; font-size: 12.5px; background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.datebar .icon-btn:disabled { opacity: .3; }
.rest-row { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.rest-row::after { content: ''; flex: 0 0 40px; }
.leave-btn { display: block; margin: 14px auto 0; color: var(--muted); }
[data-checkin].btn-block, [data-join].btn-block { margin-bottom: 10px; min-height: 50px; }
.card-head .btn-ghost.btn-small { min-width: 44px; min-height: 40px; justify-content: center; }
.quick-row .relog { flex: none; width: 44px; height: 44px; font-size: 20px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 12px; margin-right: 4px; }
.field-hint { font-size: 12.5px; color: var(--muted); margin: 5px 2px 0; line-height: 1.35; }
.chips.more { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
/* Train page: exercise library feature card, then two tiles (Women's health, Injuries & stretches). The card uses a darker
   version of the theme gradient so white text stays readable in every colour theme. */
.lib-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px 20px 18px; border: none; color: #fff;
  background: linear-gradient(135deg, var(--g3) 0%, color-mix(in srgb, var(--g2) 78%, #000) 100%); }
.lib-hero::after { content: ''; position: absolute; right: -40px; top: -50px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.lib-hero-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; background: rgba(255, 255, 255, .16); transform: rotate(-4deg); margin-bottom: 6px; }
.lib-hero b { font-size: 24px; line-height: 1.15; }
.lib-hero-sub { font-size: 15px; line-height: 1.4; color: rgba(255, 255, 255, .92); max-width: 30ch; }
.lib-hero-go { margin-top: 10px; padding: 10px 16px; border-radius: 999px; background: #fff; color: var(--g3); font-weight: 800; font-size: 15px; }
.lib-hero:active { transform: scale(.985); }
.train-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.train-tiles .tile { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; color: var(--text); }
.train-tiles .tile b { font-size: 16px; line-height: 1.2; margin-top: 4px; }
.train-tiles .tile .item-sub { line-height: 1.35; }
/* Period help (D-029): needs picker, need cards, verified food plan. */
.need-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.need-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); font-size: 14.5px; font-weight: 700; box-shadow: none; }
.need-chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.need-chip.sug { border-style: dashed; border-color: var(--accent); }
.need-chip small { font-size: 11px; font-weight: 800; color: var(--accent-strong); text-transform: uppercase; letter-spacing: .03em; }
.need-tip { font-size: 14.5px; margin: 6px 0 4px; }
.need-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.need-help h3 { font-size: 14.5px; margin: 12px 0 2px; }
.need-urgent { margin-top: 8px; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: color-mix(in srgb, var(--disputed) 12%, transparent); border: 1px solid color-mix(in srgb, var(--disputed) 35%, transparent); }
.verified-card { border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line)); }
.verified-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; color: var(--accent-strong); background: var(--accent-soft); margin-bottom: 8px; }
.plan-why { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.plan-meal { align-items: center; }
/* Period guides (D-029b). */
.need-hero { display: flex; gap: 14px; align-items: flex-start; }
.need-hero p { font-size: 15px; line-height: 1.45; }
.need-hero-emoji { font-size: 30px; line-height: 1; flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); }
.steps-list { margin: 8px 0 6px; padding: 0; list-style: none; counter-reset: st; }
.steps-list li { counter-increment: st; position: relative; padding: 2px 0 10px 40px; font-size: 14.5px; line-height: 1.45; }
.steps-list li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--accent-soft); color: var(--accent-strong); }
.need-sub { font-size: 14px; margin: 10px 0 0; }
.need-note { margin-top: 8px; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: var(--accent-soft); }
.need-card .need-links .btn-primary { color: #fff; }
.check-list { margin-top: 8px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; line-height: 1.4; font-weight: 500; cursor: pointer; }
.check-row:last-child { border-bottom: none; }
.check-row input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; padding: 0; accent-color: var(--accent); }
.check-result { margin-top: 10px; padding: 12px; border-radius: 12px; font-size: 14.5px; background: var(--accent-soft); }
.check-result.warn { background: color-mix(in srgb, var(--disputed) 12%, transparent); border: 1px solid color-mix(in srgb, var(--disputed) 35%, transparent); }
.br-stage .pf-ring { transition: transform 5s ease-in-out, background-color 1.2s; }
.br-stage.on .pf-ring { transform: scale(1.35); background: color-mix(in srgb, var(--g1) 34%, var(--card-2)); }
@media (prefers-reduced-motion: reduce) { .br-stage .pf-ring, .br-stage.on .pf-ring { transition: none; transform: none; } }
/* Menu tags (D-030): quiet pills with a coloured dot; text stays in the normal text colour for contrast. */
.badge.b-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--card-2); color: var(--text); border: 1px solid var(--line); font-weight: 700; }
.badge.b-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--tag, var(--accent)); flex: none; }
.b-tag[data-tag="high_protein"] { --tag: #0d9488; } .b-tag[data-tag="lean_pick"] { --tag: #16a34a; } .b-tag[data-tag="low_calorie"] { --tag: #2563eb; }
.b-tag[data-tag="low_carb"] { --tag: #7c3aed; } .b-tag[data-tag="high_fibre"] { --tag: #65a30d; } .b-tag[data-tag="bulk_friendly"] { --tag: #ea580c; }
.b-tag[data-tag="balanced"] { --tag: #64748b; } .b-tag[data-tag="indulgent"] { --tag: #db2777; }
.item-sub .prot { font-weight: 700; color: var(--text); }
.tag-how { margin-top: 10px; }
.tag-how > summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--accent-strong); }
.chips[hidden] { display: none; }
.item-sub .prot { white-space: nowrap; }
/* Voice logging (D-032). */
.typed-row .mic-btn { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--card-2); color: var(--accent-strong); }
.typed-row .mic-btn.on { background: var(--accent); color: var(--accent-ink); animation: mic-pulse 1.4s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .typed-row .mic-btn.on { animation: none; } }
.voice-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.voice-dot { width: 8px; height: 8px; border-radius: 50%; background: #e11d48; flex: none; }
.voice-langs { display: inline-flex; gap: 6px; margin-left: auto; }
.voice-langs .chip { padding: 5px 10px; font-size: 13px; }
/* Share cards + weekly report (D-033/D-034). */
.share-preview { width: 100%; border-radius: 18px; display: block; box-shadow: var(--shadow); }
.wa-btn { background: #128c4b; color: #fff; border-color: #128c4b; }
.share-day { margin-top: 12px; width: 100%; background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: 14px; min-height: 42px; font-weight: 750; }
button.streak { font: inherit; border: none; cursor: pointer; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.report-big { display: flex; align-items: baseline; gap: 10px; }
.report-big b { font-size: 46px; line-height: 1; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.report-grid .card { margin: 0; }
.report-grid .card b { display: block; font-size: 24px; margin-top: 4px; }
.report-grid .card small.delta-good, .report-grid .card small.delta-bad { display: block; margin-top: 4px; font-weight: 700; font-size: 12.5px; }
.delta-good { color: var(--accent-strong); } .delta-bad { color: var(--disputed); }
.tip-card { display: flex; gap: 12px; align-items: flex-start; color: var(--text); }
.tip-emoji { font-size: 28px; line-height: 1; }
/* Protein on a budget (D-035). */
.bud-item { align-items: flex-start; }
.bud-why { margin-top: 6px; } .bud-why > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent-strong); }
.bud-table { margin-top: 8px; }
.bud-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.bud-row:last-child { border-bottom: none; } .bud-row .muted { grid-column: 1 / -1; font-size: 12.5px; }
.bud-prices label { margin-top: 10px; }
/* Diabetes-friendly mode (D-037). */
.carb-ok { color: var(--text); font-weight: 700; } .carb-over { color: var(--disputed); font-weight: 800; }
.sg-low, .sg-high { color: var(--disputed); font-weight: 700; }
.sugar-form label { margin-top: 10px; }
/* Order smart (D-038). */
.order-smart { margin-bottom: 4px; }
.os-pick { margin: 12px 0 0; } .os-pick h3 { font-size: 16px; }
.os-items { list-style: none; padding: 0; margin: 8px 0; } .os-items li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.os-tot { font-size: 14px; margin: 6px 0 10px; }
/* Order screenshots (D-039). */
.quick3.four { grid-template-columns: repeat(4, 1fr); }
.quick3.four button { font-size: 12.5px; min-height: 78px; padding: 6px 4px; }
.q-emoji { font-size: 22px; line-height: 1; }
.file-btn { display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* Icons (D-042): one line-icon set in the accent colour instead of emojis. Women's health keeps its emojis. */
.ic { width: 1.3em; height: 1.3em; display: inline-block; vertical-align: -.25em; flex: none; color: var(--accent-strong); }
:is(.btn-primary, .cal-hero, .hero, .bubble, .eb-res.deficit, .fab, .mic-btn.on, .chip.on, #toast, .badge, .lib-hero-icon) .ic { color: inherit; }
.thumb:has(.ic), .thumb.t1:has(.ic), .thumb.t2:has(.ic), .thumb.t3:has(.ic), .thumb.t4:has(.ic), .thumb.t5:has(.ic),
:root[data-theme="dark"] .thumb[class*=" t"]:has(.ic) { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .thumb[class*=" t"]:has(.ic) { background: var(--accent-soft); } }
.thumb .ic { width: 25px; height: 25px; vertical-align: 0; }
.help-q:has(.ic) { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.help-q .ic { width: 22px; height: 22px; vertical-align: 0; }
.act-ico .ic { width: 22px; height: 22px; }
.lib-hero-icon .ic { width: 32px; height: 32px; vertical-align: 0; }
.ex-noimg .ic { width: 40px; height: 40px; }
.quick3 button .ic { width: 24px; height: 24px; color: var(--accent); }
.medal .ic, .rank .ic { width: 1.1em; height: 1.1em; }

/* Lose fat, gain muscle goal (D-043) */
.goal-hint { font-size: 12.5px; margin: 6px 2px 0; line-height: 1.45; }
.recomp-card .card-head b { font-size: 20px; }
.recomp-card .card-head small { font-size: 12px; font-weight: 500; }
.recomp-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* UX batch (D-044): undo toast, search clear, edit a logged food */
#toast .toast-act { display: flex; align-items: center; gap: 14px; pointer-events: auto; text-align: left; }
#toast .toast-act button { background: none; border: 0; color: var(--g1); font: inherit; font-weight: 800; padding: 6px 4px; min-height: 36px; cursor: pointer; }
.search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--card-2); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.search-clear[hidden] { display: none; }
.search-clear svg { position: static; transform: none; width: 16px; height: 16px; }
.search input[type="search"]::-webkit-search-cancel-button { display: none; }
.search input { padding-right: 50px; }
.meal-item .edit-log { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; min-width: 0; }
.meal-item .edit-log:active { opacity: .7; }
.el-amt { display: flex; align-items: center; gap: 10px; }
.el-amt input { text-align: center; font-size: 20px; font-weight: 700; }
.el-amt .icon-btn { width: 48px; height: 48px; flex: none; font-size: 22px; }
.el-preview { margin: 14px 2px 12px; font-size: 14px; }
.date-jump { position: relative; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, .5); }
.date-jump input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; min-height: 0; }

/* Saved meals (D-045) */
.save-meal { margin-top: 6px; }
.mm-chips .chip small { opacity: .7; font-weight: 600; margin-left: 4px; }
[data-pick].searching > [data-mymeals] { display: none; }
/* Bigger tap area for the small round buttons on phones (44 px), without changing how they look (D-044) */
@media (pointer: coarse) {
  :where(.icon-btn) { position: relative; }
  .icon-btn::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; }
}

/* Voice search, My meals, activity & sleep details (2026-11-24) */
.search-mic { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--accent-strong); display: grid; place-items: center; cursor: pointer; box-shadow: none; }
.search .search-mic svg { position: static; transform: none; width: 20px; height: 20px; color: inherit; }
.search-mic.on { background: var(--accent); color: var(--accent-ink); animation: mic-pulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .search-mic.on { animation: none; } }
.search:has(.search-mic) input { padding-right: 88px; }
.search:has(.search-mic) .search-clear { right: 48px; }
.mine-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mine-btn .ic { width: 16px; height: 16px; }
.mine-tabs .chip small { opacity: .7; font-weight: 600; margin-left: 2px; }
.act-tiles.act-4 { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.act-tile { display: flex; flex-direction: column; align-items: center; background: var(--card-2); border-radius: 14px; padding: 10px 2px 8px; color: inherit;
  text-decoration: none; min-width: 0; transition: transform .12s ease; }
.act-tile:active { transform: scale(.97); }
.act-tile b { font-size: 17px; white-space: nowrap; }
.act-tile small { text-align: center; }
@media (max-width: 360px) { .act-tile b { font-size: 15px; } }
.hcard .big-stat { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1.1; margin: 2px 0 2px; }
.hcard .big-stat .muted { font-size: 15px; font-weight: 600; }
.hcard .trend { font-size: 13px; font-weight: 600; margin: 2px 0 6px; }
.hcard .trend.up { color: var(--good, #16a34a); }
.hcard .trend.down { color: var(--muted); }
.hchart { width: 100%; height: auto; margin-top: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 4px; }
.stat-grid .stat { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 12px 14px; }
.stat-grid .stat b { font-family: var(--display); font-size: 20px; font-weight: 800; }
.stat-grid .stat small:last-child { color: var(--muted); font-size: 12px; }

/* ---------- Activity & sleep, redesigned (2026-11-24) ----------
   Each metric has its own colours: steps green, active calories orange to red, distance blue, sleep violet.
   Today shows them as four bright tiles with a 7-day mini chart; tapping one grows it into its own page
   (View Transitions where the browser has them, a quick grow animation otherwise). */
[data-m="steps"]    { --m1: #6ee7b7; --m2: #059669; --m3: #064e3b; --m-ink: #047857; }
[data-m="burned"]   { --m1: #fdba74; --m2: #ea580c; --m3: #9f1239; --m-ink: #c2410c; }
[data-m="distance"] { --m1: #7dd3fc; --m2: #0284c7; --m3: #1e3a8a; --m-ink: #0369a1; }
[data-m="sleep"]    { --m1: #c4b5fd; --m2: #7c3aed; --m3: #2e1065; --m-ink: #6d28d9; }
:root[data-theme="dark"] [data-m="steps"] { --m-ink: #34d399; } :root[data-theme="dark"] [data-m="burned"] { --m-ink: #fb923c; }
:root[data-theme="dark"] [data-m="distance"] { --m-ink: #38bdf8; } :root[data-theme="dark"] [data-m="sleep"] { --m-ink: #a78bfa; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-m="steps"] { --m-ink: #34d399; } :root:not([data-theme="light"]) [data-m="burned"] { --m-ink: #fb923c; }
  :root:not([data-theme="light"]) [data-m="distance"] { --m-ink: #38bdf8; } :root:not([data-theme="light"]) [data-m="sleep"] { --m-ink: #a78bfa; }
}
[data-m] { --m-grad: radial-gradient(130% 85% at 100% 0%, color-mix(in srgb, var(--m1) 62%, transparent) 0%, transparent 58%),
  linear-gradient(200deg, var(--m2) 0%, var(--m3) 100%); }

/* Today: four tiles, two by two */
.mtiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 2px 0 12px; }
.mtile { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 138px; padding: 12px 12px 11px; border-radius: 22px;
  background: var(--m-grad); color: #fff; text-decoration: none; overflow: hidden; isolation: isolate;
  box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--m2) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease); -webkit-tap-highlight-color: transparent; }
.mtile::after { content: ""; position: absolute; inset: auto -30% -55% auto; width: 120px; height: 120px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%); }
.mtile:active { transform: scale(.965); }
@media (hover: hover) { .mtile:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -14px color-mix(in srgb, var(--m2) 90%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22); } }
.mtile:focus-visible { outline: 3px solid var(--m-ink); outline-offset: 2px; }
.mt-top { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 750; letter-spacing: .1px; text-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.mt-ico { width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.mt-ico .ic { width: 17px; height: 17px; color: #fff; stroke: #fff; }
.mt-go { margin-left: auto; opacity: .75; display: grid; }
.mt-go .ic, .mt-go svg { width: 16px; height: 16px; }
.mt-val { margin-top: 10px; font-family: var(--display); font-size: 27px; font-weight: 800; line-height: 1; letter-spacing: -.6px;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.mt-val small { color: inherit; font-size: 13px; font-weight: 700; letter-spacing: 0; margin-left: 2px; opacity: .9; }
.mt-sub { margin-top: 4px; font-size: 12px; font-weight: 650; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-spark { margin-top: auto; padding-top: 8px; display: flex; align-items: flex-end; gap: 4px; height: 30px; }
.mt-spark i { flex: 1; min-height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .38); transform-origin: bottom; }
.mt-spark i.today { background: #fff; }
.mt-spark i.none { background: rgba(255, 255, 255, .16); }
.mt-spark.grow i { animation: bar-grow .55s var(--ease) both; animation-delay: calc(var(--k) * 35ms); }
@media (max-width: 360px) { .mt-val { font-size: 23px; } .mtile { padding: 11px 10px 10px; } }

/* The page a tile grows into */
.mhero { margin: 0 -16px 14px; padding: calc(10px + env(safe-area-inset-top)) 16px 16px; border-radius: 0 0 30px 30px; color: #fff;
  background: var(--m-grad); box-shadow: 0 18px 36px -22px color-mix(in srgb, var(--m2) 90%, transparent); view-transition-name: metric-bg; }
.mhero-in { view-transition-name: metric-content; }
.mhero-top { display: flex; align-items: center; gap: 10px; padding: 6px 0 12px; }
.mhero-top h1 { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; font-size: 24px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.mhero-top h1 .mt-ico { width: 34px; height: 34px; border-radius: 12px; }
.mhero-top h1 .mt-ico .ic { width: 20px; height: 20px; }
.mhero-back { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff;
  background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.mhero-back:active { transform: scale(.94); }
.mseg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); margin-bottom: 14px; }
.mseg button { flex: 1; border: 0; padding: 8px 0; border-radius: 999px; background: transparent; color: rgba(255, 255, 255, .85); font-weight: 750; font-size: 13.5px; cursor: pointer;
  transition: background-color .2s, color .2s; }
.mseg button.on { background: #fff; color: var(--m3); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.mhero-cap { color: rgba(255, 255, 255, .85); font-size: 12.5px; font-weight: 650; }
.mhero-big { font-family: var(--display); font-size: 44px; font-weight: 800; line-height: 1.05; letter-spacing: -1.2px; margin: 2px 0 6px;
  font-variant-numeric: tabular-nums; text-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.mhero-big small { color: rgba(255, 255, 255, .88); font-size: 17px; font-weight: 700; letter-spacing: 0; margin-left: 4px; }
.mhero-trend { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 750;
  background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.mchart { display: block; width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.mchart .mbar { transform-box: fill-box; transform-origin: bottom; animation: bar-grow .6s var(--ease) both; animation-delay: calc(var(--k) * 22ms + 120ms); }
.mchart.quiet .mbar { animation: none; }
.mhero .mempty { color: rgba(255, 255, 255, .9); font-weight: 600; margin-top: 14px; }
@keyframes bar-grow { from { transform: scaleY(0); } }

.mstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.mstat { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 12px 14px 12px 16px; position: relative; overflow: hidden; }
.mstat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--m2), var(--m3)); }
.mstat small:first-child { color: var(--muted); font-size: 12px; font-weight: 650; }
.mstat b { font-family: var(--display); font-size: 22px; font-weight: 800; color: var(--m-ink); font-variant-numeric: tabular-nums; }
.mstat small:last-child { color: var(--muted); font-size: 12px; }
.mnote { font-size: 13px; margin: 2px 2px 14px; color: var(--muted); }
.mbody .btn-primary { background: linear-gradient(200deg, var(--m2), var(--m3)); box-shadow: 0 3px 0 var(--m3); }
.mbody .btn-primary:active { box-shadow: 0 1px 0 var(--m3); }
.mbody .stagger { animation: view-in .4s var(--ease) both, fade-in .4s ease both; animation-delay: calc(var(--k, 0) * 50ms + 80ms); }

/* Grow / shrink between a tile and its page */
#tabs { view-transition-name: tabs; }
::view-transition-group(metric-bg) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .9, .25, 1); }
::view-transition-old(metric-bg), ::view-transition-new(metric-bg) { width: 100%; height: 100%; object-fit: cover; }
.vt-open::view-transition-old(metric-bg) { animation: vt-out .2s ease both; }
.vt-open::view-transition-new(metric-bg) { animation: none; opacity: 1; }
.vt-close::view-transition-old(metric-bg) { animation: vt-out .18s .3s ease both; }
.vt-close::view-transition-new(metric-bg) { animation: vt-in .2s .26s ease both; }
.vt-open::view-transition-new(metric-content) { animation: vt-rise .4s .16s var(--ease) both; }
::view-transition-old(metric-content) { animation: vt-out .14s ease both; }
.vt-open::view-transition-old(root), .vt-close::view-transition-old(root) { animation: vt-out .2s ease both; }
.vt-open::view-transition-new(root) { animation: vt-rise .42s .2s var(--ease) both; }
.vt-close::view-transition-new(root) { animation: vt-in .3s .1s ease both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
@keyframes vt-rise { from { opacity: 0; transform: translateY(16px); } }
/* No View Transitions in this browser: the page grows out from the top instead. */
.mhero.grow { animation: hero-grow .42s var(--ease) both; transform-origin: 50% 0; }
@keyframes hero-grow { from { opacity: .3; transform: scale(.9) translateY(24px); border-radius: 26px; } }
@media (prefers-reduced-motion: reduce) {
  .mt-spark.grow i, .mchart .mbar, .mhero.grow, .mbody .stagger { animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Buddy editor (D-053) */
.ed-top { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; }
.ed-top .ed-kind { flex: 1; margin: 0; }
.ed-sec { margin: 16px 0 0; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding-bottom: 2px; }
.species { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 8px; margin-top: 8px; }
.sp { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 5px; min-height: 0; border-radius: 16px; background: var(--card-2);
  border: 2px solid transparent; box-shadow: none; color: var(--text); }
.sp .av { margin: 0 auto; }
.sp small { font-size: 11.5px; font-weight: 700; color: var(--text); }
.sp.on { border-color: var(--accent); background: var(--accent-soft); }
.sp:active { transform: scale(.96); }
/* Cycle tracker (D-054): phase colours, ring, quick log, calendar, history, insights, day log. */
:root { --c-per: #e11d48; --c-fol: #16a34a; --c-ov: #7c3aed; --c-lut: #c2410c; --c-late: #64748b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-per: #fb7185; --c-fol: #4ade80; --c-ov: #a78bfa; --c-lut: #fb923c; --c-late: #94a3b8; } }
:root[data-theme="dark"] { --c-per: #fb7185; --c-fol: #4ade80; --c-ov: #a78bfa; --c-lut: #fb923c; --c-late: #94a3b8; }
[data-ph="per"] { --phc: var(--c-per); } [data-ph="fol"] { --phc: var(--c-fol); } [data-ph="ov"] { --phc: var(--c-ov); } [data-ph="lut"] { --phc: var(--c-lut); } [data-ph="late"] { --phc: var(--c-late); }
.cyc-private { text-align: center; font-size: 12.5px; color: var(--muted); margin: 14px 8px; }
.cyc-hero { display: flex; gap: 14px; align-items: center; border-top: 4px solid var(--phc, var(--c-per)); }
.cyc-hero-txt { flex: 1; min-width: 0; }
.cyc-hero-txt > small { display: block; color: var(--phc); font-weight: 800; text-transform: uppercase; font-size: 11.5px; letter-spacing: .04em; }
.cyc-hero h2 { font-size: 21px; margin-top: 2px; line-height: 1.2; }
.cyc-next { font-size: 14.5px; margin-top: 6px; line-height: 1.4; }
.cyc-range, .cyc-ovline { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.cyc-basis { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.cyc-ring { width: 128px; height: 128px; flex: none; }
.cyc-ring g circle { fill: none; stroke-width: 12; }
.cyc-ring .r-bg { stroke: var(--card-2); }
.cyc-ring .r-per { stroke: var(--c-per); }
.cyc-ring .r-ov { stroke: var(--c-ov); }
.cyc-ring .r-due { stroke: var(--c-per); opacity: .35; }
.cyc-ring .r-dot { fill: var(--text); stroke: var(--card); stroke-width: 3; }
.cyc-ring .r-small { font-size: 11px; fill: var(--muted); text-anchor: middle; font-weight: 750; }
.cyc-ring .r-big { font-size: 30px; font-weight: 850; fill: var(--text); text-anchor: middle; }
@media (max-width: 360px) { .cyc-hero { flex-direction: column; align-items: flex-start; } }
.cyc-empty { align-items: flex-start; border-top-color: var(--c-per); }
.cyc-empty-art { font-size: 34px; width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--c-per) 14%, var(--card)); flex: none; }
.cyc-empty p { font-size: 14px; margin-top: 4px; }
.cyc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cyc-actions > * { flex: 1 1 auto; }
.cyc-log h2, .cyc-ask h2 { font-size: 17px; }
.cyc-log .cyc-actions { margin-top: 0; }
.cyc-ask p { font-size: 14px; margin-top: 4px; }
.cyc-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.cf { min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); font-weight: 750; font-size: 13.5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: none; padding: 6px 4px; }
.cf i { display: block; width: 12px; height: 12px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c-per); }
.cf.f-spot i { width: 6px; height: 6px; } .cf.f-light i { width: 9px; height: 9px; } .cf.f-heavy i { width: 15px; height: 15px; } .cf.f-vheavy i { width: 18px; height: 18px; }
.cf.f-none i { background: transparent; border: 2px solid var(--muted); border-radius: 50%; transform: none; }
.cf.on { background: var(--c-per); border-color: var(--c-per); color: #fff; }
.cf.on i { background: #fff; }
.cf.f-none.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.cf.f-none.on i { background: transparent; border-color: var(--bg); }
.cyc-logbtn { margin-top: 10px; }
.cyc-logged { font-size: 13px; color: var(--muted); margin-top: 8px; }
.cyc-check { border-left: 4px solid var(--disputed); }
.cyc-check.lvl-info { border-left-color: var(--community); }
.cyc-check h3 { font-size: 15.5px; margin: 0 0 4px; }
.cyc-check p { font-size: 14px; }
.cyc-check .btn { margin-top: 8px; }
.cyc-more { margin: -2px 0 12px; }
.cyc-phase { border-top: 4px solid var(--phc); }
.cyc-phase h3 { font-size: 14.5px; margin: 12px 0 2px; }
.cyc-phase > p { font-size: 14px; margin-top: 4px; }
.cyc-phase .need-links { margin-top: 10px; }
.cyc-added { margin-top: 10px; font-size: 14px; }
.cyc-notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; }
/* Sources and doctor notes, used on every health guide. */
.src-foot { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
.src-foot a, .src-badge a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.src-badge { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--verified-bg); color: var(--text); margin-bottom: 12px; font-size: 13px; line-height: 1.45; }
.src-badge .src-tick { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--verified); color: var(--card); font-weight: 900; font-size: 14px; }
.src-badge b { display: block; color: var(--verified); font-size: 13.5px; }
.src-badge span { display: block; }
.src-badge a { font-weight: 650; }
.med-note { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--community) 11%, var(--card)); border: 1px solid color-mix(in srgb, var(--community) 30%, transparent); font-size: 13.5px; line-height: 1.45; margin-bottom: 12px; }
.med-note b { color: var(--community); }
.card .med-note:last-child, .card .src-badge:last-child { margin-bottom: 0; }
/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h2 { font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd span { text-align: center; font-size: 11.5px; font-weight: 800; color: var(--muted); padding: 2px 0 4px; }
.cal-d { position: relative; aspect-ratio: 1; min-height: 40px; min-width: 0; width: 100%; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 650; background: transparent; color: var(--text); box-shadow: none; padding: 0; border: 2px solid transparent; }
.cal-d.p-log { background: var(--c-per); color: #fff; font-weight: 800; }
.cal-d.p-log.f-heavy, .cal-d.p-log.f-vheavy { box-shadow: inset 0 0 0 3px color-mix(in srgb, #000 22%, var(--c-per)); }
.cal-d.p-ass { background: color-mix(in srgb, var(--c-per) 22%, var(--card)); }
.cal-d.p-pred { border: 2px dashed var(--c-per); }
.cal-d.p-ov { background: color-mix(in srgb, var(--c-ov) 16%, var(--card)); border: 2px dotted var(--c-ov); }
.cal-d.p-btw { border: 2px solid var(--c-per); }
.cal-d.p-spot::before { content: ""; position: absolute; top: 3px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--c-per); }
.cal-d.is-today { outline: 2.5px solid var(--text); outline-offset: 1px; }
.cal-d.is-fut { color: var(--muted); }
.cal-dot { position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: currentColor; opacity: .75; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 2px solid transparent; flex: none; }
.lg.p-log { background: var(--c-per); } .lg.p-ass { background: color-mix(in srgb, var(--c-per) 22%, var(--card)); }
.lg.p-pred { border: 2px dashed var(--c-per); } .lg.p-ov { background: color-mix(in srgb, var(--c-ov) 16%, var(--card)); border: 2px dotted var(--c-ov); }
.lg.p-spot { width: 7px; height: 7px; background: var(--c-per); border: 0; } .lg.dot { width: 6px; height: 6px; background: var(--text); border: 0; }
.lg[data-ph] { background: var(--phc); border-radius: 4px; border: 0; }
/* History */
.cyc-hdot { width: 12px; height: 12px; border-radius: 50%; background: var(--card-2); flex: none; }
.cyc-hdot.bleed { background: var(--c-per); } .cyc-hdot.spot { background: transparent; box-shadow: inset 0 0 0 3px var(--c-per); } .cyc-hdot.ov { background: var(--c-ov); }
.cyc-hnote { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 2px; overflow-wrap: anywhere; }
/* Insights */
.cyc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.cyc-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; }
.cyc-stat b { font-size: 22px; line-height: 1.2; }
.cyc-stat span { font-size: 13px; font-weight: 750; }
.cyc-stat small { font-size: 12px; color: var(--muted); }
.cyc-chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.cyc-chart .band { fill: color-mix(in srgb, var(--c-fol) 14%, transparent); }
.cyc-chart .cb { fill: var(--c-per); } .cyc-chart .cb.out { fill: var(--c-lut); }
.cyc-chart .cv { font-size: 10px; fill: var(--text); text-anchor: middle; font-weight: 750; }
.cyc-chart .ax { font-size: 9.5px; fill: var(--muted); text-anchor: end; }
.cyc-chart .base { stroke: var(--line); }
.cyc-pats { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.cyc-pat-top { display: flex; justify-content: space-between; gap: 4px 8px; font-size: 14px; flex-wrap: wrap; }
.cyc-pat-top span { color: var(--muted); font-size: 13px; }
.cyc-pbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin-top: 5px; background: var(--card-2); gap: 2px; }
.cyc-pbar i { background: var(--phc); }
.cyc-tools .btn-block { margin-bottom: 8px; }
.cyc-tools .grid2 { gap: 8px; }
.doc-sum { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; background: var(--card-2); color: var(--text); padding: 12px; border-radius: 12px; max-height: 50vh; overflow: auto; margin: 10px 0; }
/* Day log sheet */
.dlog fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.dlog legend { font-weight: 800; font-size: 15px; padding: 0; margin-bottom: 8px; }
.dlog-val { font-weight: 650; font-size: 13px; color: var(--muted); margin-left: 6px; }
.lchips { display: flex; flex-wrap: wrap; gap: 6px; }
.lchip { min-height: 40px; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); font-weight: 700; font-size: 13.5px; box-shadow: none; }
.lchip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.lchip[data-g="flow"].on:not([data-v="none"]), .pain-row .lchip.on { background: var(--c-per); border-color: var(--c-per); color: #fff; }
.pain-row { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; }
.pain-row .lchip { padding: 0; min-height: 42px; border-radius: 10px; font-size: 14px; }
.dlog-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.dlog-hint:empty { display: none; }
.check-row[hidden] { display: none; }
.rf-h { font-size: 14.5px; margin: 12px 0 2px; }
.rf-h:first-child { margin-top: 4px; }

/* Favourites go where you choose (D-056): Meals, Ingredients or your own categories. */
.fav-btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-opts .item.pick[aria-current="true"] { background: var(--accent-soft); }
.fav-here { flex: none; font-size: 12.5px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.fav-new { margin-top: 16px; }
.fav-new-row { display: flex; gap: 8px; align-items: stretch; }
.fav-new-row input { flex: 1; min-width: 0; }
.fav-new-row .btn { flex: none; }
.mine-tablist { display: flex; gap: 8px; flex: none; }
.chip.chip-add { border-style: dashed; color: var(--accent); background: transparent; }
.fav-move { flex: none; }
.cat-tools { display: flex; gap: 4px; flex: none; }

/* Own protein / carbs / fat split (D-057). */
.macro-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.macro-grid3 input { width: 100%; }
.macro-grid3 small { display: block; margin-top: 3px; font-size: 12px; }

/* Month and year reports, and the health summary to print (D-058). */
.report-seg a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 6px 4px; font-size: 13.5px; font-weight: 700;
  color: var(--muted); border-radius: 12px; text-decoration: none; }
.report-seg a.on { background: var(--card); color: var(--text); box-shadow: 0 1px 0 var(--ink-edge), 0 4px 10px -6px rgba(0, 0, 0, .25); }
.table-wrap { overflow-x: auto; margin-top: 8px; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rep-table th, .rep-table td { padding: 7px 6px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rep-table th:first-child, .rep-table td:first-child { text-align: left; }
.rep-table thead th { font-size: 12px; color: var(--muted); font-weight: 700; white-space: normal; }
.printout { background: #fff; color: #111; border-radius: var(--radius-s); padding: 20px 18px; margin: 0 0 16px; box-shadow: var(--shadow); font-size: 13.5px; line-height: 1.45; }
.printout h1 { font-size: 22px; color: #111; margin: 0; }
.printout h2 { font-size: 15.5px; color: #111; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 2px solid #111; }
.printout p { margin: 4px 0; color: #222; }
.printout .po-sub { color: #444; font-size: 12.5px; }
.po-table { width: 100%; border-collapse: collapse; }
.po-table th, .po-table td { text-align: left; vertical-align: top; padding: 5px 6px; border-bottom: 1px solid #ddd; color: #111; }
.po-table th[scope="row"] { width: 38%; font-weight: 700; }
.po-cols thead th { background: #f1f1f1; font-size: 12px; }
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #000 !important; }
  #tabs, #toast, #sheet, .no-print, .bg-orbs, .skip-link { display: none !important; }
  main#view { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .printout { box-shadow: none; border-radius: 0; padding: 0; margin: 0; font-size: 11.5pt; }
  .printout h2 { break-after: avoid; }
  .po-table tr { break-inside: avoid; }
}

/* Programmes: follow a plan for 8-12 weeks (D-060). */
.prog-card .actions { margin-top: 10px; }
.prog-start .chips { padding-bottom: 4px; }
.prog-weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-top: 8px; }
.prog-week { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 12px; background: var(--card-2); font-size: 12.5px; font-weight: 700; }
.prog-week.now { outline: 2px solid var(--accent); }
.prog-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.prog-dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--muted); opacity: .6; }
.prog-dots i.on { background: var(--accent); border-color: var(--accent); opacity: 1; }
.prog-ex { align-items: flex-start; }
.prog-next { font-size: 13.5px; margin-top: 6px; }
.prog-up { color: var(--verified); }

/* "Last time" in the workout logger (D-061). */
.set-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 8px 2px 2px; }
.set-hint .btn-small { flex: none; }
.set-hint b { font-weight: 800; }

/* 7-day meal plans (D-062). */
.mp-day summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.mp-sum { font-size: 12.5px; font-weight: 600; }
.mp-list { box-shadow: none; margin-top: 8px; }
.mp-item { align-items: center; }
.mp-item .item-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }

/* Macro bars on Today: goal hit / over (UX pass). */
.macro .m-hit { font-weight: 800; }
.macro .m-over { font-weight: 800; padding: 0 5px; border-radius: 6px; background: rgba(255, 209, 102, .25); }
.macro .bar.over { box-shadow: inset 0 0 0 1.5px #ffd166; }

/* Edit a saved meal (D-066). */
.me-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.me-row .item-main { flex: 1 1 100%; min-width: 0; }
.qty-step { display: flex; align-items: center; gap: 2px; flex: none; }
.qty-step input { width: 58px; text-align: center; padding: 6px 4px; }
.qty-step .icon-btn { width: 32px; height: 32px; font-size: 18px; font-weight: 800; }
.me-kcal { flex: none; min-width: 40px; text-align: right; margin-left: auto; }
/* Goal weight and waist on Me (D-063, D-067). */
.gw-box, .waist-box { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.waist-box .card-head { margin-bottom: 0; }
/* Meal plan swap (D-068). */
.mp-btns { display: flex; align-items: center; gap: 4px; flex: none; }
.mp-swap { font-size: 18px; font-weight: 800; }
/* Rest timer (D-069). */
.rest-row { align-items: center; margin-top: 10px; padding-bottom: 4px; }
.rest-row > span { flex: none; font-size: 13px; font-weight: 700; }
.rest-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 6px;
  padding: 8px 10px 8px 16px; border-radius: 999px; background: var(--text); color: var(--bg); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
.rest-pill[hidden] { display: none; }
.rest-pill b { font-size: 16px; font-variant-numeric: tabular-nums; min-width: 92px; }
.rest-pill .btn-ghost { color: var(--bg); }

/* Today: meal plan pick and programme nudge (D-070). */
.plan-meal { display: block; margin-top: 4px; text-align: left; }
.prog-nudge .item-sub { font-size: 12.5px; }

/* D-072: anything marked hidden stays hidden, even when its class sets a display (buttons are inline-flex, the voice bar is flex). */
[hidden] { display: none !important; }
/* D-073 Servings | Grams */
.amt-by { margin-top: 4px; }
/* D-074 Copy beside Save as a meal */
.meal .save-meal + .save-meal { margin-left: 4px; }
/* D-077 "Week 1 of 8" stays on one line */
.prog-card .card-head b { white-space: nowrap; flex: none; }

/* D-078 calmer Today header: the buddy (idle animation) on the left, the streak on the right; room for a speech bubble later */
.head.hello { align-items: center; padding-bottom: 10px; }
.head.hello .hello-av { margin: -4px 0 -6px; }
.head.hello .streak { margin-left: auto; }

/* D-079 the buddy stage at the top of Today: the buddy, its props and particles. Nothing in it may poke out of the stage. */
:root { --bs-dust: rgba(150, 126, 102, .55); --bs-steam: rgba(120, 118, 115, .5); --bs-z: #6b7280; --bs-shadow: rgba(0, 0, 0, .16);
  --bs-wood: #c08a55; --bs-wood2: #9e6c3e; --bs-mat: rgba(13, 148, 136, .22); --bs-counter: #d6cfc7; --bs-counter2: #b5aca2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bs-dust: rgba(225, 214, 200, .32); --bs-steam: rgba(255, 255, 255, .5); --bs-z: #cbd5e1; --bs-shadow: rgba(0, 0, 0, .38);
    --bs-wood: #a9764a; --bs-wood2: #855a35; --bs-mat: rgba(45, 212, 191, .18); --bs-counter: #5b5550; --bs-counter2: #46413d; }
}
:root[data-theme="dark"] { --bs-dust: rgba(225, 214, 200, .32); --bs-steam: rgba(255, 255, 255, .5); --bs-z: #cbd5e1; --bs-shadow: rgba(0, 0, 0, .38);
  --bs-wood: #a9764a; --bs-wood2: #855a35; --bs-mat: rgba(45, 212, 191, .18); --bs-counter: #5b5550; --bs-counter2: #46413d; }
.head.hello.bs-head { display: block; position: relative; padding: 0; margin: 0 0 2px; }
.bs-head .streak { position: absolute; right: 0; top: 30px; z-index: 5; }
.bs-stage { position: relative; width: 100%; overflow: hidden; contain: layout paint; }
.bs-stage > svg { position: absolute; left: 0; top: 0; overflow: hidden; pointer-events: none; }
.bs-back { z-index: 1; } .bs-front { z-index: 3; } .bs-fx { z-index: 4; }
.bs-buddy { position: absolute; left: 0; top: 0; z-index: 2; display: block; line-height: 0; -webkit-tap-highlight-color: transparent; }
.bs-buddy .av { will-change: transform; }
.av.rig, .av.rig * { animation: none !important; transform-box: view-box !important; transform-origin: 0 0 !important; }
.av.rig { transform-origin: var(--bs-o, 0 0) !important; }

/* D-080 the animated buddy outside Today: a little stage scaled to size; the room above its head overlaps what's above and takes no taps */
.actor-slot { display: inline-block; line-height: 0; vertical-align: bottom; }
.bs-actor { display: inline-block; position: relative; pointer-events: none; vertical-align: bottom; }
.bs-actor-in { display: block; position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.bs-actor .bs-stage { overflow: hidden; }
/* D-081 Today's macro bars grow from where they were */
.cal-hero .macros .bar i { animation: bar-fill .8s var(--ease) both; }
@keyframes bar-fill { from { width: var(--from, 0%); } }
/* D-081 a logged food's name and amount stack (the row is a button, and buttons lay out side by side) */
.meal-item .edit-log { flex: 1; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 0; box-shadow: none; }
