/* ===== Токены ===== */
:root {
  --bg: #e9f0eb;
  --surface: #ffffff;
  --surface-2: #f1f6f3;
  --ink: #0f2a23;
  --muted: #5a6f68;
  --line: #d3dfd8;
  --accent: #0f6e52;
  --accent-2: #dcefe5;
  --accent-ink: #ffffff;
  --prot: #ef6257;
  --fat: #efad33;
  --carb: #4a8cf2;
  --water: #4fb3ef;
  --z-ok: #1f9e69;
  --z-warn: #dc9a2c;
  --z-bad: #e2703a;
  --z-danger: #d6434a;
  --shadow: 0 1px 2px rgb(15 42 35 / .05), 0 10px 30px -14px rgb(15 42 35 / .22);
  --shadow-lg: 0 2px 4px rgb(15 42 35 / .05), 0 30px 60px -24px rgb(15 42 35 / .35);
  --f-display: 'Unbounded', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --f-body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --spring: cubic-bezier(.32, 1.32, .5, 1);
  --ease: cubic-bezier(.2, .85, .25, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
  interpolate-size: allow-keywords;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #0b1714; --surface: #12211c; --surface-2: #1a2c26; --ink: #e6f0eb; --muted: #8ea59c; --line: #243a32;
    --accent: #41cf98; --accent-2: #173429; --accent-ink: #052219;
    --prot: #ff786c; --fat: #f5c04e; --carb: #6aa5ff; --water: #5cc0ff;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 30px -16px rgb(0 0 0 / .7);
    --shadow-lg: 0 30px 60px -24px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #0b1714; --surface: #12211c; --surface-2: #1a2c26; --ink: #e6f0eb; --muted: #8ea59c; --line: #243a32;
  --accent: #41cf98; --accent-2: #173429; --accent-ink: #052219;
  --prot: #ff786c; --fat: #f5c04e; --carb: #6aa5ff; --water: #5cc0ff;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 30px -16px rgb(0 0 0 / .7);
  --shadow-lg: 0 30px 60px -24px rgb(0 0 0 / .8);
  color-scheme: dark;
}

/* ===== База ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); overflow-x: clip; }
body { overflow-x: clip; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--f-body); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
  transition: background-color .3s;
}
body.locked { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
.ic { flex: none; display: block; }
.num { font-family: var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 10px; }
::selection { background: var(--accent-2); }

/* ===== Каркас ===== */
.app { min-height: 100dvh; }
.view { padding: 0 16px calc(110px + var(--safe-b)); max-width: 1120px; margin: 0 auto; outline: none; }
.rail { display: none; }

.appbar {
  position: sticky; top: 0; z-index: 20; margin: 0 -16px; padding: calc(var(--safe-t) + 8px) 12px 8px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 56px;
  transition: background-color .25s, box-shadow .25s, backdrop-filter .25s;
}
.appbar.scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 1px 0 var(--line);
}
.appbar-logo { display: grid; place-items: center; }
.appbar-title {
  text-align: center; font-weight: 600; font-size: 16px; opacity: 0; transform: translateY(6px);
  transition: opacity .2s, transform .25s var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar.scrolled .appbar-title { opacity: 1; transform: none; }
.appbar > :first-child { justify-self: start; }
.appbar-actions { display: flex; justify-content: flex-end; gap: 2px; }
.theme-btn .ic { animation: theme-spin .5s var(--spring); }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--ink);
  transition: background-color .2s, transform .15s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 12px; color: var(--muted); }

