.hidden {
    display: none;
}
a.title-page {
    line-height: 120%;
    font-size: 18px;
    color: var(--c-text-strong);
    font-weight: 400;
}
.line-price {
    margin-bottom: 5px;
}
.line-price__count,
.offered-prices__title {
    min-width: 120px;
}
.offered-prices {
    margin-top: 10px;
    margin-bottom: 10px;
}
.title-small {
    margin-bottom: 10px;
}
.card .offered-price {
    margin-bottom: 10px;
    margin-top: 10px;
    gap: 17px;
}
.card .btn-main {
    margin-top: 10px;
}
.total-card {
    padding-top: 0px;
}
.offered-price::before {
    content: "⚠️";
    font-size: 18px;
    background: none;
    width: 18px;
    height: 18px;
}
.quanity-action input {
    font-size: 16px;
    font-weight: 600;
}
.btn-main.disabled {
    pointer-events: none;
    background-color: var(--c-bg-muted);
    color: var(--c-text-primary);
}
/** Кнопки форм "в процессе" */
.btn-main {
    transition: background-color 0.3s;
}
.btn-main.active {
    transition: unset;
    background: var(--c-bg-muted) url(../img/loader.svg?v2) center center no-repeat !important;
    background-size: 36px !important;
    text-indent: -99999px;
    pointer-events: none;
}
.btn-main.active:after {
    content: unset;
}
.btn-main.active > svg {
    display: none;
}

/** Form error toopltip */
input:invalid:not(:placeholder-shown),
input.error {
    border-color: var(--c-danger);
    color: var(--c-danger);
}
input.error[type="checkbox"]:before {
    border-color: var(--c-danger);
}
.tippy-box {
  color: var(--c-text-primary);
}

.tippy-arrow {
  color: var(--c-bg-muted);
}
.tippy-content {
  cursor: initial;
  background-color: var(--c-bg-muted);
  padding: 22px 24px;
  box-shadow: 0px 4px 32px 0px var(--c-shadow-pop), 0px 0px 4px 0px var(--c-shadow-pop-soft);
  z-index: initial;
}
.tippy-content p {
  color: var(--c-text-primary);
  font-size: 16px;
  line-height: 19px;
  letter-spacing: 0.03em;
}
.tippy-content a {
  margin-top: 10px;
  font-weight: 500;
  color: var(--c-danger);
  display: inline-block;
}
.mainform .tippy-content {
  padding: 10px 15px;
  color: var(--c-danger);
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  text-align: left;
}
.popup-notifications {
    width: 100%;
    max-width: 440px;
    /* выравниваем по центру/правому краю — на десктопе плашка не растягивается
     * на всю ширину, на мобиле .popup-notifications в main.css даёт боковые
     * padding'и 16px, max-width 440 их перекрывает естественно. */
    left: 50%;
    transform: translateX(-50%);
    position: fixed;
    top: 12px;
    z-index: 501;
    pointer-events: none;
}
.popup-notifications .notifications {
    pointer-events: auto;
}
.item-notification__text {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 30px;
}
.ic-info--success {
    background-image: url(../img/is_success.svg);
}
.ic-info--error {
    background-image: url(../img/ic_alert.svg);
}

/* --- Toast-уведомления: выразительный вид + прогресс-бар автоскрытия --- */
/* Базовая плашка из main.css — белая со слабой тенью и серой рамкой.
 * Здесь подмешиваем: более насыщенную тень, slide-in анимацию и нижний
 * прогресс-бар, который синхронно с setTimeout(5000) уезжает в ноль.
 * Раньше тут был цветной border-left 4px по типу, но он визуально
 * сливался с логотипом в шапке — снят, тип теперь читается через цвет
 * иконки и прогресс-бара. */
