/* FoodCoach AI — приложение (концепция приложения, раздел 7). Палитра — из панели владельца (bot/panel/index.html):
   бело-розово-фиолетовая, тёмная — сливовая. Синего нет (проверяет tests/app_shots.py). Шрифты — как на сайте,
   свои файлы (fonts/), не с чужих серверов. Кнопки — не меньше 44 px. */
@font-face { font-family: "Onest"; font-weight: 400 700; font-display: swap; src: url(fonts/onest-cyr.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400 700; font-display: swap; src: url(fonts/onest-lat.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
  U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-weight: 500 800; font-display: swap; src: url(fonts/unb-cyr.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 500 800; font-display: swap; src: url(fonts/unb-lat.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
  U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --page: #fbf6fd;
  --card: #ffffff;
  --text: #2b1a35;
  --hint: #7b6888;
  --link: #8b3fe0;
  --head: #9a4bd1;
  --sep: #f0e3f3;
  --press: #f7ecf8;
  --field: #f8f1fb;
  --soft: #f3e8ff;
  --good: #16a34a;
  --warning: #e59e0b;
  --critical: #e0245e;
  --warn-ink: #b45309;
  --button: #8b3fe0;
  --ring-bg: #efe2f5;
  --protein: #7c3aed;
  --fat: #db2777;
  --carbs: #c026d3;
  --cal-empty: #f3f0f5;
  --cal-under: #e9dffc; --cal-under-ink: #2b1a35;
  --cal-ok: #7c3aed; --cal-ok-ink: #ffffff;
  --cal-over: var(--warning); --cal-over-ink: #3b2300;
  --cal-frame: linear-gradient(135deg, #4c1d95, #9d174d);
  --cal-sel-line: #ffffff;
  --cal-today-edge: 0 0 0 1.5px rgba(76, 29, 149, .5);
  --gradient: linear-gradient(120deg, #7c3aed, #db2777);
  --nav: rgba(255, 255, 255, .94);
  --shadow: 0 1px 2px rgba(91, 33, 182, .05), 0 2px 10px rgba(91, 33, 182, .06);
  --nav-h: 64px;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  accent-color: var(--button);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #160f1c;
  --card: #231829;
  --text: #f7eefb;
  --hint: #ab98b8;
  --link: #c9a6ff;
  --head: #c9a6ff;
  --sep: rgba(255, 225, 250, .09);
  --press: #2f2136;
  --field: #2c1f33;
  --soft: #3a2550;
  --good: #4ade80;
  --warning: #fbbf24;
  --critical: #fb7185;
  --warn-ink: #fbbf24;
  --button: #b88cff;
  --ring-bg: #36263f;
  --protein: #a370f7;
  --fat: #f0569f;
  --carbs: #e879f9;
  --cal-empty: #261d2c;
  --cal-under: #3a2958; --cal-under-ink: #f7eefb;
  --cal-ok: #8b5cf6; --cal-ok-ink: #ffffff;
  --cal-over: var(--warning); --cal-over-ink: #2b1a00;
  --cal-frame: linear-gradient(135deg, #7c3aed, #be185d);
  --cal-sel-line: #ffffff;
  --cal-today-edge: none;
  --nav: rgba(35, 24, 41, .96);
  --shadow: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--page); color: var(--text); overscroll-behavior: none; }
/* место под полосу прокрутки занято всегда: раскрыл список — полоса появилась, страница не прыгает влево (30.11) */
html { scrollbar-gutter: stable; }
/* без «резинки» Android у края прокрутки: пружинили вкладки внизу (21.11); заодно без «потянуть — обновить» */
body { font: 15px/1.4 "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%;
       overflow-x: hidden; }
::selection { background: rgba(219, 39, 119, .22); }
input, textarea, select, button { font: inherit; color: inherit; }
.field, textarea, select { font-size: 16px; }  /* меньше 16 px — iPhone увеличивает страницу при вводе */
input, textarea { caret-color: var(--button); }
:focus-visible { outline: 2px solid var(--button); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: var(--link); }
svg.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
          stroke-linejoin: round; flex: none; }

/* ---------- общие части ---------- */
.screen { max-width: 640px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; min-height: 52px;
       padding: env(safe-area-inset-top) 0 0; background: var(--page); }
/* шапки вкладок — как у чата (27.11): до краёв экрана и с плавным растворением содержимого под ними */
.screen > .bar { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.screen > .bar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 24px; pointer-events: none;
                        background: linear-gradient(to bottom, var(--page), transparent); }
.bar h1 { flex: 1; min-width: 0; margin: 0; font: 600 18px/1.2 var(--display); }
.grad-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--head);
     margin: 18px 4px 6px; }
.card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; }
.card + .card { margin-top: 10px; }
.hint { color: var(--hint); font-size: 14px; }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.btn { min-height: 44px; padding: 0 18px; border: 0; border-radius: 14px; cursor: pointer; font-weight: 600;
       display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.main { background: var(--gradient); color: #fff; }
.btn.soft { background: var(--soft); color: var(--link); }
.btn.plain { background: var(--card); color: var(--link); box-shadow: var(--shadow); }
.btn.danger { background: transparent; color: var(--critical); border: 1.5px solid currentColor; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%;
            background: transparent; color: var(--link); cursor: pointer; }
.icon-btn:active, .btn:active { transform: scale(.97); }
.field { display: block; width: 100%; min-height: 44px; color: var(--text); padding: 9px 12px; border: 1.5px solid transparent;
         border-radius: 14px; background: var(--field); outline: none; }
.field:focus { border-color: var(--button); }
.seg { display: flex; gap: 2px; padding: 3px; background: var(--field); border-radius: 14px; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 11px; background: none; color: var(--hint);
              font-weight: 500; cursor: pointer; padding: 0 6px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--link); box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; }
.row + .row { border-top: 1px solid var(--sep); }
.row .grow { flex: 1; min-width: 0; }
.empty { text-align: center; color: var(--hint); padding: 18px 12px; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--soft); border-top-color: var(--button);
        animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- вход ---------- */
.login { max-width: 420px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
         justify-content: center; gap: 12px; padding: 32px 16px calc(32px + env(safe-area-inset-bottom)); }
.login .logo { width: 96px; height: 96px; border-radius: 26px; margin: 0 auto 4px; display: block;
               box-shadow: 0 8px 30px rgba(219, 39, 119, .35); }
.login h1 { text-align: center; font: 700 26px/1.2 var(--display); margin: 8px 0 0; }
.login .lead { text-align: center; color: var(--hint); margin: 0 0 16px; }
.login .or { text-align: center; color: var(--hint); font-size: 14px; margin: 6px 0; }
.login .legal { text-align: center; color: var(--hint); font-size: 13px; margin-top: 12px; }
.wait { display: flex; align-items: center; gap: 12px; justify-content: center; color: var(--hint); }

/* ---------- нижние вкладки ---------- */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
           border-top: 1px solid var(--sep); padding-bottom: env(safe-area-inset-bottom); }
/* без will-change/translateZ: с ними на Android меню на миг уезжало вниз при прокрутке (04.12) */
/* размытие — отдельным слоем под надписями: на Android, когда экран под меню начинал анимацию, надписи меню
   на миг пропадали вместе с перерисовкой размытия (жалоба владельца 04.12) */
nav.tabs::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--nav);
                   backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
nav.tabs .in { display: flex; width: 100%; max-width: 640px; height: var(--nav-h); align-items: center; }
nav.tabs button { flex: 1; height: 100%; border: 0; background: none; color: var(--hint); cursor: pointer;
                  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
                  font-size: 12px; font-weight: 500; }
nav.tabs button[aria-current="page"] { color: var(--link); }
nav.tabs .coach { flex: 0 0 84px; }
nav.tabs .coach span.bubble { width: 54px; height: 54px; margin-top: -18px; border-radius: 50%; display: grid;
  place-items: center; background: var(--gradient); color: #fff; box-shadow: 0 6px 18px rgba(219, 39, 119, .38);
  border: 4px solid var(--page); }
nav.tabs .coach span.bubble svg { width: 26px; height: 26px; }

/* ---------- тренер (чат) ---------- */
.chat-screen { padding-bottom: 0; }
.daystrip { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 12px;
            border: 0; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); cursor: pointer;
            text-align: left; }