.big-title {
  font-family: var(--f-display); font-weight: 600; font-size: clamp(28px, 7.4vw, 44px);
  line-height: 1.08; letter-spacing: -.025em; text-wrap: balance;
}
.lead { color: var(--muted); font-size: 16.5px; margin-top: 12px; max-width: 56ch; text-wrap: pretty; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.block { margin-top: 36px; }
.block > h2 { margin-bottom: 14px; }

.card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); }
.card.pad, .pad { padding: 20px; }
.card + .card, .card + .note, .note + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.stack { display: grid; gap: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px;
  background: var(--accent-2); color: var(--accent); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.hint { color: var(--muted); font-size: 14px; margin: 16px 4px 0; max-width: 70ch; }
.hint a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px;
  border-radius: 16px; font-weight: 600; font-size: 16px; white-space: nowrap; user-select: none;
  transition: transform .15s var(--ease), background-color .2s, box-shadow .2s, filter .2s;
}
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.soft { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.soft:hover { background: var(--surface-2); }
.btn.danger { background: color-mix(in srgb, var(--z-danger) 12%, transparent); color: var(--z-danger); }
.btn.big { height: 58px; font-size: 17px; border-radius: 18px; padding: 0 26px; }
.btn.sm { height: 38px; padding: 0 14px; font-size: 14.5px; border-radius: 12px; }
.row-btns { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.row-btns .btn { flex: 1; }

/* ===== Главная ===== */
.hero { display: grid; gap: 20px; padding-top: 4px; }
.hello { color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero-cta .btn.big { width: 100%; }
.trust { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; color: var(--muted); font-size: 14.5px; }
.trust li { display: flex; align-items: center; gap: 8px; }
.trust .ic { color: var(--accent); }
.hero-plate { display: grid; place-items: center; padding: 18px 0 8px; }
.view[data-page=home] .hero-text > * { animation: rise .7s var(--ease) both; }
.view[data-page=home] .hero-text > :nth-child(2) { animation-delay: .06s; }
.view[data-page=home] .hero-text > :nth-child(3) { animation-delay: .12s; }
.view[data-page=home] .hero-text > :nth-child(4) { animation-delay: .18s; }
.view[data-page=home] .hero-text > :nth-child(5) { animation-delay: .24s; }

/* Тарелка: главный образ сайта */
.plate { position: relative; width: min(66vw, 280px); aspect-ratio: 1; }
.plate::before {
  content: ''; position: absolute; inset: -6%; border-radius: 50%; background: var(--surface);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
}
.plate-rim {
  position: absolute; inset: -12%; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--accent) 35%, var(--line));
  animation: spin 90s linear infinite;
}
.plate .donut { position: relative; width: 100%; height: 100%; animation: plate-in .9s var(--spring) both; }
.plate-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.plate-center b { font-size: clamp(34px, 10vw, 46px); font-weight: 600; line-height: 1; }
.plate-center span { color: var(--muted); font-size: 14px; margin-top: 6px; }
.chip-float {
  position: absolute; padding: 7px 12px; border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 6px; white-space: nowrap;
  animation: pop .6s var(--spring) both; animation-delay: var(--d);
}
.chip-float::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.chip-float.prot { color: var(--prot); top: 2%; left: -10%; }
.chip-float.fat { color: var(--fat); top: 44%; right: -16%; }
.chip-float.carb { color: var(--carb); bottom: 0; left: -2%; }
.chip-float { --t: var(--ink); }
.chip-float.prot, .chip-float.fat, .chip-float.carb { text-shadow: none; }
.plate.is-demo .plate-center b { color: var(--muted); }

.donut .track { fill: none; stroke: var(--surface-2); }
.donut .arc { fill: none; stroke-linecap: round; transition: stroke-dasharray 1.1s var(--ease); }

.today { display: flex; align-items: center; gap: 18px; padding: 18px; margin-top: 26px; }
.today-ring { position: relative; flex: none; width: 132px; }
.today-ring .donut { width: 100%; display: block; }
.today-ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.today-ring-c b { font-size: 24px; font-weight: 600; line-height: 1.1; }
.today-ring-c span { font-size: 12.5px; color: var(--muted); }
.today-macros { flex: 1; min-width: 0; }

.macros { display: grid; gap: 14px; }
.macro-top { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 7px; }
.macro-top b { margin-left: auto; font-weight: 600; }
.macro-top em { font-style: normal; color: var(--muted); font-size: 13px; width: 40px; text-align: right; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.prot { background: var(--prot); } .dot.fat { background: var(--fat); } .dot.carb { background: var(--carb); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 1s var(--ease) .2s; }
.ready .bar i { width: var(--w); }
.bar.prot i { background: var(--prot); } .bar.fat i { background: var(--fat); } .bar.carb i { background: var(--carb); }
.fiber { margin-top: 14px; color: var(--muted); font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; min-height: 142px; border-radius: 22px;
  background: var(--surface); box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile:active { transform: scale(.97); }
.tile-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-2); color: var(--accent); margin-bottom: auto; }
.tile-t { font-weight: 600; font-size: 16px; line-height: 1.25; margin-top: 14px; }
.tile-d { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.tile-go { position: absolute; top: 16px; right: 14px; color: var(--muted); opacity: .6; }
.tile-main { grid-column: span 2; background: var(--accent); color: var(--accent-ink); min-height: 150px; }
.tile-main .tile-ic { background: color-mix(in srgb, var(--accent-ink) 16%, transparent); color: var(--accent-ink); }
.tile-main .tile-d, .tile-main .tile-go { color: color-mix(in srgb, var(--accent-ink) 78%, transparent); opacity: 1; }
.tile-main .tile-t { font-family: var(--f-display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { counter-increment: s; background: var(--surface); border-radius: 22px; padding: 18px 18px 18px 66px; position: relative; box-shadow: var(--shadow); }
.steps li::before {
  content: counter(s); position: absolute; left: 18px; top: 18px; width: 34px; height: 34px; border-radius: 12px;
  display: grid; place-items: center; background: var(--ink); color: var(--bg); font-family: var(--f-display); font-size: 15px; font-weight: 600;
}
.steps b { font-size: 16.5px; }
.steps p { color: var(--muted); font-size: 14.5px; margin: 4px 0 10px; }
.steps code { display: inline-block; font-family: var(--f-display); font-size: 12.5px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink); letter-spacing: -.01em; }

.faq details { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); }
.faq details + details { margin-top: 10px; }
.faq summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 17px 18px; font-weight: 600; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq-x { margin-left: auto; width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); transition: transform .3s var(--spring); }
.faq details[open] .faq-x { transform: rotate(45deg); }
.faq details::details-content { block-size: 0; overflow: hidden; transition: block-size .35s var(--ease), content-visibility .35s allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
.faq-a p { padding: 0 18px 18px; color: var(--muted); font-size: 15px; }

.foot { margin-top: 36px; padding: 0 4px; color: var(--muted); font-size: 13px; max-width: 70ch; }

/* ===== Квиз ===== */
.quiz { max-width: 620px; margin: 0 auto; padding-bottom: 90px; }
.q-progress { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; margin-top: 6px; }
.q-progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .55s var(--ease); }
.q-count { color: var(--muted); font-size: 13.5px; margin: 10px 0 18px; }
.q-title { font-family: var(--f-display); font-weight: 600; font-size: clamp(24px, 6.4vw, 32px); letter-spacing: -.025em; line-height: 1.12; }
.q-sub { color: var(--muted); margin: 8px 0 22px; }
.q-step.from-right { animation: slide-r .45s var(--ease) both; }
.q-step.from-left { animation: slide-l .45s var(--ease) both; }
.q-step.from-fade { animation: rise .45s var(--ease) both; }
.q-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; gap: 10px; justify-content: space-between;
  padding: 16px 16px calc(14px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 70%, color-mix(in srgb, var(--bg) 0%, transparent));
}
.q-foot .btn.primary { flex: 1; max-width: 360px; margin-left: auto; height: 56px; border-radius: 18px; }
.live-bmi { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; color: var(--muted); text-align: center; }
.live-bmi b { color: var(--ink); }