.item-notification {
    /* Длительность показа плашки. По умолчанию 4s; JS (showNotification)
     * переопределяет инлайн для отдельных типов (напр. «добавлено в
     * корзину» — 1.5s). Прогресс-бар читает ту же переменную, поэтому
     * бар и setTimeout всегда совпадают. */
    --notif-duration: 4s;
    padding: 14px 18px 16px;
    border-radius: 14px;
    border: 1px solid var(--c-shadow-tint);
    box-shadow:
        0 18px 36px -12px var(--c-shadow-tint-strong),
        0 6px 14px var(--c-shadow-tint);
    overflow: hidden;
    position: relative;
    animation: notif-slide-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.popup-notifications .item-notification {
    /* `popup-notifications` в custom.css фиксирована top:12px, поэтому
     * исходный override (top:100%, background:#fbfbfb) уже не нужен. */
    background: var(--c-bg-page);
}

.item-notification__text {
    font-size: 14px;
    line-height: 143%;
    color: var(--c-text-primary);
}

.item-notification__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--c-shadow-tint-soft);
    overflow: hidden;
}
.item-notification__progress::after {
    content: "";
    display: block;
    height: 100%;
    width: 100%;
    background: var(--c-accent);
    transform-origin: left center;
    /* Длительность из `--notif-duration` (.item-notification) — та же
     * переменная, что и setTimeout в showNotification, поэтому бар и
     * автоскрытие совпадают при любом значении. */
    animation: notif-progress var(--notif-duration) linear forwards;
}
.item-notification--success .item-notification__progress::after { background: var(--c-success); }
.item-notification--warning .item-notification__progress::after { background: var(--c-warning); }
.item-notification--error .item-notification__progress::after,
.item-notification--critical .item-notification__progress::after { background: var(--c-danger-mid); }

/* Когда плашку закрывают вручную (`.removing` от JS) — прогресс-бар
 * замираем, чтобы не дёргался во время fade-out. */
.item-notification.removing .item-notification__progress::after {
    animation-play-state: paused;
}
/* Сам прогресс-бар при свёртке тоже гасим — иначе тонкая 3px полоска
 * мелькает на дне коллапсирующей плашки. */
.item-notification.removing .item-notification__progress {
    opacity: 0;
}

