/* Onyx — общий стиль страниц покупателя: «Dark Premium × Monolith».
   Тёмный обсидиан, полупрозрачные карточки с тонкой обводкой, стеклянные шапка и нижняя панель,
   мягкое свечение цветом «глаз кота» (акцент), логотип ONYX — переливающийся титан.
   Акцент задаётся атрибутом data-accent на <html> (onyx.services.ui_prefs.ACCENTS): значения
   --accent ниже должны совпадать с ACCENTS — это проверяет tests/test_ui_settings.py.
   --accent-rgb — тот же цвет тройкой чисел, для полупрозрачных подсветок rgba(var(--accent-rgb), a). */

/* ---------- Шрифты (свои файлы в /static/fonts, лицензия SIL OFL 1.1 — рядом) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/static/fonts/inter-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/static/fonts/inter-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/static/fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/static/fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 800; font-display: swap; src: url("/static/fonts/montserrat-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --bg: #08090C;              /* обсидиан */
    --bg-inset: #0B0D12;        /* утопленные рамки (фото товара, иконки) */
    --surface: rgba(255, 255, 255, 0.03);
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-solid: #111218;   /* нижние листы */
    --surface-pop: #13151C;     /* выпадающие меню (сплошные: размытие внутри стеклянной шапки не работает) */
    --ghost: #141519;           /* «серая» кнопка: 5 % белого поверх фона, но сплошная — текст под ней не просвечивает */
    --line: rgba(255, 255, 255, 0.06);
    --line-2: rgba(255, 255, 255, 0.08);
    --line-3: rgba(255, 255, 255, 0.12);
    --text: #F4F4F5;
    --muted: #A1A1AA;
    --muted-2: #D4D4D8;
    --faint: #71717A;
    --danger: #F87171;
    --danger-bg: rgba(248, 113, 113, 0.12);
    --ok: #34D399;
    --ok-bg: rgba(52, 211, 153, 0.12);
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.85);
    --glass: rgba(10, 11, 15, 0.78);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    --font-display: "Montserrat", "Inter", sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    /* Единая шкала отступов на всех страницах (на компьютере — крупнее, см. @media 1024px):
       --gap — между блоками страницы, карточками каталога, вкладками; --gap-sm — внутри строки (чипы, иконка + текст);
       --gap-lg — между крупными разделами (форма входа, лист товара); --pad — внутренний отступ карточек и строк;
       --card-pad — внутренний отступ карточки товара в каталоге (и список, и плитки). */
    --gap-sm: 8px;
    --gap: 12px;
    --gap-lg: 16px;
    --pad: 16px;
    --card-pad: 12px;

    /* акцент по умолчанию: «Бурштин» */
    --accent: #F5B841;
    --accent-rgb: 245, 184, 65;
    --accent-ink: #08090C;
    --accent-soft: #292213;
    --accent-banner: #221C12;
    --accent-banner-muted: #E8DAC2;
    --accent-hover: #F8CA70;
}
[data-accent="amber"]    { --accent: #F5B841; --accent-rgb: 245, 184, 65;  --accent-soft: #292213; --accent-banner: #221C12; --accent-banner-muted: #E8DAC2; --accent-hover: #F8CA70; }
[data-accent="emerald"]  { --accent: #34D399; --accent-rgb: 52, 211, 153;  --accent-soft: #0E2520; --accent-banner: #0D1F1C; --accent-banner-muted: #BDE0D6; --accent-hover: #67DEB2; }
[data-accent="amethyst"] { --accent: #C084FC; --accent-rgb: 192, 132, 252; --accent-soft: #221A2E; --accent-banner: #1C1726; --accent-banner-muted: #DCCFEC; --accent-hover: #D0A3FD; }
[data-accent="ice"]      { --accent: #60A5FA; --accent-rgb: 96, 165, 250;  --accent-soft: #141F2D; --accent-banner: #121A26; --accent-banner-muted: #C7D6EB; --accent-hover: #88BCFB; }
[data-accent="ruby"]     { --accent: #F87171; --accent-rgb: 248, 113, 113; --accent-soft: #2A181A; --accent-banner: #221417; --accent-banner-muted: #E8CBCD; --accent-hover: #FA9494; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
    position: relative;
    margin: 0;
    min-height: 100vh;
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.8); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Атрибут hidden прячет всегда: иначе display:flex у .empty / .qr-wrap и т. п. перебивает его
   (так «Ничего не найдено» висело на витрине, хотя никто ничего не искал) */
[hidden] { display: none !important; }
/* лёгкое «нажатие» у всего, что нажимается */
.btn, .icon-btn, .pill, .avatar, .chip, .seg__btn, .add-btn, .stepper__btn, .cart-bar, .order-banner, .onx-qr-fab, .onx-qr-row {
    transition: transform 0.13s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease, color 0.2s ease;
}
.btn:active, .icon-btn:active, .pill:active, .avatar:active, .chip:active, .seg__btn:active, .add-btn:active,
.stepper__btn:active, .cart-bar:active, .order-banner:active, .onx-qr-row:active { transform: scale(0.96); }

/* ---------- Каркас ---------- */
.page {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: env(safe-area-inset-top) 16px calc(32px + env(safe-area-inset-bottom));
}
.page--wide { max-width: 1040px; }
.page--with-bar { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
/* группа полей без рамки (настройки, тема обращения): подпись над полем — тот же отступ везде */
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset > legend { padding: 0; margin-bottom: var(--gap-sm); }

.topbar { display: flex; align-items: center; gap: var(--gap); min-height: 60px; margin-bottom: var(--gap-sm); }
.topbar__title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__meta { color: var(--muted); font-size: 14px; }

.icon-btn {
    width: 40px; height: 40px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line-2); border-radius: 50%; background: rgba(255, 255, 255, 0.05);
    color: var(--muted-2); cursor: pointer; font-size: 20px; line-height: 1;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.icon { width: 20px; height: 20px; flex: none; }
.icon--sm { width: 16px; height: 16px; }

.pill {
    height: 32px; padding: 0 12px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2);
    color: #E4E4E7; font-size: 12.5px; font-weight: 600; white-space: nowrap;
    cursor: pointer; list-style: none;
}
.pill:hover { background: rgba(255, 255, 255, 0.09); }
.pill .icon { color: var(--accent); width: 15px; height: 15px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--accent-rgb), 0.14); border: 1px solid rgba(var(--accent-rgb), 0.32);
    color: var(--accent); font-size: 13px; font-weight: 700;
    cursor: pointer; list-style: none;
    box-shadow: 0 0 16px -4px rgba(var(--accent-rgb), 0.35);
}

/* Выпадающие меню на <details> (без JS) */
.menu { position: relative; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::marker { content: ""; }
.menu__panel {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 50;
    min-width: 220px; padding: 6px;
    background: var(--surface-pop); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: onx-fade 0.18s ease;
}
.menu--start .menu__panel { left: 0; right: auto; }
.menu__item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-sm);
    background: none; color: var(--text); font-size: 15px; text-align: left; cursor: pointer;
}
.menu__item:hover { background: var(--surface-2); color: var(--text); }
.menu__item .icon { color: var(--muted); }
.menu__item.is-active { color: var(--accent); font-weight: 600; }
.menu__item--danger, .menu__item--danger .icon { color: var(--danger); }
.menu__item__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__sep { height: 1px; margin: 6px 4px; background: var(--line-2); }
.menu__item form { margin: 0; }

/* ---------- Кнопки и поля ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 50px; padding: 0 18px; border: 1px solid transparent; border-radius: 16px;
    font-size: 15px; font-weight: 600; cursor: pointer; text-align: center;
}
.btn--block { width: 100%; }
.btn--primary {
    background: var(--accent); color: var(--accent-ink); font-weight: 700;
    box-shadow: 0 8px 28px -6px rgba(var(--accent-rgb), 0.5);
}
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
/* мягкая и серая кнопки — сплошные (тот же вид, что 14 % акцента / 5 % белого на фоне): в нижней панели под ними едет текст */
.btn--soft {
    background: var(--accent-soft); border-color: rgba(var(--accent-rgb), 0.32); color: var(--accent);
    box-shadow: 0 0 20px -6px rgba(var(--accent-rgb), 0.3);
}
.btn--soft:hover { border-color: rgba(var(--accent-rgb), 0.5); color: var(--accent-hover); }
.btn--ghost { background: var(--ghost); border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { background: #1A1B20; color: var(--text); }
.btn--danger { background: var(--danger-bg); border-color: rgba(248, 113, 113, 0.3); color: var(--danger); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; color: var(--muted-2); font-weight: 500; }
.field__hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.input {
    width: 100%; height: 50px; padding: 0 14px;
    background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line-2); border-radius: 14px;
    color: var(--text); font-size: 16px; outline: none;
    transition: border-color 0.2s ease, box-shadow 0.25s ease;
}
.input::placeholder { color: var(--faint); }
.input:focus {
    border-color: rgba(var(--accent-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14), 0 0 18px rgba(var(--accent-rgb), 0.16);
}
select.input { appearance: none; }
select.input option { background: var(--surface-solid); color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: var(--pad); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.links { display: flex; justify-content: space-between; gap: var(--gap); flex-wrap: wrap; font-size: 14px; }
.notice { padding: var(--gap) var(--pad); border-radius: 14px; font-size: 14px; border: 1px solid transparent; }
.notice--ok { background: var(--ok-bg); border-color: rgba(52, 211, 153, 0.28); color: var(--ok); }
.notice--error { background: var(--danger-bg); border-color: rgba(248, 113, 113, 0.28); color: var(--danger); }

/* Список-строки (как в Telegram) */
.rows { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.row {
    display: flex; align-items: center; gap: var(--gap); min-height: 52px; padding: 10px var(--pad);
    color: var(--text); border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--surface); color: var(--text); }
.row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__title { font-size: 15px; }
.row__sub { font-size: 12px; color: var(--muted); }
.row__value { font-size: 14px; color: var(--muted-2); flex: none; }
.row__value--amount { font-size: 17px; font-weight: 600; color: var(--text); }
.row .icon { color: var(--muted); }

/* Форма входа/регистрации и т. п. */
.auth { max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--gap-lg); padding-top: var(--gap); }
.auth__head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 8px 0 4px; }
.auth__title { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
    width: 64px; height: 64px; border-radius: 20px; background: var(--bg-inset); border: 1px solid var(--line-2);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 0 36px -10px rgba(var(--accent-rgb), 0.45);
}
.brand-mark svg { width: 48px; height: 48px; }

/* ---------- Логотип ONYX: переливающийся титан ---------- */
.wordmark {
    display: inline-block;
    font-family: var(--font-display); font-weight: 800; font-size: 17px; line-height: 1;
    letter-spacing: 0.22em; margin-right: -0.22em; text-transform: uppercase;
    background: linear-gradient(110deg, #52525B 0%, #9CA3AF 22%, #E4E4E7 42%, #FFFFFF 50%, #D4D4D8 58%, #71717A 78%, #3F3F46 100%);
    background-size: 260% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7));
    animation: onx-titanium 14s ease-in-out infinite;  /* медленно и сдержанно */
}
/* крупная надпись на страницах входа/регистрации — вместо глаз */
.wordmark--hero { font-size: 38px; margin: 22px 0 14px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 22px rgba(255, 255, 255, 0.07)); }
@keyframes onx-titanium { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.logo { display: inline-flex; align-items: center; gap: 7px; color: var(--text); }
.logo:hover { color: var(--text); }
.logo .eyes { width: 22px; height: 22px; }

/* ---------- Знак: глаза кота (светятся цветом акцента) ---------- */
.eyes { filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.55)); }
.eyes__iris { fill: var(--accent); }
.eyes__pupil { fill: var(--bg); }
.eyes__glint { fill: #FFF4D6; }
.eyes__decor { stroke: #9CA3AF; }                          /* ушки / носик — «титан», не мигают */
.eyes__decor--fill { fill: #9CA3AF; stroke: none; }
/* живые глаза: моргание раз в ~5 с и плавный ход зрачков (их двигает static/js/onyx.js) */
.eyes { overflow: visible; }
.eyes__blink { transform-box: fill-box; transform-origin: center; animation: onx-blink 5.2s ease-in-out infinite; }
.eyes__look { transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1); will-change: transform; }
@keyframes onx-blink { 0%, 92%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(0.06); } 98.5% { transform: scaleY(1); } }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--accent); box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.9); }

