:root {
  --radius: 22px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --flip: 1;
}
[dir="rtl"] { --flip: -1; }
/* Themes set colors only. They work on any element, so Settings can preview each one on its own tile. */
:root, [data-theme="midnight"], [data-theme="ocean"], [data-theme="grape"], [data-theme="sunset"] {
  --hair: rgba(255, 255, 255, 0.07);
  --on-accent-rgb: 6, 32, 20;
  --protein: #7db8ff;
  --carbs: #f5c46b;
  --fat: #f58ba6;
  --danger: #ff7a7a;
  --flame: #ff9f43;
  --statusbar: transparent;
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --card-tint: 17%; --card-tint-2: 29%;
}
:root, [data-theme="midnight"] {
  --bg: #09090b; --surface: #131316; --surface-2: #1c1c21; --surface-3: #26262c; --pill: #26262c; --dock: rgba(24, 24, 28, .78);
  --text: #f4f4f5; --muted: #9a9aa3; --faint: #5f5f68;
  --accent: #8ef0b0; --accent-2: #5fd4c8; --on-accent: #062014; --accent-rgb: 142, 240, 176; --accent-2-rgb: 95, 212, 200;
}
[data-theme="ocean"] {
  --bg: #06111f; --surface: #0d1b2d; --surface-2: #15263b; --surface-3: #1f344d; --pill: #1f344d; --dock: rgba(15, 31, 50, .8);
  --text: #eef6ff; --muted: #94aac2; --faint: #5b7088;
  --accent: #5cc8ff; --accent-2: #4f8dff; --on-accent: #04192b; --accent-rgb: 92, 200, 255; --accent-2-rgb: 79, 141, 255; --on-accent-rgb: 4, 25, 43;
  --protein: #a5c8ff;
}
[data-theme="grape"] {
  --bg: #0f0a1a; --surface: #1a1229; --surface-2: #241938; --surface-3: #30234a; --pill: #30234a; --dock: rgba(32, 22, 50, .8);
  --text: #f5f0ff; --muted: #aa9ec0; --faint: #6c5f85;
  --accent: #c49bff; --accent-2: #f08bd6; --on-accent: #1c0b33; --accent-rgb: 196, 155, 255; --accent-2-rgb: 240, 139, 214; --on-accent-rgb: 28, 11, 51;
}
[data-theme="sunset"] {
  --bg: #140a08; --surface: #211310; --surface-2: #2e1c17; --surface-3: #3d2720; --pill: #3d2720; --dock: rgba(44, 26, 21, .8);
  --text: #fff4ee; --muted: #c0a698; --faint: #806a5e;
  --accent: #ffa96b; --accent-2: #ff6f7d; --on-accent: #2b0e05; --accent-rgb: 255, 169, 107; --accent-2-rgb: 255, 111, 125; --on-accent-rgb: 43, 14, 5;
  --carbs: #ffd98a;
}
/* iPhone keeps the status bar text white in the installed app, so light themes put a dark strip behind it. */
[data-theme="white"], [data-theme="pink"] {
  --pill: #ffffff; --on-accent: #ffffff; --on-accent-rgb: 255, 255, 255;
  --danger: #d6303a; --flame: #ea7a12;
  --shadow-lg: 0 10px 34px rgba(50, 30, 50, .16);
  --shadow-sm: 0 1px 4px rgba(50, 30, 50, .16);
  --card-tint: 11%; --card-tint-2: 21%;
}
[data-theme="white"] {
  --bg: #f4f4f6; --surface: #ffffff; --surface-2: #ececf0; --surface-3: #dfdfe5; --dock: rgba(255, 255, 255, .86); --hair: rgba(0, 0, 0, .08);
  --text: #18181b; --muted: #65656f; --faint: #9c9ca6;
  --accent: #078a52; --accent-2: #0a9488; --accent-rgb: 7, 138, 82; --accent-2-rgb: 10, 148, 136;
  --protein: #2b74d9; --carbs: #a86c05; --fat: #d9426f;
  --statusbar: #18181b;
}
[data-theme="pink"] {
  --bg: #fff3f7; --surface: #ffffff; --surface-2: #fde7ef; --surface-3: #f8d3e1; --dock: rgba(255, 255, 255, .86); --hair: rgba(120, 20, 70, .1);
  --text: #3a1226; --muted: #875469; --faint: #bd93a7;
  --accent: #d92a73; --accent-2: #ee4190; --accent-rgb: 217, 42, 115; --accent-2-rgb: 238, 65, 144;
  --protein: #4a6fe3; --carbs: #a86c05; --fat: #a930c9;
  --statusbar: #c92067;
}
/* Status bar strip: content scrolled up must never show under the clock (Ron, Nov 19 2026).
   Themes with a coloured bar set --statusbar; the rest get a frosted strip in their own background. */
body::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: calc(var(--safe-t) + 10px); z-index: 16; pointer-events: none;
  background: var(--statusbar-fill, var(--statusbar));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(#000 calc(100% - 10px), transparent); mask-image: linear-gradient(#000 calc(100% - 10px), transparent); }
@supports (background: color-mix(in srgb, red, blue)) {
  :root, [data-theme] { --statusbar-fill: color-mix(in srgb, var(--bg) 92%, transparent); }
  [data-theme="white"], [data-theme="pink"] { --statusbar-fill: var(--statusbar); }
}
html.theming, html.theming * { transition: background-color .35s ease, color .35s ease, border-color .35s ease, stroke .35s ease, fill .35s ease, box-shadow .35s ease !important; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--text); }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
#app { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 6px) 16px calc(var(--safe-b) + 132px); }

