/* ====================================================================
 * [preline-header] Preline pro-стиль sticky top-bar,
 * адаптированный под Telegram Mini App `find.daddy.by`.
 *
 * Используется БЕЗ Tailwind — только нативные CSS-переменные проекта
 * (--card-bg, --text-color, --button-bg, --input-border, …) +
 * стандартные классы-маркеры Preline (`hs-dropdown`, `hs-overlay`,
 * `hs-tooltip`, `hs-tab`, …) для интерактивных компонентов.
 *
 * Preline JS (cdn.jsdelivr.net/npm/preline@2) лишь активирует эти
 * атрибуты (autoInit), а визуал мы рендерим сами — так стили
 * согласованы с style.css, dark-theme переключателем и Telegram
 * colorScheme (`body.dark-theme`).
 * ==================================================================== */

/* ---------- Контейнер верхней панели ---------- */
.preline-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200; /* выше bottom-nav (1000) — поскольку bottom-nav фикс снизу,
                     на 200 не конфликтуют; ниже модалок (2000+) */
    /* Без padding и border-radius: градиентный фон заполняет весь вьюпорт
       edge-to-edge (по горизонтали и сверху до низа шапки).
       Внутренние отступы перенесены на .preline-header-inner.

       Корпоративный градиент на основе базового #1274cf:
         • основной линейный градиент 135° — от более светлого оттенка
           к более глубокому, даёт ощущение объёма и направленного света;
         • дополнительный радиальный highlight сверху-слева — имитирует
           блик стекла / софт-тени, добавляет премиальности;
         • нижняя тонкая граница 1px (полупрозрачная) — деликатно отделяет
           шапку от контента без жёсткой линии.
       Переходы на background-image оставлены в transition ниже. */
    padding: 0;
    margin: 0;
    border-radius: 0;
    background-color: #1274cf; /* fallback при отключённых градиентах */
    background-image:
        radial-gradient(120% 140% at 0% 0%,
            rgba(255, 255, 255, 0.18) 0%,
            rgba(255, 255, 255, 0.06) 28%,
            rgba(255, 255, 255, 0) 55%),
        linear-gradient(135deg,
            #1a86d8 0%,
            #1274cf 45%,
            #0d5fa8 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 4px 18px -8px rgba(13, 95, 168, 0.45);
    transition:
        background-color 0.18s ease,
        background-image 0.25s ease,
        box-shadow 0.18s ease;
    /* Шапка всегда на контрастном фоне — текст/иконки по умолчанию белые,
       конкретные элементы при необходимости переопределяют ниже. */
    color: #ffffff;
}

.preline-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    /* Внутренние отступы контента — перенесены с .preline-header,
       чтобы фон шапки был edge-to-edge, а контент сохранил воздух. */
    padding: 10px 16px;
    box-sizing: border-box;
}

/* ---------- Левая группа: sidebar-toggle + title/desc ---------- */
.preline-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.preline-header-title-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.preline-header-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preline-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 14px;
    flex-shrink: 0;
}

.preline-header-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
    line-height: 1.2;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.preline-header-desc {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Атрибут [hidden] перебивает display: -webkit-box выше.
   Без этого правила UA-стиль [hidden] { display: none } проигрывает
   .preline-header-desc по специфичности (0,1,1 > 0,1,0), и описание
   header продолжает отображаться. */
.preline-header-desc[hidden] {
    display: none !important;
}

/* ---------- Правая группа (action-bar) ---------- */
.preline-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Универсальная круглая икон-кнопка */
.preline-icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
    position: relative;
}

.preline-icon-btn:hover,
.preline-icon-btn:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    outline: none;
}

.preline-icon-btn:active {
    transform: scale(0.94);
}

.preline-icon-btn[disabled],
.preline-icon-btn.is-loading {
    opacity: 0.6;
    cursor: progress;
}

.preline-icon-btn.is-loading i {
    animation: preline-spin 0.9s linear infinite;
}

@keyframes preline-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Theme switcher ---------- */
.preline-header-right > .flex {
    display: flex;
    align-items: center;
    gap: 2px;
}

#template-preview-dark-toggle,
#template-preview-light-toggle {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    font-size: 12px;
    transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

#template-preview-dark-toggle:not(.hidden),
#template-preview-light-toggle:not(.hidden) {
    display: inline-flex;
}

#template-preview-dark-toggle.hidden,
#template-preview-light-toggle.hidden {
    display: none;
}

#template-preview-dark-toggle:hover,
#template-preview-dark-toggle:focus-visible,
#template-preview-light-toggle:hover,
#template-preview-light-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    outline: none;
}

#template-preview-dark-toggle:active,
#template-preview-light-toggle:active {
    transform: scale(0.94);
}

#template-preview-dark-toggle svg,
#template-preview-light-toggle svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

