:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #EFF6FF;
    --amber: #F59E0B;
    --amber-light: #FFFBEB;
    --success: #10B981;
    --success-light: #ECFDF5;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --bg: #FFFFFF;
    --surface: #F8FAFC;
    --border: #E2E8F0;
    --text: #0F172A;
    --text-muted: #64748B;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,.07);
    --shadow-brand: 0 4px 24px rgba(37,99,235,.18);
    --ease: cubic-bezier(0.4,0,0.2,1);
    --bg-pattern: none;
}

/* ══ ТЁМНАЯ ТЕМА ════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --bg: #0F172A;
    --surface: #1E293B;
    --border: #334155;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --primary-light: rgba(59,130,246,.15);
    --shadow: 0 1px 4px rgba(0,0,0,.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,.6);
    --shadow-brand: 0 4px 24px rgba(59,130,246,.25);
}
[data-theme="dark"] .site-header { background: #1e293b; border-color: #2d3f55; }
[data-theme="dark"] .logo-text { color: #f1f5f9; }
[data-theme="dark"] .logo-city { color: #60a5fa; }
[data-theme="dark"] .nav-card { color: var(--text-muted); }
[data-theme="dark"] .nav-card:hover { background: rgba(255,255,255,.06); }
[data-theme="dark"] .home-hero { background: linear-gradient(135deg, #0f172a 0%, #1a2744 100%); }
[data-theme="dark"] .home-weather-card { background: rgba(30,41,59,.8); border-color: #2d3f55; }
[data-theme="dark"] .side-banner { border-color: #2d3f55; background: #1e293b; }
[data-theme="dark"] .side-banner-label { background: #1e293b; }
[data-theme="dark"] .home-news-featured { background: #1e293b; border-color: #2d3f55; }
[data-theme="dark"] .afisha-card { background: #1e293b; border-color: #2d3f55; }
[data-theme="dark"] .home-widget { background: #1e293b; border-color: #2d3f55; }
[data-theme="dark"] .home-widget-head { background: #162032; }
[data-theme="dark"] .home-transport-hint { background: #253347; }
[data-theme="dark"] .home-transport-hint:hover { background: #2d4060; }
[data-theme="dark"] .home-section-head { border-color: #2d3f55; }
[data-theme="dark"] .home-border-item { background: #162032; }
[data-theme="dark"] .classified-card, [data-theme="dark"] .news-card { background: #1e293b; border-color: #2d3f55; }
[data-theme="dark"] .home-live-bar { background: rgba(30,41,59,.8); border-color: #2d3f55; }

/* ══ ФОНЫ ═══════════════════════════════════════════════════════════════════ */
body {
    background-color: var(--bg);
    background-image: var(--bg-pattern);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Точки */
body.bg-dots { --bg-pattern: radial-gradient(circle, #c7d2fe 1px, transparent 1px); background-size: 28px 28px; }
[data-theme="dark"] body.bg-dots { --bg-pattern: radial-gradient(circle, #2d3f55 1px, transparent 1px); }

/* Сетка */
body.bg-grid {
    --bg-pattern: linear-gradient(var(--border) 1px, transparent 1px),
                  linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Фиолетовый градиент */
body.bg-purple { background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 40%, #f0f9ff 100%) !important; }
[data-theme="dark"] body.bg-purple { background: linear-gradient(135deg, #1e0a3c 0%, #2d1a4a 40%, #0f172a 100%) !important; }

/* Закат */
body.bg-sunset { background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 35%, #fce7f3 100%) !important; }
[data-theme="dark"] body.bg-sunset { background: linear-gradient(135deg, #2d1206 0%, #3d1f00 40%, #2d0a1a 100%) !important; }

/* Зелёный */
body.bg-forest { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #ecfdf5 100%) !important; }
[data-theme="dark"] body.bg-forest { background: linear-gradient(135deg, #052e16 0%, #0a3a1c 50%, #042014 100%) !important; }

/* Ночной город */
body.bg-night {
    background: #070d1a !important;
    --bg: #070d1a; --surface: #0d1628; --border: #1a2744; --text: #e2e8f0; --text-muted: #8899bb;
}
body.bg-night::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(56,89,168,.25) 0%, transparent 70%);
}

/* Северное сияние */
body.bg-aurora {
    background: linear-gradient(160deg, #0a0e1a 0%, #0d1f2d 30%, #0a1a0f 60%, #1a0a1f 100%) !important;
    --bg: #0a0e1a; --surface: #111827; --border: #1f2f3f; --text: #e2e8f0; --text-muted: #7fb3a0;
}
body.bg-aurora::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(ellipse 60% 30% at 20% 10%, rgba(52,211,153,.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 25% at 80% 15%, rgba(139,92,246,.1) 0%, transparent 60%),
        radial-gradient(ellipse 40% 20% at 50% 5%, rgba(56,189,248,.08) 0%, transparent 50%);
    animation: aurora-shift 12s ease-in-out infinite alternate;
}
@keyframes aurora-shift {
    0%   { opacity: .7; transform: scaleX(1) translateY(0); }
    50%  { opacity: 1;  transform: scaleX(1.08) translateY(10px); }
    100% { opacity: .8; transform: scaleX(.95) translateY(-5px); }
}

/* ══ АКЦЕНТНЫЕ ЦВЕТА ════════════════════════════════════════════════════════ */
body.accent-purple  { --primary: #1E40AF; --primary-dark: #6d28d9; }
body.accent-green   { --primary: #059669; --primary-dark: #047857; }
body.accent-red     { --primary: #dc2626; --primary-dark: #b91c1c; }
body.accent-orange  { --primary: #ea580c; --primary-dark: #c2410c; }
body.accent-pink    { --primary: #db2777; --primary-dark: #be185d; }
body.accent-teal    { --primary: #0891b2; --primary-dark: #0e7490; }
body.accent-blue    { --primary: #1a56db; --primary-dark: #1143b0; }
body.accent-grodno  { --primary: #1a7a45; --primary-dark: #15623a; }

/* ══ РАЗМЕР ШРИФТА ══════════════════════════════════════════════════════════ */
body.font-large  { font-size: 17px; }
body.font-xlarge { font-size: 19px; }

/* ══ ПАНЕЛЬ НАСТРОЕК ════════════════════════════════════════════════════════ */
.theme-fab { display: none; }

.theme-header-btn {
    background: none; border: 1.5px solid var(--border);
    border-radius: 10px; width: 36px; height: 36px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; cursor: pointer; color: var(--text-muted);
    transition: background .15s, color .15s, transform .25s, border-color .15s;
}
.theme-header-btn:hover { background: var(--hover); color: var(--text); border-color: var(--primary); }
.theme-header-btn.is-open { transform: rotate(45deg); color: var(--primary); border-color: var(--primary); }

.theme-panel-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.3);
    backdrop-filter: blur(2px); z-index: 901;
    opacity: 0; pointer-events: none; transition: opacity .25s;
}
.theme-panel-overlay.is-open { opacity: 1; pointer-events: all; }

.theme-panel {
    position: fixed; right: 0; top: 0; bottom: 0; width: 300px;
    background: var(--surface); border-left: 1px solid var(--border);
    box-shadow: -8px 0 40px rgba(0,0,0,.15);
    z-index: 902; overflow-y: auto;
    transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
}
.theme-panel.is-open { transform: translateX(0); }

.tp-header {
    padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.tp-header h3 { font-size: .95rem; font-weight: 800; color: var(--text); }
.tp-close {
    width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--border); color: var(--text); font-size: 1rem;
    display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.tp-close:hover { background: #fca5a5; color: #991b1b; }

.tp-body { padding: 16px 20px; flex: 1; display: flex; flex-direction: column; gap: 24px; }

.tp-section-title {
    font-size: .7rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-muted); margin-bottom: 10px;
}

/* Переключатель темы */
.tp-mode-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.tp-mode-btn {
    padding: 10px 4px; border-radius: 10px; border: 1.5px solid var(--border);
    background: var(--surface); cursor: pointer; text-align: center;
    transition: border-color .15s, background .15s; color: var(--text);
}
.tp-mode-btn .tm-icon { font-size: 1.3rem; display: block; margin-bottom: 3px; }
.tp-mode-btn .tm-label { font-size: .68rem; font-weight: 600; display: block; }
.tp-mode-btn.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }

/* Сетка фонов */
.tp-bg-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.tp-bg-opt {
    aspect-ratio: 1; border-radius: 10px; border: 2px solid transparent;
    cursor: pointer; overflow: hidden; transition: border-color .15s, transform .15s;
    position: relative;
}
.tp-bg-opt:hover { transform: scale(1.06); }
.tp-bg-opt.active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent); }
.tp-bg-opt span {
    position: absolute; bottom: 2px; left: 0; right: 0; text-align: center;
    font-size: .52rem; font-weight: 700; color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.7);
}

/* Цветовые свотчи */
.tp-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-color {
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 3px solid transparent;
    transition: transform .15s, border-color .15s; outline: none;
}
.tp-color:hover { transform: scale(1.15); }
.tp-color.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface); }

/* Размер шрифта */
.tp-font-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.tp-font-btn {
    padding: 10px 4px; border-radius: 10px; border: 1.5px solid var(--border);
    background: var(--surface); cursor: pointer; text-align: center;
    transition: border-color .15s; color: var(--text); font-weight: 600;
}
.tp-font-btn.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }

.tp-reset {
    width: 100%; padding: 10px; border-radius: 10px; border: 1.5px solid var(--border);
    background: var(--surface); cursor: pointer; font-size: .8rem; font-weight: 600;
    color: var(--text-muted); transition: border-color .15s, color .15s;
    margin-top: 8px;
}
.tp-reset:hover { border-color: #fca5a5; color: #dc2626; }

@media (max-width: 640px) {
    .theme-panel { width: 100%; }
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.site-header .container {
    display: flex; align-items: center; gap: 12px;
    height: 72px;
}
.logo {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
    text-decoration: none; color: var(--text);
    margin-right: 8px;
}

/* ── Логотип-знак ──────────────────────────────────────── */
@keyframes logo-pulse {
    0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37,99,235,.35); }
    50%      { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(37,99,235,.0); }
}
@keyframes logo-spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.logo-mark {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 12px rgba(37,99,235,.4);
    animation: logo-pulse 3s ease-in-out infinite;
    position: relative; overflow: hidden;
}
.logo-mark::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 60%);
    border-radius: 11px;
}
.logo-mark svg { position: relative; z-index: 1; }

/* ── Шрифт логотипа ────────────────────────────────────── */
.logo-wordmark {
    display: flex; flex-direction: column; gap: 1px; line-height: 1;
}
.logo-text {
    font-family: 'Bebas Neue', 'Montserrat', sans-serif;
    font-size: 1.6rem; font-weight: 400;
    letter-spacing: .06em; line-height: 1;
    color: #111827;
}

@keyframes logo-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.logo-domain {
    background: linear-gradient(90deg, #2563EB 0%, #a78bfa 40%, #2563EB 60%, #1E40AF 100%);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logo-shimmer 3s linear infinite;
    letter-spacing: .04em;
}

.logo-city {
    font-family: 'Montserrat', sans-serif;
    font-size: .48rem; font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: #2563EB;
    opacity: .7;
    margin-top: 2px;
}

/* Hover */
.logo:hover .logo-mark { box-shadow: 0 4px 18px rgba(37,99,235,.55); }
.logo:hover .logo-text  { color: #2563EB; }

/* Навигационная полоска под шапкой */
.site-subnav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.site-subnav .container {
    display: flex;
    justify-content: center;
    padding-top: 10px;
    padding-bottom: 10px;
}
[data-theme="dark"] .site-subnav { background: #1e293b; border-color: #2d3f55; }

/* Nav cards — horizontal pill chips */
.main-nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.nav-card {
    display: inline-flex; flex-direction: row; align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid #E5E7EB;
    background: #fff;
    text-decoration: none;
    color: #374151;
    white-space: nowrap;
    font-weight: 600;
    transition: border-color .15s, color .15s, background .15s;
    --nc: var(--primary);
}
/* Уникальный цвет каждой кнопки */
.main-nav a:nth-child(1) { --nc: #2563eb; } /* Транспорт   */
.main-nav a:nth-child(2) { --nc: #1E40AF; } /* Афиша       */
.main-nav a:nth-child(3) { --nc: #ea580c; } /* Объявления  */
.main-nav a:nth-child(4) { --nc: #0891b2; } /* Новости     */
.main-nav a:nth-child(5) { --nc: #1a7a45; } /* Справочник  */
.main-nav a:nth-child(6) { --nc: #dc2626; } /* Граница     */

.nav-card-icon { font-size: .95rem; line-height: 1; }
.nav-card-label { font-size: .78rem; font-weight: 600; color: inherit; }
.nav-card:hover {
    border-color: var(--nc);
    color: var(--nc);
    background: color-mix(in srgb, var(--nc) 6%, #fff);
}
.nav-card.active {
    background: var(--nc);
    border-color: var(--nc);
    color: #fff;
}
.nav-card.active:hover { filter: brightness(1.05); }
[data-theme="dark"] .nav-card { background: #1e293b; border-color: #2d3f55; color: #cbd5e1; }
[data-theme="dark"] .nav-card:hover { background: color-mix(in srgb, var(--nc) 14%, #1e293b); }

/* WIP nav cards */
.nav-card-wip { opacity: .45; cursor: default; position: relative; }
.nav-card-wip:hover { border-color: #E5E7EB; color: #374151; background: #fff; }
.nav-wip-badge {
    position: absolute; top: 3px; right: 3px;
    font-size: .55rem; line-height: 1;
    color: #94a3b8;
}

/* ── Кнопка "Кабинет" в шапке ───────────────────────────────────────────── */
.header-cab-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 0 20px 0 14px;
    height: 42px;
    border-radius: 24px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 14px rgba(37,99,235,.30);
    transition: transform .18s, box-shadow .18s, filter .18s;
    overflow: hidden;
}
/* блик */
.header-cab-btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.18) 0%, transparent 60%);
    border-radius: inherit;
    pointer-events: none;
}
.header-cab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(37,99,235,.42);
    filter: brightness(1.08);
    color: #fff;
}
.header-cab-btn.active {
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
    box-shadow: 0 4px 18px rgba(37,99,235,.45);
}
.header-cab-icon {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    background: rgba(255,255,255,.18);
    border-radius: 50%;
    font-size: .95rem;
    flex-shrink: 0;
}
.header-cab-text {
    font-size: .78rem; font-weight: 800;
    letter-spacing: .03em;
    line-height: 1;
}
[data-theme="dark"] .header-cab-btn {
    background: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
    box-shadow: 0 2px 14px rgba(109,40,217,.35);
}
[data-theme="dark"] .header-cab-btn:hover {
    box-shadow: 0 6px 22px rgba(109,40,217,.50);
}

/* Weather widget */
.weather-widget {
    display: flex; align-items: center; gap: 4px;
    flex-shrink: 0; margin-left: 4px;
    background: #f0fdf4; border-radius: 10px;
    padding: 8px 12px;
    font-size: .875rem; font-weight: 700; color: #16a34a;
    white-space: nowrap;
}
.weather-icon { font-size: 1.2rem; }
.weather-uv {
    font-size: .65rem; font-weight: 800; padding: 2px 6px;
    border-radius: 20px; letter-spacing: .03em;
    cursor: pointer; user-select: none;
    transition: opacity .15s;
}
.weather-uv:hover { opacity: .8; }
.uv-low   { background:#dcfce7; color:#15803d; }
.uv-mod   { background:#fef9c3; color:#a16207; }
.uv-high  { background:#ffedd5; color:#c2410c; }
.uv-vhigh { background:#fee2e2; color:#b91c1c; }
.uv-ext   { background:#f3e8ff; color:#7e22ce; }

/* UV popup */
.uv-popup {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,.14);
    padding: 10px 8px; min-width: 230px; z-index: 400;
}
.uv-popup.open { display: block; }
.uv-popup-title {
    font-size: 11px; font-weight: 800; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .07em;
    padding: 0 6px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.uv-popup-row {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px; border-radius: 8px; margin: 2px 0;
}
.uv-popup-range {
    font-size: 12px; font-weight: 900; min-width: 28px; text-align: center;
    padding: 2px 5px; border-radius: 6px;
    background: inherit;
}
.uv-popup-label { font-size: 12px; font-weight: 700; flex: 1; }
.uv-popup-tip { font-size: 10px; font-weight: 500; opacity: .75; white-space: nowrap; }
.uv-popup-row.uv-current { outline: 2px solid currentColor; outline-offset: -1px; }

@media (max-width: 640px) { .weather-uv { display:none !important; } }

/* Main */
.main-content { padding: 32px 0 64px; }
.main-content.main-fullscreen { padding: 0; overflow: hidden; }
.site-footer.hidden { display: none; }
.page-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header .page-title { margin-bottom: 0; }

/* Card values (weather on index) */
.card-value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.card-sub { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.card-value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.card-sub { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* Section */
.section { margin-bottom: 48px; }
.section-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 16px; }

/* News */
.news-feed, .news-list { display: flex; flex-direction: column; gap: 12px; }
.news-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 4px;
}
.news-card--full { flex-direction: row; gap: 16px; align-items: flex-start; }
.news-img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.news-title { font-weight: 600; color: var(--text); text-decoration: none; font-size: .95rem; }
.news-title:hover { color: var(--primary); }
.news-meta { display: flex; gap: 12px; }
.news-source, .news-time { font-size: .8rem; color: var(--text-muted); }

/* Events */
.events-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.event-card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.event-img { width: 100%; height: 160px; object-fit: cover; }
.event-body { padding: 16px; }
.event-date { font-size: .8rem; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.event-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.event-venue { font-size: .85rem; color: var(--text-muted); margin-bottom: 4px; }
.event-price { font-size: .9rem; font-weight: 600; color: #16a34a; margin-top: 8px; }

/* Border */
.border-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.border-card {
    background: var(--surface); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); border-left: 4px solid var(--border);
}
.border-level-green  { border-left-color: #16a34a; }
.border-level-yellow { border-left-color: #ca8a04; }
.border-level-orange { border-left-color: #ea580c; }
.border-level-red    { border-left-color: #dc2626; }
.border-name { font-size: 1.1rem; font-weight: 700; }
.border-direction { font-size: .85rem; color: var(--text-muted); }
.border-queue, .border-wait { font-size: .9rem; margin-bottom: 4px; }
.border-status { font-weight: 600; margin-top: 8px; }
.border-updated { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

.border-level-badge {
    font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 20px;
    white-space: nowrap; flex-shrink: 0;
}
.border-badge-green  { background: #dcfce7; color: #16a34a; }
.border-badge-yellow { background: #fef9c3; color: #854d0e; }
.border-badge-orange { background: #ffedd5; color: #9a3412; }
.border-badge-red    { background: #fee2e2; color: #991b1b; }

.border-queue-row {
    display: flex; gap: 16px; flex-wrap: wrap;
}
.border-queue-item {
    display: flex; align-items: baseline; gap: 4px;
}
.border-queue-icon { font-size: 1rem; }
.border-queue-count { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.border-queue-label { font-size: .75rem; color: var(--text-muted); }

/* Transport */
.transport-section { margin-bottom: 32px; }
.route-list { display: flex; flex-wrap: wrap; gap: 8px; }
.route-badge {
    display: inline-block; padding: 8px 16px;
    background: var(--surface); border: 2px solid var(--border);
    border-radius: 8px; font-weight: 700; font-size: .9rem;
    text-decoration: none; color: var(--text);
    transition: border-color .15s, background .15s;
}
.route-badge:hover { border-color: var(--primary); background: #eff6ff; color: var(--primary); }

/* Promotions */
.promo-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.promo-card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.promo-img { width: 100%; height: 160px; object-fit: cover; }
.promo-body { padding: 16px; }
.promo-store { font-size: .8rem; color: var(--primary); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.promo-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.promo-desc { font-size: .875rem; color: var(--text-muted); margin-bottom: 8px; }
.promo-date { font-size: .8rem; color: #dc2626; }

/* Classifieds */
.classifieds-list { display: flex; flex-direction: column; gap: 12px; }
.classified-card {
    background: var(--surface); border-radius: var(--radius); padding: 16px;
    box-shadow: var(--shadow); display: flex; gap: 16px;
}
.classified-img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.classified-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.classified-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.classified-desc { font-size: .875rem; color: var(--text-muted); margin-bottom: 8px; }
.classified-meta { display: flex; gap: 12px; font-size: .8rem; color: var(--text-muted); }

/* Jobs */
.jobs-list { display: flex; flex-direction: column; gap: 12px; }
.job-card {
    background: var(--surface); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow);
}
.job-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.job-company, .job-type { font-size: .875rem; color: var(--text-muted); margin-bottom: 4px; }
.job-salary { font-size: 1rem; font-weight: 700; color: #16a34a; margin-bottom: 8px; }
.job-desc { font-size: .875rem; color: var(--text-muted); margin-bottom: 8px; }
.job-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; }
.job-meta a { color: var(--primary); }

/* Article */
.article { background: var(--surface); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.article-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 12px; }
.article-meta { display: flex; gap: 16px; color: var(--text-muted); font-size: .875rem; margin-bottom: 20px; }
.article-img { width: 100%; max-height: 400px; object-fit: cover; border-radius: 8px; margin-bottom: 20px; }
.article-content { line-height: 1.8; }

/* Form */
.form { background: var(--surface); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); max-width: 600px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: 6px; }
.form-input {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: .95rem; font-family: inherit;
    transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--primary); }

/* Buttons */
.btn-primary {
    display: inline-block; padding: 10px 20px;
    background: var(--primary); color: #fff;
    border: none; border-radius: 8px; font-weight: 600; font-size: .95rem;
    cursor: pointer; text-decoration: none;
    transition: background .15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-more, .btn-back, .btn-source {
    display: inline-block; margin-top: 16px;
    color: var(--primary); text-decoration: none; font-weight: 600; font-size: .875rem;
}
.btn-more:hover, .btn-back:hover, .btn-source:hover { text-decoration: underline; }

/* Alert */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-weight: 600; }
.alert-success { background: #dcfce7; color: #16a34a; }

/* Empty state */
.empty-state { color: var(--text-muted); text-align: center; padding: 48px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; text-align: center; color: var(--text-muted); font-size: .875rem; }

/* ===== HOME PAGE ===== */
.home-main { padding: 0; }

/* Hero */
.home-hero {
    background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 60%, #1a56db 100%);
    color: #fff; padding: 40px 0 36px;
    position: relative; overflow: hidden;
}
.home-hero::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 50%, rgba(26,86,219,.25) 0%, transparent 70%);
    pointer-events: none;
}
.home-hero-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 32px; position: relative; z-index: 1;
}
.home-hero-left { flex: 1; min-width: 0; }
.home-hero-eyebrow {
    font-size: .8rem; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; opacity: .6; margin-bottom: 10px;
}
.home-hero-title {
    font-size: 2.4rem; font-weight: 900; line-height: 1.1;
    margin-bottom: 12px; letter-spacing: -.02em;
}
.home-hero-lead {
    font-size: .95rem; opacity: .75; max-width: 420px; line-height: 1.6;
    margin-bottom: 20px;
}
.home-live-bar {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
    border-radius: 999px; padding: 6px 14px;
    font-size: .78rem; font-weight: 500; max-width: 100%;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.home-live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #4ade80; flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(74,222,128,.3);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%,100% { box-shadow: 0 0 0 2px rgba(74,222,128,.3); }
    50%      { box-shadow: 0 0 0 5px rgba(74,222,128,.1); }
}

/* Weather card in hero */
.home-weather-card {
    background: rgba(255,255,255,.12); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px; padding: 20px 24px; flex-shrink: 0; min-width: 180px;
    color: #fff;
}
.hwc-city { font-size: .7rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; opacity: .55; margin-bottom: 4px; }
.hwc-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.hwc-temp { font-size: 3rem; font-weight: 900; line-height: 1; }
.hwc-icon { font-size: 2.2rem; }
.hwc-desc { font-size: .85rem; opacity: .8; margin-bottom: 8px; text-transform: capitalize; }
.hwc-details { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .75rem; opacity: .65; }
.hwc-updated { font-size: .65rem; opacity: .4; margin-top: 8px; }

/* ── 3-колоночный макет главной ─────────────────────────────────────────── */
.container-wide { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.home-wide { padding: 28px 0 56px; }
.home-3col {
    display: grid;
    grid-template-columns: 160px 1fr 220px;
    grid-template-areas: "left main right";
    gap: 24px; align-items: start;
}
/* Левый и правый сайдбары — sticky-контейнеры */
.home-side-left {
    grid-area: left; min-width: 0;
    position: sticky; top: 88px;
    align-self: start;
}
.home-col-main { grid-area: main; min-width: 0; }
.home-side-right {
    grid-area: right; min-width: 0;
    position: sticky; top: 88px;
    align-self: start;
    display: flex; flex-direction: column; gap: 16px;
}

/* Боковые баннеры */
.side-banner {
    border-radius: 12px; overflow: hidden;
    border: 1px solid #dde3ed;
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
    background: #f8fafc;
}
.side-banner img { width: 100%; display: block; }
.side-banner a { display: block; transition: opacity .15s; }
.side-banner a:hover { opacity: .92; }
.side-banner-label {
    font-size: .55rem; color: #b0bac8; text-align: right;
    padding: 2px 7px; background: #f8fafc; letter-spacing: .04em;
}
.side-banner-empty .side-banner-placeholder {
    min-height: 200px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px;
    padding: 20px; text-align: center;
}
.side-banner-empty .side-banner-placeholder span {
    font-size: .72rem; color: #c4ccd8; font-weight: 600;
}
.side-banner-empty .side-banner-placeholder a {
    font-size: .72rem; color: var(--primary); text-decoration: none;
    padding: 4px 12px; border: 1px solid var(--primary); border-radius: 6px;
}

/* Старый grid (оставляем для совместимости) */
.home-grid { display: grid; grid-template-columns: 1fr 300px; gap: 28px; padding: 28px 0 48px; align-items: start; }
.home-col-side { min-width: 0; }

/* Section headings */
.home-section { margin-bottom: 32px; }
.home-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}
.home-section-title { font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }
.home-section-link {
    font-size: .8rem; color: var(--primary); font-weight: 600;
    text-decoration: none; white-space: nowrap;
}
.home-section-link:hover { text-decoration: underline; }

/* Banner / ad slot — реальный баннер */
.home-real-banner {
    position: relative; border-radius: 14px; overflow: hidden;
    margin-bottom: 24px; border: 1px solid #dde3ed;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
.home-real-banner img { width: 100%; display: block; max-height: 100px; object-fit: cover; }
.home-real-banner a { display: block; transition: opacity .15s; }
.home-real-banner a:hover { opacity: .93; }
.home-banner-label {
    position: absolute; bottom: 6px; right: 8px;
    background: rgba(0,0,0,.32); color: rgba(255,255,255,.85);
    font-size: .55rem; padding: 1px 6px; border-radius: 3px;
    letter-spacing: .04em;
}

/* Баннер-заглушка (нет рекламы) */
.home-banner-slot {
    border-radius: 12px; overflow: hidden; margin-bottom: 24px;
    border: 1.5px dashed #dde3ed; background: #f8fafc;
}
.home-banner-inner {
    padding: 14px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.home-banner-tag {
    font-size: .6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #b0bac8; background: #eef1f6;
    border-radius: 4px; padding: 2px 6px;
}
.home-banner-text { flex: 1; font-size: .82rem; color: #94a3b8; min-width: 0; }
.home-banner-cta {
    background: var(--primary); color: #fff; border-radius: 7px;
    padding: 6px 14px; font-size: .78rem; font-weight: 600;
    text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.home-banner-cta:hover { background: var(--primary-dark); }

/* Classifieds grid */
.home-classifieds-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px;
}

/* Обычная карточка — приглушённая */
.home-classified-card {
    background: #f9fafb; border-radius: 10px; padding: 12px 13px;
    border: 1px solid #e8ecf1;
    text-decoration: none; color: #475569; display: flex;
    flex-direction: column; gap: 3px; transition: border-color .15s, background .15s;
}
.home-classified-card:hover { border-color: #c5cdd9; background: #f2f5f8; }

/* Топ — яркая карточка, выделяется */
.hcc-top {
    background: #fffdf5 !important;
    border: 1.5px solid #f59e0b !important;
    box-shadow: 0 2px 10px rgba(245,158,11,.18);
    color: var(--text) !important;
}
.hcc-top:hover {
    border-color: #e08c00 !important;
    box-shadow: 0 5px 18px rgba(245,158,11,.28) !important;
    background: #fff9e6 !important;
}

/* Стандарт — чуть заметнее обычной */
.hcc-std {
    border-color: #bfdbfe !important;
    background: #f7faff !important;
    color: var(--text) !important;
}
.hcc-std:hover { border-color: #93c5fd !important; }

/* Категория */
.hcc-cat {
    font-size: .62rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: #94a3b8;
    display: flex; align-items: center; gap: 5px;
}
.hcc-top .hcc-cat { color: #b45309; }
.hcc-std .hcc-cat { color: #3b82f6; }

.hcc-badge { font-size: .52rem; padding: 1px 5px; border-radius: 999px; font-weight: 700; }
.hcc-badge-top { background: #f59e0b; color: #fff; }
.hcc-badge-std { background: #3b82f6; color: #fff; }

/* Заголовок */
.hcc-title { font-size: .85rem; font-weight: 500; line-height: 1.3; flex: 1; color: #475569; }
.hcc-top .hcc-title { font-weight: 600; color: var(--text); }
.hcc-std .hcc-title { color: #334155; }

/* Цена */
.hcc-price { font-size: .9rem; font-weight: 700; color: #64748b; margin-top: 3px; }
.hcc-top .hcc-price { color: var(--primary); font-weight: 800; }
.hcc-std .hcc-price { color: var(--primary); }

.hcc-meta {
    display: flex; justify-content: space-between;
    font-size: .7rem; color: #94a3b8; margin-top: 3px;
}
.home-classified-add {
    align-items: center; justify-content: center; text-align: center;
    color: #94a3b8; border-style: dashed; font-size: .82rem; font-weight: 500; gap: 6px;
    background: #f8fafc !important;
}
.home-classified-add:hover { color: var(--primary) !important; border-color: var(--primary) !important; }
.hcc-add-icon { font-size: 1.2rem; line-height: 1; }

/* CTA card */
.home-cta-card {
    display: flex; align-items: center; gap: 16px; padding: 18px 20px;
    background: var(--surface); border-radius: 14px; border: 1.5px solid var(--border);
    box-shadow: var(--shadow); text-decoration: none; color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.home-cta-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.home-cta-card p { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.home-cta-arrow { margin-left: auto; font-size: 1.2rem; color: var(--primary); }

/* News list */
.home-news-list { display: flex; flex-direction: column; }
.home-news-item {
    padding: 12px 0; border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 4px;
}
.home-news-item:last-child { border-bottom: none; }
.home-news-featured { padding: 16px; background: var(--surface);
    border-radius: 12px; border: 1.5px solid var(--border);
    box-shadow: var(--shadow); margin-bottom: 4px; }
.hni-meta { display: flex; gap: 10px; align-items: center; }
.hni-source { font-size: .7rem; font-weight: 700; color: var(--primary);
    text-transform: uppercase; letter-spacing: .04em; }
.hni-time { font-size: .75rem; color: var(--text-muted); }
.hni-title { font-size: .925rem; font-weight: 600; color: var(--text);
    text-decoration: none; line-height: 1.4; }
.hni-title:hover { color: var(--primary); }
.home-news-featured .hni-title { font-size: 1.05rem; font-weight: 700; }

/* Events list */
.home-events-list { display: flex; flex-direction: column; gap: 0; }
.home-event-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.home-event-item:last-child { border-bottom: none; }
.hei-date {
    display: flex; flex-direction: column; align-items: center; flex-shrink: 0;
    width: 40px; background: var(--primary); color: #fff;
    border-radius: 8px; padding: 6px 4px; line-height: 1.1;
}
.hei-day { font-size: 1.1rem; font-weight: 900; }
.hei-mon { font-size: .6rem; text-transform: uppercase; opacity: .8; }
.hei-body { flex: 1; min-width: 0; }
.hei-title { font-size: .875rem; font-weight: 600; }
.hei-venue { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.hei-price { font-size: .8rem; font-weight: 700; color: var(--primary);
    flex-shrink: 0; white-space: nowrap; }
.hei-free { color: #16a34a; }

/* Sidebar widgets */
.home-widget {
    background: var(--surface); border-radius: 14px;
    border: 1px solid var(--border); box-shadow: var(--shadow);
    overflow: hidden;
}
.home-widget-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.home-widget-title { font-size: .875rem; font-weight: 700; }
.home-widget-link { font-size: .75rem; color: var(--primary); text-decoration: none; font-weight: 600; }
.home-widget-link:hover { text-decoration: underline; }
.home-widget-loading { padding: 16px; font-size: .8rem; color: var(--text-muted); }
.home-widget-empty { padding: 16px; font-size: .8rem; color: var(--text-muted); }

/* Border items in widget */
.home-border-item {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    border-left: 3px solid transparent;
}
.home-border-item:last-child { border-bottom: none; }
.home-border-green  { border-left-color: #16a34a; }
.home-border-yellow { border-left-color: #ca8a04; }
.home-border-orange { border-left-color: #ea580c; }
.home-border-red    { border-left-color: #dc2626; }
.hbi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.hbi-top b { font-size: .875rem; }
.hbi-badge { font-size: .65rem; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.hbi-badge-green  { background: #dcfce7; color: #15803d; }
.hbi-badge-yellow { background: #fef9c3; color: #92400e; }
.hbi-badge-orange { background: #ffedd5; color: #9a3412; }
.hbi-badge-red    { background: #fee2e2; color: #991b1b; }
.hbi-dir { font-size: .72rem; color: var(--text-muted); margin-bottom: 6px; }
.hbi-nums { display: flex; gap: 16px; font-size: .8rem; }
.hbi-nums b { font-size: 1.1rem; font-weight: 800; }
.hbi-ts { font-size: .68rem; color: #94a3b8; margin-top: 4px; }

/* Transport hint */
.home-transport-hint {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    text-decoration: none; color: var(--text); transition: background .15s;
}
.home-transport-hint:hover { background: #f8fafc; }
.hth-icon { font-size: 1.6rem; flex-shrink: 0; }
.hth-text { font-size: .875rem; font-weight: 600; }
.hth-sub { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }
.hth-arrow { margin-left: auto; color: var(--primary); font-size: 1rem; }

/* Ad slot */
.home-ad-slot {
    border-radius: 14px; border: 1.5px dashed var(--border);
    overflow: hidden; margin-bottom: 16px;
}
.home-ad-inner { padding: 16px; text-align: center; }
.home-ad-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .06em;
    color: #94a3b8; margin-bottom: 8px; }
.home-ad-placeholder {
    height: 120px; background: #f8fafc; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; color: #cbd5e1; font-weight: 600; letter-spacing: .04em;
}

/* Promo card */


/* Section more */
.section-more { font-size: .85rem; color: var(--primary); font-weight: 600; text-decoration: none; }
.section-more:hover { text-decoration: underline; }
/* Border mini (kept for border page) */
.border-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap:12px; }
.border-mini-card { background:var(--surface); border-radius:14px; padding:16px; box-shadow:var(--shadow); border:1px solid var(--border); }
.border-mini-loading { color:var(--text-muted); font-size:.9rem; padding:12px 0; }

/* Transport detail */
.route-header {
    display: flex; align-items: center; gap: 20px; margin-bottom: 32px;
    background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.route-number-big {
    font-size: 3rem; font-weight: 900; color: var(--primary);
    background: #eff6ff; border-radius: 12px; padding: 8px 20px; line-height: 1;
}
.route-name { color: var(--text-muted); font-size: .95rem; }

.stops-list { display: flex; flex-direction: column; gap: 0; }
.stop-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-left: 2px solid var(--border); padding-left: 16px; position: relative; }
.stop-dot { width: 10px; height: 10px; background: var(--primary); border-radius: 50%; position: absolute; left: -6px; }
.stop-name { font-size: .9rem; }

.schedule-block { margin-bottom: 24px; }
.schedule-day { font-size: 1rem; font-weight: 700; margin-bottom: 12px; color: var(--text-muted); }
.schedule-times { display: flex; flex-wrap: wrap; gap: 8px; }
.time-chip {
    padding: 6px 12px; background: #eff6ff; color: var(--primary);
    border-radius: 8px; font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums;
}

/* ══ АФИША ══════════════════════════════════════════════════════════════════ */

/* Большая обложка первого события */
.afisha-featured {
    position: relative; border-radius: 18px; overflow: hidden;
    min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end;
    margin-bottom: 16px; cursor: default;
    transition: transform .2s, box-shadow .2s;
}
.afisha-featured:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.afisha-featured-img {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    transition: transform .4s;
}
.afisha-featured:hover .afisha-featured-img { transform: scale(1.03); }
.afisha-featured-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.3) 60%, transparent 100%);
}
.afisha-featured-body {
    position: relative; padding: 22px 24px 20px;
    display: flex; flex-direction: column; gap: 8px;
}
.afisha-featured-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.afisha-cat-badge {
    font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 20px;
    border: 1px solid; letter-spacing: .03em; backdrop-filter: blur(4px);
}
.afisha-today-badge {
    font-size: .68rem; font-weight: 800; padding: 3px 9px; border-radius: 20px;
    background: #ef4444; color: #fff; letter-spacing: .04em; animation: pulse-badge 2s infinite;
}
.afisha-tomorrow-badge { background: #f97316 !important; animation: none; }
@keyframes pulse-badge {
    0%,100%{ box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
    50%     { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.afisha-featured-title {
    font-size: 1.35rem; font-weight: 800; color: #fff; line-height: 1.25;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.afisha-featured-desc {
    font-size: .82rem; color: rgba(255,255,255,.7); line-height: 1.45; max-width: 600px;
}
.afisha-featured-footer {
    display: flex; align-items: flex-end; justify-content: space-between;
    flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.afisha-featured-meta { display: flex; flex-direction: column; gap: 3px; }
.afisha-date-big { font-size: .85rem; font-weight: 700; color: rgba(255,255,255,.9); }
.afisha-venue { font-size: .75rem; color: rgba(255,255,255,.6); }
.afisha-price-block {}
.afisha-price {
    font-size: .9rem; font-weight: 800; color: #fbbf24;
    background: rgba(0,0,0,.35); backdrop-filter: blur(4px);
    padding: 4px 12px; border-radius: 8px;
}
.afisha-free { color: #4ade80 !important; }

/* Горизонтальный скролл карточек */
.afisha-scroll-wrap {
    position: relative;
    margin: 0 -4px;
    padding: 0 4px;
}
.afisha-arr {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,.6); backdrop-filter: blur(6px);
    border: 1.5px solid rgba(255,255,255,.8);
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10; padding: 0;
    opacity: 0; pointer-events: none;
    transition: opacity .25s, background .15s;
    -webkit-user-select: none; user-select: none;
    font-size: 1.15rem; line-height: 1; color: #374151;
}
.afisha-arr:hover { background: rgba(255,255,255,.9); }
.afisha-arr.visible { opacity: 1; pointer-events: auto; }
.afisha-arr-left  { left: 6px; }
.afisha-arr-right { right: 6px; }
.afisha-scroll {
    display: flex; gap: 10px; overflow-x: auto; padding: 4px 16px 12px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; scrollbar-color: #dde3ed transparent;
}
.afisha-scroll::-webkit-scrollbar { height: 4px; }
.afisha-scroll::-webkit-scrollbar-thumb { background: #dde3ed; border-radius: 4px; }

.afisha-card {
    flex: 0 0 200px; scroll-snap-align: start;
    background: var(--surface); border-radius: 14px;
    border: 1.5px solid var(--border); box-shadow: var(--shadow);
    display: flex; gap: 0; overflow: hidden;
    text-decoration: none; color: var(--text);
    transition: transform .18s, box-shadow .18s, border-color .18s;
    position: relative;
}
.afisha-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--card-accent, #818cf8);
    border-radius: 3px 0 0 3px;
}
.afisha-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-color: var(--card-accent, #818cf8);
}
.afisha-card-date {
    flex-shrink: 0; width: 48px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--card-bg, #1e1b4b); gap: 0; padding: 12px 0;
}
.afisha-card-day  { font-size: 1.3rem; font-weight: 900; color: #fff; line-height: 1; }
.afisha-card-mon  { font-size: .62rem; font-weight: 700; color: rgba(255,255,255,.6); text-transform: uppercase; }
.afisha-card-body { padding: 10px 11px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.afisha-card-cat  { font-size: .62rem; font-weight: 700; color: var(--card-accent, #818cf8);
    text-transform: uppercase; letter-spacing: .04em;
    display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.afisha-today-sm  { font-size: .58rem; background: #ef4444; color: #fff; padding: 1px 5px; border-radius: 4px; }
.afisha-card-title { font-size: .82rem; font-weight: 600; line-height: 1.3; color: var(--text); }
.afisha-card-venue { font-size: .7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.afisha-card-price { font-size: .78rem; font-weight: 700; color: var(--primary); margin-top: auto; padding-top: 4px; }

/* Пусто */
.afisha-empty {
    text-align: center; padding: 48px 24px;
    background: var(--surface); border-radius: 16px; border: 1.5px dashed var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-muted);
}

/* Responsive */
/* ── Mobile bottom navigation ──────────────────────────────────────── */
.mobile-bottom-nav { display: none; }

@media (max-width: 640px) {
    /* Header: compact — logo + weather only, кабинет goes to bottom nav */
    .site-header .container {
        height: 52px; padding: 0 12px; flex-wrap: nowrap; gap: 8px;
    }
    .logo-mark { width: 32px; height: 32px; border-radius: 9px; }
    .logo-text { font-size: 1.25rem; }
    .logo-city { font-size: .42rem; letter-spacing: .18em; }
    .main-nav { display: none; }
    .header-cab-btn { display: none; }
    .weather-widget { min-width: unset !important; width: auto !important; gap: 4px; }
    .weather-icon { font-size: .95rem; }
    .weather-temp { font-size: .75rem; }

    /* Bottom nav bar */
    .mobile-bottom-nav {
        display: flex;
        position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
        background: var(--surface);
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 16px rgba(0,0,0,.10);
        padding: 5px 2px max(env(safe-area-inset-bottom, 0px), 5px);
    }
    .mbn-link {
        flex: 1; display: flex; flex-direction: column;
        align-items: center; justify-content: center;
        gap: 2px; text-decoration: none;
        color: #94a3b8; padding: 3px 1px;
        border-radius: 10px; transition: color .15s, background .15s;
        min-width: 0;
    }
    .mbn-link.active {
        color: var(--nc);
        background: color-mix(in srgb, var(--nc) 12%, transparent);
    }
    .mbn-icon { font-size: 1.25rem; line-height: 1; }
    .mbn-label {
        font-size: .53rem; font-weight: 700; line-height: 1;
        text-align: center; white-space: nowrap;
        overflow: hidden; text-overflow: ellipsis; max-width: 48px;
        color: inherit;
    }

    /* Push content above bottom nav */
    .main-content { padding-bottom: 68px; }
    .site-footer { padding-bottom: 72px; }

    /* Other mobile fixes */
    .classified-card { flex-direction: column; }
    .news-card--full { flex-direction: column; }

    /* Home hero mobile */
    .home-hero { padding: 28px 0 24px; }
    .home-hero-inner { flex-direction: column-reverse; gap: 20px; }
    .home-hero-title { font-size: 1.8rem; }
    .home-weather-card { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
    .hwc-row { flex-direction: row; }
    .hwc-temp { font-size: 2.2rem; }
    .hwc-icon { font-size: 1.6rem; }
    .hwc-city { display: none; }

    /* Home grid mobile: stack */
    .home-grid { grid-template-columns: 1fr; gap: 0; padding: 20px 0 32px; }
    .home-col-side { order: -1; }
    .home-ad-slot { margin-bottom: 12px; }
    .home-classifieds-grid { grid-template-columns: 1fr 1fr; }
    .border-mini-grid { grid-template-columns: 1fr; }
    .home-live-bar { font-size: .72rem; }

    /* 3-col → 1col on mobile */
    .home-3col {
        grid-template-columns: 1fr;
        grid-template-areas: "main" "right";
    }
    .home-side-left { display: none; }
    .home-side-right { position: static; }
    .side-banner { position: static; }
    .afisha-featured { min-height: 200px; }
    .afisha-featured-title { font-size: 1.1rem; }
    .afisha-card { flex: 0 0 165px; }
}
@media (min-width: 641px) and (max-width: 1050px) {
    .main-nav { gap: 4px; }
    .nav-card { padding: 4px 8px; min-width: 44px; }
    .home-grid { grid-template-columns: 1fr 260px; }
    .home-hero-title { font-size: 2rem; }

    /* 3-col → 2col: hide left banner on tablet */
    .home-3col {
        grid-template-columns: 1fr 200px;
        grid-template-areas: "main right";
    }
    .home-side-left { display: none; }
}
@media (min-width: 1051px) and (max-width: 1200px) {
    .home-3col { grid-template-columns: 140px 1fr 200px; gap: 18px; }
}

/* ══ MOBILE BOTTOM NAV ══════════════════════════════════════════════════════ */
.mob-nav { display: none; }

@media (max-width: 640px) {
    .mob-nav {
        display: flex;
        position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
        background: var(--surface);
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 16px rgba(0,0,0,.08);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mob-nav-item {
        flex: 1; display: flex; flex-direction: column; align-items: center;
        justify-content: center; gap: 3px;
        padding: 8px 4px 10px;
        text-decoration: none; color: var(--text-muted);
        font-size: .6rem; font-weight: 700;
        transition: color .15s, background .15s;
        -webkit-tap-highlight-color: transparent;
    }
    .mob-nav-item:hover,
    .mob-nav-item.active { color: var(--primary); }
    .mob-nav-item.active { background: color-mix(in srgb, var(--primary) 6%, transparent); }
    .mob-nav-icon { font-size: 1.35rem; line-height: 1; }
    .mob-nav-label { white-space: nowrap; }

    /* отступ снизу чтобы контент не прятался за навбаром */
    body { padding-bottom: 64px; }

    /* скрыть суб-нав на мобильном — снизу есть навбар */
    .site-subnav { display: none; }

    [data-theme="dark"] .mob-nav { background: #1e293b; border-color: #2d3f55; }
}