@keyframes notif-slide-in {
    from { opacity: 0; transform: translateY(-16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes notif-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}
input[type="number"] {
    text-align: center;
    font-weight: 600;
}
.loading::before {
    content: "";
    pointer-events: none;
    position: absolute;
    display: block;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: var(--c-overlay-loader) url(../img/loader.svg?v2) center center no-repeat !important;
    background-size: 48px !important;
}
.loading * {
    pointer-events: none;
}
@media screen and (max-width: 768px) {
    .list-categories {
        /*display: grid;*/
        grid-template-columns: repeat(1, 1fr);
    }
}

/* --- Web-auth: шапка + баннер «Запомнить устройство» --- */
.header__user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
    margin-right: 12px;
    font-size: 14px;
}
.header__user-name {
    font-weight: 600;
}
.header__user-link {
    color: var(--c-accent);
    text-decoration: none;
}
.header__user-link:hover {
    text-decoration: underline;
}
.header__logout {
    display: inline;
    margin: 0;
}
.header__logout-btn {
    background: none;
    border: none;
    color: var(--c-danger);
    cursor: pointer;
    padding: 0;
    font: inherit;
}
.header__logout-btn:hover {
    text-decoration: underline;
}

/* Старые гpey-баннеры (trust-banner / push-banner) теперь идут через
 * общий `.attn-banner` — мягкий blue accent, иконка слева, кнопки
 * с SVG'шками и одинаковой шириной. Старые селекторы оставлены пустыми,
 * чтобы шаблоны без обновления HTML не теряли визуала. */
.trust-banner,
.push-banner {
    /* visual теперь в .attn-banner, здесь — только семантический хук */
}

.attn-banner {
    background: linear-gradient(180deg, var(--c-accent-bg) 0%, var(--c-accent-bg-2) 100%);
    border-bottom: 1px solid var(--c-accent-border);
    border-left: 4px solid var(--c-accent);
    padding: 14px 0;
    box-shadow: 0 6px 16px -8px var(--c-accent-alpha-18);
    color: var(--c-text-primary);
}
.attn-banner__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.attn-banner__icon {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    background: var(--c-accent);
    color: var(--c-text-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}
.attn-banner__text {
    flex: 1 1 200px;
    font-size: 14px;
    line-height: 140%;
    color: var(--c-text-primary);
    font-weight: 500;
}
.attn-banner__actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}
.attn-banner__form {
    margin: 0;
    /* form-обёртка не должна ломать flex-выравнивание кнопок */
    display: flex;
}
.attn-banner__btn {
    /* Фиксированная ширина — все кнопки во всех баннерах (pin/push/trust)
     * строго одинаковые. 140px подобрано под самый длинный текст
     * («Задать PIN» + иконка = 100px контента при 108px доступных). */
    height: 40px;
    width: 140px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: 8px;
    gap: 6px;
}
.attn-banner__btn--primary {
    background: var(--c-accent);
    color: var(--c-text-on-accent);
}
.attn-banner__btn--primary:hover {
    background: var(--c-accent-active);
}
.attn-banner__btn.btn-main--skip {
    background: var(--c-bg-page);
    color: var(--c-text-primary);
    border: 1px solid var(--c-accent-border);
}
.attn-banner__btn.btn-main--skip:hover {
    background: var(--c-accent-bg);
}
.attn-banner__btn svg {
    flex: none;
}
@media (max-width: 520px) {
    /* На узких экранах кнопки — две строго равные половины строки.
     * Именно grid, а не flex: 1 — Chrome пару <a>+<form> делит неравно
     * (замерено: 189/157px вместо 173/173), grid-колонки честные. */
    .attn-banner__actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .attn-banner__btn { min-width: 0; width: 100%; }
}
/* Старые trust-banner правила удалены — visual теперь от .attn-banner.
 * `.btn-main--skip` оставлен как generic skip-button класс: его юзают
 * не только баннеры (где он переопределяется .attn-banner__btn.btn-main--skip),
 * но и другие места. */
.btn-main--skip {
    background: var(--c-bg-page);
    color: var(--c-text-primary);
    border: 1px solid var(--c-border-strong);
}

/* --- Личный кабинет: список пунктов --- */
.personal-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.personal-action,
.personal-action__btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--c-bg-page);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    font: inherit;
    width: 100%;
    cursor: pointer;
    text-align: left;
}
.personal-action--logout {
    padding: 0;
    border: none;
    background: none;
}
.personal-action__icon {
    font-size: 22px;
    line-height: 1;
    width: 28px;
    text-align: center;
}
.personal-action__text {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}
.personal-action__arrow {
    color: var(--c-text-placeholder);
    font-size: 22px;
    line-height: 1;
}
.personal-action:hover,
.personal-action__btn:hover {
    border-color: var(--c-accent);
}
.personal-action--logout .personal-action__btn {
    color: var(--c-danger);
}
/* .info-page в main.css имеет опечатку `position: 0 18px;` (должно было быть
   `padding`) — без этого override контент прижимается к краям экрана. */
.info-page {
    padding: 0 18px;
    box-sizing: border-box;
}
.info-page__content {
    width: 100%;
    max-width: 480px;
}
.info-page__action {
    margin-top: 12px;
}
.info-page__action .btn-main {
    display: block;
    width: 100%;
}

/* --- Кабинет: тоггл push-уведомлений ---
 * Базовый .personal-action — flex {icon, text, arrow}. У toggle-варианта
 * вместо стрелки — нативный checkbox c iOS-style switch, и текст может
 * быть в две строки (label + hint). Расширяем разметку через
 * .personal-action__content + .switch без ломки соседних строк. */
.personal-action--toggle {
    cursor: default;
}
.personal-action--toggle:hover {
    border-color: var(--c-border);
}
.personal-action__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.personal-action__hint {
    font-size: 12px;
    color: var(--c-text-tertiary);
    line-height: 130%;
}

.switch {
    position: relative;
    width: 44px;
    height: 26px;
    display: inline-block;
    flex: none;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.switch__slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: var(--c-border-mid);
    border-radius: 13px;
    transition: background 0.2s ease;
}
.switch__slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--c-text-on-accent);
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px var(--c-shadow-strong);
}
.switch input:checked + .switch__slider {
    background: var(--c-accent);
}
.switch input:checked + .switch__slider::before {
    transform: translateX(18px);
}
.switch input:disabled + .switch__slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Кабинет: страница «Важная информация» --- */
.personal-info {
    margin-top: 16px;
    color: var(--c-text-primary);
    font-size: 15px;
    line-height: 160%;
}
.personal-info p {
    margin: 0 0 14px;
}
.personal-info p:last-child {
    margin-bottom: 0;
}
.personal-info__back {
    margin-top: 24px;
}
.personal-info__back .btn-main {
    display: block;
    width: 100%;
}

