/* Илчлэг AI · premium pass. Tokens first, components below. Mobile first, desktop widens the landing only. */
:root {
  --bg: #F6F5F0; --surface: #FFFFFF; --surface-2: #EFEEE7; --surface-3: #E6E5DC; --text: #131A15; --muted: #59645C; --faint: #8A948C; --line: #E3E3DA;
  --brand: #10804A; --brand-2: #1E9A5C; --brand-ink: #0B6339; --brand-deep: #0A3F25; --brand-soft: #E2F2E8; --on-brand: #FFFFFF;
  --p: #E0613F; --f: #3D7BD4; --c: #E09A26; --p-ink: #B9452A; --f-ink: #2C63B3; --c-ink: #8E5A08;
  --water: #2B8BDB; --water-soft: #E3F0FB;
  --danger: #C23A3A; --warn-soft: #FFF3DC; --gold: #C9962E;
  --r-s: 12px; --r-m: 18px; --r-l: 24px; --r-xl: 30px;
  --sh-1: 0 1px 1px rgba(19, 26, 21, .04), 0 2px 6px rgba(19, 26, 21, .04), 0 10px 24px -12px rgba(19, 26, 21, .10);
  --sh-2: 0 2px 4px rgba(19, 26, 21, .06), 0 18px 40px -12px rgba(19, 26, 21, .24);
  --sh-brand: 0 10px 24px -8px rgba(16, 128, 74, .55);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --tabs-h: 66px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1411; --surface: #171D19; --surface-2: #1F2621; --surface-3: #283029; --text: #EDF2EE; --muted: #A3AEA6; --faint: #78837B; --line: #2A322C;
    --brand: #2DAE69; --brand-2: #3CC27A; --brand-ink: #7DD9A5; --brand-deep: #0A2A19; --brand-soft: #1A3125; --on-brand: #04140B;
    --p-ink: #F08A6C; --f-ink: #82AEF0; --c-ink: #F0BD62;
    --water-soft: #172A3A; --warn-soft: #3A2F17;
    --sh-1: 0 1px 2px rgba(0,0,0,.35), 0 10px 24px -12px rgba(0,0,0,.5); --sh-2: 0 18px 40px -12px rgba(0,0,0,.7); --sh-brand: 0 10px 24px -8px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1411; --surface: #171D19; --surface-2: #1F2621; --surface-3: #283029; --text: #EDF2EE; --muted: #A3AEA6; --faint: #78837B; --line: #2A322C;
  --brand: #2DAE69; --brand-2: #3CC27A; --brand-ink: #7DD9A5; --brand-deep: #0A2A19; --brand-soft: #1A3125; --on-brand: #04140B;
  --p-ink: #F08A6C; --f-ink: #82AEF0; --c-ink: #F0BD62; --water-soft: #172A3A; --warn-soft: #3A2F17; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); min-height: 100dvh; overflow-x: hidden; caret-color: var(--brand); -webkit-font-smoothing: antialiased; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--text); }
h1, h2, h3 { text-wrap: balance; margin: 0; letter-spacing: -0.02em; }
p { text-wrap: pretty; margin: 0; }
a { color: var(--brand-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, a, [role=button], label, summary { touch-action: manipulation; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--text); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 10px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 12px) 16px calc(var(--tabs-h) + env(safe-area-inset-bottom) + 32px); }
#app.bare { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
#app.wide { max-width: 1080px; }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 22px; border: 0; border-radius: 17px; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 16px; letter-spacing: -0.005em; cursor: pointer; text-decoration: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), var(--sh-brand); transition: transform 140ms var(--ease-out), opacity 140ms, box-shadow 200ms var(--ease-out); white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: .5; cursor: default; box-shadow: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.line { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn svg { width: 20px; height: 20px; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 10px; color: var(--brand-ink); font-weight: 600; cursor: pointer; text-decoration: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: transform 140ms var(--ease-out), background-color 160ms; flex: none; }
.icon-btn:active { transform: scale(0.92); }
.icon-btn[disabled] { opacity: .4; cursor: default; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- layout ---------- */
.card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); padding: 18px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 18px; min-height: 48px; }
.top h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.top .sub { color: var(--muted); font-size: 14px; margin-bottom: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border: 0; cursor: pointer; min-height: 40px; border-radius: 999px; background: var(--surface); box-shadow: var(--sh-1); font-size: 13px; font-weight: 650; white-space: nowrap; transition: transform 140ms var(--ease-out); }
.chip:active { transform: scale(0.96); }
.chip svg { width: 16px; height: 16px; }
.chip .dots { display: inline-flex; gap: 3px; }
.chip .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.chip .dots i.off { background: var(--surface-3); }
.chip.pro { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 2px 12px; }
.sec-h h2 { font-size: 20px; font-weight: 800; }
.sec-h .aside { color: var(--muted); font-size: 13px; }

