/* Шрифт Onest (OFL), хостится локально */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/onest-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/onest-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/onest-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/onest-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 {
    --green:      #2DBE64;
    --green-2:    #32E175;
    --ink:        #1C1C1C;
    --muted:      #AFAFAF;
    --muted-2:    #979797;
    --mint:       #D2FFE3;
    --pink:       #E5293D;
    --pink-soft:  #FFD9D9;
    --amber:      #fa5f0a;
    --line:       #F0F0F0;
    --track:      #ECECEC;
    --soft:       #F2F2F2;
    --r-card:     30px;
    --shadow:     0 8px 30px rgba(20, 40, 28, 0.06);
    --shadow-sm:  0 4px 16px rgba(20, 40, 28, 0.05);
    --btn-grad:   linear-gradient(95deg, #2DBE64 0%, #32E175 100%);
    --icon-grad:  linear-gradient(135deg, #2DBE64 0%, #32E175 100%);
    --robot-grad: linear-gradient(135deg, #7C5CFF 0%, #A99BFF 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Цвет верхушки мятного градиента: закрывает белую полосу под статус-баром
   и при оверскролле в мобильных браузерах (там проглядывает голый html). */
html { background-color: #ABEEC5; }

body {
    font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: transparent; /* холст красит html; белый даёт непрозрачный градиент ниже */
    color: var(--ink);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
/* Мятный градиент, приклеенный к вьюпорту. background-attachment: fixed
   на body в iOS Safari конфликтует с position:fixed, фиксированный
   псевдоэлемент даёт тот же вид без этой проблемы. */
body::before {
    content: ''; position: fixed; inset: 0; z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, #ABEEC5 0%, #fff 82%);
}

.container {
    max-width: 1012px;
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3 { line-height: 1.18; }

.section-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

/* ---- Hero ---- */
.hero {
    /* Градиент задан на body, hero прозрачный */
    padding: 24px 0 14px;
}

.topbar {
    background: #fff;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}
/* Логотип «Проверь СостаВВ»: «Проверь Соста» тёмным, «ВВ» зелёным —
   слитно, без пробела (VV = ВкусВилл, отсылка к бренду). */
.topbar .logo {
    color: var(--ink);
    font-weight: 800;
    font-size: 23px;
    letter-spacing: -0.2px;
}
.topbar .logo .logo-vv {
    color: var(--green);
}

.hero .container {
    position: relative;
    min-height: 380px;
}

.hero-text {
    width: 520px;
    max-width: 100%;
    margin: 0;
    padding: 32px 0 16px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -1px;
}
.hero-sub {
    margin-top: 14px;
    font-size: 17px;
    color: var(--muted-2);
    font-weight: 400;
    line-height: 1.7;
}
.hero-note {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    line-height: 1.6;
}
.hero-note .term {
    border-bottom: 1px dashed currentColor;
    cursor: help;
}
.hero-note .tooltip {
    min-width: 280px; max-width: 360px;
    font-weight: 500;
    color: #fff;
}

/* Коллаж hero: три продукта и бейдж с галочкой */
.hero-visual {
    position: absolute;
    right: 0;
    top: 80px;
    transform: none;
    width: 420px;
    height: 300px;
}
.hero-visual .hv { position: absolute; display: block; }
.hv-juice {
    width: 100px;
    left: 22px;
    top: 8px;
    transform: rotate(-9deg);
    z-index: 2;
    filter: drop-shadow(0 12px 20px rgba(20,40,28,0.16));
}
.hv-chips {
    width: 168px;
    right: 32px;
    top: 92px;
    transform: rotate(13deg);
    z-index: 1;
    filter: drop-shadow(0 12px 20px rgba(20,40,28,0.16));
}
.hv-scanner {
    width: 296px;
    right: 70px;
    top: 14px;
    z-index: 3;
    filter: drop-shadow(0 14px 24px rgba(20,40,28,0.18));
}
.hv-check {
    position: absolute;
    left: 80px;
    top: 0;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #62CE50, #84E275);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(45, 190, 100, 0.4);
    z-index: 4;
}
.hv-check svg { width: 30px; height: 30px; }

/* ---- «Зачем» ---- */
.section { padding: 22px 24px; }
.why p {
    font-size: 17px;
    color: var(--muted-2);
    line-height: 1.7;
    max-width: 520px;
}

/* ---- «Как это работает» ---- */
.howto-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.howto-card {
    background: #fff;
    border-radius: var(--r-card);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    min-height: 112px;
    display: flex;
    flex-direction: column;
}
.howto-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--icon-grad);
    display: flex;
    align-items: center;
    justify-content: center;
}
.howto-icon svg { width: 21px; height: 21px; }
.howto-card .howto-text {
    margin-top: 12px;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--muted-2);
}

/* ---- Вкладки ---- */
.tabs {
    display: flex;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 31px;
    padding: 5px;
    margin-bottom: 18px;
}
.tab {
    flex: 1;
    padding: 13px 16px;
    border: none;
    background: transparent;
    border-radius: 26px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.tab svg { width: 17px; height: 17px; flex-shrink: 0; }
.tab:hover { color: var(--green); }
.tab.active {
    background: var(--mint);
    color: var(--green);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Переключатель режима подсветки над полем ввода */
.palette-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.palette-row .palette-caption { font-size: 12px; color: var(--muted); }
.palette-switch {
    display: inline-flex;
    padding: 3px;
    background: var(--soft);
    border-radius: 999px;
    font-size: 12px;
}
.palette-switch button {
    border: none;
    background: transparent;
    padding: 6px 13px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--muted-2);
    font-family: inherit;
    font-weight: 600;
    transition: all 0.15s;
}
.palette-switch button.active {
    background: #fff;
    color: var(--green);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* ---- Поле ввода ---- */
.input-section {
    background: #fff;
    border-radius: var(--r-card);
    box-shadow: var(--shadow);
    padding: 28px;
}
textarea {
    width: 100%;
    min-height: 168px;
    border: none;
    outline: none;
    resize: vertical;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink);
    background: transparent;
}
textarea::placeholder { color: var(--muted); }

.highlighted-text {
    width: 100%;
    min-height: 120px;
    /* Большие составы не растягивают окно — фиксируем высоту, листаем внутри */
    max-height: 340px;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.85;
    cursor: text;
    overscroll-behavior: contain;
}
.highlighted-text::-webkit-scrollbar { width: 7px; }
.highlighted-text::-webkit-scrollbar-thumb { background: #D7E3DB; border-radius: 4px; }
.highlighted-text::-webkit-scrollbar-track { background: transparent; }
/* Палитра подсветки по статусам ВкусВилла */
.hl-vv-ok    { background: var(--mint);      color: #1A7D36; border-radius: 5px; padding: 2px 6px; }
.hl-vv-limit { background: #FFE6D9;          color: #fa5f0a; border-radius: 5px; padding: 2px 6px; }
.hl-vv-ban   { background: var(--pink-soft); color: #B0202F; border-radius: 5px; padding: 2px 6px; font-weight: 600; }
.hl-vv-unk   { background: var(--soft);      color: var(--muted-2); border-radius: 5px; padding: 2px 6px; }
/* Обычные ингредиенты — лёгкая прозрачная подсветка (добавки цветами выше) */
.hl-plain {
    color: var(--green); text-decoration: underline;
    text-decoration-thickness: 2px; text-underline-offset: 2px;
}
.hl-good { background: var(--mint); color: #1A7D36; border-radius: 5px; padding: 2px 6px; }
.hl-neutral { background: #FFE6D9; color: #fa5f0a; border-radius: 5px; padding: 2px 6px; }
.hl-bad { background: var(--pink-soft); color: #B0202F; border-radius: 5px; padding: 2px 6px; }

.hl-legend {
    display: flex; gap: 8px 16px; margin: 14px 0 14px;
    font-size: 12px; color: var(--muted-2); flex-wrap: wrap;
}
.hl-legend span { display: flex; align-items: center; gap: 5px; }
.hl-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }

/* ---- Кнопки ---- */
.tool-actions {
    display: flex; align-items: center; gap: 18px;
    margin-top: 14px;
}
.example-btn {
    font-family: inherit; font-size: 14px; font-weight: 600;
    color: var(--green); background: none; border: none;
    cursor: pointer; padding: 0;
}
.example-btn:hover { text-decoration: underline; }
.clear-btn {
    font-family: inherit; font-size: 14px; font-weight: 500;
    color: var(--muted); background: none; border: none;
    cursor: pointer; padding: 0;
}
.clear-btn:hover { color: var(--pink); }
.clear-btn:disabled { opacity: 0.4; cursor: default; }

.btn {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 18px;
    background: var(--btn-grad);
    color: #fff;
    border: none;
    border-radius: 18px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s, transform 0.05s;
    box-shadow: 0 10px 24px rgba(45, 190, 100, 0.28);
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--track); color: var(--muted-2); box-shadow: none; cursor: not-allowed; }

.tool-note {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}
/* Дисклеймер под кнопкой действия */
.tool-disclaimer {
    margin-top: 10px;
    /* воздух до блока результата, который появляется сразу под текстом */
    margin-bottom: 18px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}
.tool-disclaimer a { color: var(--green); font-weight: 600; text-decoration: underline; }
/* Спойлер «Как сервис использует мои данные?» */
.data-spoiler {
    max-width: 720px;
    margin: 18px auto 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0 18px;
}
.data-spoiler > summary {
    list-style: none;
    cursor: pointer;
    padding: 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}
.data-spoiler > summary::-webkit-details-marker { display: none; }
.data-spoiler > summary::before { content: "🔒"; font-size: 15px; }
.data-spoiler > summary::after {
    content: "+"; margin-left: auto; font-size: 20px; color: var(--muted); font-weight: 400;
}
.data-spoiler[open] > summary::after { content: "–"; }
.data-spoiler .spoiler-body {
    font-size: 13px;
    color: var(--muted-2, #555);
    line-height: 1.65;
    padding: 0 0 16px;
}
.data-spoiler .spoiler-body a { color: var(--green); font-weight: 600; text-decoration: underline; }

/* ---- Загрузка фото ---- */
.photo-area {
    border: 2px dashed #CDE9D6;
    border-radius: 18px;
    padding: 48px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.photo-area:hover { border-color: var(--green); background: #F4FFF8; }
.photo-area.has-image { padding: 0; border-style: solid; border-color: var(--green); }
.photo-area img { max-width: 100%; max-height: 320px; border-radius: 14px; display: block; margin: 0 auto; }
.photo-icon { font-size: 46px; margin-bottom: 12px; }
.rec-edit-btn {
    flex-shrink: 0; font-family: inherit; font-size: 13px; font-weight: 700;
    cursor: pointer; padding: 7px 14px; border-radius: 10px;
    border: 1.5px solid var(--green); background: #fff; color: var(--green);
}
.rec-edit-btn:hover { background: #F0FBF4; }
.photo-label { font-size: 15px; font-weight: 600; color: var(--ink); }
.photo-label .lbl-mobile { display: none; }
.photo-sublabel { font-size: 13px; color: var(--muted); margin-top: 4px; }
/* Кнопки «Сфотографировать / Из галереи» — только на телефоне */
.photo-actions { display: none; }

@media (max-width: 560px) {
    /* Телефон: подпись над иконкой, вместо drag-подсказки — две кнопки
       (камера и галерея), чтобы можно было выбрать источник фото. */
    .photo-area:not(.has-image) { display: flex; flex-direction: column; align-items: stretch; padding: 24px 16px; }
    .photo-label { order: -1; margin-bottom: 12px; font-size: 16px; text-align: center; }
    .photo-label .lbl-desktop { display: none; }
    .photo-label .lbl-mobile { display: inline; }
    .photo-icon { margin-bottom: 4px; align-self: center; }
    .photo-sublabel { display: none; }
    .photo-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
    .photo-act-btn {
        width: 100%; padding: 14px 16px; border-radius: 14px;
        font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
        background: var(--btn-grad); color: #fff; border: none;
    }
    .photo-act-btn.photo-act-alt {
        background: #fff; color: var(--green); border: 1.5px solid var(--green);
    }
}

/* Телефон: шаги «Как это работает» — компактный нумерованный список
   без карточек (их принимали за кнопки) и иконок. */
@media (max-width: 560px) {
    .howto-cards { display: flex; flex-direction: column; gap: 10px; counter-reset: howstep; }
    .howto-card {
        background: transparent; box-shadow: none; border-radius: 0;
        padding: 0; min-height: 0;
        flex-direction: row; align-items: baseline; gap: 8px;
    }
    .howto-icon { display: none; }
    .howto-card .howto-text { margin-top: 0; font-size: 17px; font-weight: 400; line-height: 1.7; }
    .howto-card .howto-text::before {
        counter-increment: howstep; content: counter(howstep) ". ";
        color: var(--green); font-weight: 800;
    }
}
.photo-clear {
    position: absolute; top: 10px; right: 10px;
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(0,0,0,0.55); color: #fff; border: none;
    font-size: 17px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* ---- Сравнение ---- */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
/* Колонка — flex, чтобы кнопка «Загрузить фото» прижималась к низу и
   кнопки А/Б стояли на одном уровне даже при разной длине состава. */
.compare-col { display: flex; flex-direction: column; }
.compare-col label {
    display: block; font-weight: 700; font-size: 14px;
    margin-bottom: 8px; color: var(--ink);
}
.compare-col textarea {
    min-height: 150px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
}
.compare-col textarea:focus { border-color: var(--green); }
/* Распознавание состава с фото в сравнении */
.compare-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; }
.cmp-photo-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
    padding: 8px 12px; border-radius: 10px;
    border: 1.5px solid var(--green); background: #fff; color: var(--green);
}
.cmp-photo-btn:hover { background: #F0FBF4; }
.cmp-cam { display: none; }  /* камера — только на телефоне */
.cmp-photo-status { font-size: 12px; font-weight: 600; }
.cmp-photo-status.busy { color: var(--muted-2); }
.cmp-photo-status.ok  { color: #1A7D36; }
.cmp-photo-status.err { color: #B0202F; }
@media (max-width: 560px) { .cmp-cam { display: inline-block; } }
.compare-verdict {
    background: #fff; border-radius: var(--r-card);
    box-shadow: var(--shadow); padding: 28px; margin-bottom: 20px;
}
.verdict-title { font-size: 19px; font-weight: 800; margin-bottom: 12px; }

/* Сравнительный бар-чарт: 4 категории × два бара (А/Б) */
.cmp-abkey { font-size: 13px; color: var(--muted-2); margin: -4px 0 20px; }
.cmp-abkey b { color: var(--ink); }
.cmp-metric { margin-bottom: 20px; }
.cmp-metric:last-child { margin-bottom: 0; }
.cmp-metric-title {
    font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
    text-transform: uppercase; margin-bottom: 9px;
}
.cmp-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cmp-bar-row:last-child { margin-bottom: 0; }
.cmp-track {
    position: relative; flex: 1; height: 26px;
    background: #F2F6F3; border-radius: 8px; overflow: hidden;
}
.cmp-ab {
    position: absolute; left: 0; top: 0; height: 100%;
    min-width: 26px; display: flex; align-items: center; justify-content: center;
    padding: 0 7px; color: #fff; font-size: 12px; font-weight: 800;
    border-radius: 8px; z-index: 2;
}
.cmp-fill {
    height: 100%; width: 0; border-radius: 8px;
    transition: width 0.8s cubic-bezier(.25,.9,.3,1);
}
.cmp-val { min-width: 32px; text-align: left; font-size: 16px; font-weight: 800; flex-shrink: 0; }
.verdict-winner {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: 999px;
    font-weight: 700; font-size: 15px; margin-bottom: 16px;
}
.winner-tie { background: var(--soft); color: var(--muted-2); }
.winner-pick {
    background: linear-gradient(135deg, #FFF3A8, #FFD24A);
    color: #6B4500;
}
.winner-pick .winner-pick-trophy { font-size: 18px; display: inline-flex; }
.verdict-text { font-size: 15px; line-height: 1.65; color: #555; }

.compare-results { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
/* Отступ после кнопки «Сравнить» — у первого блока результатов (график) */
#compareResults > .compare-verdict:first-child { margin-top: 40px; }
/* Дисклеймер: свёрнут до первого предложения + inline «Подробнее» */
.compare-note {
    font-size: 13px; color: var(--muted-2); line-height: 1.6;
    margin: 16px 0 4px; max-width: 900px; cursor: pointer;
}
.compare-note .cn-rest { display: none; }
.compare-note.open .cn-rest { display: inline; }
.compare-note .cn-toggle {
    display: inline-flex; align-items: center; gap: 3px;
    margin-left: 6px; color: var(--green); font-weight: 700; white-space: nowrap;
}
.compare-note .cn-chev {
    width: 12px; height: 12px; transition: transform 0.2s;
}
.compare-note.open .cn-chev { transform: rotate(180deg); }
.compare-note .cn-lbl-less { display: none; }
.compare-note.open .cn-lbl-more { display: none; }
.compare-note.open .cn-lbl-less { display: inline; }
.compare-results-col {
    /* Без паддинга: контент колонки выровнен по краю кнопки */
    position: relative; padding: 0; border-radius: 14px;
    transition: transform 0.4s ease;
}
.compare-results-col h3 {
    font-size: 15px; font-weight: 700; margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 2px solid var(--green);
    display: flex; align-items: center; gap: 8px;
    height: 40px; box-sizing: border-box;
}
.compare-results-col:last-child h3 { border-color: #9B59B6; }
.compare-results-col.is-winner {
    background: linear-gradient(180deg, rgba(255,215,0,0.08), transparent 220px);
    animation: winner-rise 0.7s cubic-bezier(.2,.9,.3,1.2) both;
}
.compare-results-col.is-winner h3 { border-color: #FFB300; color: var(--ink); }
@keyframes winner-rise {
    0%   { transform: translateY(8px) scale(0.99); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
.winner-trophy {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #FFF3A8, #FFD24A 60%, #F5A623);
    font-size: 17px;
    animation: trophy-pop 0.8s cubic-bezier(.2,.8,.2,1.4) 0.15s both;
}
@keyframes trophy-pop {
    0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
    55%  { transform: scale(1.25) rotate(12deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}

/* ---- Карточки сводки ---- */
/* Сводка: две карточки в строку на всю ширину — правый край блока
   «из них добавок» совпадает с правым краем кнопки под полем ввода. */
.summary { display: flex; gap: 12px; margin: 20px 0; }
.summary-card {
    flex: 1 1 0;
    background: #fff; border-radius: 16px;
    box-shadow: var(--shadow); padding: 28px 20px; text-align: center;
}
.summary-card .number { font-size: 44px; font-weight: 800; line-height: 1; }
.summary-card .label { font-size: 15px; color: var(--muted); margin-top: 8px; }
.summary-pre { font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }

/* Карточка «всего» — тап разворачивает разбор (что посчитано ингредиентом/добавкой) */
.summary-card.ing-toggle { cursor: pointer; position: relative; user-select: none; }
.ing-caret {
    display: inline-block; margin-left: 5px; font-size: 11px; color: var(--muted);
    transition: transform .2s ease;
}
.summary-card.ing-toggle[data-open="1"] .ing-caret { transform: rotate(180deg); }

.ing-detail {
    margin: -6px 0 20px; background: #fff; border-radius: 16px;
    box-shadow: var(--shadow-sm); padding: 18px 20px;
}
.ing-detail-sec + .ing-detail-sec { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.ing-detail-h {
    font-size: 12px; font-weight: 700; color: var(--muted-2);
    letter-spacing: .03em; text-transform: uppercase; margin-bottom: 12px;
}
.ing-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ing-chip {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 14px; line-height: 1.2; padding: 7px 13px;
    border-radius: 999px; background: var(--soft); color: var(--ink);
}
.ing-chip .signal-dot { width: 9px; height: 9px; }

/* ---- График классификации ---- */
.breakdown {
    background: #fff; border-radius: var(--r-card);
    box-shadow: var(--shadow); padding: 32px;
    margin-bottom: 20px;
    display: flex; gap: 40px; align-items: center;
}
.breakdown-bars { flex: 1; }
.breakdown-title {
    font-size: 19px; font-weight: 800; margin-bottom: 24px;
    display: flex; align-items: center; gap: 8px;
}
.breakdown-title .vv-logo { display: none; }
.bar-row { display: flex; align-items: center; margin-bottom: 16px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label { width: 150px; font-size: 14px; font-weight: 600; flex-shrink: 0; line-height: 1.25; }
.bar-track {
    flex: 1; height: 10px; background: var(--track);
    border-radius: 5px; overflow: hidden; margin: 0 14px;
}
.bar-fill { height: 100%; border-radius: 5px; width: 0; transition: width 0.8s ease-out; }
.bar-fill-green   { background: var(--green); }
.bar-fill-neutral { background: var(--amber); }
.bar-fill-red     { background: var(--pink); }
.bar-fill-black   { background: var(--ink); }
.bar-count { font-size: 16px; font-weight: 700; width: 42px; text-align: right; flex-shrink: 0; }

.donut-wrap { flex-shrink: 0; position: relative; width: 140px; height: 140px; }
.donut-wrap svg { transform: rotate(-90deg); width: 100%; height: 100%; display: block; }
.donut-center {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); text-align: center;
}
.donut-center .donut-number { font-size: 32px; font-weight: 800; line-height: 1; }
.donut-center .donut-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* График внутри колонок сравнения: колонка узкая, поэтому донат
   уходит под бары, заголовок и подписи чуть компактнее. */
/* В сравнении карточки сводки — на всю ширину колонки, но пониже */
.compare-results-col .summary-card { width: auto; flex: 1 1 0; padding: 16px 18px; }
.compare-results-col .summary-card .number { font-size: 34px; }
.compare-results-col .breakdown { flex-direction: column; align-items: stretch; gap: 22px; padding: 24px; }
.compare-results-col .donut-wrap { margin: 0 auto; }
.compare-results-col .breakdown-title { font-size: 16px; margin-bottom: 18px; }
.compare-results-col .bar-label { width: 128px; font-size: 13px; }
.compare-results-col .bar-count { width: 34px; font-size: 14px; }

/* ---- Карточки добавок ---- */
.card {
    background: #fff; border-radius: var(--r-card);
    box-shadow: var(--shadow); margin-bottom: 14px;
    overflow: visible;
}
.card-header {
    display: flex; align-items: center; gap: 14px;
    padding: 28px 32px; cursor: pointer;
}
.card-body, .card-body * { user-select: text; }
.signal-dot { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; }
.signal-green     { background: var(--green); }
.signal-yellow    { background: var(--amber); }
.signal-red       { background: var(--pink); }
.signal-vv-ok     { background: var(--green); }
.signal-vv-limit  { background: var(--amber); }
.signal-vv-ban    { background: var(--pink); }
.signal-vv-unk    { background: var(--muted); }
/* код+название держим на одной строке; если не влезает — название
   переносится целиком (не разрывая код), тип переносится в 2 строки */
.card-title { flex: 1 1 auto; min-width: 0; }
.card-title .code { font-weight: 800; font-size: 18px; white-space: nowrap; }
.card-title .name { color: var(--muted); font-size: 15px; margin-left: 10px; }
.card-type {
    font-size: 14px; font-weight: 600; color: var(--muted-2);
    background: var(--soft); padding: 9px 18px; border-radius: 20px;
    white-space: normal; text-align: center; line-height: 1.25;
    flex-shrink: 0; max-width: 42%;
}
.chevron {
    color: var(--muted); font-size: 13px;
    transition: transform 0.2s; flex-shrink: 0;
}
.card.open .chevron { transform: rotate(90deg); }
.card-body { display: none; padding: 0 32px 28px; }

/* Свёрнутый список добавок в колонках сравнения */
.ing-collapse { margin-bottom: 14px; }
.ing-collapse-head {
    background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow);
    padding: 20px 24px; display: flex; align-items: center; gap: 10px;
    cursor: pointer; font-weight: 700; font-size: 15px;
}
.ing-collapse-count {
    background: var(--mint); color: #1A7D36;
    border-radius: 999px; padding: 2px 11px; font-size: 13px; font-weight: 700;
}
.ing-collapse-head .chevron { margin-left: auto; }
.ing-collapse.open .ing-collapse-head .chevron { transform: rotate(90deg); }
.ing-collapse-body { display: none; margin-top: 14px; }
.ing-collapse.open .ing-collapse-body { display: block; }
.card.open .card-body { display: block; }
.info-row { padding: 18px 0; border-top: 1px solid var(--line); }
.info-row .info-label {
    font-size: 12px; color: var(--muted); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 8px;
}
.info-row .info-value { font-size: 16px; line-height: 1.6; }
.research-source { font-size: 16px; line-height: 1.6; }
.research-source-label { font-weight: 800; color: var(--ink); margin-right: 4px; }

/* Бейджи-индикаторы */
.signal-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 15px; border-radius: 20px;
    font-size: 14px; font-weight: 600; margin-top: 8px;
}
.badge-green  { background: var(--mint); color: #1A7D36; }
.badge-yellow { background: #FFE6D9; color: #fa5f0a; }
.badge-red    { background: var(--pink-soft); color: #B0202F; }

.tr-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 9px 16px; border-radius: 20px;
    font-size: 14px; font-weight: 600;
}
.tr-banned  { background: var(--pink-soft); color: #B0202F; }
.tr-limited { background: #FFE6D9; color: #fa5f0a; }

.vv-badge {
    display: inline-flex; align-items: center; gap: 8px;
    /* левый отступ 16px — как у .tr-badge, чтобы логотип ВВ и тексты
       всех индикаторов начинались с одного отступа */
    padding: 6px 16px; border-radius: 20px;
    font-size: 14px; font-weight: 600;
}
.vv-ok    { background: var(--mint); color: #1A7D36; }
.vv-limit { background: #FFE6D9; color: #fa5f0a; }
.vv-ban   { background: var(--pink-soft); color: #B0202F; }
.vv-note { font-size: 12px; color: #8a8a8a; line-height: 1.45; max-width: 540px; }
.card-sources { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.card-source { font-size: 12px; color: #1A7D36; text-decoration: underline; text-underline-offset: 2px; }
.card-source:hover { color: #145f2a; }
.card-source-note { font-size: 12px; color: #8a8a8a; line-height: 1.45; }
.vv-logo {
    /* viewBox SVG обрезан по буквам «ВВ» (ratio ≈ 1.93) — размер задаём
       прямоугольником, чтобы буквы были не мельче текста бейджа */
    width: 2.1em; height: 1.1em; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.vv-logo svg { width: 100%; height: 100%; display: block; }

/* ---- Подсказки ---- */
.has-tooltip { position: relative; }
.has-tooltip, .has-tooltip .term, .term {
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none; cursor: pointer;
}
.tooltip {
    display: block; position: absolute;
    bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    background: var(--ink); color: #fff;
    font-size: 13px; font-weight: 400; line-height: 1.5;
    padding: 12px 14px; border-radius: 10px;
    pointer-events: none; opacity: 0; transition: opacity 0.2s;
    z-index: 10; width: max-content; min-width: 240px; max-width: 420px;
    white-space: normal; text-align: left;
}
.tooltip::after {
    content: ''; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--ink);
}
.has-tooltip:hover .tooltip,
.has-tooltip.tip-open .tooltip { opacity: 1; }
.badge-tip { display: inline-flex; align-items: center; }
/* Бейджи прижаты влево — тултип раскрываем от левого края бейджа,
   чтобы он не вылезал за край карточки на десктопе. */
.badge-tip .tooltip { left: 0; transform: none; }
.badge-tip .tooltip::after { left: 22px; transform: none; }
/* «?» рядом с бейджем — сигнал, что по нему можно нажать за расшифровкой */
.tip-q {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; margin-left: 6px; flex-shrink: 0;
    border-radius: 50%; background: #E4EFE8; color: #5E7A69;
    font-size: 11px; font-weight: 700; line-height: 1;
}
.badge-tip:hover .tip-q, .badge-tip.tip-open .tip-q { background: var(--green); color: #fff; }
.tip-end .tooltip { left: auto; right: 0; transform: none; }
/* Подсказка на заголовке «Классификация добавок во ВкусВилле» —
   заголовок у верхнего края карточки, поэтому плашку раскрываем вниз. */
.title-tip { display: inline; cursor: pointer; }
.title-tip .tip-q { vertical-align: middle; position: relative; top: -2px; }
.title-tip .tooltip { top: calc(100% + 10px); bottom: auto; left: 0; transform: none; font-weight: 400; max-width: 460px; }
.title-tip .tooltip::after { top: auto; bottom: 100%; left: 22px; transform: none; border-top-color: transparent; border-bottom-color: var(--ink); }
.title-tip:hover .tip-q, .title-tip.tip-open .tip-q { background: var(--green); color: #fff; }
.title-tip .tip-q { margin-left: 8px; }
.tip-end .tooltip::after { left: auto; right: 22px; transform: none; }

/* ---- Лоадер и ошибки ---- */
.loader { text-align: center; padding: 44px; color: var(--muted); }
.spinner {
    width: 34px; height: 34px;
    border: 3px solid var(--track); border-top-color: var(--green);
    border-radius: 50%; animation: spin 0.8s linear infinite;
    margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Анимированный лоадер-фрукт: на каждый запуск проверки подставляется
   следующая gif по кругу (см. nextLoaderHtml). Анимация внутри gif,
   CSS-вращение не нужно. */
.spinner-img {
    width: 76px; height: 76px;
    object-fit: contain;
    margin: 0 auto 14px;
    display: block;
}
.error {
    background: var(--pink-soft); color: #B0202F;
    padding: 16px 20px; border-radius: 14px;
    margin-bottom: 12px; font-size: 14px;
}

/* ---- Анимации ---- */
@keyframes fadeInUp { from { opacity:0; transform:translateY(20px);} to { opacity:1; transform:translateY(0);} }
@keyframes countUp  { from { opacity:0; transform:scale(0.5);} to { opacity:1; transform:scale(1);} }
@keyframes slideInLeft  { from { opacity:0; transform:translateX(-30px);} to { opacity:1; transform:translateX(0);} }
@keyframes slideInRight { from { opacity:0; transform:translateX(30px);} to { opacity:1; transform:translateX(0);} }
.anim-fade-up    { animation: fadeInUp 0.5s ease-out both; }
.anim-count      { animation: countUp 0.4s ease-out both; }
.anim-slide-left { animation: slideInLeft 0.5s ease-out both; }
.anim-slide-right{ animation: slideInRight 0.5s ease-out both; }

/* ---- Вопросы и ответы ---- */
.qa-list { display: flex; flex-direction: column; gap: 14px; }
.qa-item {
    background: #fff; border-radius: var(--r-card);
    box-shadow: var(--shadow);
}
.qa-item summary {
    list-style: none; cursor: pointer;
    padding: 26px 32px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 20px; font-weight: 600; font-size: 16px;
}
.qa-item summary::-webkit-details-marker { display: none; }
.qa-item summary::after {
    content: '+'; font-size: 26px; font-weight: 400;
    color: var(--green); transition: transform 0.2s; flex-shrink: 0;
    line-height: 1;
}
.qa-item[open] summary::after { content: '−'; }
.qa-item .qa-answer {
    padding: 0 32px 26px; color: #555;
    font-size: 15px; line-height: 1.7;
}

/* ---- Футер ---- */
.disclaimer {
    margin-top: 56px;
    background: var(--green);
    color: #fff;
    text-align: center;
    padding: 52px 24px;
}
.disclaimer h3 { font-size: 26px; font-weight: 800; margin-bottom: 12px; }
.disclaimer p {
    font-size: 16px; line-height: 1.6;
    color: rgba(255,255,255,0.92);
    max-width: 640px; margin: 0 auto;
}
.footer-link { color: #fff; text-decoration: underline; font-weight: 600; }
.footer-link:hover { opacity: 0.85; }

/* Cookie-баннер */
.cookie-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1100;
    max-width: 760px; margin: 0 auto;
    background: #fff; border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,0.20);
    padding: 16px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    font-size: 14px; color: var(--ink);
}
/* display:flex на .cookie-banner перебивает UA-правило [hidden]{display:none},
   поэтому явно прячем при атрибуте hidden (иначе «Хорошо» не скрывает баннер) */
.cookie-banner[hidden] { display: none; }
.cookie-text { flex: 1; min-width: 220px; line-height: 1.5; }
.cookie-text a { color: var(--green); font-weight: 600; }
.cookie-accept {
    flex-shrink: 0; border: none; cursor: pointer;
    background: var(--btn-grad); color: #fff; font-family: inherit;
    font-weight: 700; font-size: 14px; padding: 11px 24px; border-radius: 12px;
}
.cookie-accept:hover { filter: brightness(1.04); }
@media (max-width: 560px) {
    .cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 14px 16px; }
    .cookie-accept { width: 100%; }
}

/* ---- Адаптив ---- */
@media (max-width: 920px) {
    .hero .container { min-height: 0; }
    .hero-text { width: 100%; padding-top: 16px; }
    .hero-text h1 { font-size: 36px; }
    .hero-text h1 br, .hero-sub br { display: none; }
    .hero-visual {
        position: static; transform: none;
        margin: 24px auto 0;
    }
    .howto-cards { grid-template-columns: 1fr; }
    .howto-card { min-height: 0; }
    .section-title { font-size: 26px; }
    .breakdown { flex-direction: column-reverse; gap: 24px; }
    .compare-grid, .compare-results { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .hero-text h1 { font-size: 30px; }
    .hero-visual { width: 320px; height: 250px; transform: scale(0.78); transform-origin: top center; }
    .tabs { flex-wrap: wrap; }
    .tab { flex: 1 1 100%; }
    /* На телефоне «Анализ по фото» — первой вкладкой */
    .tab-photo { order: 1; }
    .tab-analyze { order: 2; }
    .tab-compare { order: 3; }
    .card-header { padding: 22px; gap: 10px; }
    .card-body { padding: 0 22px 22px; }
    .card-title .name { display: block; margin-left: 0; margin-top: 2px; }
    .summary { gap: 10px; }
    .summary-card { width: auto; padding: 22px 14px; flex: 1 1 0; }
    .qa-item summary { padding: 22px; }
    .qa-item .qa-answer { padding: 0 22px 22px; }
}

/* ---- Помощник ---- */
.assistant-fab {
    position: fixed; right: 28px; bottom: 28px;
    width: 78px; height: 78px; border-radius: 50%;
    background: transparent; border: none; cursor: pointer; padding: 0;
    filter:
        drop-shadow(0 0 2px #fff)
        drop-shadow(0 0 4px rgba(255,255,255,0.95))
        drop-shadow(0 10px 22px rgba(45, 190, 100, 0.42));
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    transition: transform 0.22s cubic-bezier(.34,1.56,.64,1), filter 0.18s ease, opacity 0.2s, visibility 0.2s;
    animation: fab-bob 4s ease-in-out infinite;
}
.assistant-fab:hover {
    transform: translateY(-4px) scale(1.06) rotate(-2deg);
    filter:
        drop-shadow(0 0 2px #fff)
        drop-shadow(0 0 4px rgba(255,255,255,0.95))
        drop-shadow(0 16px 30px rgba(45, 190, 100, 0.55));
}
@keyframes fab-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}
.assistant-fab svg, .assistant-fab video {
    width: 100%; height: 100%; pointer-events: none;
    object-fit: contain;
}
body.assistant-open .assistant-fab {
    opacity: 0; visibility: hidden; transform: scale(0.6);
}

/* Реплика бота — мессенджер-облачко с хвостиком к кнопке.
   Появляется с мультяшным отскоком «из бота», сначала печатает точки. */
.fab-teaser {
    position: fixed; right: 112px; bottom: 42px; z-index: 1000;
    max-width: 260px;
    background: linear-gradient(135deg, #8B6CFF, #6A48F0);
    color: #fff;
    font-size: 14px; font-weight: 600; line-height: 1.45;
    padding: 13px 17px; border-radius: 18px;
    box-shadow: 0 10px 28px rgba(106, 72, 240, 0.4);
    cursor: pointer; display: none;
    transform-origin: 100% 130%; /* растёт из точки, где сидит бот */
}
.fab-teaser::after { /* хвостик к боту */
    content: ''; position: absolute; right: -9px; bottom: 12px;
    border-style: solid; border-width: 7px 0 7px 11px;
    border-color: transparent transparent transparent #6A48F0;
}
.fab-teaser.show { display: block; animation: teaser-pop 0.5s cubic-bezier(.34,1.56,.64,1) both; }
.fab-teaser.show.hide { animation: teaser-out 0.28s ease both; }
@keyframes teaser-pop {
    0%   { opacity: 0; transform: scale(0.2) translateY(16px) rotate(-6deg); }
    65%  { opacity: 1; transform: scale(1.07) translateY(-3px) rotate(1.5deg); }
    100% { opacity: 1; transform: none; }
}
@keyframes teaser-out {
    to { opacity: 0; transform: scale(0.4) translateY(12px); }
}
/* точки «печатает…» внутри облачка (keyframes chat-dot общие с чатом) */
.tease-typing { display: inline-flex; gap: 5px; padding: 4px 3px; }
.tease-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.85);
    animation: chat-dot 1.2s infinite ease-in-out;
}
.tease-typing span:nth-child(2) { animation-delay: 0.18s; }
.tease-typing span:nth-child(3) { animation-delay: 0.36s; }
.tease-text { display: block; animation: fadeInUp 0.3s ease-out both; }
/* бот подпрыгивает, когда «говорит» */
.assistant-fab.speaking { animation: fab-jiggle 0.7s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes fab-jiggle {
    0%   { transform: translateY(0) rotate(0); }
    25%  { transform: translateY(-6px) rotate(-8deg) scale(1.07); }
    50%  { transform: translateY(0) rotate(6deg); }
    75%  { transform: translateY(-2px) rotate(-3deg); }
    100% { transform: translateY(0) rotate(0); }
}
body.assistant-open .fab-teaser { display: none !important; }
@media (max-width: 560px) {
    .fab-teaser { right: 98px; bottom: 30px; max-width: calc(100vw - 128px); font-size: 13px; }
}

.assistant-panel {
    position: fixed; right: 28px; bottom: 28px;
    width: 384px; max-width: calc(100vw - 32px);
    height: 580px; max-height: calc(100vh - 56px);
    background: #fff; border-radius: 24px;
    box-shadow: 0 24px 60px rgba(20, 40, 28, 0.28);
    display: flex; flex-direction: column; overflow: hidden;
    z-index: 1001;
    opacity: 0; visibility: hidden;
    transform: translateY(24px) scale(0.92);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(.2,.8,.2,1), visibility 0.22s;
}
body.assistant-open .assistant-panel {
    opacity: 1; visibility: visible;
    transform: translateY(0) scale(1);
}

.assistant-head {
    background: var(--btn-grad); color: #fff;
    padding: 16px 18px;
    display: flex; align-items: center; gap: 12px;
}
.ah-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: #fff; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.ah-avatar svg { width: 38px; height: 38px; }
.ah-title { font-weight: 700; font-size: 16px; }
.ah-status { font-size: 12px; opacity: 0.92; display: flex; align-items: center; gap: 5px; }
.ah-status::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: #fff; display: inline-block;
}
.ah-close {
    margin-left: auto;
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: rgba(255, 255, 255, 0.18);
    color: #fff; font-size: 19px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.ah-close:hover { background: rgba(255, 255, 255, 0.32); }

.assistant-body {
    flex: 1; overflow-y: auto; padding: 20px;
    display: flex; flex-direction: column; gap: 12px;
    background: #F7FBF8;
}
.chat-msg {
    max-width: 84%; padding: 12px 15px; border-radius: 16px;
    font-size: 14px; line-height: 1.5; white-space: pre-wrap;
}
.chat-msg.bot {
    background: #fff; color: var(--ink);
    border-bottom-left-radius: 5px; align-self: flex-start;
    box-shadow: var(--shadow-sm);
}
.chat-msg.user {
    background: var(--btn-grad); color: #fff;
    border-bottom-right-radius: 5px; align-self: flex-end;
}

.assistant-foot {
    padding: 14px 16px; border-top: 1px solid var(--line);
    display: flex; gap: 10px; align-items: flex-end; background: #fff;
}
.assistant-foot textarea {
    flex: 1; width: auto; min-height: 24px; max-height: 96px;
    border: none; outline: none; resize: none;
    font-family: inherit; font-size: 16px; line-height: 1.5;  /* 16px — iOS не зумит при фокусе */
    background: var(--soft); border-radius: 16px; padding: 11px 14px;
}
.assistant-send {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--btn-grad); border: none; cursor: pointer;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: filter 0.15s, transform 0.05s;
}
.assistant-send:hover { filter: brightness(1.05); }
.assistant-send:active { transform: scale(0.94); }
.assistant-send svg { width: 19px; height: 19px; }

@media (max-width: 560px) {
    .assistant-fab { right: 18px; bottom: 18px; }
    .assistant-panel { right: 16px; bottom: 16px; left: 16px; width: auto; }
}

/* Помощник: карточки категорий */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.assistant-menu-btn {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 6px;
    border: 1.5px solid #CDE9D6; background: #fff; color: var(--green);
    font: inherit; font-size: 13.5px; font-weight: 700;
    padding: 8px 14px; border-radius: 999px; cursor: pointer;
    transition: all .15s ease; -webkit-tap-highlight-color: transparent;
}
.assistant-menu-btn:hover { background: #F0FBF4; border-color: var(--green); }
.cat-card {
    background: #fff; border: none; border-radius: 14px;
    box-shadow: var(--shadow-sm); padding: 13px;
    display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
    cursor: pointer; font-family: inherit; text-align: left;
    transition: transform 0.08s, box-shadow 0.15s;
}
.cat-card:hover { box-shadow: 0 6px 18px rgba(20, 40, 28, 0.12); }
.cat-card:active { transform: scale(0.98); }
.cat-emoji {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 21px;
}
.cat-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.cat-action { font-size: 12px; font-weight: 600; color: var(--green); }

/* Помощник: индикатор набора */
.chat-typing {
    align-self: flex-start; background: #fff;
    border-radius: 16px; border-bottom-left-radius: 5px;
    box-shadow: var(--shadow-sm); padding: 14px 16px;
    display: flex; gap: 5px;
}
.chat-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
    animation: chat-dot 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes chat-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Помощник: карточки товаров */
.chat-products { display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.chat-product {
    display: flex; gap: 11px; align-items: center;
    background: #fff; border-radius: 14px; padding: 9px;
    box-shadow: var(--shadow-sm); color: var(--ink);
    cursor: pointer;
    transition: transform 0.08s;
}
.chat-product:active { transform: scale(0.99); }
.cp-img {
    width: 54px; height: 54px; border-radius: 10px; flex-shrink: 0;
    object-fit: cover; background: var(--soft);
}
.cp-img-empty { display: flex; align-items: center; justify-content: center; }
.cp-img-empty::after { content: '📦'; font-size: 22px; opacity: 0.4; }
.cp-check {
    width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
    background: #fff;
    box-shadow: inset 0 0 0 2px var(--track);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.18s, box-shadow 0.18s;
}
.chat-product.selected .cp-check { background: var(--btn-grad); box-shadow: none; }
.cp-check svg { width: 13px; height: 13px; opacity: 0; transition: opacity 0.18s; }
.chat-product.selected .cp-check svg { opacity: 1; }
.cp-info { min-width: 0; flex: 1; }
.cp-name {
    font-size: 13px; font-weight: 600; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.cp-meta { font-size: 12px; color: var(--muted-2); margin-top: 3px; }
.cp-meta b { color: var(--green); font-weight: 700; }
.chat-cart-btn {
    align-self: stretch; background: var(--btn-grad); color: #fff;
    border: none; border-radius: 14px; padding: 12px;
    font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: filter 0.15s, transform 0.05s;
}
.chat-cart-btn:hover { filter: brightness(1.04); }
.chat-cart-btn:active { transform: scale(0.98); }
.chat-cart-btn:disabled { opacity: 0.7; cursor: default; }

/* ---- Оценка анализа ---- */
.rate-card {
    margin: 18px 0 8px; padding: 26px 24px 22px; text-align: center;
    background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow);
}
.rate-title { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.rate-sub { font-size: 14px; color: var(--muted); margin-top: 6px; }
.rate-stars { display: inline-flex; gap: 6px; margin-top: 16px; }
.rate-star {
    width: 48px; height: 48px; padding: 0; border: 0; background: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: transform .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.rate-star svg { width: 34px; height: 34px; display: block; }
.rate-star svg path { fill: #E9EEEB; stroke: none; transition: fill .15s ease, transform .15s ease; }
.rate-star:hover { transform: scale(1.12); }
.rate-stars.hovering .rate-star.lit svg path,
.rate-stars:not(.hovering) .rate-star.on svg path { fill: #FFC531; }
.rate-card.done .rate-star { cursor: default; }
.rate-card.done .rate-star:hover { transform: none; }
.rate-star.pop { animation: starPop .35s ease; }
@keyframes starPop { 0%{transform:scale(1)} 40%{transform:scale(1.35)} 100%{transform:scale(1)} }
.rate-thanks { display: none; margin-top: 12px; font-size: 15px; font-weight: 700; color: var(--green); }
.rate-card.done .rate-thanks { display: block; }
.rate-reasons { display: none; margin-top: 14px; }
.rate-card.ask .rate-reasons { display: block; }
.rate-reasons-title { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.rate-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rate-chip {
    border: 1.5px solid #DCE7E0; background: #fff; color: var(--ink);
    border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 600;
    cursor: pointer; transition: all .15s ease; -webkit-tap-highlight-color: transparent;
}
.rate-chip:hover { border-color: var(--green); }
.rate-chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.rate-other { margin: 12px auto 0; max-width: 460px; text-align: left; }
.rate-comment {
    width: 100%; min-height: 0; height: 74px; resize: none; font: inherit; font-size: 14px; line-height: 1.45;
    padding: 12px 14px; border: 1.5px solid #DCE7E0; border-radius: 14px; background: #FAFCFB;
    outline: none; transition: border-color .15s;
}
.rate-comment:focus { border-color: var(--green); background: #fff; }
.rate-other-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.rate-count { font-size: 12px; color: var(--muted); }
.rate-send {
    border: 0; background: var(--btn-grad); color: #fff; font: inherit; font-size: 14px; font-weight: 700;
    padding: 9px 18px; border-radius: 999px; cursor: pointer; transition: opacity .15s;
}
.rate-send:disabled { opacity: .45; cursor: default; }
.rate-other-done { text-align: center; font-size: 14px; font-weight: 700; color: var(--green); padding: 8px 0; }
@media (max-width: 560px) {
    .rate-card { padding: 22px 16px 18px; border-radius: 22px; }
    .rate-title { font-size: 16px; }
    .rate-stars { gap: 2px; }
    .rate-star { width: 44px; height: 44px; }
    .rate-star svg { width: 32px; height: 32px; }
    .rate-chip { font-size: 13px; padding: 8px 12px; }
}
/* ---- Подбор во ВкусВилле (bridge) ---- */
.bridge { margin-top: 16px; margin-bottom: 16px; }
.bridge-cta {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 22px;
    background: linear-gradient(135deg, #F0FBF4, #E5F8EC);
    border: 1px solid #CDE9D6;
    border-radius: var(--r-card);
}
.bridge-emoji {
    width: 48px; height: 48px; border-radius: 50%;
    background: #fff; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    /* иконка продукта периодически «оживает» — покачивается и
       подпрыгивает, чтобы блок «Подобрать» цеплял взгляд */
    animation: emoji-wiggle 3.4s ease-in-out infinite;
    transform-origin: 50% 60%;
}
@keyframes emoji-wiggle {
    0%, 55%, 100% { transform: rotate(0) scale(1) translateY(0); }
    60% { transform: rotate(-14deg) scale(1.15) translateY(-3px); }
    66% { transform: rotate(11deg)  scale(1.15) translateY(-4px); }
    72% { transform: rotate(-9deg)  scale(1.12) translateY(-2px); }
    78% { transform: rotate(6deg)   scale(1.08) translateY(-1px); }
    84% { transform: rotate(0) scale(1) translateY(0); }
}
.bridge-text { flex: 1; min-width: 0; }
.bridge-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.bridge-sub { font-size: 14px; color: var(--muted-2); margin-top: 3px; }
.bridge-btn {
    padding: 12px 22px; border-radius: 999px;
    background: var(--btn-grad); color: #fff; border: none;
    font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
    flex-shrink: 0; box-shadow: 0 6px 16px rgba(45, 190, 100, 0.28);
    transition: filter 0.15s, transform 0.05s;
}
.bridge-btn:hover { filter: brightness(1.05); }
.bridge-btn:active { transform: scale(0.98); }

.bridge-picker {
    margin-top: 12px;
    background: #fff; border-radius: var(--r-card);
    box-shadow: var(--shadow); padding: 22px;
    animation: fadeInUp 0.35s ease-out both;
}
.bridge-head {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; line-height: 1.5; margin-bottom: 14px;
}
.bridge-head-emoji { font-size: 22px; }
.bridge-head-text { color: var(--ink); }
.bridge-typing { display: flex; gap: 5px; padding: 8px 0; }
.bridge-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
    animation: chat-dot 1.2s infinite ease-in-out;
}
.bridge-typing span:nth-child(2) { animation-delay: 0.18s; }
.bridge-typing span:nth-child(3) { animation-delay: 0.36s; }
.bridge-products { display: flex; flex-direction: column; gap: 9px; max-width: 560px; }
/* Лента мини-чата подбора: пузыри пользователя/бота + блоки товаров.
   Высота зафиксирована — лента листается внутри, а не растягивает блок. */
.bridge-chat {
    display: flex; flex-direction: column; gap: 10px; max-width: 560px; align-items: stretch;
    max-height: 460px; overflow-y: auto; padding-right: 4px;
    overscroll-behavior: contain;
}
.bridge-chat::-webkit-scrollbar { width: 7px; }
.bridge-chat::-webkit-scrollbar-thumb { background: #D7E3DB; border-radius: 4px; }
.bridge-chat::-webkit-scrollbar-track { background: transparent; }
.bridge-chat .chat-msg { white-space: normal; }
/* Промокод на первый заказ — компактная строка под полем ввода,
   код полужирным капсом без цветного выделения. */
.bridge-promo {
    margin-top: 10px; max-width: 560px;
    font-size: 13px; color: var(--muted-2); line-height: 1.7;
}
.bp-code {
    display: inline; padding: 0; margin: 0 1px;
    border: none; background: none; color: var(--ink);
    font-family: inherit; font-weight: 800; font-size: 13px;
    letter-spacing: 0.6px; cursor: pointer; vertical-align: baseline;
}
.bp-code.copied { color: var(--muted-2); font-weight: 700; }
.bridge-refine { display: flex; gap: 8px; margin-top: 12px; max-width: 560px; }
.bridge-refine-input {
    flex: 1; min-width: 0; border: 1.5px solid #CDE9D6; border-radius: 12px;
    padding: 11px 14px; font-family: inherit; font-size: 16px;  /* 16px — iOS не зумит при фокусе */
    outline: none; background: #fff; color: var(--ink);
}
.bridge-refine-input:focus { border-color: var(--green); }
.bridge-refine-btn {
    width: 46px; border: none; border-radius: 12px; flex-shrink: 0;
    background: var(--btn-grad); color: #fff; font-size: 18px; cursor: pointer;
}
.bridge-empty { padding: 14px 0; color: var(--muted-2); font-size: 14px; }

@media (max-width: 560px) {
    .bridge-cta { flex-direction: column; align-items: flex-start; gap: 12px; }
    .bridge-btn { align-self: stretch; }
}

/* ---- Адаптив: телефон ---- */
/* Горизонтальный вылет режем на обёртке #pageClip, а не на html/body:
   overflow на body в iOS Safari «отклеивает» position:fixed. Фиксированные
   элементы (бот, облачко, панель чата) живут вне обёртки. */
#pageClip { overflow-x: clip; }
@supports not (overflow: clip) {
    #pageClip { overflow-x: hidden; }
}
* { -webkit-tap-highlight-color: transparent; }

@media (max-width: 560px) {
    /* На телефоне строчная привязка тултипа ненадёжна (термин переносится,
       плашка вылезает за край и обрезается). Делаем плашку во всю ширину
       экрана, закреплённую снизу — её невозможно обрезать. */
    .tooltip {
        position: fixed;
        left: 12px; right: 12px; bottom: 16px; top: auto;
        width: auto; min-width: 0; max-width: none;
        transform: none;
        font-size: 14px; padding: 16px 18px; border-radius: 14px;
        box-shadow: 0 8px 28px rgba(0,0,0,0.35);
        z-index: 9999;
    }
    .tooltip::after { display: none; } /* нет привязки — стрелка не нужна */
    .tip-end .tooltip { left: 12px; right: 12px; transform: none; }
    /* Инлайн-плашка внутри анимированных блоков (transform → своя стековая
       область) перекрывается соседними карточками. На телефоне тултип
       показываем через отдельный «шит» на уровне body (#tipSheet). */
    .has-tooltip .tooltip { display: none !important; }
}
/* Мобильный шит подсказки */
.tip-sheet-backdrop {
    position: fixed; inset: 0; background: rgba(20,30,24,0.28);
    z-index: 9998; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.tip-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
    background: #fff; color: var(--ink);
    border-radius: 20px 20px 0 0; padding: 14px 20px 26px;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
    font-size: 15px; line-height: 1.55; font-weight: 400;
    transform: translateY(105%); transition: transform .25s ease-out;
    max-height: 70vh; overflow-y: auto;
}
.tip-sheet::before {
    content: ''; display: block; width: 40px; height: 4px; border-radius: 2px;
    background: #DDE5DF; margin: 0 auto 14px;
}
.tip-sheet strong { font-weight: 700; }
.tip-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.tip-sheet.open { transform: translateY(0); }
@media (min-width: 561px) { .tip-sheet, .tip-sheet-backdrop { display: none; } }

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .section { padding: 20px 16px; }
    .section-title { font-size: 22px; }
    .hero { padding: 16px 0 8px; }
    .hero-text h1 { font-size: 26px; }
    .hero-note { font-size: 12px; }
    .topbar { height: 52px; }

    .breakdown { padding: 20px; gap: 18px; }
    .breakdown-title { font-size: 17px; margin-bottom: 18px; }
    .bar-label { width: 112px; font-size: 13px; }
    .bar-track { margin: 0 8px; }
    .bar-count { width: 32px; font-size: 15px; }
    .donut-wrap { width: 112px; height: 112px; }
    .donut-center .donut-number { font-size: 26px; }

    .card-header { padding: 18px 16px; gap: 9px; }
    .card-body { padding: 0 16px 18px; }
    .card-title .code { font-size: 16px; }
    .card-type { white-space: normal; font-size: 12px; padding: 6px 12px; }
    .info-row .info-value, .research-source { font-size: 15px; }

    .summary-card .number { font-size: 34px; }
    .btn { padding: 16px; font-size: 16px; }
    textarea, .highlighted-text { font-size: 16px; }  /* 16px — чтобы iOS не зумил при фокусе */
}

.bridge-more { display:inline-block; margin-top:14px; color:#2DBE64; font-weight:600; font-size:14px; text-decoration:none; }
.bridge-more:hover { text-decoration:underline; }

@media (max-width: 560px) {
    /* График: заголовок сверху, бары на всю ширину, донат строго по центру */
    .breakdown { flex-direction: column; align-items: stretch; gap: 18px; }
    .breakdown-bars { width: 100%; }
    .donut-wrap { align-self: center; margin: 2px auto 0; }
}