/* --- Доверенные устройства --- */
.devices-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}
.devices-list__item {
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}
.devices-list__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.devices-list__current {
    background: var(--c-accent);
    color: var(--c-text-on-accent);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 11px;
    text-transform: uppercase;
}
.devices-list__meta {
    color: var(--c-text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}

/* Корзина — пустое состояние и строки предложений */
.cart-empty {
    padding: 24px 16px;
    color: var(--c-text-tertiary);
    text-align: center;
    font-size: 14px;
}

.proposal {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--c-bg-muted);
}

.proposal--approved {
    background: var(--c-success-bg);
}

.proposal--new {
    background: var(--c-warning-bg-2);
}

.proposal__heading {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-secondary);
}

/* Заказы — карточка, раскрытие, бейдж статуса, фильтр, пагинация */
/* Фильтр заказов по диапазону дат. Вынесен из .head-page (там flex
   space-between без wrap — одиночный date-input жался к заголовку и на
   узком экране наезжал). Отдельная карточка-строка под заголовком: поля
   «с»/«по» + кнопка в одну строку, «Сбросить» уходит на свою строку. */
.orders-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: -8px 0 16px;  /* head-page снизу даёт 20px — поджимаем зазор */
    padding: 10px 12px;
    border: 1px solid var(--c-border-mid);
    border-radius: 10px;
    background: var(--c-bg-card);
}

.orders-filter__field {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;  /* два поля делят строку поровну и сжимаются до нуля */
    min-width: 0;
}

.orders-filter__label {
    font-size: 13px;
    color: var(--c-text-tertiary);
    flex: 0 0 auto;
}

.orders-filter__inputwrap {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.orders-filter input[type="date"] {
    width: 100%;
    /* iOS/WebKit схлопывает высоту пустого date-input (нет контента-
       плейсхолдера) — фиксируем min-height + box-sizing, чтобы пустое и
       заполненное поле были одной высоты. */
    box-sizing: border-box;
    min-height: 38px;
    padding: 6px 8px;
    border: 1px solid var(--c-border-mid);
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    line-height: 1.4;
    color: var(--c-text-heading);
    background: var(--c-bg-page);
}

/* Кастомная маска-плейсхолдер. Нативная (дд.мм.гггг) не рендерится в
   iOS-standalone PWA на пустом date-input — кладём свой текст поверх поля.
   Прячется классом .has-value, который ставит JS (common.js: initPage на
   старте + делегированный input). Непрозрачный фон перекрывает нативную
   маску там, где она есть (Chrome), чтобы не двоилось. */
.orders-filter__mask {
    position: absolute;
    top: 50%;
    left: 9px;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 13px;
    color: var(--c-text-tertiary);
    background: var(--c-bg-page);
    padding-right: 4px;
}

.orders-filter__inputwrap.has-value .orders-filter__mask {
    display: none;
}

.orders-filter__apply {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-height: 38px;
    padding: 0;
    border: none;
    border-radius: 8px;
    color: #fff;
    background: var(--c-accent);
    cursor: pointer;
}

.orders-filter__apply svg {
    width: 18px;
    height: 18px;
}

.orders-filter__apply:active {
    opacity: 0.85;
}

.orders-filter__reset {
    flex: 1 0 100%;  /* на свою строку, прижата вправо */
    text-align: right;
    font-size: 12px;
    color: var(--c-accent);
    text-decoration: underline;
}

.orders-empty {
    padding: 24px 16px;
    color: var(--c-text-tertiary);
    text-align: center;
    font-size: 14px;
}

/* Раскрытие — через .item-order.active из common.js. Своих border-стрелок
   и checkbox-tricks не вводим: main.css уже даёт SVG-стрелку и
   max-height transition. Снимаем верхний кэп, чтобы крупные заказы (до
   ~50 позиций) показывались полностью без внутреннего скролла. */
.item-order.active .content-order {
    max-height: none;
}

.head-order__number {
    font-weight: 600;
    color: var(--c-text-heading);
}

.head-order__bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

/* main.css даёт .head-order { display:flex; gap:16px }. По умолчанию
   flex-item не сжимается ниже intrinsic-ширины своего контента — поэтому
   длинный статус ("Принят в обработку") + контент + стрелка не помещались
   на мобиле и стрелка вылезала за правую кромку плашки. */
.head-order__content {
    min-width: 0;
}

.order-status {
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    color: var(--c-text-heading);
    background: var(--c-bg-chip);
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status--2 { background: var(--c-success-bg); color: var(--c-success); }
.status--3 { background: var(--c-warning-bg-2); color: var(--c-warning-text-2); }
.status--4 { background: var(--c-danger-bg); color: var(--c-danger-mid); }
.status--5 { background: var(--c-orange-bg); color: var(--c-orange-text); }

.orders-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

.orders-pagination__btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--c-border-mid);
    color: var(--c-accent);
    font-size: 14px;
    text-decoration: none;
}

