/* ---- Typeface ----
   Outfit, self-hosted so it loads under the Mini App's CSP (`_CSP` in
   server.py has no font-src, so fonts fall back to default-src 'self' — do not
   add Google Fonts). Google serves Outfit as a *variable* font: one file per
   subset carrying the whole 400-800 weight axis, which is why there are two
   files rather than one per weight (all five pinned weights hand back the same
   bytes). The unicode-range is what makes this safe for Russian: Outfit ships
   latin + latin-ext only, so Cyrillic never matches a range here and falls
   through to the system stack instead of rendering as tofu. */
/* latin */
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/outfit/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/outfit/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


:root {
  /* Telegram injects these; sensible fallbacks for out-of-Telegram preview. */
  --bg: var(--tg-theme-bg-color, #0f1115);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #1a1d23);
  --text: var(--tg-theme-text-color, #f5f6f8);
  --hint: var(--tg-theme-hint-color, #8a8f98);
  --link: var(--tg-theme-link-color, #4ea1ff);
  --accent: var(--tg-theme-button-color, #4ea1ff);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);

  /* Status (how the day is going) — used by the ring, bars and day summaries.
     Manual QA when touching --p/--f/--warn/--mc: screenshot the week bar chart,
     calendar legend, arc subtitle and day-status text in both Telegram light and
     dark themes, and confirm --warn reads as amber and stays visually distinct
     from both --f (on-track green) and --mc (carbs orange). */
  --p: #FF3B5C;   /* off track / over budget / danger */
  --f: #30D158;   /* on track                         */
  --warn: #FFB340; /* amber: drifting off target      */

  /* Text-only twins of the three status colours and of protein blue. The pure
     hues are tuned for *fills* (chart bars, the donut, macro rails, calendar
     dots), where 3:1 is the bar and the saturated colour is the design. As
     small text they fail badly on Telegram's light theme — #30D158 on white is
     1.8:1, #FFB340 is 1.7:1 — so anything that renders one of these as words
     reads its `-text` twin, which mixes toward --text and therefore darkens on
     light and lightens on dark. Ratios are picked to clear 4.5:1 in both
     themes; re-measure before changing one. Static fallback first, so an
     engine without color-mix() keeps the old (readable-on-dark) colour. */
  --p-text: var(--p);
  --p-text: color-mix(in srgb, var(--p) 70%, var(--text));
  --f-text: var(--f);
  --f-text: color-mix(in srgb, var(--f) 60%, var(--text));
  --warn-text: var(--warn);
  --warn-text: color-mix(in srgb, var(--warn) 55%, var(--text));
  --mp-text: var(--mp);
  --mp-text: color-mix(in srgb, var(--mp) 70%, var(--text));

  /* Macro identity — protein / carbs / fat, shown wherever macros appear. */
  --mp: #0A84FF;  /* protein */
  --mc: #FF9F0A;  /* carbs   */
  --mf: #7B61FF;  /* fat     */
  --radius: 18px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  --hairline: rgba(128, 128, 128, 0.16);

  /* Surface vocabulary shared with the marketing site's phone mockup
     (website/www/index.html #panel-dash), which is the design source for Home.
     The site pins dark hexes; these derive from the Telegram theme instead, so
     the same design holds in light mode. */
  --radius-card: 20px;  /* calorie card                       */
  --radius-sm: 14px;    /* meal rows, water/weight cards      */
  /* One rail colour for every progress track (donut, macro bars, water). These
     used to disagree — two read --secondary-bg, one read --bg. Static value
     first so an engine without color-mix() keeps a usable rule. */
  --track: var(--secondary-bg);
  --track: color-mix(in srgb, var(--text) 12%, var(--bg));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  /* Emoji faces sit before the generic sans-serif, which always matches and
     would otherwise end the chain — the FAB, streak pill and empty states are
     emoji. Mirrors website/www/site.css. */
  font-family: Outfit, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  overscroll-behavior-y: contain;
}

.hidden { display: none !important; }

/* ---- Loader ---- */
/* The boot loader is a skeleton of the Home screen rather than a bare spinner:
   it lives in index.html so it paints on the very first frame (before app.js
   parses), making a cold start feel like the app is already there. Warm starts
   hydrate from the persisted cache and replace it almost immediately. */
.loader { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--secondary-bg);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.spinner-sm { width: 24px; height: 24px; border-width: 2.5px; border-color: rgba(255,255,255,0.25); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Skeletons (cold-load placeholders) ----
   A shimmering block that stands in for content while it loads. The sweep is a
   neutral grey so it reads on both Telegram light and dark themes. */
.skel { position: relative; overflow: hidden; background: var(--secondary-bg); border-radius: 10px; }
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(128, 128, 128, 0.18), transparent);
  animation: skelsweep 1.3s ease-in-out infinite;
}
@keyframes skelsweep { 100% { transform: translateX(100%); } }

/* Shared page frame for the skeletons — mirrors .app so the shapes line up. */
.skel-frame {
  padding: calc(var(--safe-top, env(safe-area-inset-top, 0px)) + 6px) 16px 24px;
  max-width: 520px; margin: 0 auto;
}
.skel-line { height: 14px; border-radius: 7px; }
.skel-card { height: 96px; border-radius: var(--radius); margin-top: 16px; }

/* Home skeleton: day bar, calorie card, the water/weight two-up, meal rows.
   Shapes mirror the real layout so a cold start doesn't visibly jump when the
   screen paints over it. */
/* Heights are measured off the real screen, not guessed — the point is that
   the swap doesn't jump. Re-measure if the card's padding or type changes. */
.skel-daybar { width: 42%; height: 30px; margin: 2px 0 12px; }
.skel-cal { height: 192px; border-radius: var(--radius-card); }
.skel-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.skel-duo-card { height: 132px; border-radius: calc(var(--radius-sm) + 2px); }
.skel-mealhead { width: 34%; height: 16px; border-radius: 8px; margin-top: 26px; }
.skel-rows { margin-top: 17px; }
.skel-row { height: 50px; border-radius: var(--radius-sm); margin-top: 8px; }

/* Generic page skeleton overlay (Progress / Settings cold load) — a header
   line and a few cards, sitting above the page but below the bottom nav. */
#page-skel { position: fixed; inset: 0; z-index: 44; background: var(--bg); }
#page-skel .skel-title { width: 42%; height: 26px; margin: 6px 0 20px; }

/* ---- Gate (errors / onboarding) ---- */
.gate {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 32px; gap: 12px;
}
.gate-emoji { font-size: 64px; }
.gate h2 { margin: 0; font-size: 22px; }
.gate p { margin: 0; color: var(--hint); max-width: 300px; line-height: 1.5; }
.gate .btn { margin-top: 16px; }

/* ---- Welcome (first run): scan before goal setup ---- */
.welcome-actions {
  width: 100%; max-width: 320px;
  display: flex; flex-direction: column; gap: 10px;
}
/* The buttons live inside .welcome-actions, so the gap controls spacing — drop
   the .gate .btn top margin that would otherwise stack with it. */
.welcome-actions .btn { margin-top: 0; }
.welcome-logged {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 320px;
  background: var(--secondary-bg); border-radius: 12px; padding: 12px 16px;
  font-size: 14px; font-weight: 600;
}

/* ---- App layout ---- */
.app {
  padding: calc(var(--safe-top, env(safe-area-inset-top, 0px)) + 6px) 16px
           calc(96px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
}

/* ---- Calorie card (donut + macro bars) ----
   The design source is the phone mockup in website/www/index.html (#panel-dash):
   one card holding a full donut beside three macro bars, replacing the old
   semicircle arc and the separate three-ring macro card. */
.cal-card { padding: 18px; border-radius: var(--radius-card); margin: 2px 0 0; }
.cal-main { display: flex; align-items: center; gap: 16px; }
.arc-wrap {
  position: relative; width: 118px; height: 118px; flex: none;
  display: grid; place-items: center;
}
/* Rotated so the stroke starts at 12 o'clock and fills clockwise. */
.arc { display: block; width: 118px; height: 118px; transform: rotate(-90deg); }
.arc-track { fill: none; stroke: var(--track); stroke-width: 12; }
.arc-fill {
  fill: none; stroke: url(#cal-grad); stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: 0 9999;
  transition: stroke-dasharray 0.9s cubic-bezier(.4,0,.2,1), stroke 0.3s;
}
.arc-center {
  position: absolute; display: flex; flex-direction: column;
  align-items: center; gap: 1px; text-align: center;
}
.arc-num { font-size: 25px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; color: var(--text); }
.arc-of { font-size: 11px; font-weight: 500; color: var(--hint); }

/* Day summary ("420 left" / "180 over"), the only element carrying the
   server's `tone`. A full-width foot row under a hairline divider. */
.cal-foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline);
}
.arc-sub { font-size: 12px; font-weight: 600; color: var(--hint); min-height: 15px; }
.arc-sub.over { color: var(--p-text); }
.arc-sub.warn { color: var(--warn-text); }
.arc-sub.good { color: var(--f-text); }

/* Streak chip, now in the day bar rather than over the arc. Amber, not red —
   red reads as danger, and a streak is not a warning. */
.streak-badge {
  display: inline-flex; align-items: center; flex: none;
  background: rgba(255, 179, 64, 0.12);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px; font-weight: 600; color: var(--warn-text);
  white-space: nowrap;
}

/* ---- Cards ---- */
.card {
  background: var(--secondary-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

/* ---- Macro bars (protein / carbs / fat vs. target) ----
   The right-hand column of the calorie card. Bars, not rings: three rings in
   their own card cost a full screen band to say what three 6px rails say
   inline, beside the number they qualify. */
.dot-p { background: var(--mp); } .dot-c { background: var(--mc); } .dot-f { background: var(--mf); }
.macros { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.macro-row { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.macro-line {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; font-size: 12px;
}
.macro-name { color: var(--hint); font-weight: 500; white-space: nowrap; }
.macro-val {
  font-weight: 700; color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.macro-track { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.macro-fill {
  display: block; height: 100%; width: 0; border-radius: 3px;
  transition: width 0.8s cubic-bezier(.4,0,.2,1), background-color 0.3s;
}
.macro-tail { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.over-badge {
  display: inline-block; padding: 1px 5px; border-radius: 5px;
  font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(255, 59, 92, .14); color: var(--p-text);
  vertical-align: middle;
}
/* Base bar colour per macro; JS recolours to --p when over target by >5%. */
#rp { background: var(--mp); }
#rc { background: var(--mc); }
#rf { background: var(--mf); }

/* Empty day (no meals logged yet) — the alternative right-hand column of the
   calorie card, so the card keeps its shape before the first meal. */
.macros-empty {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 4px 0;
}
.macros-empty-icon { font-size: 26px; opacity: .25; }
.macros-empty-txt { font-size: 12px; color: var(--hint); text-align: center; line-height: 1.45; }

/* ---- Sections ---- */
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
/* Quieter heading for Home's meal list, matching the mockup. A modifier rather
   than a change to `.section-head h3`, which Progress and Settings share. */
.section-head--quiet { margin-bottom: 9px; }
.section-head--quiet h3 { font-size: 13px; font-weight: 600; color: var(--hint); }

/* Small-caps label from the site's design (WATER / WEIGHT). */
.caps {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--hint);
}

.btn-ghost {
  background: none; border: none; color: var(--link);
  font-size: 15px; font-weight: 600; cursor: pointer; padding: 6px 4px;
}

/* ---- Weekly bar chart ---- */
.week-card { padding: 18px 16px 12px; }
.week-bars {
  position: relative; display: flex; align-items: flex-end; gap: 8px;
  height: 110px; padding-left: 30px;
}
/* Calorie y-axis: numeric labels in a left gutter + faint gridlines behind the
   bars (auto 500/1000 step). Gridlines start at the bars (left: 30px) so they
   align with the goal/extreme reference lines. */
.wk-yaxis { position: absolute; left: 0; top: 0; bottom: 0; width: 28px; pointer-events: none; }
.wk-yaxis span { position: absolute; left: 0; transform: translateY(50%);
  font-size: 10px; color: var(--hint); font-weight: 600; }
.wk-grid { position: absolute; left: 30px; right: 0; height: 0;
  border-top: 1px solid var(--hairline); opacity: 0.5; pointer-events: none; }
.wk-col {
  flex: 1; min-width: 0; border-radius: 6px 6px 3px 3px;
  background: var(--accent); opacity: 0.85;
  min-height: 4px; transition: height 0.6s cubic-bezier(.4,0,.2,1);
}
/* Traffic-light tone: on track / drifting / off track for the day's goal.
   Default (no goal) stays neutral accent; logged days get a tone class. */
.wk-col.good { background: var(--f); opacity: 0.9; }
.wk-col.warn { background: var(--warn); opacity: 0.9; }
.wk-col.bad { background: var(--p); opacity: 0.9; }
.wk-col.today { opacity: 1; }
.wk-col.empty { background: var(--hint); opacity: 0.18; }
.week-labels { display: flex; gap: 8px; margin-top: 8px; padding-left: 30px; }
.wk-label { flex: 1; text-align: center; font-size: 11px; color: var(--hint); font-weight: 600; }
.wk-label.today { color: var(--text); }
/* Legend explaining the chart's dashed reference lines (shown to match the
   lines actually drawn: goal always, the safe-minimum floor only for cuts). */
.week-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.week-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--hint); font-weight: 600; }
.week-legend-dash { width: 18px; height: 0; flex-shrink: 0; }
.week-legend-dash.goal { border-top: 1.5px dashed var(--hint); opacity: 0.7; }
.week-legend-dash.extreme { border-top: 1.5px dashed var(--p); opacity: 0.85; }

/* "?" help button + the title group it sits in (keeps it next to the heading
   rather than pushed to the far edge by the section-head's space-between). */
.head-left { display: flex; align-items: center; gap: 7px; min-width: 0; }
.info-btn {
  width: 18px; height: 18px; flex-shrink: 0; padding: 0; cursor: pointer;
  border: 1.5px solid var(--hint); border-radius: 50%; background: transparent;
  color: var(--hint); font-size: 11px; font-weight: 700; line-height: 1;
}
.info-btn:active { opacity: 0.55; }
.macro-split-title { display: flex; align-items: center; gap: 7px; }

/* Weekly chart: week pager, stepped goal/floor overlay, tapped-day popover. */
.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.week-nav .date-label { font-size: 13px; }
.week-plot { position: relative; }
/* Stepped dashed target (and safe-min) line, drawn over the bars. Aligned to the
   bars area (left: 30px) like .wk-grid; non-scaling stroke keeps dashes uniform
   despite the non-uniform viewBox scaling. */
.wk-overlay { position: absolute; left: 30px; top: 0; width: calc(100% - 30px); height: 100%;
  pointer-events: none; overflow: visible; z-index: 2; }
.wk-overlay path { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.wk-overlay path.goal { stroke: var(--hint); opacity: 0.75; stroke-dasharray: 4 3; }
.wk-overlay path.extreme { stroke: var(--p); opacity: 0.85; stroke-dasharray: 4 3; }
.bar-pop {
  position: absolute; z-index: 6; transform: translateX(-50%); pointer-events: none;
  min-width: 196px; padding: 9px 11px; border-radius: 12px;
  background: var(--secondary-bg); border: 1px solid var(--hairline);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.bar-pop-date { font-size: 11px; color: var(--hint); font-weight: 700; margin-bottom: 2px; }
.bar-pop-cal { font-size: 15px; font-weight: 800; }
.bar-pop-goal { font-size: 11px; color: var(--hint); font-weight: 600; margin-left: 3px; }
.bar-pop-macros {
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hairline);
}
.bp-macro { display: flex; flex-direction: column; gap: 3px; }
.bp-macro-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 600; }
.bp-macro-name { display: flex; align-items: center; gap: 5px; color: var(--text); }
.bp-macro-name i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bp-macro-val { color: var(--hint); white-space: nowrap; }
.bp-macro-pct { color: var(--text); font-weight: 700; margin-left: 6px; }
.bp-bar { height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.bp-fill { height: 100%; width: 0; border-radius: 2px; transition: width 0.4s ease; }

/* ---- Meals ---- */
.meals-list { display: flex; flex-direction: column; gap: 8px; }
.meal {
  display: flex; align-items: center; gap: 10px;
  background: var(--secondary-bg); border-radius: var(--radius-sm); padding: 9px 11px;
  animation: slidein 0.25s ease;
}
@keyframes slidein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.meal-thumb {
  width: 38px; height: 38px; border-radius: 10px; object-fit: cover;
  flex-shrink: 0; background: var(--bg);
}
.meal-time {
  font-size: 12px; font-weight: 700; color: var(--hint);
  min-width: 38px; text-align: center;
}
.meal-info { flex: 1; min-width: 0; }
.meal-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-macros { font-size: 11px; color: var(--hint); margin-top: 1px; }
.meal-cal { font-weight: 700; font-size: 14px; white-space: nowrap; }
.meal-cal small { font-size: 11px; color: var(--hint); font-weight: 600; }
.meal-del {
  background: none; border: none; color: var(--hint); font-size: 20px;
  cursor: pointer; padding: 4px 2px; line-height: 1;
}
.empty { text-align: center; color: var(--hint); padding: 20px 0; }
.empty-text { font-size: 15px; margin-bottom: 14px; }
.btn-inline { width: auto; display: inline-flex; align-items: center; gap: 6px; padding: 11px 20px; }

/* ---- Water + weight (two-up row) ----
   Half-width cards side by side, per the mockup. Each card carries its own
   caps label row, so the two `.section-head` wrappers these used to sit under
   are gone; the Goal / Log buttons became the right-hand item of that row. */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.duo-card { padding: 13px; border-radius: calc(var(--radius-sm) + 2px); min-width: 0; }
.duo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.duo-head .btn-ghost { padding: 0; font-size: 11px; font-weight: 600; }

/* ---- Weight ---- */
.weight-card { display: flex; flex-direction: column; gap: 5px; }
.weight-card.tappable { cursor: pointer; }
.weight-now { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.weight-val { font-size: 19px; font-weight: 700; }
.weight-unit { font-size: 12px; color: var(--hint); font-weight: 500; }
.spark { width: 100%; height: 34px; margin: 2px 0; display: block; }
.spark path { fill: none; stroke: var(--f); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.spark .area { fill: var(--f); opacity: 0.10; stroke: none; }
/* Weight delta. Coloured by movement toward the user's goal, never by
   direction — the app does not treat "down" as good. */
.weight-meta { font-size: 12px; font-weight: 600; color: var(--hint); }
.weight-meta.toward { color: var(--f-text); }
.weight-meta .weight-span { color: var(--hint); font-weight: 500; }

/* ---- Water ---- */
.water-card { display: flex; flex-direction: column; gap: 7px; }
.water-now { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.water-val { font-size: 19px; font-weight: 700; }
.water-unit, .water-goal-meta { font-size: 12px; color: var(--hint); font-weight: 500; }
.water-bar { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; }
.water-fill {
  height: 100%; width: 0; border-radius: 3px;
  background: var(--mp); transition: width 0.5s ease;
}
.water-fill.full { background: var(--f); }
.water-actions { display: flex; gap: 5px; margin-top: 1px; }
.water-add {
  flex: 1; min-width: 0; border: none;
  background: rgba(10, 132, 255, 0.13); color: var(--mp-text);
  border-radius: 8px; padding: 5px 0; font-size: 11px; font-weight: 700;
  text-align: center; cursor: pointer; transition: transform 0.12s;
}
.water-add:active { transform: scale(0.96); }
.water-undo {
  /* Icon-only control, so it owes 3:1 against its own tint — plain --hint on
     --track lands at 2.9:1 on dark. Mixed toward --text it clears 4.7:1 in
     both themes while staying visibly quieter than the +250 / +500 chips. */
  flex: none; border: none; background: var(--track);
  color: color-mix(in srgb, var(--hint) 70%, var(--text));
  border-radius: 8px; padding: 5px 8px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.water-undo:disabled { opacity: 0.4; cursor: default; }

/* Barcode "looking up" spinner is inline in the sheet (not overlaying a photo). */
.barcode-searching {
  position: static; inset: auto; flex-direction: row; justify-content: flex-start;
  background: none; color: var(--hint); margin-top: 12px;
}
/* "or" divider between the camera-scan button and manual entry. */
.bc-or { text-align: center; color: var(--hint); font-size: 13px; margin: 14px 0; }

/* ---- Buttons ---- */
.btn {
  width: 100%; border: none; border-radius: 14px; padding: 15px;
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.5; }
/* Welcome-screen goal CTA escalation once a user has logged several meals
   without finishing setup (Task 39) — a subtle attention pulse, not a trap. */
@keyframes btnPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
.btn-pulse { animation: btnPulse 1.6s ease-in-out infinite; }

/* ---- Floating add-meal button (opens the add-meal sheet, lower-right) ---- */
.fab {
  position: fixed; z-index: 40;
  right: max(16px, calc(50vw - 260px + 16px));
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 60px; height: 60px; border: none; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  display: grid; place-items: center; font-size: 27px;
  cursor: pointer; transition: transform 0.15s;
}
.fab:active { transform: scale(0.92); }
.fab-icon { line-height: 1; font-size: 32px; font-weight: 400; }

/* ---- Bottom sheets ---- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
  animation: slideup 0.28s cubic-bezier(.16,1,.3,1);
  max-width: 520px; margin: 0 auto;
  max-height: 92vh; overflow-y: auto;
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle { width: 38px; height: 4px; border-radius: 2px; background: var(--hint); opacity: 0.4; margin: 4px auto 14px; }
.sheet-body h3 { margin: 0 0 16px; font-size: 19px; }

/* ---- Photo capture ---- */
/* Two equal-width meal-entry tiles: 📷 Scan and ✍️ Describe, side by side. */
.entry-tiles { display: flex; gap: 10px; }
.entry-tile {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--secondary-bg); border: 1.5px dashed var(--hairline);
  border-radius: 16px; padding: 18px 12px; cursor: pointer; color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.entry-tile:active { transform: scale(0.99); }
.entry-tile-icon {
  font-size: 26px; width: 48px; height: 48px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 12px;
  background: var(--accent); color: var(--accent-text);
}
.entry-tile-label { font-weight: 700; font-size: 15px; }

.photo-preview {
  position: relative; border-radius: 16px; overflow: hidden;
  background: var(--secondary-bg); aspect-ratio: 16 / 10;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-clear {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px;
  border: none; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer; z-index: 2;
}
.photo-analyzing {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(0,0,0,0.55); color: #fff; font-weight: 600; font-size: 14px;
}

.ai-hint {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--hint); margin-top: 12px; line-height: 1.4;
}
.ai-hint::before { content: "✨"; font-size: 15px; }

/* AI result summary — the scanned meal at a glance, so Save is one tap. The
   editor below it is collapsed by default (opt-in depth). */
.meal-result {
  background: var(--secondary-bg); border-radius: 16px;
  padding: 16px; margin-top: 14px; text-align: center;
}
.meal-result-food { font-size: 18px; font-weight: 700; line-height: 1.3; }
.meal-result-cal { font-size: 30px; font-weight: 800; margin-top: 4px; }
.meal-result-cal #meal-result-unit { font-size: 15px; font-weight: 600; color: var(--hint); }
.meal-result-macros { font-size: 13px; font-weight: 600; color: var(--hint); margin-top: 4px; }
.meal-result .ai-hint { justify-content: center; margin-top: 10px; }

/* Partial-result paywall: the calorie total is real, the rows under it are
   placeholder glyphs. The blur is cosmetic — the server never sent the macros
   or the ingredient list — so there is nothing here to un-blur with devtools. */
.scan-preview {
  background: var(--secondary-bg); border-radius: 16px;
  padding: 16px; margin-top: 14px; text-align: center;
}
.scan-preview .meal-result-cal { margin-top: 0; }
.scan-preview #sp-unit { font-size: 15px; font-weight: 600; color: var(--hint); }
.sp-locked { margin-top: 10px; text-align: left; }
.sp-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 600; color: var(--hint); padding: 4px 2px;
}
.sp-blur { filter: blur(4.5px); user-select: none; letter-spacing: 1px; }
.scan-preview .disclaimer-note { margin-top: 10px; text-align: left; }
.scan-preview .btn { margin-top: 12px; }

/* "Edit details" disclosure that reveals the editor after a scan. */
.details-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; color: var(--link);
  font-size: 15px; font-weight: 600; cursor: pointer; padding: 14px 4px;
}
.details-toggle-chev { font-size: 18px; }
.meal-details.collapsed { display: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 13px; color: var(--hint); font-weight: 600; }
.field input, .field textarea {
  width: 100%; min-width: 0;
  background: var(--secondary-bg); border: 1px solid transparent; color: var(--text);
  border-radius: 12px; padding: 13px 14px; font-size: 16px; outline: none;
  transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field-row { display: flex; gap: 10px; }
/* min-width:0 lets the inputs shrink below their intrinsic width so a 3-column
   row (protein/carbs/fat) fits the viewport instead of overflowing off-screen. */
.field-row .field { flex: 1; min-width: 0; }
.field textarea {
  resize: none; font-family: inherit; line-height: 1.4; min-height: 64px;
}

/* "Estimate from description" button — secondary action below the description
   field that re-runs the LLM on the typed text. */
.btn-estimate {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--secondary-bg); color: var(--text);
  border: none; border-radius: 14px; padding: 13px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform 0.15s, opacity 0.15s; margin-bottom: 14px;
}
.btn-estimate:active { transform: scale(0.985); }
.btn-estimate:disabled { opacity: 0.5; cursor: default; }
.btn-estimate .spinner-sm { margin: 0; }

/* Description field + its dictate button, side by side. */
.desc-row { display: flex; gap: 8px; align-items: stretch; }
.desc-row textarea { flex: 1; min-width: 0; }
.desc-mic {
  flex: 0 0 auto; width: 48px; border: none; border-radius: 12px;
  background: var(--secondary-bg); color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer; transition: transform 0.15s;
}
.desc-mic:active { transform: scale(0.94); }

/* ---- Voice recorder sheet ---- */
.voice-hint { font-size: 14px; color: var(--hint); line-height: 1.4; margin: 0 0 18px; }
.voice-stage {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin: 8px 0 24px;
}
.voice-dot {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--p); display: grid; place-items: center;
  animation: voicepulse 1.4s ease-in-out infinite;
}
/* Box-shadow (not transform) so the pulse doesn't reflow the sheet. */
@keyframes voicepulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0.45); }  /* --p */
  50% { box-shadow: 0 0 0 18px rgba(255, 59, 92, 0); }
}
.voice-timer { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.voice-working {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--hint);
}
.voice-working .spinner-sm { border-color: rgba(128,128,128,0.25); border-top-color: var(--accent); }

/* Helper line under the Description field: makes it obvious the field both
   refines the AI estimate and accepts a free-text description. */
.field-help { font-size: 12px; color: var(--hint); margin: -6px 0 14px; line-height: 1.4; }
.activity-desc { font-size: 13px; color: var(--hint); margin: -8px 0 14px; padding: 0 2px; min-height: 18px; }

/* ---- Editable nutrition block (Add-a-meal) ----
   The atomic recognized ingredients above an editable total-calories field.
   Editing an item's grams OR the total calories live-recomputes everything
   else (a calculator under the hood). */
.items-editor-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
#items-editor-title, #em-items-title { font-size: 14px; font-weight: 700; }
.items-editor-hint { font-size: 12px; color: var(--hint); }
.items-editor-list { display: flex; flex-direction: column; gap: 8px; }
/* Gap below the ingredient list only when there are rows. */
.items-editor-list:not(:empty) { margin-bottom: 12px; }
.item-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--secondary-bg); border-radius: 12px; padding: 10px 12px;
  animation: slidein 0.2s ease;
}
.item-emoji { font-size: 20px; flex-shrink: 0; width: 24px; text-align: center; }
.item-main { flex: 1; min-width: 0; }
.item-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-kcal { font-size: 12px; color: var(--hint); margin-top: 1px; }
.item-weight { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.item-weight-input {
  width: 62px; text-align: right; -moz-appearance: textfield;
  background: var(--bg); border: 1px solid var(--hairline); color: var(--text);
  border-radius: 9px; padding: 8px; font-size: 15px; outline: none;
  transition: border-color 0.15s;
}
.item-weight-input:focus { border-color: var(--accent); }
.item-weight-unit { font-size: 13px; color: var(--hint); font-weight: 600; }
/* Recalculated macro summary under the total-calories field. */
.items-editor-macros { font-size: 13px; color: var(--hint); font-weight: 600; margin: -8px 0 14px; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 20px;
  border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 100;
  box-shadow: var(--shadow); animation: toastin 0.25s ease; max-width: 90%;
  text-align: center;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============================================================ PAGES + NAV */
.page { display: none; }
.page.active { display: block; }
.page-head { padding: 18px 0 4px; }
.page-head h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }

/* Bottom tab bar */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; background: var(--secondary-bg);
  border-top: 1px solid var(--hairline);
  padding-bottom: env(safe-area-inset-bottom);
  max-width: 520px; margin: 0 auto;
}
.nav-btn {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 7px; color: var(--hint);
}
.nav-icon { font-size: 21px; line-height: 1; opacity: 0.65; }
.nav-label { font-size: 11px; font-weight: 600; }
.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-icon { opacity: 1; }

/* The bottom nav needs clearance; lift the FAB and toast above it. */
.fab { bottom: calc(80px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(80px + env(safe-area-inset-bottom)); }

/* ============================================================ HISTORY */
.search-row { position: relative; margin: 12px 0 4px; }
.search-row input {
  width: 100%; background: var(--secondary-bg); border: 1px solid transparent;
  color: var(--text); border-radius: 12px; padding: 12px 38px 12px 14px;
  font-size: 15px; outline: none;
}
.search-row input:focus { border-color: var(--accent); }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: var(--hairline); color: var(--text); font-size: 18px;
  cursor: pointer; line-height: 1;
}
.search-banner { font-size: 13px; color: var(--hint); font-weight: 600; margin: 10px 2px; }

.date-nav { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 12px; }
.date-arrow {
  width: 40px; height: 40px; border: none; border-radius: 12px;
  background: var(--secondary-bg); color: var(--text); font-size: 22px; cursor: pointer;
}
.date-arrow:disabled { opacity: 0.3; }
.date-label { font-weight: 700; font-size: 16px; }

.day-summary { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.day-cal { font-size: 30px; font-weight: 800; }
.day-cal-goal { font-size: 16px; color: var(--hint); font-weight: 600; }
.day-status { font-size: 14px; color: var(--hint); font-weight: 600; min-height: 18px; }
.day-status.over { color: var(--p); }
.day-status.warn { color: var(--warn); }
.day-status.good { color: var(--f); }
.day-macros { display: flex; gap: 16px; font-size: 13px; color: var(--hint); font-weight: 600; }
.day-macros i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.day-macros .dot-p { background: var(--mp); }
.day-macros .dot-c { background: var(--mc); }
.day-macros .dot-f { background: var(--mf); }

/* ============================================================ PROGRESS */
.muted { font-size: 12px; color: var(--hint); font-weight: 600; }
.month-chart { width: 100%; height: 130px; display: block; }
.month-chart .area { fill: var(--accent); opacity: 0.12; stroke: none; }
.month-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.month-chart .chart-goal { stroke: var(--hint); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: 0.6; }
.month-chart .chart-grid { stroke: var(--hairline); stroke-width: 1; opacity: 0.5; }
/* Crisp HTML calorie labels layered over the (horizontally distorted) SVG. */
.chart-wrap { position: relative; }
.chart-yaxis { position: absolute; left: 0; top: 0; bottom: 0; width: 34px; pointer-events: none; }
.chart-yaxis span { position: absolute; left: 2px; transform: translateY(-50%);
  font-size: 10px; color: var(--hint); font-weight: 600; }

.stats-grid { display: flex; gap: 10px; }
/* Four-up (referral progress): tighter gaps and smaller labels so a fourth
   column fits a narrow phone without wrapping the words. */
.stats-grid-4 { gap: 6px; }
.stats-grid-4 .stat { min-width: 0; }
.stats-grid-4 .stat-name { font-size: 10.5px; }
.stat { flex: 1; text-align: center; }
.stat-val { font-size: 22px; font-weight: 800; }
.stat-name { font-size: 11px; color: var(--hint); margin-top: 3px; font-weight: 600; }

.macro-split-title { font-size: 13px; color: var(--hint); font-weight: 600; margin-bottom: 12px; }
.msplit { display: flex; flex-direction: column; gap: 10px; }
.msplit-row { display: flex; align-items: center; gap: 10px; }
.msplit-lbl { width: 64px; font-size: 13px; color: var(--hint); font-weight: 600; }
.msplit-bar { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.msplit-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.fill-p { background: var(--mp); }
.fill-c { background: var(--mc); }
.fill-f { background: var(--mf); }
.msplit-pct { width: 40px; text-align: right; font-size: 13px; font-weight: 700; }

.top-foods { display: flex; flex-direction: column; gap: 10px; }
.top-food { display: flex; justify-content: space-between; font-size: 14px; }
.tf-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 10px; }
.tf-count { color: var(--hint); font-weight: 700; }

.achv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 12px; }
.achv-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.achv-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: var(--bg); border: 2px solid var(--hairline); }
.achv-badge.earned .achv-icon { background: rgba(48, 209, 88, 0.14); border-color: var(--f); }
.achv-badge.locked .achv-icon { filter: grayscale(1); opacity: 0.45; }
.achv-label { font-size: 11px; color: var(--hint); font-weight: 600; }
.achv-badge.earned .achv-label { color: var(--text); }

.goal-progress { margin-top: 14px; }
.goal-bar { height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.goal-fill { height: 100%; background: var(--accent); border-radius: 5px; transition: width 0.6s ease; }
.goal-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 13px; color: var(--hint); font-weight: 600; }
.goal-pct { color: var(--text); font-weight: 700; }

.advice-card { display: flex; flex-direction: column; gap: 14px; }
.advice-content { display: flex; flex-direction: column; gap: 10px; }
.advice-text { margin: 0; font-size: 15px; line-height: 1.5; }
.advice-recs { margin: 0; padding-left: 18px; color: var(--hint); font-size: 14px; line-height: 1.6; }

/* Markdown emitted by renderMarkdown() (app.js) for the LLM-written weekly
   narrative and daily advice. Headings stay close to body size — this is a
   card inside a section that already has its own <h3>, not a document. */
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }
.md-p { margin: 0 0 10px; }
.md-h { margin: 16px 0 6px; font-weight: 700; line-height: 1.35; }
.md-h1 { font-size: 16px; }
.md-h2 { font-size: 15px; }
.md-h3 { font-size: 14px; color: var(--hint); text-transform: uppercase; letter-spacing: 0.4px; }
.md-list { margin: 0 0 10px; padding-left: 20px; }
.md-list li { margin-bottom: 4px; }
.md-list li::marker { color: var(--hint); }
.md-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  background: var(--bg); border-radius: 4px; padding: 1px 5px;
}
.md-link { color: var(--accent); text-decoration: underline; cursor: pointer; }

/* T3 (P1): weekly AI insight teaser - a decorative blurred placeholder (the
   real narrative is withheld server-side for free users, so there is
   nothing genuine underneath to blur) with an unlock CTA on top. */
.insight-lock { position: relative; min-height: 64px; }
.insight-lock-blur {
  margin: 0; font-size: 15px; line-height: 1.5; color: var(--text);
  filter: blur(5px); user-select: none;
}
.insight-lock-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.insight-lock-overlay .btn { width: auto; padding: 10px 20px; font-size: 13px; }

/* ============================================================ PAYWALL / PLANS */
.trial-pill {
  display: block; margin: 0 auto 10px; width: fit-content;
  background: rgba(78, 161, 255, 0.12); border: 1px solid rgba(78, 161, 255, 0.3);
  color: var(--accent); font-size: 12px; font-weight: 700;
  border-radius: 20px; padding: 6px 14px; cursor: pointer;
}

.plans-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.plan-card {
  position: relative; text-align: left; width: 100%;
  background: var(--secondary-bg); border: 1.5px solid var(--hairline);
  border-radius: 14px; padding: 14px 16px; cursor: pointer; color: var(--text);
  transition: border-color 0.15s;
}
/* The selected card is what the Continue button charges for, so it is marked
   the way a radio group is — a filled dot and an accent name — not by a
   1.5px border colour alone (which is invisible next to an unselected card on
   a bright phone screen, and told a screen reader nothing at all). */
.plan-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.plan-card.selected .plan-card-name { color: var(--accent); }
.plan-card-head { display: flex; align-items: center; gap: 8px; }
.plan-card-radio {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--hairline); background: transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plan-card.selected .plan-card-radio {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--accent);
}
.plan-card-name { font-weight: 700; font-size: 16px; }
.plan-card-badge {
  margin-left: auto;
  background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 700;
  border-radius: 8px; padding: 2px 8px; text-transform: uppercase; letter-spacing: 0.03em;
}
.plan-card-price { margin-top: 4px; font-size: 15px; font-weight: 600; color: var(--text); }
/* Offer pricing: what it costs now, then the list price struck through beside
   it. The strike-through is decoration only — .plan-card-was also carries an
   aria-label saying "was <price>", since a line through a number is invisible
   to a screen reader. */
.plan-card-was {
  margin-left: 8px; font-weight: 500; font-size: 13px;
  color: var(--hint); text-decoration: line-through;
}
/* The countdown to the server's own expires_at (never a client-invented one). */
.plan-card-offer { margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--accent); }
.plan-card-sub { margin-top: 2px; font-size: 13px; color: var(--hint); }