/* ---------- welcome ---------- */
.hero { padding-top: 6px; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-row b { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand-row .link { margin-left: auto; padding: 10px 4px 10px 12px; font-size: 15px; }
.logo { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(160deg, var(--brand-2), var(--brand)); color: #fff; display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 10px -4px rgba(16,128,74,.6); flex: none; }
.logo svg { width: 20px; height: 20px; }
.hero h1 { font-size: clamp(36px, 10.4vw, 60px); line-height: 1.02; font-weight: 800; margin: 30px 0 14px; letter-spacing: -0.035em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { color: var(--muted); font-size: 17px; line-height: 1.5; max-width: 34ch; }
.hero-cta { display: none; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 16px; color: var(--muted); font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 16px; height: 16px; color: var(--brand); stroke-width: 2.4; }
.demo { margin: 28px 0 34px; position: relative; }
.plate { aspect-ratio: 4 / 3.3; border-radius: var(--r-xl); background: radial-gradient(circle at 46% 56%, #fff 0 33%, #ECE7DA 33.5% 41%, transparent 41.5%), radial-gradient(120% 90% at 30% 10%, #7A5438, #4A3020 70%); position: relative; overflow: hidden; box-shadow: var(--sh-2); }
.plate::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 60% at 70% 0%, rgba(255,255,255,.12), transparent 60%); pointer-events: none; }
.plate .bz { position: absolute; width: 17%; aspect-ratio: 1; border-radius: 50% 50% 46% 46%; background: radial-gradient(circle at 50% 30%, #fffdf6, #efe4cd 70%, #d9c8a6); box-shadow: 0 4px 8px rgba(0,0,0,.2), inset 0 -4px 6px rgba(160,130,90,.25); }
.plate .bz::after { content: ""; position: absolute; left: 38%; top: 14%; width: 24%; height: 24%; border-radius: 50%; background: radial-gradient(circle, #b98e5d, #8a6440); opacity: .8; }
.plate .cup { position: absolute; right: 7%; top: 9%; width: 22%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #e7d3b5 0 52%, #fff 53% 70%, #ddd 71%); box-shadow: 0 6px 14px rgba(0,0,0,.28); }
.scanline { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0, rgba(60,194,122,0) 42%, rgba(60,194,122,.38) 50%, transparent 51%); animation: scan 2.8s var(--ease-in-out) infinite; pointer-events: none; }
@keyframes scan { from { transform: translateY(-55%); } to { transform: translateY(55%); } }
.demo .result { position: absolute; left: 14px; right: 14px; bottom: -24px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: var(--r-m); box-shadow: var(--sh-2); padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.demo .result .k { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.demo .result .k small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.macro-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.macro-pills span { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.macro-pills .mp { color: var(--p-ink); } .macro-pills .mf { color: var(--f-ink); } .macro-pills .mc { color: var(--c-ink); }
.tag { position: absolute; background: rgba(255,255,255,.95); color: #131A15; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; box-shadow: 0 4px 12px rgba(0,0,0,.22); opacity: 0; transform: translateY(4px) scale(.96); animation: tagIn 420ms var(--ease-out) forwards; }
.tag:nth-of-type(2) { animation-delay: 160ms; }
@keyframes tagIn { to { opacity: 1; transform: none; } }
.how { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; counter-reset: how; }
.how li { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--r-m); padding: 14px; box-shadow: var(--sh-1); counter-increment: how; }
.how li::before { content: counter(how); width: 32px; height: 32px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; flex: none; font-variant-numeric: tabular-nums; }
.how b { display: block; }
.how span { color: var(--muted); font-size: 14px; }
.land-h { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; margin: 40px 0 14px; }
.benefits { list-style: none; padding: 0; margin: 0; }
.benefits li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; }
.benefits li + li { border-top: 1px solid var(--line); }
.benefits .ic { width: 42px; height: 42px; border-radius: 13px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; flex: none; }
.benefits b { display: block; font-size: 16px; }
.benefits span { color: var(--muted); font-size: 14px; }
.foods-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.foods-strip span { background: var(--surface); padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--sh-1); }
.price-peek { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-peek > div { background: var(--surface); border-radius: var(--r-l); padding: 16px; box-shadow: var(--sh-1); min-width: 0; }
.price-peek .pp-pro { background: linear-gradient(165deg, var(--brand-deep), #0E6A3D 70%, var(--brand)); color: #fff; }
.price-peek .pp-name { font-size: 14px; font-weight: 700; opacity: .8; }
.price-peek .pp-price { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 10px; line-height: 1.1; }
.price-peek .pp-price small { font-size: 13px; font-weight: 600; opacity: .75; margin-left: 2px; }
.price-peek ul { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.4; }
.price-peek li { display: flex; gap: 6px; align-items: flex-start; padding: 3px 0; }
.price-peek li svg { width: 15px; height: 15px; margin-top: 2px; stroke-width: 2.6; color: var(--brand); }
.price-peek .pp-pro li svg { color: #9BE6BC; }
.price-note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 12px; }
.faq details { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--sh-1); }
.faq details + details { margin-top: 10px; }
.faq summary { list-style: none; cursor: pointer; padding: 16px; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { margin-left: auto; width: 18px; height: 18px; color: var(--muted); transition: transform 200ms var(--ease-out); }
.faq details[open] summary svg { transform: rotate(90deg); }
.faq details p { padding: 0 16px 16px; color: var(--muted); font-size: 15px; }
.cta-wrap { position: sticky; bottom: 0; z-index: 5; padding: 22px 0 calc(env(safe-area-inset-bottom) + 8px); margin-top: 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 42%); }
.cta-wrap .sub-cta { text-align: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.foot { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; font-size: 13px; color: var(--muted); margin-top: 22px; padding-bottom: 8px; }
.foot a { color: var(--muted); padding: 6px 0; }

/* ---------- auth + setup ---------- */
.auth-h { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 8px 0 10px; }
.auth-p { color: var(--muted); margin-bottom: 24px; }
.field { display: block; min-width: 0; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field > span small { color: var(--muted); font-weight: 500; }
.input { width: 100%; min-height: 54px; padding: 0 16px; border-radius: 15px; border: 1.5px solid var(--line); background: var(--surface); outline: none; transition: border-color 160ms, box-shadow 160ms; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.input::placeholder { color: var(--faint); }
.input.code { text-align: center; letter-spacing: .5em; text-indent: .5em; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; min-height: 64px; }
.unit { position: relative; display: block; }
.unit .input { padding-right: 46px; }
.unit em { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 15px; pointer-events: none; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin-top: 8px; }
.err:empty { min-height: 0; margin: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button, .opt { min-height: 50px; border-radius: 15px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; padding: 8px 10px; transition: border-color 160ms, background-color 160ms, color 160ms, transform 140ms var(--ease-out); }
.seg button:active, .opt:active { transform: scale(0.97); }
.seg button[aria-pressed="true"], .opt[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.goal-seg button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 76px; font-size: 14px; }
.goal-seg svg { width: 22px; height: 22px; }
.opt { display: flex; width: 100%; text-align: left; align-items: center; gap: 12px; }
.opt small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.opt[disabled] { opacity: .45; cursor: default; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.more { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--sh-1); }
.more summary { list-style: none; cursor: pointer; padding: 15px 16px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.more summary::-webkit-details-marker { display: none; }
.more summary small { color: var(--muted); font-weight: 500; }
.more summary svg { margin-left: auto; width: 18px; height: 18px; color: var(--muted); transition: transform 200ms var(--ease-out); }
.more[open] summary svg { transform: rotate(90deg); }
.more .in { padding: 0 16px 16px; }
.plan-live { background: linear-gradient(165deg, var(--brand-deep), #0E6A3D 75%, var(--brand)); color: #fff; border-radius: var(--r-l); padding: 18px; box-shadow: var(--sh-2); }
.plan-live .l { font-size: 14px; opacity: .8; }
.plan-live .k { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin-top: 2px; }
.plan-live .k small { font-size: 16px; font-weight: 600; opacity: .8; margin-left: 4px; }
.plan-live .m { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.plan-live .m span { background: rgba(255,255,255,.12); border-radius: 999px; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.plan-live .why { font-size: 13px; opacity: .85; margin-top: 12px; }
.note { background: var(--brand-soft); color: var(--brand-ink); border-radius: 15px; padding: 12px 14px; font-size: 14px; }
.note.warn { background: var(--warn-soft); color: var(--text); }

/* ---------- today ---------- */
.ring-card { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 150px; height: 150px; flex: none; }
.ring svg { width: 150px; height: 150px; transform: rotate(-90deg); overflow: visible; }
.ring circle { stroke-width: 14; fill: none; }
.ring .trk { stroke: var(--surface-2); }
.ring .val { stroke: url(#ringGrad); transition: stroke-dashoffset 900ms var(--ease-out); }
.ring.over .val { stroke: var(--c); }
.ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .mid b { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.ring .mid span { font-size: 13px; color: var(--muted); margin-top: 5px; }
.macros { flex: 1; min-width: 0; display: grid; gap: 13px; }
.mac .lbl { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 6px; gap: 6px; }
.mac .lbl > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.mac .lbl > span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.mac .lbl b { font-weight: 750; }
.mac .lbl b span { font-weight: 500; }
.bar { height: 7px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 8px; transform-origin: left; transition: width 900ms var(--ease-out); }
.ring-foot { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.ring-foot b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.ring-foot span { font-size: 12px; color: var(--muted); }

.water { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 6px 12px; }
.water .head { min-width: 0; }
.water .head b { display: block; }
.water .head span { font-size: 14px; color: var(--muted); }
.water .glasses { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 8px; }
.water .glasses button { flex: 1; max-width: 34px; height: 26px; border: 0; padding: 0; border-radius: 4px 4px 8px 8px; background: var(--water-soft); cursor: pointer; position: relative; transition: background-color 220ms var(--ease-out), transform 140ms var(--ease-out); }
.water .glasses button::after { content: ""; position: absolute; inset: -9px -3px; }
.water .glasses button.on { background: var(--water); }
.water .glasses button:active { transform: scale(0.9); }
.water .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--water-soft); color: var(--water); display: grid; place-items: center; flex: none; }
.water .add { background: var(--water); color: #fff; box-shadow: 0 8px 18px -8px rgba(43,139,219,.7); }

.mgroup + .mgroup { margin-top: 18px; }
.mgroup-h { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 4px 8px; }
.meal { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; background: var(--surface); border-radius: var(--r-m); box-shadow: var(--sh-1); width: 100%; border: 0; text-align: left; cursor: pointer; transition: transform 140ms var(--ease-out), box-shadow 200ms var(--ease-out); }
.meal:active { transform: scale(0.985); }
.meal + .meal { margin-top: 8px; }
.meal.new { animation: popIn 420ms var(--ease-out) both; }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.thumb { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-2); object-fit: cover; flex: none; display: grid; place-items: center; color: var(--muted); }
.thumb svg { width: 22px; height: 22px; }
.meal .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal .s { font-size: 13px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal .k { text-align: right; font-weight: 800; font-size: 18px; white-space: nowrap; letter-spacing: -0.01em; }
.meal .k small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.empty { text-align: center; padding: 30px 20px 24px; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); }
.empty .art { width: 112px; height: 112px; margin: 0 auto 14px; position: relative; display: grid; place-items: center; }
.empty .art::before, .empty .art::after { content: ""; position: absolute; border-radius: 50%; }
.empty .art::before { inset: 0; background: var(--brand-soft); opacity: .55; }
.empty .art::after { inset: 16px; background: var(--brand-soft); }
.empty .art svg { position: relative; z-index: 1; width: 40px; height: 40px; color: var(--brand-ink); stroke-width: 1.7; }
.empty b { font-size: 18px; letter-spacing: -0.01em; }
.empty p { color: var(--muted); margin: 6px auto 18px; max-width: 30ch; }
.empty .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.empty .acts .btn { padding: 0 12px; }

/* ---------- tabs ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; max-width: 480px; margin: 0 auto; height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); box-shadow: 0 -1px 0 var(--line); }
.tabs a, .tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--faint); text-decoration: none; background: none; border: 0; padding: 8px 0; cursor: pointer; min-height: 54px; justify-content: center; transition: color 160ms; }
.tabs a svg, .tabs button svg { transition: transform 200ms var(--ease-out); }
.tabs [aria-current="page"] { color: var(--brand-ink); }
.tabs [aria-current="page"] svg { transform: translateY(-1px); stroke-width: 2.2; }
.tabs .tab-cam { width: 64px; height: 64px; border-radius: 22px; background: linear-gradient(160deg, var(--brand-2), var(--brand)); color: #fff; margin: -28px auto 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 12px 26px -8px rgba(16,128,74,.65); transition: transform 140ms var(--ease-out); }
.tabs .tab-cam:active { transform: scale(0.93); }
.tabs .tab-cam svg { width: 28px; height: 28px; }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(8, 12, 10, .5); opacity: 0; transition: opacity 260ms var(--ease-out); }
.scrim.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 480px; margin: 0 auto; max-height: 94dvh; display: flex; flex-direction: column; background: var(--bg); border-radius: 28px 28px 0 0; box-shadow: var(--sh-2); transform: translateY(100%); transition: transform 420ms var(--ease-drawer); outline: none; }
.sheet.on { transform: translateY(0); }
.sheet.full { height: 94dvh; }
.sheet .grab { width: 40px; height: 5px; border-radius: 5px; background: var(--surface-3); margin: 10px auto 2px; flex: none; }
.sheet .sh-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 16px 10px 20px; flex: none; }
.sheet .sh-top h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.sheet .sh-top .icon-btn { width: 38px; height: 38px; }
.sheet .sh-top .icon-btn svg { width: 18px; height: 18px; }
.sheet .sh-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 18px; flex: 1; }
.sheet .sh-foot { padding: 12px 16px calc(env(safe-area-inset-bottom) + 14px); flex: none; background: var(--bg); box-shadow: 0 -1px 0 var(--line); }

/* ---------- scan + editor ---------- */
.shot { position: relative; border-radius: var(--r-l); overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fadeIn 300ms var(--ease-out) both; }
.shot .scanline { animation-duration: 1.9s; }
.shot .lbl { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.shot .lbl .dot { width: 7px; height: 7px; border-radius: 50%; background: #3CC27A; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.shot .total { position: absolute; left: 12px; bottom: 12px; background: rgba(10,16,12,.66); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; padding: 8px 14px; border-radius: 16px; }
.shot .total b { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.shot .total small { font-size: 13px; opacity: .8; margin-left: 3px; }
.sk { background: linear-gradient(90deg, var(--surface-2) 0 40%, var(--surface) 50%, var(--surface-2) 60% 100%); background-size: 250% 100%; animation: shimmer 1.3s linear infinite; border-radius: 10px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.scan-steps { list-style: none; padding: 0; margin: 16px 2px 0; display: grid; gap: 10px; }
.scan-steps li { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 15px; transition: color 300ms; }
.scan-steps li i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface-3); flex: none; display: grid; place-items: center; transition: border-color 300ms, background-color 300ms; }
.scan-steps li.on { color: var(--text); }
.scan-steps li.on i { border-color: var(--brand); border-right-color: transparent; animation: spin .8s linear infinite; }
.scan-steps li.done { color: var(--text); }
.scan-steps li.done i { border-color: var(--brand); background: var(--brand); animation: none; }
.sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin-top: 12px; }
.sum div { background: var(--surface); border-radius: 15px; padding: 10px 4px; box-shadow: var(--sh-1); }
.sum b { display: block; font-size: 18px; font-weight: 800; }
.sum span { font-size: 12px; color: var(--muted); }
.sum .sp b { color: var(--p-ink); } .sum .sf b { color: var(--f-ink); } .sum .sc b { color: var(--c-ink); }
.item { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--sh-1); padding: 12px 12px 12px 14px; }
.item + .item { margin-top: 10px; }
.item .nm { font-weight: 700; font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.item .meta { font-size: 13px; color: var(--muted); margin-top: 1px; }
.stepper { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.stepper button { width: 46px; height: 42px; border-radius: 13px; border: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; transition: transform 120ms var(--ease-out); }
.stepper button:active { transform: scale(0.92); }
.stepper .q { flex: 1; text-align: center; min-height: 42px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; padding: 0 6px; width: 100%; outline: none; }
.stepper .q:focus { border-color: var(--brand); }
.stepper .u { color: var(--muted); font-size: 14px; }
.portions { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.portions button { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; }
.portions button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.conf { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.conf.mid { background: var(--surface-2); color: var(--muted); }
.conf.lo { background: var(--warn-soft); color: var(--text); }
.x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; position: relative; flex: none; }
.x::after { content: ""; position: absolute; inset: -4px; }
.x svg { width: 18px; height: 18px; }
.mt { display: flex; gap: 8px; overflow-x: auto; padding: 2px; margin: 16px -2px 12px; scrollbar-width: none; }
.mt button { flex: none; min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; transition: background-color 160ms, border-color 160ms; }
.mt button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.ai-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; margin-top: 14px; }
.ai-note svg { width: 16px; height: 16px; margin-top: 2px; }

/* ---------- food search ---------- */
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.search .input { padding-left: 44px; }
.fl { list-style: none; margin: 10px 0 0; padding: 0; }
.fl button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 6px; border: 0; background: none; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line); }
.fl button > svg { color: var(--brand-ink); }
.fl b { font-weight: 600; }
.fl small { color: var(--muted); display: block; }

/* ---------- history ---------- */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart svg * { stroke: none; }
.chart .bar-r { fill: color-mix(in srgb, var(--brand) 42%, var(--surface)); transform-box: fill-box; transform-origin: bottom; animation: grow 600ms var(--ease-out) both; }
.chart .bar-r.now { fill: var(--brand); }
.chart .bar-r.zero { fill: var(--surface-2); }
.chart .bar-r.hi { fill: color-mix(in srgb, var(--c) 70%, var(--surface)); }
@keyframes grow { from { transform: scaleY(0.05); } }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-weight: 500; }
.chart .vl { fill: var(--text); font-size: 9.5px; font-weight: 700; }
.chart .legend { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.chart .legend i { width: 18px; border-top: 2px dashed var(--muted); }
.chart svg .goal { stroke: var(--text); stroke-dasharray: 4 4; opacity: .45; stroke-width: 1.2; }
.chart .today-l { fill: var(--text); font-weight: 800; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stats3 div { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.stats3 b { display: block; font-size: 18px; font-weight: 800; }
.stats3 span { font-size: 12px; color: var(--muted); }
.day { width: 100%; border: 0; background: var(--surface); box-shadow: var(--sh-1); border-radius: var(--r-m); padding: 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; }
.day + .day, .day-x + .day { margin-top: 10px; }
.day .pct { width: 40px; height: 40px; flex: none; }
.day .pct svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.day .pct circle { fill: none; stroke-width: 5; }
.day .pct .t2 { stroke: var(--surface-2); }
.day .pct .v2 { stroke: var(--brand); stroke-linecap: round; }
.day-x { padding: 8px 2px 2px; }

/* ---------- me ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; }
.avatar { width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(160deg, var(--brand-2), var(--brand)); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 800; flex: none; }
.profile-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.profile-head .sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.list { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); overflow: hidden; }
.list > a, .list > button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 16px; border: 0; background: none; text-decoration: none; color: var(--text); cursor: pointer; text-align: left; font-size: 16px; transition: background-color 140ms; }
.list > a:active, .list > button:active { background: var(--surface-2); }
.list > * + * { box-shadow: inset 0 1px 0 var(--line); }
.list .v { margin-left: auto; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.list .v svg { width: 18px; height: 18px; }
.pro-card { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--brand-deep), #0E6A3D 65%, var(--brand)); color: #fff; border-radius: var(--r-l); padding: 20px; box-shadow: var(--sh-2); }
.pro-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%); pointer-events: none; }
.pro-card .row b { font-size: 19px; }
.pro-card p { opacity: .88; font-size: 14px; margin: 6px 0 16px; }
.pro-card .btn { background: #fff; color: #0B5E36; box-shadow: none; }
.pro-card .star { width: 34px; height: 34px; border-radius: 11px; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.pro-card .star svg { width: 18px; height: 18px; color: #F6D27A; }
.pro-on { display: flex; align-items: center; gap: 12px; }
.pro-on .star { width: 44px; height: 44px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; flex: none; }

/* ---------- premium sheet ---------- */
.pw-hero { text-align: center; padding: 4px 6px 18px; }
.pw-hero .badge { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 20px; background: linear-gradient(160deg, var(--brand-2), var(--brand-deep)); color: #F6D27A; display: grid; place-items: center; box-shadow: var(--sh-brand); }
.pw-hero .badge svg { width: 28px; height: 28px; fill: currentColor; stroke: none; }
.pw-hero h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.pw-hero p { color: var(--muted); font-size: 15px; margin-top: 6px; }
.cmp { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: var(--r-m); box-shadow: var(--sh-1); overflow: hidden; font-size: 14px; margin-bottom: 16px; }
.cmp th, .cmp td { padding: 11px 12px; text-align: center; }
.cmp th { font-size: 12px; color: var(--muted); font-weight: 650; }
.cmp th:first-child, .cmp td:first-child { text-align: left; }
.cmp td { border-top: 1px solid var(--line); font-weight: 600; }
.cmp td:last-child, .cmp th:last-child { background: color-mix(in srgb, var(--brand-soft) 70%, transparent); color: var(--brand-ink); }
.cmp td:first-child { font-weight: 500; color: var(--text); }
.plan { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border-radius: var(--r-m); border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; transition: border-color 160ms, background-color 160ms, transform 140ms var(--ease-out); }
.plan:active { transform: scale(0.985); }
.plan + .plan { margin-top: 10px; }
.plan[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.plan .rd { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface-3); flex: none; display: grid; place-items: center; transition: border-color 160ms; }
.plan[aria-pressed="true"] .rd { border-color: var(--brand); }
.plan[aria-pressed="true"] .rd::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--brand); }
.plan b { font-size: 17px; }
.plan .pr { margin-left: auto; text-align: right; font-weight: 800; font-size: 19px; white-space: nowrap; letter-spacing: -0.01em; }
.plan .pr small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.save { display: inline-block; font-size: 11px; font-weight: 750; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: #fff; margin-left: 6px; vertical-align: 2px; }
.perks { list-style: none; padding: 0; margin: 0 0 16px; }
.perks li { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.perks svg { color: var(--brand); width: 20px; height: 20px; }
.pay { display: grid; gap: 10px; }
.pay .btn { justify-content: space-between; box-shadow: none; }
.pay .btn .l { display: inline-flex; align-items: center; gap: 10px; }
.pay .soon { font-size: 12px; font-weight: 600; opacity: .75; }
.pay-qpay { background: var(--brand); }
.pay-qpay .qp { width: 26px; height: 26px; border-radius: 8px; background: #fff; color: var(--brand); display: grid; place-items: center; font-size: 11px; font-weight: 900; letter-spacing: -0.04em; }
.pay-card { background: var(--text); color: var(--bg); }
.pay-apple { background: #000; color: #fff; }
.pay-apple svg { fill: currentColor; stroke: none; width: 18px; height: 18px; }
.pay-or { text-align: center; color: var(--muted); font-size: 12px; margin: 2px 0 -2px; }
.pay-safe { display: flex; gap: 6px; justify-content: center; align-items: center; color: var(--muted); font-size: 12px; margin-top: 4px; }
.pay-safe svg { width: 14px; height: 14px; }

/* ---------- legal ---------- */
.legal h1 { font-size: 28px; margin: 8px 0 16px; letter-spacing: -0.03em; }
.legal h2 { font-size: 18px; margin: 24px 0 8px; }
.legal p, .legal li { color: var(--text); font-size: 15px; line-height: 1.65; max-width: 68ch; }
.legal p + p { margin-top: 10px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 20px); z-index: 80; transform: translate(-50%, 12px) scale(.98); opacity: 0; transition: opacity 200ms var(--ease-out), transform 240ms var(--ease-out); background: #141A16; color: #fff; padding: 12px 14px 12px 16px; border-radius: 16px; box-shadow: 0 16px 36px -10px rgba(0,0,0,.45); display: flex; gap: 14px; align-items: center; max-width: calc(100vw - 32px); width: max-content; font-size: 15px; font-weight: 500; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast .ok { width: 22px; height: 22px; border-radius: 50%; background: #2DAE69; display: grid; place-items: center; flex: none; }
.toast .ok svg { width: 14px; height: 14px; stroke-width: 3; color: #fff; }
.toast button { background: none; border: 0; color: #7DD9A5; font-weight: 700; cursor: pointer; padding: 6px; }
#app.bare ~ .toast { bottom: calc(env(safe-area-inset-bottom) + 24px); }
.has-sheet .toast { bottom: auto; top: calc(env(safe-area-inset-top) + 12px); transform: translate(-50%, -12px) scale(.98); }
.has-sheet .toast.on { transform: translate(-50%, 0); }

.fade-in { animation: fadeUp 280ms var(--ease-out) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
.stagger > * { animation: fadeUp 360ms var(--ease-out) both; }
.stagger > *:nth-child(2) { animation-delay: 40ms; } .stagger > *:nth-child(3) { animation-delay: 80ms; } .stagger > *:nth-child(4) { animation-delay: 120ms; } .stagger > *:nth-child(5) { animation-delay: 160ms; } .stagger > *:nth-child(n+6) { animation-delay: 200ms; }

@supports (corner-shape: squircle) {
  .card, .btn, .sheet, .meal, .item, .plan, .list, .empty, .logo, .tab-cam, .avatar { corner-shape: squircle; }
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(1.06); }
  .meal:hover, .day:hover { box-shadow: var(--sh-2); }
  .list > a:hover, .list > button:hover, .fl button:hover { background: var(--surface-2); }
  .icon-btn:hover { background: var(--surface-3); }
  .tabs a:hover, .tabs button:not(.tab-cam):hover { color: var(--text); }
  .plan:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
}
@media (min-width: 720px) {
  body { background: radial-gradient(60% 50% at 15% 0%, color-mix(in srgb, var(--brand-soft) 80%, transparent), transparent), var(--bg); }
  .sheet { bottom: 24px; border-radius: 28px; max-height: calc(100dvh - 48px); }
  .sheet.full { height: min(880px, calc(100dvh - 48px)); }
  .sheet:not(.on) { transform: translateY(calc(100% + 40px)); }
}
@media (min-width: 960px) {
  #app.wide { padding-left: 32px; padding-right: 32px; }
  .wide .hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; margin-top: 24px; }
  .wide .hero h1 { margin-top: 0; }
  .wide .hero-cta { display: flex; gap: 12px; align-items: center; margin-top: 28px; }
  .wide .hero-cta .btn { min-width: 220px; }
  .wide .demo { margin: 0 0 24px; }
  .wide .land-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
  .wide .cta-wrap { display: none; }
  .wide .how { grid-template-columns: repeat(3, 1fr); margin-top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .scanline { display: none; }
  .sheet { transition: opacity 200ms !important; }
}

/* iPhone app: App Store purchases only, no web payment UI */
.ios-app .webpay { display: none !important; }

/* ===== Coach chat ===== */
.coach-card { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 14px 16px; border: 0; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--sh-1); color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: transform 140ms var(--ease-out), box-shadow 200ms; }
.coach-card:active { transform: scale(0.98); }
.coach-card .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.coach-card .ic svg { width: 22px; height: 22px; }
.coach-card .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.coach-card .grow .muted { font-size: 13px; }
.coach-card > svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }
.bub { max-width: 88%; padding: 11px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; animation: bubIn 200ms var(--ease-out); }
.bub.ai { align-self: flex-start; background: var(--surface); box-shadow: var(--sh-1); border-bottom-left-radius: 6px; }
.bub.me { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 6px; }
.bub.err { background: var(--warn-soft); color: var(--text); }
.bub.typing { display: inline-flex; gap: 5px; padding: 15px 16px; }
.bub.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: tdot 1s ease-in-out infinite; }
.bub.typing i:nth-child(2) { animation-delay: .15s; } .bub.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tdot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes bubIn { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip-q { border: 0; cursor: pointer; padding: 10px 14px; min-height: 44px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-ink); font: 600 14px/1.25 var(--font); text-align: left; transition: transform 140ms var(--ease-out); }
.chip-q:active { transform: scale(0.97); }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-width: 0; resize: none; border: 0; border-radius: 18px; padding: 14px 16px; background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); font: 16px/1.35 var(--font); max-height: 120px; outline: none; }
.chat-form textarea:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
.chat-form .send { width: 52px; min-height: 52px; padding: 0; border-radius: 18px; flex: none; }
.chat-note { font-size: 12px; margin-top: 8px; }
kbd { font: 600 11px/1 var(--font); padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.tabs .tab-cam span { display: none; }
@media (hover: none) { kbd { display: none; } }

/* ===== Desktop (Windows Chrome/Edge, 1366x768 and up): side rail, two columns, mouse and keyboard ===== */
@media (min-width: 1024px) {
  html { scrollbar-gutter: stable; }
  .tabs { top: 0; right: auto; bottom: auto; width: 236px; height: 100dvh; max-width: none; margin: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; padding: 28px 14px; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
  .tabs[hidden] { display: none; }
  .tabs::before { content: "Илчлэг AI"; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; padding: 4px 14px 22px; color: var(--brand-ink); order: -2; }
  .tabs a, .tabs button { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; min-height: 46px; width: 100%; border-radius: 14px; font-size: 15px; }
  .tabs a svg, .tabs button svg { width: 22px; height: 22px; }
  .tabs [aria-current="page"] { background: var(--brand-soft); }
  .tabs [aria-current="page"] svg { transform: none; }
  .tabs .tab-cam { order: -1; width: 100%; height: 52px; margin: 0 0 14px; border-radius: 16px; flex-direction: row; justify-content: center; gap: 10px; color: #fff; font-size: 15px; font-weight: 700; }
  .tabs .tab-cam svg { width: 22px; height: 22px; }
  .tabs .tab-cam span { display: inline; }
  .tabs a:focus-visible, .tabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
  #app:not(.bare):not(.wide) { max-width: none; margin: 0 0 0 236px; padding: 36px clamp(32px, 4vw, 72px) 56px; }
  #app:not(.bare):not(.wide) > div { max-width: 1120px; margin: 0 auto; }
  .v-today .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .v-today .c2 .sec-h { margin-top: 0; }
  .top h1 { font-size: 36px; }
  .toast { left: calc(50% + 118px); }
  .sheet, .sheet.full { max-width: 640px; }
  .sheet.full { height: min(780px, calc(100dvh - 48px)); }
  .scrim { backdrop-filter: none; }
  #app:not(.bare):not(.wide) > .v-me, #app:not(.bare):not(.wide) > .v-hist { max-width: 820px; margin-left: 0; }
  .v-today .cols { margin-top: 14px; }
  .v-today .c1 .coach-card { margin-top: 0; }
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--faint) 55%, transparent); border-radius: 8px; border: 3px solid var(--bg); }
  ::-webkit-scrollbar-track { background: transparent; }
}
@media (min-width: 1024px) and (hover: hover) {
  .coach-card:hover, .meal:hover { box-shadow: var(--sh-2); }
  .chip-q:hover { filter: brightness(0.97); }
  .tabs a:hover:not([aria-current]), .tabs button:not(.tab-cam):hover { background: var(--surface-2); }
}
