@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/manrope-latin.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 {
  --bg: #eef1f7;
  --card: rgba(255,255,255,.92);
  --border: #e5e9f2;
  --text: #141a2b;
  --muted: #5f6980;
  --brand: #3b6ef5;
  --brand-2: #6a3bf5;
  --green: #20a464;
  --red: #e5484d;
  --violet: #7c3aed;
  --radius: 18px;
  --shadow: 0 10px 40px rgba(20, 40, 90, .10);
  --glass: rgba(255,255,255,.65);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(1000px 500px at 90% -5%, rgba(107, 90, 245, .16), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(59, 110, 245, .14), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-start;   /* фиксируем верх: бейдж не «плавает» при разной высоте контента */
  justify-content: center;
  overflow: hidden;
  color: #fff;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  animation: kenburns 18s ease-in-out infinite alternate;
}
@keyframes kenburns { from { transform: scale(1) translateY(0);} to { transform: scale(1.12) translateY(-8px);} }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(16,24,50,.82) 0%, rgba(16,24,50,.55) 45%, rgba(16,24,50,.25) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  width: 100%;
  max-width: 1080px; margin: 0 auto; padding: 70px 24px 100px;
}
.hero-badge {
  display: inline-block; padding: 7px 16px; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(6px); font-size: 14px; font-weight: 600; margin-bottom: 18px;
  letter-spacing: .3px;
}
.hero h1 { margin: 0; font-size: clamp(34px, 6vw, 58px); font-weight: 800; letter-spacing: -1px; line-height: 1.05; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #ffd76a, #ff9d5c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 16px 0 0; font-size: 17px; color: rgba(255,255,255,.88); max-width: 560px; }
.hero-stats { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 28px; }
.hs { display: flex; align-items: center; gap: 9px; font-size: 14px; color: rgba(255,255,255,.92); }
.hs b { font-size: 20px; }

/* ============ LAYOUT ============ */
main {
  max-width: 1080px; margin: -60px auto 20px; padding: 0 20px 20px; position: relative; z-index: 3;
}
footer { text-align: center; margin: 30px 0 10px; color: var(--muted); font-size: 13px; }

/* ============ CARDS ============ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.card-title h2 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.card h2 { margin: 0 0 18px; font-size: 22px; letter-spacing: -.4px; }
.form-card { 
  background: var(--glass);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 20px 60px rgba(20, 40, 90, .18);
}
.form-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.form-head h2 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.f-emoji { font-size: 22px; }
h3 { margin: 18px 0 10px; }
.opt { font-weight: 500; color: var(--muted); font-size: 12px; }
.field-note { margin-top: 8px; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.field-note.error { background: linear-gradient(135deg, #ffe9e9, #ffdfdf); color: #b42318; border: 1px solid #f3c3c3; }

/* ============ EXCLUSIONS ============ */
.exclude-block { margin-top: 18px; }
.exclude-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.chip-list { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #d5dbe8;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--brand); background: #f3f7ff; }
.chip.active {
  background: linear-gradient(135deg, var(--red), #ff7a6b);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(229, 72, 77, .3);
}
.ghost-chip { background: #fff; border: 1px dashed #c0c7d6; color: var(--text); }
.ghost-chip:hover { border-color: var(--brand); color: var(--brand); background: #f6f9ff; }
.exclude-custom { margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #fafbfd; }
.fit-row { display: flex; gap: 8px; align-items: center; }
.checkbox-row { flex-wrap: wrap; gap: 12px; row-gap: 10px; }
.macro-check {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; cursor: pointer; font-weight: 700; font-size: 14px;
  transition: border-color .15s, background .15s;
}
.macro-check:hover { border-color: var(--brand); }
.macro-check:has(input:checked) { border-color: var(--brand); background: linear-gradient(135deg, #eef3ff, #f6f0ff); }
.macro-check input { width: auto; accent-color: var(--brand); }
.fit-row input { flex: 1; }
.exclude-custom .chip-list { margin-top: 10px; }

/* summary top row */
.summary-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.summary-top .card-title { margin-bottom: 0; }

/* ============ FORM ============ */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; align-items: start; }
/* вариант .grid: колонки одинаковой ширины, поля и подписи выровнены по нижнему краю */
.fit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; align-items: end; margin-top: 18px; }
label { font-size: 14px; color: var(--text); display: flex; flex-direction: column; gap: 7px; font-weight: 600; }
label.checkbox { flex-direction: row; align-items: center; gap: 9px; font-weight: 600; }
label.checkbox input { width: auto; accent-color: var(--brand); }
input, select {
  padding: 12px 14px;
  border: 1px solid #d5dbe8;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  color: var(--text);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(59, 110, 245, .15);
}

/* ============ BUTTONS ============ */
.actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions .addr { flex: 1 1 260px; min-width: 0; }
button {
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .1s, box-shadow .2s, background .2s, filter .2s;
}
button:active { transform: translateY(1px) scale(.99); }
.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(59, 110, 245, .35);
}
.primary:hover { filter: brightness(1.06); box-shadow: 0 14px 30px rgba(59, 110, 245, .4); transform: translateY(-1px); }
.primary:disabled { opacity: .6; box-shadow: none; transform: none; cursor: not-allowed; }
.ghost { background: #fff; border-color: #d5dbe8; color: var(--text); }
.ghost:hover { border-color: var(--brand); color: var(--brand); background: #f6f9ff; }

/* ============ STORES ============ */
.store-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.store-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px;
  cursor: pointer; background: #fff; transition: border-color .15s, transform .1s, box-shadow .2s;
}
.store-item:hover { border-color: var(--brand); transform: translateX(3px); box-shadow: var(--shadow); }
.store-item.selected { border-color: var(--brand); background: linear-gradient(135deg, #eef3ff, #f6f0ff); box-shadow: inset 0 0 0 1.5px var(--brand); }
.store-name { font-weight: 800; font-size: 16px; }
.store-meta { color: var(--muted); font-size: 13px; }
.store-item input[type="checkbox"] {
  flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer;
}
.store-item > div { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }

/* ============ FEEDBACK ============ */
.error {
  background: linear-gradient(135deg, #ffe9e9, #ffdfdf);
  color: #b42318; padding: 14px 16px; border-radius: 12px; margin-top: 16px;
  border: 1px solid #f3c3c3; font-weight: 500;
}
.loading { color: var(--brand); margin-top: 16px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.loading::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* ============ SUMMARY ============ */
.summary { background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(245,248,255,.9)); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.summary-cell {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px; padding: 16px;
  box-shadow: 0 4px 14px rgba(20,40,90,.06);
}
.summary-cell .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.summary-cell .value { font-size: 24px; font-weight: 800; margin-top: 5px; letter-spacing: -.5px; }

/* ============ MENU ============ */
.menu-day { margin-bottom: 16px; animation: up .35s ease both; }
@keyframes up { from { opacity: 0; transform: translateY(12px);} to { opacity: 1; transform: none;} }
.day-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 17px 20px; background: linear-gradient(135deg, #fff, #f7f9ff);
  border: 1px solid var(--border); border-radius: 14px; cursor: pointer; font-weight: 800;
  box-shadow: var(--shadow); transition: border-color .15s, transform .1s;
}
.day-head:hover { border-color: var(--brand); transform: translateX(2px); }
.day-title { font-size: 17px; }
.day-kcal { font-size: 13px; color: var(--muted); font-weight: 700; }
.day-legend { font-size: 12px; color: var(--muted); margin-left: auto; }
.chev { color: var(--muted); font-size: 14px; transition: transform .2s; margin-left: 4px; }
.day-body { padding: 16px 2px 0; }
.day-body.open, .meal-body.open { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(-4px);} to { opacity: 1; transform: none;} }

.person-block { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; align-items: start; }
.meal-row-label {
  font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); margin: 16px 0 10px; padding-top: 4px;
}
.meal-row-label:first-child { margin-top: 0; }
@media (max-width: 640px) { .person-block { grid-template-columns: 1fr; } }

/* meal card */
.meal {
  border: 1px solid var(--border); border-radius: 14px; background: #fff;
  overflow: hidden; box-shadow: 0 4px 16px rgba(20,40,90,.06);
  transition: box-shadow .2s, transform .1s;
}
.meal:hover { box-shadow: 0 8px 24px rgba(20,40,90,.1); }
.meal-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; cursor: pointer; }
.meal-head:hover { background: #f8faff; }
.meal-t { font-weight: 700; font-size: 14px; flex: 1; }
.meal-kcal {
  font-size: 13px; font-weight: 800; white-space: nowrap; color: var(--brand);
  background: #eaf0ff; padding: 3px 10px; border-radius: 999px;
}
.meal-body { padding: 0 16px 14px; color: var(--text); }
.meal .sub { font-size: 13px; color: var(--violet); margin: 4px 0 8px; font-weight: 700; }
.meal .kbju { font-size: 13px; color: var(--muted); margin: 8px 0; }
.meal .ing { font-size: 13px; line-height: 1.6; }
.meal .ing b { color: var(--text); }
.meal .recipe { font-size: 13px; line-height: 1.6; border-top: 1px dashed var(--border); padding: 10px 0 2px; margin-top: 6px; }
.meal .recipe b { color: var(--text); }
.meal-shared { margin-bottom: 14px; }
.meal .split { font-size: 13px; line-height: 1.5; margin: 10px 0 6px; }
.meal .split-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--border); align-items: baseline; }
.meal .split-who { font-weight: 800; }
.meal .split-what .sub { display: block; margin: 2px 0 0; }
.meal .split-kbju { color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) { .meal .split-row { grid-template-columns: 36px 1fr; } .meal .split-kbju { grid-column: 2; white-space: normal; } }
.day-body, .meal-body { display: none; }
.day-body.open, .meal-body.open { display: block; }

/* ============ TABLE ============ */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 700; font-size: 13px; }
tr:hover td { background: #f8faff; }
.num { text-align: right; }
tfoot td { font-weight: 800; border-top: 2px solid var(--border); font-size: 17px; background: #f7f9ff; }

@media (max-width: 560px) {
  .hero { min-height: 320px; }
  .card { padding: 20px; }
}
/* meal icon (эмодзи блюда) */
.meal-icon { margin-right: 4px; }

/* корзина-чек */
.card-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.count-badge {
  font-size: 13px; font-weight: 800; color: var(--green);
  background: #e8f8ef; padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
button.ghost.small { padding: 7px 12px; font-size: 13px; }
#basketOut td > input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
#basketOut tr.cat-head td {
  background: #f3f6ff; font-weight: 800; color: var(--text);
  padding: 10px 10px 8px; border-bottom: 1px solid var(--border); font-size: 14px;
}
#basketOut .cat-sub { color: var(--muted); font-weight: 700; font-size: 13px; }
#basketOut tr.cat-head:hover td { background: #f3f6ff; }
#basketOut tbody tr td:first-child { width: 34px; }

/* ============ FIND PAGE ============ */
.suggest-row { margin-top: 18px; }
.recipe-title { margin: 0 0 6px; font-size: 24px; font-weight: 800; }
.recipe-reason { color: var(--muted); margin: 0 0 12px; font-style: italic; }
.recipe-ing, .recipe-steps { margin-top: 14px; line-height: 1.6; }
.steps-text { white-space: pre-line; }
.recipe-ing ul { margin: 8px 0 0; padding-left: 20px; }
.kbju-note { color: var(--muted); font-size: 12px; margin-top: 4px; }
#fResult .kbju { font-weight: 800; color: var(--brand); margin-top: 4px; }
.find-opts { margin-top: 18px; }
.find-list { display: flex; flex-direction: column; gap: 16px; }
.find-card { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.find-card .actions { margin-top: 12px; }
.find-badge { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; background: #eef3ff; color: var(--brand); font-size: 12px; font-weight: 700; }
#fUnknown { margin-bottom: 14px; }

/* ссылка-кнопка (главные кнопки grid) */
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 22px; border-radius: 12px;
  font-weight: 700; text-decoration: none; font-size: 15px;
  background: linear-gradient(135deg, var(--red), #ff8a6b);
  color: #fff; box-shadow: 0 10px 24px rgba(229, 72, 77, .3);
  transition: filter .2s, transform .1s;
}
.link-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ============ TOP NAV (вкладки) ============ */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: flex-start; gap: 10px;
}
.brand { font-weight: 800; font-size: 18px; text-decoration: none; color: var(--text); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 37px; }
.tabs { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tab {
  flex: 0 0 auto;
  padding: 9px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  color: var(--text); border: 1px solid transparent;
  transition: all .15s; background: transparent; white-space: nowrap;
}
.tab:hover { background: #f1f5ff; color: var(--brand); }
.tab.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 6px 16px rgba(59,110,245,.3);
}

/* ============ SUMMARY BTNS ============ */
.summary-btns { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ SUB RESULT CARDS (добор/остаток/замена) ============ */
.sub-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sub-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; box-shadow: 0 4px 14px rgba(20,40,90,.06);
}
.sub-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sub-name { font-weight: 800; font-size: 16px; }
.sub-amt { font-size: 13px; font-weight: 800; color: var(--brand); background: #eaf0ff; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.sub-reason { font-size: 13px; color: var(--muted); font-style: italic; }
.sub-meta { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ============ КНИГА РЕЦЕПТОВ ============ */
.filter-fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin: 0; }
.filter-fieldset legend { font-weight: 700; font-size: 13px; padding: 0 6px; color: var(--text); }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.recipe-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: transform .12s, box-shadow .12s; }
.recipe-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,40,90,.12); }
.recipe-head { display: flex; align-items: center; gap: 12px; }
.recipe-icon { font-size: 34px; line-height: 1; }
.recipe-title h3 { margin: 0; font-size: 17px; letter-spacing: -.3px; line-height: 1.25; }
.recipe-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.recipe-body h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.recipe-ing { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.recipe-ing li { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; border-bottom: 1px dashed var(--border); padding-bottom: 4px; }
.recipe-ing b { color: var(--brand); font-weight: 700; white-space: nowrap; }
.cook-toggle {
  margin-top: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: #f7f9ff; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text);
  transition: all .15s;
}
.cook-toggle:hover { border-color: var(--brand); color: var(--brand); background: #f1f5ff; }
.cook-text { display: none; white-space: pre-line; margin-top: 10px; padding: 12px; border-radius: 10px; background: #f7f9ff; border: 1px solid var(--border); font-size: 13.5px; line-height: 1.6; color: var(--text); }
.cook-text.open { display: block; }
.chip-chip-active, .chip.chip-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff !important; border-color: transparent;
  box-shadow: 0 6px 16px rgba(59,110,245,.3);
}
.muted { color: var(--muted); }
.muted.small { font-size: 13px; margin-top: 10px; }

/* ============ ТАБЛИЦА КОРЗИНЫ (горизонтальный скролл на узких экранах) ============ */
#basketOut { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#basketOut table { min-width: 460px; }

/* ============ ФОКУС С КЛАВИАТУРЫ ============ */
:focus-visible {
  outline: 3px solid rgba(59, 110, 245, .55);
  outline-offset: 2px;
  border-radius: 8px;
}
input:focus-visible, select:focus-visible { outline: none; }

/* ============ АДАПТИВНАЯ ШАПКА ============ */
@media (max-width: 720px) {
  .topnav { position: static; }
  .topnav-inner { padding: 10px 14px; flex-wrap: wrap; justify-content: space-between; }
  .brand { font-size: 17px; }
  .tabs { order: 3; flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .tab { padding: 8px 10px; text-align: center; white-space: normal; }
}
@media (max-width: 560px) {
  .hero-inner { padding: 46px 18px 84px; }
  .hero h1 { font-size: clamp(30px, 10vw, 42px); }
  .hero p { font-size: 15.5px; }
  .hero-stats { gap: 14px 18px; margin-top: 22px; }
  main { padding: 0 14px 16px; }
  footer { font-size: 14px; }
}

/* ============ АНИМАЦИИ: уважение к prefers-reduced-motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-bg { animation: none; transform: none; }
}

/* ============ АККАУНТ, ДОКУМЕНТЫ, COOKIE ============ */
.nav-account {
  flex: 0 0 auto; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  text-decoration: none; color: var(--brand); border: 1px solid var(--brand); white-space: nowrap;
}
.nav-account:hover { background: #f1f5ff; }
.auth-main { margin-top: 32px; max-width: 720px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card form .actions { margin-top: 4px; }
.auth-title { margin: 0 0 14px; font-size: 26px; letter-spacing: -.5px; }
.auth-sub { margin: 28px 0 12px; font-size: 18px; }
.auth-links { margin-top: 16px; font-size: 14px; }
.auth-card a, .legal-doc a, .footer-links a { color: var(--brand); }
.consent-check { align-items: flex-start; font-weight: 500; line-height: 1.45; }
.consent-check input { margin-top: 3px; }
.notice {
  background: #e8f8ef; color: #12663d; padding: 14px 16px; border-radius: 12px; margin-top: 16px;
  border: 1px solid #bfe8d0; font-weight: 600;
}
button.danger { background: #fff; border-color: #f3c3c3; color: #b42318; }
button.danger:hover { background: #fff1f1; border-color: var(--red); }
.legal-doc h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.5px; }
.legal-doc h2 { margin: 24px 0 8px; font-size: 18px; }
.legal-doc p, .legal-doc li { font-size: 15px; line-height: 1.6; }
.legal-doc ul, .legal-doc ol { padding-left: 22px; }
.footer-links { margin-top: 6px; }
.cookie-notice {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 13.5px;
}
.cookie-notice a { color: var(--brand); }
@media (max-width: 560px) {
  .cookie-notice { flex-direction: column; align-items: stretch; }
  .nav-account { padding: 8px 12px; }
}


/* ============ ИЗБРАННОЕ (сердечко) ============ */
.fav-row { display: flex; justify-content: flex-end; margin-top: 4px; }
.fav-btn {
  padding: 7px 12px; font-size: 13px; border-radius: 999px; background: #fff;
  border: 1px solid #f3c3c7; color: #c4323a; font-weight: 700;
}
.fav-btn:hover { background: #fff3f4; border-color: var(--red); }
.fav-btn.is-fav { background: #fff0f1; border-color: var(--red); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80;
  background: #141a2b; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(20,26,43,.3); max-width: calc(100vw - 32px);
}
.toast a { color: #9db8ff; }

/* ============ ЛИЧНЫЙ КАБИНЕТ ============ */
.cab, .cab-dialog { --m-p: #3b6ef5; --m-f: #f5a524; --m-c: #20a464; }
.cab { margin-top: 24px; }
.cab-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cab-avatar {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 28px; font-weight: 800;
  box-shadow: 0 10px 24px rgba(59,110,245,.3);
}
.cab-who { flex: 1 1 220px; min-width: 0; }
.cab-who h1 { margin: 0; font-size: 26px; letter-spacing: -.5px; }
.cab-who .muted { font-size: 14px; overflow-wrap: anywhere; }
.cab-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.cab-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 104px;
  padding: 10px 14px; border-radius: 14px; background: #f5f7fc; border: 1px solid var(--border); color: var(--text); text-align: left;
}
.cab-stat:hover { border-color: var(--brand); background: #f1f5ff; }
.cab-stat b { font-size: 22px; line-height: 1.1; }
.cab-stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.cab-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 4px; padding: 6px;
  background: var(--glass); border: 1px solid var(--border); border-radius: 16px; backdrop-filter: blur(8px);
}
.cab-tabs button {
  flex: 1 1 auto; padding: 10px 14px; border-radius: 12px; border: 0; background: transparent;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.cab-tabs button:hover { background: #fff; color: var(--brand); }
.cab-tabs button.active { background: #fff; color: var(--brand); box-shadow: 0 4px 14px rgba(20,40,90,.10); }
.cab-panel { margin-top: 14px; }
.cab-panel[hidden] { display: none; }
.cab-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cab-toolbar input[type=search] { flex: 1 1 240px; width: auto; }
.cab-kbju { font-size: 13px; font-weight: 700; color: var(--brand); background: #f1f5ff; border-radius: 10px; padding: 7px 10px; }
.cab-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.cab-card-actions .is-on { border-color: var(--green); color: var(--green); background: #effaf4; }
.cab-del { margin-left: auto; }
.cab-empty { text-align: center; padding: 36px 20px; margin-top: 16px; }
.cab-empty h3 { margin: 6px 0; }
.cab-empty p { max-width: 520px; margin: 0 auto 16px; }
.cab-empty a { color: var(--brand); }
.cab-empty-icon { font-size: 44px; }

.cab-shop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.cab-shop h2 { font-size: 20px; margin: 0 0 6px; }
.cab-picks { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.cab-picks li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.cab-pick-title { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 14px; }
.cab-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.cab-stepper button { border: 0; background: #f5f7fc; padding: 4px 10px; font-size: 16px; border-radius: 0; color: var(--text); }
.cab-count { min-width: 26px; text-align: center; font-weight: 800; }
.muted.small.cab-portion-label { margin: 0; }
.cab-shop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cab-cost { font-size: 20px; font-weight: 800; color: var(--green); }
.cab-cat { margin-top: 14px; }
.cab-cat-head { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.cab-buy { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 7px 2px; font-weight: 500; font-size: 14px; border-bottom: 1px dashed var(--border); }
.cab-buy input { width: auto; accent-color: var(--green); }
.cab-buy span:nth-of-type(1) { flex: 1 1 auto; }
.cab-buy .muted.small { margin: 0; }
.cab-buy.done span:nth-of-type(1) { text-decoration: line-through; color: var(--muted); }
.cab-settings { max-width: 640px; }

.cab-x { border: 0; background: transparent; color: var(--muted); padding: 6px 8px; font-size: 14px; border-radius: 8px; }
.cab-x:hover { background: #fff1f1; color: var(--red); }
.cab-dialog {
  width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0;
  border-radius: 20px; box-shadow: 0 30px 80px rgba(20,26,43,.35); color: var(--text); background: #fff;
}
.cab-dialog::backdrop { background: rgba(20,26,43,.45); backdrop-filter: blur(3px); }
.cab-dialog form { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.cab-dialog-head { display: flex; align-items: center; justify-content: space-between; }
.cab-dialog-head h2 { margin: 0; font-size: 22px; }
.cab-dialog-actions { justify-content: flex-start; }
.cab-editor { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; }
.cab-editor-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cab-field { display: flex; flex-direction: column; gap: 7px; }
.cab-label { font-size: 14px; font-weight: 600; }
.cab-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.cab-row .cab-field { flex: 1 1 260px; }
.cab-portions { width: 110px; }
.cab-icons { display: flex; flex-wrap: wrap; gap: 6px; }
.cab-icon { width: 40px; height: 40px; padding: 0; font-size: 20px; border-radius: 12px; background: #f5f7fc; border: 1px solid transparent; }
.cab-icon.active { border-color: var(--brand); background: #eaf0ff; box-shadow: 0 0 0 3px rgba(59,110,245,.15); }
.cab-ings { display: flex; flex-direction: column; gap: 8px; }
.cab-ing { display: grid; grid-template-columns: minmax(0, 1fr) 96px 28px 34px; gap: 8px; align-items: center; }
.cab-ing.bad .cab-ing-name { border-color: var(--red); background: #fff6f6; }
.cab-ing-unit { color: var(--muted); font-weight: 700; font-size: 13px; }
#addIng { align-self: flex-start; }
.cab-dialog textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 11px 13px; border-radius: 12px; border: 1px solid #d5dbe8; resize: vertical;
}
.cab-editor-side { min-width: 0; }
.cab-live { position: sticky; top: 0; padding: 16px; border-radius: 16px; background: #f5f7fc; border: 1px solid var(--border); text-align: center; }
.cab-live-title { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.cab-ring {
  --size: 150px; width: var(--size); height: var(--size); margin: 14px auto; border-radius: 50%;
  background: conic-gradient(#e3e8f2 0 360deg); display: grid; place-content: center; justify-items: center; position: relative;
  transition: background .25s;
}
.cab-ring::before { content: ""; position: absolute; inset: 16px; border-radius: 50%; background: #f5f7fc; }
.cab-ring span, .cab-ring small { position: relative; }
.cab-ring span { font-size: 30px; font-weight: 800; line-height: 1; }
.cab-ring small { color: var(--muted); font-weight: 700; }
.cab-macros { list-style: none; padding: 0; margin: 0 0 8px; text-align: left; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.cab-macros li { display: flex; align-items: center; gap: 8px; }
.cab-macros b { margin-left: auto; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.p { background: var(--m-p); }
.dot.f { background: var(--m-f); }
.dot.c { background: var(--m-c); }

@media (max-width: 760px) {
  .cab-shop { grid-template-columns: 1fr; }
  .cab-editor { grid-template-columns: 1fr; }
  .cab-editor-side { order: -1; }
  .cab-live { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; text-align: left; padding: 12px; }
  .cab-live-title, .cab-live .muted { grid-column: 1 / -1; }
  .cab-ring { --size: 96px; margin: 0; }
  .cab-ring::before { inset: 11px; }
  .cab-ring span { font-size: 22px; }
}
@media (max-width: 560px) {
  .cab-hero { gap: 12px; }
  .cab-avatar { width: 52px; height: 52px; font-size: 22px; border-radius: 16px; }
  .cab-stats { width: 100%; }
  .cab-stat { flex: 1 1 0; min-width: 0; padding: 8px 10px; }
  .cab-tabs button { flex: 1 1 calc(50% - 6px); font-size: 13px; padding: 9px 8px; }
  .cab-dialog form { padding: 16px 14px; }
  .cab-ing { grid-template-columns: minmax(0, 1fr) 72px 24px 30px; gap: 6px; }
}

.pick-mode { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-weight: 600; font-size: 14px; }
.summary-cell .value.small { font-size: 14px; font-weight: 600; letter-spacing: 0; line-height: 1.4; }
#basketOut .offer { margin-top: 4px; font-size: 13px; line-height: 1.35; }
#basketOut .offer a { color: var(--brand); text-decoration: none; }
#basketOut .offer a:hover { text-decoration: underline; }
#basketOut .offer-brand { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: #eef3ff; color: var(--brand); font-size: 11px; font-weight: 700; }
#basketOut .offer-meta { color: var(--muted); font-size: 12px; }
#basketOut .offer-pick { margin-top: 4px; width: 100%; max-width: 360px; font-size: 12px; padding: 4px 6px; }
body.is-busy button:disabled { cursor: wait; }
.budget-over { color: #c0392b; }
