/* FoodScan 0.7.0 — интерфейс по макету «обновлённый интерфейс».
 * Файл собирается скриптом mock2/build_css.py из трёх частей: новая база
 * (шрифты, токены, кнопки, поля), перенесённые без изменений компоненты 0.6.x
 * (сканер, лента «Мнения», вход, аватар, комментарии) и новые экраны с адаптивом.
 * Порядок важен: новые правила идут после старых и выигрывают при равной специфичности. */

/* Manrope с переменной насыщенностью: один файл на набор символов, браузер
 * скачивает только нужный (кириллица на RU, латиница на EN). */
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/manrope-cyrillic-wght-normal.e58febde317b.woff2") format('woff2-variations'), url("fonts/manrope-cyrillic-wght-normal.e58febde317b.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: 200 800;
  font-display: swap;
  src: url("fonts/manrope-latin-ext-wght-normal.6d36d5bdedfa.woff2") format('woff2-variations'), url("fonts/manrope-latin-ext-wght-normal.6d36d5bdedfa.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: Manrope;
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/manrope-latin-wght-normal.938c6e8019b6.woff2") format('woff2-variations'), url("fonts/manrope-latin-wght-normal.938c6e8019b6.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;
}

/* Токены макета. Старые имена (--primary, --ink…) оставлены алиасами: на них
 * опираются перенесённые компоненты сканера, ленты и входа. */
:root {
  --fs-bg: #ffffff;
  --fs-text: #1a2e23;
  --fs-muted: #617168;
  --fs-line: #e1e8e1;
  --fs-line-strong: #c9d5cb;
  --fs-soft: #f5f7f3;
  --fs-green: #19533e;
  --fs-green-hover: #133f2f;
  --fs-greenbg: #edf3e7;
  --fs-dark: #153e30;
  --fs-lime: #d6ef9b;
  --fs-on-green: #ffffff;
  --fs-white: #ffffff;
  --fs-danger: #b53b2f;
  --fs-dangerbg: #fbecea;
  --fs-amber: #8a6512;
  --fs-star: #c98a0b;
  --fs-warningbg: #fff8e7;
  --fs-shadow: 0 16px 50px rgba(22, 55, 39, .09);
  --fs-shadow-soft: 0 1px 4px rgba(26, 46, 35, .08);
  --fs-focus: #19533e;
  --fs-container: 1080px;
  --fs-pad: 18px;
  --fs-radius: 14px;

  --primary: var(--fs-green);
  --primary-dark: var(--fs-dark);
  --primary-soft: var(--fs-greenbg);
  --ink: var(--fs-text);
  --muted: var(--fs-muted);
  --line: var(--fs-line);
  --canvas: var(--fs-bg);
  --surface: var(--fs-bg);
  --danger: var(--fs-danger);
  --warn: var(--fs-amber);
  --radius: var(--fs-radius);
  --shadow: none;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fs-bg: #151e19;
    --fs-text: #edf5ee;
    --fs-muted: #b0c0b4;
    --fs-line: #354b3b;
    --fs-line-strong: #4b6352;
    --fs-soft: #223128;
    --fs-green: #b6dda8;
    --fs-green-hover: #cbe8bf;
    --fs-greenbg: #2c422d;
    --fs-dark: #12291c;
    --fs-on-green: #12291c;
    --fs-danger: #ffb0a5;
    --fs-dangerbg: #43251f;
    --fs-amber: #e3c769;
    --fs-star: #e8c35a;
    --fs-warningbg: #39331f;
    --fs-shadow: 0 16px 50px rgba(0, 0, 0, .35);
    --fs-shadow-soft: 0 1px 4px rgba(0, 0, 0, .3);
    --fs-focus: #d6ef9b;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--fs-bg);
  color: var(--fs-text);
  font: 400 16px/1.5 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
body { overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.03em; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 750; }
h3 { font-size: 17px; font-weight: 750; }
p { line-height: 1.6; }
a { color: var(--fs-green); text-underline-offset: 3px; }
img { max-width: 100%; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
ul { margin: 0; padding: 0; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--fs-muted); }
.small { font-size: 13px; line-height: 1.55; }
.center { text-align: center; }
.error, .danger-text { color: var(--fs-danger); }
.warn { color: var(--fs-amber); }
.lede { color: var(--fs-muted); }

/* --------------------------------------------------------------- кнопки */

/* Кнопка без класса — основная (зелёная): так написан почти весь прежний код. */
button {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--fs-green);
  color: var(--fs-on-green);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
button svg { width: 18px; height: 18px; }
/* Зелёная подсветка только у основных кнопок. :where() обнуляет специфичность,
 * поэтому hover клавиатуры кода, голосов и кнопок ленты не перекрашивается. */
button:where(:not([class]), .primary, .block):hover:not(:disabled) { background: var(--fs-green-hover); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--fs-green); color: var(--fs-on-green); }
button.primary:hover:not(:disabled) { background: var(--fs-green-hover); }
button.secondary, button.ghost {
  background: var(--fs-bg);
  color: var(--fs-green);
  border-color: var(--fs-line);
}
button.secondary:hover:not(:disabled), button.ghost:hover:not(:disabled) { background: var(--fs-soft); border-color: var(--fs-line-strong); }
button.soft { background: var(--fs-greenbg); color: var(--fs-green); }
button.soft:hover:not(:disabled) { background: var(--fs-greenbg); filter: brightness(.97); }
button.lime { background: var(--fs-lime); color: #153e30; }
button.lime:hover:not(:disabled) { background: #c9e588; }
button.danger { background: var(--fs-danger); color: var(--fs-bg); }
button.danger:hover:not(:disabled) { background: var(--fs-danger); filter: brightness(.94); }
button.danger.ghost, button.secondary.danger { background: var(--fs-bg); color: var(--fs-danger); border-color: var(--fs-line); }
button.block { display: flex; width: 100%; }
button.text-button, button.link {
  background: none;
  border: 0;
  color: var(--fs-green);
  min-height: 40px;
  padding: 8px 2px;
  font-weight: 700;
  justify-content: flex-start;
}
button.text-button:hover:not(:disabled), button.link:hover:not(:disabled) { background: none; text-decoration: underline; text-underline-offset: 4px; }
button.text-button.danger-text { color: var(--fs-danger); }
button.icon-button, button.icon-only {
  min-height: 40px;
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--fs-muted);
}
button.icon-button:hover:not(:disabled), button.icon-only:hover:not(:disabled) { background: var(--fs-soft); color: var(--fs-green); }
button.icon-only.danger { color: var(--fs-danger); background: none; }
button.small-button { min-height: 40px; padding: 8px 13px; font-size: 13px; }
button.chip-button { min-height: 40px; }

/* Видимый фокус для клавиатуры; мышь и палец рамку не вызывают. */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--fs-focus); outline-offset: 2px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--fs-focus); outline-offset: 2px; }
#screen:focus, #screen:focus-visible { outline: none; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.tight { gap: 6px; }
.row.end { justify-content: flex-end; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ----------------------------------------------------------------- поля */

input[type="text"], input[type="tel"], input[type="search"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 16px; /* меньше 16px iOS приближает страницу при фокусе */
  color: var(--fs-text);
  background: var(--fs-bg);
  border: 1px solid var(--fs-line);
  border-radius: 10px;
  padding: 11px 14px;
  min-height: 46px;
}
input::placeholder, textarea::placeholder { color: var(--fs-muted); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--fs-line-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--fs-focus); outline-offset: 0; border-color: var(--fs-green); }
input[aria-invalid="true"] { border-color: var(--fs-danger); }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--fs-muted) 50%), linear-gradient(135deg, var(--fs-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--fs-green); width: 18px; height: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span.label, .field-label { display: block; font-size: 14px; font-weight: 700; }
.field-title { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.field .hint, .hint, .field-hint { color: var(--fs-muted); font-size: 12.5px; line-height: 1.5; margin: 0; }
.field-hint.is-warning { color: var(--fs-amber); font-weight: 600; }
.counter { color: var(--fs-muted); font-size: 12px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.field-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.field-foot.end { justify-content: flex-end; }

/* Текст только для экранного диктора. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--fs-dark);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: calc(10px + env(safe-area-inset-top)); }

/* ======================================================================
 * Блоки 0.6.9: перенесены без изменения разметки, цвета заменены токенами.
 * ==================================================================== */

/* --- из 0.6.9: показатели «Оценка» и «Популярность» --- */
/* ------------------------------------------------------------------ metrics */

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.insight {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 12px 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  box-shadow: var(--shadow);
}
.insight-top { display: flex; align-items: center; min-height: 38px; }
.insight-symbol { width: 27px; height: 27px; flex: none; display: grid; place-items: center;
  border-radius: 9px; color: var(--primary-dark); background: var(--primary-soft); }
.insight-symbol svg { width: 17px; height: 17px; }
.insight-title { min-width: 0; font-size: 12px; font-weight: 700; line-height: 1.2; flex: 1; }
.insight-help { position: absolute; top: 52px; right: 5px; min-height: 44px; width: 44px;
  padding: 6px; background: transparent; border: 0; color: var(--muted); display: grid; place-items: center; }
.insight-help svg { width: 17px; height: 17px; }
.insight-help:hover { background: var(--primary-soft); color: var(--primary-dark); }
.insight-number { display: flex; gap: 5px; align-items: center; padding-right: 24px; }
.insight-number strong { font-size: clamp(24px, 7vw, 31px); line-height: 1; letter-spacing: -.04em; }
.insight-number span { color: var(--muted); font-size: 13px; }
.insight-track { width: 100%; height: 5px; overflow: hidden; border-radius: 9px; background: var(--primary-soft); }
.insight-track span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.insight-foot { color: var(--muted); font-size: 12px; line-height: 1.35; margin: 0; }

/* --- из 0.6.9: ролики, отзывы, голоса, строки листов --- */
/* ------------------------------------------------------------------- reels */

.rail { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.reel {
  flex: 0 0 106px;
  height: 142px;
  border-radius: 14px;
  border: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #2b4a3c 0%, #0d1a15 100%);
  color: #fff;
  display: grid;
  place-items: center;
}
.reel video, .reel img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.reel .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.reel .play svg { width: 30px; height: 30px; }
.reel .duration {
  position: absolute;
  right: 7px;
  bottom: 7px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, .55);
  border-radius: 999px;
  padding: 2px 7px;
}
.reel .who {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 30px;
  font-size: 11px;
  text-align: left;
  opacity: .9;
}

/* ------------------------------------------------------------------- reviews */

.review { display: flex; flex-direction: column; gap: 8px; }
.review .head { display: flex; gap: 10px; align-items: center; }
.avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fs-soft);
  color: var(--fs-muted);
  font-size: 13px;
  font-weight: 700;
}
.review .who { font-weight: 700; font-size: 14px; }
.review .meta { color: var(--muted); font-size: 11.5px; }
.review .text { white-space: pre-wrap; font-size: 14px; }
.review .part { font-size: 12.5px; color: var(--muted); }
.review .part b { color: var(--ink); }
.review img.photo {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--fs-soft);
}
.review-photo-trigger {
  display: block;
  width: 100%;
  padding: 0;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--fs-soft);
  cursor: zoom-in;
}
.review-photo-trigger:hover { box-shadow: 0 0 0 2px var(--primary-soft); }
.stars { color: var(--fs-star); font-size: 13px; letter-spacing: 1px; white-space: nowrap; }