/* ---------- Витрина: стеклянная шапка ---------- */
.store-head {
    position: sticky; top: 0; z-index: 40;
    padding-top: env(safe-area-inset-top);
    background: rgba(8, 9, 12, 0.97); border-bottom: 1px solid var(--line);
}
.store-head__in {
    max-width: 560px; margin: 0 auto; padding: 10px 16px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--gap-sm);
}
.store-head__side { display: flex; align-items: center; gap: 6px; min-width: 0; }
.store-head__side--end { justify-content: flex-end; }
.store-head + .page { padding-top: var(--gap-lg); }
.brand { display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: 46vw; }
.brand__sub {
    display: flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 5px;
    font-size: 10.5px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em;
}
.brand__sub span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kiosk-panel { min-width: 260px; max-width: calc(100vw - 32px); }
.kiosk-panel__cur { display: flex; flex-direction: column; gap: 3px; padding: 8px 12px 10px; }
.kiosk-panel__label { font-size: 11px; color: var(--muted); font-weight: 500; }
.kiosk-panel__name { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.35; }

.greeting { display: flex; align-items: center; gap: var(--gap-sm); font-size: 12.5px; color: var(--muted); margin: 0 0 var(--gap); }
.page > .tariff-note { margin-bottom: var(--gap); }
.greeting .icon { color: var(--accent); }