/* ---- header ---- */
.top { display: flex; align-items: center; gap: 2px; padding: 4px 0 14px; }
.day { text-align: center; min-width: 96px; }
#dayLabel { font-weight: 650; font-size: 17px; letter-spacing: -0.01em; }
#dayDate { font-size: 12.5px; color: var(--muted); }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); transition: background .15s, transform .12s var(--ease-out), color .15s, opacity .2s; }
.icon-btn.gone { opacity: 0; pointer-events: none; }
.icon-btn:active { background: var(--surface-2); transform: scale(.94); color: var(--text); }
.top-right { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.streak { display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px 0 9px; border-radius: 99px; background: var(--surface); border: 1px solid var(--hair); font-size: 14.5px; transition: transform .12s var(--ease-out); }
.streak:active { transform: scale(.95); }
.streak .flame svg { width: 17px; height: 17px; stroke: var(--faint); }
.streak.on .flame svg { stroke: var(--flame); fill: rgba(255, 159, 67, .25); }
.streak b { font-variant-numeric: tabular-nums; font-weight: 650; }
.streak.pop { animation: pop .6s var(--ease-spring); }
@keyframes pop { 40% { transform: scale(1.25); } }

/* ---- hero ---- */
.hero {
  position: relative; display: flex; gap: 20px; align-items: center; padding: 18px;
  background: radial-gradient(120% 90% at 0% 0%, rgba(var(--accent-rgb), .07), transparent 60%), var(--surface);
  border: 1px solid var(--hair); border-radius: 26px;
}
.ring-wrap { position: relative; width: 132px; height: 132px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: url(#ringGrad); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .9s var(--ease-out); }
.ring-fg.over { stroke: var(--danger); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.big { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.05; }
.ring-label { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.hero-side { flex: 1; min-width: 0; }
.eaten { font-size: 13px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.eaten > span:first-child { font-weight: 650; font-size: 15px; }
.macros { display: grid; gap: 11px; }
.macro-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.macro-top .val { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .8s var(--ease-out); }
.macro[data-m=protein] i { background: var(--protein); }
.macro[data-m=carbs] i { background: var(--carbs); }
.macro[data-m=fat] i { background: var(--fat); }
.macro.done .macro-top span:first-child::after { content: " ✓"; color: var(--accent); }

/* ---- week strip ---- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 14px 0 6px; }
.wd { display: grid; justify-items: center; gap: 5px; padding: 7px 0 8px; border-radius: 14px; font-size: 11px; color: var(--muted); transition: background .28s var(--ease-out), color .28s var(--ease-out), transform .12s var(--ease-out); }
.wd:active { transform: scale(.94); }
.wd.sel { background: var(--surface); color: var(--text); }
.wd.future { opacity: .35; pointer-events: none; }
.wd svg { width: 26px; height: 26px; transform: rotate(-90deg); }
.wd circle { fill: none; stroke-width: 3; }
.wd .bg { stroke: var(--surface-3); }
.wd .fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 62.8; transition: stroke-dashoffset .7s var(--ease-out); }
.wd.over .fg { stroke: var(--danger); }
.wd .dot { position: relative; width: 26px; height: 26px; }
.wd.perfect .dot::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), .5); }

/* ---- meals ---- */
.meal { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); margin-top: 10px; overflow: hidden; animation: rise .4s var(--ease-out) both; }
.settled .meal { animation: none; }
.measuring * { animation: none !important; }
.meal-head { display: flex; align-items: center; gap: 10px; padding: 13px 8px 13px 14px; }
.meal-ico { width: 34px; height: 34px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.meal-ico svg { width: 18px; height: 18px; }
.meal-title { flex: 1; min-width: 0; }
.meal-name { font-weight: 620; font-size: 15.5px; letter-spacing: -0.01em; }
.meal-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meal-kcal { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 15px; margin-inline-end: 2px; }
.meal-kcal small { font-weight: 400; color: var(--muted); font-size: 11px; }
.meal-btn { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); transition: background .15s, transform .12s var(--ease-out); flex: none; }
.meal-btn:active { background: var(--surface-2); transform: scale(.92); }
.meal-btn.add { color: var(--accent); }
.items { list-style: none; margin: 0; padding: 0 0 6px; }
.items li { overflow: hidden; }
.items li.fresh { animation: grow .5s var(--ease-out) both; }
.items li.fresh .entry { animation: glow 1.4s ease-out; }
@keyframes grow { from { max-height: 0; opacity: 0; transform: translateY(-6px); } to { max-height: 90px; } }
@keyframes glow { 0%, 25% { background: rgba(var(--accent-rgb), .12); } }
.entry { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--hair); width: 100%; text-align: start; transition: background .15s; }
.entry:active { background: var(--surface-2); }
.entry .main { flex: 1; min-width: 0; }
.entry .name { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.entry .kcal { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); }
.suggest { display: flex; align-items: center; gap: 8px; margin: 0 14px 12px; padding: 9px 12px; border-radius: 12px; border: 1px dashed var(--surface-3); color: var(--muted); font-size: 13px; width: calc(100% - 28px); text-align: left; transition: border-color .15s, color .15s; }
.suggest:active { border-color: var(--accent); color: var(--text); }
.suggest svg { width: 16px; height: 16px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---- dock ---- */
.dock {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 10px); z-index: 5;
  max-width: 536px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr 1.1fr 1fr 1fr; align-items: center;
  padding: 8px; border-radius: 26px;
  background: color-mix(in srgb, var(--dock) 70%, transparent); border: 1px solid var(--hair);
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  box-shadow: var(--shadow-lg);
}
.dock button { display: grid; justify-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); padding: 6px 0; border-radius: 16px; transition: transform .12s var(--ease-out), color .15s; }
.dock button:active { transform: scale(.92); color: var(--text); }
.dock .primary { justify-self: center; width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 6px 22px rgba(var(--accent-2-rgb), .35); margin: -22px 0 0; }
.dock .primary svg { width: 26px; height: 26px; stroke-width: 2; }

/* ---- sheet ---- */
html.locked, html.locked body { overflow: hidden; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 10; opacity: 0; transition: opacity .36s ease; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: var(--kb, 0px); z-index: 11;
  max-width: 560px; margin: 0 auto;
  max-height: min(92dvh, calc(var(--vvh, 100dvh) - var(--safe-t) - 10px)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 28px 28px 0 0; border-top: 1px solid var(--hair);
  padding: 8px 18px calc(var(--safe-b) + 22px);
  transform: translateY(105%); transition: transform .38s cubic-bezier(.32, .72, 0, 1), bottom .25s var(--ease-out);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .25);
}
.sheet.show { transform: translateY(0); transition: transform .5s cubic-bezier(.16, 1, .3, 1), bottom .25s var(--ease-out); }
.sheet.tall { height: min(92dvh, calc(var(--vvh, 100dvh) - var(--safe-t) - 10px)); }
html.kb .sheet { padding-bottom: 14px; border-radius: 22px 22px 0 0; }
.grabber { width: 36px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.02em; }
.sheet .lede { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.sheet h3 { margin: 20px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
/* sheet content cascades in, top to bottom */
#sheetBody > * { animation: rise .38s var(--ease-out) both; }
#sheetBody > :nth-child(2) { animation-delay: 30ms; } #sheetBody > :nth-child(3) { animation-delay: 60ms; }
#sheetBody > :nth-child(4) { animation-delay: 90ms; } #sheetBody > :nth-child(5) { animation-delay: 115ms; }
#sheetBody > :nth-child(n+6) { animation-delay: 140ms; }
.menu button { animation: rise .4s var(--ease-out) both; }
.menu button:nth-child(2) { animation-delay: 40ms; } .menu button:nth-child(3) { animation-delay: 70ms; }
.menu button:nth-child(4) { animation-delay: 100ms; } .menu button:nth-child(5) { animation-delay: 125ms; } .menu button:nth-child(6) { animation-delay: 150ms; }

/* search: field stays pinned at the top while results scroll under it */
.search-head { position: sticky; top: -8px; z-index: 2; margin: -8px -18px 0; padding: 8px 18px 10px; background: var(--surface); }
.search-head h2 { margin-bottom: 10px; }
.search-box { position: relative; }
.search-box > svg { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--faint); pointer-events: none; }
.search-box .input { padding-inline-start: 40px; padding-inline-end: 42px; -webkit-appearance: none; appearance: none; }
.search-box .input::-webkit-search-cancel-button { display: none; }
.search-box .clear { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; color: var(--muted); font-size: 20px; line-height: 1; animation: pop-in .2s var(--ease-spring); }
.loading-bar { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px; overflow: hidden; opacity: 0; transition: opacity .2s; }
.loading-bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: slide 1s ease-in-out infinite; }
.busy .loading-bar { opacity: 1; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-50%) scale(.6); } }
.list-label { margin: 4px 2px 0; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; min-height: 1px; }
.list-label:empty { display: none; }
.results .empty { padding: 22px 0; }
.sheet.tall .results { padding-bottom: 20px; }

.field { display: grid; gap: 5px; margin-bottom: 10px; }
.field label { font-size: 12px; color: var(--muted); }
.input, textarea.input {
  width: 100%; background: var(--surface-2); border: 1px solid transparent; border-radius: 14px;
  padding: 12px 13px; outline: none; transition: border-color .15s;
}
.input:focus { border-color: rgba(var(--accent-rgb), .6); }
textarea.input { min-height: 96px; resize: vertical; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid4 .input { padding: 10px 6px; text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; min-width: 0; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border-radius: 16px; background: var(--surface-2); font-weight: 600; text-align: center; transition: transform .12s var(--ease-out), opacity .15s, background .15s, color .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); }
.btn.danger { background: none; color: var(--danger); }
.btn:disabled { opacity: .5; }
.btn.busy { opacity: .85; color: transparent; position: relative; }
.btn.busy::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(var(--on-accent-rgb), .25); border-top-color: var(--on-accent); animation: spin .7s linear infinite; }
.btn + .btn { margin-top: 8px; }
.row > .btn + .btn { margin-top: 0; }
.chips-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.btn svg { width: 18px; height: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chip { padding: 8px 13px; border-radius: 99px; background: var(--surface-2); font-size: 13.5px; border: 1px solid transparent; transition: border-color .2s, background .2s, color .2s, transform .12s var(--ease-out); color: var(--muted); }
.chip:active { transform: scale(.94); }
.chip.on { border-color: rgba(var(--accent-rgb), .55); background: rgba(var(--accent-rgb), .1); color: var(--text); }
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 13px; padding: 3px; margin-bottom: 12px; }
.seg::before { content: ""; position: absolute; top: 3px; bottom: 3px; inset-inline-start: 3px; width: calc((100% - 6px) / var(--n, 2)); border-radius: 10px; background: var(--pill);
  transform: translateX(calc(100% * var(--i, 0) * var(--flip))); transition: transform .38s var(--ease-spring); box-shadow: var(--shadow-sm); }