.votes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 2px; }
.vote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fs-muted);
  padding: 7px 13px;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.vote:hover:not(:disabled) { background: var(--fs-soft); }
.vote svg { width: 16px; height: 16px; }
.vote[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--fs-line); color: var(--primary-dark); }
.vote.up[aria-pressed="true"] { color: var(--primary-dark); }

/* -------------------------------------------------------------------- history */

.day-label { font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 2px 0; }
.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  min-height: 0;
  color: var(--ink);
}
.history-row:hover { border-color: var(--fs-line); }
.history-row .tile {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--fs-greenbg);
  color: var(--primary);
  font-weight: 700;
}
.history-row .body { flex: 1; min-width: 0; }
.history-row .name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-row .sub { font-size: 11.5px; color: var(--muted); }
.history-row svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }

/* --- из 0.6.9: аватар, редактор аватара, переключатель, статусы --- */
.profile-head { display: flex; gap: 12px; align-items: center; }
.contributed-list { display: flex; flex-direction: column; gap: 10px; }
.contributed-product { display: flex; flex-direction: column; gap: 6px; }
.contributed-product .submission-top { align-items: flex-start; gap: 8px; }
.contributed-product .submission-top b { font-size: 14px; overflow-wrap: anywhere; }
.contributed-product .tag { flex: 0 1 auto; max-width: 56%; white-space: normal; text-align: center; }
.contributed-product p { margin: 0; }
.contributed-product .submission-reason { color: var(--danger); font-weight: 600; }
.contributed-product .submission-actions { margin-top: 4px; }
.contributed-product .submission-actions button { min-height: 38px; }
.profile-head .avatar {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  font-size: 17px;
  background: var(--fs-soft);
}
.profile-head .avatar-button {
  position: relative;
  flex: 0 0 62px;
  display: block;
  width: 62px;
  height: 62px;
  min-height: 62px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fs-soft);
  cursor: pointer;
}
.avatar-button > img, .avatar-button > .avatar {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--fs-soft);
  overflow: hidden;
}
.avatar-camera {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--canvas);
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}
.avatar-camera svg { width: 15px; height: 15px; }
.avatar-button:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.avatar-editor-dialog[open] {
  position: fixed;
  width: min(420px, calc(100vw - 24px));
  max-width: 420px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  margin: auto;
  padding: 24px;
  border: 0;
  border-radius: 22px;
  background: var(--fs-bg);
  color: var(--ink);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .24);
  z-index: 200;
}
.avatar-editor-dialog::backdrop { background: rgba(5, 20, 12, .72); }
.avatar-editor-dialog h2 { font-size: 20px; margin: 0 0 8px; }
.avatar-editor-dialog .avatar-editor-preview {
  display: block;
  width: min(224px, 100%);
  height: auto;
  aspect-ratio: 1;
  margin: 14px auto 20px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  cursor: move;
  touch-action: none;
  background: var(--fs-soft);
}
.avatar-editor-zoom { display: flex; flex-direction: column; gap: 10px; font-size: 14px; font-weight: 600; }
.avatar-editor-zoom input { width: 100%; accent-color: var(--primary); min-height: 44px; }
.avatar-editor-actions { display: flex; gap: 10px; margin-top: 18px; }
.avatar-editor-actions button { flex: 1; min-height: 44px; }
.avatar-editor-dialog :focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-soft);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--primary-dark);
}
.status-card svg { width: 20px; height: 20px; flex: 0 0 auto; }
.status-card .text { flex: 1; font-size: 13px; }
.status-card .text b { display: block; font-size: 13.5px; }
.switch {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: var(--fs-line-strong);
  border: 0;
  padding: 0;
  min-height: 0;
  flex: 0 0 auto;
  transition: background .15s;
}
.switch[aria-checked="true"] { background: var(--primary); }
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.switch[aria-checked="true"]::after { transform: translateX(19px); }

.status-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.status-option:last-child { border-bottom: 0; }
.status-option svg { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }
.status-option.active svg { color: var(--primary); }
.status-option .body { flex: 1; }
.status-option .body b { display: block; font-size: 14px; }
.status-option .body span { font-size: 12px; color: var(--muted); }
.status-option .mark { color: var(--primary); }
.status-option .mark svg { width: 20px; height: 20px; }


/* --- из 0.6.9: вход по SMS, вложения отзыва, уведомления --- */
.login-art { display: grid; place-items: center; padding: 10px 0 4px; }
.login-art svg { width: 76px; height: 76px; color: var(--primary); }
.phone-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.phone-card .body { flex: 1; }
.phone-card .body span { display: block; font-size: 12px; color: var(--muted); }
.phone-card .body b { font-size: 15px; }
.phone-error { color: var(--fs-danger); font-size: 13px; margin: 0; }
.field input[aria-invalid="true"] { border-color: var(--fs-danger); }
.phone-region-link { color: var(--primary); font-size: 13px; font-weight: 600; }
.code-field { position: relative; }
.code-field input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  font-size: 18px;
}
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; pointer-events: none; }
.code-box {
  height: 54px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.code-box.filled { border-color: var(--fs-line-strong); }
.code-box.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(28, 122, 76, .12); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  padding: 0;
  min-height: 52px;
  border-radius: 12px;
}
.keypad button:hover { background: var(--fs-soft); }
.keypad button.flat { border-color: transparent; background: none; }

/* --------------------------------------------------------------------- editor */

.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.media-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  min-height: 0;
}
.media-tile:hover { background: var(--fs-soft); }
.media-tile svg { width: 26px; height: 26px; color: var(--primary); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb-item {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--fs-soft);
  border: 1px solid var(--line);
}
.thumb-item img, .thumb-item video { width: 100%; height: 100%; object-fit: cover; }
.thumb-item .badge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 10px;
  text-align: center;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  padding: 2px 0;
}
.thumb-item .remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  min-height: 0;
  border-radius: 50%;
  background: rgba(10, 15, 12, .65);
  color: #fff;
  padding: 0;
  display: grid;
  place-items: center;
}
.thumb-item .remove svg { width: 13px; height: 13px; }

.notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--fs-soft);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 12.5px;
  color: var(--muted);
}
.notice svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }

/* --- из 0.6.9: листы, сканер, просмотрщик роликов, мелкие элементы --- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(12, 18, 15, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sheet .sheet-title { font-size: 17px; font-weight: 700; }
.sheet-list { display: flex; flex-direction: column; gap: 8px; }
/* Блоки панели не сжимаются: длинное содержимое прокручивает панель целиком.
 * Иначе блок с явным min-height сжимался до высоты экрана, а его содержимое
 * рисовалось поверх соседних блоков (так комментарии налезали на форму). */
.sheet > * { flex-shrink: 0; }

/* Комментарии: панель постоянной высоты, как в соцсетях. Заголовок и форма
 * закреплены, прокручивается только список; высота не прыгает при загрузке. */
.sheet.comments-sheet { height: min(90vh, 760px); height: min(90dvh, 760px); overflow: hidden; gap: 10px; }
.comments-sheet .opinion-comments-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Полоса прокрутки у края панели, текст — с обычными полями. */
  margin: 0 -16px;
  padding: 2px 16px 8px;
}
.comments-sheet .opinion-comments-more { margin-top: 8px; }
.comments-sheet .opinion-comment-form { padding-top: 10px; gap: 6px; }
.comments-sheet .opinion-comment-form textarea { min-height: 56px; max-height: 30vh; max-height: 30dvh; }
.comments-sheet .opinion-comment-form .field > span.label { margin-bottom: 4px; }
/* Низкий экран (телефон горизонтально): закреплённая форма заняла бы почти всю
 * высоту, поэтому там прокручивается вся панель целиком. */
@media (max-height: 480px) {
  .sheet.comments-sheet { height: auto; overflow: auto; }
  .comments-sheet .opinion-comments-scroll { flex: 0 0 auto; overflow: visible; }
}

.scanner { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column; }
.scanner video { flex: 1; width: 100%; object-fit: cover; }
.scanner .scanner-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  color: #fff;
}
.scanner .scanner-bar .title { flex: 1; text-align: center; font-weight: 600; }
.scanner .round-button {
  width: 40px;
  height: 40px;
  min-height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
}
.scanner .round-button svg { width: 20px; height: 20px; }
.scanner .frame {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 32%;
  height: 26%;
  border: 3px solid rgba(255, 255, 255, .92);
  border-radius: 18px;
}
.scanner .scanner-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 16px calc(22px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  text-align: center;
}

/* Frozen frame shown the moment a code is read: proof of what was scanned. */
.scan-snapshot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-found {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(150px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(10, 18, 14, .86);
  color: #fff;
  border-radius: 12px;
  padding: 10px 15px;
  font-size: 14px;
  white-space: nowrap;
}
.scan-found .scan-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
}
.scan-found .scan-check svg { width: 14px; height: 14px; }

.shutter {
  width: 66px;
  height: 66px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  border: 4px solid rgba(255, 255, 255, .45);
}
.shutter:hover:not(:disabled) { background: var(--fs-soft); }

