/* ════════════════════════════════════════════════════════════════
   home.css — тёмная тема STRELA Kazakhstan
   Активируется через: html[data-theme="dark"]
   Поддерживает: prefers-color-scheme: dark (авто)
   ════════════════════════════════════════════════════════════════ */

/* ── Плавный переход темы ─────────────────────────────────────── */
html {
    transition: background-color .25s ease, color .25s ease;
}
*, *::before, *::after {
    transition-property: background-color, border-color, box-shadow, color;
    transition-duration: .2s;
    transition-timing-function: ease;
}
/* Не трогаем анимации иконок и трансформации */
i, svg, img, .spinner, .nw-drop, .nw-snow,
.nweather-cloud, [class*="fa-"] {
    transition: none !important;
}

/* ══════════════════════════════════════════════════════════════
   ТЁМНАЯ ТЕМА — CSS-переменные
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"],
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) }
{
    --bg:          #0d1117;
    --bg2:         #161b26;
    --card:        #1c2130;
    --border:      rgba(255,255,255,0.08);
    --border-hover:rgba(241,196,15,0.35);
    --accent:      #f1c40f;
    --accent-dark: #fbbf24;
    --accent-bg:   rgba(241,196,15,0.07);
    --blue:        #60a5fa;
    --green:       #4ade80;
    --red:         #f87171;
    --orange:      #fb923c;
    --purple:      #c084fc;
    --text:        #e8edf5;
    --text2:       #8892a4;
    --text3:       #4a5568;
    --shadow:      0 2px 12px rgba(0,0,0,0.45);
    --shadow-lg:   0 4px 28px rgba(0,0,0,0.6);
}

/* ── Применяем через атрибут (приоритетнее media) ───────────── */
html[data-theme="dark"] {
    --bg:          #0d1117;
    --bg2:         #161b26;
    --card:        #1c2130;
    --border:      rgba(255,255,255,0.08);
    --border-hover:rgba(241,196,15,0.35);
    --accent:      #f1c40f;
    --accent-dark: #fbbf24;
    --accent-bg:   rgba(241,196,15,0.07);
    --blue:        #60a5fa;
    --green:       #4ade80;
    --red:         #f87171;
    --orange:      #fb923c;
    --purple:      #c084fc;
    --text:        #e8edf5;
    --text2:       #8892a4;
    --text3:       #4a5568;
    --shadow:      0 2px 12px rgba(0,0,0,0.45);
    --shadow-lg:   0 4px 28px rgba(0,0,0,0.6);
}

/* ══════════════════════════════════════════════════════════════
   БАЗОВЫЕ ЭЛЕМЕНТЫ
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] body,
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body {
    background: var(--bg);
    color: var(--text);
}}
html[data-theme="dark"] body { background: var(--bg); color: var(--text); }

/* Desktop — body по центру с тёмной тенью */
@media (min-width:1024px) {
    html[data-theme="dark"] body {
        box-shadow: 0 0 0 1px rgba(255,255,255,0.05),
                    0 8px 40px rgba(0,0,0,0.5);
    }
    html[data-theme="dark"] html { background: #07090e; }
}

/* ══════════════════════════════════════════════════════════════
   ШАПКА (HH)
   ══════════════════════════════════════════════════════════════ */
/* Glass blur на .hh::before (home.php) — фон шапки прозрачный */
html[data-theme="dark"] .hh {
    background: transparent;
}
html[data-theme="dark"] .hh-search {
    flex: 1 1 0;
    min-width: 0;
}
html[data-theme="dark"] .hh-search input {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: var(--text);
    min-width: 0;
    max-width: 100%;
}
html[data-theme="dark"] .hh-search input::placeholder { color: var(--text3); }
html[data-theme="dark"] .hh-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(241,196,15,0.22);
}
html[data-theme="dark"] .hh-search-clear:hover {
    color: var(--text);
    background: rgba(255,255,255,0.1);
}
html[data-theme="dark"] .hh-lang {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: var(--text2);
}
html[data-theme="dark"] .hh-lang:active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}
html[data-theme="dark"] .hh-name { color: var(--text); }
html[data-theme="dark"] .hh-sub  { color: var(--text3); }
html[data-theme="dark"] .hh-icon { color: var(--accent); }