.search-row { display: flex; align-items: center; gap: var(--gap-sm); }
.search {
    flex: 1; min-width: 0; height: 44px; padding: 0 14px;
    display: flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line-2); border-radius: 16px; color: var(--faint);
    transition: border-color 0.2s ease;
}
.search:focus-within { border-color: rgba(255, 255, 255, 0.18); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text); font-size: 15px; }
.search input::placeholder { color: var(--faint); }
.seg { display: flex; gap: 2px; padding: 4px; height: 44px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line-2); border-radius: 16px; flex: none; }
.seg__btn {
    width: 34px; height: 34px; border: 0; border-radius: 12px; background: none; color: var(--faint);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.seg__btn:hover { color: var(--muted-2); }
.seg__btn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }

.chips { display: flex; gap: var(--gap-sm); padding: var(--gap) 0 0; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none; height: 32px; padding: 0 16px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer;
}
.chip:hover { color: var(--muted-2); }
.chip[aria-pressed="true"] { background: #FFFFFF; border-color: #FFFFFF; color: var(--bg); font-weight: 600; }

/* Полоса «Кот сторожит заказ #N» (static/js/onyx.js) */
.order-banner {
    display: flex; align-items: center; gap: var(--gap); margin: var(--gap) 0 0; padding: var(--card-pad);
    width: 100%; border-radius: var(--radius); text-align: left; cursor: pointer; color: var(--text);
    /* слева сверху ≈ --accent-banner (11 % акцента на фоне), к правому краю темнее */
    background: var(--bg) linear-gradient(135deg, rgba(var(--accent-rgb), 0.11) 0%, rgba(255, 255, 255, 0.025) 100%);
    border: 1px solid rgba(var(--accent-rgb), 0.26);
    box-shadow: inset 0 1px 0 rgba(var(--accent-rgb), 0.18), 0 8px 24px -10px rgba(var(--accent-rgb), 0.22);
}
.order-banner:hover { color: var(--text); border-color: rgba(var(--accent-rgb), 0.4); }
.order-banner__icon {
    width: 44px; height: 44px; border-radius: 14px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(8, 9, 12, 0.9); border: 1px solid var(--line-2);
}
.order-banner__icon svg { width: 30px; height: 30px; }
.order-banner__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.order-banner__title { font-size: 14px; font-weight: 600; color: #FFFFFF; }
.order-banner__sub { font-size: 12px; color: var(--accent-banner-muted); opacity: 0.85; }
.order-banner .icon { color: var(--accent); }

.empty { padding: 40px var(--gap); text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: var(--gap); }
.empty .brand-mark { opacity: 0.9; }
.empty[hidden] { display: none; }

/* ---------- Товар: одна разметка, два вида (список / плитки) ----------
   Фото товара — в тёмной утопленной рамке; карточка — полупрозрачная с тонкой обводкой. */
.catalog { display: grid; gap: var(--gap); padding-top: var(--gap); }
.item {
    position: relative; min-width: 0;
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
    transition: background-color 0.18s ease, border-color 0.18s ease;
}
.item:hover { background: rgba(255, 255, 255, 0.045); border-color: rgba(255, 255, 255, 0.11); }
.item__main {
    width: 100%; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer;
    display: flex; align-items: center; gap: var(--gap); padding: var(--card-pad); border-radius: inherit;
}
.item__media {
    position: relative; width: 64px; height: 64px; flex: none; border-radius: 14px; overflow: hidden;
    background: var(--bg-inset); border: 1px solid rgba(255, 255, 255, 0.06);
}
.item__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.item__ph {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; letter-spacing: 0.04em; color: rgba(var(--accent-rgb), 0.85);
}
/* Текст карточки — как в каталогах доставки, одинаково в списке и плитках:
   1) цена цветом акцента (рядом серым — цена за кг / л и залог), 2) название обычным белым,
   3) серая строка: вес / объём · ячейка · остаток. */
.item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-right: 48px; }
.item.has-qty .item__body { padding-right: 112px; }
.item__price { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--accent); font-variant-numeric: tabular-nums; }
.item__name { font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.item__name span:first-child, .cart-line__name span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* серая строка: слева вес / объём · ячейка · остаток, справа цена за кг / л (как в каталогах доставки) */
.item__foot { display: flex; align-items: baseline; justify-content: space-between; gap: var(--gap-sm); min-width: 0; font-size: 12px; line-height: 1.3; color: var(--faint); }
.item__foot:empty { display: none; }
.item__meta { min-width: 0; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-18 {
    flex: none; font-size: 10.5px; font-weight: 600; line-height: 1.3; padding: 1px 6px; border-radius: 6px;
    color: #FB7185; background: rgba(244, 63, 94, 0.15); border: 1px solid rgba(244, 63, 94, 0.3);
}
/* кнопка «+» или степпер «− N +» справа */
.item__ctrl { position: absolute; right: var(--card-pad); top: 50%; transform: translateY(-50%); display: flex; align-items: center; }
.item__ctrl form, .item__add { margin: 0; }
.add-btn {
    width: 38px; height: 38px; border-radius: 50%; cursor: pointer; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--accent-rgb), 0.14); border: 1px solid rgba(var(--accent-rgb), 0.32); color: var(--accent);
    box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.12);
}
.add-btn:hover { background: rgba(var(--accent-rgb), 0.22); color: var(--accent-hover); box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.25); }
/* Нет в наличии: вся карточка серая (фото без цвета, цена и текст приглушены); «Немає» — один раз, в серой
   строке под названием, справа — серый неактивный «+» */