.reel-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.reel-viewer .top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 8px;
}
.reel-viewer .top .who { font-weight: 600; }
.reel-viewer video { width: 100%; flex: 1; min-height: 0; object-fit: contain; background: #000; }
.reel-viewer .bottom {
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reel-viewer .caption { font-size: 15px; font-weight: 600; }
.reel-viewer .caption span { display: block; font-size: 13px; font-weight: 400; opacity: .75; }
.reel-viewer .votes .vote { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; }
.reel-viewer .votes .vote[aria-pressed="true"] { background: rgba(255, 255, 255, .28); color: #fff; }
.reel-viewer button.ghost { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; }

#toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 90;
  max-width: min(92vw, 520px);
  background: #153e30;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  white-space: pre-line;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.fallback { padding: 24px; }

@media (prefers-reduced-motion: reduce) {
  #progress.busy { animation: none; background: var(--primary); }
}
/* Layout rules below use flex, which would otherwise win over the user-agent
   [hidden] rule and leave toggled blocks visible. */
[hidden] { display: none !important; }

/* Inline icons default to 20px; component rules below override where needed. */
svg { width: 20px; height: 20px; flex: none; }

/* Photo tile for products a reader added themselves. */
.tile.photo { padding: 0; overflow: hidden; background: var(--fs-soft); }
.tile.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- adding a product the catalog does not know --------------------------- */

.field-stack { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.field-stack > span { font-size: 13px; font-weight: 600; color: var(--fs-muted); }
.field-stack input, .field-stack textarea { width: 100%; }

.photo-preview {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin-top: 4px;
}

.ok-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px auto 10px;
}
.ok-mark svg { width: 26px; height: 26px; }
.ok-title { font-size: 19px; margin: 0 0 6px; text-align: center; }

.bonus-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
}
.bonus-note svg { width: 18px; height: 18px; flex: 0 0 auto; }

.tag.bonus { background: var(--primary); color: #fff; }
.chip.sub { background: var(--primary-soft); border-color: transparent; color: var(--primary-dark); }
.chip.sub[aria-pressed="true"] { background: var(--primary); color: #fff; }

/* --- из 0.6.9: лента мнений, комментарии, жалобы, примеры, напоминание --- */
.opinion-toolbar {
  flex: none;
  min-height: 34px;
  padding: 7px 15px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #193126;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.opinion-count { opacity: .82; font-variant-numeric: tabular-nums; }
.opinions-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  background: #101a16;
}
.opinions-feed::-webkit-scrollbar { display: none; }
.opinion-slide {
  position: relative;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: radial-gradient(circle at 50% 34%, #304c3f, #101a16 75%);
  color: #fff;
}
.opinion-stage, .opinion-video { position: absolute; inset: 0; width: 100%; height: 100%; }
/* manipulation отключает масштаб по двойному тапу (он нужен для лайка), но
   оставляет вертикальную прокрутку ленты и щипок. */
.opinion-video { object-fit: contain; background: transparent; cursor: pointer; touch-action: manipulation; }
.opinion-stage::after {
  content: '';
  position: absolute;
  inset: 45% 0 0;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(10, 20, 15, .62) 38%, rgba(6, 14, 10, .95));
}
.opinion-play {
  position: absolute;
  z-index: 2;
  top: 41%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 15px;
  border-radius: 50%;
  background: rgba(13, 35, 24, .7);
  border: 1px solid rgba(255, 255, 255, .7);
  backdrop-filter: blur(10px);
}
.opinion-play svg { width: 27px; height: 27px; }
.opinion-actions {
  position: absolute;
  z-index: 3;
  right: 9px;
  bottom: 112px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: center;
}
.opinion-action {
  /* Только иконки: круглая кнопка 48 px; у лайка и комментариев под иконкой счётчик. */
  width: 48px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 2px;
  background: rgba(6, 20, 13, .57);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 24px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  backdrop-filter: blur(8px);
}
.opinion-action:hover:not(:disabled), .opinion-play:hover:not(:disabled) { background: rgba(22, 67, 45, .96); }
.opinion-action svg { width: 22px; height: 22px; }
.opinion-action[aria-pressed="true"] { color: #ff8d7a; border-color: #ff8d7a; }
.opinion-action[aria-pressed="true"] svg { fill: currentColor; }
/* Сердце двойного тапа: появляется в точке касания и гаснет. */
.opinion-heart {
  position: absolute;
  z-index: 4;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  pointer-events: none;
  color: #ff5a4f;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .35));
  animation: opinion-heart .75s ease-out forwards;
}
.opinion-heart svg { width: 100%; height: 100%; fill: currentColor; stroke: currentColor; }
@keyframes opinion-heart {
  0% { opacity: 0; transform: scale(.4); }
  18% { opacity: 1; transform: scale(1.12); }
  40% { transform: scale(.96); }
  100% { opacity: 0; transform: scale(1.05) translateY(-18px); }
}
/* Слайд-копия первого ролика в конце ленты — точка бесшовного перехода к началу. */
.opinion-loop { pointer-events: none; }
.opinion-caption {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 73px;
  bottom: 16px;
  max-height: 43%;
  overflow-y: auto;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .4);
}
.opinion-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.opinion-caption h2 { margin: 7px 0 5px; font-size: clamp(18px, 4.7vw, 24px); line-height: 1.15; }
.opinion-caption p { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.opinion-caption-foot { display: flex; flex-wrap: wrap; gap: 5px 9px; align-items: center; margin-top: 9px;
  font-size: 12px; font-weight: 600; }
.opinion-product-link { min-height: 40px; padding: 6px 10px; background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .5); color: #fff; font-size: 12px; }
.opinion-product-link:hover:not(:disabled) { background: rgba(255, 255, 255, .28); }
.opinion-more { width: 100%; min-height: 50px; scroll-snap-align: end; background: #193126; }
.opinion-empty { margin: 24px 16px; padding: 25px 20px; color: var(--ink); scroll-snap-align: start; }
.opinion-empty p { margin: 9px 0 16px; color: var(--muted); }
.opinion-comments { display: flex; flex-direction: column; gap: 9px; min-height: 60px; }
.opinion-comment { padding: 12px; border-radius: 13px; background: var(--canvas); overflow-wrap: anywhere; }
.opinion-comment .row { margin-bottom: 6px; }
.opinion-comment strong { font-size: 13px; }
.opinion-comment p { white-space: pre-wrap; font-size: 14px; }
.opinion-comment .tag { margin-top: 7px; }
.opinion-comment-form { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.opinion-comment-form textarea { width: 100%; min-height: 80px; resize: vertical; }
.opinion-comment.is-reply { margin-left: 14px; border-left: 3px solid var(--primary); }
.opinion-reply-target { color: var(--muted); font-size: 12px; font-weight: 600; }
.opinion-comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin-top: 5px; }
.opinion-comment-actions button { min-height: 44px; padding: 7px 9px; }
.opinion-comment-like { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.opinion-comment-like svg { width: 17px; height: 17px; }
.opinion-comment-like[aria-pressed="true"] { color: var(--primary-dark); font-weight: 700; }
.opinion-reply-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--primary-dark); font-size: 13px; }
.opinion-reply-status:empty { display: none; }
.opinion-reply-status button { min-height: 44px; }
.opinion-comments-more { width: 100%; min-height: 44px; }

/* Предпросмотр ограничен первыми 30 секундами; сервер сам обрезает исходник. */
.video-trim { display: flex; flex-direction: column; gap: 9px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.video-trim video { width: 100%; max-height: 220px; object-fit: contain; background: #101a16; border-radius: 10px; }
.video-trim .trim-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .opinions-feed { scroll-behavior: auto; scroll-snap-type: y proximity; }
  .opinion-heart { animation: opinion-heart-still .6s linear forwards; }
}
@keyframes opinion-heart-still {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}
@media (max-width: 350px) {
  .opinion-actions { right: 6px; bottom: 100px; gap: 5px; }
  .opinion-action { width: 46px; min-height: 46px; }
  .opinion-caption { right: 61px; left: 12px; }
  .tabbar button { font-size: 10px; }
}

.media-tile.wide { grid-column: 1 / -1; flex-direction: row; min-height: 48px; padding: 9px 12px; }
.media-tile.wide svg { width: 21px; height: 21px; }

.scan-intro { display: flex; flex-direction: column; gap: 6px; padding: 12px 1px 4px; }
.scan-intro h1 { font-size: clamp(21px, 5.8vw, 25px); letter-spacing: -.025em; line-height: 1.2; }
.scan-intro p { color: var(--muted); font-size: 14px; line-height: 1.5; }

.opinion-comment-delete { align-self: flex-start; min-height: 44px; margin-top: 3px; padding: 6px 10px; }

/* Жалоба доступна с клавиатуры и пальцем; компактная колонка не перекрывает подпись видео. */
.video-report-form { display: grid; gap: 9px; }
.video-report-option { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.video-report-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.video-report-option:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.video-report-option input { width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
.video-access-note { border-left: 4px solid var(--primary); font-size: 14px; line-height: 1.5; }
@media (max-height: 680px) {
  .opinion-actions { bottom: 80px; gap: 4px; }
  .opinion-action { min-height: 44px; }
}
/* Телефон горизонтально: колонка из шести кнопок (~290 px) выше самого слайда
 * (156–230 px) и уходила за верхний край — «Нравится» и «Комментарии» были
 * недоступны. Кнопки встают в ряд у верхнего края, подпись — на всю ширину
 * под ними. Центральная кнопка воспроизведения дублирует кнопку в ряду и
 * закрывала бы подпись, поэтому здесь скрыта. */
@media (max-height: 480px) {
  .opinion-actions { top: 8px; right: 8px; bottom: auto; flex-direction: row; gap: 4px; }
  .opinion-action { width: 44px; min-height: 44px; }
  .opinion-play { display: none; }
  .opinion-caption { right: 16px; bottom: 10px; max-height: calc(100% - 70px); }
  .opinion-caption h2 { margin: 4px 0 3px; font-size: 18px; }
  .opinion-caption p { -webkit-line-clamp: 2; }
}

.tag.first { background: var(--fs-warningbg); color: var(--fs-amber); }
.card.review.is-example { border: 1px dashed var(--fs-line-strong); background: var(--fs-soft); box-shadow: none; }

.first-call { display: grid; gap: 6px; border: 1px solid var(--fs-line); background: var(--fs-warningbg); }
.first-call-title { margin: 0; font-size: 16px; line-height: 1.3; }
.first-call p { margin: 0; }
.quick-stars { display: flex; gap: 4px; margin-top: 4px; }
.quick-star {
  min-width: 48px; min-height: 48px; padding: 0; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fs-star); font-size: 26px; line-height: 1; cursor: pointer;
  transition: transform .12s ease, background-color .12s ease;
}
/* Подсветка звёзд до наведённой: все звёзды тёмные, следующие за наведённой — светлые. */
.quick-stars:hover .quick-star { background: var(--fs-warningbg); }
.quick-star:hover ~ .quick-star { background: var(--surface); color: var(--fs-muted); }
.quick-star:hover { transform: translateY(-1px); }
.quick-star:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.nutrition { margin-top: 10px; display: grid; gap: 8px; }
.nutrition-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nutrition-title { font-weight: 700; font-size: 14px; }
.nutrition-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; }
.nutrition-cell { background: var(--primary-soft); border-radius: 12px; padding: 8px 6px; text-align: center; }
.nutrition-cell dt { font-size: 12px; color: var(--muted); }
.nutrition-cell dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.nutrition p { margin: 0; }

.reminder-slot:empty { display: none; }
.reminder { display: grid; gap: 8px; margin: 0; border: 1px solid var(--fs-line); }
.reminder-head { display: flex; gap: 12px; align-items: center; }
.reminder-photo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: var(--canvas); }
.reminder-title { margin: 0 0 2px; font-size: 16px; }
.reminder-head p { margin: 0; overflow-wrap: anywhere; }
.reminder-later { justify-self: start; min-height: 44px; }
@media (max-width: 360px) {
  .quick-star { min-width: 44px; min-height: 44px; font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .quick-star { transition: none; }
  .quick-star:hover { transform: none; }
}

/* ======================================================================
 * 0.7.0 — оболочка и общие компоненты нового интерфейса.
 * Идут после перенесённых блоков 0.6.x и при равной специфичности побеждают.
 * ==================================================================== */

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--fs-bg);
}

/* Полоса загрузки закреплена у верхнего края окна: при прокрутке она не
 * уезжает вместе со страницей, и ожидание ответа видно всегда. */
#progress {
  position: fixed;
  z-index: 45;
  top: env(safe-area-inset-top);
  left: 0;
  right: 0;
  height: 3px;
  pointer-events: none;
  background: transparent;
}
#progress.busy {
  background: linear-gradient(90deg, transparent, var(--fs-green), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: sweep 1s linear infinite;
}
@keyframes sweep { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ----------------------------------------------------------------- шапка */

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
  background: var(--fs-bg);
  border-bottom: 1px solid var(--fs-line);
}
.appbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  max-width: calc(var(--fs-container) + 2 * var(--fs-pad));
  min-height: 66px;
  margin: 0 auto;
  padding: 8px var(--fs-pad);
}
button.brand {
  gap: 10px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fs-text);
  text-align: left;
  justify-content: flex-start;
}
button.brand:hover:not(:disabled) { background: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--fs-lime);
  color: #153e30;
}
button .brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 21px; font-weight: 800; letter-spacing: -.05em; line-height: 1.1; }
.brand-text small {
  margin-top: 4px;
  color: var(--fs-muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .18em;
  line-height: 1;
  text-transform: uppercase;
}
.top-nav { display: none; }
.appbar-tools { display: flex; align-items: center; gap: 10px; min-width: 0; }
.region-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fs-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.region-pill svg { width: 16px; height: 16px; }
.region-pill span { overflow: hidden; text-overflow: ellipsis; }
button.account-button { display: none; }

/* Во время запроса кнопки навигации заблокированы, но не тускнеют: мигание всей
 * шапки и нижнего меню при каждом запросе отвлекает сильнее, чем помогает. */
.appbar button:disabled, .tabbar button:disabled { opacity: 1; cursor: progress; }

/* ------------------------------------------------------------- содержимое */

#screen {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--fs-container) + 2 * var(--fs-pad));
  margin: 0 auto;
  padding: 22px var(--fs-pad) 32px;
}
.screen { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.screen.narrow { width: 100%; max-width: 540px; margin: 0 auto; }

/* ------------------------------------------------------------------ подвал */

.site-footer { border-top: 1px solid var(--fs-line); background: var(--fs-bg); }
.site-footer:empty { display: none; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 20px;
  max-width: calc(var(--fs-container) + 2 * var(--fs-pad));
  margin: 0 auto;
  padding: 6px var(--fs-pad);
  color: var(--fs-muted);
  font-size: 12px;
}
.footer-note { display: none; line-height: 1.5; }
.footer-links { display: flex; gap: 20px; }
.footer-links button.text-button { min-height: 44px; padding: 8px 0; color: var(--fs-muted); font-size: 12px; font-weight: 650; }
.footer-links button.text-button:hover:not(:disabled) { color: var(--fs-green); }

/* ------------------------------------------------------------ нижнее меню */

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  background: var(--fs-bg);
  border-top: 1px solid var(--fs-line);
  box-shadow: none;
}
.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 54px;
  padding: 4px 2px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--fs-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}
