/*
 |--------------------------------------------------------------------------
 | Realtime globe (/realtime) — единый CSS страницы
 |--------------------------------------------------------------------------
 |
 | Страница автономна: не подключает app.css. Это обычный CSS без Tailwind —
 | правится и видна по F5, без сборки. Разметку строит realtime.js, имена
 | классов заданы здесь. Вендорный maplibre-gl.css грузится отдельным <link>.
 */

/* ---------- шрифт ---------- */

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/realtime/fonts/ibm-plex-sans-400.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/realtime/fonts/ibm-plex-sans-600.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/realtime/fonts/ibm-plex-sans-700.woff2') format('woff2');
}

/* ---------- токены ---------- */

:root {
    --rt-accent: #0254ec;
    --rt-accent-rgb: 2, 84, 236;
    --rt-bg: #070b14;
}

/* ---------- каркас страницы ---------- */

* {
    box-sizing: border-box;
}

html.rt-page,
html.rt-page body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

html.rt-page body {
    background-color: var(--rt-bg);
    color: #fff;
    font-family: 'IBM Plex Sans', 'Helvetica Neue', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.rt-root {
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow: hidden;
    background-color: var(--rt-bg);
    color: #fff;
}

.rt-hidden {
    display: none !important;
}

/* Виджет чата (Crisp) приезжает через GTM и перекрывает карту — прячем. */
.rt-page .crisp-client,
.rt-page #crisp-chatbox {
    display: none !important;
}

/* ---------- звёздный фон + карта ---------- */

.rt-starfield {
    pointer-events: none;
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 45%, rgba(30, 48, 90, 0.55) 0%, rgba(7, 11, 20, 0) 60%),
        var(--rt-bg);
}

.rt-starfield canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#rt-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.maplibregl-canvas:focus {
    outline: none;
}

/* Нативную атрибуцию убираем с карты: тот же текст живёт в панели About (ODbL ок). */
.maplibregl-ctrl-attrib,
.maplibregl-ctrl-bottom-right,
.maplibregl-ctrl-bottom-left {
    display: none !important;
}

/* ---------- общий вид карточек ---------- */

.rt-card {
    box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.45);
}

/* ---------- верхняя панель (лого + тулбар + live + факты) ---------- */

.rt-panel {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 20;
    width: 100%;
    max-width: 100%;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.35);
    color: #111827;
}

.rt-panel-top {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
}

.rt-logo {
    display: inline-flex;
    align-items: center;
}

.rt-logo img {
    height: 32px;
    width: auto;
    display: block;
}

