/* Кормило — «Тёплый дом»: визуальная оболочка существующих сценариев. */
:root {
  color-scheme: light;
  --cream: #f5f2e9;
  --cream-deep: #ececdd;
  --ink: #283223;
  --forest: #44543a;
  --sage: #44543a;
  --sage-soft: #dbe1cf;
  --muted: #626a5d;
  --line: #d9ddcf;
  --earth: #785842;
  --brand: #875437;
  --brand-soft: #eee2d5;
  --danger: #963f32;
  --danger-soft: #f4e6df;
  --ok: #44543a;
  --on-accent: #fbfaf3;
  --radius: 4px;
  --radius-lg: 6px;
  --radius-pill: 999px;
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: Manrope, "Segoe UI", Arial, sans-serif;
  --ease: 160ms ease;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scrollbar-gutter: stable; }
html:has(.profile-drawer:not([hidden]), .auth-drawer:not([hidden]), .manual-menu-dialog[open]) { overflow: hidden; }
body { margin: 0; min-height: 100%; background: var(--cream); color: var(--ink); font: 16px/1.6 var(--font-body); }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; cursor: pointer; font-size: 14px; line-height: 1.4; transition: color var(--ease), background var(--ease), border-color var(--ease); }
button:disabled, input:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
a { color: var(--forest); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; }
input, select, textarea { max-width: 100%; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"], input[type="range"] { accent-color: var(--forest); }
.visually-hidden, .menu-select-native { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.page-shell { min-height: 100%; }
.app { max-width: 1280px; margin: 0 auto; padding: 0 40px 64px; }

/* Исходный PNG-знак без обрезки и перекрашивания; подпись отдельным текстом. */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 24px; min-width: 0; color: inherit; text-decoration: none; }
.brand-logo { width: auto; height: 88px; object-fit: contain; flex-shrink: 0; }
.brand-tag { position: static; margin: 0; max-width: 165px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 20px; min-width: 0; }
.profile-btn, .auth-entry-btn { display: flex; align-items: center; gap: 10px; max-width: 240px; padding: 4px 0; border: 0; text-align: left; }
.profile-btn:hover, .auth-entry-btn:hover { color: var(--forest); }
.avatar, .auth-entry-avatar { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--cream-deep); color: var(--forest); font: 400 19px/1 var(--font-display); }
.profile-meta, .auth-entry-meta { display: grid; gap: 2px; min-width: 0; }
.profile-meta strong, .auth-entry-meta strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.profile-meta span, .auth-entry-meta span { color: var(--muted); font-size: 12px; }
.workspace-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 38px 0 34px; }
.eyebrow, .panel-eyebrow { margin: 0 0 10px; color: var(--forest); font-size: 12px; font-weight: 500; letter-spacing: 1.3px; text-transform: uppercase; }
.workspace-intro h1 { margin: 0; font-size: clamp(36px, 3.7vw, 50px); line-height: 1.12; letter-spacing: -1.5px; }
.workspace-intro h1 em { color: var(--forest); font-weight: 400; }
.workspace-note { margin: 0 0 3px; max-width: 330px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.workspace { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.65fr); gap: 36px; align-items: start; }
.panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.panel-head h2 { margin: 0; font-size: 26px; line-height: 1.25; letter-spacing: -.5px; }
.primary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; padding: 12px 18px; border: 1px solid var(--forest); border-radius: var(--radius); background: var(--forest); color: var(--on-accent); font-size: 14px; font-weight: 500; line-height: 1.4; text-decoration: none; }
.primary-btn:hover { background: #35432d; border-color: #35432d; color: var(--on-accent); }
.primary-btn:disabled { opacity: .5; cursor: wait; }
.ghost-btn { border-color: var(--line); color: var(--forest); font-size: 13px; font-weight: 500; }
.ghost-btn:hover { background: var(--cream-deep); border-color: #b8c2aa; }
.empty, .grocery-empty { margin: 0; padding: 16px 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.muted { color: var(--muted); }

/* Разговор: собственная прокрутка только у истории сообщений. */
.chat-panel { position: sticky; top: 24px; padding: 24px; background: var(--cream-deep); border-radius: var(--radius-lg); }
.chat-panel .panel-head { flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.chat-panel .panel-head h2 { font-size: 23px; }
.chat-header-copy { min-width: 0; }
.chat-header-copy p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.chat-panel #chat-clear { min-height: 36px; padding: 7px 0; border: 0; font-size: 12px; }
.chat-panel #chat-clear:hover { text-decoration: underline; background: transparent; }
.scroll-shell { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.scroll-viewport { min-width: 0; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #aeb8a1 transparent; }
.scroll-viewport::-webkit-scrollbar { width: 7px; height: 7px; }
.scroll-viewport::-webkit-scrollbar-thumb { border-radius: 8px; background: #aeb8a1; }
.chat-scroll { min-height: 270px; max-height: min(480px, calc(100dvh - 270px)); }
.chat-feed { display: flex; flex: 1; flex-direction: column; gap: 17px; padding: 0 6px 16px 0; }
.chat-empty { display: grid; gap: 12px; margin: auto 0; padding: 18px 0 28px; }
.chat-empty-title { margin: 0; color: var(--ink); font: 400 25px/1.25 var(--font-display); }
.chat-empty-description { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.chat-starters { display: grid; gap: 9px; margin-top: 6px; }
.chat-starter { width: 100%; min-height: 44px; padding: 10px 12px; border-color: #cbd2be; background: var(--cream); color: var(--forest); font-size: 13px; text-align: left; }
.chat-starter:hover { border-color: var(--forest); }
.bubble { max-width: 100%; padding: 13px 15px; border-radius: 5px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; }
.bubble--user { align-self: flex-end; margin-left: 18px; background: var(--cream); border-bottom-right-radius: 0; }
.bubble--assistant { align-self: flex-start; padding-left: 12px; border-left: 2px solid var(--forest); border-radius: 0; }
.bubble--error { align-self: flex-start; background: var(--danger-soft); color: var(--danger); }
.bubble-role { display: block; margin-bottom: 5px; color: inherit; font-size: 12px; font-weight: 500; letter-spacing: .8px; text-transform: uppercase; }
.chat-compose { display: grid; gap: 10px; margin-top: 10px; }
.chat-compose input { width: 100%; min-width: 0; min-height: 48px; padding: 12px; border: 1px solid #cdd3c1; border-radius: var(--radius); background: var(--cream); font-size: 15px; }
.chat-compose .primary-btn { width: 100%; justify-content: space-between; }
.chat-helper { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

/* Результаты находятся в обычном потоке страницы. */
.result { background: transparent; }
.result > .panel-head { margin: 0 0 18px; }
.result-body { min-width: 0; }
.result-tabs { display: flex; flex-wrap: wrap; gap: 30px; margin: 0 0 24px; border-bottom: 1px solid var(--line); }
.tab-btn { min-height: 46px; padding: 10px 0 13px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; }
.tab-btn:hover { color: var(--forest); }
.tab-btn.is-active, .tab-btn[aria-selected="true"] { border-bottom-color: var(--forest); color: var(--ink); }
.result-panel { display: none; min-width: 0; }
.result-panel.is-active { display: block; }
.result-panel h3 { margin: 0 0 16px; font-size: 26px; line-height: 1.3; letter-spacing: -.5px; }
.menu-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin-bottom: 14px; }
.menu-panel-head h3 { margin: 0; min-width: 0; }
.menu-eater-filter-wrap { display: block; max-width: 100%; }
.menu-eater-filter { display: block; width: 100%; min-width: 0 !important; max-width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); font-size: 13px; cursor: pointer; }
.menu-day-nav { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0 16px; }
.menu-day-btn { min-height: 42px; padding: 9px 11px; color: var(--muted); font-size: 13px; }
.menu-day-btn:hover { background: var(--cream-deep); color: var(--forest); }
.menu-day-btn[aria-pressed="true"], .menu-day-btn.is-active { border-color: var(--forest); background: var(--cream-deep); color: var(--ink); }
.menu-day-filter { width: min(240px, 100%); min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); font-size: 14px; }
.menu-list, .grocery-list { margin: 0; padding: 0; list-style: none; }
.menu-list li.menu-day-heading { margin: 28px 0 0; padding: 8px 0 13px; font: 400 25px/1.3 var(--font-display); color: var(--forest); letter-spacing: -.4px; }
.menu-list li.menu-day-heading:first-child { margin-top: 0; }
.menu-list li.menu-list-item { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: start; gap: 8px 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.menu-list-item > .menu-list-thumb { grid-column: 1; grid-row: 1 / span 2; }
.menu-list-thumb { width: 112px; height: 112px; object-fit: cover; border-radius: 3px; background: var(--cream-deep); }
.menu-list-body { display: grid; gap: 7px; min-width: 0; grid-column: 2; }
.menu-list-title { display: flex; align-items: center; gap: 15px; min-width: 0; }
.menu-list-title strong { display: block; min-width: 0; font: 400 24px/1.3 var(--font-display); letter-spacing: -.3px; overflow-wrap: break-word; }
.menu-list-meta, .menu-item-meta { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.menu-list li.menu-list-item:not(:has(> .menu-list-thumb)) { grid-template-columns: minmax(0, 1fr); }
.menu-list-item:not(:has(> .menu-list-thumb)) > .menu-list-body, .menu-list-item:not(:has(> .menu-list-thumb)) > .menu-eaters { grid-column: 1; }
.menu-eaters { display: grid; grid-column: 2; min-width: 0; gap: 0; }
.menu-eater-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px 12px; padding: 11px 0; min-width: 0; }
.menu-eater-row + .menu-eater-row { border-top: 1px solid var(--line); }
.menu-eater-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; font-size: 13px; line-height: 1.5; }
.menu-eater-info > strong { font-weight: 500; overflow-wrap: anywhere; }
.menu-portion { color: var(--muted); font-size: 13px; }
.manual-pin-label { color: var(--earth); font-size: 12px; }
.menu-list-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.menu-list-actions .ghost-btn, .menu-list-actions .pair-choice { min-height: 36px; padding: 6px 0; border: 0; background: transparent; color: var(--forest); font-size: 13px; font-weight: 500; }
.menu-list-actions .ghost-btn:hover, .menu-list-actions .pair-choice:hover { text-decoration: underline; text-underline-offset: 3px; }
.menu-list-item.is-manual-pin { border-left: 2px solid #b2926a; padding-left: 14px; }
.menu-dish-more { grid-column: 1 / -1; min-width: 0; margin: 3px 0 0; }
.menu-dish-more > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 0; color: var(--forest); font-size: 13px; list-style: none; cursor: pointer; }
.menu-dish-more > summary::-webkit-details-marker { display: none; }
.menu-dish-more > summary::before { content: "+"; font-size: 19px; line-height: 1; }
.menu-dish-more[open] > summary::before { content: "−"; }
.menu-dish-more .dish-body { display: grid; gap: 13px; margin-top: 10px; padding: 18px; border-radius: var(--radius); background: var(--cream-deep); font-size: 13px; line-height: 1.7; }
.full-composition { min-width: 0; }
.menu-dish-more .ingredients-list { display: grid; gap: 0; margin: 12px 0 0; padding: 0; list-style: none; }
.menu-dish-more .ingredient-row { display: grid; gap: 3px; padding: 11px 0; border-bottom: 1px solid #d3d8c7; }
.menu-dish-more .ingredient-row:last-child { border-bottom: 0; }
.menu-dish-more .ingredient-name { font-weight: 500; }
.menu-dish-more .ingredient-kbju, .menu-dish-more .ingredient-meta, .menu-dish-more .ingredient-weight-note, .menu-dish-more .dish-composition-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.menu-dish-more .ingredient-kbju.missing { color: var(--earth); }
.result-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.result-footer p { margin: 0; }
.result-footer .ghost-btn { border: 0; padding-inline: 0; }

/* Список продуктов: нативное включение в закупку и ручные количества. */
.grocery-list-hint { margin: 0 0 18px; }
.grocery-list li.grocery-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 17px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.grocery-row-main { display: flex; flex: 1 1 170px; align-items: center; gap: 12px; min-width: 0; }
.grocery-row-toggle { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; accent-color: var(--forest); cursor: pointer; }
.grocery-row-name { min-width: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.grocery-row.is-off .grocery-row-name { color: var(--muted); text-decoration: line-through; }
.grocery-row-amount-wrap { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.grocery-row-amount-wrap input, .grocery-row-amount-kind { width: 82px; min-height: 42px; padding: 8px 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream-deep); font-size: 14px; }
.grocery-row-amount-kind { width: auto; min-width: 54px; }
.grocery-row-unit { color: var(--muted); font-size: 13px; }
.grocery-row-amount-wrap .number-spin { width: auto; max-width: 176px; }
.grocery-add-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .5fr); align-items: end; gap: 14px; padding: 20px; margin: 8px 0 20px; background: var(--cream-deep); border-radius: var(--radius); }
.grocery-add-form .primary-btn { grid-column: 1 / -1; justify-self: start; }
.optional-panel { display: grid; gap: 9px; margin: 0 0 18px; min-width: 0; }
.optional-panel .optional-panel-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 0; border: 0; border-radius: 0; background: transparent; color: var(--forest); font-size: 13px; text-align: left; }
.optional-panel .optional-panel-toggle:hover { background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.optional-panel .optional-panel-toggle::after { content: "+"; flex-shrink: 0; font-size: 19px; line-height: 1; }
.optional-panel .optional-panel-toggle[aria-expanded="true"]::after { content: "−"; }
.optional-panel-body { min-width: 0; }
.plan-hit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.plan-hit-card { padding: 17px; border-radius: var(--radius); background: var(--cream-deep); }
.plan-hit-card h4 { margin: 0 0 8px; font-size: 21px; line-height: 1.25; }
.plan-hit-card p { margin: 0; font-size: 13px; line-height: 1.6; }
.plan-hit-card ul { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.plan-hit-card li { color: var(--muted); font-size: 12px; line-height: 1.6; }
.plan-hit-card li.is-ok { color: var(--forest); }
.plan-hit-card li.is-miss { color: var(--earth); }

/* Магазин и все динамические состояния существующего адаптера. */
.cart-box { display: grid; gap: 18px; justify-items: start; min-width: 0; }
.cart-box > .empty { max-width: 560px; padding-top: 0; }
.cart-status { width: 100%; margin: 0; padding: 14px 18px; border-left: 2px solid var(--forest); background: var(--cream-deep); font-size: 14px; line-height: 1.7; }
.cart-status[data-state="error"] { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.cart-extra-links { display: flex; flex-wrap: wrap; gap: 12px; }
.cart-extra-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--forest); border-radius: var(--radius); text-decoration: none; }
.cart-shop-picker { display: grid; gap: 10px; width: 100%; }
.cart-shop-picker-title { margin: 0; color: var(--muted); font-size: 13px; font-weight: 500; }
.shop-list { display: grid; gap: 10px; width: 100%; margin: 0; padding: 0; list-style: none; }
.shop-list-item { margin: 0; min-width: 0; }
.shop-list-btn { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 68px; padding: 17px; border: 1px solid var(--line); background: var(--cream-deep); text-align: left; }
.shop-list-btn:hover { border-color: var(--forest); }
.shop-list-logo { width: auto; height: 25px; max-width: 160px; object-fit: contain; }
.shop-list-name { font-size: 16px; font-weight: 500; }
#vv-cart-host.vv-cart-match-host { display: grid; width: 100%; min-width: 0; gap: 16px; color: var(--ink); font: 14px/1.65 var(--font-body); }
#vv-cart-host .grocery-empty { margin: 0; font-size: 14px; }
#vv-cart-host .vv-cart-total { margin: 0; padding: 8px 0; color: var(--forest); font: 400 27px/1.3 var(--font-display); font-variant-numeric: tabular-nums; }
#vv-cart-host .vv-cart-list { display: grid; gap: 16px; width: 100%; margin: 0; padding: 0; list-style: none; }
#vv-cart-host .vv-cart-row { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream-deep); font-size: 13px; line-height: 1.6; }
#vv-cart-host .vv-cart-row.is-error { background: var(--danger-soft); color: var(--danger); border-color: #d8b9aa; }
#vv-cart-host .vv-cart-row.is-error .vv-cart-row-title { color: var(--danger); }
#vv-cart-host .vv-cart-row.is-empty { border-color: #c9cdbf; }
#vv-cart-host .vv-cart-row.is-unpicked { border-style: dashed; border-color: #8c9b7d; }
#vv-cart-host .vv-cart-row-title { margin: 0 0 5px; color: var(--ink); font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
#vv-cart-host .vv-cart-row-meta, #vv-cart-host .vv-cart-row-stats { margin: 0 0 5px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#vv-cart-host .vv-cart-row-product { margin: 10px 0 0; font-size: 13px; overflow-wrap: anywhere; }
#vv-cart-host .vv-cart-row-note { margin: 9px 0 0; color: var(--earth); font-size: 12px; }
#vv-cart-host .vv-cart-candidates, #vv-cart-host .vv-cart-candidates-order { display: grid; gap: 10px; margin: 13px 0; padding: 0; }
#vv-cart-host .vv-cart-candidates { list-style: none; }
#vv-cart-host .vv-cart-candidates-order { padding-left: 18px; color: var(--muted); font-size: 12px; }
#vv-cart-host .vv-cart-candidate-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
#vv-cart-host button.vv-cart-candidate { flex: 1 1 240px; width: 100%; min-width: 0; min-height: 46px; padding: 12px; border: 1px solid #cbd2be; background: var(--cream); color: var(--ink); font: 400 13px/1.6 var(--font-body); text-align: left; overflow-wrap: anywhere; }
#vv-cart-host button.vv-cart-candidate:hover { border-color: var(--forest); }
#vv-cart-host button.vv-cart-candidate.is-chosen { border-color: var(--forest); background: #e2e7d7; color: var(--forest); }
#vv-cart-host .vv-cart-candidate-packs { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; max-width: 100%; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#vv-cart-host input.vv-cart-packs-input { width: 62px; min-height: 44px; margin: 0; padding: 8px; border: 1px solid #bdc7ad; border-radius: var(--radius); background: var(--cream); color: var(--ink); font-size: 14px; text-align: center; appearance: textfield; }
#vv-cart-host input.vv-cart-packs-input::-webkit-outer-spin-button, #vv-cart-host input.vv-cart-packs-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#vv-cart-host .vv-cart-banner { margin: 0; padding: 15px 18px; border-left: 2px solid var(--danger); border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-size: 13px; line-height: 1.7; }
#vv-cart-host .vv-cart-urls { display: flex; flex-wrap: wrap; gap: 12px; }
#vv-cart-host .vv-cart-urls a { padding: 11px 16px; border: 1px solid var(--forest); border-radius: var(--radius); background: var(--forest); color: var(--on-accent); text-decoration: none; overflow-wrap: anywhere; }
#vv-cart-host .manual-badge, #vv-cart-host .manual-override-badge { display: inline-block; margin-left: 6px; padding: 2px 6px; border: 1px solid #d5c4ad; border-radius: 2px; color: var(--earth); font-size: 12px; font-weight: 400; }
#vv-cart-host .vv-match-progress { padding: 20px 0; color: var(--forest); font-size: 14px; }
#vv-cart-host .vv-match-status { margin: 0; font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
#vv-cart-host .vv-match-log-unavailable { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
#vv-cart-host .vv-match-log-tail { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
#vv-cart-host .vv-match-log-tail .is-error { color: var(--danger); }
#vv-cart-host .vv-match-log-tail .is-warn { color: var(--earth); }

/* Профиль и анкета семьи. */
.profile-drawer { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: flex-end; }
.profile-backdrop, .auth-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: rgba(40, 50, 35, .35); }
.profile-sheet { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(520px, 100%); height: 100%; min-width: 0; border-left: 1px solid var(--line); background: var(--cream); box-shadow: -18px 0 60px rgba(40, 50, 35, .12); }
.profile-sheet-head, .auth-sheet-head { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 25px 26px 20px; border-bottom: 1px solid var(--line); }
.profile-sheet-head h2, .auth-sheet-head h2 { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -.7px; }
.profile-sheet-sub, .auth-sheet-sub { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.profile-sheet-head .ghost-btn, .auth-sheet-head .ghost-btn { flex-shrink: 0; min-height: 40px; padding: 8px 10px; }
.profile-scroll, .auth-scroll { flex: 1; min-height: 0; }
.profile-body { display: grid; flex: 1; align-content: start; gap: 24px; padding: 22px 26px 36px; }
.profile-view { display: grid; align-content: start; gap: 22px; min-width: 0; }
.profile-eater-hero { display: grid; justify-items: center; gap: 12px; padding: 6px 0 12px; text-align: center; }
.profile-eater-hero-img { width: 88px; height: 88px; border-radius: 6px; object-fit: cover; }
.profile-eater-hero-name { margin: 0; color: var(--forest); font: 400 26px/1.25 var(--font-display); }
.profile-block { display: grid; gap: 18px; padding: 7px 0 24px; border-bottom: 1px solid var(--line); }
.profile-block h3 { margin: 0; color: var(--forest); font-size: 24px; line-height: 1.3; }
.field-label-text, .field label { display: block; color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.6; }
.field-grid, .kbju-plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; min-width: 0; }
.field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.field input, .field select, .auth-input { width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; border: 1px solid #cbd1c0; border-radius: var(--radius); background: #fbf9f1; color: var(--ink); font-size: 15px; line-height: 1.5; }
.field-hint, .kbju-rec-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.kbju-rec-hint { font-size: 12px; }
.profile-back { justify-self: start; border: 0; padding-inline: 0; }
.eater-list-scroll { max-height: 330px; }
.eater-list { display: grid; gap: 9px; }
.eater-list-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 11px 12px; background: var(--cream-deep); text-align: left; }
.eater-list-btn:hover { border-color: var(--forest); }
.eater-list-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 4px; object-fit: cover; }
.eater-list-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.eater-list-hint, .eater-list-btn > span { color: var(--muted); font-size: 12px; }
.eater-list-rename { flex: 1; min-width: 0; width: 100%; min-height: 40px; padding: 8px; border: 1px solid var(--forest); border-radius: var(--radius); background: var(--cream); font-size: 14px; }
.eater-add-btn { width: 100%; margin-top: 5px; border-color: var(--forest); color: var(--forest); }
.eater-add-btn:disabled { display: none; }
.family-pick-menu { position: absolute; z-index: 5; display: grid; gap: 5px; max-height: min(420px, 60dvh); padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); box-shadow: 0 12px 36px rgba(40, 50, 35, .15); overflow: auto; }
.family-pick-heading { margin: 6px 6px 3px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .8px; text-transform: uppercase; }
.family-pick-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 9px; border: 0; border-radius: 3px; text-align: left; font-size: 14px; }
.family-pick-option:hover { background: var(--cream-deep); }
.family-pick-icon { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 3px; object-fit: cover; }
.kitchen-equipment, .checks { display: flex; flex-wrap: wrap; gap: 8px; }
.kitchen-equip-btn { min-height: 42px; padding: 10px 12px; color: var(--muted); font-size: 13px; }
.kitchen-equip-btn.is-selected { border-color: var(--forest); background: var(--cream-deep); color: var(--forest); }
.check { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font-size: 13px; cursor: pointer; }
.check:has(input:checked) { border-color: var(--forest); background: var(--cream-deep); color: var(--forest); }
.check input { flex: 0 0 17px; width: 17px; height: 17px; margin: 0; }
.cart-pick-field { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; }
.survey-open-btn { width: 100%; margin-top: 4px; }

/* Выпадающие списки и прежние обработчики числовых полей. */
.menu-select { position: relative; width: 100%; min-width: 0; }
.field select.menu-select-native { width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.menu-select-trigger { position: relative; width: 100%; min-height: 46px; padding: 11px 36px 11px 12px; border: 1px solid #cbd1c0; border-radius: var(--radius); background: #fbf9f1; text-align: left; font-size: 15px; overflow-wrap: anywhere; }
.menu-select-trigger::after { content: ""; position: absolute; right: 15px; top: 50%; width: 7px; height: 7px; border-right: 1px solid var(--forest); border-bottom: 1px solid var(--forest); transform: translateY(-65%) rotate(45deg); pointer-events: none; }
.menu-select.is-open .menu-select-trigger::after { transform: translateY(-20%) rotate(225deg); }
.menu-select-list { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 5px); max-height: min(340px, 45dvh); margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); box-shadow: 0 10px 30px rgba(40, 50, 35, .12); list-style: none; overflow: auto; }
.menu-select-option { display: block; width: 100%; min-height: 44px; padding: 10px; border: 0; border-radius: 3px; text-align: left; font-size: 14px; }
.menu-select-option:hover { background: var(--cream-deep); }
.menu-select-option.is-selected { background: var(--forest); color: var(--on-accent); }
.number-spin { display: flex; align-items: stretch; gap: 6px; width: 100%; min-width: 0; }
.number-spin input[type="number"] { flex: 1; min-width: 0; width: 100%; appearance: textfield; -moz-appearance: textfield; }
.number-spin input[type="number"]::-webkit-outer-spin-button, .number-spin input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.number-spin-rail { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; flex: 0 0 78px; gap: 4px; }
.number-spin-btn { display: grid; place-items: center; width: 37px; min-height: 44px; padding: 0; border-color: #cbd1c0; color: var(--forest); }
.number-spin-btn:hover { background: var(--cream-deep); }
.number-spin-btn svg { display: block; width: 13px; height: 13px; }
.number-spin-btn:disabled { opacity: .35; cursor: default; }

/* Пошаговая анкета, сравнения блюд и перекусы. */
.onboarding-progress { display: grid; gap: 9px; margin: 4px 0 10px; }
.onboarding-progress-track { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.onboarding-progress-fill { width: 0; height: 100%; border-radius: inherit; background: var(--forest); transition: width 200ms ease; }
.onboarding-progress-label { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.onboarding-step { display: grid; align-content: start; gap: 20px; min-height: 230px; }
.onboarding-question { margin: 0; color: var(--forest); font-size: 28px; line-height: 1.25; letter-spacing: -.5px; }
.onboarding-step .field { margin: 0; }
.onboarding-pair-label { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.onboarding-pair-choices, .preference-pair-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.onboarding-nav { display: grid; gap: 12px; margin-top: 10px; }
.onboarding-nav-row { display: flex; justify-content: space-between; gap: 12px; }
.onboarding-keep-btn { width: 100%; }
.preference-survey { display: grid; gap: 16px; }
.preference-title { margin: 0; color: var(--forest); font: 400 26px/1.3 var(--font-display); }
.preference-pairs { display: grid; gap: 24px; }
.preference-pair { display: grid; gap: 12px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.preference-pair-label { margin: 0; color: var(--forest); font-size: 14px; font-weight: 500; }
.pair-choice { display: grid; align-content: start; gap: 9px; min-height: 44px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.pair-choice:hover { background: var(--cream-deep); }
.pair-choice.has-photo { padding: 7px; }
.pair-choice-photo { display: block; width: 100%; aspect-ratio: 1; border-radius: 2px; overflow: hidden; background: var(--cream-deep); }
.pair-choice-photo img { width: 100%; height: 100%; object-fit: cover; }
.pair-choice-photo.is-missing { min-height: 80px; background: var(--cream-deep); }
.pair-choice-caption { display: block; padding: 4px 3px; font-size: 13px; line-height: 1.5; }
.pair-choice.skip { grid-column: 1 / -1; display: block; text-align: center; }
.pair-choice.is-picked { border-color: var(--forest); background: #e2e7d7; color: var(--forest); }
.kbju-plan-fieldset, .snack-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.kbju-plan-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.kbju-plan-fieldset > .field-hint { margin-bottom: 17px; }
.snack-fieldset > .field-hint { margin: 9px 0 16px; }
.snack-dictionary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.snack-dictionary .pair-choice { min-height: 42px; padding: 9px 12px; }
.snack-search-results { display: grid; gap: 7px; margin-top: 7px; }
.snack-search-results:empty { display: none; }
.snack-search-results .pair-choice { justify-self: start; max-width: 100%; }
.snack-pile { display: grid; gap: 12px; margin-top: 18px; }
.snack-pile-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px 14px; padding: 17px; border-radius: var(--radius); background: var(--cream-deep); }
.snack-pile-name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.snack-pile-range { grid-column: 1 / -1; width: 100%; margin: 5px 0; }
.snack-pile-meta { color: var(--muted); font-size: 12px; }

/* Замена блюда — нативный dialog с исходными полями и действиями. */
.manual-menu-dialog { width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--cream); color: var(--ink); box-shadow: 0 20px 70px rgba(40, 50, 35, .18); overflow: auto; }
.manual-menu-dialog::backdrop { background: rgba(40, 50, 35, .38); }
.manual-menu-dialog h2 { margin: 0 0 13px; color: var(--forest); font-size: 29px; line-height: 1.25; letter-spacing: -.5px; }
.manual-menu-dialog .field { margin: 22px 0 14px; }
.manual-menu-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }

/* Вход, регистрация, восстановление, согласия и профиль аккаунта. */
.auth-drawer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.auth-sheet { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(480px, 100%); min-width: 0; max-height: calc(100dvh - 48px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--cream); box-shadow: 0 24px 80px rgba(40, 50, 35, .18); }
.auth-body { display: flex; flex: 1; flex-direction: column; gap: 16px; padding: 23px 26px 30px; }
.auth-lead { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.auth-oauth-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px; background: #fbf9f1; border-color: #cbd1c0; font-size: 14px; }
.auth-oauth-btn:hover { background: var(--cream-deep); border-color: var(--forest); }
.auth-oauth-btn-icon { flex-shrink: 0; width: 24px; height: 24px; object-fit: contain; }
.auth-oauth-btn-label { min-width: 0; }
.auth-divider { margin: 1px 0; color: var(--muted); font-size: 12px; letter-spacing: .7px; text-align: center; }
.auth-mode-row { display: flex; gap: 0; border-bottom: 1px solid var(--line); }
.auth-mode-chip { flex: 1; padding: 11px 7px 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); }
.auth-mode-chip.is-active { color: var(--forest); border-bottom-color: var(--forest); }
.auth-password-field { position: relative; min-width: 0; }
.field input.auth-input-password, .auth-input-password { padding-right: 92px; }
.auth-password-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 8px 7px; border: 0; background: transparent; color: var(--forest); font-size: 12px; }
.auth-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; color: var(--ink); font-size: 13px; line-height: 1.7; cursor: pointer; }
.auth-check input { flex: 0 0 17px; width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--forest); }
.auth-text-link { align-self: flex-start; min-height: 36px; padding: 5px 0; border: 0; background: transparent; color: var(--forest); font-size: 13px; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-status, .auth-error { margin: 0; padding: 14px 16px; border-radius: var(--radius); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.auth-status { background: #e2e7d7; color: var(--ok); }
.auth-error { background: var(--danger-soft); color: var(--danger); }
.auth-policy-p { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.8; }
.auth-back-btn, .auth-signout { align-self: flex-start; }

@media (min-width: 1100px) {
  .menu-eater-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .menu-eater-row > .menu-eater-info { grid-column: 1; grid-row: 1; }
  .menu-eater-row > .menu-list-actions { grid-column: 3; grid-row: 1; }
  .menu-eater-row > .menu-dish-more:not([open]) { grid-column: 2; grid-row: 1; margin: 0; }
  .menu-eater-row > .menu-dish-more[open] { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 1080px) {
  .app { padding-inline: 28px; }
  .workspace { gap: 28px; }
  .brand { gap: 17px; }
  .brand-tag { max-width: 130px; }
  .topbar-actions { gap: 16px; }
  .chat-panel { padding: 20px; }
  .menu-list li.menu-list-item { column-gap: 17px; }
  .menu-list-title strong { font-size: 23px; }
}
@media (max-width: 840px) {
  .app { padding-inline: 24px; }
  .topbar { flex-wrap: wrap; gap: 16px; }
  .brand-tag { max-width: 165px; }
  .workspace-intro { align-items: flex-start; gap: 20px; padding: 30px 0; }
  .workspace-note { max-width: 240px; font-size: 13px; }
  .workspace { display: flex; flex-direction: column; gap: 32px; }
  .result { order: 0; width: 100%; }
  .chat-panel { order: 1; position: static; width: 100%; padding: 24px; }
  .chat-scroll { min-height: 200px; max-height: 400px; }
  .chat-empty { max-width: 460px; }
  .chat-compose { display: flex; gap: 12px; }
  .chat-compose input { flex: 1; }
  .chat-compose .primary-btn { width: auto; }
  .menu-eater-filter-wrap { max-width: 240px; }
}
@media (max-width: 580px) {
  .app { padding: 0 20px 42px; }
  .topbar { gap: 13px; padding: 16px 0 18px; }
  .brand { width: 100%; gap: 20px; }
  .brand-logo { height: 70px; }
  .brand-tag { max-width: 140px; font-size: 12px; }
  .topbar-actions { justify-content: space-between; width: 100%; gap: 12px; }
  .profile-btn, .auth-entry-btn { max-width: calc(50% - 6px); }
  .avatar, .auth-entry-avatar { flex-basis: 34px; width: 34px; height: 34px; }
  .profile-meta strong, .auth-entry-meta strong { font-size: 12px; }
  .profile-meta span, .auth-entry-meta span { display: none; }
  .workspace-intro { display: block; padding: 20px 0 18px; }
  .workspace-intro h1 { font-size: 38px; line-height: 1.15; letter-spacing: -1.2px; }
  .workspace-note { max-width: none; margin: 15px 0 0; font-size: 13px; }
  .eyebrow, .panel-eyebrow { font-size: 12px; letter-spacing: 1px; }
  .result > .panel-head { margin-bottom: 12px; }
  .panel-head h2 { font-size: 25px; }
  .result-tabs { gap: 27px; margin-bottom: 21px; }
  .tab-btn { min-height: 44px; font-size: 14px; }
  .result-panel h3 { font-size: 24px; }
  .menu-panel-head { align-items: flex-start; }
  .menu-panel-head h3 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .menu-eater-filter-wrap { width: 100%; max-width: 100%; }
  .menu-eater-filter { min-height: 44px; font-size: 14px; }
  .menu-day-nav { flex-wrap: nowrap; width: 100%; max-width: 100%; min-width: 0; padding-bottom: 7px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #aeb8a1 transparent; }
  .menu-day-btn { flex: 0 0 auto; min-height: 44px; }
  .menu-list li.menu-list-item { grid-template-columns: 80px minmax(0, 1fr); gap: 12px 15px; padding: 21px 0; }
  .menu-list-item > .menu-list-thumb { grid-row: 1; }
  .menu-list-thumb { width: 80px; height: 88px; }
  .menu-list-title strong { font-size: 22px; line-height: 1.3; }
  .menu-list-meta, .menu-item-meta { font-size: 12px; }
  .menu-list-body { gap: 6px; }
  .menu-eaters { grid-column: 1 / -1; }
  .menu-eater-row { padding: 10px 0; gap: 5px 12px; }
  .menu-eater-info { gap: 3px 7px; }
  .menu-list-actions { gap: 5px 10px; }
  .menu-list-actions .ghost-btn, .menu-list-actions .pair-choice { min-height: 44px; font-size: 13px; }
  .menu-dish-more > summary { min-height: 44px; }
  .menu-dish-more .dish-body { padding: 15px; }
  .menu-list li.menu-day-heading { margin-top: 20px; font-size: 24px; }
  .result-footer { margin-top: 20px; }
  .plan-hit { grid-template-columns: 1fr; }
  .grocery-list li.grocery-row { align-items: flex-start; gap: 11px; }
  .grocery-row-main { flex-basis: 100%; }
  .grocery-row-amount-wrap { margin-left: 32px; }
  .grocery-row-amount-wrap input, .grocery-row-amount-kind { min-height: 44px; font-size: 16px; }
  .grocery-add-form { grid-template-columns: 1fr; padding: 16px; }
  .grocery-add-form .primary-btn { width: 100%; }
  .cart-box { gap: 16px; }
  .shop-list-btn { padding: 15px; }
  #vv-cart-host .vv-cart-row { padding: 15px; }
  #vv-cart-host .vv-cart-total { font-size: 25px; }
  #vv-cart-host button.vv-cart-candidate { flex-basis: 100%; font-size: 13px; }
  #vv-cart-host input.vv-cart-packs-input { font-size: 16px; }
  .chat-panel { padding: 20px; }
  .chat-compose { display: grid; }
  .chat-compose input { font-size: 16px; }
  .chat-compose .primary-btn { width: 100%; }
  .chat-empty-title { font-size: 25px; }
  .profile-sheet { width: 100%; }
  .profile-sheet-head, .auth-sheet-head { gap: 12px; padding: 21px 20px 17px; }
  .profile-sheet-head h2, .auth-sheet-head h2 { font-size: 27px; }
  .profile-sheet-head .ghost-btn, .auth-sheet-head .ghost-btn { min-height: 44px; padding-inline: 8px; }
  .profile-body { padding: 20px 20px 30px; }
  .field-grid, .kbju-plan-grid { grid-template-columns: 1fr; gap: 17px; }
  .field input, .field select, .auth-input, .menu-select-trigger { font-size: 16px; }
  .number-spin-rail { flex-basis: 92px; }
  .number-spin-btn { width: 44px; min-height: 44px; }
  .onboarding-question { font-size: 26px; }
  .onboarding-pair-choices, .preference-pair-choices { gap: 9px; }
  .pair-choice-caption { font-size: 13px; }
  .manual-menu-dialog { width: calc(100vw - 24px); padding: 24px 20px; max-height: calc(100dvh - 24px); }
  .manual-menu-dialog h2 { font-size: 27px; }
  .manual-menu-dialog-actions { display: grid; }
  .auth-drawer { padding: 12px; }
  .auth-sheet { width: 100%; max-height: calc(100dvh - 24px); }
  .auth-body { padding: 20px 20px 26px; }
  .auth-password-toggle { min-height: 44px; }
  .auth-text-link { min-height: 44px; }
}
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="range"]), select, textarea { font-size: 16px; }
  .menu-list-actions .ghost-btn, .menu-list-actions .pair-choice, .menu-dish-more > summary, .menu-day-btn, .kitchen-equip-btn, .snack-dictionary .pair-choice { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