.seg button { position: relative; padding: 8px; border-radius: 10px; font-size: 13.5px; color: var(--muted); transition: color .25s; }
.seg button.on { color: var(--text); }

.menu { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-top: 6px; }
.menu button:last-child:nth-child(odd) { grid-column: 1 / -1; }
.meal-photos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 2px -2px 12px; padding: 0 2px; scrollbar-width: none; }
.meal-photos::-webkit-scrollbar { display: none; }
.meal-photos img { flex: 0 0 72%; height: 180px; object-fit: cover; border-radius: 18px; scroll-snap-align: start; background: var(--surface-2); }
.meal-photo { display: block; width: 100%; height: 180px; object-fit: cover; border-radius: 18px; margin: 2px 0 12px; background: var(--surface-2); }
.menu button { display: grid; gap: 8px; padding: 14px; border-radius: 18px; background: var(--surface-2); text-align: start; font-weight: 560; font-size: 14.5px; transition: transform .12s var(--ease-out), background .15s; }
.menu button:active { transform: scale(.97); background: var(--surface-3); }
.menu button small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: -4px; }
.menu svg { color: var(--accent); }

.results { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.results > li { min-width: 0; }
.result { width: 100%; min-width: 0; text-align: start; background: var(--surface-2); border-radius: 14px; padding: 11px 12px; display: flex; gap: 10px; align-items: center; transition: transform .12s var(--ease-out), background .15s; }
.result:active { transform: scale(.985); background: var(--surface-3); }
.results.anim .result { animation: rise .32s var(--ease-out) both; animation-delay: var(--d, 0ms); }
.result .main { flex: 1; min-width: 0; }
.result .name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result .k { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); text-align: end; white-space: nowrap; }
.result .edit { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); flex: none; }
.result .edit svg { width: 17px; height: 17px; }
.tag { font-size: 10.5px; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--muted); margin-inline-start: 5px; vertical-align: 1px; font-weight: 500; }