.opts { display: grid; gap: 10px; }
.opts + .live-bmi, .card + .opts { margin-top: 14px; }
.opt {
  position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; text-align: left;
  padding: 16px 52px 16px 18px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 2px transparent;
  transition: box-shadow .2s, background-color .2s, transform .15s var(--ease);
}
.opt:active { transform: scale(.98); }
.opt.on { background: var(--accent-2); box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.opt-ic { grid-row: span 2; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.opt.on .opt-ic { background: var(--surface); }
.opt-t { font-weight: 600; font-size: 16.5px; grid-column: 2; }
.opt:not(:has(.opt-ic)) .opt-t, .opt:not(:has(.opt-ic)) .opt-d { grid-column: 1 / -1; }
.opt-d { color: var(--muted); font-size: 14px; grid-column: 2; }
.opt-check {
  position: absolute; right: 16px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); transform: scale(0); transition: transform .3s var(--spring);
}
.opt.on .opt-check { transform: scale(1); }
.opts.two { grid-template-columns: 1fr 1fr; }
.opts.two .opt { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 26px 12px 22px; row-gap: 12px; }
.opts.two .opt-ic { grid-row: auto; width: 72px; height: 72px; border-radius: 24px; }
.opts.two .opt-ic .ic { width: 36px; height: 36px; }
.opts.two .opt-t { grid-column: 1; }
.opts.two .opt-check { top: 14px; right: 14px; margin: 0; }

/* Слайдер */
.field-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.field-label { font-weight: 500; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 6px; }
.step-btn { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); transition: transform .12s, background-color .2s; }
.step-btn:active { transform: scale(.88); background: var(--accent-2); }
.field-val { min-width: 92px; text-align: center; }
.field-val b { font-family: var(--f-display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.field-val small { color: var(--muted); font-size: 14px; margin-left: 4px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; margin: 0; cursor: pointer; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track {
  height: 10px; border-radius: 99px;
  background: linear-gradient(to right, var(--accent) var(--pct), var(--surface-2) var(--pct));
}
input[type=range]::-moz-range-track { height: 10px; border-radius: 99px; background: var(--surface-2); }
input[type=range]::-moz-range-progress { height: 10px; border-radius: 99px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 50%; background: #fff;
  border: 3px solid var(--accent); box-shadow: 0 4px 12px -2px rgb(0 0 0 / .25); transition: transform .15s var(--ease);
}
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }

.seg {
  position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); padding: 4px; border-radius: 16px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
}
.seg-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n)); border-radius: 12px;
  background: var(--surface); box-shadow: 0 2px 8px -2px rgb(0 0 0 / .18); transform: translateX(calc(var(--i) * 100%));
  transition: transform .42s var(--spring);
}
.seg button { position: relative; height: 40px; border-radius: 12px; font-size: 14.5px; font-weight: 500; color: var(--muted); transition: color .2s; padding: 0 6px; }
.seg button[aria-selected=true] { color: var(--ink); font-weight: 600; }