.chat-top { position: sticky; top: 0; z-index: 5; background: var(--page); margin: 0 -16px; padding: 0 16px 8px; }
/* шапка на всю ширину с полями: иначе тень сообщений под ней видна по краям тонкой полоской (27.11) */
.chat-top .bar { position: static; }
/* плавный переход: сообщения уходят под шапку, растворяясь, а не обрезаясь резкой линией (27.11) */
.chat-top::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 24px; pointer-events: none;
                   background: linear-gradient(to bottom, var(--page), transparent); }
.daystrip .grow { flex: 1; min-width: 0; font-size: 14px; }
.daystrip b { font-weight: 600; }
.msgs { display: flex; flex-direction: column; gap: 8px; padding: 12px 0 calc(var(--nav-h) + 104px + env(safe-area-inset-bottom)); }
.more { align-self: center; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.msg.user { align-self: flex-end; background: var(--gradient); color: #fff; border-bottom-right-radius: 6px; }
.msg.user a { color: #fff; }
.msg .time { display: block; margin-top: 4px; font-size: 11px; color: var(--hint); text-align: right; white-space: normal; }
.msg.user .time { color: rgba(255, 255, 255, .8); }
.msg blockquote { margin: 6px 0; padding: 2px 0 2px 10px; border-left: 3px solid var(--fat); }
.msg pre, .msg code { font-family: ui-monospace, monospace; font-size: 14px; background: var(--field);
                      border-radius: 6px; padding: 0 4px; }
.msg pre { padding: 8px; overflow-x: auto; white-space: pre-wrap; }
.msg img { display: block; max-width: 100%; border-radius: 12px; margin-bottom: 6px; }
.msg.user img { margin: -4px -8px 6px; max-width: calc(100% + 16px); max-height: 320px; object-fit: cover; }
.msg.user .pics { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: -4px -8px 6px; width: 240px; max-width: calc(100% + 16px); }
.msg.user .pics img { margin: 0; width: 100%; max-width: 100%; aspect-ratio: 1; max-height: none; border-radius: 10px; }
/* 29.11: голосовое — нарисованная дорожка, как в мессенджере */
.vtrack { display: flex; align-items: center; gap: 10px; white-space: normal; }
.vico { flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; }
.vico svg { width: 18px; height: 18px; }
.wave { display: flex; align-items: center; gap: 2px; height: 26px; }
.wave i { width: 3px; border-radius: 2px; background: currentColor; opacity: .9; }
.vlen { font-size: 13px; font-variant-numeric: tabular-nums; opacity: .9; }
.msg .cmd { border: 0; padding: 0; background: none; color: var(--link); font: inherit; text-decoration: underline;
            cursor: pointer; }
.msg .report { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 4px; padding: 0 12px;
               border: 0; border-radius: 12px; background: var(--field); color: var(--hint); font-size: 14px; cursor: pointer; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; white-space: normal; }
.pill { min-height: 44px; padding: 8px 14px; border: 0; border-radius: 22px; background: var(--gradient); color: #fff;
        font-size: 15px; font-weight: 500; cursor: pointer; text-align: center; text-decoration: none;
        display: inline-flex; align-items: center; }
.pill.link { background: var(--soft); color: var(--link); }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--card);
          box-shadow: var(--shadow); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--fat); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 15;
            background: var(--page); padding: 8px 16px 22px; border-top: 1px solid var(--sep); }