body.dark-theme #template-preview-dark-toggle,
body.dark-theme #template-preview-light-toggle {
    color: rgba(255, 255, 255, 0.85);
}

body.dark-theme #template-preview-dark-toggle:hover,
body.dark-theme #template-preview-dark-toggle:focus-visible,
body.dark-theme #template-preview-light-toggle:hover,
body.dark-theme #template-preview-light-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.12);
}

.preline-theme-switch {
    display: inline-flex;
    align-items: center;
    margin: 0 2px;
}

.preline-theme-switch-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.preline-theme-switch-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 0;
}

.preline-theme-switch-track {
    position: relative;
    width: 56px;
    height: 28px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-color) 24%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-color) 14%, transparent);
    transition: background 0.22s ease, box-shadow 0.22s ease;
    overflow: hidden;
}

.preline-theme-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.25),
        inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    transition:
        transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
        background-color 0.22s ease,
        box-shadow 0.22s ease;
    z-index: 2;
}

/* Включённое состояние (тёмная тема) — насыщенный фирменный трек.
   Используется тот же градиент, что и в других активных элементах
   (кнопки, бэйджи), чтобы визуально связывать состояния приложения. */
.preline-theme-switch-input:checked ~ .preline-theme-switch-label .preline-theme-switch-track {
    background: linear-gradient(135deg,
        var(--button-bg) 0%,
        color-mix(in srgb, var(--button-bg) 50%, #6f42c1 50%) 100%);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--button-bg) 80%, transparent),
        0 1px 4px color-mix(in srgb, var(--button-bg) 35%, transparent);
}

/* Thumb в checked: меняет цвет с белого на тёмный navy, чтобы
   изменение состояния было видно НЕЗАВИСИМО от цвета трека.
   Контраст thumb/track инвертируется между состояниями. */
.preline-theme-switch-input:checked ~ .preline-theme-switch-label .preline-theme-switch-thumb {
    transform: translateX(28px);
    background: #1e1e3a;
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.45),
        inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* Фокус — заметное голубое кольцо для клавиатурной навигации. */
.preline-theme-switch-input:focus-visible ~ .preline-theme-switch-label .preline-theme-switch-track {
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--button-bg) 70%, transparent),
        0 0 0 3px color-mix(in srgb, var(--button-bg) 35%, transparent);
}

.preline-theme-switch-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #fff;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.18s ease, color 0.22s ease;
}

/* Иконка солнца — видна только в выключенном состоянии.
   Цвет тёмный, чтобы контрастировать с белым thumb в unchecked. */
.preline-theme-switch-icon-light {
    left: 7px;
    color: color-mix(in srgb, var(--text-color) 70%, transparent);
}

/* Иконка луны — видна только во включённом состоянии.
   Цвет белый, чтобы контрастировать с тёмным thumb в checked. */
.preline-theme-switch-icon-dark {
    right: 7px;
    color: #ffffff;
}

.preline-theme-switch-input:checked ~ .preline-theme-switch-label .preline-theme-switch-icon-light {
    opacity: 0;
}

.preline-theme-switch-input:not(:checked) ~ .preline-theme-switch-label .preline-theme-switch-icon-dark {
    opacity: 0;
}

/* ---------- Notifications bell + badge ----------
 * Структура бэйджа (как в эталоне Preline hs-pro-dnnd):
 *   <span class="preline-notif-badge [preline-notif-badge--hidden]">
 *       <span class="preline-notif-badge-pulse"></span>
 *       <span class="preline-notif-badge-count">N</span>
 *   </span>
 * - .preline-notif-badge          — обёртка, абсолютно в правом-верхнем углу
 *                                   колокола, чуть наружу.
 * - .preline-notif-badge-pulse    — фоновое «пульсирующее» пятно, красно-
 *                                   е/акцентное.
 * - .preline-notif-badge-count    — число поверх пятна.
 */
.preline-notif-wrap {
    position: relative;
}

.preline-notif-badge {
    --notif-badge-bg: #ef4444; /* tailwind red-500 */
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(40%, -40%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Доп. отступы вокруг числа — фоновое пятно (absolute, inset:0)
       получается чуть больше числа, и его пульсирующая "тень"
       выходит за пределы белой обводки числа, как в эталоне. */
    padding: 2px;
    pointer-events: none;
    line-height: 1;
}

.preline-notif-badge-pulse {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--notif-badge-bg);
    /* Более заметная пульсация: стартовая плотность цвета увеличена
       с 60% до 80%, анимация ускорена с 2.2s до 1.8s. */
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--notif-badge-bg) 80%, transparent);
    animation: preline-notif-badge-pulse 1.8s ease-out infinite;
    /* Ниже числа, чтобы белый текст не оказался под фоновым пятном */
    z-index: 0;
}