.zone-pill {
  --zc: var(--z-ok); display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: color-mix(in srgb, var(--zc) 15%, transparent); color: color-mix(in srgb, var(--zc) 80%, var(--ink));
  transition: background-color .3s, color .3s;
}
.zone-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--zc); }

/* Экран подсчёта */
.calc-ov { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); animation: fade .25s both; transition: opacity .4s, transform .4s var(--ease); }
.calc-ov.out { opacity: 0; transform: scale(1.04); pointer-events: none; }
.calc-box { display: grid; justify-items: center; gap: 28px; padding: 24px; }
.calc-spin { animation: spin 1.6s var(--ease) infinite; }
.calc-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.calc-box li { display: flex; align-items: center; gap: 10px; font-weight: 500; opacity: 0; animation: rise .5s var(--ease) both; animation-delay: var(--d); }
.calc-box li .ic { color: var(--accent-ink); background: var(--accent); border-radius: 50%; padding: 3px; width: 24px; height: 24px; }

/* ===== Результат ===== */
.result-head { margin-bottom: 18px; }
.result-grid { display: grid; gap: 14px; }
.result-grid .col { display: grid; gap: 14px; align-content: start; }
.result-plate { display: grid; justify-items: center; gap: 18px; padding: 44px 18px 20px; }
.result-plate .plate { width: min(66vw, 270px); margin-bottom: 18px; }
.result-plate .seg { width: 100%; max-width: 380px; }
.formula-note { color: var(--muted); font-size: 13.5px; margin-top: -8px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--surface); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.stat span { color: var(--muted); font-size: 13.5px; }
.stat b { font-size: 25px; font-weight: 600; line-height: 1.2; }
.stat small { color: var(--muted); font-size: 13px; }
.stat.link { transition: transform .2s var(--ease); }
.stat.link:active { transform: scale(.97); }
.result > .card, .result > .note, .result > .cta-card { margin-top: 14px; }

.note {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px;
  background: var(--accent-2); color: var(--ink); font-size: 14.5px; margin-top: 14px;
}
.note .ic { color: var(--accent); }
.note p { flex: 1; }
.note.warn { background: color-mix(in srgb, var(--z-warn) 16%, var(--surface)); }
.note.warn .ic { color: var(--z-warn); }