.tab-icon { display: grid; place-items: center; }
.tabbar button svg { width: 22px; height: 22px; }
.tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar button[aria-current] { color: var(--fs-green); font-weight: 750; }
.tabbar button:hover:not(:disabled) { background: var(--fs-soft); color: var(--fs-green); }
.tabbar button:focus-visible { outline: 3px solid var(--fs-focus); outline-offset: -3px; }
/* Сканер — главная кнопка меню: тёмно-зелёная плашка с подписью внутри,
 * чуть приподнятая над строкой, как в макете. Ширина по содержимому, чтобы
 * плашка не растягивалась на всю колонку сетки. */
.tabbar button.scan-tab {
  justify-self: center;
  min-width: 66px;
  margin-top: -7px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--fs-green);
  color: var(--fs-on-green);
  font-weight: 700;
}
.tabbar button.scan-tab:hover:not(:disabled) { background: var(--fs-green-hover); color: var(--fs-on-green); }
.tabbar button.scan-tab[aria-current] { color: var(--fs-on-green); }
/* Внутренний контур на зелёной плашке был бы не виден — выносим его наружу. */
.tabbar button.scan-tab:focus-visible { outline-offset: 2px; }

/* --------------------------------------------------------- всплывашка */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 90;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(92vw, 520px);
  padding: 12px 16px;
  border-radius: 10px;
  background: #153e30;
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
  box-shadow: var(--fs-shadow);
}

/* -------------------------------------------------- заголовки и подписи */

.page-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 18px; }
.page-head-text { min-width: 0; flex: 1 1 320px; }
.eyebrow {
  color: var(--fs-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
  line-height: 1.4;
  text-transform: uppercase;
}
.page-title { margin: 8px 0 8px; font-size: 28px; overflow-wrap: anywhere; }
.page-lead { max-width: 580px; color: var(--fs-muted); font-size: 14px; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.section-title { margin: 0; font-size: 20px; font-weight: 750; }
.section-note { margin: 4px 0 0; color: var(--fs-muted); font-size: 12.5px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.subsection-title { font-size: 16px; }
.aside-title { margin: 0 0 12px; font-size: 20px; font-weight: 750; line-height: 1.3; }

/* --------------------------------------------------------------- метки */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--fs-greenbg);
  color: var(--fs-green);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
}
.tag.ok { background: var(--fs-greenbg); color: var(--fs-green); }
.tag.grey, .tag.soft, .tag.status-draft, .tag.status-archived { background: var(--fs-soft); color: var(--fs-muted); }
.tag.bad, .tag.status-rejected { background: var(--fs-dangerbg); color: var(--fs-danger); }
.tag.warn, .tag.first, .tag.status-pending { background: var(--fs-warningbg); color: var(--fs-amber); }
.tag.status-approved { background: var(--fs-greenbg); color: var(--fs-green); }
.tag.bonus { background: var(--fs-green); color: var(--fs-on-green); }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--fs-soft);
  color: var(--fs-text);
  font-size: 13px;
  line-height: 1.5;
}
.notice svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.notice.warning { background: var(--fs-warningbg); color: var(--fs-amber); }
.notice.small { font-size: 12.5px; }
.video-access-note { border-left: 4px solid var(--fs-amber); }

.card {
  background: var(--fs-bg);
  border: 1px solid var(--fs-line);
  border-radius: var(--fs-radius);
  padding: 16px;
  box-shadow: none;
}
.card.plain { border: 0; }

/* Пустое состояние: значок, заголовок, пояснение, действия. */
.empty-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 18px;
  border-radius: 20px;
  background: var(--fs-soft);
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
  border-radius: 20px;
  background: var(--fs-greenbg);
  color: var(--fs-green);
}
.empty-icon svg { width: 28px; height: 28px; }
.empty-title { font-size: 21px; line-height: 1.3; }
.empty-text { max-width: 420px; color: var(--fs-muted); font-size: 14px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-top: 6px; }
.empty-actions > p { flex-basis: 100%; }
.empty-inline { padding: 18px 0; color: var(--fs-muted); font-size: 14px; text-align: center; }

/* Строка «‹ Каталог · Молочные». */
.back-bar { display: flex; align-items: center; gap: 12px; min-width: 0; margin-bottom: -4px; color: var(--fs-muted); font-size: 13px; }
button.back-link {
  gap: 6px;
  min-height: 44px;
  padding: 8px 10px 8px 4px;
  border: 0;
  background: none;
  color: var(--fs-text);
  font-size: 14px;
  font-weight: 650;
}
button.back-link:hover:not(:disabled) { background: var(--fs-soft); color: var(--fs-green); }
button.back-link:disabled { opacity: .45; }
.crumb { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------- чипы */

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
button.chip {
  flex: 0 0 auto;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--fs-line);
  border-radius: 9px;
  background: var(--fs-bg);
  color: var(--fs-muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
button.chip svg { width: 16px; height: 16px; }
button.chip:hover:not(:disabled) { background: var(--fs-soft); color: var(--fs-text); }
button.chip[aria-pressed="true"] { background: var(--fs-dark); border-color: var(--fs-dark); color: #fff; }
button.chip[aria-pressed="true"]:hover:not(:disabled) { background: var(--fs-dark); color: #fff; }
button.chip.sub { background: var(--fs-greenbg); border-color: transparent; color: var(--fs-green); }
button.chip.sub[aria-pressed="true"] { background: var(--fs-green); border-color: var(--fs-green); color: var(--fs-on-green); }

/* На телефоне категории — одна строка с прокруткой до краёв экрана, чтобы
 * длинное дерево не занимало половину высоты; на широком экране — перенос. */
.category-chips {
  display: flex;
  gap: 8px;
  margin: 0 calc(-1 * var(--fs-pad));
  padding: 2px var(--fs-pad);
  overflow-x: auto;
  scrollbar-width: none;
  scroll-padding-inline: var(--fs-pad);
}
.category-chips::-webkit-scrollbar { display: none; }

/* --------------------------------------------- вкладки и переключатели */

.segmented {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--fs-line);
  border-radius: 14px;
  background: var(--fs-soft);
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
button.segment {
  flex: 0 0 auto;
  gap: 8px;
  min-height: 44px;
  padding: 9px 15px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fs-muted);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
button.segment:hover:not(:disabled) { background: transparent; color: var(--fs-green); }
button.segment[aria-selected="true"] { background: var(--fs-bg); color: var(--fs-green); box-shadow: var(--fs-shadow-soft); }
button.segment svg { width: 19px; height: 19px; }
.segment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--fs-soft);
  color: var(--fs-muted);
  font-size: 11px;
  font-weight: 700;
}
button.segment[aria-selected="true"] .segment-badge { background: var(--fs-greenbg); color: var(--fs-green); }
.segmented button.segment .segment-badge { background: var(--fs-bg); }

/* Вкладки с подчёркиванием (карточка продукта и профиль). */
.tabs-line, .segmented.profile-tabs {
  display: flex;
  gap: 24px;
  width: 100%;
  padding: 0;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid var(--fs-line);
  border-radius: 0;
  background: none;
  scrollbar-width: none;
}
.tabs-line::-webkit-scrollbar { display: none; }
.tabs-line button.segment, .profile-tabs button.segment {
  gap: 6px;
  min-height: 48px;
  padding: 12px 0;
  border-radius: 0;
  background: none;
  color: var(--fs-muted);
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
}
.tabs-line button.segment[aria-selected="true"], .profile-tabs button.segment[aria-selected="true"] {
  background: none;
  color: var(--fs-green);
  box-shadow: inset 0 -2px 0 var(--fs-green);
}
.tabs-line button.segment:focus-visible, .profile-tabs button.segment:focus-visible { outline-offset: -3px; }
.tabs-line .segment-badge, .profile-tabs .segment-badge { background: var(--fs-soft); }

/* --------------------------------------------------------- поиск */

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 50px;
  padding: 0 6px 0 14px;
  border: 1px solid var(--fs-line);
  border-radius: 11px;
  background: var(--fs-bg);
}
.search-field:hover { border-color: var(--fs-line-strong); }
.search-field:focus-within { outline: 3px solid var(--fs-focus); outline-offset: 1px; border-color: var(--fs-green); }
.search-field input[type="search"], .search-field input {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 12px 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.search-field input:focus-visible { outline: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-icon { width: 19px; height: 19px; color: var(--fs-muted); }
/* Поиск в листе «Язык отзывов» выглядит так же, как поле поиска каталога. */
.search { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border: 1px solid var(--fs-line); border-radius: 11px; background: var(--fs-bg); color: var(--fs-muted); }
.search:focus-within { outline: 3px solid var(--fs-focus); outline-offset: 1px; border-color: var(--fs-green); }
.search input { flex: 1; min-width: 0; min-height: 0; padding: 11px 0; border: 0; background: none; }
.search input:focus-visible { outline: none; }
/* Пустая ячейка вместо фонарика держит кнопки сканера на своих местах. */
.round-button.spacer { visibility: hidden; }
/* Очистка — второстепенное действие: без заливки, чтобы не спорить с полем. */
button.search-clear {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fs-muted);
}
button.search-clear:hover:not(:disabled) { background: var(--fs-soft); color: var(--fs-text); }
button.search-clear svg { width: 18px; height: 18px; }

/* --------------------------------------------------------- каталог */

.catalog-hero { display: block; }
.catalog-hero .eyebrow { display: none; }
.hero-title { margin: 0 0 10px; font-size: 31px; line-height: 1.1; }
.hero-title > span { display: block; }
.hero-title .accent { color: var(--fs-green); }
button.hero-scan { display: none; }

.search-row { display: flex; align-items: stretch; gap: 6px; }
.search-row .search-field { flex: 1; min-height: 50px; }
button.search-submit { display: none; }
button.filter-button { position: relative; min-width: 50px; min-height: 50px; padding: 0 12px; }
button.filter-button svg { width: 20px; height: 20px; }
.filter-label { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.filter-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--fs-green);
  color: var(--fs-on-green);
  font-size: 11px;
  line-height: 1;
}
button.mobile-scan { min-height: 48px; margin-top: -6px; }

.catalog-results { display: flex; flex-direction: column; gap: 16px; }
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.results-head > div:first-child { min-width: 0; }
.sort-box { display: flex; align-items: center; gap: 8px; flex: none; }
.sort-box label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sort-box select { width: auto; max-width: 150px; min-height: 44px; padding: 9px 32px 9px 12px; border-radius: 8px; font-size: 14px; }
button.more-button { margin-top: 4px; }

.note-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 16px;
  border-radius: 13px;
  background: var(--fs-soft);
}
.note-icon { color: var(--fs-green); }
.note-icon svg { width: 28px; height: 28px; }
.note-text { display: flex; flex-direction: column; gap: 3px; flex: 1 1 200px; min-width: 0; }
.note-text strong { font-size: 14px; }
.note-text span { color: var(--fs-muted); font-size: 13px; }
.note-card button.text-button { gap: 6px; margin-left: 42px; }