.rt-toolbar {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ряд «live» */
.rt-live {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 6px;
    font-size: 14px;
    color: #4b5563;
}

.rt-live-dot {
    position: relative;
    display: inline-flex;
    height: 8px;
    width: 8px;
    margin-right: 2px;
}

.rt-live-dot .rt-ping {
    position: absolute;
    inset: 0;
    display: inline-flex;
    height: 100%;
    width: 100%;
    border-radius: 9999px;
    background: #22c55e;
    opacity: 0.75;
}

.rt-live-dot .rt-live-core {
    position: relative;
    display: inline-flex;
    height: 8px;
    width: 8px;
    border-radius: 9999px;
    background: #22c55e;
}

.rt-strong {
    font-weight: 700;
    color: #000;
}

.rt-muted {
    color: #9ca3af;
}

/* ---------- факты (строки чипов) ---------- */

.rt-facts {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rt-fact-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rt-fact-label {
    width: 68px;
    flex-shrink: 0;
    font-size: 12px;
    color: #9ca3af;
}

.rt-chips-wrap {
    position: relative;
    min-width: 0;
    flex: 1;
}

.rt-chips-wrap::before,
.rt-chips-wrap::after {
    content: '';
    pointer-events: none;
    position: absolute;
    top: 0;
    z-index: 10;
    height: 100%;
    width: 16px;
}

.rt-chips-wrap::before {
    left: 0;
    background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}

.rt-chips-wrap::after {
    right: 0;
    background: linear-gradient(to left, #fff, rgba(255, 255, 255, 0));
}

.rt-chips {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding: 2px 4px;
    scrollbar-width: none;
}

.rt-chips::-webkit-scrollbar {
    display: none;
}

.rt-chip {
    display: flex;
    flex-shrink: 0;
    cursor: pointer;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    max-width: 190px;
    border: 0;
    border-radius: 6px;
    background: #f3f4f6;
    padding: 2px 6px;
    font-size: 12px;
    color: #000;
    transition: background 0.1s;
}

.rt-chip:hover {
    background: rgba(var(--rt-accent-rgb), 0.1);
}

.rt-chip.is-active {
    background: rgba(var(--rt-accent-rgb), 0.1);
    box-shadow: inset 0 0 0 1px rgba(var(--rt-accent-rgb), 0.4);
}

.rt-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rt-chip-count {
    color: #9ca3af;
}

.rt-chip-dot {
    display: inline-flex;
    height: 16px;
    width: 16px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #d1d5db;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
    color: #fff;
}

.rt-flag {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.rt-empty {
    padding: 0 4px;
    font-size: 12px;
    color: #d1d5db;
}

/* ---------- мини-статистика (спарклайн) ---------- */

.rt-stats {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.rt-stats-spark {
    height: 30px;
}

.rt-spark-svg {
    display: block;
    width: 100%;
    height: 30px;
    overflow: visible;
}

.rt-spark-line {
    fill: none;
    stroke: var(--rt-accent);
    stroke-width: 1.5;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.rt-spark-fill {
    fill: rgba(var(--rt-accent-rgb), 0.12);
    stroke: none;
}

.rt-stats-meta {
    margin-top: 4px;
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 11px;
    color: #9ca3af;
}

.rt-stats-meta .rt-strong {
    font-size: 12px;
}

/* ---------- кнопки тулбара ---------- */

.rt-tool-btn {
    display: flex;
    height: 24px;
    width: 24px;
    flex-shrink: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    color: #4b5563;
    padding: 0;
    transition: all 0.1s;
}

.rt-tool-btn:hover {
    border-color: rgba(0, 0, 0, 0.2);
    background: #f9fafb;
    color: #000;
}

.rt-tool-btn.is-active {
    border-color: rgba(var(--rt-accent-rgb), 0.2);
    background: rgba(var(--rt-accent-rgb), 0.1);
    color: var(--rt-accent);
}

.rt-tool-btn.is-muted {
    border-color: rgba(0, 0, 0, 0.05);
    background: #f9fafb;
    color: #d1d5db;
}

.rt-tool-btn svg {
    height: 14px;
    width: 14px;
}

/* обёртка кнопки с поповером/тултипом */
.rt-tool {
    position: relative;
    flex-shrink: 0;
}

/* палитра */
.rt-pop {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 30;
    margin-top: 6px;
    display: flex;
    gap: 4px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    padding: 6px;
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.4);
}

.rt-swatch {
    height: 24px;
    width: 24px;
    cursor: pointer;
    border: 0;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s;
}

.rt-swatch:hover {
    transform: scale(1.05);
}

.rt-swatch.is-active {
    box-shadow: 0 0 0 2px var(--rt-accent);
}

/* тултип */
.rt-tip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    z-index: 40;
    white-space: nowrap;
    border-radius: 6px;
    background: #111827;
    color: #fff;
    padding: 4px 8px;
    font-size: 11px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s;
}

.rt-tool:hover .rt-tip {
    opacity: 1;
}

/* ---------- радио ---------- */

.rt-radio {
    position: relative;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.rt-radio-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rt-radio-ico {
    display: flex;
    height: 20px;
    width: 20px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: var(--rt-accent);
}

.rt-radio-now {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.2;
}

.rt-radio-now .rt-radio-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111827;
}

.rt-radio-loading {
    color: #9ca3af;
}

.rt-radio-error {
    color: #ef4444;
}

.rt-radio-blocked {
    color: #d97706;
}

.rt-radio-picker {
    position: relative;
    flex-shrink: 0;
}

.rt-radio-station {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    border: 0;
    border-radius: 6px;
    background: #f3f4f6;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
    color: #111827;
    transition: background 0.1s;
}

.rt-radio-station:hover {
    background: rgba(var(--rt-accent-rgb), 0.1);
}

.rt-radio-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 30;
    margin-top: 4px;
    width: 160px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    padding: 4px 0;
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.4);
}

.rt-radio-menu button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 6px 10px;
    text-align: left;
    font-size: 12px;
    color: #111827;
}

.rt-radio-menu button:hover {
    background: #f9fafb;
}

.rt-radio-menu button.is-active {
    color: var(--rt-accent);
}

.rt-radio-provider {
    flex-shrink: 0;
    font-size: 10px;
    color: #9ca3af;
    text-decoration: none;
}

.rt-radio-provider:hover {
    color: #6b7280;
}

.rt-radio-slot {
    pointer-events: none;
    position: absolute;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* ---------- лента событий ---------- */

.rt-feed {
    position: absolute;
    bottom: 96px;
    left: 0;
    z-index: 20;
    width: 100%;
    background: rgba(12, 18, 32, 0.72);
    box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
}

.rt-feed-head {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.rt-feed-head-clear {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: inline-flex;
}

.rt-feed-head-clear:hover {
    color: #fff;
}

.rt-feed-scroll {
    max-height: 30vh;
    overflow-y: auto;
    padding: 6px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.rt-feed-scroll::-webkit-scrollbar {
    width: 6px;
}

.rt-feed-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.rt-feed-row {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: 6px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 4px 12px;
    text-align: left;
    font-size: 12px;
    color: inherit;
    transition: background 0.1s;
    animation: rt-feed-in 0.28s ease;
}

.rt-feed-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.rt-feed-ico {
    margin-top: 2px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.4);
}

.rt-feed-ico.is-breaking {
    color: #fbbf24;
}

.rt-feed-ico svg {
    height: 14px;
    width: 14px;
}

.rt-feed-line {
    min-width: 0;
    flex: 1;
}

.rt-feed-line > span,
.rt-feed-line > img {
    margin-right: 4px;
}

.rt-feed-src {
    font-weight: 500;
    color: #f3f4f6;
}

.rt-feed-dim {
    color: rgba(255, 255, 255, 0.5);
}

.rt-feed-city {
    color: #f3f4f6;
}

.rt-mono {
    display: inline;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 4px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.35;
    color: #f3f4f6;
}

.rt-feed-ago {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    opacity: 0.6;
}

.rt-feed-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

@keyframes rt-feed-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- крестик выхода ---------- */

.rt-close {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 30;
    display: flex;
    height: 36px;
    width: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(6px);
    transition: all 0.15s;
    text-decoration: none;
}

.rt-close:hover {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}

.rt-close svg {
    height: 16px;
    width: 16px;
}

/* ---------- About / атрибуция ---------- */

.rt-about {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    z-index: 20;
    width: 100%;
    padding: 0 12px;
}

.rt-about-box {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(6px);
}

.rt-about-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    text-align: left;
    color: inherit;
}

.rt-about-toggle h1 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}

.rt-about-toggle span {
    margin-left: auto;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.rt-about-cta {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.rt-about-cta:hover {
    color: rgba(255, 255, 255, 0.8);
}

.rt-attrib {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.35);
}

.rt-attrib a {
    color: inherit;
    text-decoration: none;
}

.rt-attrib a:hover {
    color: rgba(255, 255, 255, 0.6);
}

.rt-about-body {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
}

.rt-about-body p {
    margin: 0 0 8px;
}

.rt-about-body a {
    color: #fff;
    text-decoration: underline;
}

/* ---------- replay bar ---------- */

/* Replay-бар живёт ВНУТРИ панели (между live-строкой и фактами), как в
   референсе, а не отдельной карточкой снизу. */
.rt-replay {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.rt-replay-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Ползунок нативный + accent-color: залитая часть и бегунок красятся акцентом
   во всех актуальных браузерах (Chrome/Firefox/Safari), без хаков с псевдо. */
.rt-range {
    width: 100%;
    flex: 1;
    cursor: pointer;
    accent-color: var(--rt-accent);
}

.rt-replay-label {
    flex-shrink: 0;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: #6b7280;
}

/* ---------- маркеры ---------- */

.rt-marker {
    cursor: pointer;
    transition: transform 0.1s;
}

.rt-marker:hover {
    transform: scale(1.05);
}

.rt-marker-inner {
    position: relative;
    animation: rt-marker-arrival 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Пин = SVG-флаг страны в круге (flag-icons, одинаково на всех ОС). */
.rt-marker-flag {
    display: block;
    height: 44px;
    width: 44px;
    border-radius: 9999px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    outline: 1px solid rgba(0, 0, 0, 0.1);
}

.rt-marker-sm .rt-marker-flag {
    height: 34px;
    width: 34px;
}

/* Инлайн-флаг в чипах и ленте. */
.rt-flag-img {
    display: inline-block;
    flex-shrink: 0;
    height: 13px;
    width: auto;
    border-radius: 2px;
    vertical-align: -2px;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}

.rt-marker-badge {
    position: absolute;
    right: 1px;
    top: 1px;
    z-index: 10;
    height: 13px;
    width: 13px;
    border-radius: 9999px;
    border: 2px solid #fff;
    background: #22c55e;
}

.rt-marker-breaking .rt-marker-badge {
    background: #fbbf24;
}

.rt-marker-breaking .rt-marker-flag {
    outline: 2px solid #fbbf24;
}

/* Затухание: opacity/scale вешаем на .rt-marker-inner, а не на .rt-marker —
   позиционный transform внешнего элемента задаёт сам maplibre каждый кадр и
   перебил бы scale, из-за чего пин пропадал бы рывком, а не плавно гас. */
.rt-marker-leaving {
    pointer-events: none;
}

.rt-marker-leaving .rt-marker-inner {
    opacity: 0;
    transform: scale(0.55);
    transition: opacity 0.65s ease, transform 0.65s ease;
    animation: none;
}

@keyframes rt-marker-arrival {
    0% {
        opacity: 0;
        transform: translateY(-14px) scale(0.4);
    }
    60% {
        opacity: 1;
        transform: translateY(0) scale(1.08);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.rt-ping {
    animation: rt-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes rt-ping {
    75%,
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* ---------- попап маркера ---------- */

.rt-popup {
    position: relative;
    width: 320px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    padding: 12px;
    font-size: 14px;
    color: #000;
    box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.4);
}

.rt-popup-logo {
    position: absolute;
    left: 12px;
    top: 12px;
    height: 56px;
    width: 56px;
    border-radius: 9999px;
    background: #f3f4f6;
    outline: 1px solid rgba(0, 0, 0, 0.1);
}

.rt-popup-head {
    margin-bottom: 12px;
    padding-left: 72px;
    min-height: 56px;
}

.rt-popup-source {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
}

.rt-popup-place {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #6b7280;
}

.rt-popup-grid {
    margin-top: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 6px;
    font-size: 12px;
    line-height: 1.2;
    color: #6b7280;
}

.rt-popup-grid .rt-k {
    color: #9ca3af;
}

.rt-popup-grid .rt-v {
    color: #000;
}

.rt-popup-body {
    border-radius: 8px;
    background: #f9fafb;
    padding: 10px;
}

.rt-popup-body .rt-k {
    font-size: 12px;
    color: #9ca3af;
}

.rt-popup-title {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: #000;
}

.rt-popup-foot {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rt-popup-cta {
    cursor: pointer;
    border: 0;
    border-radius: 8px;
    background: #000;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    transition: background 0.15s;
}

.rt-popup-cta:hover {
    background: #1f2937;
}

.rt-popup-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: underline;
}

.rt-popup-link:hover {
    color: #000;
}

/* maplibre popup: гасим стандартную «капсулу», рисуем свою */
.maplibregl-popup-content {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.maplibregl-popup-tip {
    display: none !important;
}

.maplibregl-popup-close-button {
    right: 6px !important;
    top: 6px !important;
    z-index: 10 !important;
    display: flex !important;
    height: 24px;
    width: 24px;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 9999px !important;
    background: rgba(255, 255, 255, 0.85) !important;
    font-size: 16px !important;
    line-height: 1 !important;
    color: #6b7280 !important;
}

.maplibregl-popup-close-button:hover {
    background: #f3f4f6 !important;
    color: #000 !important;
}

/* ---------- планшет/десктоп ---------- */

/* ---------- доступность: скрытый live-регион ---------- */

.rt-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- скелетоны загрузки ---------- */

.rt-skel {
    display: inline-block;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.11) 37%, rgba(0, 0, 0, 0.06) 63%);
    background-size: 400% 100%;
    animation: rt-shimmer 1.3s ease infinite;
}

@keyframes rt-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

.rt-facts-skel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rt-skel-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rt-skel-label {
    height: 10px;
    width: 56px;
    flex-shrink: 0;
}

.rt-skel-chips {
    display: flex;
    gap: 6px;
    overflow: hidden;
}

.rt-skel-chip {
    height: 20px;
    width: 66px;
    flex-shrink: 0;
    border-radius: 6px;
}

.rt-feed-skel {
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rt-skel-feed-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 12px;
}

.rt-skel-feed-dot,
.rt-skel-feed-line {
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 37%, rgba(255, 255, 255, 0.1) 63%);
    background-size: 400% 100%;
    animation: rt-shimmer 1.3s ease infinite;
}

.rt-skel-feed-dot {
    height: 14px;
    width: 14px;
    flex-shrink: 0;
}

.rt-skel-feed-line {
    height: 12px;
    width: 78%;
}

/* ---------- оверлей загрузки карты ---------- */

.rt-loading {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background:
        radial-gradient(ellipse at 50% 45%, rgba(30, 48, 90, 0.55) 0%, rgba(7, 11, 20, 0) 60%),
        var(--rt-bg);
    color: rgba(255, 255, 255, 0.7);
    transition: opacity 0.6s ease, visibility 0.6s;
}

.rt-loading.rt-gone {
    opacity: 0;
    visibility: hidden;
}

.rt-loading-spinner {
    height: 34px;
    width: 34px;
    border-radius: 9999px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--rt-accent);
    animation: rt-spin 0.8s linear infinite;
}

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

.rt-loading-text {
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* ---------- CTA-баннер ---------- */

.rt-cta {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(92vw, 640px);
    padding: 9px 10px 9px 16px;
    border-radius: 9999px;
    background: rgba(7, 11, 20, 0.86);
    color: #fff;
    box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rt-cta-dot {
    height: 8px;
    width: 8px;
    flex-shrink: 0;
    border-radius: 9999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.rt-cta-text {
    font-size: 13px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.8);
}

.rt-cta-strong {
    font-weight: 600;
    color: #fff;
}

.rt-cta-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 9999px;
    background: #fff;
    color: #070b14;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.rt-cta-btn:hover {
    background: #e5e7eb;
}

.rt-cta-x {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    width: 26px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    border-radius: 9999px;
}

.rt-cta-x:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.rt-cta-x svg {
    height: 14px;
    width: 14px;
}

/* На узких экранах баннер перекрыл бы ленту/About — прячем. */
@media (max-width: 767px) {
    .rt-cta {
        display: none;
    }
}

/* ---------- тикер топ-историй (бегущая строка сверху) ---------- */

.rt-ticker {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 24;
    display: none;
    align-items: center;
    gap: 10px;
    width: min(46vw, 480px);
    padding: 6px 10px 6px 12px;
    border-radius: 9999px;
    background: rgba(7, 11, 20, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    color: #fff;
    overflow: hidden;
}

/* Показываем только на широких экранах — в центре хватает места между
   панелью слева и крестиком справа. */
@media (min-width: 1300px) {
    .rt-ticker:not(.rt-hidden) {
        display: flex;
    }
}

.rt-ticker-label {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f97316;
}

.rt-ticker-label svg {
    height: 13px;
    width: 13px;
}

.rt-ticker-viewport {
    position: relative;
    flex: 1;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.rt-ticker-track {
    display: inline-flex;
    white-space: nowrap;
    will-change: transform;
    animation: rt-ticker-scroll 30s linear infinite;
}

.rt-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 22px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.rt-ticker-badge {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    background: #ef4444;
    border-radius: 4px;
    padding: 1px 5px;
}

@keyframes rt-ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (min-width: 768px) {
    .rt-panel {
        left: 16px;
        top: 16px;
        width: 384px;
        border-radius: 16px;
    }

    .rt-feed {
        bottom: 16px;
        left: 16px;
        width: 384px;
        border-radius: 16px;
    }

    .rt-feed-scroll {
        max-height: 42vh;
    }

    .rt-close {
        right: 16px;
        top: 16px;
    }

    .rt-about {
        left: auto;
        right: 16px;
        bottom: 16px;
        width: 288px;
        padding: 0;
    }
}

/* ---------- уважение к настройкам движения ---------- */

@media (prefers-reduced-motion: reduce) {
    .rt-marker-inner,
    .rt-ping,
    .rt-feed-row,
    .rt-skel,
    .rt-skel-feed-dot,
    .rt-skel-feed-line,
    .rt-loading-spinner,
    .rt-ticker-track {
        animation: none;
    }

    .rt-marker {
        transition: none;
    }
}