.orders-pagination__current {
    font-size: 14px;
    color: var(--c-text-heading);
}

/* Кнопка «Прайс-лист» в каталоге — первым элементом списка категорий/товаров.
   Визуально вписана как тот же item-category/item-catalog, но с акцентной
   иконкой и заметным выделением — чтобы пользователь видел, что это
   actionable (скачивание XLSX), а не навигация в подраздел. */
.item-category--price-list,
.item-catalog--price-list {
    background: var(--c-accent-bg-4);
    border: 1px solid var(--c-accent-border);
}
.item-category--price-list:hover,
.item-catalog--price-list:hover {
    background: var(--c-accent-bg-3);
}
.item-category--price-list .item-category__title,
.item-catalog--price-list .item-catalog__title {
    color: var(--c-accent);
    font-weight: 600;
}
.item-category__icon {
    font-size: 22px;
    margin-right: 10px;
}
.item-catalog--price-list .item-catalog__image {
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Статусные страницы — «магазин закрыт», «доступ запрещён» */
.status-page {
    padding: 24px 0;
}

.status-page__card {
    background: var(--c-bg-page);
    border: 1px solid var(--c-bg-chip);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    margin: 0 16px;
    box-shadow: 0 2px 8px var(--c-shadow-card);
}

.status-page__icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
}

.status-page__message {
    font-size: 14px;
    line-height: 1.5;
    color: var(--c-text-heading);
}

/* Плавность fade'а toast-уведомлений — переопределяем main.css.
 * Главное отличие: вместо height (anim из `auto` в `0` ломается в
 * браузерах) используем max-height. Иначе после `.removing` остаётся
 * «остаточная полоска» — height снапает в 0, но border/padding ещё
 * пытаются доехать. */
.item-notification {
    max-height: 500px;
    transition:
        opacity 0.4s linear,
        transform 0.4s linear,
        max-height 0.4s linear,
        margin 0.4s linear,
        padding 0.4s linear,
        border-width 0.4s linear;
}
.item-notification.removing {
    /* перекрываем main.css `height: 0`, чтобы свёртка ехала через max-height */
    height: auto;
    max-height: 0;
    border-top-width: 0;
    border-bottom-width: 0;
}

/* --- Колокольчик уведомлений: выпадающая панель с историей --- */
/* main.css задаёт .btn-notifications с расчётом на <a>, поэтому browser-
 * дефолты у <button> (рамка, серый фон, паддинг, шрифт) пробивались
 * наружу и колокольчик выглядел «вычурной» кнопкой. Сбрасываем то, что
 * .btn-notifications не покрывает явно. */
button.btn-notifications {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}


/* Панель анкерится к шапке (header.position нормальный, .container —
 * relative по умолчанию у нас не задан, поэтому здесь position:absolute
 * привязывается к нему через manual top/right через header__wrapper).
 * Чтобы не зависеть от иерархии, используем position:fixed — панель
 * рендерится в правом верхнем углу под шапкой. На мобилках 100% ширины
 * с боковыми отступами выглядит органично.
 */