/* ============================================================ SETTINGS */
.list { padding: 4px 0; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--hairline);
}
.list-row:last-child { border-bottom: none; }
.list-row > span:first-child { color: var(--text); font-size: 15px; }
.list-val { color: var(--hint); font-weight: 600; font-size: 15px; }
.list-btn { width: 100%; background: none; border: none; cursor: pointer; font: inherit; text-align: left; color: var(--text); }
.list-btn .chev { color: var(--hint); font-size: 18px; }
.list-btn.danger > span:first-child { color: var(--p); }

.lang-toggle { display: flex; gap: 6px; }
.lang-chip {
  border: 1px solid var(--hairline); background: none; color: var(--hint);
  border-radius: 9px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.lang-chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ============================================================ CHIPS + SELECT */
.chip-group { display: flex; gap: 8px; margin-bottom: 14px; }
.chip-group.vertical { flex-direction: column; }
.chip {
  flex: 1; border: 1.5px solid var(--hairline); background: var(--secondary-bg);
  color: var(--text); border-radius: 12px; padding: 13px 10px; font-size: 15px;
  font-weight: 600; cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.chip.selected { border-color: var(--accent); color: var(--accent); font-weight: 700; }

.field select {
  background: var(--secondary-bg); border: 1px solid transparent; color: var(--text);
  border-radius: 12px; padding: 13px 14px; font-size: 16px; outline: none;
  appearance: none; -webkit-appearance: none;
}
.field select:focus { border-color: var(--accent); }

/* ============================================================ BUTTONS (extra) */
.btn-danger { background: var(--p); color: #fff; }
.btn-ghost-full { background: var(--secondary-bg); color: var(--text); }
.btn-danger-ghost { background: none; color: var(--p); margin-top: 8px; }

/* ============================================================ CONFIRM MODAL */
.modal-body {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--bg); border-radius: 18px; padding: 24px;
  width: calc(100% - 48px); max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); animation: pop 0.2s ease;
}
@keyframes pop {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-body h3 { margin: 0 0 8px; font-size: 19px; }
.modal-body p { margin: 0 0 18px; color: var(--hint); line-height: 1.5; font-size: 14px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* Quick re-add's calorie readout: updates live as the weight is edited. */
.requick-cal { font-size: 28px; font-weight: 800; margin: 0 0 18px; }
#requick-kcal-unit { font-size: 14px; font-weight: 600; color: var(--hint); }

/* ============================================================ ONBOARDING */
.onboarding {
  min-height: 100vh; max-width: 520px; margin: 0 auto;
  padding: 0 20px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.onb-progress { height: 4px; background: var(--secondary-bg); border-radius: 2px; margin-top: 18px; overflow: hidden; }
.onb-progress-fill { height: 100%; background: var(--accent); width: 0; transition: width 0.3s ease; }
.onb-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.onb-step { display: flex; flex-direction: column; gap: 22px; }
.onb-step.center { align-items: center; }
.onb-q { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.25; }
.onb-choices { display: flex; gap: 10px; flex-wrap: wrap; }
.onb-choices.vertical { flex-direction: column; }
.onb-choice {
  flex: 1; min-width: 120px; border: 1.5px solid var(--hairline); background: var(--secondary-bg);
  color: var(--text); border-radius: 14px; padding: 18px; font-size: 17px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
}
.onb-choice.selected { border-color: var(--accent); color: var(--accent); }
.onb-choice-label { font-size: 17px; font-weight: 600; }
.onb-choice-desc { font-size: 13px; font-weight: 400; color: var(--hint); line-height: 1.3; }
.onb-choice.selected .onb-choice-desc { color: var(--accent); opacity: 0.75; }
.onb-input {
  background: var(--secondary-bg); border: 1.5px solid transparent; color: var(--text);
  border-radius: 14px; padding: 18px; font-size: 22px; font-weight: 700; outline: none; text-align: center;
}
.onb-input:focus { border-color: var(--accent); }
.onb-actions { display: flex; gap: 10px; margin-top: 6px; }
.onb-actions .btn { flex: 1; }

/* ============================================================ GOAL WIZARD */
.gw-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; min-height: 28px; }
.gw-link { background: none; border: none; color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.gw-counter { font-size: 14px; color: var(--hint); font-weight: 600; }
.gw-body { justify-content: flex-start; padding-top: 18px; }
.gw-body .onb-q { text-transform: uppercase; letter-spacing: 0.01em; }
.gw-error { color: var(--p); font-size: 14px; font-weight: 600; }
.gw-context {
  background: var(--secondary-bg); border-radius: 14px; padding: 14px 16px;
  font-size: 15px; color: var(--hint); font-weight: 600;
}
.gw-context b { color: var(--text); }

/* Pace step */
.pace-value { text-align: center; font-size: 38px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.pace-value small { font-size: 20px; font-weight: 700; }
.pace-cards { display: flex; gap: 10px; }
.pace-card {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 1.5px solid var(--hairline); background: var(--secondary-bg); color: var(--text);
  border-radius: 16px; padding: 18px 8px; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.pace-card .pace-emoji { font-size: 26px; line-height: 1; }
.pace-card.selected { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pace-info { display: flex; flex-direction: column; gap: 6px; }
.pace-info-main { font-size: 15px; font-weight: 700; }
.pace-info-hint { font-size: 14px; color: var(--hint); }
.pace-info-kcal { font-size: 15px; font-weight: 700; color: var(--f); }

/* Building step */
.build-pct { font-size: 56px; font-weight: 800; color: var(--accent); text-align: center; }
.build-label { text-align: center; color: var(--hint); font-size: 16px; font-weight: 600; }
.build-bar { width: 100%; height: 8px; background: var(--secondary-bg); border-radius: 4px; overflow: hidden; }
.build-bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 0.3s ease; }
.build-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.build-item { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; color: var(--hint); }
.build-item.done { color: var(--text); }
.build-check {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 14px; font-weight: 800;
  background: var(--secondary-bg); color: transparent; transition: background 0.2s, color 0.2s;
}
.build-item.done .build-check { background: var(--f); color: var(--bg); }

/* Plan-ready step */
.gw-done { gap: 16px; padding-bottom: 24px; }
.gw-check {
  width: 76px; height: 76px; border-radius: 50%; margin: 8px auto 0;
  background: var(--f); color: var(--bg); font-size: 38px; font-weight: 800;
  display: grid; place-items: center;
}
.gw-done .onb-q { text-align: center; font-size: 22px; }
.plan-chip {
  align-self: center; display: inline-block;
  background: rgba(48, 209, 136, 0.16); color: var(--f);
  border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 700;
  margin-bottom: 10px;
}
.gw-card-title { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.gw-card-sub { font-size: 13px; color: var(--hint); margin-bottom: 12px; }
.gw-consistent { text-align: center; font-size: 13px; color: var(--hint); margin-top: 10px; }
.plan-chart { width: 100%; height: 150px; display: block; margin-top: 8px; }
.plan-chart .pc-line { fill: none; stroke: var(--f); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.plan-chart .pc-area { fill: var(--f); opacity: 0.12; stroke: none; }
.plan-chart .pc-target { stroke: var(--hint); stroke-width: 1.2; stroke-dasharray: 5 5; opacity: 0.7; }
.plan-chart .pc-dot { fill: var(--bg); stroke: var(--f); stroke-width: 2.5; }
/* Adherence band between the actual and planned lines: green where ahead of
 * plan, red where behind. crispEdges hides hairline seams between the quads. */
.plan-chart .pc-fill-good { fill: var(--f); opacity: 0.30; stroke: none; shape-rendering: crispEdges; }
.plan-chart .pc-fill-bad { fill: var(--p); opacity: 0.30; stroke: none; shape-rendering: crispEdges; }
/* Actual progress so far (overlaid on the planned curve). */
.plan-chart .pc-actual { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.plan-chart .pc-here { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.plan-chart .pc-label { fill: var(--text); font-size: 12px; font-weight: 700; }
.plan-chart .pc-trophy { font-size: 16px; }
.plan-axis { display: flex; justify-content: space-between; padding: 4px 6px 0; font-size: 11px; color: var(--hint); font-weight: 600; }
/* Plan chart legend: which line/shade is which. */
.plan-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 8px; font-size: 11px; color: var(--hint); font-weight: 600; }
.plan-legend:empty { display: none; }
.pl-item { display: inline-flex; align-items: center; gap: 5px; }
.pl-swatch { width: 12px; height: 4px; border-radius: 2px; display: inline-block; }
.pl-swatch.pl-plan { background: var(--f); }
.pl-swatch.pl-you { background: var(--accent); }
.pl-swatch.pl-ahead { background: var(--f); height: 10px; opacity: 0.45; }
.pl-swatch.pl-behind { background: var(--p); height: 10px; opacity: 0.45; }

/* Daily recommendation rings */
.rec-rings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 10px; }
.rec-ring { display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
.rec-ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.rec-ring .rr-track { fill: none; stroke: var(--secondary-bg); stroke-width: 7; }
.rec-ring .rr-fill { fill: none; stroke-width: 7; stroke-linecap: round; }
.rec-ring .rr-val {
  position: absolute; top: 30px; left: 0; right: 0; text-align: center;
  font-size: 17px; font-weight: 800;
}
.rec-ring .rr-label { font-size: 13px; color: var(--hint); font-weight: 600; }
.rec-ring .rr-edit { background: none; border: none; color: var(--hint); font-size: 14px; cursor: pointer; padding: 2px 8px; }
.gw-tips { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.7; color: var(--text); }

.sheet-body .btn + .btn { margin-top: 10px; }

/* ---- Medical disclaimer + legal (Tasks 1 & 2) ---- */
/* Small muted footnote: "estimates, not medical advice". */
.disclaimer-note {
  font-size: 11.5px; line-height: 1.45; color: var(--hint);
  margin: 12px 0 0; padding: 0 2px; text-align: center;
}
/* Legal consent line on the welcome screen. */
.legal-note {
  font-size: 12px; line-height: 1.5; color: var(--hint);
  margin: 10px 0 0; max-width: 320px; text-align: center;
}
.legal-link { color: var(--link); cursor: pointer; white-space: nowrap; }
.legal-sep { color: var(--hint); margin: 0 2px; }
/* Settings "About" disclaimer sits left-aligned under the legal rows. */
#about-disclaimer { text-align: left; }

/* ---- Feedback threads (user thread list + admin inbox) ---- */
.feedback-threads { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.fb-thread {
  border: 1px solid var(--border, rgba(128,128,128,0.25)); border-radius: 12px;
  padding: 12px 14px; background: var(--card, rgba(128,128,128,0.06));
}
.fb-thread-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 6px;
}
.fb-thread-who { font-size: 13px; font-weight: 600; color: var(--text); }
.fb-thread-date { font-size: 11.5px; color: var(--hint); white-space: nowrap; }
.fb-status {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
}
.fb-status.open { background: rgba(255, 159, 10, 0.18); color: var(--mc, #e08600); }
.fb-status.answered { background: rgba(52, 199, 89, 0.16); color: var(--good, #2faa55); }
.fb-msg { font-size: 14px; line-height: 1.45; color: var(--text); white-space: pre-wrap; }
.fb-reply {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: rgba(52, 199, 89, 0.10); font-size: 13.5px; line-height: 1.45;
  white-space: pre-wrap; color: var(--text);
}
.fb-reply-label { font-size: 11px; font-weight: 600; color: var(--hint); display: block; margin-bottom: 3px; }
.fb-reply-box { margin-top: 10px; }
.fb-reply-box textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 56px;
  border-radius: 10px; padding: 8px 10px; font: inherit;
  border: 1px solid var(--border, rgba(128,128,128,0.3)); background: var(--bg, transparent);
  color: var(--text);
}
.fb-reply-box .btn { margin-top: 8px; }

/* ---- Admin payments list (refunds) ---- */
.charge-list { display: flex; flex-direction: column; gap: 10px; }
.charge-row {
  border: 1px solid var(--border, rgba(128,128,128,0.25)); border-radius: 12px;
  padding: 10px 12px; background: var(--card, rgba(128,128,128,0.06));
}
.charge-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 4px;
}
.charge-who { font-size: 13px; font-weight: 600; color: var(--text); }
.charge-amount { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.charge-meta { font-size: 11.5px; color: var(--hint); word-break: break-all; }
.charge-actions { margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.charge-refunded {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 159, 10, 0.18); color: var(--mc, #e08600);
}

/* Admin offer-mint form (support recovery). Three fields on one line so the
   whole gesture — who, what, how long — is visible without scrolling. */
.offer-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.offer-form-row { display: flex; gap: 8px; }
.offer-form-row > * { flex: 1; min-width: 0; }
.field-select, .offer-form-row input {
  border: 1px solid var(--border, rgba(128,128,128,0.25)); border-radius: 10px;
  padding: 8px 10px; font-size: 14px;
  background: var(--secondary-bg); color: var(--text);
}

/* Extreme-deficit safety warning banner (goal-wizard "plan ready"). */
.warn-banner {
  background: rgba(255, 159, 10, 0.14); border: 1px solid var(--mc);
  color: var(--text); border-radius: 12px;
  padding: 12px 14px; margin: 4px 0 0; font-size: 13px; line-height: 1.5;
}
.warn-banner::before { content: "⚠️ "; }

/* Trial disclosure banner: welcome screen (pre-onboarding) and the
   goal-wizard "plan ready" screen — proactive, not just the reactive
   paywall (Task 38). */
.trial-banner {
  background: rgba(78, 161, 255, 0.12); border: 1px solid rgba(78, 161, 255, 0.3);
  color: var(--text); border-radius: 12px; text-align: center;
  padding: 12px 14px; margin: 4px 0 0; font-size: 13px; line-height: 1.5;
}
.trial-banner strong { display: block; font-size: 14px; margin-bottom: 3px; }
.trial-banner p { margin: 0; color: var(--hint); }
/* Welcome screen centers its children narrower than the full app width. */
.welcome-trial { width: 100%; max-width: 320px; }
/* Monthly -> Annual upsell: the two actions sit side by side under the copy,
   with Dismiss visually quieter than the CTA but the same tap size. */
.upsell-actions { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.upsell-actions button { padding: 6px 12px; }
#upsell-dismiss { color: var(--hint); }

/* Admin banner. The body is a div (renderMarkdown emits block elements, which
   are invalid inside the <p> the upsell card uses), so the muted-body styling
   .trial-banner p gets has to be restated for the markdown children — and
   lists need their bullets back inside a text-align:center card. */
.banner-body { margin: 0; color: var(--hint); }
.banner-body .md-p { margin: 0 0 4px; }
.banner-body .md-p:last-child { margin-bottom: 0; }
.banner-body .md-list { margin: 4px 0; padding-left: 18px; text-align: left; }
#home-banner-dismiss { color: var(--hint); }
/* Admin banner composer: the two body fields are the only multi-line inputs
   in the dashboard. */
.banner-input {
  width: 100%; border: 0; background: transparent; color: var(--text);
  font: inherit; resize: vertical;
}

/* ---- Estimate-uncertainty badge on the AI result card (Task 10) ---- */
.estimate-badge {
  display: inline-block; margin-top: 8px;
  background: var(--secondary-bg); border: 1px solid var(--hairline);
  border-radius: 999px; padding: 3px 12px;
  font-size: 12px; font-weight: 700; color: var(--hint);
}

/* ---- Recent meals: one-tap re-add (Task 9) ---- */
.recent-meals { margin-top: 16px; }
.recent-meals-title { font-size: 13px; font-weight: 700; color: var(--hint); margin-bottom: 8px; }
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--secondary-bg); border: none; border-radius: 12px;
  padding: 12px 14px; cursor: pointer; color: var(--text); text-align: left;
  font: inherit; transition: transform 0.12s;
}
.recent-item:active { transform: scale(0.99); }
.recent-item:disabled { opacity: 0.5; }
.recent-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.recent-item-name {
  font-size: 15px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent-item-cal { font-size: 12px; color: var(--hint); }
.recent-item-add {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; font-weight: 600;
  background: var(--accent); color: var(--accent-text);
}

/* ---- Meal time / backfill (Task 12) ---- */
.when-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.when-label { font-size: 13px; color: var(--hint); font-weight: 600; }
.when-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.when-input {
  background: var(--secondary-bg); border: 1px solid transparent; color: var(--text);
  border-radius: 12px; padding: 10px 12px; font-size: 15px; outline: none;
  min-width: 0; transition: border-color 0.15s;
}
.when-input:focus { border-color: var(--accent); }
.when-now {
  flex-shrink: 0; background: none; border: none; color: var(--link);
  font-size: 14px; font-weight: 700; cursor: pointer; padding: 6px 4px;
}

/* ============================================================ DATE BAR + CALENDAR */
/* Home top date selector: ‹ [label] › on the left, streak + search on the
   right — a space-between row rather than the old full-width label, per the
   mockup's tight header. */
.day-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 2px 0 12px;
}
.day-bar-group { display: flex; align-items: center; gap: 2px; min-width: 0; }
.day-bar .date-arrow {
  width: 28px; height: 28px; font-size: 18px; flex-shrink: 0;
  background: none; color: var(--hint); border-radius: 8px;
}
.day-bar-date {
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  background: none; color: var(--text);
  border: none; border-radius: 8px; padding: 4px 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.day-bar-icon {
  width: 30px; height: 30px; flex-shrink: 0; line-height: 1;
  border: none; border-radius: 999px; background: var(--secondary-bg);
  color: var(--text); font-size: 14px; cursor: pointer;
}

/* Month calendar overlay. */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 12px; }
.cal-title { font-weight: 800; font-size: 17px; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays { margin-bottom: 6px; }
.cal-wd {
  text-align: center; font-size: 11px; font-weight: 700;
  color: var(--hint); text-transform: uppercase;
}
.cal-cell {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px; background: var(--secondary-bg);
  color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
}
.cal-cell.blank { background: transparent; cursor: default; }
.cal-cell.future { opacity: 0.3; cursor: default; }
.cal-cell.selected { background: var(--hairline); }
.cal-cell.today { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Tracked days colour their number by adherence (WHOOP-style). */
.cal-cell.tone-good { color: var(--f); font-weight: 800; }
.cal-cell.tone-warn { color: var(--mc); font-weight: 800; }
.cal-cell.tone-bad  { color: var(--p); font-weight: 800; }
/* T2 (P1): a tracked day beyond the free history window - number dimmed,
   small lock badge, tapping opens the paywall instead of navigating. */
.cal-cell.locked { position: relative; opacity: 0.4; filter: grayscale(1); }
.cal-cell.locked::after {
  content: "🔒"; position: absolute; top: 1px; right: 2px; font-size: 8px; line-height: 1;
}
.cal-legend { display: flex; justify-content: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; row-gap: 6px; }
.cal-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--hint); }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cal-dot.tone-good { background: var(--f); }
.cal-dot.tone-warn { background: var(--mc); }
.cal-dot.tone-bad  { background: var(--p); }
/* Phase 2: states the history lock instead of leaving it to be discovered by
   tapping a greyed-out day. Tapping it opens the same `history_lock` paywall. */
.cal-lock-banner {
  width: 100%; margin-top: 12px; padding: 10px 12px; text-align: left;
  background: var(--secondary-bg); border: none; border-radius: 12px;
  color: var(--hint); font-size: 12.5px; line-height: 1.4; cursor: pointer;
}
.cal-lock-banner::before { content: "🔒 "; }

@media (prefers-reduced-motion: reduce) {
  .spinner, .spinner-sm { animation-duration: 2.4s; }
  .arc-fill, .macro-fill, .water-fill { transition-duration: 0.01s; }
  .skel::after { animation-duration: 2.6s; }
  .btn-pulse { animation: none; }
  /* The recording dot still needs to read as "live", so it slows rather than
     stopping — the running timer beside it carries the same signal. */
  .voice-dot { animation-duration: 3s; }
}