.preline-notif-badge-count {
    /* relative + z-index:1 > absolute sibling в одном stacking context,
       поэтому число рисуется поверх .preline-notif-badge-pulse */
    position: relative;
    z-index: 1;
    min-width: 10px;
    height: 10px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--notif-badge-bg);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
    /* Ранее здесь был box-shadow: 0 0 0 2px var(--card-bg, #fff),
       который рисовал белый border в светлой теме и тёмный border в тёмной.
       Удалено, чтобы бэйдж с количеством уведомлений выглядел «чистым». */
}

.preline-notif-badge--hidden {
    display: none !important;
}

/* Fallback: старая HTML-структура (без вложенных pulse/count).
   Если бэйдж — это одиночный #prelineNotifBadge напрямую, рисуем
   его как простой кружок. Совместимо со старой разметкой, чтобы
   при кэшированном HTML бэйдж не пропал. */
.preline-notif-badge > #prelineNotifBadge:not(.preline-notif-badge-count) {
    position: relative;
    z-index: 1;
    min-width: 10px;
    height: 10px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--notif-badge-bg);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
    /* Убран белый border (светлая тема) / тёмный border (тёмная тема),
       который раньше задавался через box-shadow с var(--card-bg). */
}

body.dark-theme .preline-notif-badge {
    --notif-badge-bg: #dc2626; /* tailwind red-600 в тёмной теме */
}

@keyframes preline-notif-badge-pulse {
    /* Более заметная пульсация: увеличены радиус волны (6px → 14px)
       и начальная плотность цвета (60% → 80%), волна расходится
       дальше и стартует насыщеннее. */
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--notif-badge-bg) 80%, transparent); }
    70%  { box-shadow: 0 0 0 14px color-mix(in srgb, var(--notif-badge-bg) 0%, transparent); }
    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--notif-badge-bg) 0%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
    .preline-notif-badge-pulse {
        animation: none;
    }
}

/* ---------- Profile avatar ---------- */

/* ---------- Language switcher ---------- */
.preline-lang-wrap {
    position: relative;
}

.preline-lang-btn {
    gap: 4px;
}

.preline-lang-current {
    font-size: 13px;
    line-height: 1;
    /* Скрываем текущий флаг, если иконка-глобус уже всё объясняет, но оставляем
       визуальный «флаг-индикатор» для тех, кто привык ориентироваться по флагу. */
    display: inline-flex;
    align-items: center;
}

.preline-dropdown--lang {
    min-width: 200px;
}

.preline-lang-list {
    display: flex;
    flex-direction: column;
    padding: 4px;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
}

.preline-lang-option {
    /* Сбрасываем глобальные input/select/button стили (см. .preline-profile-action). */
    margin: 0;
    padding: 8px 10px;
    width: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.16s ease;
}

.preline-lang-option:hover,
.preline-lang-option:focus-visible {
    background: color-mix(in srgb, var(--text-color) 8%, transparent);
    outline: none;
}

.preline-lang-option-flag {
    font-size: 18px;
    line-height: 1;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.preline-lang-option-label {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preline-lang-option-check {
    width: 16px;
    text-align: center;
    color: var(--button-bg);
    opacity: 0;
    visibility: hidden;
    flex-shrink: 0;
    font-size: 12px;
}

.preline-lang-option--active {
    background: color-mix(in srgb, var(--button-bg) 10%, transparent);
    color: var(--button-bg);
    font-weight: 600;
}

.preline-lang-option--active .preline-lang-option-check {
    opacity: 1;
    visibility: visible;
}

.preline-profile-wrap {
    margin-left: 4px;
}

.preline-profile-btn {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.preline-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: none;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    overflow: hidden;
    box-shadow: none;
}

.preline-profile-avatar:hover,
.preline-profile-avatar:focus,
.preline-profile-avatar:active {
    background: none;
    box-shadow: none;
}

.preline-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ---------- Dropdowns (Preline-инстанс) ---------- */
.preline-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: var(--card-bg);
    border: 1px solid color-mix(in srgb, var(--input-border) 60%, transparent);
    border-radius: 14px;
    box-shadow:
        0 12px 28px -8px color-mix(in srgb, var(--text-color) 18%, transparent),
        0 2px 6px color-mix(in srgb, var(--text-color) 6%, transparent);
    padding: 8px;
    z-index: 250;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

/* Дропдаун уведомлений шире — внутри помещается двухстрочное
   сообщение, временная метка и hover-кнопки mark-as-read/archive.

   ВАЖНО: используем position:fixed с привязкой к правому краю
   viewport, а не position:absolute к родителю (.hs-dropdown).
   Кнопка уведомлений находится у самого правого края шапки, и
   при absolute+right:0 широкий dropdown уезжает левым краем
   за пределы экрана на узких viewport (особенно в Telegram
   Mini App на телефоне).

   z-index должен быть выше bottom-nav (z-index:1000) и
   geotracker-fab-stack (z-index:1010), иначе дропдаун
   перекрывается ими при открытии. */
.preline-dropdown--notif {
    position: fixed;
    top: 56px; /* высота шапки (padding 10+10 + кнопка 36) */
    right: 12px;
    left: auto;
    width: 320px;
    min-width: 320px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px;
    z-index: 1100;
}

.preline-dropdown.is-open,
.hs-dropdown.open > .preline-dropdown,
.hs-dropdown.hs-dropdown-open > .preline-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.preline-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--input-border) 50%, transparent);
    margin-bottom: 4px;
}