.composer .in { position: relative; max-width: 608px; margin: 0 auto; display: flex; align-items: flex-end; gap: 4px; }
/* у поля четыре кнопки — серые чуть уже, подсказка в поле в одну строку. С 04.12 (владелец): камера слева от поля,
   «Команды» — внутри поля (.box — это и есть видимое поле: рамка, фон, тень), чтобы поле было шире */
.composer .icon-btn:not(.send) { width: 40px; }
.composer .box { flex: 1; min-width: 0; display: flex; align-items: flex-end; border: 1.5px solid transparent; border-radius: 22px;
                 background: var(--card); box-shadow: var(--shadow); }
.composer .box:focus-within { border-color: var(--button); }
.composer .box .icon-btn { height: 43px; margin-left: 2px; }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer textarea { flex: 1; min-width: 0; resize: none; overflow-y: hidden; max-height: 140px; min-height: 43px; padding: 10px 14px 10px 2px;
                     border: 0; background: transparent; outline: none; line-height: 1.35; }
.composer .send { background: var(--gradient); color: #fff; }
/* 04.12 «тренер слушает» — запись голосового (как в Telegram): вместо поля плашка с переливающейся рамкой, снизу
   свечение, которое разгорается от голоса (--lvl 0…1 ставит app.js). Голубой — ТОЛЬКО здесь (решение владельца 04.12:
   в общий фирменный градиент его не добавлять); светлый сиреневато-голубой, чтобы плавно переходил в фиолетовый. */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
:root { --listen-blue: #7ab8ff; --listen-ring: conic-gradient(from var(--spin), var(--listen-blue), #7c3aed, #db2777, #a855f7, var(--listen-blue)); }
.composer.listening { border-top-color: transparent; }
.composer.listening::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(100% + 90px); z-index: -1;
  pointer-events: none; transform-origin: 50% 100%; transform: scaleY(calc(.7 + var(--lvl, 0) * .6));
  opacity: calc(.75 + var(--lvl, 0) * .25); filter: blur(16px); animation: listen-in .35s ease-out both;
  background: radial-gradient(36% 62% at 16% 80%, rgba(122, 184, 255, .95), transparent 70%),
              radial-gradient(40% 70% at 50% 82%, rgba(139, 92, 246, .8), transparent 72%),
              radial-gradient(36% 62% at 86% 80%, rgba(236, 72, 153, .85), transparent 70%); }
:root[data-theme="dark"] .composer.listening::before { opacity: calc(.6 + var(--lvl, 0) * .4); }
@keyframes listen-in { from { opacity: 0; } }
.composer.listening .in > :not(.rcancel, .recbox, .mic, .rlock) { display: none; }
/* удержание (04.12, как в Telegram): палец на кнопке — она крупнее и светится; над ней замочек «вверх — закрепить»,
   в плашке «‹ влево — отмена»; кнопки «Отмена» нет — палец занят */
.composer .mic { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.composer.holding .rcancel { display: none; }
.composer .mic.holding { position: relative; z-index: 1; scale: 1.3; background: var(--gradient); color: #fff;
  box-shadow: 0 0 calc(10px + var(--lvl, 0) * 26px) rgba(219, 39, 119, calc(.35 + var(--lvl, 0) * .35)); transition: scale .15s ease-out; }
.composer .rlock { position: absolute; right: 2px; bottom: calc(100% + 22px); width: 40px; padding: 10px 0 8px; display: flex;
  flex-direction: column; align-items: center; gap: 2px; border-radius: 20px; background: var(--card); color: var(--link);
  box-shadow: var(--shadow), 0 4px 16px rgba(91, 33, 182, .18); animation: lock-in .25s ease-out both;
  transform: translateY(calc(var(--up, 0) * -12px)); }
.composer .rlock .ico { width: 20px; height: 20px; }
.composer .rlock .ico + .ico { width: 16px; height: 16px; animation: lock-hint 1.2s ease-in-out infinite; }
@keyframes lock-in { from { opacity: 0; translate: 0 14px; } }
@keyframes lock-hint { 50% { translate: 0 -3px; } }
.recbox .rhint { transition: opacity .1s; white-space: nowrap; margin-left: 2px; }
.composer .rcancel { flex: none; min-height: 46px; padding: 0 14px; border-radius: 22px; }
.composer .recbox { flex: 1; min-width: 0; min-height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border: 2px solid transparent; border-radius: 22px; background: linear-gradient(var(--card), var(--card)) padding-box, var(--listen-ring) border-box;
  box-shadow: 0 0 calc(6px + var(--lvl, 0) * 20px) rgba(139, 92, 246, calc(.25 + var(--lvl, 0) * .35));
  animation: ring 3.5s linear infinite; font-variant-numeric: tabular-nums; }
@keyframes ring { to { --spin: 360deg; } }
.recbox .rdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gradient); animation: blink 1.2s infinite; }
.recbox b { flex: none; font-weight: 600; }
.recbox .rhint { flex: none; color: var(--hint); font-size: 14px; }
.recbox .rwave { flex: 1; min-width: 0; height: 24px; display: flex; align-items: center; justify-content: flex-end; gap: 2px; overflow: hidden; }
.recbox .rwave i { flex: none; width: 3px; height: 14%; border-radius: 2px; background: linear-gradient(var(--listen-blue), #8b5cf6, #db2777);
                   transition: height .08s linear; }
@keyframes pulse { 50% { opacity: .7; } }
.composer .rec { background: var(--gradient); color: #fff; box-shadow: 0 4px 14px rgba(219, 39, 119, .35); }
@media (max-width: 380px) { .composer:not(.holding) .recbox .rhint { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .composer .recbox, .recbox .rdot, .composer.listening::before, .composer .rlock .ico + .ico { animation: none; }
  .composer.listening::before { transform: none; }
}
/* пересланное из другого приложения — над полем ввода, как ответ на сообщение в мессенджере (01.12) */
.composer .fwd { max-width: 608px; margin: 0 auto 8px; display: flex; align-items: center; gap: 6px; padding: 6px 4px 6px 12px;
                 background: var(--card); border-left: 3px solid var(--button); border-radius: 12px; box-shadow: var(--shadow); }
.has-fwd .msgs { padding-bottom: calc(var(--nav-h) + 172px + env(safe-area-inset-bottom)); }
.composer .thumbs { display: flex; gap: 6px; margin-top: 4px; overflow-x: auto; }
.composer .thumb { position: relative; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--field); }
.composer .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.composer .thumb .x { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
                      background: rgba(22, 15, 28, .55); color: #fff; }
.composer .thumb .x svg { width: 10px; height: 10px; }
.composer .fwd-body { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; }
.composer .fwd-body b { color: var(--button); font-size: 13px; }
.composer .fwd-text { color: var(--hint); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                      white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- дневник ---------- */
.daynav { display: flex; align-items: center; gap: 4px; }
.daynav .day { flex: 1; min-height: 44px; border: 0; background: none; font-weight: 600; cursor: pointer; text-align: center; }
.rings { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr)); gap: 6px; align-items: start; }
.ring { position: relative; display: grid; justify-items: center; text-align: center; }
.ring .cap { margin-top: 4px; font-size: 12px; line-height: 1.25; color: var(--hint); }
.ring .cap span { display: block; }
.ring .cap span { font-variant-numeric: tabular-nums; }
.ring svg { width: 100%; max-width: 116px; height: auto; display: block; transform: rotate(-90deg); }
.ring .dial { position: relative; width: 100%; max-width: 116px; }
.ring .lbl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
             line-height: 1.1; }
.ring .lbl b { font-size: 17px; font-variant-numeric: tabular-nums; }
.ring .lbl span { font-size: 11px; color: var(--hint); }
.ring.big .lbl b { font-size: 19px; }
.ring.over .lbl b { color: var(--warn-ink); }
.left { text-align: center; margin-top: 8px; font-size: 14px; color: var(--hint); }
.card.list { padding: 0; overflow: hidden; }
.meal { display: block; width: 100%; padding: 9px 14px; border: 0; background: none; text-align: left; cursor: pointer; }
.meal + .meal { border-top: 1px solid var(--sep); }
.meal:active, .result:active { background: var(--press); }
.meal .head { display: flex; gap: 8px; align-items: baseline; }
.meal .head .grow { flex: 1; min-width: 0; font-weight: 600; }
.meal .head .items { font-weight: 400; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meal .macros { margin-top: 2px; font-size: 12px; color: var(--hint); }
.meal .kc { white-space: nowrap; }
.meal .kc small { font-weight: 400; color: var(--hint); font-size: 12px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--soft); color: var(--link);
         font-size: 12px; font-weight: 600; vertical-align: 1px; }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.actions.stack { flex-direction: column; }
.actions.stack .btn { flex: none; width: 100%; }
.note { margin-top: 12px; font-size: 13px; color: var(--hint); }

/* ---------- окна снизу и сообщения ---------- */
.veil { position: fixed; inset: 0; z-index: 40; background: rgba(22, 15, 28, .45); display: flex; align-items: flex-end;
        justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 640px; max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--page);
         border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .24s cubic-bezier(.2, .8, .2, 1); }