.add-btn:disabled { cursor: not-allowed; background: rgba(255, 255, 255, 0.04); border-color: var(--line-2); color: var(--faint); box-shadow: none; }
.item.is-out .item__ctrl { opacity: 0.5; }
.item.is-out .item__media img { filter: grayscale(1); opacity: 0.4; }
.item.is-out .item__ph { color: var(--faint); }
.item.is-out .item__price, .item.is-out .item__name, .item.is-out .item__unit, .item.is-out .item__deposit, .item.is-out .item__meta { color: var(--faint); }
.item.is-out .badge-18 { filter: grayscale(1); opacity: 0.6; }

/* Степпер «− N +» — на витрине и в корзине */
.stepper {
    display: flex; align-items: center; gap: 2px; flex: none; padding: 4px; border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.14); border: 1px solid rgba(var(--accent-rgb), 0.32);
    box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.12);
}
.stepper form { margin: 0; display: flex; }
.stepper__btn {
    width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(8, 9, 12, 0.8); color: #FFFFFF;
}
.stepper form:last-child .stepper__btn { background: var(--accent); color: var(--accent-ink); }
.stepper__btn:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper__qty { min-width: 22px; text-align: center; font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

.catalog.is-list { grid-template-columns: minmax(0, 1fr); }

/* Плитки: фото, под ним цена / название / серая строка; «+» или степпер — в углу фото */
.catalog.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog.is-grid .item__main { flex-direction: column; align-items: stretch; gap: var(--gap-sm); padding: var(--card-pad); }
.catalog.is-grid .item__media { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 13px; }
.catalog.is-grid .item__ph { font-size: 22px; }
.catalog.is-grid .item__body, .catalog.is-grid .item.has-qty .item__body { padding: 0 2px; }
.catalog.is-grid .item__name { font-size: 13.5px; display: block; white-space: normal; }
/* название — до двух строк и всегда высотой в две строки: цены и серые строки соседних плиток на одном уровне */
.catalog.is-grid .item__name span:first-child { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; min-height: 2.6em; }
.catalog.is-grid .item__foot { font-size: 11.5px; }
.catalog.is-grid .item__ctrl { top: calc(var(--card-pad) + 6px); right: calc(var(--card-pad) + 6px); bottom: auto; transform: none; }
.catalog.is-grid .add-btn { width: 34px; height: 34px; background: var(--accent-soft); }   /* сплошная: на фото видна */
.catalog.is-grid .stepper { padding: 3px; background: var(--accent-soft); }
.catalog.is-grid .stepper__btn { width: 26px; height: 26px; }
.catalog.is-grid .stepper__qty { min-width: 18px; font-size: 12px; }
.catalog.is-grid .badge-18 { position: absolute; top: 8px; left: 8px; }
.item .media-badge { display: none; }
.catalog.is-grid .item .media-badge { display: inline-block; }
.catalog.is-grid .item .name-badge { display: none; }

@media (min-width: 720px) {
    .catalog.is-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .catalog.is-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Нижняя панель: плавающая стеклянная плашка корзины / кнопка оплаты */
.bottom-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 28px 16px calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 35%, rgba(8, 9, 12, 0));
    pointer-events: none;
}
.bottom-bar__inner { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.cart-bar {
    display: flex; align-items: center; gap: 10px; width: 100%;
    min-height: 56px; padding: 0 16px; border-radius: 20px;
    background: rgba(14, 16, 22, 0.84); border: 1px solid rgba(var(--accent-rgb), 0.34); color: #FFFFFF;
    box-shadow: 0 8px 32px rgba(var(--accent-rgb), 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
}
.cart-bar:hover { color: #FFFFFF; border-color: rgba(var(--accent-rgb), 0.5); }
.cart-bar__count {
    min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800;
}
.cart-bar__label { flex: 1; text-align: left; font-size: 15px; font-weight: 600; }
.cart-bar__total { font-size: 15px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.cart-bar .icon { color: var(--muted); }

.footer { padding: 32px 0 var(--gap-sm); text-align: center; font-size: 12px; color: var(--faint); }
.icon-btn--ghost { visibility: hidden; }   /* место стрелки «назад», когда её нет (страница входа) */
.limit-note a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.item__deposit { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 8px 0 0; font-size: 12px; }
.legal-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.legal-links a:hover { color: var(--text); }
.legal { line-height: 1.6; font-size: 14px; }
.legal h2 { font-size: 20px; margin: 4px 0 12px; }
.legal h3 { font-size: 15px; margin: 22px 0 8px; }
.legal ol, .legal ul { padding-left: 20px; margin: 8px 0; }
.legal li { margin: 4px 0; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.legal-operator { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; }
.legal-operator dt { color: var(--muted); }
.legal-operator dd { margin: 0; overflow-wrap: anywhere; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 13px; display: block; overflow-x: auto; }
.legal-table th, .legal-table td { border: 1px solid var(--line-2); padding: 8px; text-align: left; vertical-align: top; min-width: 120px; }
.legal-table th { color: var(--muted); font-weight: 600; }

/* Карточка товара (нижний лист) */
.sheet-overlay {
    position: fixed; inset: 0; z-index: 60; display: none;
    align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.65);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.sheet-overlay.is-open { display: flex; animation: onx-fade 0.18s ease; }
.sheet {
    width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
    background: var(--surface-solid); border-top: 1px solid rgba(255, 255, 255, 0.1); border-radius: 28px 28px 0 0;
    padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: var(--gap-lg);
    box-shadow: var(--shadow);
}
.sheet-overlay.is-open .sheet { animation: onx-sheet-up 0.26s var(--ease); }
.sheet__grab { width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.15); margin: 0 auto 2px; }
.sheet__media { width: 100%; height: 220px; border-radius: var(--radius); overflow: hidden; background: var(--bg-inset); border: 1px solid rgba(255, 255, 255, 0.06); }
.sheet__media img { width: 100%; height: 100%; object-fit: cover; }
.sheet__head { display: flex; align-items: flex-start; gap: 10px; }
.sheet__title { flex: 1; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.sheet__price { font-size: 22px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
/* товара нет: лист тоже серый, «нет в наличии» — только в строке статуса, кнопки покупки нет */
.sheet-overlay.is-out .sheet__media img { filter: grayscale(1); opacity: 0.45; }
.sheet-overlay.is-out .sheet__price, .sheet-overlay.is-out .sheet__title, .sheet-overlay.is-out #modalStock { color: var(--faint); }
.sheet__desc { color: var(--muted-2); font-size: 14px; }
.sheet__facts { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
/* цена за кг / л (98/6/ES) и информация о продукте до покупки (1169/2011) */
.item__unit { flex: none; margin-left: auto; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sheet__unit { font-size: 14px; color: var(--muted); }
.sheet__info { margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.sheet__info[hidden], .sheet__info > [hidden] { display: none; }
.sheet__info dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.sheet__info dd { margin: 2px 0 0; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.sheet__allergens { font-weight: 600; }
@keyframes onx-sheet-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes onx-fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 720px) {
    .sheet-overlay { align-items: center; }
    .sheet { border-radius: 24px; border: 1px solid rgba(255, 255, 255, 0.1); }
}

/* ---------- Корзина ---------- */
.cart-line { display: flex; align-items: center; gap: var(--gap); padding: var(--gap) var(--pad); border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .item__media { width: 52px; height: 52px; }
.cart-line__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cart-line__name { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.cart-line__sub { font-size: 12.5px; color: var(--muted); }
.summary { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 2px; }
.summary__total { font-size: 22px; font-weight: 700; }

/* ---------- Заказ и QR ---------- */
.steps { display: flex; align-items: center; gap: 8px; }
.steps__dot { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 2px solid var(--line-3); display: inline-flex; align-items: center; justify-content: center; }
.steps__dot.is-done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.5); }
.steps__dot.is-current { border-color: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.35); }
.steps__line { flex: 1; height: 3px; border-radius: 2px; background: var(--line-3); }
.steps__line.is-done { background: var(--accent); }
.steps__labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); gap: 8px; }
.steps__labels .is-current { color: var(--accent); font-weight: 600; }
.steps__labels .is-done { color: var(--muted-2); }

.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--gap); padding: var(--gap-sm) 0; }
.qr-wrap[hidden] { display: none; }   /* без этого display:flex перебивает атрибут hidden и просроченный QR остаётся на экране */
.qr-card {
    position: relative; width: 232px; height: 232px; border-radius: 28px; background: #FFFFFF;
    display: flex; align-items: center; justify-content: center; padding: 12px;
    box-shadow: 0 0 48px -12px rgba(var(--accent-rgb), 0.45), var(--shadow);
}
.qr-card img { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-card__mark {
    position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px;
    border-radius: 14px; background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.qr-card__mark svg { width: 34px; height: 34px; }
.qr-timer { width: 232px; }
.qr-timer__head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.qr-timer__num { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.qr-timer__bar { margin-top: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.qr-timer__fill { height: 100%; width: 100%; border-radius: 3px; background: var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.6); transition: width 1s linear; }
.qr-hint { max-width: 300px; text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.order-status { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--muted-2); }
.status--PAID { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.32); background: rgba(var(--accent-rgb), 0.12); }
.status--COMPLETED { color: var(--ok); border-color: rgba(52, 211, 153, 0.3); background: var(--ok-bg); }
.status--FAILED, .status--EXPIRED { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); background: var(--danger-bg); }

/* ---------- История заказов (/orders, /orders/{id}) ---------- */
.order-row { display: flex; flex-direction: column; gap: 6px; padding: 14px var(--pad); color: var(--text); transition: background-color 0.18s ease, border-color 0.18s ease; }
.order-row:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); border-color: rgba(255, 255, 255, 0.11); }
.order-row:active { transform: scale(0.98); }
.order-row__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.order-row__title { font-size: 15px; font-weight: 600; }
.order-row__total { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-row__items { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-row__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 10px; margin-top: 2px; }
.order-row .order-status, .order-head .order-status { white-space: nowrap; }
.order-row__meta { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--gap-sm) var(--gap); padding: 14px var(--pad); }
.order-head__date { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.order-line__total { font-size: 14.5px; font-weight: 600; flex: none; font-variant-numeric: tabular-nums; }
.receipt { display: flex; flex-direction: column; gap: 10px; }
.receipt__title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.receipt__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.receipt__row--total { font-size: 17px; font-weight: 700; color: var(--text); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.receipt__row--back span:last-child { color: var(--accent); font-weight: 600; }
.receipt__note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ---------- Профиль и аккаунт (/profile, /profile/account) ---------- */
.profile-card { display: flex; align-items: center; gap: var(--gap); }
.avatar--lg { width: 52px; height: 52px; font-size: 20px; cursor: default; }
.profile-card__text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.profile-card__name { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card__sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.field__value { font-size: 15px; color: var(--text); word-break: break-all; }
.phone-row { display: flex; gap: 8px; }
.phone-row__cc { width: auto; flex: none; padding: 0 12px; }
.phone-row .input[type="tel"] { flex: 1; min-width: 0; }
.notice--pending { background: rgba(var(--accent-rgb), 0.1); border-color: rgba(var(--accent-rgb), 0.3); color: var(--accent-banner-muted); font-size: 13px; }

/* ---------- Поддержка (/support) ---------- */
.textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.45; resize: vertical; font: inherit; font-size: 16px; }
.topic-chips { display: flex; flex-wrap: wrap; gap: var(--gap-sm); }
.topic-chip { position: relative; }
.topic-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.topic-chip span { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--muted-2); font-size: 14px; font-weight: 500; }
.topic-chip input:checked + span { background: rgba(var(--accent-rgb), 0.14); border-color: rgba(var(--accent-rgb), 0.45); color: var(--accent); box-shadow: 0 0 16px -4px rgba(var(--accent-rgb), 0.35); }
.topic-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.support-status--open { color: var(--muted-2); }
.support-status--answered { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.32); background: rgba(var(--accent-rgb), 0.12); }
.support-status--closed { color: var(--faint); }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.9); vertical-align: 2px; margin-left: 4px; }
.order-row.is-unread { border-color: rgba(var(--accent-rgb), 0.3); }
.row__badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.thread { display: flex; flex-direction: column; gap: var(--gap); }
.msg { max-width: 86%; display: flex; flex-direction: column; gap: 4px; }
.msg--me { align-self: flex-end; align-items: flex-end; }
.msg--them { align-self: flex-start; }
.msg__who { font-size: 11.5px; color: var(--faint); padding: 0 6px; }
.msg__body { padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg--me .msg__body { background: rgba(var(--accent-rgb), 0.14); border: 1px solid rgba(var(--accent-rgb), 0.3); border-bottom-right-radius: 6px; }
.msg--them .msg__body { background: var(--surface); border: 1px solid var(--line-2); border-bottom-left-radius: 6px; }

/* ---------- Настройки интерфейса ---------- */
.preview { display: flex; flex-direction: column; align-items: center; gap: var(--gap); padding: 20px var(--pad); }
.preview .brand-mark { width: 88px; height: 88px; border-radius: 26px; }
.preview .brand-mark svg { width: 72px; height: 72px; }
.preview__row { display: flex; gap: var(--gap-sm); width: 100%; align-items: center; }
.preview__row .btn { flex: 1; min-height: 44px; font-size: 15px; }
.swatches { display: flex; justify-content: space-between; gap: 8px; border: 0; padding: 0; margin: 0; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch__dot { display: block; width: 48px; height: 48px; border-radius: 50%; transition: box-shadow 0.25s ease; }
.swatch input:checked + .swatch__dot { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--sw), 0 0 22px var(--sw); }
.swatch input:focus-visible + .swatch__dot { outline: 2px solid var(--text); outline-offset: 6px; }
.swatch__name { display: block; margin-top: 6px; font-size: 11px; text-align: center; color: var(--muted); }
.radio-row { display: flex; gap: var(--gap-sm); }
.radio-row label { flex: 1; position: relative; }
.radio-row input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radio-row span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); color: var(--muted-2); font-size: 14px; font-weight: 500; }
.radio-row input:checked + span { background: rgba(var(--accent-rgb), 0.12); border-color: rgba(var(--accent-rgb), 0.45); color: var(--text); box-shadow: 0 0 16px -4px rgba(var(--accent-rgb), 0.35); }
.radio-row input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Выбор стиля глаз (/settings/interface) */
.eye-styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.eye-style { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.eye-style input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.eye-style__tile {
    width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-inset); border: 1px solid var(--line-2); transition: border-color 0.2s ease, box-shadow 0.25s ease;
}
.eye-style__tile svg { width: 62%; height: 62%; }
.eye-style__name { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.25; }
.eye-style input:checked + .eye-style__tile { border-color: rgba(var(--accent-rgb), 0.55); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35), 0 0 22px -6px rgba(var(--accent-rgb), 0.5); }
.eye-style input:checked ~ .eye-style__name { color: var(--text); font-weight: 600; }
.eye-style input:focus-visible + .eye-style__tile { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Кабинет кота (/shop, static/js/cat.js) ---------- */
.cat-coins { gap: 6px; }
.cat-coins__dot { width: 8px; height: 8px; border-radius: 50%; background: #FBBF24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.7); }
.cat-scene { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; }
.cat-scene::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 56%, rgba(var(--accent-rgb), 0.16) 0%, rgba(var(--accent-rgb), 0.04) 44%, transparent 72%); }
.cat-scene > * { position: relative; }
.cat-scene__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cat-phrase { display: inline-flex; align-items: center; gap: 7px; min-width: 0; padding: 5px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line-2); font-size: 12px; color: var(--muted-2); }
.cat-phrase span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-stage { width: 100%; max-width: 300px; aspect-ratio: 240 / 230; margin: 0 auto; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.cat-svg { width: 100%; height: 100%; overflow: visible; color: var(--accent); }
.cat-hint { text-align: center; font-size: 12px; color: var(--muted); }
.cat-scene__bgs { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.cat-scene__bgs .chips { padding: 0; flex-wrap: wrap; overflow: visible; }
.cat-level { display: flex; flex-direction: column; gap: 8px; }
.cat-level__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cat-level__name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; }
.cat-level__note { margin-top: 2px; }
.cat-guest { display: flex; flex-direction: column; gap: 10px; text-align: center; align-items: center; }
.cat-skins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cat-skin {
    display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px;
    border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.13s ease;
}
.cat-skin:active { transform: scale(0.97); }
.cat-skin[aria-pressed="true"] { border-color: rgba(var(--accent-rgb), 0.5); background: rgba(var(--accent-rgb), 0.1); box-shadow: 0 0 18px -6px rgba(var(--accent-rgb), 0.5); }
.cat-skin.is-locked { color: var(--muted); }
.cat-skin__badge { flex: none; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(var(--accent-rgb), 0.14); color: var(--accent); }
.cat-skin.is-locked .cat-skin__badge { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.cat-skin__badge.is-season { background: rgba(251, 191, 36, 0.15); color: #FCD34D; }
/* живой кот: дыхание, хвост, моргание, сон, снег, окна города */
.cat-glow { filter: drop-shadow(0 0 5px rgba(var(--accent-rgb), 0.65)); }
.cat-line { stroke: rgba(var(--accent-rgb), 0.38); }   /* контур кота — в цвет глаз */
.cat-breathe { transform-origin: 120px 206px; animation: cat-breathe 3.8s ease-in-out infinite; }
.cat-sleep { transform-origin: 120px 195px; animation: cat-sleep 4.6s ease-in-out infinite; }
.cat-tail { transform-origin: 148px 190px; animation: cat-tail 3.4s ease-in-out infinite; }
.cat-blink { transform-box: fill-box; transform-origin: center; animation: onx-blink 4.8s ease-in-out infinite; }
.cat-pupil { transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1); }
.cat-eyes__happy { opacity: 0; transition: opacity 0.14s ease; }
.cat-eyes__open { transition: opacity 0.14s ease; }
.cat-blush { opacity: 0.25; transition: opacity 0.18s ease; }
.is-happy .cat-eyes__open { opacity: 0; }
.is-happy .cat-eyes__happy { opacity: 1; }
.is-happy .cat-blush { opacity: 0.72; }
.cat-zzz { animation: cat-zzz 3.2s ease-in-out infinite; transform-box: fill-box; }
.cat-zzz--2 { animation-delay: 1.05s; } .cat-zzz--3 { animation-delay: 2.1s; }
.cat-snow { animation: cat-snow 4.6s linear infinite; }
.cat-snow--2 { animation-duration: 5.1s; animation-delay: 1.1s; } .cat-snow--3 { animation-delay: 2.3s; } .cat-snow--4 { animation-duration: 5.5s; animation-delay: 0.6s; }
.cat-win { animation: cat-win 4.5s ease-in-out infinite; }
.cat-win--2 { animation-duration: 5.8s; animation-delay: 1.4s; } .cat-win--3 { animation-duration: 3.9s; animation-delay: 2.2s; }
.cat-stage.is-bouncing { animation: cat-bounce 0.48s cubic-bezier(0.22, 1, 0.36, 1); }
.cat-stage.is-waking { animation: cat-wake 0.72s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes cat-breathe { 0%, 100% { transform: scaleY(1) translateY(0); } 50% { transform: scaleY(1.018) translateY(-1.5px); } }
@keyframes cat-sleep { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.022, 0.985); } }
@keyframes cat-tail { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(8deg); } }
@keyframes cat-zzz { 0% { opacity: 0; transform: translate(0, 4px) scale(0.75); } 25% { opacity: 0.9; } 75% { opacity: 0.75; } 100% { opacity: 0; transform: translate(12px, -24px) scale(1.12); } }
@keyframes cat-snow { 0% { transform: translate(0, -10px); opacity: 0; } 20%, 80% { opacity: 0.85; } 100% { transform: translate(8px, 215px); opacity: 0; } }
@keyframes cat-win { 0%, 100% { opacity: 0.22; } 50% { opacity: 0.72; } }
@keyframes cat-bounce { 0% { transform: scale(1); } 30% { transform: scale(1.045, 0.955) translateY(3px); } 65% { transform: scale(0.98, 1.025) translateY(-3px); } 100% { transform: scale(1); } }
@keyframes cat-wake { 0% { transform: scale(0.96, 0.9) translateY(8px); } 42% { transform: scale(0.95, 1.06) translateY(-6px); } 72% { transform: scale(1.03, 0.98) translateY(1px); } 100% { transform: scale(1); } }