.preline-dropdown-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-color);
}

.preline-dropdown-link {
    background: transparent;
    border: 0;
    color: var(--button-bg);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}

.preline-dropdown-link:hover {
    background: color-mix(in srgb, var(--button-bg) 10%, transparent);
}

.preline-dropdown-header--profile {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.preline-profile-name {
    font-weight: 700;
    font-size: 12px;
    color: var(--text-color);
}

.preline-profile-meta {
    font-size: 12px;
    color: color-mix(in srgb, var(--text-color) 60%, transparent);
}

.preline-profile-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 4px;
    width: fit-content;
    max-width: 100%;
}

.preline-profile-action {
    /* Сбрасываем глобальное `input, select, button { margin: 10px 0;
       padding: 10px; width: 100%; display: block; }` из style.css
       (см. строки 199 и 631). Без этого кнопки профильного дропдауна
       получают лишние отступы сверху/снизу и растягиваются на всю
       ширину. */
    margin: 0;
    padding: 8px 10px;
    width: auto;
    display: flex;
    align-items: center;
    align-self: flex-start;
    gap: 10px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.16s ease;
}

.preline-profile-action:hover {
    background: color-mix(in srgb, var(--text-color) 8%, transparent);
}

.preline-profile-action--primary {
    color: var(--button-bg);
}

.preline-profile-action--primary:hover {
    background: color-mix(in srgb, var(--button-bg) 10%, transparent);
}

.preline-profile-action i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.preline-notif-list {
    /* legacy class — kept as a no-op so older markup still
       renders the same way. The new structure uses
       .preline-notif-panel + .preline-notif-list-scroll. */
}

/* ---------- Tabs (All / Archived) ---------- */
.preline-notif-tabs {
    display: flex;
    gap: 4px;
    padding: 4px 6px 6px;
    border-bottom: 1px solid color-mix(in srgb, var(--input-border) 50%, transparent);
}

.preline-notif-tab {
    background: transparent;
    border: 0;
    color: color-mix(in srgb, var(--text-color) 65%, transparent);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.16s ease, color 0.16s ease;
    /* Сбрасываем глобальный стиль кнопок из style.css */
    margin: 0;
    width: auto;
}

.preline-notif-tab:hover {
    background: color-mix(in srgb, var(--text-color) 6%, transparent);
    color: var(--text-color);
}

.preline-notif-tab--active {
    color: var(--button-bg);
    background: color-mix(in srgb, var(--button-bg) 12%, transparent);
}

.preline-notif-tab--active:hover {
    background: color-mix(in srgb, var(--button-bg) 18%, transparent);
    color: var(--button-bg);
}

.preline-notif-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--button-bg);
    color: var(--button-bg-text, #fff);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.preline-notif-tab-count--hidden {
    display: none;
}

.preline-notif-panel[hidden] {
    display: none;
}

.preline-notif-list-scroll {
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 2px;
}

.preline-notif-empty {
    padding: 28px 16px;
    text-align: center;
    color: color-mix(in srgb, var(--text-color) 55%, transparent);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.preline-notif-empty i {
    font-size: 22px;
    opacity: 0.45;
}

/* ---------- Daily-bonus «отметить день» — urgency affordance ----------
 *
 * Когда в дропдауне уведомлений есть активное напоминание
 * «Отметь день» (см. public/preline-header.js → _renderDailyBonusHint),
 * кнопка #dashDailyBonusClaimBtn получает класс
 * .daily-bonus-claim-btn--urgent и слегка пульсирует, чтобы
 * привлечь внимание пользователя. Снимается автоматически,
 * когда напоминание прочитано/архивировано.
 *
 * Реализация через CSS keyframes + will-change, чтобы анимация
 * не вызывала reflow на остальных элементах шапки.
 */
.daily-bonus-claim-btn--urgent {
    animation: preline-daily-bonus-pulse 1.4s ease-in-out infinite;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--button-bg) 50%, transparent);
}

@keyframes preline-daily-bonus-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--button-bg) 0%, transparent);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 0 0 6px color-mix(in srgb, var(--button-bg) 18%, transparent);
    }
}