.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 16px; text-align: center; }
.totals div { background: var(--surface-2); border-radius: 14px; padding: 10px 4px; }
.totals b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.totals span { font-size: 11px; color: var(--muted); }
.totals .p b { color: var(--protein); } .totals .c b { color: var(--carbs); } .totals .f b { color: var(--fat); }

.ask { background: rgba(var(--accent-rgb), .08); border: 1px solid rgba(var(--accent-rgb), .25); border-radius: 16px; padding: 12px; margin: 8px 0 12px; }
.ask p { margin: 0 0 10px; font-weight: 560; }
.ask .btn + .btn { margin-top: 0; }
.note { font-size: 13px; color: var(--carbs); margin: 4px 0 10px; }

.voice-item { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.voice-item .row { gap: 10px; }
.voice-item .name { font-weight: 560; }
.voice-item .grams { width: 84px; flex: none; padding: 8px; text-align: center; background: var(--surface-3); }
.voice-item .x { flex: none; width: 30px; color: var(--muted); font-size: 18px; }

.mic { width: 88px; height: 88px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); display: grid; place-items: center; margin: 10px auto 12px; transition: transform .15s var(--ease-out); }
.mic svg { width: 34px; height: 34px; }
.mic.live { animation: pulse 1.3s ease-in-out infinite; background: var(--danger); color: white; }
@keyframes pulse { 50% { transform: scale(1.07); box-shadow: 0 0 0 14px rgba(255, 122, 122, .14); } }

.scanner { position: relative; border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin-bottom: 12px; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame { position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%; border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); border: 2px solid rgba(var(--accent-rgb), .9); }
.scanner .frame::after { content: ""; position: absolute; left: 6%; right: 6%; height: 2px; top: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: scan 1.6s ease-in-out infinite alternate; }
@keyframes scan { from { transform: translateY(-28px); } to { transform: translateY(28px); } }
.scanner .msg { position: absolute; inset: auto 0 10px; text-align: center; font-size: 13px; color: #fff; text-shadow: 0 1px 4px #000; }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 30px auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }

/* ---- progress ---- */
.streak-hero { text-align: center; padding: 8px 0 4px; }
.streak-hero .flame-big svg { width: 64px; height: 64px; margin: 0 auto; stroke: var(--flame); fill: rgba(255, 159, 67, .2); stroke-width: 1.4; animation: flicker 2.4s ease-in-out infinite; }
.streak-hero.cold .flame-big svg { stroke: var(--faint); fill: none; animation: none; }
@keyframes flicker { 50% { transform: scale(1.05) rotate(-2deg); } }
.streak-hero .n { font-size: 46px; font-weight: 750; letter-spacing: -0.04em; line-height: 1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 14px 0 4px; text-align: center; }
.stats div { background: var(--surface-2); border-radius: 14px; padding: 10px 4px; }
.stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11px; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { background: var(--surface-2); border-radius: 16px; padding: 12px 8px; text-align: center; }
.badge .e { font-size: 28px; line-height: 1.2; }
.badge b { display: block; font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.badge span { font-size: 11px; color: var(--muted); }
.badge.locked .e { filter: grayscale(1); opacity: .3; }
.badge.locked b { color: var(--muted); }
.card-row { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 16px; padding: 12px 14px; }
.card-row .grow { flex: 1; min-width: 0; }
.card-row b { font-weight: 600; font-size: 14.5px; display: block; }
.card-row span { font-size: 12.5px; color: var(--muted); }
.card-row .btn { width: auto; padding: 9px 14px; font-size: 13.5px; border-radius: 12px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 100px + var(--kb, 0px)); z-index: 20; transform: translate(-50%, 10px) scale(.96); opacity: 0;
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 99px; font-size: 14px; font-weight: 600; transition: opacity .2s, transform .35s var(--ease-spring); width: max-content; max-width: calc(100vw - 32px); text-align: center; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }

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

/* ---- siri steps, friends ---- */
a.btn { color: inherit; text-decoration: none; }
a.btn.primary { color: var(--on-accent); }
.steps { display: grid; gap: 10px; margin: 6px 0 14px; }
.steps > div { display: grid; grid-template-columns: 26px 1fr; gap: 4px 10px; align-items: center; background: var(--surface-2); border-radius: 16px; padding: 12px; }
.steps b { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 13px; }
.steps span { font-size: 14px; }
.steps .btn { grid-column: 2; margin-top: 6px; padding: 11px; }
.linkbox { background: var(--surface-2); border-radius: 14px; padding: 12px 13px; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); word-break: break-all; margin-bottom: 10px; -webkit-user-select: all; user-select: all; }
#flist .meal-ico { font-weight: 650; color: var(--accent); }