/* Батарея: вкладка скрыта (ушли с сайта / свернули браузер) — все анимации стоят (класс ставит static/js/onyx.js) */
.onx-paused *, .onx-paused *::before, .onx-paused *::after { animation-play-state: paused !important; }

/* ---------- Быстрый доступ к QR (static/js/onyx.js) ---------- */
.onx-qr-fab {
    position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 35;
    width: 56px; height: 56px; border-radius: 50%; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(14, 16, 22, 0.84); border: 1px solid rgba(var(--accent-rgb), 0.4); color: var(--accent);
    box-shadow: 0 8px 28px rgba(var(--accent-rgb), 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
}
.onx-qr-fab svg { width: 26px; height: 26px; }
.onx-qr-fab:active { transform: scale(0.94); }
.onx-qr-badge {
    position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
    background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}
.onx-qr-backdrop {
    position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.65); opacity: 0; pointer-events: none; transition: opacity 0.2s;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.onx-qr-sheet {
    position: fixed; left: 50%; bottom: 0; z-index: 71; width: 100%; max-width: 560px;
    transform: translate(-50%, 100%); transition: transform 0.3s var(--ease);
    background: var(--surface-solid); border-top: 1px solid rgba(255, 255, 255, 0.1); border-radius: 28px 28px 0 0;
    padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 12px;
}
.onx-qr-open .onx-qr-backdrop { opacity: 1; pointer-events: auto; }
.onx-qr-open .onx-qr-sheet { transform: translate(-50%, 0); }
.onx-qr-head { display: flex; align-items: center; gap: 8px; }
.onx-qr-title { flex: 1; font-size: 17px; font-weight: 700; }
.onx-qr-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.07); color: var(--muted-2); font-size: 20px; cursor: pointer; }
.onx-qr-row {
    display: flex; justify-content: space-between; align-items: center; min-height: 54px; padding: 0 14px;
    border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); color: var(--text); font-size: 15px; cursor: pointer;
}
.onx-qr-row:hover { background: var(--surface-2); }
.onx-qr-sum { color: var(--accent); font-weight: 600; }
.onx-qr-muted, .onx-qr-hint { font-size: 13px; color: var(--muted); }
.onx-qr-muted { text-align: center; }
.onx-qr-btn { width: 100%; }
.onx-qr-err { font-size: 13px; color: var(--danger); min-height: 1em; }
.onx-qr-link { border: 0; background: none; color: var(--muted); font-size: 14px; text-align: left; padding: 8px 0; cursor: pointer; }
.onx-qr-box { align-self: center; margin: 6px 0; }
/* кнопка не перекрывает нижнюю панель и последние элементы страницы */
body:has(.bottom-bar) .onx-qr-fab { bottom: calc(96px + env(safe-area-inset-bottom)); }
.onx-has-qr .page:not(.page--with-bar) { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* Меньше движения — по настройке телефона */
@media (prefers-reduced-motion: reduce) {
    .wordmark { animation: none; background-position: 50% 0; }
    .eyes__blink { animation: none !important; }   /* иначе бесконечное моргание с длительностью 0.01 мс мерцало бы */
    .cat-breathe, .cat-sleep, .cat-tail, .cat-blink, .cat-zzz, .cat-snow, .cat-win { animation: none !important; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Компьютер (≥1024px): та же разметка, но просторная раскладка. Телефон не затрагивается. ---------- */
@media (min-width: 1024px) {
    :root { --gap: 16px; --gap-lg: 20px; --pad: 18px; --card-pad: 14px; }
    body { font-size: 16px; }

    /* Узкие страницы (вход, корзина, профиль, настройки) — аккуратная колонка по центру */
    .page { max-width: 640px; padding-left: 24px; padding-right: 24px; padding-top: 12px; }
    .topbar { min-height: 68px; }
    .topbar__title { font-size: 20px; }
    .auth { max-width: 440px; padding-top: 48px; }

    /* Витрина: широкая сетка */
    .page--wide { max-width: 1320px; padding-left: 40px; padding-right: 40px; }
    .store-head__in { max-width: 1320px; padding: 12px 40px; }
    .brand { max-width: 420px; }
    .logo .wordmark { font-size: 20px; }
    .brand__sub { font-size: 12px; }
    .greeting { font-size: 14px; }
    .search { height: 48px; padding: 0 16px; }
    .search input { font-size: 16px; }
    .seg { height: 48px; }
    .seg__btn { width: 38px; height: 38px; }
    .chip { height: 36px; padding: 0 18px; font-size: 14px; }

    /* Вид «список»: карточки в 2 колонки */
    .catalog.is-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog.is-list .item__media { width: 76px; height: 76px; }
    .catalog.is-list .item__name { font-size: 15px; }
    .catalog.is-list .item__price { font-size: 16px; }

    /* Вид «плитки»: число колонок по ширине экрана */
    .catalog.is-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .catalog.is-grid .item__name { font-size: 15px; }
    .catalog.is-grid .item__foot { font-size: 13px; }
    .catalog.is-grid .item__price { font-size: 17px; }
    .catalog.is-grid .add-btn { width: 38px; height: 38px; }
    .catalog.is-grid .stepper__btn { width: 30px; height: 30px; }

    /* Нижняя панель — плавающая плашка, а не полоса во всю ширину */
    .bottom-bar { background: none; padding: 0 24px 24px; }
    .bottom-bar__inner { max-width: 592px; }
    .page--wide ~ .bottom-bar { padding: 0 40px 28px; }
    .page--wide ~ .bottom-bar .bottom-bar__inner { max-width: 400px; margin: 0 0 0 auto; }
    .page--with-bar { padding-bottom: 112px; }
    /* Корзина: кнопка оплаты сразу под суммой, а не у нижнего края экрана */
    .page > .bottom-bar { position: static; padding: 8px 0 0; }
    .page > .bottom-bar .bottom-bar__inner { max-width: none; }
    .page--with-bar:has(> .bottom-bar) { padding-bottom: 32px; }
    body:has(.bottom-bar) .onx-qr-fab { bottom: 104px; }
    .onx-qr-fab { right: 40px; }

    /* Корзина и настройки: чуть крупнее */
    .cart-line .item__media { width: 64px; height: 64px; }
    .cart-line__name { font-size: 16px; }
    .summary__total { font-size: 26px; }

    /* Карточка товара — окно по центру, а не лист снизу */
    .sheet { max-width: 520px; padding: 22px 24px 24px; }
    .sheet__grab { display: none; }
    .sheet__media { height: 280px; }
    .onx-qr-sheet { max-width: 480px; }
}

/* Очень широкие мониторы: список в 3 колонки */
@media (min-width: 1500px) {
    .catalog.is-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Корзина: оплата балансом Onyx ---------- */
.balance-pay { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.balance-pay input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.balance-pay__text { display: flex; flex-direction: column; gap: 4px; }

/* Удаление аккаунта (/profile/account): свёрнутый блок в конце страницы, кнопка — только с паролем и галочкой */
.danger-zone { border-color: rgba(248, 113, 113, 0.28); }
.danger-zone__head { cursor: pointer; font-weight: 600; color: var(--danger); list-style: none; }
.danger-zone__head::-webkit-details-marker { display: none; }
.danger-zone__head::after { content: "›"; float: right; transition: transform 0.2s var(--ease); }
.danger-zone[open] .danger-zone__head::after { transform: rotate(90deg); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--danger); }

/* ---------- Карта киосков (/map, static/js/map.js) ---------- */
.kmap { height: min(48vh, 420px); min-height: 260px; border-radius: var(--radius); border: 1px solid var(--line-2); overflow: hidden; background: var(--surface-solid); }
/* светлые плитки OSM приводим к тёмной теме сайта; маркеры лежат в другом слое и цвет не меняют */
.kmap .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.7); }
.kmap.leaflet-container { background: var(--surface-solid); font-family: inherit; }
.kmap .leaflet-control-attribution { background: rgba(8, 9, 12, 0.7); color: var(--muted); }
.kmap .leaflet-control-attribution a { color: var(--muted-2); }
.kmap .leaflet-bar a { background: var(--surface-pop); color: var(--text); border-color: var(--line-2); }
.kpin span { display: block; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--surface-pop); border: 3px solid var(--accent); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 14px rgba(var(--accent-rgb), 0.45); }
.kpin.is-current span { background: var(--accent); }
.kpin.is-selected span { transform: rotate(-45deg) scale(1.2); box-shadow: 0 0 0 2px #fff, 0 0 18px rgba(var(--accent-rgb), 0.7); }
.kme { fill: #4DA3FF; fill-opacity: 0.95; stroke: #fff; stroke-width: 3; }
.kmap-tools { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; margin: var(--gap) 0; }
.kmap-tools .small { margin: 0; flex: 1 1 180px; }
.kmap-card { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--gap); }
.kmap-card[hidden], .kmap-card__actions a[hidden] { display: none; }
.kmap-card__name { font-size: 17px; }
.kmap-card__actions { display: flex; flex-wrap: wrap; gap: var(--gap-sm); margin-top: var(--gap); }
.kmap-card__actions .btn { flex: 1 1 120px; text-align: center; justify-content: center; }
.kmap-card__actions .btn--icon { flex: 0 0 auto; padding-inline: 14px; }
.kmap-list { list-style: none; margin: 0 0 var(--gap); padding: 0; display: flex; flex-direction: column; gap: var(--gap-sm); }
.kmap-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; cursor: pointer; color: var(--text); font: inherit; min-height: 56px; }
.kmap-item__text { display: flex; flex-direction: column; gap: 2px; }
.kmap-item.is-current { border-color: rgba(var(--accent-rgb), 0.45); }
.kmap-item.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kmap-item__dist { white-space: nowrap; color: var(--accent); font-weight: 600; }

/* Полоса прокрутки (белая линия справа) не показывается; прокрутка работает как раньше.
   Системный индикатор iOS во время самой прокрутки рисует сам Safari. */
html, body, * { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Без свечения: кнопки, плашки и выбранные элементы — без цветного ореола (рамка и заливка остаются) */
.btn--primary, .btn--primary:hover, .btn--soft, .btn--soft:hover, .avatar, .brand-mark, .add-btn, .add-btn:hover, .stepper,
.order-banner, .cart-bar, .onx-qr-fab, .qr-card, .steps__dot.is-done, .steps__dot.is-current, .qr-timer__fill, .dot, .unread-dot,
.topic-chip input:checked + span, .radio-row input:checked + span, .cat-skin[aria-pressed="true"], .cat-coins__dot { box-shadow: none !important; }
.eye-style input:checked + .eye-style__tile { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35) !important; }
.swatch input:checked + .swatch__dot { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--sw) !important; }
.input:focus { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14) !important; }
.kpin.is-selected span { box-shadow: 0 0 0 2px #fff !important; }
.cat-glow { filter: none !important; }