/* При системном prefers-reduced-motion — отключаем пульсацию,
   оставляем только лёгкую подсветку фона (через box-shadow). */
@media (prefers-reduced-motion: reduce) {
    .daily-bonus-claim-btn--urgent {
        animation: none;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--button-bg) 22%, transparent);
    }
}

/* ---------- Footer (Mark all as read / Clear archive) ---------- */
.preline-notif-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 6px 8px;
    border-top: 1px solid color-mix(in srgb, var(--input-border) 50%, transparent);
}

.preline-notif-footer-btn {
    background: transparent;
    border: 0;
    color: var(--button-bg);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.16s ease;
    margin: 0;
    width: auto;
}

.preline-notif-footer-btn:hover {
    background: color-mix(in srgb, var(--button-bg) 10%, transparent);
}

.preline-notif-footer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent;
}

.preline-notif-footer-btn i {
    font-size: 12px;
}

/* ---------- Notification item ---------- */
.preline-notif-item {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 10px 36px 10px 10px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: background 0.16s ease;
    cursor: default;
    /* Разрешаем вертикальный скролл списка уведомлений,
       горизонтальные свайпы обрабатываем вручную в JS. */
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    /* Поле для CSS-кастомных пропсов, которыми управляет JS-свайп. */
    --preline-swipe-ratio: 0;
}

.preline-notif-item:hover {
    background: color-mix(in srgb, var(--text-color) 6%, transparent);
}

/* Во время активного свайпа отключаем hover-фон и плавные переходы,
 * чтобы карточка жёстко следовала за пальцем. Подсказку «Архив» рисуем
 * через box-shadow на самой карточке — так она не конфликтует с
 * ::before (точка непрочитанного) и ::after (нет других потребителей). */
.preline-notif-item--swiping {
    background: transparent !important;
    transition: none !important;
    will-change: transform;
    /* Тёплый «архивный» фон, нарастающий по мере свайпа вправо.
     * Интенсивность задаётся CSS-переменной --preline-swipe-ratio (0..1),
     * которую выставляет JS в touchmove. */
    box-shadow: inset 0 0 0 9999px color-mix(in srgb, #ea580c calc(var(--preline-swipe-ratio) * 16%), transparent);
}

/* Метка-подсказка «Архив» справа от карточки. Появляется только во время
 * активного свайпа. Не пересекается с ::before непрочитанной точки,
 * потому что уведомление не может одновременно находиться и в состоянии
 * «непрочитанное, но уже в процессе свайпа» в плане разметки: после
 * коммита свайпа карточка уходит в архив и пропадает из DOM панели «Все». */
.preline-notif-item--swiping::after {
    content: '\f187'; /* fa-box-archive */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #ea580c;
    font-size: 16px;
    opacity: calc(var(--preline-swipe-ratio));
    pointer-events: none;
    z-index: 3;
}

/* Скрываем hover-кнопки действий, пока идёт свайп — иначе они
 * визуально «наезжают» на подсказку архива. */
.preline-notif-item--swiping .preline-notif-item-actions {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Индикатор непрочитанного — та же маленькая точка слева, что и до
 * фичи свайпа. Живёт в ::before, ::after занят иконкой архива при свайпе. */
.preline-notif-item--unread::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--button-bg);
    z-index: 2;
}

.preline-notif-item--unread .preline-notif-item-title {
    color: var(--text-color);
}

.preline-notif-item-icon {
    /* FIX 2026-07-13: убран background и border-radius у иконок
     * дропдауна уведомлений — теперь иконки «плоские» (только цветной
     * символ), без цветного квадрата-подложки. Размер шрифта увеличен
     * с 13px до 16px для лучшей читаемости. Цвет иконки по-прежнему
     * задаётся модификатором (--enter/--exit/--inactive/--resume/
     * --info/--reward). */
    width: 30px;
    height: 30px;
    color: var(--button-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.preline-notif-item-icon--enter {
    color: #16a34a;
}

.preline-notif-item-icon--exit {
    color: #ea580c;
}

.preline-notif-item-icon--inactive {
    color: #ca8a04;
}

.preline-notif-item-icon--resume {
    color: #2563eb;
}

.preline-notif-item-icon--info {
    color: #6366f1;
}

.preline-notif-item-icon--reward {
    color: #db2777;
}

.preline-notif-item-body {
    min-width: 0;
    flex: 1;
}

.preline-notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.25;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preline-notif-item-message {
    font-size: 12px;
    color: color-mix(in srgb, var(--text-color) 70%, transparent);
    line-height: 1.35;
    /* Ограничиваем 2 строками, чтобы дропдаун не разъезжался */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.preline-notif-item-time {
    font-size: 11px;
    color: color-mix(in srgb, var(--text-color) 55%, transparent);
    margin-top: 2px;
}

/* ---------- Hover-действия: mark as read / archive ---------- */
.preline-notif-item-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--card-bg, var(--input-bg)) 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--input-border) 60%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.preline-notif-item:hover .preline-notif-item-actions,
.preline-notif-item:focus-within .preline-notif-item-actions {
    opacity: 1;
    pointer-events: auto;
}

.preline-notif-item-action {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: color-mix(in srgb, var(--text-color) 70%, transparent);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
    /* Сбрасываем глобальный стиль кнопок */
    margin: 0;
    padding: 0;
}

.preline-notif-item-action:hover {
    background: color-mix(in srgb, var(--text-color) 10%, transparent);
    color: var(--text-color);
}

.preline-notif-item-action--danger:hover {
    color: #ea580c;
}

.preline-notif-item-action i {
    font-size: 11px;
    line-height: 1;
}(--text-color) 55%, transparent);
}