.notifications-panel {
    /* header = padding 15+15 + content ~33 + border 1 ≈ 64px */
    position: fixed;
    top: 68px;
    right: 12px;
    left: 12px;
    max-width: 380px;
    margin-left: auto;
    z-index: 500;
    background: var(--c-bg-page);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    box-shadow: 0 12px 28px var(--c-shadow-strong);
    overflow: hidden;
}
.notifications-panel[hidden] {
    display: none;
}
.notifications-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-bg-chip);
}
.notifications-panel__title {
    font-weight: 600;
    font-size: 15px;
    color: var(--c-text-primary);
}
.notifications-panel__clear {
    background: none;
    border: none;
    color: var(--c-accent);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}
.notifications-panel__clear:hover {
    text-decoration: underline;
}
.notifications-panel__list {
    max-height: 60vh;
    overflow-y: auto;
}
.notifications-panel__empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--c-text-tertiary);
    font-size: 13px;
}
.notifications-panel__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-bg-muted);
}
.notifications-panel__item:last-child {
    border-bottom: none;
}
.notifications-panel__item .ic-info {
    margin-top: 2px;
    flex: none;
}
.notifications-panel__item-body {
    flex: 1;
    min-width: 0;
}
.notifications-panel__item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--c-text-primary);
    margin-bottom: 2px;
}
.notifications-panel__item-text {
    font-size: 13px;
    line-height: 143%;
    color: var(--c-text-heading);
    word-break: break-word;
}
.notifications-panel__item-time {
    margin-top: 4px;
    font-size: 11px;
    color: var(--c-text-tertiary);
}

/* Запросы — кнопки «Принять/Отклонить» во встречном предложении.
 * `.item-catalog__buttons` — это flex-контейнер с `gap:16px`, а его CSS
 * правило `.item-catalog__buttons .btn-main { flex:1 }` рассчитано на
 * случай, когда кнопка — прямой ребёнок (как в макете). У нас же между
 * `.item-catalog__buttons` и `.btn-main` живёт `<form>` (нужна для CSRF
 * и POST на разные URL'ы) — без вмешательства она съедает flex-grow и
 * кнопки лежат по ширине контента. `display:contents` снимает форму с
 * layout, и кнопки внутри становятся прямыми flex-детьми контейнера. */
.item-catalog__buttons form[name="proposal_action"] {
    display: contents;
}

/* --- Переключатель темы оформления (страница настроек) --- */
.personal-action--theme {
    flex-wrap: wrap;
    row-gap: 10px;
}
.theme-switch {
    display: flex;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
    background: var(--c-bg-muted);
    /* контрол всегда отдельной строкой под подписью */
    flex-basis: 100%;
}
.theme-switch__btn {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    color: var(--c-text-secondary);
    cursor: pointer;
}
.theme-switch__btn.active {
    background: var(--c-bg-page);
    color: var(--c-text-primary);
    box-shadow: 0 1px 3px var(--c-shadow-mid);
}

/* --- Тёмная тема: подмена логотипа (wordmark в logo.svg чёрный) --- */
html[data-theme="dark"] img[src$="logo.svg"] {
    content: url("../img/logo-dark.svg");
}

/* Тёмная тема: стрелка раскрытия заказа (arrow_down.svg залит чёрным) —
   инвертируем чёрный в светло-серый, иначе тёмное на тёмном (невидно). */
html[data-theme="dark"] .head-order__arrow { filter: invert(0.7); }