/* ---- units ---- */
.collapse { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .32s var(--ease-out), opacity .22s; }
.collapse.off { grid-template-rows: 0fr; opacity: 0; pointer-events: none; }
.collapse > div { min-height: 0; overflow: hidden; }
.amount-label { display: flex; justify-content: space-between; }
.stepper { display: grid; grid-template-columns: 50px 1fr 50px; gap: 6px; }
.stepper .input { text-align: center; font-size: 18px; font-weight: 600; }
.stepper button { border-radius: 14px; background: var(--surface-2); font-size: 22px; color: var(--text); transition: transform .12s var(--ease-out), background .15s; }
.stepper button:active { transform: scale(.94); background: var(--surface-3); }

/* ---- sign in ---- */
.login { position: fixed; inset: 0; z-index: 15; background: var(--bg); display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: calc(var(--safe-t, env(safe-area-inset-top)) + 24px) 24px calc(var(--safe-b) + 24px); text-align: center; animation: login-in .4s var(--ease-out); }
.login[hidden] { display: none; }
.login-icon { width: 76px; height: 76px; border-radius: 18px; margin: 0 auto 6px; }
.login h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.login p { margin: 0 0 14px; color: var(--muted); }
.login .input { text-align: center; }
.login-code { color: var(--muted); font-size: 13.5px; padding: 12px; }
@keyframes login-in { from { opacity: 0; transform: translateY(10px); } }
.login.leaving { opacity: 0; transition: opacity .26s ease; }

/* ---- theme picker ---- */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.theme-tile { background: var(--bg); color: var(--text); border: 2px solid var(--hair); border-radius: 18px; padding: 12px 8px 9px; display: grid; justify-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  transition: transform .14s var(--ease-out), border-color .2s; }
.theme-tile:active { transform: scale(.95); }
.theme-tile.on { border-color: var(--accent); }
.theme-tile i { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: block; box-shadow: 0 0 0 4px var(--surface-2); }

/* ---- stand-out cards (Settings switch) ---- */
:root[data-cards="bold"] { --card-bold: color-mix(in srgb, rgb(var(--accent-rgb)) var(--card-tint), var(--surface)); --card-line: rgba(var(--accent-rgb), .45); }
:root[data-cards="bold"] .hero, :root[data-cards="bold"] .meal, :root[data-cards="bold"] .league-card, :root[data-cards="bold"] .streak {
  background-color: var(--card-bold); border-color: var(--card-line); box-shadow: var(--shadow-sm);
}
:root[data-cards="bold"] .wd.sel { background: var(--card-bold); }
:root[data-cards="bold"] .meal-ico { background: rgba(var(--accent-rgb), .22); color: var(--accent); }
/* Sheets keep their plain background, so the cards inside them stand out from it. */
:root[data-cards="bold"] .sheet {
  --surface-2: color-mix(in srgb, rgb(var(--accent-rgb)) var(--card-tint), var(--surface));
  --surface-3: color-mix(in srgb, rgb(var(--accent-rgb)) var(--card-tint-2), var(--surface));
}
:root[data-cards="bold"] .sheet :is(.card-row, .btn:not(.primary, .danger, .google), .menu button, .result, .steps > div, .stats div, .totals div, .badge, .voice-item, .together, .request, .pick) {
  box-shadow: inset 0 0 0 1px var(--card-line);
}
.toggle-row { width: 100%; text-align: start; transition: transform .12s var(--ease-out); }
.toggle-row:active { transform: scale(.985); }
.switch { position: relative; width: 48px; height: 29px; border-radius: 99px; background: var(--surface-3); flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .24s var(--ease-out); }
[aria-checked="true"] .switch { background: var(--accent); }
[aria-checked="true"] .switch::after { transform: translateX(calc(19px * var(--flip))); }

/* ---- right-to-left ---- */
[dir="rtl"] #prevDay svg, [dir="rtl"] #nextDay svg { transform: scaleX(-1); }
[dir="rtl"] .name, [dir="rtl"] .sheet h2 { unicode-bidi: plaintext; text-align: right; } /* food names are often English */
[lang="ar"] * { letter-spacing: 0 !important; } /* spacing breaks joined Arabic letters */

/* Google's button stays white in every theme, per their branding rules. */
.btn.google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.g-logo { width: 19px; height: 19px; flex: none; }
.login-or { color: var(--muted); font-size: 13px; margin: 4px 0; }