/* ------------------------------------------------------- плитка товара */

.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
.product-grid.is-empty { display: block; }
.product-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
/* Фото занимает всю зону плитки (по просьбе — «максимум места»); пропорции
 * зоны чуть шире квадрата, как в макете, чтобы под ней помещались две строки названия. */
.product-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / .92;
  overflow: hidden;
  border: 1px solid var(--fs-line);
  border-radius: 14px;
  background: var(--fs-soft);
  color: var(--fs-green);
  cursor: pointer;
  touch-action: pan-y;
}
.product-media img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.product-media.fit-contain img { object-fit: contain; }
.product-media.fit-contain::before {
  content: '';
  position: absolute;
  inset: -12px;
  background: var(--tile-backdrop) center / cover no-repeat;
  filter: blur(14px) saturate(1.1);
  opacity: .5;
}
.placeholder-icon { width: 42px; height: 42px; opacity: .6; stroke-width: 1.5; }
.product-media button.gallery-arrow {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 30, 23, .58);
  color: #fff;
}
.product-media button.gallery-arrow:hover:not(:disabled) { background: rgba(18, 30, 23, .82); }
.product-media button.gallery-arrow svg { width: 18px; height: 18px; }
.gallery-arrow.prev { left: 6px; }
.gallery-arrow.next { right: 6px; }
.gallery-count {
  position: absolute;
  z-index: 3;
  left: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(18, 30, 23, .78);
  color: #fff;
  font-size: 11px;
}
button.save-toggle {
  position: absolute;
  z-index: 3;
  top: 7px;
  right: 7px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--fs-line);
  border-radius: 10px;
  background: var(--fs-bg);
  color: var(--fs-muted);
}
button.save-toggle:hover:not(:disabled) { background: var(--fs-bg); color: var(--fs-green); border-color: var(--fs-line-strong); }
button.save-toggle[aria-pressed="true"], button.save-toggle[aria-pressed="true"]:hover:not(:disabled) { background: var(--fs-lime); border-color: var(--fs-lime); color: #153e30; }
button.product-link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  min-height: 0;
  padding: 11px 0 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--fs-text);
  font-weight: 400;
  text-align: left;
}
button.product-link:hover:not(:disabled) { background: none; }
button.product-link:hover .product-name { color: var(--fs-green); text-decoration: underline; text-underline-offset: 4px; }
.product-brand {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  color: var(--fs-muted);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-name {
  display: -webkit-box;
  min-height: 2.8em;
  overflow: hidden;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rating-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 5px; margin-top: 8px; color: var(--fs-muted); font-size: 12px; }
.rating-line svg { width: 14px; height: 14px; }
.rating-line .rating-star { color: var(--fs-star); }
.rating-line strong { color: var(--fs-text); font-size: 13px; font-weight: 750; }
.rating-line .rating-count { color: var(--fs-muted); font-size: 12px; }

.product-card.skeleton .product-media { cursor: default; border-color: transparent; animation: fs-pulse 1.4s ease-in-out infinite; }
.sk-line { display: block; height: 12px; margin-top: 12px; border-radius: 6px; background: var(--fs-soft); animation: fs-pulse 1.4s ease-in-out infinite; }
.sk-line.short { width: 45%; }
@keyframes fs-pulse { 50% { opacity: .55; } }

.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--fs-line);
  border-top-color: var(--fs-green);
  border-radius: 50%;
  animation: fs-spin .8s linear infinite;
}
@keyframes fs-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------- строка товара в списке */

button.product-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--fs-line);
  border-radius: 0;
  background: none;
  color: var(--fs-text);
  font-weight: 400;
  text-align: left;
}
button.product-row:hover:not(:disabled) { background: none; }
button.product-row:hover .product-row-name { color: var(--fs-green); text-decoration: underline; text-underline-offset: 4px; }
.row-list > button.product-row:last-child { border-bottom: 0; }
.product-thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--fs-line);
  border-radius: 11px;
  background: var(--fs-soft);
  color: var(--fs-green);
}
.product-thumb img { width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.product-thumb svg { width: 24px; height: 24px; opacity: .7; }
.product-row-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.product-row-body .product-brand { margin: 0; }
.product-row-name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.01em;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.product-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--fs-muted); font-size: 12.5px; }
.product-row-meta svg { width: 14px; height: 14px; }
.row-chevron { width: 18px; height: 18px; color: var(--fs-muted); }
button .row-chevron { width: 18px; height: 18px; }

/* ----------------------------------------------- подсказки со значками */

.tip-list { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.tip-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.5; }
.tip-icon { display: grid; place-items: center; flex: none; margin-top: 1px; color: var(--fs-green); }
.tip-icon svg { width: 20px; height: 20px; }
.tip-list li > span:not(.tip-icon) > strong { display: block; margin-bottom: 3px; font-size: 15px; }
.tip-list li > span:not(.tip-icon) > span { display: block; color: var(--fs-muted); font-size: 14px; }

/* -------------------------------------------------------- листы и диалоги */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 46, 35, .45);
}
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  max-height: 92dvh;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  overflow: auto;
  border-radius: 18px 18px 0 0;
  background: var(--fs-bg);
  color: var(--fs-text);
  box-shadow: var(--fs-shadow);
  gap: 14px;
}
.sheet > .row.between { flex-wrap: nowrap; align-items: flex-start; }
.sheet .sheet-title { min-width: 0; font-size: 21px; font-weight: 750; letter-spacing: -.03em; line-height: 1.25; padding-top: 6px; }
.sheet-body { display: flex; flex-direction: column; gap: 12px; }
.sheet-body > p { font-size: 14px; }
.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--fs-line);
}
.sheet-actions button { flex: 1 1 140px; }
.confirm-sheet { max-width: 440px; }
.confirm-sheet .row.end button { flex: 1 1 120px; }

/* Фильтры каталога. */
.sheet-body.filters { gap: 20px; }
.filters legend { margin-bottom: 8px; font-size: 15px; font-weight: 750; }
.filter-list { display: flex; flex-direction: column; gap: 2px; }
.filter-list.compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.filter-option:hover { background: var(--fs-soft); }
.filter-option:has(input:checked) { background: var(--fs-greenbg); color: var(--fs-green); font-weight: 650; }
.filter-option:focus-within { outline: 3px solid var(--fs-focus); outline-offset: -1px; }
.filter-option input:focus-visible { outline: none; }
.filter-option.sub { padding-left: 36px; font-size: 13.5px; }
.filter-option-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.filter-count { color: var(--fs-muted); font-size: 12px; }

/* Источники и помощь. */
.source-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--fs-line); }
.source-item:last-child { border-bottom: 0; }
.source-item h3 { margin-bottom: 4px; font-size: 15px; }
.source-item p { color: var(--fs-muted); font-size: 14px; }
.source-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--fs-greenbg); color: var(--fs-green); }
.source-links { margin-top: 6px; font-size: 13px; }
.faq { gap: 0; }
.faq-item { border-bottom: 1px solid var(--fs-line); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { width: 18px; height: 18px; color: var(--fs-muted); transition: transform .15s; }
.faq-item[open] summary svg { transform: rotate(180deg); }
.faq-item p { padding: 0 0 14px; color: var(--fs-muted); font-size: 14px; }
.faq > button { margin-top: 16px; }

/* ======================================================================
 * 0.7.0 — экраны: сканер, история, профиль, мнения, карточка продукта,
 * редактор отзыва, вход и добавление товара. Адаптив — в конце файла.
 * ==================================================================== */

a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--fs-green);
  color: var(--fs-on-green);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
a.button:hover { background: var(--fs-green-hover); }
a.button.block { display: flex; width: 100%; }
.lead-text { font-size: 15px; line-height: 1.65; }
.button-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* Миниатюры товара: значок категории на мягкой подложке, если фото нет. */
.product-thumb.placeholder, .tile.placeholder, .editor-thumb.placeholder { color: var(--fs-green); }

/* ---------------------------------------------------------------- сканер */