/* --- Страница прайс-листа: быстрый просмотр + кнопка «XLSX» --- */
.price-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.price-list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.price-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--c-accent-bg-3);
    border: 1px solid var(--c-accent-border);
    color: var(--c-accent);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s;
}
.price-list-btn:hover {
    background: var(--c-accent-bg-2);
}
/* На узких экранах прячем подписи — остаются иконки, заголовок не зажат */
@media (max-width: 420px) {
    .price-list-btn span {
        display: none;
    }
    .price-list-btn {
        padding: 9px 10px;
    }
}
.price-list-scope {
    color: var(--c-text-tertiary);
    font-size: 14px;
    margin: 2px 0 16px;
}
.price-list-section {
    margin-bottom: 18px;
}
.price-list-section__title {
    background: var(--c-bg-chip);
    color: var(--c-text-heading);
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    padding: 9px 12px;
    margin-bottom: 6px;
}
.price-list-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--c-border);
}
.price-list-row:last-child {
    border-bottom: 0;
}
.price-list-row__name {
    color: var(--c-text-primary);
    font-size: 14px;
    line-height: 1.35;
}
.price-list-row__prices {
    text-align: right;
    flex-shrink: 0;
}
.price-list-row__price {
    color: var(--c-text-heading);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
}

/* Ховер/нажатие на кнопках товаров и категорий в каталоге. Только для
   ссылок (a.item-catalog / a.item-category): в корзине/заказах/заявках те же
   классы висят на некликабельных <div>, их подсвечивать нельзя. Прайс-лист
   исключён из общего правила — у него свой акцентный ховер выше, ему добавлено
   только нажатие. Раскладка по медиа-запросам — как у .btn-main в main.css:
   (hover: hover) для десктопа, (hover: none) + :active для тач-устройств. */