.chart { display: block; width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 5; }
.chart .ylab, .chart .xlab { fill: var(--muted); font: 500 11.5px var(--f-body); }
@media (min-width: 900px) { .chart .ylab, .chart .xlab { font-size: 12.5px; } }
.chart .ylab { text-anchor: end; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.ready .chart-line { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease) .25s; }
.chart-area { opacity: 0; transition: opacity 1s ease .9s; }
.ready .chart-area { opacity: 1; }
.chart-dot.start { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.chart-dot.end { fill: var(--accent); stroke: var(--surface); stroke-width: 3; transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .5s var(--spring) 1.6s; }
.ready .chart-dot.end { transform: scale(1); }
.forecast .muted b { color: var(--ink); }

.meals-split { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.meals-split li { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 12px; font-size: 15px; }
.meals-split i { height: 10px; border-radius: 99px; background: var(--accent); width: 0; transition: width 1s var(--ease) .3s; }
.ready .meals-split i { width: var(--w); }
.meals-split b { font-weight: 600; min-width: 84px; text-align: right; }

.cta-card {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 24px; background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow-lg); transition: transform .2s var(--ease);
}
.cta-card:active { transform: scale(.98); }
.cta-card > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.cta-card small { opacity: .72; font-size: 14px; }
.cta-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }

/* ===== Меню ===== */
.menu-tot { display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 8px; margin-top: 20px; text-align: center; }
.menu-tot div { display: grid; gap: 2px; }
.menu-tot div + div { border-left: 1px solid var(--line); }
.menu-tot span { color: var(--muted); font-size: 12.5px; }
.menu-tot b { font-size: 17px; font-weight: 600; }
.menu { display: grid; gap: 12px; margin-top: 14px; }
.meal-card { padding: 18px; animation: rise .55s var(--ease) both; animation-delay: calc(var(--i) * 70ms + .1s); }
.meal-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.meal-card ul { list-style: none; margin: 0; padding: 0; }
.meal-card li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.meal-card li span { flex: 1; }
.meal-card footer { color: var(--muted); font-size: 13.5px; margin-top: 10px; }
.dish { font-weight: 600; font-size: 15.5px; margin: -4px 0 6px; color: var(--accent); }

.week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 20px; }
.wd {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 0; height: 66px; padding: 0 0 4px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow); transition: background-color .2s, color .2s, transform .15s var(--ease);
}
.wd:active { transform: scale(.94); }
.wd span { font-size: 12.5px; line-height: 1.3; color: var(--muted); }
.wd b { font-family: var(--f-display); font-size: 18px; line-height: 1.3; font-weight: 600; }
.wd.is-today::after { content: ''; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.wd.on { background: var(--accent); color: var(--accent-ink); }
.wd.on span { color: color-mix(in srgb, var(--accent-ink) 75%, transparent); }
.wd.on.is-today::after { background: var(--accent-ink); }

.shop { margin-top: 22px; }
.shop-note { font-size: 14px; margin-top: -4px; }
.shop-group h3 { font-size: 14px; font-weight: 600; color: var(--muted); margin: 18px 0 2px; }
.shop-group ul { list-style: none; margin: 0; padding: 0; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); cursor: pointer; font-size: 15px; }
.shop-item input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; flex: none; }
.shop-item span { flex: 1; transition: color .2s; }
.shop-item b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shop-item:has(input:checked) span, .shop-item:has(input:checked) b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.shop-group.prep .shop-item b { color: var(--accent); }
.shop-group { break-inside: avoid; }
@media (min-width: 900px) { .shop-cols { columns: 2; column-gap: 40px; } .shop-group h3 { margin-top: 0; padding-top: 18px; } }

.lead-form { margin-top: 22px; padding: 22px; display: grid; gap: 14px; background: var(--surface); box-shadow: var(--shadow-lg), inset 0 0 0 2px var(--accent-2); }
.lead-top h2 { font-family: var(--f-display); font-size: 21px; letter-spacing: -.02em; line-height: 1.2; }
.lead-top p { color: var(--muted); margin-top: 6px; font-size: 15px; }
.inp { display: grid; gap: 6px; }
.inp span { font-size: 14px; color: var(--muted); font-weight: 500; }
.inp input, .weigh input {
  height: 52px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2);
  font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s; width: 100%;
}
.inp input:focus, .weigh input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 1px 0 0; flex: none; }
.form-err { color: var(--z-danger); font-size: 14px; min-height: 0; }
.form-err:empty { display: none; }
.lead-done { display: flex; gap: 14px; align-items: center; animation: pop .5s var(--spring) both; }
.lead-done > .ic { width: 52px; height: 52px; padding: 12px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.lead-done p { color: var(--muted); }

.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 40px 0; }
.empty > .ic { width: 64px; height: 64px; padding: 14px; border-radius: 22px; background: var(--accent-2); color: var(--accent); }
.empty .btn { margin-top: 12px; }