.scan-modes { margin: 2px 0 0; }
.scan-panel { min-width: 0; }
.scan-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.scan-camera {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 22px;
  background: var(--fs-dark);
  color: #fff;
  text-align: center;
}
/* Верхняя строка: что сканируем — слева, состояние камеры — справа. */
.scan-camera-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}
.scan-camera-hint, .scan-camera-label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.scan-camera-label { color: rgba(255, 255, 255, .7); text-align: right; }
.scan-camera-top svg { width: 15px; height: 15px; flex: none; }
/* Рамка видоискателя по центру плашки, уголки — по её краям. */
.scan-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(235px, 100%);
  height: 140px;
  margin: 28px auto;
  color: var(--fs-lime);
}
.scan-corner { position: absolute; width: 25px; height: 25px; border: 0 solid currentColor; pointer-events: none; }
.scan-corner.tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 8px; }
.scan-corner.tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 8px; }
.scan-corner.bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 8px; }
.scan-corner.br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 8px; }
/* Значок в рамке лишь подсказывает, что сюда попадёт код, поэтому он мелкий и
 * приглушённый (как в макете) и не спорит с заголовком и кнопкой. */
.scan-camera-icon svg { width: 20px; height: 20px; stroke-width: 1.8; opacity: .8; }
.scan-camera-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 6px 4px;
}
.scan-camera h2 { color: #fff; font-size: 22px; line-height: 1.25; }
.scan-camera p { max-width: 360px; color: rgba(255, 255, 255, .82); font-size: 14px; }
.scan-camera button.lime { width: 100%; max-width: 340px; min-height: 50px; margin-top: 6px; font-size: 15px; }
.scan-camera button.lime:focus-visible { outline-color: var(--fs-lime); outline-offset: 3px; }
.scan-camera .scan-privacy {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 340px;
  color: rgba(255, 255, 255, .74);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}
.scan-privacy svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }

.scan-aside { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.scan-aside > p { font-size: 14px; }
.scan-fallback { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--fs-line); }
.scan-fallback h3 { margin-bottom: 4px; font-size: 15px; }
.scan-aside button.text-button { gap: 8px; min-height: 44px; }

.scan-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 20px;
  border: 2px dashed var(--fs-line-strong);
  border-radius: 20px;
  background: var(--fs-soft);
  text-align: center;
}
.scan-drop-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 20px; background: var(--fs-greenbg); color: var(--fs-green); }
.scan-drop-icon svg { width: 30px; height: 30px; }
.scan-drop h2 { font-size: 21px; }
.scan-drop p { max-width: 420px; color: var(--fs-muted); font-size: 14px; }
.scan-drop .button-row { margin-top: 6px; }

.scan-manual { padding: 20px; border: 1px solid var(--fs-line); border-radius: 20px; }
.manual-form { display: flex; flex-direction: column; gap: 10px; }
.manual-row { display: flex; gap: 8px; }
.manual-row input { flex: 1; min-height: 50px; font-size: 18px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.manual-row button { flex: none; min-height: 50px; }
.barcode-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px;
  border-radius: 14px;
  background: var(--fs-soft);
  color: var(--fs-text);
}
/* Полоски штрихкода нарисованы градиентом: без картинки и в цвете текста темы. */
.barcode-bars {
  width: 190px;
  max-width: 100%;
  height: 60px;
  background: repeating-linear-gradient(90deg,
    currentColor 0 2px, transparent 2px 4px, currentColor 4px 5px, transparent 5px 8px,
    currentColor 8px 11px, transparent 11px 12px, currentColor 12px 13px, transparent 13px 16px);
}
.barcode-digits { font-size: 14px; font-weight: 650; letter-spacing: .18em; }
.reminder-slot:empty { display: none; }
.scan-note { max-width: 640px; }

/* -------------------------------------------------------------- история */

.history-tools { display: flex; flex-direction: column; gap: 12px; }
.history-tools .search-field { width: 100%; max-width: 490px; min-height: 48px; }
.history-list { display: flex; flex-direction: column; gap: 20px; }
.history-group { display: flex; flex-direction: column; }
.history-group .day-label { margin: 0 0 2px; color: var(--fs-muted); font-size: 14px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.suggestions { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.suggestions-slot:empty { display: none; }
.suggestions .section-head { flex-wrap: wrap; }
.suggestions button.text-button { gap: 6px; }

/* -------------------------------------------------------------- профиль */

.welcome-card {
  display: grid;
  gap: 24px;
  padding: 22px;
  border-radius: 20px;
  background: var(--fs-soft);
}
.welcome-text { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.welcome-text h2 { font-size: 24px; }
.welcome-text > p:not(.small) { color: var(--fs-muted); font-size: 15px; }
.benefit-list { display: flex; flex-direction: column; gap: 16px; list-style: none; }
.benefit-list li { display: flex; align-items: flex-start; gap: 12px; }
.benefit-list li > span:not(.tip-icon) { display: flex; flex-direction: column; gap: 2px; }
.benefit-list strong { font-size: 15px; }
.benefit-list li > span:not(.tip-icon) > span { color: var(--fs-muted); font-size: 14px; }

.profile-card { display: flex; align-items: center; gap: 16px; }
.profile-card button.avatar-button {
  position: relative;
  flex: 0 0 72px;
  display: block;
  width: 72px;
  height: 72px;
  min-height: 72px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fs-lime);
}
.profile-card .avatar-button > img, .profile-card .avatar-button > .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--fs-lime);
  color: #153e30;
  font-size: 26px;
  font-weight: 750;
}
.profile-card .avatar-camera { border-color: var(--fs-bg); background: var(--fs-green); color: var(--fs-on-green); }
.profile-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.profile-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.profile-name { font-size: 25px; overflow-wrap: anywhere; }
.profile-summary { color: var(--fs-text); font-size: 14px; font-weight: 600; }
button.profile-edit { flex: none; align-self: flex-start; }
.profile-panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-tools { display: flex; justify-content: flex-end; margin-bottom: -6px; }
.panel-tools button.text-button { gap: 6px; }
.card-list { display: flex; flex-direction: column; gap: 14px; }

.own-review-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--fs-line);
  border-radius: 16px;
  background: var(--fs-bg);
}
.own-review-top { display: flex; align-items: flex-start; gap: 10px; }
.own-review-top button.product-row { flex: 1; min-width: 0; padding: 0; border: 0; }
.own-review-top .row-chevron { display: none; }
.own-review-top > .tag { flex: none; max-width: 45%; white-space: normal; text-align: center; }
.own-review-text { font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.own-review-reason {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--fs-dangerbg);
  color: var(--fs-danger);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
.own-review-reason svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.own-review-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--fs-muted); font-size: 12.5px; }
.own-review-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.own-review-meta svg { width: 15px; height: 15px; }
.own-review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.own-review-actions button.text-button { margin-left: auto; padding-inline: 8px; }
.contributed-product .own-review-actions { margin-top: 0; }

.profile-menu { display: flex; flex-direction: column; margin-top: 6px; border-top: 1px solid var(--fs-line); }
button.menu-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--fs-line);
  border-radius: 0;
  background: none;
  color: var(--fs-text);
  font-weight: 400;
  text-align: left;
}
button.menu-row:hover:not(:disabled) { background: none; }
button.menu-row:hover .menu-text strong { color: var(--fs-green); }
button.menu-row:focus-visible { outline-offset: -3px; }
.menu-icon { display: grid; place-items: center; flex: none; color: var(--fs-muted); }
.menu-icon svg { width: 21px; height: 21px; }
.menu-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.menu-text strong { font-size: 15px; font-weight: 650; }
.menu-text span { color: var(--fs-muted); font-size: 12.5px; }
button.menu-row.danger-row .menu-icon, button.menu-row.danger-row .menu-text strong { color: var(--fs-danger); }