a.item-catalog,
a.item-category {
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
@media (hover: hover) {
    a.item-catalog:not(.item-catalog--price-list):hover,
    a.item-category:not(.item-category--price-list):hover {
        border-color: var(--c-accent-border);
        background: var(--c-accent-bg-4);
        box-shadow: 0 4px 10px 0 var(--c-shadow-mid);
    }
}
@media (hover: none) {
    a.item-catalog:not(.item-catalog--price-list):active,
    a.item-category:not(.item-category--price-list):active {
        border-color: var(--c-accent-border);
        background: var(--c-accent-bg-4);
        box-shadow: 0 2px 4px 0 var(--c-shadow-soft);
    }
    /* Прайс-листу — нажатие в тон его собственному ховеру */
    a.item-catalog.item-catalog--price-list:active,
    a.item-category.item-category--price-list:active {
        background: var(--c-accent-bg-3);
    }
}

/* Заголовок в карточке товара (и заголовок категории в списке): глобальный
   .title-page задаёт line-height 83% — при переносе названия на 2+ строки
   они слипаются. Разрежаем только заголовочный блок head-page--main. */
.head-page--main .title-page {
    line-height: 115%;
}

/* Карточка заказа: заголовок раздела + кнопки скачивания накладной */
.order-section { margin-bottom: 10px; }
.order-section__title {
    /* Theme-токены вместо хардкода — иначе светлый фон #f5f7ff слепит в тёмной теме. */
    font-weight: 700; color: var(--c-accent-hover); background: var(--c-accent-bg);
    border-radius: 8px; padding: 6px 10px; margin: 8px 0 6px;
    font-size: 13px;
}
/* Статус-бейдж заказа: пилюля с надписью в шапке (справа в верхней строке).
   Цвета — theme-токены (tint-фон + текст), адаптивны к тёмной теме. */
.order-status-badge {
    margin-left: auto;
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap;
    background: var(--c-bg-muted); color: var(--c-text-secondary);
}
.order-status-badge.status--2 { background: var(--c-success-bg); color: var(--c-success-text); }
.order-status-badge.status--3 { background: var(--c-warning-bg); color: var(--c-warning-text); }
.order-status-badge.status--4 { background: var(--c-danger-bg); color: var(--c-danger-text); }
.order-status-badge.status--5 { background: var(--c-orange-bg); color: var(--c-orange-text); }

/* Меню-троеточие действий в шапке заказа (выпадающий список) */
.order-menu { position: relative; }
.order-menu__btn {
    background: none; border: none; cursor: pointer;
    font-size: 22px; line-height: 1; padding: 2px 10px;
    color: #9aa0ad; border-radius: 8px;
}
.order-menu__btn:hover { background: var(--c-bg-muted); }
.order-menu__panel {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
    min-width: 190px; background: var(--c-bg-page);
    border: 1px solid var(--c-shadow-tint); border-radius: 12px;
    box-shadow: 0 12px 28px -10px var(--c-shadow-tint-strong);
    padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
/* Классовый display:flex выше перебивает UA-правило [hidden]{display:none} —
   возвращаем скрытие явно, иначе панель видна всегда (не «всплывает», а торчит). */
.order-menu__panel[hidden] { display: none; }
.order-menu__item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px;
    text-decoration: none; color: var(--c-text-primary); font-size: 14px;
}
.order-menu__item:hover { background: var(--c-bg-muted); }
/* Иконка формата файла (PDF/XLSX) — вместо текстовой метки формата. */
.order-menu__fmt { flex: 0 0 auto; width: 20px; height: 24px; display: block; }

/* --- Тактильный отклик на нажатие (уровень A) ------------------------- */
/* touch-action: manipulation убирает 300ms-задержку клика и double-tap-zoom
   на интерактивных элементах; tap-highlight отключаем — рисуем свой :active. */
.fixed-buttons__btn,
.btn-main,
.btn-quantity,
.head-order,
.item-request__head,
.order-menu__panel button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Сжатие при нажатии — только на тач-устройствах (hover:none). На десктопе
   :active-scale выглядит чужеродно, там хватает hover-состояний. */
@media (hover: none) {
    .fixed-buttons__btn:active,
    .btn-main:active,
    .btn-quantity:active,
    .head-order:active,
    .item-request__head:active {
        transform: scale(0.96);
        transition: transform 0.06s ease;
    }
}

/* Уважение к prefers-reduced-motion: без сжатия. */
@media (prefers-reduced-motion: reduce) {
    .fixed-buttons__btn:active,
    .btn-main:active,
    .btn-quantity:active,
    .head-order:active,
    .item-request__head:active {
        transform: none;
        transition: none;
    }
}

/* --- Статичный chrome при навигации (уровень B) ----------------------- */
/* Таб-бар свапается вместе с <body> (корректная серверная .active), но не
   уезжает в анимации контента — выносим в свою VT-группу. Шапка же —
   data-turbo-permanent (см. base_store.html): не свапается вовсе, её JS-стейт
   (колокольчик/панель) переживает навигацию. VT-имя ниже на ней — безвредный
   no-op (узел один и тот же в old/new), оставлено для единообразия. */
header.header { view-transition-name: appheader; }
.fixed-buttons { view-transition-name: tabbar; }

/* --- Анимация смены экранов (View Transitions, уровень B) ------------- */
/* root = контент (chrome вынесен в свои VT-группы tabbar/appheader, Task 6).
   Короткий fade + лёгкий вертикальный сдвиг — «нативная» смена без резкости. */
::view-transition-old(root) {
    animation: vt-fade-out 0.16s ease both;
}
::view-transition-new(root) {
    animation: vt-fade-in 0.20s ease both;
}
@keyframes vt-fade-out {
    to { opacity: 0; transform: translateY(-6px); }
}
@keyframes vt-fade-in {
    from { opacity: 0; transform: translateY(8px); }
}

/* Без анимации при reduced-motion. */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none;
    }
}

/* --- Индикатор загрузки при навигации (уровень B) -------------------- */
/* Полоса прогресса Turbo. Turbo сам ставит position/z-index и показывает её
   спустя задержку (снижена до 120мс в turbo-init.js); здесь только бренд-цвет.
   !important — Turbo инжектит свой <style> позже custom.css и перебил бы цвет. */
.turbo-progress-bar {
    background-color: var(--c-accent) !important;
    height: 3px !important;
}

/* Лёгкое затемнение контента на время Turbo-навигации. z-index 5 — ниже
   шапки и таб-бара (z-index 10), выше контента: chrome остаётся ярким,
   тускнеет только страница. Появляется с задержкой (transition-delay), чтобы
   мгновенные/кешированные переходы не мигали. pointer-events:none — не
   блокирует повторный тап, это визуальная подсказка, а не модалка. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 5;
    background: #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility 0s linear .2s;
}
html.turbo-loading body::after {
    opacity: .12;
    visibility: visible;
    transition: opacity .2s ease .14s, visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
    body::after { transition: none; }
}