.sheet .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--sep); margin: 4px auto 10px; }
.sheet h3 { font: 600 18px/1.25 var(--display); margin: 4px 0 12px; }
.sheet .item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.sheet .item + .item { border-top: 1px solid var(--sep); }
.sheet .item .grow { flex: 1; min-width: 0; }
.sheet .item input { width: 92px; text-align: right; }
.sheet .item .drop { width: 40px; margin-right: -8px; color: var(--hint); }
.sheet .item { touch-action: pan-y; }   /* свайп влево убирает продукт (04.12) */
.result { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 52px; padding: 8px 4px; border: 0;
          background: none; text-align: left; cursor: pointer; }
.result + .result { border-top: 1px solid var(--sep); }
.result .grow { flex: 1; min-width: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chip { min-height: 44px; min-width: 56px; padding: 0 14px; border: 0; border-radius: 22px; background: var(--soft);
        color: var(--link); font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--gradient); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }   /* окно выезжает снизу целиком, мягко тормозит (04.12) */
.card.cal { touch-action: pan-y; }   /* свайп календаря — вбок, страница листается как была */
@media (prefers-reduced-motion: reduce) { .veil, .sheet { animation: none; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); z-index: 60;
         transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); display: flex; align-items: center;
         gap: 12px; padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--text); color: var(--page);
         box-shadow: 0 6px 24px rgba(0, 0, 0, .2); animation: fade .2s; }