/* ===== Дневник ===== */
.day-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 16px; }
.day-title { text-align: center; font-size: clamp(24px, 6.4vw, 34px); text-transform: none; }
.diary-sum { display: flex; align-items: center; gap: 18px; padding: 18px; }
.diary-sum .today-ring { width: 150px; }
.water .card-head h2 .ic { color: var(--water); }
.glasses { display: flex; flex-wrap: wrap; gap: 8px; }
.glass {
  position: relative; width: 34px; height: 44px; border-radius: 6px 6px 12px 12px; box-shadow: inset 0 0 0 2px var(--line);
  overflow: hidden; transition: transform .15s var(--spring);
}
.glass:active { transform: scale(.88); }
.glass i { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 0; border-radius: 3px 3px 9px 9px; background: var(--water); transition: height .45s var(--spring); }
.glass.full i { height: calc(100% - 9px); }
.meal-log { padding: 6px 18px; }
.meal-log header { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.meal-log header .muted { margin-left: auto; font-size: 14px; }
.add-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-2); color: var(--accent); transition: transform .15s var(--spring); }
.add-btn:active { transform: scale(.86) rotate(90deg); }
.meal-log ul { list-style: none; margin: 0; padding: 0 0 8px; }
.log-item { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); animation: rise .4s var(--ease) both; transition: opacity .25s, transform .25s; }
.log-item.gone { opacity: 0; transform: translateX(40px); }
.log-item div { display: grid; min-width: 0; }
.log-item b { font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-item small { color: var(--muted); font-size: 12.5px; }
.log-item > span { font-weight: 600; font-variant-numeric: tabular-nums; }
.meal-empty { width: 100%; padding: 14px; margin-bottom: 14px; border-radius: 16px; border: 1.5px dashed var(--line); color: var(--muted); font-size: 14.5px; transition: border-color .2s, color .2s; }
.meal-empty:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Шторка ===== */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(5 15 12 / .42); opacity: 0; transition: opacity .3s; }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 90dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(105%); transition: transform .42s var(--ease); padding-bottom: var(--safe-b); min-height: 62dvh;
}
.sheet.open .sheet-panel { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 10px auto 0; flex: none; }
.sheet-close { position: absolute; top: 10px; right: 10px; }
.sheet-body { padding: 10px 18px 22px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 14px; align-content: start; }
.sheet-title { font-family: var(--f-display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; padding-right: 44px; }
.search { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-radius: 14px; background: var(--surface-2); color: var(--muted); }
.search input { flex: 1; border: 0; background: none; outline: none; height: 100%; font-size: 16px; color: var(--ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 500; transition: background-color .2s, color .2s, transform .12s; }
.chip:active { transform: scale(.94); }
.chip.on { background: var(--ink); color: var(--bg); }
.food-list { list-style: none; margin: 0; padding: 0; }
.food-list button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.food-list button:active { background: var(--surface-2); }
.food-list span { flex: 1; display: grid; }
.food-list small { color: var(--muted); font-size: 12.5px; }
.food-list em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.food-list em::after { content: ' ккал'; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.food-none { color: var(--muted); padding: 20px 4px; }
.link-back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; justify-self: start; }
.grams { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.grams input {
  width: 160px; text-align: center; font-family: var(--f-display); font-size: 48px; font-weight: 600; border: 0; outline: none;
  background: none; border-bottom: 2px solid var(--line); letter-spacing: -.02em; -moz-appearance: textfield;
}
.grams input:focus { border-color: var(--accent); }
.grams input::-webkit-inner-spin-button { display: none; }
.grams span { font-size: 20px; color: var(--muted); }
.grams + .chips { justify-content: center; flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.grams-n { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; background: var(--surface-2); border-radius: 16px; padding: 12px 4px; }
.grams-n div { display: grid; }
.grams-n b { font-size: 18px; }
.grams-n span { font-size: 12px; color: var(--muted); }

/* ===== Тело ===== */
.body > .seg { margin: 18px 0 16px; }
.body-pane.swap { animation: rise .4s var(--ease) both; }
.body-grid { display: grid; gap: 14px; }
.big-res { display: grid; gap: 16px; align-content: start; }
.big-res-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.num.xl, .xl { font-family: var(--f-display); font-size: clamp(44px, 13vw, 60px); font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.xl-unit { color: var(--muted); font-size: 17px; margin-right: auto; }
.big-res-top .zone-pill { align-self: center; }
.gauge { position: relative; padding: 14px 0 26px; }
.gauge-track { display: flex; gap: 3px; height: 12px; }
.gauge-track i { border-radius: 6px; }
.gauge-mark {
  position: absolute; top: 6px; width: 6px; height: 28px; margin-left: -3px; border-radius: 6px; background: var(--ink);
  box-shadow: 0 0 0 3px var(--surface); transition: left .7s var(--spring); left: 0;
}
.gauge-scale span { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 12px; color: var(--muted); }
.split-bar { height: 14px; border-radius: 99px; background: var(--carb); overflow: hidden; }
.split-bar i { display: block; height: 100%; background: var(--fat); border-radius: inherit; transition: width .6s var(--ease); }
.split-leg { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 14px; }
.split-leg span { display: flex; align-items: center; gap: 6px; }
.fat-split .muted { font-size: 13.5px; margin-top: 6px; }
.water-glasses { display: flex; flex-wrap: wrap; gap: 8px; }
.wg { width: 22px; height: 28px; border-radius: 50% 50% 50% 50% / 60% 60% 42% 42%; background: var(--water); animation: pop .5s var(--spring) both; animation-delay: calc(var(--i) * 35ms); }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { width: 50px; height: 30px; border-radius: 99px; background: var(--line); position: relative; transition: background-color .25s; flex: none; }
.toggle-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .2); transition: transform .3s var(--spring); }
.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(20px); }
.toggle input:focus-visible + .toggle-ui { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.formula-list { list-style: none; margin: 0; padding: 0; }
.formula-list li { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.formula-list li.avg { border: 0; font-weight: 600; }
.formula-list b { font-variant-numeric: tabular-nums; }

/* ===== Профиль ===== */
.profile .big-title { margin-bottom: 18px; }
.me { display: flex; align-items: center; gap: 14px; }
.me-ava { width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-2); color: var(--accent); flex: none; }
.me-info { flex: 1; display: grid; gap: 2px; min-width: 0; }
.me-info b { font-size: 17px; }
.me-info span { color: var(--muted); font-size: 14px; }
.weigh { display: flex; gap: 10px; }
.weigh input { flex: 1; min-width: 0; }
.w-list { list-style: none; margin: 14px 0 0; padding: 0; }
.w-list li { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.install .muted { margin-bottom: 14px; }
.profile .card .muted + .btn { margin-top: 14px; }

/* ===== Нижняя панель ===== */
.tabbar {
  position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); height: 68px;
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent);
  max-width: 520px; margin: 0 auto; transition: transform .4s var(--ease), opacity .3s;
}
.tab-blob {
  position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 5); border-radius: 20px; background: var(--accent-2);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .5s var(--spring);
}
.tabbar a { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; transition: color .25s; }
.tabbar a.on { color: var(--accent); font-weight: 600; }
.tabbar a.on .ic { animation: bump .45s var(--spring); }
.app:has(#view[data-page=quiz]) .tabbar,
.app:has(#view[data-page=kbju] .quiz) .tabbar { transform: translateY(140%); opacity: 0; pointer-events: none; }

.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(92px + var(--safe-b)); display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 16px; background: var(--ink); color: var(--bg); font-weight: 500; font-size: 15px;
  box-shadow: var(--shadow-lg); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: transform .4s var(--spring), opacity .25s; width: max-content; max-width: calc(100% - 32px);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast .ic { color: var(--accent); }
.toast.err .ic { color: var(--prot); }

/* ===== Переходы между экранами ===== */
#view { view-transition-name: page; }
.tabbar { view-transition-name: tabbar; }
.rail { view-transition-name: rail; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(page) { animation-duration: .45s; }
::view-transition-old(page) { animation: page-out .2s ease-in both; }
::view-transition-new(page) { animation: page-in .46s var(--ease) both; }
html[data-dir=back]::view-transition-old(page) { animation-name: page-out-back; }
html[data-dir=back]::view-transition-new(page) { animation-name: page-in-back; }
.view.enter { animation: page-in .46s var(--ease) both; }
html[data-dir=back] .view.enter { animation-name: page-in-back; }

@keyframes page-in { from { opacity: 0; transform: translateX(32px); } }
@keyframes page-in-back { from { opacity: 0; transform: translateX(-32px); } }
@keyframes page-out { to { opacity: 0; transform: translateX(-16px); } }
@keyframes page-out-back { to { opacity: 0; transform: translateX(16px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes slide-r { from { opacity: 0; transform: translateX(48px); } }
@keyframes slide-l { from { opacity: 0; transform: translateX(-48px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes plate-in { from { opacity: 0; transform: scale(.82) rotate(-30deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes theme-spin { from { transform: rotate(-90deg) scale(.5); opacity: 0; } }
@keyframes theme-reveal { from { clip-path: circle(0 at var(--tx) var(--ty)); } to { clip-path: circle(var(--tr) at var(--tx) var(--ty)); } }
html.theme-vt #view, html.theme-vt .tabbar, html.theme-vt .rail { view-transition-name: none; }
html.theme-vt::view-transition-old(root) { animation: none; }
html.theme-vt::view-transition-new(root) { animation: theme-reveal .65s var(--ease) both; }
@keyframes bump { 40% { transform: translateY(-4px) scale(1.12); } }

/* ===== Планшет и десктоп ===== */
@media (min-width: 640px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .tile-main { grid-column: span 1; grid-row: span 2; min-height: 0; }
  .tile-main .tile-t { font-size: 24px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps li { padding: 66px 18px 18px; }
  .hero-cta .btn.big { width: auto; }
  .menu { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .result-grid .stats { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 252px 1fr; }
  .rail {
    display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100dvh; padding: 26px 16px;
    border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 45%, transparent);
  }
  .rail-brand em { font-style: normal; color: var(--accent); }
  .rail-brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 600; font-size: 21px; letter-spacing: -.02em; padding: 0 8px; }
  .rail-nav { display: grid; gap: 4px; }
  .rail-nav a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 14px; color: var(--muted); font-weight: 500; transition: background-color .2s, color .2s; }
  .rail-nav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
  .rail-nav a.on { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }
  .rail-mini { margin-top: auto; display: grid; gap: 2px; padding: 16px; border-radius: 20px; background: var(--accent-2); color: var(--ink); }
  .rail-mini span { opacity: .7; font-size: 13px; }
  .rail-mini b { font-family: var(--f-display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
  .rail-mini small { opacity: .7; }
  .rail-mini a { color: var(--accent); font-weight: 600; }
  .tabbar { display: none; }
  .view { width: 100%; padding: 8px 40px 64px; }
  .appbar { margin: 0 -40px; padding: 14px 28px; }
  .appbar-logo { visibility: hidden; }
  .hero { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; min-height: 440px; }
  .hero-plate { padding: 40px 0; }
  .plate { width: 320px; }
  .result-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .body-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .q-foot { position: static; background: none; padding: 26px 0 0; }
  .quiz { padding-bottom: 40px; }
  .toast { bottom: 32px; left: calc(50% + 126px); }
  .sheet-panel { left: 50%; right: auto; bottom: 50%; width: 520px; max-height: 80dvh; border-radius: 28px; transform: translate(-50%, 60%) scale(.96); opacity: 0; transition: transform .4s var(--ease), opacity .25s; }
  .sheet.open .sheet-panel { transform: translate(-50%, 50%); opacity: 1; }
  .sheet-grip { display: none; }
  .sheet-panel { min-height: 0; }
  .diary { max-width: 760px; }
  .plan, .profile { max-width: 860px; }
}
@media (max-width: 380px) {
  .chip-float { font-size: 12.5px; padding: 6px 10px; }
  .today, .diary-sum { flex-direction: column; align-items: stretch; }
  .today-ring, .diary-sum .today-ring { margin: 0 auto; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