.sheet-body.settings { gap: 0; }
.settings-group { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--fs-line); }
.settings-group:last-child { border-bottom: 0; }
.settings-group h3 { font-size: 15px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.settings-row > div { min-width: 0; }
.settings-value { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
/* Переключатель сам по себе маленький; невидимая зона вокруг доводит цель нажатия до 44px. */
button.switch { position: relative; overflow: visible; background: var(--fs-line-strong); }
button.switch::before { content: ''; position: absolute; inset: -9px -4px; }
button.switch[aria-checked="true"] { background: var(--fs-green); }
button.switch:hover:not(:disabled) { filter: brightness(.95); }
.status-list { display: flex; flex-direction: column; }

/* --------------------------------------------------------------- мнения */

.opinions-screen { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.opinions-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 18px; }
.page-lead .opinion-count:not(:empty)::before { content: '· '; }
button.add-video { flex: none; }
.opinion-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 240px;
  color: var(--fs-muted);
  font-size: 14px;
}
.opinions-screen:not(.has-feed) .opinions-feed { min-width: 0; }
.opinions-screen:not(.has-feed) .opinions-feed .empty-block { min-height: 310px; justify-content: center; }
.opinions-screen:not(.has-feed) .opinions-feed { background: none; overflow: visible; }
.interest-tips { display: flex; flex-direction: column; gap: 6px; }
.opinions-aside .tip-list { margin-top: 8px; }

/* Лента с роликами на телефоне: экран между шапкой и нижним меню целиком
 * отдан видео, от заголовка остаётся тонкая полоса со счётчиком и кнопкой
 * «Добавить». Подсказки и подвал в этом режиме скрыты. */
@media (max-width: 899px) {
  body.opinions-mode { overflow: hidden; }
  .opinions-mode #app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .opinions-mode #screen { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; max-width: none; padding: 0; overflow: hidden; }
  .opinions-mode .site-footer { display: none; }
  .opinions-screen.has-feed { flex: 1; min-height: 0; gap: 0; background: #101a16; }
  .opinions-screen.has-feed .opinions-head {
    flex: none;
    flex-wrap: nowrap;
    align-items: center;
    min-height: 44px;
    padding: 4px 8px 4px 16px;
    background: #193126;
    color: #fff;
  }
  .opinions-screen.has-feed .opinions-head .eyebrow,
  .opinions-screen.has-feed .opinions-head .page-lead > span:not(.opinion-count) { display: none; }
  /* Заголовок остаётся для экранного диктора, но не занимает место. */
  .opinions-screen.has-feed .opinions-head .page-title {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .opinions-screen.has-feed .opinions-head .page-head-text { flex: 1; min-width: 0; }
  .opinions-screen.has-feed .opinions-head .page-lead { color: rgba(255, 255, 255, .85); font-size: 12px; font-weight: 650; }
  .opinions-screen.has-feed .page-lead .opinion-count::before { content: ''; }
  .opinions-screen.has-feed button.add-video {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .08);
    color: #fff;
  }
  .opinions-screen.has-feed button.add-video:hover:not(:disabled) { background: rgba(255, 255, 255, .18); }
  .opinions-screen.has-feed button.add-video:focus-visible { outline-color: var(--fs-lime); }
  .opinions-screen.has-feed .add-video-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .opinions-screen.has-feed .opinions-aside { display: none; }
  .opinions-screen.has-feed .opinions-feed { flex: 1; min-height: 0; }
}

.reel-viewer button.round-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.reel-viewer button.round-button:hover:not(:disabled) { background: rgba(255, 255, 255, .24); }
.reel-viewer button.round-button svg { width: 20px; height: 20px; }
button.opinion-action, button.opinion-play { color: #fff; }
button.opinion-more { border: 0; border-radius: 0; color: #fff; }
button.opinion-more:hover:not(:disabled) { background: #22402f; }

/* ----------------------------------------------------- карточка продукта */

.product-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.hero-media { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hero-photo {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 250px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--fs-line);
  border-radius: 18px;
  background: var(--fs-soft);
  color: var(--fs-green);
}
button.hero-photo { cursor: zoom-in; }
button.hero-photo:hover:not(:disabled) { background: var(--fs-soft); border-color: var(--fs-line-strong); }
.hero-photo img { width: 100%; max-height: 230px; object-fit: contain; }
.hero-photo.is-placeholder { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.hero-photo.is-placeholder .placeholder-icon { width: 56px; height: 56px; }
.zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(18, 30, 23, .74);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}
.zoom-hint svg { width: 15px; height: 15px; }
.hero-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
button.hero-thumb {
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  min-height: 62px;
  padding: 4px;
  border: 1px solid var(--fs-line);
  border-radius: 10px;
  background: var(--fs-soft);
}
button.hero-thumb:hover:not(:disabled) { background: var(--fs-soft); border-color: var(--fs-green); }
.hero-thumb img { width: 100%; height: 100%; object-fit: contain; }
.photo-credit { color: var(--fs-muted); font-size: 12px; }
a.photo-credit { align-self: flex-start; }

.product-summary { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.product-title { font-size: 27px; line-height: 1.15; overflow-wrap: anywhere; }
.product-meta { color: var(--fs-muted); font-size: 13px; }
.product-summary .notice { font-size: 12.5px; }
.rating-block { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.rating-text { display: flex; flex-direction: column; min-width: 0; }
.rating-text strong { font-size: 17px; font-weight: 750; }
button.help-button { margin-left: auto; flex: none; }
.star-meter { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.star-meter svg { width: 22px; height: 22px; }
.star-meter svg.on { color: var(--fs-star); fill: currentColor; }
.star-meter svg.off { color: var(--fs-line-strong); }
.star-meter.small svg { width: 14px; height: 14px; }
.product-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.product-actions button { min-height: 48px; }
button.save-button[aria-pressed="true"], button.save-button[aria-pressed="true"]:hover:not(:disabled) {
  background: var(--fs-lime);
  border-color: var(--fs-lime);
  color: #153e30;
}
.barcode-line { color: var(--fs-muted); font-size: 12px; }

.product-panel { min-width: 0; padding-top: 4px; }
.product-panel:focus-visible { outline-offset: 6px; border-radius: 6px; }
.product-overview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.overview-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.try-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px;
  border-radius: 14px;
  background: var(--fs-soft);
}
.try-card .aside-title { margin: 0; font-size: 18px; }
.try-card p:not(.small) { font-size: 14px; }
.product-composition { display: flex; flex-direction: column; gap: 18px; }
.ingredients-block { display: flex; flex-direction: column; gap: 10px; }
.ingredients { font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.nutrition-grid dd { font-size: 21px; font-weight: 750; }

.product-reviews { display: flex; flex-direction: column; gap: 14px; }
.video-rail:empty { display: none; }
.video-rail { display: flex; flex-direction: column; gap: 10px; }
.reviews-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.review-list { display: flex; flex-direction: column; gap: 12px; }
.card.review { display: flex; flex-direction: column; gap: 10px; border-radius: 14px; }
.review-author { flex: 1; min-width: 0; }
.review-author .who { overflow-wrap: anywhere; }
.review-score { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }

/* ------------------------------------------------------ редактор отзыва */

.editor-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.editor-head .page-head { flex: 1 1 320px; }
.editor-head > .tag { margin-top: 4px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.editor-product {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--fs-line);
  border-radius: 14px;
  background: var(--fs-soft);
}
.editor-thumb {
  grid-row: 1 / span 4;
  display: grid;
  place-items: center;
  width: 64px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--fs-line);
  border-radius: 11px;
  background: var(--fs-bg);
}
.editor-thumb img { width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.editor-thumb svg { width: 26px; height: 26px; }
.editor-product .product-brand { margin: 0; }
.editor-product-name { font-size: 15px; font-weight: 750; line-height: 1.35; overflow-wrap: anywhere; }
.editor-product > .tag { justify-self: start; margin-top: 4px; }
.editor-form { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.editor-form > button.text-button { align-self: center; }

.rate-field { display: flex; flex-direction: column; gap: 10px; }
.rate-field legend { margin-bottom: 10px; }
.rate-stars { display: flex; flex-wrap: wrap; gap: 8px; }
/* Звёзды — подписи к скрытым радиокнопкам: крупная цель нажатия, стрелки
 * клавиатуры работают как у обычной группы, фокус рисуем на подписи. */
.rate-star {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--fs-line);
  border-radius: 10px;
  background: var(--fs-soft);
  color: var(--fs-line-strong);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.rate-star svg { width: 24px; height: 24px; fill: currentColor; }
.rate-star:hover { border-color: var(--fs-line-strong); color: var(--fs-star); }
.rate-star.on { border-color: transparent; background: var(--fs-warningbg); color: var(--fs-star); }
.rate-star:has(input:focus-visible) { outline: 3px solid var(--fs-focus); outline-offset: 2px; }
.rate-star:has(input:disabled) { cursor: default; opacity: .6; }
.rating-word { font-size: 14px; font-weight: 650; }

.more-fields { border: 1px solid var(--fs-line); border-radius: 12px; }
.more-fields > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 10px 14px;
  color: var(--fs-green);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}
.more-fields > summary::-webkit-details-marker { display: none; }
.summary-icon { width: 18px; height: 18px; transition: transform .15s; }
.more-fields[open] .summary-icon { transform: rotate(180deg); }
.more-fields > .field { padding: 0 14px 14px; }

.upload-zone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1.5px dashed var(--fs-line-strong);
  border-radius: 14px;
  background: var(--fs-soft);
}
.upload-head { display: flex; align-items: center; gap: 10px; }
.upload-head > span:nth-child(2) { flex: 1; min-width: 0; }
.upload-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--fs-greenbg); color: var(--fs-green); }
.upload-icon svg { width: 20px; height: 20px; }
.upload-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
button.upload-option {
  flex-direction: column;
  gap: 6px;
  min-height: 74px;
  padding: 10px 8px;
  border: 1px solid var(--fs-line);
  border-radius: 12px;
  background: var(--fs-bg);
  color: var(--fs-text);
  font-size: 13px;
  font-weight: 650;
}
button.upload-option svg { width: 22px; height: 22px; color: var(--fs-green); }
button.upload-option:hover:not(:disabled) { background: var(--fs-bg); border-color: var(--fs-green); color: var(--fs-green); }
.thumb-glyph { display: grid; place-items: center; width: 100%; height: 100%; background: var(--fs-soft); color: var(--fs-muted); }
.thumb-glyph svg { width: 26px; height: 26px; }
.trim-box { display: flex; flex-direction: column; gap: 10px; }
.trim-box:empty { display: none; }
.geo-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.geo-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; }
.geo-label svg { width: 17px; height: 17px; color: var(--fs-green); }
.form-actions { display: flex; flex-direction: column-reverse; gap: 10px; padding-top: 18px; border-top: 1px solid var(--fs-line); }
.form-actions button { width: 100%; min-height: 50px; }

/* ------------------------------------------------ вход и новый продукт */

.login-screen, .add-product-screen { gap: 16px; }
.auth-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px;
  border: 1px solid var(--fs-line);
  border-radius: 20px;
  background: var(--fs-bg);
}
.auth-card h1 { font-size: 24px; }
.auth-card .login-art svg { color: var(--fs-green); }
.add-product-screen > .card { display: flex; flex-direction: column; gap: 8px; }

/* ================================================================ адаптив */

/* Очень узкие экраны (≈320 px): плотнее поля и сетка. */
/* На самых узких телефонах обе подписи над рамкой не помещаются в строку и
 * переносились, разрывая её. Оставляем по одной строке: мельче шрифт, а значок
 * у «Камера не включена» убираем — состояние и так понятно из текста. */
@media (max-width: 380px) {
  .scan-camera { padding: 18px; }
  .scan-camera-top { gap: 8px; font-size: 11px; }
  .scan-camera-hint, .scan-camera-label { white-space: nowrap; }
  .scan-camera-label svg { display: none; }
}
@media (max-width: 350px) {
  :root { --fs-pad: 14px; }
  #screen { padding-top: 18px; }
  .hero-title { font-size: 27px; }
  .product-name { font-size: 14px; }
  .product-grid { gap: 18px 10px; }
  .tabbar button { font-size: 10px; }
  .tabbar button.scan-tab { min-width: 58px; padding: 8px 10px; }
  .rate-star { width: 42px; height: 42px; }
  .rate-stars { gap: 6px; }
  .manual-row { flex-direction: column; }
  .upload-options { grid-template-columns: minmax(0, 1fr); }
  .sort-box select { max-width: 120px; }
}

/* Телефон: только значок у второстепенных кнопок, где подпись дублирует смысл. */
@media (max-width: 619px) {
  /* Четыре вкладки профиля не помещаются в 390 px вместе со значками: на
   * телефоне оставляем подписи и счётчики, а полоса прокручивается вбок. */
  .profile-tabs button.segment svg { display: none; }
  .product-actions .save-button span,
  button.profile-edit span {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .product-actions button.save-button { width: 48px; padding: 0; }
  button.profile-edit { width: 44px; padding: 0; }
  .profile-card { align-items: flex-start; }
  .scan-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .scan-modes button.segment { flex-direction: column; gap: 4px; min-height: 62px; padding: 8px 4px; font-size: 12px; white-space: normal; line-height: 1.2; }
  .scan-modes button.segment svg { width: 20px; height: 20px; }
  .tabs-line, .segmented.profile-tabs { gap: 18px; }
  .tabs-line button.segment, .profile-tabs button.segment { font-size: 13px; }
  .own-review-actions button:not(.text-button) { flex: 1 1 auto; }
  .reviews-head .row.tight { width: 100%; }
  .reviews-head .row.tight button { flex: 1 1 auto; }
}

/* Планшет и шире: поля страницы больше, у героя каталога появляется плитка
 * «У продуктовой полки?», чипы категорий переносятся вместо прокрутки. */
@media (min-width: 620px) {
  :root { --fs-pad: 28px; }
  #screen { padding-top: 28px; padding-bottom: 40px; }
  .screen { gap: 22px; }
  .page-title { font-size: 30px; }
  .page-lead { font-size: 15px; }
  .catalog-hero { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 26px; align-items: stretch; }
  .catalog-hero .eyebrow { display: block; margin-bottom: 8px; }
  /* Слоган всегда в две строки, как в макете: вторая фраза — отдельный акцент. */
  .hero-title { font-size: 36px; }
  button.hero-scan {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 4px;
    min-height: 170px;
    padding: 22px;
    border: 0;
    border-radius: 18px;
    background: var(--fs-greenbg);
    color: var(--fs-green);
    text-align: left;
  }
  button.hero-scan:hover:not(:disabled) { background: var(--fs-greenbg); filter: brightness(.97); }
  .hero-scan-icon { margin-bottom: auto; }
  .hero-scan-icon svg { width: 44px; height: 44px; stroke-width: 1.35; }
  .hero-scan strong { font-size: 16px; }
  .hero-scan span:last-child { color: var(--fs-text); font-size: 13px; font-weight: 500; }
  button.mobile-scan { display: none; }
  .search-row { gap: 9px; }
  .search-row .search-field, button.filter-button, button.search-submit { min-height: 53px; }
  button.search-submit { display: inline-flex; padding-inline: 24px; }
  button.filter-button { padding: 0 16px; }
  .filter-label { position: static !important; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; }
  .filter-badge { position: static; }
  .category-chips { flex-wrap: wrap; margin: 0; padding: 2px 0; overflow: visible; }
  .sort-box label { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; color: var(--fs-muted); font-size: 12px; }
  .sort-box select { max-width: 190px; font-size: 13px; min-height: 40px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 14px; }
  .note-card { flex-wrap: nowrap; padding: 20px; gap: 17px; }
  .note-card button.text-button { margin-left: 0; flex: none; }
  .crumb { display: inline; }
  .crumb::before { content: '·'; margin-right: 12px; }
  .empty-block { padding: 36px 24px; }
  .history-tools { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .history-tools .search-field { flex: 1 1 320px; }
  .history-tools .category-chips { flex: none; }
  .welcome-card { padding: 32px; }
  .profile-card { gap: 20px; }
  .profile-name { font-size: 30px; }
  .own-review-card { padding: 20px; }
  .scan-camera { padding: 26px; }
  .scan-drop { padding: 38px 24px; }
  .scan-manual { padding: 26px; }
  .hero-photo { min-height: 320px; padding: 25px; }
  .hero-photo img { max-height: 280px; }
  .product-title { font-size: 31px; }
  .product-actions { display: flex; flex-wrap: wrap; }
  .product-actions button { flex: 0 1 auto; }
  .upload-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-actions { flex-direction: row; justify-content: flex-end; padding-top: 20px; }
  .form-actions button { width: auto; min-height: 46px; }
  .auth-card { padding: 30px 32px; }
  /* Листы на широком экране — диалоги по центру, а не панели снизу. */
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-height: 88vh; max-height: 88dvh; padding: 24px; border-radius: 18px; }
  .sheet.comments-sheet, .sheet.filters-sheet { max-width: 600px; }
  #toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

@media (min-width: 820px) {
  .catalog-hero { grid-template-columns: minmax(0, 1fr) 230px; gap: 30px; }
  .hero-title { font-size: 42px; }
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 27px 16px; }
  .product-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scan-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 32px; }
  .scan-frame { width: min(270px, 100%); height: 160px; margin: 37px auto 30px; }
  .welcome-card { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: center; }
  .product-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 34px; align-items: start; }
  .product-overview { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 30px; }
  .editor-layout { grid-template-columns: 235px minmax(0, 1fr); gap: 30px; }
  .editor-product { position: sticky; top: 100px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 20px; }
  .editor-thumb { width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 6px; }
  .editor-product > .tag { align-self: flex-start; }
  .opinions-screen:not(.has-feed) {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-areas: "head head" "feed aside";
    gap: 26px 34px;
    align-items: start;
  }
  .opinions-screen:not(.has-feed) .opinions-head { grid-area: head; }
  .opinions-screen:not(.has-feed) .opinions-feed { grid-area: feed; }
  .opinions-screen:not(.has-feed) .opinions-aside { grid-area: aside; padding-top: 8px; }
}

/* Компьютер: верхнее меню и кнопка профиля в шапке, нижнее меню скрыто.
 * Лента мнений — колонка шириной с телефон справа от заголовка и подсказок. */
@media (min-width: 900px) {
  .appbar-inner { min-height: 82px; padding-top: 14px; padding-bottom: 14px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-text strong { font-size: 23px; }
  .brand-text small { font-size: 10px; }
  .top-nav { display: flex; align-items: center; gap: 22px; margin-right: auto; margin-left: 26px; }
  .top-nav button {
    min-height: 44px;
    padding: 12px 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--fs-muted);
    font-size: 14px;
    font-weight: 650;
  }
  .top-nav button:hover:not(:disabled) { background: none; color: var(--fs-green); }
  .top-nav button[aria-current] { color: var(--fs-green); box-shadow: inset 0 -2px 0 var(--fs-green); }
  .appbar-tools { gap: 16px; }
  .region-pill { font-size: 13px; }
  button.account-button {
    display: inline-flex;
    gap: 8px;
    min-height: 44px;
    max-width: 220px;
    padding: 6px 14px 6px 6px;
    border: 1px solid var(--fs-line);
    border-radius: 24px;
    background: var(--fs-bg);
    color: var(--fs-text);
    font-size: 13px;
    font-weight: 650;
  }
  button.account-button > svg { margin-left: 6px; width: 18px; height: 18px; }
  button.account-button:hover:not(:disabled) { background: var(--fs-soft); border-color: var(--fs-line-strong); }
  button.account-button[aria-current] { border-color: var(--fs-green); color: var(--fs-green); }
  .account-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--fs-lime);
    color: #153e30;
    font-size: 12px;
    font-weight: 750;
    object-fit: cover;
  }
  .account-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar { display: none; }
  .footer-inner { justify-content: space-between; padding-top: 8px; padding-bottom: 8px; }
  .footer-note { display: block; }
  #toast { bottom: 28px; }
  #screen { padding-top: 30px; }
  .opinions-screen.has-feed {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    grid-template-areas: "head feed" "aside feed";
    grid-template-rows: auto 1fr;
    gap: 26px 40px;
    align-items: start;
  }
  .opinions-screen.has-feed .opinions-head { grid-area: head; }
  .opinions-screen.has-feed .opinions-aside { grid-area: aside; }
  .opinions-screen.has-feed .opinions-feed {
    grid-area: feed;
    height: min(calc(100vh - 150px), 780px);
    height: min(calc(100dvh - 150px), 780px);
    border-radius: 20px;
  }
}