.toast .btn { min-height: 40px; padding: 0 12px; background: transparent; color: var(--soft); }
.toast.solo { padding: 12px 16px; }
.toast.gone { opacity: 0; transition: opacity .2s ease-out; pointer-events: none; }   /* касание мимо — плавно уходит (04.12) */
/* заставка при запуске (#splash в index.html, hideSplash в app.js): цвет и размер — как у заставки APK
   (android/…/colors.xml splash_bg, логотип 240 точек), поэтому переход от неё к странице не виден */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #1a191e;
          transition: opacity .4s ease; }
#splash img { width: 240px; height: 240px; display: block; animation: glow 1.6s ease-in-out .5s infinite alternate; }
#splash.gone { opacity: 0; pointer-events: none; }
#splash.gone img { animation: none; transform: scale(1.06); transition: transform .4s ease; }
@keyframes glow { to { transform: scale(1.035); filter: brightness(1.15); } }
@media (prefers-reduced-motion: reduce) { #splash img { animation: none; } }
/* «Нажми ещё раз для выхода» — неяркая подсказка над вкладками, без кнопок (backNav в app.js) */
.backhint { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 70;
            transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 7px 14px;
            border-radius: 14px; background: var(--text); color: var(--page); opacity: .72; font-size: 13px;
            pointer-events: none; animation: fade .2s; }

/* ---------- профиль ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--hint); min-width: 0; }
.form label.full { grid-column: 1 / -1; }
.form .field { color: var(--text); font-size: 16px; }
select.field { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--hint) 50%),
  linear-gradient(135deg, var(--hint) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.norm { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; }
.norm b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.norm span { font-size: 12px; color: var(--hint); }
.switch { position: relative; flex: none; width: 60px; height: 44px; border: 0; background: none; cursor: pointer; padding: 0; }
.switch::before { content: ""; position: absolute; left: 4px; top: 6px; width: 52px; height: 32px; border-radius: 16px;
                  background: var(--ring-bg); }
.switch::after { content: ""; position: absolute; top: 9px; left: 7px; width: 26px; height: 26px; border-radius: 50%;
                 background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch[aria-checked="true"]::before { background: var(--gradient); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.card > .field, .card > .seg, .card > .btn { margin: 4px 0 8px; }
.tone, .choice { display: grid; gap: 8px; }
.tone button, .choice button { display: block; width: 100%; min-height: 48px; padding: 8px 12px; border: 1.5px solid var(--sep);
               border-radius: 14px; background: var(--card); text-align: left; cursor: pointer; }
.tone button[aria-pressed="true"], .choice button[aria-pressed="true"] { border-color: var(--button); background: var(--soft); }
.tone b, .choice b { display: block; }
.tone span, .choice span { font-size: 13px; color: var(--hint); }
.card > .choice { margin: 4px 0 8px; }
.del { flex: none; }
.links { display: flex; flex-direction: column; }
.bar .chip { display: inline-flex; align-items: center; gap: 2px; padding: 0 14px 0 8px; }
.bar .chip .ico { width: 20px; height: 20px; }

/* календарь дневника: цвет всей клетки — ккал против нормы (±10%, как в недельном отчёте) — просьба владельца 26.11; палитра (26.11): меньше — светло-фиолетовый, норма — фиолетовый, больше — жёлтый как перебор на полосках БЖУ (--warning), рамка — тёмный градиент;
   выбранный день — рамка, сегодня — черта под числом */
.cal { touch-action: pan-y; }   /* свайп влево/вправо листает календарь (04.12) */
.calnav { display: flex; align-items: center; gap: 4px; margin: -4px -6px 6px; }
.calnav .grow { flex: 1; text-align: center; font-weight: 600; }
.cgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cgrid.wd span { text-align: center; font-size: 11px; color: var(--hint); padding-bottom: 2px; }
.cd { --fill: var(--cal-empty); --frame: var(--cal-frame); min-height: 52px; padding: 5px 0 6px; border: 2px solid transparent; border-radius: 12px;
      background: linear-gradient(var(--fill), var(--fill)) padding-box, var(--frame) border-box; color: var(--text);
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font: inherit; }
.cd.blank { background: none; border: 0; }
.cd:disabled { opacity: .35; cursor: default; }
.cd:not(:disabled):active { filter: brightness(.95); }
.cd b { font-size: 14px; font-weight: 600; line-height: 1.2; min-width: 24px; padding: 1px 5px; border-radius: 999px; text-align: center; }
.cd .kc { font-size: 10px; line-height: 1.2; min-height: 12px; color: var(--text); opacity: .7; }
.cd.under, .legend .under i { --fill: var(--cal-under); color: var(--cal-under-ink); }
.cd.ok, .legend .ok i { --fill: var(--cal-ok); color: var(--cal-ok-ink); }
/* «в норме» — награда (просьба владельца 26.11): градиент как у кнопки «Тренер» и свечение; звёздочка в углу — только
   если и белки, жиры, углеводы в норме (27.11, класс star с сервера) */
.cd { position: relative; }
.cd.ok, .legend .ok i { background: var(--gradient) padding-box, var(--frame, var(--cal-frame)) border-box; }
.cd.ok { box-shadow: 0 4px 12px -3px rgba(190, 40, 160, .55); }
.cd.star::before { content: ''; position: absolute; top: 3px; right: 3px; width: 10px; height: 10px;
                 background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z'/%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(0 0 2px rgba(255, 255, 255, .8)); }
/* золотая — всё в норме (27.11): тот же значок, золотой с тёплым свечением */
.cd.star.gold::before { content: ''; position: absolute; top: 3px; right: 3px; width: 10px; height: 10px;
                 background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffd23f' d='M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z'/%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(0 0 2px rgba(255, 190, 40, .9)); }
.cd.ok.sel { box-shadow: inset 0 0 0 2px var(--cal-sel-line), 0 4px 12px -3px rgba(190, 40, 160, .55); }
.cd.over, .legend .over i { --fill: var(--cal-over); color: var(--cal-over-ink); }
.cd.ok .kc, .cd.under .kc, .cd.over .kc { color: inherit; opacity: .85; }
.cd.today b::after { content: ''; display: block; width: 16px; height: 3px; margin: 3px auto 1px; border-radius: 2px; background: #fff; box-shadow: var(--cal-today-edge); }
.cd.ok.today b::after, .cd.over.today b::after { box-shadow: none; }
/* выбранный — рамка внутри клетки (не налезает на соседние): ярче и толще обычной, с белой полоской внутри */
.cd.sel { --frame: var(--gradient); border-width: 3px; box-shadow: inset 0 0 0 2px var(--cal-sel-line); }
.legend { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--hint); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { --fill: var(--cal-empty); display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid transparent;
            background: linear-gradient(var(--fill), var(--fill)) padding-box, var(--cal-frame) border-box; }
.card.cal .hint { margin: 8px 0 0; }
.links a { display: flex; align-items: center; min-height: 44px; text-decoration: none; }
.links a + a { border-top: 1px solid var(--sep); }

/* пока пишешь — вкладки прячутся, поле ввода опускается к клавиатуре */
.typing-mode nav.tabs { display: none; }
.typing-mode .composer { bottom: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
/* 04.12: вкладок нет — и места под ними под сообщениями нет (была пустая полоса над полем) */
.typing-mode .msgs { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.typing-mode.has-fwd .msgs { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }

/* прогресс: вес и ккал по дням (свои графики на SVG, как в панели) */
.wtop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wtop .big { display: block; font: 600 26px/1.2 var(--display); }
.chart { display: block; width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.chart .grid { stroke: var(--sep); stroke-width: 1; }
.chart .axis { fill: var(--hint); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart .warea { fill: url(#wfill); }
.chart .wline { fill: none; stroke: url(#wgrad); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .wdot { fill: var(--card); stroke: var(--fat); stroke-width: 2; }
/* нажатие на графике веса: линия, точка и сводка над графиком (weightChart) */
.wchart { position: relative; }
.wchart .chart { touch-action: pan-y; cursor: crosshair; -webkit-user-select: none; user-select: none; }
.chart .wmark { display: none; pointer-events: none; }
.wchart.on .chart .wmark { display: inline; }
.chart .wmark line { stroke: var(--hint); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .wmark circle { fill: var(--fat); stroke: var(--card); stroke-width: 2.5; }
.wtip { position: absolute; top: -6px; transform: translate(-50%, -100%); display: none; flex-direction: column;
        align-items: center; gap: 1px; padding: 6px 10px; border-radius: 12px; background: var(--card);
        box-shadow: 0 4px 16px rgba(43, 26, 53, .18); font-size: 12px; line-height: 1.3; white-space: nowrap;
        pointer-events: none; z-index: 2; }
.wtip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.wchart.on .wtip { display: flex; }
.chart .kbar { fill: url(#kgrad); }
.chart .now { fill: url(#kgrad); opacity: .45; }
.chart .over { fill: var(--warning); }
.chart .none { fill: var(--ring-bg); }
.chart .norm { stroke: var(--hint); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .hit { fill: transparent; cursor: pointer; }
.card > .seg { margin: 0; }
.flat { margin: 0 0 6px; }
.row.week { padding: 10px 16px; }

/* продукты: поиск, карточка продукта, состав блюда, рецепты */
.search { margin: 4px 0 10px; }
.card.list .result { padding: 8px 16px; text-align: left; }
.card.list .more { display: block; width: 100%; min-height: 44px; border: 0; border-top: 1px solid var(--sep);
                   background: none; color: var(--link); font-weight: 600; cursor: pointer; }
.about { margin: 6px 0 4px; }
.about .hint { margin: 0 0 8px; }
.recipe ul { list-style: none; margin: 6px 0 0; padding: 0; }
.recipe li { display: flex; gap: 10px; padding: 4px 0; font-size: 14px; border-top: 1px solid var(--sep); }
.recipe li .grow { flex: 1; min-width: 0; }
.card .btn { margin-top: 4px; }
/* крестик очистки в поле поиска браузер рисует синим — свой цвет темы */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 16px; height: 16px;
  background: var(--hint); cursor: pointer;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }

/* «Добавить»: другие способы записи; «Повторить» и штрихкод */
.chips.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chips.ways .chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
                    min-width: 0; min-height: 60px; padding: 6px 4px; border-radius: 16px; font-size: 13px; }
.chips.ways .ico { width: 20px; height: 20px; }
.btn.wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.row-form { display: flex; gap: 8px; margin: 10px 0; }
.row-form .field { flex: 1; min-width: 0; margin: 0; }
.sheet .seg { margin-bottom: 10px; }

/* реакции на ответы тренера */
.react-badge { display: inline-grid; place-items: center; min-width: 44px; min-height: 32px; margin: 6px 0 0; padding: 0 10px;
               border: 0; border-radius: 16px; background: var(--soft); font-size: 18px; cursor: pointer; }
.reacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 4px 0 8px; }
.react { min-height: 56px; border: 0; border-radius: 16px; background: var(--soft); font-size: 28px; cursor: pointer; }
.react[aria-pressed="true"] { background: var(--gradient); }
/* сканер штрихкода камерой: видео в рамке, полоска в градиенте; свои цвета, без синего */
.scanner { position: relative; overflow: hidden; aspect-ratio: 4 / 3; max-height: 46vh; max-height: 46dvh; width: 100%;
  margin: 4px 0 10px; border-radius: 18px; background: #160f1c; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 9%; right: 9%; top: 27%; bottom: 27%; border: 3px solid rgba(255, 255, 255, .92);
  border-radius: 16px; box-shadow: 0 0 0 999px rgba(22, 15, 28, .38); }
.scan-frame::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 3px; margin-top: -1.5px;
  border-radius: 2px; background: var(--gradient); box-shadow: 0 0 10px rgba(219, 39, 119, .7); animation: pulse 1.4s ease-in-out infinite; }
.scan-say { position: absolute; left: 12px; right: 12px; bottom: 10px; margin: 0; text-align: center; color: #fff;
  font-size: 14px; font-weight: 600; text-shadow: 0 1px 4px rgba(22, 15, 28, .8); }
.scan-fail:empty { display: none; }
.scan-fail { margin: 4px 0 10px; color: var(--warn-ink); }
.sheet .btn.wide + .btn.wide, .sheet .scan-fail + .btn.wide { margin-top: 8px; }
.sheet .actions + .btn.wide { margin-top: 10px; }

/* значки (просьба владельца 21.11: «как на сайте»): заголовок раздела — белый значок в градиентном квадратике,
   строка — значок в мягком квадрате, записи и пустые места — цветные рисунки еды с сайта (ART в app.js) */
h2 { display: flex; align-items: center; gap: 8px; }
.sec-ico { flex: none; width: 22px; height: 22px; border-radius: 7px; background: var(--gradient); color: #fff;
           display: grid; place-items: center; }
.sec-ico .ico { width: 14px; height: 14px; stroke-width: 2.2; }
.lead-ico { flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--soft); color: var(--link);
            display: grid; place-items: center; }
.lead-ico .ico { width: 18px; height: 18px; }
.tone button, .choice button { display: flex; align-items: center; gap: 12px; }
.tone .grow span, .choice .grow span { display: block; }
.tone button[aria-pressed="true"] .lead-ico, .choice button[aria-pressed="true"] .lead-ico { background: var(--gradient); color: #fff; }
.links a { gap: 12px; }
.links a .grow { flex: 1; min-width: 0; }
.links a > .ico:last-child { width: 18px; height: 18px; color: var(--hint); }
svg.art { display: block; flex: none; }
.meal { display: flex; gap: 12px; align-items: flex-start; }
.meal .body { flex: 1; min-width: 0; }
.slim .pic { width: 34px; height: 34px; padding: 4px; border-radius: 10px; background: var(--soft); }
.empty .art.big { width: 56px; height: 56px; margin: 0 auto 8px; }

/* дневник компактно (21.11): шапка с датой, итог дня в одну строку, календарь плотнее */
.bar .daynav { flex: none; margin-left: auto; gap: 0; }
.bar .daynav .day { min-width: 96px; font-size: 15px; }
.bar .chip.back { min-height: 40px; }
.daysum { display: flex; align-items: center; gap: 14px; }
.daysum .ring { width: 96px; flex: none; }
.daysum .ring .cap { display: none; }
.daysum .ring.big .lbl b { font-size: 18px; }
.daysum .grow { flex: 1; min-width: 0; display: grid; gap: 6px; }
.daysum .left { margin: 0; text-align: left; font-weight: 600; color: var(--text); font-size: 15px; }
.daysum .left.over { color: var(--warn-ink); }
.mbar .mtop { display: flex; justify-content: space-between; font-size: 12px; color: var(--hint); line-height: 1.3; }
.mbar.over .mtop .num { color: var(--warn-ink); }
.mbar .track { height: 6px; border-radius: 3px; background: var(--ring-bg); overflow: hidden; margin-top: 2px; }
.mbar .track i { display: block; height: 100%; border-radius: 3px; }
.card.slim { display: flex; align-items: center; gap: 10px; }
.card.slim p { margin: 0; }
.calnav { margin: -6px -8px 4px; }
.cgrid { gap: 3px; }
.cd { min-height: 44px; padding: 4px 0; border-radius: 10px; gap: 0; }
.cd b { font-size: 13px; }
.cd .kc { font-size: 9.5px; min-height: 11px; }
.legend { margin-top: 8px; gap: 12px; }
.card.cal .hint { margin-top: 6px; font-size: 12px; }
.card.cal { margin-top: 10px; padding-bottom: 4px; }
.calmore { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 40px; margin-top: 4px;
           border: 0; background: none; color: var(--link); font-weight: 600; font-size: 14px; cursor: pointer; }
.calmore .ico { width: 18px; height: 18px; }

/* код для бота без ссылки (codeCard) */
.code-card { margin: 14px 0; padding: 12px 14px; border-radius: 14px; background: var(--field); text-align: left; }
.code-card .hint { margin: 0 0 10px; }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.code-text { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 22px; font-weight: 700; letter-spacing: 2px;
  color: var(--text); user-select: all; }

/* ---------- «Продукты»: что съесть, ПП-рецепты, список покупок, свои продукты ---------- */
h2.with-act { display: flex; align-items: center; }
h2.with-act .icon-btn { margin: -12px -8px -12px auto; }
.pad { margin: 0; padding: 4px 16px 10px; }
.recipe .gap { display: block; margin-top: 12px; }
.recipe ol.steps { margin: 6px 0 0; padding-left: 22px; }
.recipe ol.steps li { display: list-item; border-top: 0; padding: 3px 0; font-size: 14px; line-height: 1.4; }
.grp { margin: 8px 0 2px; font-weight: 600; color: var(--head); }
.grp:first-child { margin-top: 0; }
.row.shop { gap: 6px; }
.row.shop.done .grow { color: var(--hint); text-decoration: line-through; }
.tick { flex: none; width: 44px; height: 44px; margin-left: -8px; display: grid; place-items: center; border: 0;
        background: none; cursor: pointer; padding: 0; }
.tick span { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--link); display: grid; place-items: center;
             color: transparent; }
.tick span svg.ico { width: 16px; height: 16px; }
.tick[aria-checked="true"] span { background: var(--gradient); border-color: transparent; color: #fff; }
.addrow { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.addrow .field { flex: 1; min-width: 0; }
.row .grow.tap { border: 0; background: none; text-align: left; padding: 4px 0; cursor: pointer; color: inherit; font: inherit;
                 min-height: 44px; }
.sheet .answer { font-size: 15px; line-height: 1.45; white-space: pre-wrap; }
.sheet label.item { cursor: default; }
.sheet label.item .field { width: 92px; text-align: right; }

/* «Подобрать рецепт» (вкладка «Продукты»): что есть дома — плашками, популярное — с «+» */
.cook .chip { display: inline-flex; align-items: center; gap: 4px; }
.cook .chip .ico { width: 16px; height: 16px; }
.cook .chips.home .chip .ico { opacity: .85; }
.cook .card + .card { margin-top: 10px; }
.cook .grp.pad { padding: 10px 16px 2px; margin: 0; }

/* разделы вкладки «Продукты» сворачиваются (27.11): свёрнутый — плашка-карточка со стрелкой, число — сколько внутри */
.fold-head { margin: 18px 4px 6px; }
.fold-btn { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0;
            border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
            text-align: left; cursor: pointer; }
.fold-btn .grow { flex: 1; min-width: 0; }
.fold-n { padding: 3px 8px; border-radius: 10px; background: var(--soft); color: var(--link); font-size: 12px;
          letter-spacing: 0; text-transform: none; }
.fold-btn .chev { display: grid; place-items: center; width: 28px; height: 28px; color: var(--hint); }
.fold-btn .chev .ico { width: 18px; height: 18px; transition: transform .2s ease; }
.fold-head.shut .chev .ico { transform: rotate(-90deg); }
.fold-head.shut { margin: 10px 0 0; padding: 4px 6px 4px 12px; background: var(--card); border-radius: 16px;
                  box-shadow: var(--shadow); }
.fold-head .icon-btn { margin: -12px -8px -12px 4px; }
.fold-head.shut .icon-btn { margin: -8px -2px -8px 4px; }
@media (prefers-reduced-motion: reduce) { .fold-btn .chev .ico { transition: none; } }

/* QR-код входа на компьютере (27.11): белый квадрат на любой теме — камере нужен светлый фон */
.card.qr { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.card.qr svg { width: 180px; height: 180px; border-radius: 12px; }
.card.qr[hidden] { display: none; }

/* счётчик звёздочек под календарём (27.11): три столбца, в каждом белая и золотая на градиенте, как в днях */
.stars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sep); }
.scol { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.scol .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.spills { display: flex; gap: 4px; }
.spill { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px 3px 6px; border-radius: 999px; background: var(--gradient); color: #fff; }
.spill svg { width: 13px; height: 13px; fill: #fff; filter: drop-shadow(0 0 2px rgba(255, 255, 255, .8)); }
.spill.gold svg { fill: #ffd23f; filter: drop-shadow(0 0 2px rgba(255, 190, 40, .9)); }
.spill b { font-size: 13px; font-weight: 700; }
/* подпись звёздочек под календарём (28.11): картинка + простые слова, по строке на звёздочку */
.starkey { display: grid; gap: 6px; margin-top: 10px; font-size: 13px; line-height: 1.35; color: var(--text); }
.starkey > div { display: flex; align-items: center; gap: 8px; }
.starkey .spill { padding: 3px 6px; flex: none; }
/* окно закрывается плавно: фон гаснет, окно уезжает вниз (28.11) */
.veil.closing { transition: background-color .2s; background-color: transparent; pointer-events: none; }


/* меню у сообщения по тапу, как в Telegram (01.12): реакции сверху, действия списком */
.menu-veil { position: fixed; inset: 0; z-index: 40; background: rgba(22, 15, 28, .28); }
/* всегда у правого края — под большой палец (владелец 01.12) */
.msg-menu { position: fixed; right: 16px; width: min(320px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 640px) { .msg-menu { right: max(16px, calc(50vw - 304px)); } }
.menu-reacts { display: flex; padding: 4px; background: var(--card); border-radius: 26px; box-shadow: var(--shadow); }
.menu-reacts .react { flex: 1; min-width: 0; min-height: 44px; padding: 0; border-radius: 22px; background: transparent; font-size: 24px; }
.menu-list { padding: 6px 0; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.menu-list button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 46px; padding: 0 16px; border: 0;
                    background: none; color: var(--text); font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.menu-list button:active { background: var(--press); }
.menu-list svg { width: 20px; height: 20px; color: var(--button); flex: none; }