/* ── Кнопка переключения темы ─────────────────────────────── */
.h-theme-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text2);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s, border-color .2s, transform .2s;
    flex-shrink: 0;
}
.h-theme-btn:active { transform: scale(.88) rotate(20deg); }
html[data-theme="dark"] .h-theme-btn {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: #fbbf24;
}
html[data-theme="dark"] .h-theme-btn:hover {
    background: rgba(251,191,36,0.12);
    border-color: rgba(251,191,36,0.35);
    color: #fde68a;
}

/* Иконка меняется */
.h-theme-btn .icon-sun  { display: none; }
.h-theme-btn .icon-moon { display: block; }
html[data-theme="dark"] .h-theme-btn .icon-sun  { display: block; }
html[data-theme="dark"] .h-theme-btn .icon-moon { display: none; }

/* ══════════════════════════════════════════════════════════════
   СТАТИСТИКА
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-stat {
    border-right-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .h-stat-val  { color: var(--accent-dark); }
html[data-theme="dark"] .h-stat-lbl  { color: var(--text3); }

/* ══════════════════════════════════════════════════════════════
   ВИДЖЕТ ПОГОДЫ
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-weather {
    background: var(--card);
    border-color: rgba(255,255,255,0.09);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.04);
}
html[data-theme="dark"] .h-weather:hover {
    border-color: rgba(255,255,255,0.16);
    background: #222836;
}
html[data-theme="dark"] .h-weather:hover .h-weather-chevron {
    opacity: .72;
}

/* Иконки погоды */
html[data-theme="dark"] .h-weather-icon.clear  { background: rgba(243,156,18,.13); color: #fbbf24; }
html[data-theme="dark"] .h-weather-icon.cloudy { background: rgba(127,140,141,.1);  color: #94a3b8; }
html[data-theme="dark"] .h-weather-icon.rain   { background: rgba(41,128,185,.14);  color: #60a5fa; }
html[data-theme="dark"] .h-weather-icon.snow   { background: rgba(93,109,126,.12);  color: #bae6fd; }
html[data-theme="dark"] .h-weather-icon.storm  { background: rgba(230,126,34,.13);  color: #fb923c; }

/* Шиммер при загрузке */
html[data-theme="dark"] .h-weather.loading .h-weather-temp {
    background: linear-gradient(90deg,rgba(255,255,255,.06) 25%,rgba(255,255,255,.1) 50%,rgba(255,255,255,.06) 75%);
    background-size: 200% 100%;
}
html[data-theme="dark"] .h-weather.loading .h-weather-date {
    background: linear-gradient(90deg,rgba(255,255,255,.06) 25%,rgba(255,255,255,.09) 50%,rgba(255,255,255,.06) 75%);
    background-size: 200% 100%;
}

/* ══════════════════════════════════════════════════════════════
   СЕТКА СЕРВИСОВ
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-services {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .h-services::before {
    background: repeating-linear-gradient(
        90deg,
        transparent 0%, transparent calc(100% - 1px),
        rgba(255,255,255,0) calc(100% - 0.5px),
        rgba(255,255,255,0.05) calc(100% - 0.25px),
        rgba(255,255,255,0.05) calc(100% + 0.25px),
        rgba(255,255,255,0) calc(100% + 0.5px),
        transparent calc(100% + 1px)
    );
    background-size: 25% 100%;
}
html[data-theme="dark"] .h-services::after {
    background: repeating-linear-gradient(
        180deg,
        transparent 0%, transparent calc(100% - 1px),
        rgba(255,255,255,0) calc(100% - 0.5px),
        rgba(255,255,255,0.05) calc(100% - 0.25px),
        rgba(255,255,255,0.05) calc(100% + 0.25px),
        rgba(255,255,255,0) calc(100% + 0.5px),
        transparent calc(100% + 1px)
    );
    background-size: 100% 25%;
}
html[data-theme="dark"] .h-svc:hover {
    background: rgba(241,196,15,0.07);
}
html[data-theme="dark"] .h-svc-name { color: var(--text); }

/* ══════════════════════════════════════════════════════════════
   КАРТОЧКИ СОБЫТИЙ
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-ev-card {
    background: var(--card);
    border-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .h-ev-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
html[data-theme="dark"] .h-ev-avatar {
    border-color: rgba(255,255,255,0.1);
}
html[data-theme="dark"] .h-ev-avatar-placeholder {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
    color: var(--text3);
}
html[data-theme="dark"] .h-ev-avatar.h-ev-avatar--eq-png {
    background: rgba(255,255,255,0.06);
}

/* ══════════════════════════════════════════════════════════════
   КАРТОЧКИ ОПЕРАТОРОВ
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-op-card {
    background: var(--card);
    border-color: rgba(255,255,255,0.07);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .h-op-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
html[data-theme="dark"] .h-op-card-avatar img {
    border-color: rgba(255,255,255,0.12);
}
html[data-theme="dark"] .h-op-eq-trust {
    background: rgba(212,169,10,0.07);
    border-color: rgba(212,169,10,0.18);
    color: var(--text2);
}
html[data-theme="dark"] .h-op-role-badge {
    background: rgba(212,169,10,0.08);
    border-color: rgba(212,169,10,0.2);
}
html[data-theme="dark"] .h-op-show-more {
    background: var(--card);
    border-color: rgba(255,255,255,0.1);
    color: var(--text2);
}
html[data-theme="dark"] .h-op-show-more:hover {
    background: rgba(255,255,255,0.06);
}

/* ══════════════════════════════════════════════════════════════
   КАРТОЧКИ ТЕХНИКИ
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-eq {
    background: var(--card);
    border-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .h-eq:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
html[data-theme="dark"] .h-eq-img,
html[data-theme="dark"] .h-eq-img.h-eq-type-png { background: rgba(255,255,255,0.04); }
html[data-theme="dark"] .h-eq-noimg { background: rgba(255,255,255,0.04); color: var(--text3); }
html[data-theme="dark"] .h-eq-tag {
    background: rgba(13,17,23,0.85);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(6px);
}

/* ══════════════════════════════════════════════════════════════
   КАРТОЧКИ МАГАЗИНА
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-shop {
    background: var(--card);
    border-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .h-shop:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
html[data-theme="dark"] .h-shop-img { background: rgba(255,255,255,0.04); }
html[data-theme="dark"] .h-shop-top {
    background: var(--accent);
    color: #000;
}

/* ══════════════════════════════════════════════════════════════
   ТОП ПОЛЬЗОВАТЕЛИ
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-top-card {
    background: var(--card);
    border-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .h-top-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
html[data-theme="dark"] .h-top-avatar {
    border-color: rgba(255,255,255,0.12);
}

/* ══════════════════════════════════════════════════════════════
   НОВОСТИ
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-news-item {
    background: var(--card);
    border-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .h-news-item:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.45);
}

/* ══════════════════════════════════════════════════════════════
   ЛЕНТА АКТИВНОСТИ
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-feed-item {
    background: var(--card);
    border-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .h-feed-item:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
html[data-theme="dark"] .h-feed-like {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: var(--text2);
}
html[data-theme="dark"] .h-feed-like:hover {
    background: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .h-feed-like.liked {
    background: rgba(231,76,60,0.12);
    border-color: rgba(239,68,68,0.3);
    color: #f87171;
}
html[data-theme="dark"] .h-feed-img { background: rgba(255,255,255,0.04); }

/* ══════════════════════════════════════════════════════════════
   РЕКЛАМНЫЙ БАННЕР
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-ad {
    background: linear-gradient(135deg, rgba(241,196,15,0.08), rgba(241,196,15,0.04));
    border-color: rgba(241,196,15,0.22);
}
html[data-theme="dark"] .h-ad-text  { color: var(--text2); }
html[data-theme="dark"] .h-ad-cta {
    background: rgba(241,196,15,0.1);
    border-color: rgba(241,196,15,0.3);
    color: var(--accent-dark);
}

/* ══════════════════════════════════════════════════════════════
   ЗАГОЛОВКИ СЕКЦИЙ
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-sh h2 { color: var(--text); }
html[data-theme="dark"] .h-sh a  { color: var(--accent-dark); }

/* ══════════════════════════════════════════════════════════════
   МОДАЛКА ПРОГНОЗА ПОГОДЫ (h-modal)
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-modal {
    background: var(--card);
    box-shadow: 0 -8px 60px rgba(0,0,0,0.7);
}
html[data-theme="dark"] .h-modal-handle {
    background: rgba(255,255,255,0.15);
}
html[data-theme="dark"] .h-modal-header {
    border-bottom-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .h-modal-header h3 { color: var(--text); }
html[data-theme="dark"] .h-modal-header-close {
    background: rgba(255,255,255,0.07);
    color: var(--text2);
    border: 1px solid rgba(255,255,255,0.1);
}
html[data-theme="dark"] .h-modal-header-close:active {
    background: rgba(255,255,255,0.12);
}
html[data-theme="dark"] .h-modal-user {
    background: rgba(255,255,255,0.05);
}
html[data-theme="dark"] .h-modal-user:active {
    background: rgba(255,255,255,0.09);
}
html[data-theme="dark"] .h-modal-user img {
    border-color: rgba(255,255,255,0.12);
}
html[data-theme="dark"] .h-modal-comment {
    background: rgba(255,255,255,0.05);
    border-left-color: var(--accent);
}
html[data-theme="dark"] .h-modal-stars .s-empty { color: rgba(255,255,255,0.15); }
html[data-theme="dark"] .h-modal-rating-details {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .h-modal-rating-row + .h-modal-rating-row {
    border-top-color: rgba(255,255,255,0.06);
}
html[data-theme="dark"] .h-modal-close {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: var(--text);
}
html[data-theme="dark"] .h-modal-close:active {
    background: rgba(255,255,255,0.1);
}
html[data-theme="dark"] .h-modal-arrow-line { background: rgba(255,255,255,0.07); }

/* ── Дни прогноза ─────────────────────────────────────────── */
html[data-theme="dark"] .h-wm-city {
    color: var(--text);
    border-bottom-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .h-wm-notif-bell {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
}
html[data-theme="dark"] .h-wm-notif-bell--on {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.35);
}
html[data-theme="dark"] .h-wm-notif-bell--on .h-wm-notif-check {
    border-color: var(--card, #1a1f2e);
}
html[data-theme="dark"] .h-wm-notif-confirm-box {
    background: var(--card);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .h-wm-notif-confirm-icon {
    background: rgba(248, 113, 113, 0.14);
    color: #f87171;
}
html[data-theme="dark"] .h-wm-notif-confirm-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}
html[data-theme="dark"] .h-wm-day {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
}
html[data-theme="dark"] .h-wm-day:hover {
    border-color: rgba(255,255,255,0.11);
    background: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .h-wm-day:active {
    background: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .h-wm-day.today {
    background: rgba(241,196,15,0.09);
    border-color: rgba(241,196,15,0.22);
}
html[data-theme="dark"] .h-wm-day-name { color: var(--text); }
html[data-theme="dark"] .h-wm-day-temp .mx { color: #f87171; }
html[data-theme="dark"] .h-wm-day-temp .mn { color: #60a5fa; }
html[data-theme="dark"] .h-wm-day-rain.wet { color: #60a5fa; }
html[data-theme="dark"] .h-wm-day-rain-period { color: #64748b; }
html[data-theme="dark"] .h-wm-day-rain-col.has-wet .h-wm-day-rain-period {
    color: #7dd3fc;
    opacity: .92;
}

/* ══════════════════════════════════════════════════════════════
   WEATHER ADMIN PANEL
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-weather-admin {
    background: linear-gradient(180deg, rgba(31,78,121,0.25) 0%, rgba(15,35,64,0.3) 100%);
    border-color: rgba(52,152,219,0.2);
}
html[data-theme="dark"] .h-weather-admin-title { color: #90c4e8; }
html[data-theme="dark"] .h-weather-admin-sub   { color: #5f8fae; }
html[data-theme="dark"] .h-wa-label            { color: #6b9bb8; }
html[data-theme="dark"] .h-wa-input,
html[data-theme="dark"] .h-wa-textarea {
    background: rgba(255,255,255,0.06);
    border-color: rgba(52,152,219,0.2);
    color: var(--text);
}
html[data-theme="dark"] .h-wa-input:focus,
html[data-theme="dark"] .h-wa-textarea:focus { border-color: #3498db; }
html[data-theme="dark"] .h-wa-check {
    background: rgba(52,152,219,0.1);
    border-color: rgba(52,152,219,0.2);
    color: #7bb8d8;
}
html[data-theme="dark"] .h-wa-template {
    background: rgba(255,255,255,0.05);
    border-color: rgba(52,152,219,0.18);
    color: #90c4e8;
}
html[data-theme="dark"] .h-wa-template:hover {
    background: rgba(52,152,219,0.1);
}
html[data-theme="dark"] .h-wa-status {
    background: rgba(255,255,255,0.04);
    border-color: rgba(52,152,219,0.18);
    color: #7ab2cc;
}
html[data-theme="dark"] .h-wa-logs-title  { color: #6fa7c4; }
html[data-theme="dark"] .h-wa-logs-refresh {
    background: rgba(255,255,255,0.05);
    border-color: rgba(52,152,219,0.2);
    color: #6fa7c4;
}
html[data-theme="dark"] .h-wa-log-item {
    background: rgba(255,255,255,0.04);
    border-color: rgba(52,152,219,0.15);
}
html[data-theme="dark"] .h-wa-log-item:hover { background: rgba(52,152,219,0.07); }
html[data-theme="dark"] .h-wa-log-type   { color: #90c4e8; }
html[data-theme="dark"] .h-wa-log-time   { color: #4d7b97; }
html[data-theme="dark"] .h-wa-log-text   { color: #7ab2cc; }
html[data-theme="dark"] .h-wa-log-stats  { color: #456b83; }
html[data-theme="dark"] .h-wa-preview-block {
    background: rgba(255,255,255,0.04);
    border-color: rgba(52,152,219,0.15);
}
html[data-theme="dark"] .h-wa-preview-lang  { color: #4d7b97; }
html[data-theme="dark"] .h-wa-preview-title { color: var(--text); }
html[data-theme="dark"] .h-wa-preview-body  { color: #6b9bb8; }
html[data-theme="dark"] .h-wa-send-box {
    background: var(--card);
}
html[data-theme="dark"] .h-wa-send-cancel {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

/* ══════════════════════════════════════════════════════════════
   МОДАЛКА ПОИСКА
   ══════════════════════════════════════════════════════════════ */
html[data-theme="light"] .search-results-content {
    background: var(--card);
    border-color: rgba(15,23,42,0.10);
    box-shadow: 0 8px 32px rgba(15,23,42,0.12);
}
html[data-theme="light"] .search-results-header,
html[data-theme="light"] .search-results-meta {
    border-bottom-color: rgba(15,23,42,0.14);
}
html[data-theme="light"] .search-result-item {
    border-bottom-color: rgba(15,23,42,0.10);
}
html[data-theme="light"] .search-result-item:hover {
    background: rgba(15,23,42,0.04);
}
html[data-theme="light"] .search-category-title {
    color: var(--text2);
}

html[data-theme="dark"] .search-results-content {
    background: var(--card);
    border-color: rgba(255,255,255,0.10);
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
html[data-theme="dark"] .search-results-header,
html[data-theme="dark"] .search-results-meta {
    border-bottom-color: rgba(255,255,255,0.12);
    color: var(--text);
}
html[data-theme="dark"] .search-results-close { color: var(--text2); }
html[data-theme="dark"] .search-result-item:hover {
    background: rgba(255,255,255,0.06);
}
html[data-theme="dark"] .search-result-item {
    border-bottom-color: rgba(255,255,255,0.10);
}
html[data-theme="dark"] .search-result-thumb {
    background: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .search-category-title { color: var(--text3); }
html[data-theme="dark"] .search-result-title   { color: var(--text); }
html[data-theme="dark"] .search-result-sub     { color: var(--text2); }
html[data-theme="dark"] .search-empty          { color: var(--text2); }
html[data-theme="dark"] .search-auth-note {
    background: rgba(241,196,15,0.07);
    border-color: rgba(241,196,15,0.25);
}
html[data-theme="dark"] .search-result-lock-cta {
    background: rgba(241,196,15,0.1);
    border-color: rgba(241,196,15,0.3);
}

/* ══════════════════════════════════════════════════════════════
   СПИННЕР / ЗАГРУЗКА
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .h-loading .spinner {
    border-color: rgba(255,255,255,0.1);
    border-top-color: var(--accent);
}
html[data-theme="dark"] .h-end { color: var(--text3); }

/* ══════════════════════════════════════════════════════════════
   МОБИЛЬНЫЙ ФУТЕР
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .mobile-footer {
    --footer-bg:            rgba(13,17,23,0.97) !important;
    --footer-border:        rgba(255,255,255,0.07) !important;
    --footer-inactive:      #4a5568 !important;
    --footer-active-primary:#fbbf24 !important;
    --footer-active-bg:     rgba(251,191,36,0.08) !important;
    --footer-shadow:        0 -1px 0 rgba(255,255,255,0.04),
                            0 -4px 20px rgba(0,0,0,0.5) !important;
    background:   rgba(13,17,23,0.97) !important;
    border-top:   1px solid rgba(255,255,255,0.07) !important;
    box-shadow:   0 -1px 0 rgba(255,255,255,0.04),
                  0 -4px 20px rgba(0,0,0,0.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
html[data-theme="dark"] .mobile-footer .footer-btn {
    color: #64748b !important;
}
html[data-theme="dark"] .mobile-footer .footer-btn.active {
    color: #fbbf24 !important;
}
html[data-theme="dark"] .mobile-footer .footer-btn span {
    color: inherit !important;
}

/* ══════════════════════════════════════════════════════════════
   СКРОЛЛБАР (Webkit)
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: transparent;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* ══════════════════════════════════════════════════════════════
   АВТОМАТИЧЕСКОЕ ОПРЕДЕЛЕНИЕ (prefers-color-scheme)
   ══════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --bg:          #0d1117;
        --bg2:         #161b26;
        --card:        #1c2130;
        --border:      rgba(255,255,255,0.08);
        --border-hover:rgba(241,196,15,0.35);
        --accent:      #f1c40f;
        --accent-dark: #fbbf24;
        --accent-bg:   rgba(241,196,15,0.07);
        --blue:        #60a5fa;
        --green:       #4ade80;
        --red:         #f87171;
        --orange:      #fb923c;
        --purple:      #c084fc;
        --text:        #e8edf5;
        --text2:       #8892a4;
        --text3:       #4a5568;
        --shadow:      0 2px 12px rgba(0,0,0,0.45);
        --shadow-lg:   0 4px 28px rgba(0,0,0,0.6);
    }
    html:not([data-theme="light"]) body { background: #0d1117; color: #e8edf5; }

    html:not([data-theme="light"]) .hh {
        background: transparent;
    }
    html:not([data-theme="light"]) .hh-search input {
        background: rgba(255,255,255,0.06);
        border-color: rgba(255,255,255,0.1);
        color: #e8edf5;
    }
    html:not([data-theme="light"]) .hh-lang {
        background: rgba(255,255,255,0.06);
        border-color: rgba(255,255,255,0.1);
        color: #8892a4;
    }
    html:not([data-theme="light"]) .h-weather {
        background: #1c2130;
        border-color: rgba(255,255,255,0.09);
        box-shadow: 0 2px 12px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
    }
    html:not([data-theme="light"]) .h-weather:hover {
        border-color: rgba(255,255,255,0.16);
        background: #222836;
    }
    html:not([data-theme="light"]) .h-weather.loading .h-weather-temp,
    html:not([data-theme="light"]) .h-weather.loading .h-weather-date {
        background: linear-gradient(90deg,rgba(255,255,255,.06) 25%,rgba(255,255,255,.1) 50%,rgba(255,255,255,.06) 75%);
        background-size: 200% 100%;
    }
    html:not([data-theme="light"]) .h-op-card,
    html:not([data-theme="light"]) .h-ev-card,
    html:not([data-theme="light"]) .h-eq,
    html:not([data-theme="light"]) .h-shop,
    html:not([data-theme="light"]) .h-top-card,
    html:not([data-theme="light"]) .h-news-item,
    html:not([data-theme="light"]) .h-feed-item {
        background: #1c2130;
        border-color: rgba(255,255,255,0.07);
    }
    html:not([data-theme="light"]) .h-op-show-more { background: #1c2130; }
    html:not([data-theme="light"]) .h-modal { background: #1c2130; }
    html:not([data-theme="light"]) .h-wm-day {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.06);
    }
    html:not([data-theme="light"]) .h-wm-day:hover {
        border-color: rgba(255,255,255,0.11);
        background: rgba(255,255,255,0.07);
    }
    html:not([data-theme="light"]) .h-wm-day.today {
        background: rgba(241,196,15,0.09);
        border-color: rgba(241,196,15,0.22);
    }
    html:not([data-theme="light"]) .search-results-content {
        background: #1c2130;
        border-color: rgba(255,255,255,0.10);
    }
    html:not([data-theme="light"]) .search-results-header,
    html:not([data-theme="light"]) .search-results-meta {
        border-bottom-color: rgba(255,255,255,0.12);
    }
    html:not([data-theme="light"]) .search-result-item {
        border-bottom-color: rgba(255,255,255,0.10);
    }
    html:not([data-theme="light"]) .search-result-item:hover { background: rgba(255,255,255,0.06); }
    html:not([data-theme="light"]) .mobile-footer {
        background:  rgba(13,17,23,0.97) !important;
        border-top:  1px solid rgba(255,255,255,0.07) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    html:not([data-theme="light"]) .mobile-footer .footer-btn { color: #64748b !important; }
    html:not([data-theme="light"]) .mobile-footer .footer-btn.active { color: #fbbf24 !important; }
    html:not([data-theme="light"]) .h-services { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.07); }
    html:not([data-theme="light"]) .h-ad {
        background: linear-gradient(135deg,rgba(241,196,15,0.08),rgba(241,196,15,0.04));
        border-color: rgba(241,196,15,0.22);
    }
    html:not([data-theme="light"]) .h-theme-btn { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: #fbbf24; }
    html:not([data-theme="light"]) .h-theme-btn .icon-sun  { display: block; }
    html:not([data-theme="light"]) .h-theme-btn .icon-moon { display: none; }
    html:not([data-theme="light"]) .h-weather-icon.clear  { background: rgba(243,156,18,.13); color: #fbbf24; }
    html:not([data-theme="light"]) .h-weather-icon.rain   { background: rgba(41,128,185,.14); color: #60a5fa; }
    html:not([data-theme="light"]) .h-weather-icon.snow   { background: rgba(93,109,126,.12); color: #bae6fd; }
    html:not([data-theme="light"]) .h-weather-icon.storm  { background: rgba(230,126,34,.13); color: #fb923c; }
    html:not([data-theme="light"]) .h-weather-icon.cloudy { background: rgba(127,140,141,.1);  color: #94a3b8; }
    html:not([data-theme="light"]) .h-wm-day-temp .mx { color: #f87171; }
    html:not([data-theme="light"]) .h-wm-day-temp .mn { color: #60a5fa; }
    html:not([data-theme="light"]) .h-wm-day-rain-period { color: #64748b; }
    html:not([data-theme="light"]) .h-wm-day-rain-col.has-wet .h-wm-day-rain-period {
        color: #7dd3fc;
        opacity: .92;
    }
    html:not([data-theme="light"]) .h-wa-input,
    html:not([data-theme="light"]) .h-wa-textarea { background: rgba(255,255,255,0.06); border-color: rgba(52,152,219,0.2); color: #e8edf5; }
    html:not([data-theme="light"]) .h-wa-template { background: rgba(255,255,255,0.05); border-color: rgba(52,152,219,0.18); color: #90c4e8; }
    html:not([data-theme="light"]) .h-wa-log-item { background: rgba(255,255,255,0.04); border-color: rgba(52,152,219,0.15); }
    html:not([data-theme="light"]) .h-wa-status   { background: rgba(255,255,255,0.04); border-color: rgba(52,152,219,0.18); color: #7ab2cc; }
    html:not([data-theme="light"]) .h-wa-preview-block { background: rgba(255,255,255,0.04); border-color: rgba(52,152,219,0.15); }
    html:not([data-theme="light"]) .h-wa-send-box { background: #1c2130; }
    html:not([data-theme="light"]) .h-wa-weather-admin {
        background: linear-gradient(180deg,rgba(31,78,121,0.25),rgba(15,35,64,0.3));
    }
    html:not([data-theme="light"]) .h-eq-tag {
        background: rgba(13,17,23,0.85);
        color: #e8edf5;
        border: 1px solid rgba(255,255,255,0.12);
    }
    html:not([data-theme="light"]) .h-feed-like {
        background: rgba(255,255,255,0.05);
        border-color: rgba(255,255,255,0.1);
        color: #8892a4;
    }
    html:not([data-theme="light"]) .h-feed-like.liked {
        background: rgba(231,76,60,0.12);
        color: #f87171;
    }
    @media (min-width: 1024px) {
        html:not([data-theme="light"]) body {
            max-width: 1260px;
            box-shadow: 0 0 0 1px rgba(255,255,255,0.05), 0 8px 40px rgba(0,0,0,0.5);
        }
        html:not([data-theme="light"]) html { background: #07090e; }
    }
}