@media (prefers-color-scheme: dark) {
  /* Тёмная «плашка» выбранного чипа сливалась бы с тёмным фоном. */
  button.chip[aria-pressed="true"], button.chip[aria-pressed="true"]:hover:not(:disabled) {
    background: var(--fs-green);
    border-color: var(--fs-green);
    color: var(--fs-on-green);
  }
  .scan-camera { border: 1px solid var(--fs-line); }
  .overlay { background: rgba(0, 0, 0, .6); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  #progress.busy { animation: none; background: var(--fs-green); opacity: .6; }
}

/* --- 0.7.0, аудит axe ---------------------------------------------------- */
/* WCAG 2.4.11: при переходе по Tab браузер докручивает элемент лишь до края окна, и
 * закладки нижнего ряда плиток оставались под липким нижним меню. scroll-padding
 * сообщает браузеру, сколько места занимают липкие шапка и меню. */
html {
  scroll-padding-top: calc(76px + env(safe-area-inset-top));
  scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { html { scroll-padding-bottom: 16px; } }
/* Счётчик роликов на светлой шапке компьютера: с прозрачностью .82 контраст был 3.6:1. */
.opinion-count { opacity: 1; }

.overview-review { margin-block: 16px; }
.overview-review .review-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }

.shared-review-page { max-width: 48rem; margin: 0 auto; padding: clamp(18px, 4vw, 48px); overflow-wrap: anywhere; }
.shared-review-page img, .shared-review-page video { max-width: 100%; max-height: 70vh; object-fit: contain; }
.review .share-review { align-self: flex-start; }
.review-notice-list { list-style: none; padding: 0; }
.review-notice-list li { padding-block: 12px; border-bottom: 1px solid var(--line); }
.review-notice-list li p { margin-block: 4px; }
.notice-count { display: inline-block; border-radius: 1em; padding: 0 .45em; font-size: .78em; font-weight: 700; background: #235c43; color: white; margin-inline-start: .3em; }
.notice-count[hidden] { display: none; }
.tab-icon { position: relative; }
.tab-icon .notice-count { position: absolute; inset-inline-start: 60%; top: -.45em; }

/* Сначала действие у полки, затем иллюстрация. */
.scan-camera {
  background: radial-gradient(ellipse at 90% 10%, #285c48, transparent 55%), #153c31;
  align-items: stretch;
}
.scan-camera .scan-camera-body { align-items: flex-start; text-align: left; padding: 18px 0 0; }
.scan-camera .scan-camera-body p { margin: 0; }
.scan-camera .scan-camera-body button { max-width: 100%; }
.scan-frame { width: min(220px, 83%); height: 92px; margin: 22px auto 18px; }
.scan-frame .barcode-art { filter: invert(1); opacity: .75; max-width: 65%; margin: 0; }
.scan-camera .scan-privacy { margin: 0 auto; }
.product-actions { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; }
.product-actions:has(.read-reviews[hidden]) { grid-template-columns: minmax(0,1fr) auto; }
.read-reviews[hidden] { display: none; }
.review-list, .review-list article { scroll-margin-top: 80px; }
.rating-block .unrated-icon { width: 24px; height: 24px; flex: none; color: var(--fs-muted); }
.product-summary .rating-block { padding: 12px 14px; border-radius: 14px; background: var(--fs-soft); }
@media (max-width: 640px) {
  .product-hero { grid-template-columns: 84px minmax(0, 1fr); column-gap: 14px; row-gap: 6px; align-items: center; }
  .product-hero > .hero-media { grid-area: 1 / 1 / 4 / 2; min-width: 0; align-self: start; }
  .hero-media .hero-photo { width: 100%; height: 98px; min-height: 0; padding: 5px; border-radius: 12px; }
  .hero-media .hero-photo img { width: 100%; height: 100%; object-fit: contain; }
  .hero-media .hero-photo .zoom-hint { display: none; }
  .hero-media .hero-photo.is-placeholder .placeholder-icon { height: 28px; width: 28px; }
  .hero-media .hero-photo.is-placeholder span { font-size: 10px; }
  .hero-media .photo-credit { overflow-wrap: anywhere; font-size: 9px; }
  .hero-media .hero-thumbs { max-width: 84px; overflow-x: auto; }
  .product-hero > .product-summary { display: contents; }
  .product-summary > * { grid-column: 1 / -1; min-width: 0; }
  .product-summary > .eyebrow { grid-area: 1 / 2 / 2 / 3; }
  .product-summary > .product-title { grid-area: 2 / 2 / 3 / 3; font-size: clamp(19px,5.3vw,26px); line-height: 1.16; }
  .product-summary > .product-meta { grid-area: 3 / 2 / 4 / 3; align-self: start; }
  .product-summary .rating-block { margin-top: 8px; }
  .product-actions { gap: 6px; }
  .product-actions button { padding-inline: 8px; font-size: 13px; line-height: 1.2; }
  .product-actions .save-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .product-actions button.save-button { width: 44px; }
}
@media (max-width: 360px) {
  .scan-camera .scan-camera-body { padding-top: 14px; gap: 8px; }
  .product-actions .rate-button svg { display: none; }
}