/* ---------- Sidebar overlay / drawer ----------
   [fix/sidebar-visible-when-scrolled] На iOS Safari и в Telegram WebView
   `position: fixed` у элемента внутри <body> может «съезжать» вместе с
   прокруткой документа, если у какого-то предка есть transform/filter/
   will-change/backdrop-filter. Чтобы панель гарантированно перекрывала
   весь viewport даже когда страница прокручена вниз, дублируем inset
   явными top/right/bottom/left и добавляем width/height через vw/vh/dvh
   (dvh корректно учитывает динамическую высоту вьюпорта в мобильных
   браузерах). На случай, если движок всё равно «приклеит» сайдбар к
   scroll-позиции документа — JS открытия (preline-header.js) временно
   переводит <body> в position:fixed с top:-scrollY, см. _openSidebar(). */
.preline-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    /* Верхний stacking context: сайдбар должен перекрывать любые модальные блоки. */
    z-index: 2147483647;
}

.preline-sidebar.hidden {
    display: none;
}

.hs-overlay.open .preline-sidebar-backdrop,
.preline-sidebar.open .preline-sidebar-backdrop,
.preline-sidebar:not(.hidden) .preline-sidebar-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 18, 28, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: preline-fade-in 0.18s ease both;
}

@keyframes preline-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.preline-sidebar-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 2147483647;
    width: min(82vw, 320px);
    background: var(--card-bg);
    border-right: 1px solid color-mix(in srgb, var(--input-border) 60%, transparent);
    box-shadow: 6px 0 24px -8px color-mix(in srgb, var(--text-color) 22%, transparent);
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preline-sidebar:not(.hidden) .preline-sidebar-panel {
    transform: translateX(0);
}

/* ---------- Sidebar header (brand + close) ---------- */
.preline-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 18px;
    border-bottom: 1px solid color-mix(in srgb, var(--input-border) 50%, transparent);
    flex-shrink: 0;
}

.preline-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
    min-width: 0;
    cursor: pointer;
}

.preline-sidebar-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--button-bg) 0%, color-mix(in srgb, var(--button-bg) 60%, #6f42c1 40%) 100%);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--button-bg) 25%, transparent);
    flex-shrink: 0;
}

.preline-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.preline-sidebar-brand-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-color);
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preline-sidebar-brand-sub {
    font-size: 11px;
    color: color-mix(in srgb, var(--text-color) 55%, transparent);
}

.preline-sidebar-close {
    flex-shrink: 0;
}

/* ---------- Sidebar scrollable content ---------- */
.preline-sidebar-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px 8px 12px 8px;
    -webkit-overflow-scrolling: touch;
}

.preline-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.preline-sidebar-content::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-color) 18%, transparent);
    border-radius: 6px;
}

.preline-sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

/* ---------- Группы навигации ---------- */
.preline-sidebar-group {
    margin-bottom: 4px;
}

.preline-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.preline-sidebar-list-item {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

/* ---------- Plain link (например, Dashboard) ---------- */
.preline-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 9px;
    background: transparent;
    border: 0;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    width: 100%;
    margin: 0;
    transition: background 0.16s ease, color 0.16s ease;
}

.preline-sidebar-link:hover,
.preline-sidebar-link:focus-visible {
    background: color-mix(in srgb, var(--text-color) 7%, transparent);
    outline: none;
}

.preline-sidebar-link.active {
    background: color-mix(in srgb, var(--button-bg) 14%, transparent);
    color: var(--button-bg);
    font-weight: 600;
}

.preline-sidebar-link.active i {
    color: var(--button-bg);
}

.preline-sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 14px;
    color: color-mix(in srgb, var(--text-color) 65%, transparent);
    flex-shrink: 0;
}

.preline-sidebar-link--accent {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--button-bg) 8%, transparent) 0%,
        color-mix(in srgb, var(--button-bg) 14%, transparent) 100%
    );
    border: 1px solid color-mix(in srgb, var(--button-bg) 30%, transparent);
}