/* ---- league, friends, profiles ---- */
.league-card { display: flex; align-items: center; gap: 12px; width: 100%; margin: 8px 0 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--hair); text-align: start; transition: transform .14s var(--ease-out); }
.league-card:active { transform: scale(.98); }
.league-card .grow, .request .grow, .profile-hero .grow { display: grid; gap: 1px; flex: 1; min-width: 0; }
.league-card b, .request b { font-weight: 620; font-size: 15px; }
.league-card .grow > span, .request .grow > span, .profile-hero .grow > span { color: var(--muted); font-size: 12.5px; }
.chev { color: var(--faint); }
.chev svg { width: 18px; height: 18px; }
[dir="rtl"] .chev svg { transform: scaleX(-1); }
.dot-new { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font: 700 12px/20px -apple-system, system-ui; text-align: center; }

.ava { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2); font-size: 23px; line-height: 1; flex: none; }
.ava.lg { width: 66px; height: 66px; font-size: 37px; }
.ava.xl { width: 92px; height: 92px; font-size: 52px; animation: pop-in .42s var(--ease-spring); }
@keyframes pop-in { from { transform: scale(.7); opacity: 0; } }
.ava:not(.f-none)::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; padding: 3px; background: var(--ring, transparent); pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.ava.lg::before, .ava.xl::before { inset: -4px; padding: 4px; }
.ava.f-none::before { display: none; }
.f-bronze { --ring: conic-gradient(#b0713a, #e9b98a, #8a5427, #b0713a); }
.f-silver { --ring: conic-gradient(#aeb4bd, #f2f4f7, #868c96, #aeb4bd); }
.f-gold { --ring: conic-gradient(#d9a319, #fff0a8, #b77f06, #d9a319); }
.f-diamond { --ring: conic-gradient(#5fd7ff, #f1fcff, #a78bfa, #5fd7ff); }
.f-legend { --ring: conic-gradient(#ff5da2, #ffd166, #5ee7a0, #5cc8ff, #b48cff, #ff5da2); }
.f-ember { --ring: conic-gradient(#ff7a18, #ffc371, #c22a00, #ff7a18); }
.f-flame { --ring: conic-gradient(#ff2d00, #ffb300, #ff5a00, #ffe066, #ff2d00); }
.f-buddy { --ring: conic-gradient(#ff5da2, #7db8ff, #ff5da2); }
.f-legend::before, .f-flame::before { animation: spin 3.2s linear infinite; }

.profile-hero { display: flex; align-items: center; gap: 14px; padding: 2px 0 6px; }
.profile-hero b { font-size: 19px; font-weight: 680; }
.level { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 12px; }
.profile-hero .bar { margin-top: 3px; }
.profile-hero .bar i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.request { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 14px; padding: 10px; margin-bottom: 6px; }
.request .btn { width: auto; padding: 9px 12px; font-size: 13.5px; flex: none; }
.league-head { display: flex; justify-content: space-between; align-items: baseline; }
.league-head span { color: var(--muted); font-size: 12.5px; }
.result.board { gap: 10px; }
.result.board.up { box-shadow: inset 3px 0 0 var(--accent); }
.result.board.down { box-shadow: inset 3px 0 0 var(--danger); }
[dir="rtl"] .result.board.up { box-shadow: inset -3px 0 0 var(--accent); }
[dir="rtl"] .result.board.down { box-shadow: inset -3px 0 0 var(--danger); }
.rank { width: 18px; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.friend-hero { display: grid; justify-items: center; gap: 2px; padding: 8px 0 12px; }
.friend-hero b { font-size: 21px; font-weight: 700; margin-top: 8px; }
.friend-hero > span:not(.ava):not(.recap-e) { color: var(--muted); font-size: 14px; }
.recap-e { font-size: 66px; line-height: 1.1; animation: pop-in .5s var(--ease-spring); }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.together { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 12px; background: var(--surface-2); border-radius: 18px; padding: 12px 14px; margin: 14px 0 10px; }
.together .flame-big { grid-row: span 2; color: var(--flame); }
.together .flame-big svg { width: 34px; height: 34px; fill: rgba(255, 159, 67, .25); }
.together b { font-size: 21px; margin-inline-end: 6px; }
.together span { color: var(--muted); font-size: 13.5px; }
.together small { color: var(--muted); font-size: 12px; }
.username-box .at { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.username-box .input { direction: ltr; padding-inline: 34px 13px; }
[dir="rtl"] .username-box .input { padding-inline: 13px 34px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 16px; background: var(--surface-2); border: 2px solid transparent; font-size: 13px; font-weight: 580; transition: transform .14s var(--ease-out), border-color .2s; }
.pick:active { transform: scale(.95); }
.pick.on { border-color: var(--accent); }
.pick.locked { opacity: .55; }
.pick-e { font-size: 30px; line-height: 1.1; }
.stats.two { grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }

/* ---- MacroSay Pro: upgrade screen, plan row, locks ---- */
.pro-hero { text-align: center; padding: 4px 4px 2px; }
.pro-hero h2 { font-size: 23px; text-wrap: balance; }
.pro-hero .lede { margin-bottom: 4px; }
.pro-badge { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; margin: 2px auto 10px; color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 30px rgba(var(--accent-rgb), .35); animation: pro-pop .55s var(--ease-spring) both; }
.pro-badge svg { width: 28px; height: 28px; }
.pro-badge.sm { width: 36px; height: 36px; border-radius: 12px; margin: 0; box-shadow: none; animation: none; flex: none; }
.pro-badge.sm svg { width: 19px; height: 19px; }
@keyframes pro-pop { from { transform: scale(.6) rotate(-12deg); opacity: 0; } }
.pro-kicker { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.pro-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.pro-list li { display: flex; gap: 12px; align-items: center; animation: rise .4s var(--ease-out) both; }
.pro-list li:nth-child(2) { animation-delay: 50ms; } .pro-list li:nth-child(3) { animation-delay: 100ms; } .pro-list li:nth-child(4) { animation-delay: 150ms; }
.pro-list svg { width: 22px; height: 22px; flex: none; color: var(--accent); padding: 7px; box-sizing: content-box; border-radius: 12px; background: rgba(var(--accent-rgb), .12); }
.pro-list span { font-size: 13px; color: var(--muted); line-height: 1.3; }
.pro-list b { display: block; color: var(--text); font-size: 14.5px; font-weight: 600; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.plan { position: relative; display: grid; gap: 2px; text-align: start; padding: 16px 13px 13px; border-radius: 18px; background: var(--surface-2);
  border: 2px solid transparent; transition: border-color .25s, background .25s, transform .12s var(--ease-out); }
.plan:active { transform: scale(.97); }
.plan.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.plan b { font-size: 15px; }
.plan span { font-size: 14px; font-weight: 600; }
.plan small { font-size: 12px; color: var(--muted); }
.plan em { position: absolute; top: -9px; inset-inline-end: 10px; font-style: normal; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); }
.pro-cta { font-size: 16px; padding: 16px; }
.fine { margin: 8px 4px 2px; font-size: 12px; line-height: 1.4; color: var(--muted); text-align: center; min-height: 2.8em; }
.btn.ghost { background: none; color: var(--muted); }
.btn.sm { width: auto; padding: 9px 14px; border-radius: 12px; font-size: 13.5px; flex: none; }
.plan-row + h3 { margin-top: 18px; }
/* coach plan (Settings › Coach): actions under the plan card, and the extra-seat stepper */
.coach-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 12px; }
.coach-actions .btn { padding: 11px 10px; font-size: 13.5px; }
.coach-actions .btn + .btn { margin-top: 0; }
.coach-actions .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.plan-row + .btn { margin-top: 10px; }
.seat-step { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 18px; padding: 12px 14px; margin: 4px 0 6px; }
.seat-step b { display: block; font-size: 30px; font-variant-numeric: tabular-nums; }
.seat-step span { font-size: 12.5px; color: var(--muted); }
.seat-step .icon-btn { font-size: 22px; font-weight: 600; }
.seat-step .icon-btn:disabled { opacity: .35; }
.menu button.locked { position: relative; }
.menu button.locked::after { content: ""; position: absolute; top: 12px; inset-inline-end: 12px; width: 15px; height: 15px; opacity: .8; background: var(--muted);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="10.5" width="14" height="10" rx="2.5"/><path d="M8 10.5V8a4 4 0 0 1 8 0v2.5"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="10.5" width="14" height="10" rx="2.5"/><path d="M8 10.5V8a4 4 0 0 1 8 0v2.5"/></svg>') center / contain no-repeat; }
.tag.pro { background: rgba(var(--accent-rgb), .15); color: var(--accent); }

/* ---- Siri link + Home Screen install guide ---- */
.link-btn { display: block; margin: -4px auto 6px; padding: 6px 10px; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.install { position: fixed; z-index: 16; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); padding: 16px 16px 14px; border-radius: 22px;
  background: var(--surface); border: 1px solid rgba(var(--accent-rgb), .35); box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  transform: translateY(24px); opacity: 0; transition: transform .45s var(--ease-spring), opacity .3s; }
.install.show { transform: none; opacity: 1; }
.install-x { position: absolute; top: 8px; inset-inline-end: 8px; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; color: var(--muted); }
.install-head { display: flex; gap: 12px; align-items: center; padding-inline-end: 28px; }
.install-head img { width: 46px; height: 46px; border-radius: 12px; flex: none; }
.install-head b { display: block; font-size: 15px; }
.install-head span { font-size: 13px; color: var(--muted); }
.install .btn { margin-top: 12px; }
.install-steps { margin: 12px 0 0; padding-inline-start: 22px; display: grid; gap: 7px; font-size: 14px; }
.install-steps svg { display: inline-block; width: 17px; height: 17px; vertical-align: -3px; margin: 0 2px; color: var(--accent); }
.install-arrow { display: grid; place-items: center; margin-top: 8px; color: var(--accent); animation: nudge-down 1.2s var(--ease-out) infinite; }
.install-arrow svg { width: 26px; height: 26px; }
@keyframes nudge-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .install-arrow { animation: none; } }

/* ---- body weight ---- */
.weight-card .ava { display: grid; place-items: center; color: var(--accent); }
.weight-card .spark { flex: none; overflow: visible; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.weigh { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; align-items: center; margin: 4px 0 10px; }
.weigh-step { height: 52px; border-radius: 16px; background: var(--surface-2); font-size: 24px; font-weight: 500; color: var(--text); transition: transform .12s var(--ease-out), background .15s; }
.weigh-step:active { transform: scale(.94); background: var(--surface-3); }
.weigh-input { height: 52px; text-align: center; font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.weigh-unit { width: 140px; margin: 0 auto 14px; }
.weigh-chart { display: block; width: 100%; height: auto; margin: 2px 0 4px; overflow: visible; }
.weigh-chart .dots circle { fill: var(--faint); }
.weigh-chart .trend { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.weigh-chart text { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.weigh-empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 13.5px; background: var(--surface-2); border-radius: 14px; margin-bottom: 12px; }
.weigh-stats { grid-template-columns: repeat(3, 1fr); }
.weigh-list .result b { font-variant-numeric: tabular-nums; }
.weigh-list .result .x { margin-inline-start: 4px; }
.sheet-up .install { opacity: 0; pointer-events: none; transform: translateY(12px); }
.weigh-range { margin-top: 18px; }

/* ---- Nov 15 2026: goals, suggestions, menu picks, recap card, duels, coach, Golden Era theme ---- */
[data-theme="iron"] {
  --bg: #0b0a08; --surface: #16140f; --surface-2: #211e16; --surface-3: #2e2a1e; --pill: #2e2a1e; --dock: rgba(28, 25, 18, .82);
  --text: #f7f1e3; --muted: #b3a88d; --faint: #73694f; --hair: rgba(255, 230, 170, .08);
  --accent: #e8b84a; --accent-2: #c7892e; --on-accent: #241904; --accent-rgb: 232, 184, 74; --accent-2-rgb: 199, 137, 46; --on-accent-rgb: 36, 25, 4;
  --protein: #f0d58c; --carbs: #9fc7ff; --fat: #f39a7f; --danger: #ff7a7a; --flame: #ff9f43;
  --statusbar: transparent; --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5); --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3); --card-tint: 17%; --card-tint-2: 29%;
}
.suggest-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 11px; border-radius: 99px; background: rgba(var(--accent-rgb), .1); color: var(--accent); font-size: 12.5px; font-weight: 600; transition: transform .12s var(--ease-out), background .15s; }
.suggest-chip:active { transform: scale(.95); background: rgba(var(--accent-rgb), .18); }
.suggest-chip svg { width: 14px; height: 14px; }
.suggest-chip[hidden] { display: none; }
.ring-wrap { cursor: pointer; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.grid3 .input { text-align: center; }
.pick-list { display: grid; gap: 6px; }
.pick-list .card-row { width: 100%; text-align: start; border: 1px solid transparent; transition: border-color .2s, background .2s, transform .12s var(--ease-out); }
.pick-list .card-row:active { transform: scale(.985); }
.pick-list .card-row.on { border-color: rgba(var(--accent-rgb), .55); background: rgba(var(--accent-rgb), .08); }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface-3); flex: none; transition: border-color .2s, box-shadow .2s; }
.card-row.on .radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface-2), inset 0 0 0 10px var(--accent); }
#gPace:empty { display: none; }
#gPace { margin-top: 8px; }
.adapt-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0 4px; }
.adapt-row > div { display: grid; text-align: center; }
.adapt-row span { font-size: 12px; color: var(--muted); }
.adapt-row b { font-size: 30px; font-variant-numeric: tabular-nums; }
.adapt-row .new b { color: var(--accent); }
.adapt-row .arrow { color: var(--faint); }
.options { display: grid; gap: 10px; margin: 10px 0 12px; }
.option { background: var(--surface-2); border-radius: 18px; padding: 14px; display: grid; gap: 4px; animation: rise .4s var(--ease-out) both; }
.option:nth-child(2) { animation-delay: 50ms; } .option:nth-child(3) { animation-delay: 100ms; }
.option .row { align-items: baseline; }
.option b { font-weight: 640; font-size: 15.5px; flex: 1; }
.option .k { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.option p { margin: 0; font-size: 13.5px; color: var(--muted); }
.option .tip { color: var(--carbs); }
.option .sub { font-size: 12.5px; color: var(--faint); }
.option .btn { justify-self: start; width: auto; margin-top: 6px; padding: 9px 14px; font-size: 13.5px; border-radius: 12px; }
.recap-img { display: block; width: min(62%, 260px); margin: 6px auto 14px; border-radius: 18px; box-shadow: var(--shadow-lg); aspect-ratio: 9 / 16; }
.duel { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 14px; padding: 11px 12px; margin-bottom: 6px; }
.duel .grow { display: grid; gap: 2px; flex: 1; min-width: 0; }
.duel .grow > b { font-size: 14.5px; font-weight: 600; }
.duel .grow > span { font-size: 12.5px; color: var(--muted); }
.duel .score b { color: var(--text); font-variant-numeric: tabular-nums; }
.duel .btn { width: auto; flex: none; padding: 8px 12px; font-size: 13px; border-radius: 12px; }
.coach-note { margin: 0 14px 12px; padding: 9px 12px; border-radius: 12px; background: rgba(var(--accent-rgb), .09); font-size: 13.5px; line-height: 1.4; }
.coach-note b { font-weight: 640; }
.day-note .coach-note { margin: 10px 0 0; }
.coach-note.mine { background: var(--surface-2); }
.client-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.client-head .grow { display: grid; flex: 1; }
.client-head .grow b { font-size: 18px; }
.client-head .grow span { font-size: 13px; color: var(--muted); }
#aiCost { margin: 0 0 8px; }

/* ---- offline line under the header (app.js showNet) ---- */
.net { width: fit-content; margin: -6px auto 12px; padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2, rgba(127,127,127,.14)); }
.net::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; margin-inline-end: 7px; vertical-align: 1px; }
.net.busy::before { background: var(--accent); animation: net-pulse 1s ease-in-out infinite alternate; }
@keyframes net-pulse { to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .net.busy::before { animation: none; } }