.preline-sidebar-link--accent:hover,
.preline-sidebar-link--accent:focus-visible {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--button-bg) 14%, transparent) 0%,
        color-mix(in srgb, var(--button-bg) 22%, transparent) 100%
    );
}

/* Бейдж "NEW" / "Plans" — справа на пункте */
.preline-sidebar-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ff7a18 0%, #d82b6b 100%);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px color-mix(in srgb, #d82b6b 30%, transparent);
}

/* ---------- Divider (как "Apps" в примере) ---------- */
.preline-sidebar-divider {
    padding: 14px 12px 6px 12px;
    position: relative;
}

.preline-sidebar-divider span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--text-color) 45%, transparent);
}

.preline-sidebar-divider::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 12px;
    right: 12px;
    height: 1px;
    background: color-mix(in srgb, var(--input-border) 50%, transparent);
    pointer-events: none;
}

/* ---------- Accordion ---------- */
.preline-sidebar-accordion {
    margin: 0;
}

.preline-sidebar-accordion-toggle {
    /* inherits .preline-sidebar-link styling + chevron */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 9px;
    background: transparent;
    border: 0;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.16s ease;
}

.preline-sidebar-accordion-toggle:hover,
.preline-sidebar-accordion-toggle:focus-visible {
    background: color-mix(in srgb, var(--text-color) 7%, transparent);
    outline: none;
}

.preline-sidebar-accordion-toggle i.preline-sidebar-accordion-chevron {
    margin-left: auto;
    width: 16px;
    text-align: center;
    font-size: 11px;
    color: color-mix(in srgb, var(--text-color) 55%, transparent);
    transition: transform 0.2s ease;
}

.hs-accordion.active > .preline-sidebar-accordion-toggle,
.preline-sidebar-accordion-toggle[aria-expanded="true"] {
    color: var(--button-bg);
}

.hs-accordion.active > .preline-sidebar-accordion-toggle i.preline-sidebar-accordion-chevron,
.preline-sidebar-accordion-toggle[aria-expanded="true"] i.preline-sidebar-accordion-chevron {
    transform: rotate(-180deg);
}

.preline-sidebar-accordion-content {
    /* управляется Preline: высота меняется плавно */
    overflow: hidden;
    transition: height 0.22s ease;
}

/* ---------- Sub-list (вложенные пункты аккордеона) ---------- */
.preline-sidebar-sublist {
    list-style: none;
    padding: 4px 0 4px 32px;
    margin: 0;
    position: relative;
    text-align: left;
}

.preline-sidebar-sublist > li {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
}

.preline-sidebar-sublist::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 18px;
    width: 1px;
    background: color-mix(in srgb, var(--input-border) 60%, transparent);
    pointer-events: none;
}

.preline-sidebar-sublink {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    color: color-mix(in srgb, var(--text-color) 80%, transparent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    margin: 0;
    transition: background 0.14s ease, color 0.14s ease;
    position: relative;
}

.preline-sidebar-sublink::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 1px;
    background: color-mix(in srgb, var(--input-border) 60%, transparent);
}

.preline-sidebar-sublink:hover,
.preline-sidebar-sublink:focus-visible {
    background: color-mix(in srgb, var(--text-color) 7%, transparent);
    color: var(--text-color);
    outline: none;
}

.preline-sidebar-sublink i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: color-mix(in srgb, var(--text-color) 55%, transparent);
}

/* ---------- "Apps" group с цветными бейджами ---------- */
.preline-sidebar-app-badge {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.preline-sidebar-app-badge i {
    color: #fff;
    width: auto;
    font-size: 12px;
}

.preline-sidebar-app-badge--indigo {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.preline-sidebar-app-badge--emerald {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.preline-sidebar-app-badge--amber {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.preline-sidebar-app-badge--rose {
    background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
}

.preline-sidebar-app-badge--sky {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

/* ---------- Footer (профиль + theme toggle) ---------- */
.preline-sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid color-mix(in srgb, var(--input-border) 50%, transparent);
    padding: 12px 14px;
    background: color-mix(in srgb, var(--card-bg) 92%, transparent);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preline-sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preline-sidebar-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: none;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    overflow: hidden;
    box-shadow: none;
    flex-shrink: 0;
}

.preline-sidebar-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preline-sidebar-profile-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.preline-sidebar-profile-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.preline-sidebar-profile-meta {
    font-size: 11px;
    color: color-mix(in srgb, var(--text-color) 55%, transparent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preline-sidebar-profile-chevron {
    margin-left: auto;
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.preline-sidebar-theme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 4px 0 4px;
}

.preline-sidebar-theme-label {
    font-size: 12px;
    color: color-mix(in srgb, var(--text-color) 65%, transparent);
}

.preline-sidebar-theme-switch .preline-theme-switch-track {
    width: 44px;
    height: 22px;
}

.preline-sidebar-theme-switch .preline-theme-switch-thumb {
    width: 16px;
    height: 16px;
}

.preline-sidebar-theme-switch
.preline-theme-switch-input:checked ~ .preline-theme-switch-label
.preline-theme-switch-thumb {
    transform: translateX(22px);
}

/* ---------- Адаптив ---------- */
@media (max-width: 480px) {
    .preline-header-inner {
        padding: 8px 10px;
    }

    .preline-header-title {
        font-size: 13px;
    }

    .preline-header-desc {
        font-size: 11px;
    }

    .preline-icon-btn {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .preline-theme-switch-track {
        width: 48px;
        height: 24px;
    }

    .preline-theme-switch-thumb {
        width: 18px;
        height: 18px;
    }

    .preline-theme-switch-input:checked ~ .preline-theme-switch-label .preline-theme-switch-thumb {
        transform: translateX(24px);
    }

    .preline-header-action-help {
        display: none; /* на мобильном "?" переезжает в sidebar */
    }

    /* На очень узких экранах в шапке оставляем только иконку-глобус,
       флаг-индикатор прячем, чтобы не ломать ширину кнопок. */
    .preline-lang-current {
        display: none;
    }
}

@media (min-width: 1024px) {
    #template-preview-dark-toggle,
    #template-preview-light-toggle {
        width: 36px;
        height: 36px;
    }
}

@media (min-width: 900px) {
    .preline-header-inner {
        padding: 14px 28px;
    }

    .preline-header-title {
        font-size: 19px;
    }

    /* На десктопе sidebar открывается как оверлей при клике на ≡,
       но остаётся скрытым по умолчанию (не «dock», как в примере Preline,
       чтобы не съедать ширину контента на узких экранах).
       Если захотим «dock»-режим, уберём .hidden по умолчанию для lg. */
    .preline-sidebar-toggle {
        display: inline-flex;
    }
}

/* ---------- Сдвигаем контент секций, чтобы шапка не перекрывала ---------- */
body {
    scroll-padding-top: 84px;
}

/* Скрываем на fullscreen-карте top-bar (карта занимает весь экран) */
body.fullscreen-app .preline-header {
    display: none;
}

/* Когда открыт sidebar — не скроллим body.
   [fix/sidebar-visible-when-scrolled] Проблема: на iOS Safari и в
   Telegram WebView `position: fixed` у элемента внутри <body> иногда
   «съезжает» вместе с прокруткой документа, и панель оказывается выше
   viewport. Чтобы этого избежать, JS открытия (preline-header.js)
   прокручивает страницу в начало ДО того, как показать панель — этого
   достаточно в комбинации с overflow:hidden ниже.
   ВАЖНО: НЕ ставим здесь `position: fixed` на body — это сделало бы
   body containing block для `.preline-sidebar` (тоже fixed) и сломало
   бы его позиционирование относительно viewport (высота body стала бы
   равна высоте контента страницы). */
body.preline-sidebar-open {
    overflow: hidden;
    /* Страховка от «прыжка» ширины при появлении/исчезновении
       вертикального скроллбара, когда overflow:hidden. */
    scrollbar-gutter: stable;
}

/* Dark theme — корпоративный тёмный градиент с лёгким синим акцентом,
   сохраняющий преемственность с базовым бренд-цветом #1274cf (приглушённый
   в тёмной палитре). Текст/иконки уже белые в обеих темах (см. базовые
   правила выше), поэтому контраст сохраняется.

     • основной линейный градиент 135° — от приподнятого нейтрально-серого
       с холодным оттенком к глубокому тёмно-синему, как в enterprise-дашбордах;
     • радиальный highlight сверху-слева — мягкий «софт-блик», чтобы шапка
       не выглядела плоской;
     • нижняя граница и тень адаптированы под тёмную палитру. */
body.dark-theme .preline-header {
    background-color: #2a2a30; /* fallback */
    background-image:
        radial-gradient(120% 140% at 0% 0%,
            rgba(120, 170, 220, 0.14) 0%,
            rgba(120, 170, 220, 0.05) 30%,
            rgba(120, 170, 220, 0) 60%),
        linear-gradient(135deg,
            #3a3a44 0%,
            #2e2e38 45%,
            #1f2030 100%);
    border-bottom-color: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 4px 18px -8px rgba(0, 0, 0, 0.55);
}

/* В dark-theme thumb в checked уже получает тёмный цвет (#1e1e3a)
   через .preline-theme-switch-input:checked ~ ... .preline-theme-switch-thumb.
   Это правило намеренно оставлено ПУСТЫМ (комментарий), чтобы не
   перебивать цвет thumb и не возвращать белый — иначе визуальная
   индикация состояния (белый↔тёмный) сломается. */
