:root {
    --bg-app: #050505;
    --surface-glass: rgba(11, 14, 20, 0.85);
    --surface-solid: #0b0e14;
    --border-glass: rgba(255, 255, 255, 0.05);
    --accent: #FACC15;
    --accent-glow: rgba(250, 204, 21, 0.3);
    --blue: #3B82F6;
    --red: #EF4444;
    --orange: #F97316;
    --green: #10B981;
    --text-main: #F8FAFC;
    --text-muted: #475569;
    --panel-w: 480px;
    --radius-lg: 16px;
    --radius-md: 12px;

    /* Téma-függő segédszínek (sötét az alapértelmezett) */
    --input-bg: rgba(0, 0, 0, 0.3);
    --input-bg-focus: rgba(0, 0, 0, 0.5);
    --hover-bg: rgba(255, 255, 255, 0.04);
    --hover-bg-strong: rgba(255, 255, 255, 0.06);
    --card-bg-soft: rgba(255, 255, 255, 0.03);
    --shadow-color: rgba(0, 0, 0, 0.65);
    --handle-color: rgba(255, 255, 255, .25);
    /* A felső sáv lefelé elhalványuló hátteréhez (rgba-ban keverjük) */
    --top-bar-rgb: 11, 14, 20;
}

html[data-theme="light"] {
    --bg-app: #eef1f5;
    --surface-glass: rgba(255, 255, 255, 0.85);
    --surface-solid: #ffffff;
    --border-glass: rgba(15, 23, 42, 0.1);
    --accent: #B45309;
    --accent-glow: rgba(180, 83, 9, 0.25);
    --blue: #2563EB;
    --red: #DC2626;
    --orange: #C2410C;
    --green: #059669;
    --text-main: #0f172a;
    --text-muted: #64748b;

    --input-bg: rgba(15, 23, 42, 0.05);
    --input-bg-focus: rgba(15, 23, 42, 0.08);
    --hover-bg: rgba(15, 23, 42, 0.04);
    --hover-bg-strong: rgba(15, 23, 42, 0.07);
    --card-bg-soft: rgba(15, 23, 42, 0.03);
    --shadow-color: rgba(15, 23, 42, 0.18);
    --handle-color: rgba(15, 23, 42, .2);
    --top-bar-rgb: 255, 255, 255;
}

html[data-theme="light"] body {
    background: var(--bg-app);
}

/* A JS sablonokban sok helyen kemény kódolt, sötét háttérre szánt világos
   szövegszín szerepel (pl. "Aktuális állapot", "Szolgáltatások" lista,
   "Közlekedik" doboz, figyelmeztetés szövege). Világos módban ezek a
   inline style-ok szinte láthatatlanok lennének a világos kártyákon,
   ezért itt, attribútum-szelektorral, !important-tel felülírjuk őket. */
html[data-theme="light"] [style*="color:#cbd5e1"],
html[data-theme="light"] [style*="color: #cbd5e1"],
html[data-theme="light"] [style*="color:#e2e8f0"],
html[data-theme="light"] [style*="color: #e2e8f0"],
html[data-theme="light"] [style*="color:#f1f5f9"],
html[data-theme="light"] [style*="color: #f1f5f9"] {
    color: var(--text-main) !important;
}

html[data-theme="light"] [style*="color:#94a3b8"],
html[data-theme="light"] [style*="color: #94a3b8"],
html[data-theme="light"] [style*="color:#64748b"],
html[data-theme="light"] [style*="color: #64748b"] {
    color: var(--text-muted) !important;
}

html[data-theme="light"] [style*="background:rgba(255,255,255,.03)"] {
    background: var(--card-bg-soft) !important;
}

html[data-theme="light"] [style*="background:rgba(255,255,255,.08)"] {
    background: var(--hover-bg-strong) !important;
}

html[data-theme="light"] [style*="border:1px solid rgba(255,255,255,.06)"] {
    border: 1px solid var(--border-glass) !important;
}

html[data-theme="light"] [style*="background: #1e293b"],
html[data-theme="light"] [style*="background:#1e293b"] {
    background: var(--surface-solid) !important;
}

html[data-theme="light"] [style*="border: 1px solid rgba(255,255,255,0.08)"],
html[data-theme="light"] [style*="border:1px solid rgba(255,255,255,0.08)"] {
    border: 1px solid var(--border-glass) !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

#map {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #020617;
}

/* ==========================================================================
   FELSŐ SÁV (FR24-stílus): logó + LIVE + egyesített kereső + CET óra
   ========================================================================== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 400;

    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 18px;

    background: none;
    border: none;
    /* Csak a benne lévő vezérlők fogják a kattintást, a köztük lévő
       "üres" (elhalványuló) rész felett a térkép marad használható. */
    pointer-events: none;
}

.top-bar-inner {
    pointer-events: none;
}

/* A háttér külön rétegen van, és lefelé fokozatosan átlátszóvá válik (a sáv
   alá is lelóg), így nincs éles alsó széle. A maszk a homályosítást is
   elhalványítja - a sáv TARTALMA viszont végig éles marad. */
.top-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -28px;
    z-index: -1;
    pointer-events: none;

    /* Csak enyhe sötétítés (FR24-stílus): a térkép végig átlátszik alatta. */
    background: linear-gradient(to bottom,
        rgba(var(--top-bar-rgb), 0.55) 0%,
        rgba(var(--top-bar-rgb), 0.42) 38%,
        rgba(var(--top-bar-rgb), 0.24) 65%,
        rgba(var(--top-bar-rgb), 0.08) 84%,
        rgba(var(--top-bar-rgb), 0) 100%);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, rgba(0, 0, 0, .35) 78%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 45%, rgba(0, 0, 0, .35) 78%, transparent 100%);
}

/* Három csoport egy sorban: ["Az oldalról" + LIVE] [márka + TikTok]
   [óra + kereső]. A két szélső oszlop egyforma széles (1fr), ezért a középső
   csoport pontosan a sáv közepére esik, a két másik pedig - egy kis szünet
   (a rács gap-je) után - közvetlenül mellé simul, nem a képernyő szélére. */
.top-bar-inner {
    position: relative;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
}

.top-bar-inner > * {
    pointer-events: auto;
}

/* Az oldalról + LIVE: a saját oszlopa jobb széléhez húzva, hogy a középső
   csoport mellett álljon. */
.top-bar-left {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* A .live-badge-green alap bal margója a sor térközére rakódna rá -
   a távolságot itt a gap adja. */
.top-bar-left .live-badge-green {
    margin-left: 0;
}

.top-bar-about {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    background: var(--hover-bg-strong);
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s ease;
}

.top-bar-about:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-app);
}

/* A középső csoport: márka + TikTok. Ez az "auto" szélességű rácsoszlop, a
   két 1fr oszlop között - így marad pontosan középen. */
.top-bar-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 0 0 auto;
}

/* A logó a megszokott stílusát tartja (.brand-image ikon + .logo színátmenetes
   felirat), csak a felső sávhoz méretezzük vissza. */
.top-bar .top-bar-logo {
    width: 32px;
    height: 32px;
}

.top-bar .top-bar-wordmark {
    font-size: 18px;
    white-space: nowrap;
}

.top-bar-live {
    flex: 0 0 auto;
}

/* --- egyesített kereső --- */
.top-bar-search {
    position: relative;
    flex: 0 0 auto;
    width: 240px;
}

.top-bar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    opacity: .7;
    pointer-events: none;
}

.top-bar-search-input {
    width: 100%;
    height: 38px;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    padding: 0 36px 0 34px;
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
    transition: all .2s ease;
}

.top-bar-search-input:focus {
    border-color: var(--accent);
    background: var(--input-bg-focus);
    box-shadow: 0 0 10px var(--accent-glow);
}

.top-bar-search-clear {
    display: none;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--hover-bg-strong);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
}

.top-bar-search-clear:hover {
    background: var(--red);
    color: #fff;
}

/* --- találati lenyíló --- */
.top-bar-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    /* A kereső keskeny, de a találati lista jobbra igazítva szélesebb lehet */
    left: auto;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 36px);
    max-height: min(70vh, 560px);
    overflow-y: auto;

    background: var(--surface-solid);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: 0 25px 70px var(--shadow-color);
    padding: 6px;
}

.top-bar-results.open {
    display: block;
}

.gs-group-title {
    padding: 8px 10px 4px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.gs-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background .15s ease;
}

.gs-item:hover,
.gs-item.gs-active {
    background: var(--hover-bg-strong);
}

.gs-item-icon {
    flex: 0 0 auto;
    font-size: 15px;
    width: 20px;
    text-align: center;
}

.gs-item-body {
    flex: 1 1 auto;
    min-width: 0;
}

.gs-item-main {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-item-sub {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-item-right {
    flex: 0 0 auto;
    font-size: 11px;
    font-family: 'Space Mono', monospace;
    color: var(--text-muted);
}

.gs-empty {
    padding: 14px 10px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.gs-item-history {
    border: 1px dashed var(--border-glass);
    margin-top: 4px;
}

/* A globális kereső vonat-találatai ugyanazt a .station-item kártyát kapják,
   mint a vonat-/UIC-kereső listái; itt csak a .station-list-hez hasonló
   függőleges elrendezést kell megadni a lenyílón belül. */
.gs-train-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px 2px 4px;
}

/* --- CET óra --- */
/* Óra + kereső: a saját oszlopa bal széléhez húzva, hogy a középső csoport
   mellett álljon (ne a képernyő jobb szélén). */
.top-bar-right {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-clock {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.top-bar-clock-time {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.top-bar-clock-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* A felső sáv helyet kap: a bal oldali UI és a jobb oldali panel lejjebb kezdődik.
   A logó/LIVE/TikTok átkerült a sávba, ezért a régi bal felső fejléc rejtve. */
@media (min-width: 769px) {
    .ui-left > header.glass-panel {
        display: none;
    }
}

/* Keskenyebb asztali nézetben szűkítjük a három csoportot, hogy a
   szélsők ne lógjanak ki a képernyőből. A szómárka szabálya a .top-bar-os
   alapszabálynál nem kevésbé specifikus, különben nem érvényesülne. */
@media (min-width: 769px) and (max-width: 1000px) {
    .top-bar-search {
        width: 150px;
    }
    .top-bar-about {
        padding: 0 9px;
        font-size: 11px;
    }
    .top-bar .top-bar-wordmark {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }
}

/* Mobilon a felső sáv rejtve, de az óra a meglévő mobil fejlécben megjelenik. */
.mobile-top-clock {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.mobile-top-clock-label {
    font-size: 9px;
    letter-spacing: .5px;
    color: var(--text-muted);
}

.ui-layer {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    display: flex;
    padding: 80px 24px 24px;
    gap: 24px;
}

.ui-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: none;
}

/* A bal oldali panel keresői alapból rejtve; csak az alsó kereső gombbal
   kiválasztott egy darab kereső jelenik meg (.active). */
.ui-left .desktop-search {
    display: none;
}
.ui-left .desktop-search.active {
    display: block;
}

.ui-right {
    position: absolute;
    /* a felső sáv (56px) alatt kezdődik */
    top: 80px;
    right: 24px;
    bottom: 24px;
    pointer-events: none;
}

.ui-right .panel {
    height: 100%;
}

.glass-panel {
    pointer-events: auto;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 70px var(--shadow-color);
}

.update-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    max-width: 90vw;
    color: var(--text-main);
    font-size: 13px;
    white-space: nowrap;
    border: 1px solid transparent !important;
}

.update-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    pointer-events: none;
    background-image:
        linear-gradient(90deg, #22D3FF 50%, transparent 50%),
        linear-gradient(90deg, #22D3FF 50%, transparent 50%),
        linear-gradient(180deg, #22D3FF 50%, transparent 50%),
        linear-gradient(180deg, #22D3FF 50%, transparent 50%);
    background-size: 16px 2px, 16px 2px, 2px 16px, 2px 16px;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
    background-position:
        left 0px top 0px,
        left 0px bottom 0px,
        left 0px top 0px,
        right 0px top 0px;
    animation: bannerDash 0.8s linear infinite;
}

@keyframes bannerDash {
    to {
        background-position:
            left 16px top 0px,
            left -16px bottom 0px,
            left 0px top -16px,
            right 0px top 16px;
    }
}

.update-banner-date {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    color: #22D3FF;
    font-size: 12px;
}

.update-banner-sep {
    color: var(--text-main);
}

.update-banner-text {
    color: var(--text-main);
}

.update-banner-close {
    background: none;
    border: none;
    color: #22D3FF;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 2px 4px;
    margin-left: 4px;
}

.update-banner-close:hover {
    color: var(--red);
}

/* "Az oldalról" gomb - ugyanaz a pill-stílus, közvetlenül az Új frissítés alatt */
.about-banner {
    top: 66px;
    text-decoration: none;
    cursor: pointer;
    justify-content: center;
}
.about-banner:hover .update-banner-text b {
    color: #22D3FF;
}
@media (max-width: 768px) {
    /* #aboutBanner: magasabb specificitás, hogy a mobil .update-banner
       szabály (top:56px) ne írja felül - így az Új frissítés alá kerül. */
    #aboutBanner.about-banner {
        top: 100px;
        left: auto;
        right: 12px;
        transform: none;
        height: 36px;
        padding: 0 10px;
        max-width: calc(100vw - 24px);
    }
}

@media (max-width: 768px) {
    .update-banner {
        top: 56px;
        left: auto;
        right: 12px;
        transform: none;
        height: 36px;
        padding: 0 10px;
        gap: 6px;
        max-width: calc(100vw - 12px - var(--mobile-live-toggle-w, 128px) - 8px - 12px);
        white-space: nowrap;
        text-align: left;
        font-size: 12px;
        overflow: hidden;
    }
    .update-banner-trigger {
        min-width: 0;
        overflow: hidden;
    }
    .update-banner-date,
    .update-banner-text,
    .update-banner-sep {
        font-size: 11px;
    }
}

.search-accordion.glass-panel {
    max-width: 400px;
}

.top-delay-list-wrap {
    position: relative;
}
.top-delay-list-wrap.is-clipped::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 36px;
    background: linear-gradient(to bottom, transparent, var(--surface-solid));
    pointer-events: none;
}
.top-delay-list {
    max-height: 220px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.top-delay-list::-webkit-scrollbar {
    display: none;
}

/* Frissítés gomb - az eredeti sáv most kattintható gomb + bezárás gomb */
.update-banner-trigger {
    font: inherit;
    color: inherit;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Frissítés modal */
.update-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, .30);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.update-modal-overlay.is-open {
    display: flex;
}
.update-modal {
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 16px;
    padding: 22px;
    background: var(--surface-solid);
    color: var(--text-main);
    box-shadow: 0 20px 60px var(--shadow-color);
    animation: update-modal-pop 0.18s ease-out;
}
@keyframes update-modal-pop {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.update-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.update-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.update-modal-icon {
    font-size: 22px;
    line-height: 1;
}
.update-modal-title h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
}
.update-modal-date {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
}
.update-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.update-modal-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.update-modal-list li {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.update-modal-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}
.update-modal-item-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
}

/* "❤️ 1haza" aláírás a lista végén */
.update-modal-signature {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.update-modal-signature-heart {
    font-size: 14px;
    animation: update-modal-heartbeat 1.4s ease-in-out infinite;
}
@keyframes update-modal-heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.25); }
    40% { transform: scale(1); }
}
.update-modal-signature-text {
    font-size: 12.5px;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}
.update-modal-signature-name {
    font-weight: 700;
    opacity: 1;
    background: linear-gradient(90deg, #ff6b9d, #ffb86b, #ff6b9d);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: update-modal-shine 3s linear infinite;
}
@keyframes update-modal-shine {
    to { background-position: -200% center; }
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    align-self: flex-start;
    width: 100%;
    max-width: 400px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
}

.brand-wrap{
    display:flex;
    align-items:center;
    gap:12px;
}

.brand-image{
    width:50px;
    aspect-ratio:1 / 1;
    border-radius:50%;
    object-fit:contain;
    flex-shrink:0;
}

.logo {
    font-family: 'Space Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    color: #FACC15;
    -webkit-text-fill-color: #FACC15;
}

.header-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--green);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 6px 12px;
    border-radius: 30px;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hover-bg-strong);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.theme-toggle-btn:hover {
    background: var(--text-main);
    color: var(--bg-app);
    transform: scale(1.05);
}

.theme-toggle-icon {
    font-size: 15px;
    line-height: 1;
    transition: transform 0.35s ease;
}

.theme-toggle-btn:active .theme-toggle-icon {
    transform: rotate(20deg) scale(0.9);
}

.theme-toggle-btn-mobile {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.tiktok-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hover-bg-strong);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
    text-decoration: none;
}

.tiktok-btn-mobile {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.tiktok-btn:hover {
    background: var(--text-main);
    color: var(--bg-app);
    transform: scale(1.05);
}

/* Az Instagram gomb a TikTok gomb stílusát örökli (azonos méret/kör), csak a
   hover kap Instagram-színátmenetet. */
.instagram-btn:hover {
    background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888);
    color: #fff;
    border-color: transparent;
    transform: scale(1.05);
}

/* ── Számítógépes "immerzív" térkép-mód ─────────────────────────────────────
   A .mk-ui-hidden állapotban a UI-elemek NEM tűnnek el, hanem ANIMÁLVA
   kicsúsznak a képből (mint a menetrend-panel): a bal oldali keresők/kártyák
   balra, a jobb oldali panel jobbra, az alsó eszköztár és a Leaflet-vezérlők
   le. A felső sáv (#topBar) és a térkép marad. */
.ui-left, .ui-right, .bottom-toolbar,
.leaflet-control-container .leaflet-bottom {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
body.mk-ui-hidden .ui-left { transform: translateX(-115%); }
body.mk-ui-hidden .ui-right { transform: translateX(115%); }
/* Az eszköztár transzformmal van középre igazítva (translateX(-50%)) – ezt
   megtartjuk, és csak lefelé csúsztatjuk. */
body.mk-ui-hidden .bottom-toolbar { transform: translateX(-50%) translateY(220%); }
body.mk-ui-hidden .leaflet-control-container .leaflet-bottom { transform: translateY(220%); }

/* A jobb felső sarok súgója (csak asztali nézet), EGY SORBAN. Alapból rejtett;
   csak VÁLTÁS UTÁN villan fel (a .visible osztállyal), és 5 mp múlva eltűnik. */
.map-ui-hint {
    position: fixed;
    top: 66px;
    right: 16px;
    z-index: 550;
    white-space: nowrap;
    padding: 7px 12px;
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.78);
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.map-ui-hint.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobilon nincs ez a mód. */
@media (max-width: 768px) {
    .map-ui-hint { display: none !important; }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

.station-search {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px;
    align-self: flex-start;
    width: 100%;
    max-width: 400px;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-header h4 {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 600;
}

.search-input {
    width: 100%;
    height: 44px;
    line-height: 20px;
    vertical-align: middle;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent);
    background: var(--input-bg-focus);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Keresőmező a jobb oldali "→" gombbal: a beírt állomásnévre keres. */
.search-input-row {
    position: relative;
    width: 100%;
}

.search-input-row .search-input {
    padding-right: 46px;
}

.search-go-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);

    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--hover-bg-strong);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-go-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.search-go-btn:active {
    transform: translateY(-50%) scale(0.92);
}

.btn-secondary {
    background: var(--hover-bg-strong);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: var(--text-main);
    color: var(--bg-app);
}

.station-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 420px);
    overflow-y: auto;
    padding-right: 4px;
}

.filter-form {
    max-width: none;
}

.filter-form > .filter-main-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.filter-form > .filter-main-view > .search-input,
.filter-form > .filter-main-view > .filter-choice-btn {
    width: 100%;
}

.filter-form > .filter-main-view > .btn-secondary {
    width: auto;
    min-width: 180px;
}

select.filter-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    cursor: pointer;
}

select.filter-select option {
    background: var(--bg-app);
    color: var(--text-main);
}

.filter-choice-btn {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.filter-choice-btn:hover {
    border-color: var(--accent);
    background: var(--input-bg-focus);
}

.filter-choice-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-choice-label-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    min-width: 0;
}

.filter-choice-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #FACC15;
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.filter-choice-chevron {
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
}

.filter-choice-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-choice-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 4px;
    transition: opacity 0.2s ease;
}

.filter-choice-back:hover {
    opacity: 0.7;
}

.filter-choice-back-arrow {
    font-size: 16px;
    line-height: 1;
}

.filter-choice-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-choice-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100vh - 420px);
    overflow-y: auto;
    padding-right: 4px;
}

.filter-choice-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--card-bg-soft);
    border: 1px solid var(--border-glass);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.filter-choice-row:hover {
    border-color: var(--accent);
}

.filter-choice-row.is-all {
    font-weight: 600;
}

.filter-choice-row:has(input[type="checkbox"]:checked) {
    background: var(--accent);
    border-color: var(--accent);
    color: #0f172a;
}

.filter-choice-row input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 2px solid var(--border-glass);
    background: var(--input-bg);
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.filter-choice-row input[type="checkbox"]:checked {
    background: var(--accent);
}

.filter-choice-row input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #0f172a;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #FACC15;
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    margin-left: 4px;
}

.station-item {
    padding: 12px 14px;
    background: var(--card-bg-soft);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.station-item:hover {
    background: var(--hover-bg-strong);
    border-color: var(--accent);
    transform: translateX(4px);
}

/* Kézi keresés: ha a lista üres vagy be sem töltött, a beírt teljes névvel
   közvetlenül lekérdezhető az állomási menetrend. */
.station-manual-btn {
    border-color: var(--accent);
    background: var(--hover-bg-soft, rgba(56,189,248,.08));
}

.station-manual-hint {
    cursor: default;
    background: transparent;
    border-style: dashed;
}

.station-manual-hint:hover {
    background: transparent;
    border-color: var(--border-glass);
    transform: none;
}

.panel {
    width: var(--panel-w);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* FR24-stílusú mini-összefoglaló: csak mobilon, peek állapotban látszik
   (lásd a mobil media blokkot lentebb). */
.train-mini-summary {
    display: none;
}

/* Mobil alsó gombsor a vonatpanelekhez: asztali nézetben sosem látszik,
   mobilon a .has-actions osztály kapcsolja be (lásd a mobil media blokkot
   lentebb). */
.train-action-bar {
    display: none;
}

/* FR24-stílusú mini-összefoglaló lap: a teljes menetrend paneltől külön
   doboz, csak mobilon létezik (lásd a mobil media blokkot lentebb). */
.train-mini-sheet {
    display: none;
}

/* Az állomás összefoglaló alsó lap csak mobilon látszik (lásd a media
   query-t); számítógépen a térképi buborék marad. */
.station-mini-sheet {
    display: none;
}

/* Fejléc-sor a vonatnév alatt: balra a viszonylat / UIC / utolsó
   frissítés oszlopa, jobbra az FR24-stílusú vonatfotó. Az adatoszlopot FÖLÜLRE
   igazítjuk (nem középre): különben rövid adat (pl. nem közlekedő vonatnál csak
   viszonylat + UIC) a magas fotóhoz képest középre kerül, és nagy rés támad a
   vonatnév (N/A) és a viszonylat között. */
.detail-header-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 10px;
}

.detail-header-info {
    flex: 1;
    min-width: 0;
}

.train-photo-wrap {
    width: 50%;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(148, 163, 184, .08);
}

/* A fejlécből a görgethető részbe költöztetett adatok (viszonylat, UIC,
   sebesség, utolsó frissítés, állapot, figyelmeztetések) konténere. */
.detail-meta {
    padding: 12px 16px 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.train-photo {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
}

/* Járműfotó-lapozó: több kép esetén nyilak (hover-re, érintőn mindig),
   a kép alján kis sáv a fotós nevével. */
.loco-carousel {
    position: relative;
}

.loco-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease, background .15s ease;
    z-index: 2;
}

.loco-nav:hover {
    background: rgba(0, 0, 0, .7);
}

.loco-nav-prev { left: 4px; }
.loco-nav-next { right: 4px; }

.loco-carousel:hover .loco-nav { opacity: 1; }

/* Érintőkijelzőn nincs hover: a nyilak halványan mindig látszanak. */
@media (hover: none) {
    .loco-nav { opacity: .7; }
}

.loco-owner {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 6px 3px;
    font-size: 10px;
    font-weight: 600;
    color: #e2e8f0;
    background: linear-gradient(transparent, rgba(0, 0, 0, .7));
    text-align: left;
    pointer-events: none;
    z-index: 1;
}

.panel.open {
    transform: translateX(0);
}

.panel-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    gap: 16px;
    color: #64748b;
}

.panel-empty .icon {
    font-size: 56px;
    filter: grayscale(1) opacity(0.3);
}

.panel-empty h3 {
    font-size: 18px;
    color: var(--text-main);
    font-weight: 600;
}

.panel-empty p {
    font-size: 14px;
    line-height: 1.6;
}

.train-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.detail-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-glass);
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
}

.detail-train-num {
    font-family: 'DM Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.detail-train-id {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

.detail-sections {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.station-table-wrapper {
    padding: 0 12px;
    overflow: visible;
    flex: unset;
    min-height: auto;
}

.timetable-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.timetable-table th {
    padding: 10px 10px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    background: var(--surface-solid);
    z-index: 10;
}

.timetable-table td {
    padding: 12px 10px;
    color: var(--text-main);
    vertical-align: middle;
    position: relative;
}

.timetable-table td i {
    color: #fef08a;
    font-style: italic;
}

.timeline-cell {
    width: 32px;
    padding: 0 !important;
    text-align: center;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #1e293b;
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-line.active {
    background: #3b82f6;
}

.timeline-line.split-top {
    bottom: 50%;
    background: #3b82f6;
}

.timeline-line.split-bottom {
    top: 50%;
    background: #1e293b;
}

.timetable-table tr:first-child .timeline-line {
    top: 50%;
}

.timetable-table tr:last-child .timeline-line {
    bottom: 50%;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0b0e14;
    border: 2px solid #334155;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-dot.passed {
    background: #3b82f6;
    border-color: #3b82f6;
}

.timeline-dot.current {
    background: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 0 12px #22c55e;
    width: 12px;
    height: 12px;
}

.station-name-text {
    font-size: 13.5px;
    font-weight: 500;
    color: #cbd5e1;
}

.station-name-text.passed {
    color: #64748b;
}

.station-name-text.current {
    color: #22c55e;
    font-weight: 600;
}

.station-name-text.terminal {
    color: var(--accent);
}

html[data-theme="light"] .station-name-text {
    color: #0f172a;
}

/* A menetrendben az állomásnév kattintható: megnyitja az állomási menetrendet. */
.station-schedule-link {
    cursor: pointer;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: rgba(148, 163, 184, 0.5);
    text-underline-offset: 3px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.station-schedule-link:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

html[data-theme="light"] .station-name-text.passed {
    color: #94a3b8;
}

html[data-theme="light"] .station-name-text.current {
    color: var(--green);
}

html[data-theme="light"] .station-name-text.terminal {
    color: var(--accent);
}

.time-stack {
    display: flex;
    flex-direction: column;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    line-height: 1.2;
}

.time-sched-muted {
    font-size: 11px;
    color: #475569;
    margin-bottom: 2px;
}

.time-actual-item {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.time-actual-item.ontime {
    color: #22c55e;
}

.time-actual-item.late {
    color: #ef4444;
}

.time-actual-item.early {
    color: #3b82f6;
}

.time-actual-item.future {
    color: #475569;
}

.delay-small-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 6px;
    display: inline-block;
}

.time-actual-item.late .delay-small-badge {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.time-actual-item.early .delay-small-badge {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

html[data-theme="light"] .time-actual-item.late .delay-small-badge {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

html[data-theme="light"] .time-actual-item.early .delay-small-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

.timetable-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-glass);
    font-size: 11px;
    color: var(--text-muted);
    background: var(--card-bg-soft);
}

.leg-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.leg-sq {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.leg-sq.early { background: #3b82f6; }
.leg-sq.ontime { background: #10B981; }
.leg-sq.late { background: #EF4444; }
.leg-sq.est-ontime { background: #34D399; }
.leg-sq.est-late { background: #F97316; }

.station-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.station-table th {
    padding: 12px 10px;
    color: #64748b;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-glass);
}

.station-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-glass);
    vertical-align: middle;
}

.table-vszam {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
}

.table-viszonylat {
    font-weight: 500;
    color: var(--text-main);
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.table-time-block {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    line-height: 1.3;
}

.info-cell {
    background: var(--card-bg-soft);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 0 12px;
}

.vtk-card{
    flex-shrink:0;
    min-height:72px;
}

.vtk-main{
    min-height:40px;
}

.delay-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.delay-badge.sleeping{
  background: rgba(148,163,184,.15);
  color: var(--text-muted);
  border: 1px solid rgba(148,163,184,.25);
}

.delay-ok {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.delay-late {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.delay-early {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hover-bg-strong);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.close-btn:hover {
    background: var(--text-main);
    color: var(--bg-app);
    transform: scale(1.05);
}

.detail-header-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.detail-header-actions .close-btn,
.detail-header-actions .copy-link-btn {
    position: static;
    top: auto;
    right: auto;
}

/* Panel bezáró gomb a húzható panel szintjén - csak mobilon látszik (lásd a
   @media (max-width:768px) blokkot); asztali nézetben rejtve. */
.panel-mobile-close {
    display: none;
}

.emig-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.emig-modal {
    width: min(420px, 100%);
    background: rgba(10, 14, 22, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    padding: 24px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    align-items: center;
    text-align: center;
}

.emig-modal label,
.emig-modal input,
.emig-modal .emig-modal-buttons {
    width: 100%;
    max-width: 380px;
}

.emig-modal .emig-modal-buttons {
    justify-content: center;
    display: flex;
}

.emig-modal h3,
.emig-modal p,
.emig-modal h4 {
    text-align: center;
}

.emig-modal h3 {
    margin: 0;
    font-size: 20px;
}

.emig-modal p {
    margin: 0;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
}

.emig-modal label {
    font-size: 13px;
    color: #cbd5e1;
}

.emig-modal input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.emig-modal input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.12);
}

.emig-modal-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.emig-modal-buttons button {
    flex: 1;
    min-width: 120px;
}

.error-message {
    min-height: 20px;
    font-size: 13px;
    color: #f87171;
}

.marker-holder {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.marker-holder:hover {
    transform: scale(1.2);
    z-index: 1000 !important;
}

.train-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.9);
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    z-index: 2;
    /* A kijelölt (megnyitott) vonat nagyítása CSS-változóval, hogy "Vonat" ikon
       módban az elforgatással (rotate) együtt tudjon érvényesülni. */
    transform: scale(var(--mk-scale, 1));
}

.leaflet-tooltip {
    background: #12141c !important;
    color: #F8FAFC !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.leaflet-tooltip-top:before {
    border-top-color: #12141c !important;
}

html[data-theme="light"] .leaflet-tooltip {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(15, 23, 42, 0.15) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

html[data-theme="light"] .leaflet-tooltip-top:before {
    border-top-color: #ffffff !important;
}

/* Vonat megállóinak felirata a térképen (kisebb, mint az alap tooltip).
   A háttérszín a menetrend panel szövegszíneit követi: szürke = már érintett,
   zöld = következő megálló, alap = még hátralévő. */
.leaflet-tooltip.train-stop-label {
    padding: 2px 8px !important;
    font-size: 11px !important;
    font-weight: 600;
    border-radius: 6px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.leaflet-tooltip.train-stop-label.passed {
    background: #64748b !important;
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.leaflet-tooltip.train-stop-label.passed.leaflet-tooltip-top:before {
    border-top-color: #64748b !important;
}

.leaflet-tooltip.train-stop-label.current {
    background: #22c55e !important;
    color: #052e12 !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    font-weight: 700;
}

.leaflet-tooltip.train-stop-label.current.leaflet-tooltip-top:before {
    border-top-color: #22c55e !important;
}

/* Vasútállomás – hover buborék (csak név, típus, felhívás).
   Ugyanolyan (átlátszó, sötét) háttér, mint a vonat-tooltipé. */
.leaflet-tooltip.station-point-label {
    padding: 6px 10px !important;
    border-radius: 8px !important;
    background: rgba(18, 20, 28, 0.82) !important;
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-align: center;
    line-height: 1.3;
}

.leaflet-tooltip.station-point-label.leaflet-tooltip-top:before {
    border-top-color: rgba(18, 20, 28, 0.82) !important;
}

html[data-theme="light"] .leaflet-tooltip.station-point-label {
    background: rgba(255, 255, 255, 0.85) !important;
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.15) !important;
}

html[data-theme="light"] .leaflet-tooltip.station-point-label.leaflet-tooltip-top:before {
    border-top-color: rgba(255, 255, 255, 0.85) !important;
}

/* Ha nyitva van a részletes állomás-buborék (kattintás), ne látszódjon
   emellett a kisebb hover-tooltip is. */
body.station-popup-open .leaflet-tooltip.station-point-label {
    display: none !important;
}

/* Vasútállomás-/megállóhely-jelölők (kép-pinek).
   A transform-ot a Leaflet használja a pozicionáláshoz, ezért a hover-effekt
   csak filteren keresztül megy (különben a marker a sarokba ugorna). */
.station-pin {
    filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.35));
    transition: filter 0.12s ease;
    cursor: pointer;
}
.station-pin:hover {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)) brightness(1.1);
}
/* A megállóhelyek csak 12-es zoomtól látszanak (10–11 közt a réteg fent van,
   de a megállóhely-pineket elrejtjük). */
.leaflet-container.mk-hide-halts .station-pin-halt {
    display: none !important;
}

.station-tip-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #f8fafc;
}

.station-tip-type {
    font-size: 10.5px;
    font-weight: 700;
    margin-top: 2px;
    letter-spacing: 0.02em;
}

.station-tip-type.is-station { color: #60a5fa; }
.station-tip-type.is-halt { color: #fbbf24; }

.station-tip-hint {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 3px;
    font-style: italic;
}

/* Vasútállomás – kattintós buborék (Leaflet popup).
   Ugyanolyan (átlátszó, sötét) háttér, mint a vonat-tooltipé. */
.station-pop .leaflet-popup-content-wrapper {
    background: rgba(18, 20, 28, 0.82);
    color: var(--text-main, #f1f5f9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.station-pop .leaflet-popup-content {
    margin: 12px 14px;
    /* Fix szélesség: különben a Leaflet a tartalomra zsugorítja, és a
       sorok "1fr" oszlopa (célállomás) 0px-re esik össze. */
    width: 250px !important;
    line-height: 1.35;
}

.station-pop .leaflet-popup-tip {
    background: rgba(18, 20, 28, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.station-pop-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-glass, rgba(255, 255, 255, 0.1));
}

.station-pop-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent, #60a5fa);
}

.station-pop-type {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
}

.station-pop-type.is-station {
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.25);
    border: 1px solid rgba(37, 99, 235, 0.5);
}

.station-pop-type.is-halt {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.22);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.station-pop-loading,
.station-pop-empty {
    font-size: 12px;
    color: #94a3b8;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.station-pop-loading .live-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
}

.station-pop-deps-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Egy induló vonat sora – a teljes állomási menetrend stílusában, kompaktan:
   idő+késés | ikon+szám+cél | vágány, késés szerinti bal szegéllyel. */
.station-pop-dep {
    --delay-color: #475569;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 9px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--delay-color);
    border-radius: 9px;
    color: #f1f5f9;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.station-pop-dep:hover {
    background: #27364d;
    border-color: var(--accent, #2563eb);
    border-left-color: var(--delay-color);
    transform: translateY(-1px);
}

.station-pop-dep:active {
    transform: scale(0.985);
}

.station-pop-dep-time {
    font-size: 12.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 42px;
}

/* A közös menetrendi idő-stack itt kicsit kompaktabb */
.station-pop-dep-time .time-stack { line-height: 1.15; }
.station-pop-dep-time .time-sched-muted { font-size: 10px; }
.station-pop-dep-time .time-actual-item { font-size: 12.5px; }
.station-pop-dep-time .delay-small-badge { font-size: 9.5px; }

.station-pop-dep-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.station-pop-dep-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.station-pop-dep-textcol {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.station-pop-dep-num {
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-pop-dep-dest {
    font-size: 11.5px;
    font-weight: 600;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-pop-dep-platform {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
}

.station-pop-dep-vagany {
    font-size: 13px;
    font-weight: 800;
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 1px 7px;
    font-variant-numeric: tabular-nums;
}

.station-pop-dep-vagany-empty {
    font-size: 13px;
    color: #64748b;
}

.station-pop-full-btn {
    margin-top: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 8px;
    background: var(--accent, #FACC15);
    /* Az akcentszín sárga (#FACC15), ezért sötét, vastag felirat kell a
       jó olvashatósághoz (a korábbi fehér szöveg alig látszott). */
    color: #1a1200;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.station-pop-full-btn:hover {
    filter: brightness(1.06);
}

/* Világos témában a buborék olvashatóbb sötét szövege */
:root[data-theme="light"] .station-pop .leaflet-popup-content-wrapper,
:root[data-theme="light"] .station-pop .leaflet-popup-tip {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .station-pop-dep {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}
:root[data-theme="light"] .station-pop-dep:hover {
    background: #eef2ff;
}
:root[data-theme="light"] .station-pop-dep-dest { color: #475569; }
:root[data-theme="light"] .station-pop-dep-vagany {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.08);
}

.leaflet-control-zoom {
    display: flex !important;
    flex-direction: row !important;
    border: none !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    margin-left: 24px !important;
    margin-bottom: 90px !important;
}

.leaflet-control-zoom a {
    background: var(--surface-glass) !important;
    color: var(--text-main) !important;
    border-color: var(--border-glass) !important;
}

.leaflet-control-zoom a:first-child {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.leaflet-control-zoom a:last-child {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-left: none !important;
    border-bottom: 1px solid var(--border-glass) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--surface-glass) !important;
    filter: brightness(1.2);
}

/* A helyzet gomb egyetlen <a>-ja egyszerre :first-child és :last-child, ezért
   a fenti magasabb specifikusságú zoom-szabályok (:first-child/:last-child)
   levágnák a bal oldali lekerekítést. A :first-child:last-child szelektor
   nagyobb specifikussággal biztosítja, hogy mind a négy sarok lekerekített. */
.leaflet-location-btn a:first-child:last-child {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-left: 1px solid var(--border-glass) !important;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--hover-bg-strong);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hover-bg);
    filter: brightness(1.4);
}

.search-accordion {
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 16px 20px;
    cursor: default;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.accordion-header:hover {
    background: var(--hover-bg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}

.search-accordion.open .accordion-content,
.search-accordion.active .accordion-content {
    max-height: calc(100vh - 340px);
}

/* Asztali nézet: a bal oldali (ui-left) TARTALMAS panelek - Beállítások, keresők,
   Szűrő - MIND az aljáig érjenek, hogy alul csak akkora rés maradjon, mint a
   márka-doboz FÖLÖTT (a .ui-layer 24px paddingja). A panel MINDIG csak akkora,
   amekkora a tartalma - üres/kevés tartalomnál rövid marad, sok tartalomnál
   viszont legfeljebb az aljáig nő (alul ~24px rés) és onnan görgethető. Ezért
   FELSŐ korlát (max-height), nem fix magasság. A tartalom teteje a
   nézetmagasságtól független (≈197px), így a 100vh - 221px alul ~24px rést hagy. */
.ui-left .desktop-search.active .accordion-content,
.ui-left .desktop-search.open .accordion-content {
    /* A régi bal felső márka-fejléc helyére a felső sáv került: a kereső
       feljebb kezdődik (80px padding + ~48px accordion-fejléc), így több hely jut. */
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

/* A találatlistás keresők (Vonatkereső, Állomáskereső, UIC - .station-list) a
   listát FLEX-szel töltik ki a keresőmező alatti helyen, így a görgetés a listán
   belül van (nem az egész panelen), és a keresőmező magasságától függetlenül az
   aljáig ér. A Szűrőben nincs .station-list, ott maga a panel görgethető. */
.ui-left .desktop-search.active .accordion-content:has(.station-list),
.ui-left .desktop-search.open .accordion-content:has(.station-list) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ui-left .desktop-search.active .accordion-content:has(.station-list) .station-search,
.ui-left .desktop-search.open .accordion-content:has(.station-list) .station-search {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.ui-left .desktop-search.active .accordion-content:has(.station-list) .station-list,
.ui-left .desktop-search.open .accordion-content:has(.station-list) .station-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

/* A Szűrő választó-nézete (pl. Mozdony lista) ugyanígy a panel aljáig érjen: a
   .filter-choice-list FLEX-szel tölti ki a helyet a "Vissza" + cím alatt, és
   BELÜL görgethető (a 100vh - 420px korlát helyett). A rövid fő nézet (mezők)
   továbbra is a tartalomhoz igazodik. */
.ui-left .desktop-search[data-section="filter"].active .accordion-content,
.ui-left .desktop-search[data-section="filter"].open .accordion-content {
    display: flex;
    flex-direction: column;
}
.ui-left .desktop-search[data-section="filter"].active .accordion-content > .filter-form,
.ui-left .desktop-search[data-section="filter"].open .accordion-content > .filter-form {
    flex: 1 1 auto;
    min-height: 0;
}
.ui-left .desktop-search[data-section="filter"].active .filter-choice-view,
.ui-left .desktop-search[data-section="filter"].open .filter-choice-view {
    flex: 1 1 auto;
    min-height: 0;
}
.ui-left .desktop-search[data-section="filter"].active .filter-choice-list,
.ui-left .desktop-search[data-section="filter"].open .filter-choice-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.accordion-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    transition: all .2s ease;
    font-size: 13px;
    line-height: 1;
}

.accordion-close:hover {
    background: var(--red);
    color: #fff;
}

#compositionModal,
#timetableModal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.composition-box {
    width: 700px;
    max-width: 90vw;
    height: auto;
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.composition-header {
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-glass);
}

.composition-header-sub {
    padding: 20px;
    font-size: 14px;
    font-weight: 400;
    border-bottom: 1px solid var(--border-glass);
}

.composition-search {
    padding: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

#compositionResults,
#timetableResults {
    flex: 1 1 auto;
    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;

    padding: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 15px var(--accent-glow);
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

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

.loading-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-size: 14px;
}

.modal-empty-message {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    max-height: 50%;
    width: 100%;
    gap: 10px;
}

.composition-search input {
    flex: 1;
    min-width: 160px;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-main);
}

/* Világos témában a Keresés gomb valóban sárga legyen */
html[data-theme="light"] .btn-primary {
    background: #FACC15;
    color: #000;
}
html[data-theme="light"] .btn-primary:hover {
    background: #EAB308;
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.5);
}

/* --- A menetrend panelbe ágyazott összeállítás (figyelmeztetés alatt,
   menetrend fölött). Nyitott állapotban a gomb helyét a kocsilista veszi át,
   saját fejléccel és bezáró gombbal. --- */
.train-comp {
    margin: 8px 0 0;
}

/* A fejléc egyben a nyitó/záró kapcsoló: csak az összeállítást csukja be,
   a menetrend panelt nem. Csukva ▾, nyitva ✕ jelöli az állapotot. */
.train-comp-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    background: var(--hover-bg-strong);
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: all .2s ease;
}

.train-comp-toggle:hover {
    border-color: var(--accent);
    background: var(--hover-bg-soft, rgba(56, 189, 248, .08));
}

/* Nyitva a fejléc a lista tetejéhez tapad. */
.train-comp.open .train-comp-toggle {
    border-radius: 8px 8px 0 0;
    border-bottom-color: transparent;
}

.train-comp-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.train-comp-mark {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--text-muted);
}

.train-comp-panel {
    display: none;
    border: 1px solid var(--border-glass);
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: var(--card-bg-soft);
    overflow: hidden;
}

.train-comp.open .train-comp-panel {
    display: block;
}

.train-comp-body {
    padding: 10px;
    max-height: 320px;
    overflow-y: auto;
}

.train-comp-body .vtk-card:last-child {
    margin-bottom: 0;
}

.train-comp-loading,
.train-comp-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 10px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* A pörgő ikon és a szöveg egymás alatt. */
.train-comp-loading {
    flex-direction: column;
}

.vtk-card {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.vtk-body {
    padding: 16px 12px;
    min-width: 0;
}

.vtk-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* A UIC fix formátumú kód: soha ne törjön két sorba, és ne is zsugorodjon.
   Enélkül a flexbox a típusnévvel együtt ezt is szűkíti, amitől a kód
   kettétörik, a típusnév dobozában pedig ott marad a kihasználatlan hely. */
.vtk-uic {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: right;
}

/* UIC-szám megjelenítése (lásd uicHtml az app.js-ben). Az alapszín téma-függő:
   sötét témában fehér, világosban fekete. A mozdonyszám ("630 056") a vonatnem
   színével és nagyobb betűvel emelkedik ki. */
.uic-num {
    color: #fff;
}
html[data-theme="light"] .uic-num {
    color: #000;
}
.uic-hl {
    font-weight: 700;
    font-size: 1.2em;
}

/* A sorban egyedül a típusnév tördelhető - ez a változó hosszúságú, olvasható
   szöveg, tehát a szűkítést is ennek kell viselnie. Ha tördelődik, a sorai az
   elválasztóhoz simulnak: a doboza ilyenkor szélesebb a leghosszabb soránál, és
   balra igazítva a maradék pont az elválasztó előtt tátongana. */
.vtk-type {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--green);
    flex: 0 1 auto;
    min-width: 0;
    text-align: right;
}

.vtk-wall {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--blue);
    flex: 0 0 auto;
}

/* A vasúthálózat már vektorréteg (hungary_railways.geojson), a színét és a
   fényerejét az app.js állítja (applyRailwayFilter) – nem kell CSS-szűrő. */

.icon-tooltip {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.icon-tooltip img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
    transition: transform 0.2s ease;
    cursor: pointer;
    position: relative;
    z-index: 2;
    border-radius: 5px;
    border: rgb(100, 116, 139) solid 2px;
}

/* hover zoom */
.icon-tooltip:hover img {
    transform: scale(1.15);
}

/* tooltip base state */
.icon-tooltip .tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    /* --tip-shift: px-eltolás, hogy a buborék ne lógjon ki a panelből
       (a JS állítja hoverkor, alapból 0) */
    transform: translateX(calc(-50% + var(--tip-shift, 0px))) translateY(0);

    background: rgba(235,235,235,0.96);
    color: #1a1a1a;
    padding: 9px 14px;
    border-radius: 12px;

    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    font-family: Arial, sans-serif;
    letter-spacing: 0.2px;

    box-shadow:
        0 6px 18px rgba(0,0,0,0.22),
        0 1px 2px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.15);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 999;
}

/* hover reveal */
.icon-tooltip:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(calc(-50% + var(--tip-shift, 0px))) translateY(-8px);
}

.station-train-btn{
    --delay-color:#ef4444;
    border-left:3px solid var(--delay-color);

    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;

    padding:14px 16px;

    margin-bottom:10px;

    background:rgba(239,68,68,.04); /* halvány piros háttér */
    border-top:1px solid rgba(255,255,255,.08);
    border-right:1px solid rgba(255,255,255,.08);
    border-bottom:1px solid rgba(255,255,255,.08);

    border-radius:12px;

    color:#f1f5f9;
    text-align:left;
    cursor:pointer;

    transition:.2s;
}

.station-train-btn:hover{
    background:#27364d;
    border-color:var(--accent);
    transform:translateY(-1px);
}

.station-train-btn:active{
    transform:scale(.98);
}

/* BAL OLDAL */
.station-train-btn{
    --delay-color:#ef4444;
    border-left:3px solid var(--delay-color);

    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;

    padding:14px 16px;

    margin-bottom:10px;

    background: var(--surface-glass);
    border-top:1px solid rgba(255,255,255,.08);
    border-right:1px solid rgba(255,255,255,.08);
    border-bottom:1px solid rgba(255,255,255,.08);

    border-radius:12px;

    color:#f1f5f9;
    text-align:left;
    cursor:pointer;

    transition:.2s;
}

.station-train-btn:hover{
    background:#27364d;
    border-color:var(--accent);
    transform:translateY(-1px);
}

.station-train-btn:active{
    transform:scale(.98);
}

/* BAL OLDAL */
.station-train-left{
    display:flex;
    align-items:center;
    gap:12px;

    flex:0 0 140px;   /* fix szélesség, ne nyúljon/zsugorodjon */
    width:140px;
    min-width:0;
}

.station-train-left img{
    width:28px;
    height:28px;
    flex-shrink:0;
}

.station-train-left > div{
    display:flex;
    flex-direction:column;
    line-height:1.25;
    min-width:0;
    overflow:hidden;
}

/* Vonatszám */
.station-train-number{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-weight:600;
}

/* Vonat típusa (pl. BAGOLYVONAT / Személyvonat) */
.station-train-type{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    color:#94a3b8;
    font-size:13px;
}

/* A vonat mellett a mozdony pályaszáma (pl. "418 305"), ha épp közlekedik. */
.station-train-loco{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-family:'Space Mono', monospace;
    font-size:12px;
    font-weight:700;
    margin-top:2px;
}

.station-train-route{
    flex:1;
    min-width:0;

    padding-left:12px;
    border-left:1px solid rgba(255,255,255,.06);

    font-size:14px;
    color:#e2e8f0;

    /* Ha nem fér ki egy sorban, tördeljük több sorba (ne vágjuk le
       ellipszissel). A hosszú állomásnév is törhet, hogy szűk oszlopban
       (mobil) se lógjon ki. A fejlécben ezt felülírjuk – ott marad az
       egysoros, ellipszises "Viszonylat/Hová/Honnan" címke. */
    white-space:normal;
    overflow:visible;
    overflow-wrap:break-word;
    word-break:normal;
    line-height:1.3;
}

/* "Állomáson" fül: ott a teljes viszonylat látszik, ezért ha nem fér ki
   egy sorban, tördeljük, ne vágjuk le. */
.station-train-route--wrap{
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    /* break-word (nem "anywhere"): a leghosszabb szó marad a minimum
       szélesség, így az oszlop nem tud pár pixelre összenyomódni. */
    overflow-wrap:break-word;
    word-break:normal;
    min-width:90px;
    line-height:1.3;
}

/* IDŐ - a sor első oszlopa */
.station-train-times{
    flex:0 0 74px;
    width:74px;

    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:2px;

    font-variant-numeric:tabular-nums;
    white-space:nowrap;
}

.station-train-times div{
    font-size:13px;
    line-height:1.2;
}

/* VÁGÁNY - a sor utolsó oszlopa */
.station-train-platform{
    flex:0 0 auto;
    min-width:44px;

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:1px;

    padding-left:12px;
    border-left:1px solid rgba(255,255,255,.06);
}

/* A vágány ugyanolyan "chip" stílusú, mint az állomás-összefoglaló
   buborékban (.station-pop-dep-vagany): halvány háttér, lekerekített. */
.station-train-platform-num{
    font-size:13px;
    font-weight:800;
    color:#f8fafc;
    background:rgba(255,255,255,.1);
    border-radius:6px;
    padding:1px 7px;
    font-variant-numeric:tabular-nums;
    line-height:1.3;
}

html[data-theme="light"] .station-train-platform-num{
    color:#0f172a;
    background:rgba(0,0,0,.08);
}

.station-train-platform-label{
    font-size:9px;
    letter-spacing:.5px;
    text-transform:uppercase;
    color:#64748b;
}

.station-train-platform-empty{
    color:#475569;
    font-size:14px;
}

/* A gomb most függőleges: felül a négy oszlop, alatta a figyelmeztetés. */
.station-train-btn{
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    gap:0;
}

.station-train-main{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    width:100%;
    min-width:0;
}

.station-train-left{
    flex:0 0 132px;
    width:132px;
    padding-left:12px;
    border-left:1px solid rgba(255,255,255,.06);
}

/* FIGYELMEZTETÉS - a vonat kiírása alatt, teljes szélességben */
.station-train-warnings{
    width:100%;
    margin-top:8px;
    padding-top:8px;
    border-top:1px dashed rgba(239,68,68,.35);
    display:flex;
    flex-direction:column;
    gap:4px;
}

.station-train-warning{
    display:flex;
    align-items:flex-start;
    gap:6px;

    font-size:12px;
    line-height:1.35;
    text-align:left;
    color:#fca5a5;
    overflow-wrap:break-word;
    white-space:normal;
}

.station-train-warning-icon{
    flex:0 0 auto;
    line-height:1.35;
}

html[data-theme="light"] .station-train-warning{
    color:#b91c1c;
}

/* RAGADÓS OSZLOPFEJLÉC - a fülsáv (top:0) alatt áll meg görgetéskor */
.station-train-head{
    position:sticky;
    top:var(--station-tabs-h, 40px);
    z-index:15;

    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;

    margin:0 12px;
    /* A sorokon 3px-es színes bal szegély van - itt átlátszóval pótoljuk,
       hogy az oszlopok pontosan egy vonalba essenek a fejléccel. */
    border-left:3px solid transparent;
    padding:8px 16px;

    background:var(--surface-solid, #0f172a);
    backdrop-filter:blur(8px);
    border-bottom:1px solid var(--border-glass);

    font-size:10px;
    font-weight:700;
    letter-spacing:1px;
    text-transform:uppercase;
    color:var(--text-muted);
    font-family:'Space Mono', monospace;
}

/* A fejlécben ugyanazok az oszlopszélességek, de díszítés nélkül */
.station-train-head .station-train-left,
.station-train-head .station-train-route,
.station-train-head .station-train-platform{
    border-left:none;
    display:block;
    min-width:0;
}

.station-train-head .station-train-route{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.station-train-head .station-train-platform{
    text-align:center;
}

@media (max-width: 768px){
    .station-train-btn{
        gap:7px;
        padding:12px 10px;
    }
    .station-train-times{
        flex:0 0 56px;
        width:56px;
    }
    .station-train-left{
        /* Telefonon több hely a vonatszámnak/típusnak (kevésbé csonkolódik). */
        flex:0 0 116px;
        width:116px;
        gap:7px;
        padding-left:8px;
    }
    .station-train-left img{
        width:22px;
        height:22px;
    }
    .station-train-route{
        padding-left:8px;
        font-size:13px;
        /* A viszonylatnak kevesebb hely kell – ami nem fér ki, több sorba
           tördel (a .station-train-route alap-szabálya szerint). */
    }
    .station-train-platform{
        min-width:32px;
        padding-left:8px;
    }
    .station-train-platform-num{
        font-size:14px;
    }
    .station-train-platform-label{
        display:none;
    }
    .station-train-main{
        gap:7px;
    }
    .station-train-head{
        margin:0 8px;
        padding:6px 10px;
        gap:7px;
        font-size:9px;
        letter-spacing:.5px;
    }
    .station-train-warning{
        font-size:11px;
    }
}

/* ==========================================================================
   RESPONSIVE & MOBILE STYLES (JAVÍTOTT RÉSZ)
   ========================================================================== */

.mobile-search-toggle {
    display: none;
}

.mobile-search-overlay {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --panel-w: 100%;
        --panel-max-w: 100%;
    }

    /* Telefonon a vonat-tooltip buborék egyáltalán nem jelenhet meg -
       koppintásra a mini-összefoglaló lap nyílik. A megállónév-címkék
       (.train-stop-label) permanent feliratok, azok maradnak. */
    .leaflet-tooltip:not(.train-stop-label) {
        display: none !important;
    }

    .ui-layer {
        padding: 0;
        pointer-events: none;
    }

    .ui-left {
        display: none;
    }

    .train-detail {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .detail-sections {
        flex: unset;
        min-height: auto;
        overflow: visible;
    }

    .mobile-search-toggle {
        display: flex;
        position: fixed;
        top: 56px;
        left: 16px;
        bottom: unset;
        z-index: 200;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: var(--surface-glass);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border-glass);
        box-shadow: 0 4px 16px var(--shadow-color);
        color: var(--text-main);
        font-size: 20px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        pointer-events: auto;
        transition: transform .15s ease;
    }

    .mobile-search-toggle:active {
        transform: scale(0.93);
    }

    .mobile-search-overlay {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 300;
        height: 55vh;
        background: var(--surface-glass);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-top: 1px solid var(--border-glass);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 40px var(--shadow-color);
        pointer-events: auto;
        transform: translateY(100%);
        transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
        overflow: hidden;
    }

    .mobile-search-overlay.open {
        transform: translateY(0);
    }

    .mobile-search-handle {
        display: flex;
        justify-content: center;
        padding: 10px 0 8px;
        cursor: grab;
        flex-shrink: 0;
        touch-action: none;
    }

    .mobile-search-handle::after {
        content: '';
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: var(--handle-color);
    }

    .mobile-search-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px 12px;
        border-bottom: 1px solid var(--border-glass);
        flex-shrink: 0;
    }

    .mobile-search-header-logo {
        font-family: 'Space Mono', monospace;
        font-size: 16px;
        font-weight: 700;
        background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .mobile-search-header-logo span {
        -webkit-text-fill-color: var(--accent);
    }

    .mobile-search-close {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(255,255,255,.06);
        border: 1px solid var(--border-glass);
        color: var(--text-main);
        font-size: 14px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-search-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1;
        padding: 8px 0 20px;
        min-height: 0;
    }

    .mobile-search-body .search-accordion {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        max-width: 100%;
    }

    .mobile-search-body .search-accordion + .search-accordion {
        border-top: 1px solid var(--border-glass);
    }

    .mobile-search-body .station-search {
        max-width: 100%;
        padding: 12px 20px;
    }

    /* Mobilon a panel tartalmát NE korlátozzuk/vágjuk el (a .search-accordion.active
       .accordion-content { max-height: calc(100vh - 340px) } + overflow:hidden
       miatt a Beállítások/Szűrő nem volt görgethető). Itt a .mobile-search-body
       görget, ezért a tartalom teljes magasságú és látható legyen. */
    .mobile-search-body .search-accordion .accordion-content {
        max-height: none !important;
        overflow: visible !important;
    }
    /* Mobilon a keresők belső listái se korlátozzák magukat - a body görget. */
    .mobile-search-body .station-list,
    .mobile-search-body .filter-choice-list {
        max-height: none;
    }

    /* Mobilon a külső lap-fejléc (.mobile-search-header) már kiírja a szekció
       nevét (Beállítások / Szűrő / Keresők), ezért a belső accordion-fejléc
       (ismételt cím + ✕) felesleges - elrejtjük. */
    .mobile-search-body .search-accordion > .accordion-header {
        display: none;
    }

    /* ── JAVÍTOTT PANEL KONTÉNER MOBILON ── */
    .ui-right {
        width: 100%;
        position: fixed;
        inset: 0;
        z-index: 150;
        pointer-events: none;
        padding: 0;
        height: 100%;
        display: flex;
        align-items: flex-end;
    }

    .panel {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 55vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .panel.open {
        transform: translateY(0);
        pointer-events: auto;
    }

    .panel-drag-handle {
        position: relative;
        top: unset;
        left: unset;
        right: unset;
        width: 100%;
        height: 40px;
        cursor: grab;
        z-index: 10;
        pointer-events: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: none;
        flex-shrink: 0;
        background: transparent;
    }

    .panel-drag-handle::after {
        content: '';
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: var(--handle-color);
    }

    /* A vonat menetrend (és minden panel) bezáró ✕-e a húzható panel szintjén,
       a többi gombtól külön. A tartalmi bezáró gombokat (title="Bezárás")
       elrejtjük - ez veszi át a helyüket. */
    .panel-mobile-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 6px;
        right: 14px;
        z-index: 30;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: none;
        background: var(--hover-bg-strong, rgba(255, 255, 255, 0.12));
        color: var(--text-main);
        font-size: 15px;
        line-height: 1;
        cursor: pointer;
    }
    #panelContent .close-btn[title="Bezárás"] {
        display: none !important;
    }

    #panelContent {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    /* ── FR24-stílusú mini-összefoglaló lap ─────────────────────────────
       Külön doboz a teljes menetrend paneltől: vonatra koppintáskor ez
       csúszik fel, a Részletek gombbal / felfelé húzással pedig helyet
       cserél a teljes menetrend panellel. */
    .train-mini-sheet {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 150;
        border-radius: 20px 20px 0 0;
        transform: translateY(110%);
        transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1);
        pointer-events: none;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .train-mini-sheet.open {
        transform: translateY(0);
        pointer-events: auto;
    }

    /* Állomás összefoglaló alsó lap – ugyanúgy csúszik fel, mint a vonatoké.
       A tartalma (fejléc + induló vonatok + "Teljes menetrend" gomb) a buborék
       .station-pop-* osztályait használja, csak most alsó lapban. */
    .station-mini-sheet {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 150;
        border-radius: 20px 20px 0 0;
        transform: translateY(110%);
        transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1);
        pointer-events: none;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        max-height: 72vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .station-mini-sheet.open {
        transform: translateY(0);
        pointer-events: auto;
    }

    #stationMiniSheetContent {
        padding: 0 16px 18px;
    }

    /* A buborékban fix 250px-re kötött belső szélességet mobilon a lap teljes
       szélességére engedjük. */
    .station-mini-sheet .station-pop-deps-list {
        width: auto;
    }

    .mini-sheet-handle {
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: none;
    }

    .mini-sheet-handle::after {
        content: '';
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: var(--handle-color);
    }

    .mini-sheet-loading {
        padding: 8px 16px 18px;
        text-align: center;
        color: #94a3b8;
        font-size: 13px;
    }

    .train-mini-sheet .train-mini-summary {
        display: block;
    }

    /* A kártyára koppintás nem nyit ki semmit (csak a Részletek gomb vagy
       a felfelé húzás), ezért nem kap pointer kurzort sem. */
    .train-mini-summary {
        padding: 0 12px 10px;
        -webkit-tap-highlight-color: transparent;
        touch-action: pan-y;
        flex-shrink: 0;
    }

    /* FR24-stílusú fejrész: balra a vonat adatai, jobbra a járműfotó,
       ami a bal oszlop teljes magasságát kitölti. */
    .tms-top {
        display: flex;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 7px;
    }

    .tms-headcol {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
    }

    .tms-headcol .delay-badge {
        flex-shrink: 0;
        align-self: center;
        font-size: 10px;
        padding: 2px 6px;
        gap: 4px;
    }

    /* UIC + mozdonynév két sorban, tőlük jobbra a késés-badge. */
    .tms-subrow {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }

    .tms-subcol {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    .tms-photo-wrap {
        width: 34%;
        flex-shrink: 0;
        align-self: center;
        border-radius: 10px;
        overflow: hidden;
        background: rgba(148, 163, 184, .08);
    }

    .tms-photo {
        display: block;
        width: 100%;
        aspect-ratio: 16 / 9;
        height: auto;
        object-fit: cover;
    }

    .tms-header {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .tms-header img {
        width: 20px;
        height: 20px;
        object-fit: contain;
        flex-shrink: 0;
    }

    .tms-title {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    .tms-name {
        font-weight: 700;
        font-size: 14px;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tms-sub {
        font-size: 11px;
        color: #94a3b8;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* UIC + mozdonynév sor: ugyanaz a monospace stílus, mint a teljes
       menetrend fejlécében. */
    .tms-sub.tms-uic {
        font-family: 'Space Mono', monospace;
        font-size: 10px;
    }

    .tms-header .delay-badge {
        flex-shrink: 0;
    }

    /* Középső rész: balra a viszonylat + idők + progressz, jobbra
       oszlopban a sebesség / köv. állomás statok. */
    .tms-main {
        display: flex;
        align-items: stretch;
        gap: 8px;
    }

    /* A viszonylat-blokk ugyanazt a kártyastílust kapja, mint a statok. */
    .tms-routecol {
        flex: 1;
        min-width: 0;
        background: rgba(255, 255, 255, .05);
        border: 1px solid rgba(255, 255, 255, .07);
        border-radius: 7px;
        padding: 5px 8px 6px;
    }

    .tms-route {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .tms-endpoint {
        flex: 1;
        min-width: 0;
    }

    .tms-right {
        text-align: right;
    }

    .tms-station {
        font-size: 12px;
        font-weight: 700;
        color: var(--text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tms-time {
        font-size: 11px;
        color: #94a3b8;
        margin-top: 1px;
        font-family: 'Space Mono', monospace;
    }

    .tms-mid {
        font-size: 13px;
        flex-shrink: 0;
        color: var(--accent);
        font-weight: 700;
    }

    .tms-progress {
        height: 3px;
        border-radius: 2px;
        background: rgba(148, 163, 184, .25);
        margin-top: 7px;
        overflow: hidden;
    }

    .tms-progress-fill {
        height: 100%;
        border-radius: 2px;
        background: var(--accent);
        transition: width .3s;
    }

    .tms-progress-labels {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        font-size: 10px;
        color: #94a3b8;
        margin-top: 4px;
    }

    .tms-stats {
        display: flex;
        flex-direction: column;
        justify-content: stretch;
        gap: 6px;
        width: 34%;
        flex-shrink: 0;
        margin-top: 0;
    }

    .tms-stat {
        flex: 1;
        min-width: 0;
        background: rgba(255, 255, 255, .05);
        border: 1px solid rgba(255, 255, 255, .07);
        border-radius: 7px;
        padding: 4px 7px;
        display: flex;
        flex-direction: column;
    }

    .tms-stat-label {
        font-size: 9px;
        text-transform: uppercase;
        letter-spacing: .4px;
        color: #94a3b8;
    }

    .tms-stat-value {
        font-size: 12px;
        font-weight: 700;
        color: var(--text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ── Fix alsó gombsor a vonatpanelekhez ────────────────────────────
       A teljes menetrend panelen a #panelContent (görgethető tartalom)
       UTÁN áll a flex oszlopban, így mindig a panel alján marad; a mini-
       összefoglaló lapon a kártya alatt ül. */
    .panel.has-actions .train-action-bar,
    .train-mini-sheet.has-actions .train-action-bar {
        display: flex;
        gap: 8px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(148, 163, 184, .15);
        flex-shrink: 0;
    }

    /* Gombok: felül az emoji/ikon, alatta a felirat. */
    .tab-btn {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 7px 4px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, .08);
        background: rgba(255, 255, 255, .05);
        color: var(--text-main);
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .tab-btn .tab-ic {
        font-size: 16px;
        line-height: 1;
        flex-shrink: 0;
    }

    /* A mini-összefoglaló lapon a gombsor is kompaktabb, hogy az egész
       kártya kevesebb helyet foglaljon (FR24-stílus). */
    .train-mini-sheet.has-actions .train-action-bar {
        gap: 6px;
        padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
    }

    .train-mini-sheet .tab-btn {
        padding: 4px 4px;
        gap: 2px;
        font-size: 10px;
        border-radius: 8px;
    }

    .train-mini-sheet .tab-btn .tab-ic {
        font-size: 13px;
    }

    .tab-btn .tab-label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* A Részletek / Kevesebb gomb kiemelt (accent): a mini lapon a
       "Részletek" nyitja a teljes menetrendet, a teljes menetrend panelen
       a "Kevesebb" vált vissza a mini-összefoglalóra. */
    .tab-btn.tab-details {
        background: var(--accent);
        border-color: transparent;
        color: #0f172a;
    }

    /* Aktív követés állapot jelzése a gombsoron. */
    .tab-btn.active-btn {
        border-color: var(--accent);
        color: var(--accent);
        background: rgba(255, 255, 255, .08);
    }

    /* A gombsor kiváltja a fejléc jobb felső akciógombjait (a bezárást a
       .panel-mobile-close adja), és a nekik fenntartott hely sem kell. */
    .panel.has-actions .detail-header-actions {
        display: none;
    }

    .panel.has-actions .detail-train-num {
        padding-right: 40px !important;
    }

    .close-btn {
        top: 12px;
        right: 12px;
    }

    .detail-header-actions {
        top: 12px;
        right: 12px;
        gap: 6px;
    }

    .composition-box{
        width:100vw;
        height:90vh;
        max-height:90vh;
        border-radius:20px;
        overflow:hidden;
    }

    #compositionResults,
    #timetableResults{
        flex:1;
        min-height:0;
        overflow-y:auto;
    }

    .composition-search {
        flex-direction: column;
        align-items: stretch;
    }

    .composition-search input,
    .btn-primary {
        width: 100%;
    }

    /* JAVÍTOTT TÁBLÁZAT WRAPPER */
    .station-table-wrapper {
        overflow-x: auto;
        overflow-y: visible;
        padding: 0 8px;
        flex-shrink: 0;
        -webkit-overflow-scrolling: touch;
    }

    .timetable-table th,
    .timetable-table td,
    .station-table th,
    .station-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .timetable-legend {
        padding: 12px 16px;
    }
    
    .detail-header {
        padding: 16px 16px 12px;
    }

    .leaflet-control-zoom:not(.leaflet-location-btn) {
        position: fixed !important;
        left: auto !important;
        right: 12px !important;
        bottom: 90px !important;
        margin: 0 !important;
        transform: scale(0.9);
        transform-origin: bottom right;
    }

    .time-stack {
        font-size: 11px;
    }

    .time-actual-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .delay-small-badge {
        margin-left: 0;
        font-size: 10px;
    }

    /* Oszlopszélességek rögzítése */
    .timetable-table col:nth-child(1) { width: 28px; }  /* timeline */
    .timetable-table col:nth-child(2) { width: 32px; }  /* km */
    .timetable-table col:nth-child(3) { width: auto; }  /* állomás */
    .timetable-table col:nth-child(4) { width: 52px; }  /* érk. */
    .timetable-table col:nth-child(5) { width: 52px; }  /* ind. */

    .timetable-table th,
    .timetable-table td {
        padding: 8px 4px;
        font-size: 11px;
    }

    .station-name-text {
        font-size: 12px;
    }

    .time-sched-muted {
        font-size: 10px;
    }
}

.mobile-top-header {
    display: none;
}

@media (max-width: 768px) {
    .mobile-top-header {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 120;
        padding: 10px 20px;
        background: var(--surface-glass);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border-glass);
        pointer-events: none;
    }

    .mobile-top-logo {
        font-family: 'Space Mono', monospace;
        font-size: 17px;
        font-weight: 700;
        background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .mobile-top-logo span {
        -webkit-text-fill-color: #FACC15;
    }

    /* Mobilon a márkanév és az óra helyett a kereső ül a fejlécben; a
       helyőrző szövege viszi a márkát ("Mozdonykereső.hu"). */
    .mobile-top-header .mobile-top-search {
        pointer-events: auto;
        flex: 1 1 auto;
        width: auto;
        max-width: 250px;
    }

    .mobile-top-header .live-badge-green,
    .mobile-top-header .tiktok-btn {
        pointer-events: auto;
        flex: 0 0 auto;
    }

    .mobile-top-search .top-bar-search-input {
        height: 34px;
        font-size: 12px;
        padding: 0 32px 0 30px;
    }

    .mobile-top-search .top-bar-search-icon {
        left: 10px;
        font-size: 12px;
    }

    /* A lenyíló a fejléc alatt, a képernyőn belül maradva */
    .mobile-top-search .top-bar-results {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(94vw, 420px);
        max-height: 68vh;
    }

    /* Nyitott találati lista alatt a fejléc a panel fölé kerül */
    .mobile-top-header.search-open {
        z-index: 200;
    }

    #map {
        top: 44px;
    }

    .mobile-search-body .search-accordion {
        border-bottom: 1px solid var(--border-glass);
    }
}

@media (min-width: 769px) {
    .panel {
        height: 100% !important; 
    }
}

.vtk-uic-row{
  display:flex;
  align-items:center;
  margin:auto;
  justify-content:space-between;
  /* Szűk térköz: a típusnév gyakran hajszálnyival lóg csak túl a helyén, és
     a tördelés utána nagy üres részt hagy a doboza jobb oldalán. */
  gap:10px;
}

.copy-uic-btn{
  flex:0 0 auto;
  width:34px;
  height:34px;
  border:none;
  border-radius:10px;
  background:rgba(255,255,255,.06);
  color:#fff;
  cursor:pointer;
  transition: transform .15s, background .2s, box-shadow .2s;
  font-size:16px;
}

.copy-uic-btn:hover{
  background:rgba(255,255,255,.12);
  transform:scale(1.08);
}

.copy-uic-btn:active{
  transform:scale(.92);
}

.copy-uic-btn.copied{
  background:#10B981;
  box-shadow:0 0 14px rgba(16,185,129,.45);
}

.copy-link-btn{
    position:absolute;
    top:16px;
    width:32px;
    height:32px;
    border-radius:50%;
    background: var(--hover-bg-strong);
    border:1px solid var(--border-glass);
    color: var(--text-muted);
    font-size:14px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:all .2s;
    z-index:10;
}

.copy-link-btn:hover{
    background:var(--text-main);
    color:var(--bg-app);
    transform:scale(1.05);
}

.copy-link-btn:active{
    transform:scale(.95);
}

.copy-link-btn.copied{
    background:#10B981;
    color:#fff;
    border-color:#10B981;
    box-shadow:0 0 14px rgba(16,185,129,.45);
    transform:scale(1.08);
}

.active-btn {
  background: #4caf50 !important;
  color: #fff !important;
}

.loading-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  backdrop-filter:blur(8px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:99999;
}

.loading-box{
  background:var(--surface-solid);
  border:1px solid var(--border-glass);
  border-radius:20px;
  padding:28px 40px;
  text-align:center;
  box-shadow: 0 20px 60px var(--shadow-color);
}

.loading-spinner{
  width:42px;
  height:42px;
  border:4px solid var(--border-glass);
  border-top-color:#3b82f6;
  border-radius:50%;
  margin:auto;
  animation:spin 1s linear infinite;
}

.loading-title{
  margin-top:18px;
  font-size:20px;
  font-weight:700;
}

.loading-subtitle{
  margin-top:6px;
  color:#94a3b8;
  font-size:14px;
}

.maintenance-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: none;
    align-items: center;
    justify-content: center;

    background: rgba(0,0,0,.45);
    backdrop-filter: blur(10px);
}

.maintenance-card {
    background: rgba(20,20,20,.95);
    border: 1px solid rgba(255,255,255,.08);

    padding: 32px;
    border-radius: 20px;

    text-align: center;

    min-width: 320px;
    max-width: 500px;

    box-shadow: 0 10px 40px rgba(0,0,0,.4);
}

.maintenance-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.maintenance-card h2 {
    margin: 0 0 10px;
}

.maintenance-card p {
    opacity: .8;
}

/* ===== Icon glow + mobile optimization ===== */
.brand-image{
    filter: drop-shadow(0 0 8px rgba(250,204,21,.55))
            drop-shadow(0 0 18px rgba(250,204,21,.35));
    animation: iconGlow 3s ease-in-out infinite;
    will-change: filter, transform;
}

@keyframes iconGlow{
    0%,100%{
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(250,204,21,.55))
                drop-shadow(0 0 18px rgba(250,204,21,.35));
    }
    50%{
        transform: scale(1.04);
        filter: drop-shadow(0 0 12px rgba(250,204,21,.8))
                drop-shadow(0 0 28px rgba(250,204,21,.55));
    }
}

@media (max-width:768px){
    .brand-image{ width:40px; }
    .glass-panel{
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

@media (prefers-reduced-motion: reduce){
    .brand-image{ animation:none; }
}

/* ===== Alsó eszköztár (beállítások / szűrő / infó) ===== */
.bottom-toolbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 6px;
    border-radius: 18px;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    box-shadow: 0 8px 24px var(--shadow-color);
}

html[data-theme="light"] .bottom-toolbar {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 48px;
    height: auto;
    padding: 6px 5px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn svg {
    width: 18px;
    height: 18px;
}

.toolbar-label {
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    white-space: nowrap;
}

.toolbar-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toolbar-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 999px;
    background: #FACC15;
    color: #0f172a;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--bg-app, #0f172a);
}

.toolbar-btn:hover {
    background: var(--hover-bg-strong);
}

.support-heart-icon {
    animation: heartbeat 3s ease-in-out infinite;
    transform-origin: center;
    filter: drop-shadow(0 0 4px rgba(224, 36, 94, 0.9)) drop-shadow(0 0 8px rgba(224, 36, 94, 0.6));
}

@keyframes heartbeat {
    0%, 60%, 100% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.22); }
}

.toolbar-info-icon {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-style: italic;
    font-size: 17px;
    line-height: 1;
}

.delay-info-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: flex-end;
    justify-content: center;
    background: transparent;
    padding: 0 0 96px 0;
}

.delay-info-box {
    position: relative;
    max-width: 300px;
    width: 100%;
    padding: 20px;
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    box-shadow: 0 20px 60px var(--shadow-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    pointer-events: auto;
}

html[data-theme="light"] .delay-info-box {
    background: var(--surface-glass);
}

/* ===== Középre nyíló ablakok (beállítások / szűrő) ===== */
.center-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.30);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    padding: 20px;
}

.center-modal-box {
    position: relative;
    max-width: 360px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 60px var(--shadow-color);
}

/* A Beállítások a szűrővel azonos panelbe kerül (settings-slot). Asztali
   nézetben a bal oldali panel accordion-tartalma korlátozott magasságú, ezért
   a beállítások hosszú listája itt görgethető legyen. */
.desktop-search[data-section="settings"].active .accordion-content,
.desktop-search[data-section="settings"].open .accordion-content {
    overflow-y: auto;
}
.settings-slot {
    padding: 4px 16px 16px;
}

.center-modal-box h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.center-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--hover-bg-strong);
    color: var(--text-main);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.center-modal-close:hover {
    background: var(--red);
    color: #fff;
}

.search-input.input-error {
    border-color: var(--red);
    box-shadow: 0 0 0 1px var(--red);
}

.feedback-status-error {
    color: var(--red) !important;
}

.feedback-status-success {
    color: var(--green) !important;
}

.delay-info-box h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.delay-info-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--hover-bg-strong);
    color: var(--text-main);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.delay-info-close:hover {
    background: var(--red);
    color: #fff;
}

.delay-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
    color: var(--text-main);
}

.delay-legend-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.delay-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px var(--border-glass);
}

@media (max-width: 768px) {
    .bottom-toolbar {
        bottom: 18px;
    }

    .toolbar-btn {
        min-width: 48px;
        padding: 6px 4px;
    }

    .toolbar-label {
        font-size: 10px;
    }

    .delay-info-overlay {
        padding: 0 0 84px 0;
    }
}
/* ============ Kereső popover a bottom-toolbar felett ============ */
.search-popover {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  bottom: 92px;
  z-index: 9999;
  padding: 14px 8px 8px;
  border-radius: 14px;
  min-width: 220px;
  display: none;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.search-popover.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.search-popover-title {
  margin: 0 28px 8px 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}
.search-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: inherit;
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.search-popover-item:hover,
.search-popover-item:focus-visible {
  background: rgba(255,255,255,0.08);
}
.search-popover-item span:first-child {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

/* ============ Legtöbbet késő vonatok (Top 10) ============ */
.top-delay-card {
    max-width: 400px;
    pointer-events: auto;
    overflow: hidden;
    transition: opacity .2s ease, transform .2s ease;
}

.top-delay-card.hidden {
    display: none;
}

.top-delay-header {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.top-delay-header:hover {
    background: var(--hover-bg);
}

.top-delay-chevron {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform .2s ease;
}

.top-delay-card.collapsed .top-delay-chevron {
    transform: rotate(-90deg);
}

.top-delay-content {
    max-height: 360px;
    overflow-y: auto;
    transition: max-height .25s ease;
}

.top-delay-card.collapsed .top-delay-content {
    max-height: 0;
    overflow: hidden;
}

.top-delay-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 16px 16px;
}

.top-delay-empty {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.top-delay-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--card-bg-soft);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all .2s ease;
}

.top-delay-item:hover {
    background: var(--hover-bg-strong);
    border-color: var(--accent);
    transform: translateX(4px);
}

.top-delay-rank {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--hover-bg-strong);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.top-delay-info {
    flex: 1;
    min-width: 0;
}

.top-delay-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.top-delay-number {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    color: var(--text-main);
}

.top-delay-nem {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}
.top-delay-nem-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Menetrend: külföldi (más időzónájú) állomás helyi ideje alatti eltérés-jelző */
.tz-offset-note {
    font-size: 10px;
    font-weight: 700;
    color: #f59e0b;
    margin-top: 2px;
    white-space: nowrap;
}

.top-delay-route {
    font-size: 12px;
    /* Sötét módban a sima --text-muted (#475569) túl sötét a fekete kártyán,
       ezért olvashatóbb, világosabb szürke; világos módban marad a sötétebb. */
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
html[data-theme="light"] .top-delay-route { color: var(--text-muted); }



/* --- Station disruptions --- */
.station-disrupt-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--card-bg-soft);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all .2s ease;
}
.station-disrupt-item:hover {
    background: var(--hover-bg-strong);
    border-color: var(--accent);
    transform: translateX(4px);
}
.station-disrupt-rank {
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--hover-bg-strong);
    color: var(--text-muted);
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.station-disrupt-info { flex: 1; min-width: 0; }
.station-disrupt-name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.station-disrupt-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex; gap: 10px; flex-wrap: wrap;
}
.station-disrupt-meta b { color: var(--text-main); font-weight: 600; }

/* ── MÁVINFORM hírek ─────────────────────────────────────────────────────── */
.mavinform-item {
    display: block;
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
    padding: 10px 12px;
    background: var(--card-bg-soft);
    border: 1px solid var(--border-glass);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all .2s ease;
}
.mavinform-item:hover {
    background: var(--hover-bg-strong);
    border-color: var(--accent);
    transform: translateX(4px);
}
.mavinform-item-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}
.mavinform-cat {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
    padding: 1px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    color: #e2e8f0;
    background: rgba(148, 163, 184, .18);
    border: 1px solid rgba(148, 163, 184, .35);
}
.mavinform-cat.mavinform-cat-vaganyzar {
    color: #fecaca; background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .45);
}
.mavinform-cat.mavinform-cat-rendkivuli {
    color: #fed7aa; background: rgba(249, 115, 22, .18); border-color: rgba(249, 115, 22, .45);
}
.mavinform-cat.mavinform-cat-modositott {
    color: #bfdbfe; background: rgba(59, 130, 246, .18); border-color: rgba(59, 130, 246, .45);
}
/* Világos módban a chipek szövege sötét, telített szín (a fenti világos színek
   világos háttéren alig olvashatók lennének, pl. a "Rendkívüli változás"). */
html[data-theme="light"] .mavinform-cat {
    color: #334155; background: rgba(100, 116, 139, .14); border-color: rgba(100, 116, 139, .38);
}
html[data-theme="light"] .mavinform-cat.mavinform-cat-vaganyzar {
    color: #b91c1c; background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .40);
}
html[data-theme="light"] .mavinform-cat.mavinform-cat-rendkivuli {
    color: #c2410c; background: rgba(249, 115, 22, .14); border-color: rgba(249, 115, 22, .42);
}
html[data-theme="light"] .mavinform-cat.mavinform-cat-modositott {
    color: #1d4ed8; background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .40);
}
.mavinform-havaria { font-size: 13px; line-height: 1; }
.mavinform-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--text-main);
    font-size: 13.5px;
    line-height: 1.35;
}
.mavinform-meta {
    font-size: 11.5px;
    /* Sötét módban olvashatóbb, világosabb szürke (a dátum/terület kis szövege). */
    color: #94a3b8;
    margin-top: 4px;
    display: flex;
    gap: 4px 12px;
    flex-wrap: wrap;
}
html[data-theme="light"] .mavinform-meta { color: var(--text-muted); }
.mavinform-scope { white-space: nowrap; }

/* MÁVINFORM részletnézet (belső panel, mint a visszajelzés modal) */
.mavinform-detail-box {
    max-width: 560px;
    width: min(560px, 92vw);
    text-align: left;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
}
.mavinform-detail-box h3 {
    margin: 4px 0 6px;
    padding-right: 28px;
    line-height: 1.3;
}
.mavinform-detail-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.mavinform-detail-top:empty { display: none; }
.mavinform-detail-meta {
    display: flex;
    gap: 6px 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-glass);
}
.mavinform-detail-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    flex: 1 1 auto;
    min-height: 60px;
}
.mavinform-detail-body p { margin: 0 0 10px; }
.mavinform-detail-body h2 { font-size: 16px; font-weight: 700; margin: 14px 0 6px; }
.mavinform-detail-body h3 { font-size: 15px; font-weight: 700; margin: 12px 0 6px; padding: 0; }
.mavinform-detail-body ul,
.mavinform-detail-body ol { margin: 0 0 10px; padding-left: 22px; }
.mavinform-detail-body li { margin: 2px 0; }
.mavinform-detail-body strong, .mavinform-detail-body b { color: var(--text-main); }
/* A MÁV "dobozos" bekezdései: keret + halvány háttér a jobb tagolásért */
.mavinform-detail-body > div {
    background: var(--card-bg-soft);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 8px 10px;
    margin: 0 0 10px;
}
.mavinform-detail-loading,
.mavinform-detail-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mavinform-detail-loading .live-dot { width: 10px; height: 10px; display: inline-block; }
.mavinform-detail-source {
    margin-top: 12px;
    align-self: flex-start;
    font-size: 12.5px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.mavinform-detail-source:hover { text-decoration: underline; }

/* "Részletek" gomb a Mávinform kártya fejlécében */
.mavinform-details-btn {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, .16);
    color: var(--accent);
    border: 1px solid var(--border-glass);
    cursor: pointer;
    white-space: nowrap;
    vertical-align: middle;
    transition: all .2s ease;
}
.mavinform-details-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.mavinform-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px;
    background: rgba(59, 130, 246, .16);
    color: var(--accent);
    border: 1px solid var(--border-glass);
    cursor: pointer;
    vertical-align: middle;
    transition: all .2s ease;
}
.mavinform-refresh-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.mavinform-refresh-btn.is-refreshing {
    pointer-events: none;
    animation: mavinform-refresh-spin .8s linear infinite;
}
@keyframes mavinform-refresh-spin {
    to { transform: rotate(360deg); }
}

/* MÁVINFORM böngésző: lapozható lista (bal) + tartós részletnézet (jobb) */
.mavinform-browser-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    padding: 20px;
}
.mavinform-browser {
    position: relative;
    width: min(1000px, 96vw);
    height: min(760px, 92vh);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 20px 60px var(--shadow-color);
}
.mavinform-browser-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    padding-right: 52px;
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
}
.mavinform-browser-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}
.mavinform-browser-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}
.mavinform-browser-list {
    width: 340px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.mavinform-browser-items {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mavinform-browser-items .mavinform-item.active {
    background: var(--hover-bg-strong);
    border-color: var(--accent);
    transform: translateX(4px);
}
.mavinform-browser-pager {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-glass);
}
.mavinform-pager-btn {
    padding: 5px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: var(--card-bg-soft);
    color: var(--text-main);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: all .2s ease;
}
.mavinform-pager-btn:hover:not(:disabled) {
    background: var(--hover-bg-strong);
    border-color: var(--accent);
}
.mavinform-pager-btn:disabled { opacity: .4; cursor: default; }
.mavinform-pager-info {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}
.mavinform-browser-detail {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 26px;
    overflow: hidden;           /* maga a panel nem görög… */
    text-align: left;
}
.mavinform-browser-detail h3 {
    margin: 4px 0 6px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
    flex: 0 0 auto;
}
.mavinform-browser-detail .mavinform-detail-top,
.mavinform-browser-detail .mavinform-detail-meta { flex: 0 0 auto; }
/* …csak a szövegtörzs görög, így a „Megnyitás a MÁV oldalán" mindig alul,
   fix ponton marad, akkor is ha fel-le görgetsz. */
.mavinform-browser-detail .mavinform-detail-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 60px;
}
.mavinform-browser-detail .mavinform-detail-source {
    flex: 0 0 auto;
    width: 100%;
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border-glass);
}
.mavinform-browser-back {
    display: none;
    align-self: flex-start;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: var(--card-bg-soft);
    color: var(--text-main);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

/* MÁVINFORM szűrő (a mavcsoport.hu/mavinform beépített szűrője alapján) */
.mavinform-filter-toggle {
    margin-left: auto;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-glass);
    background: var(--card-bg-soft);
    color: var(--text-main);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s ease;
}
.mavinform-filter-toggle:hover,
.mavinform-filter-toggle.open { background: var(--hover-bg-strong); border-color: var(--accent); }
.mavinform-filter-toggle.has-filters { color: var(--accent); border-color: var(--accent); }

.mavinform-filter {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-glass);
    padding: 14px 20px;
    max-height: 46vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mavinform-filter[hidden] { display: none; }
.mavinform-filter-searchrow {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.mavinform-filter-input {
    flex: 1 1 180px;
    min-width: 0;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: var(--card-bg-soft);
    color: var(--text-main);
    font: inherit;
    font-size: 13px;
}
.mavinform-filter-input:focus { outline: none; border-color: var(--accent); }
.mavinform-filter-search,
.mavinform-filter-clear {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s ease;
}
.mavinform-filter-search { background: var(--accent); color: #fff; border-color: var(--accent); }
.mavinform-filter-search:hover { filter: brightness(1.08); }
.mavinform-filter-clear { background: var(--card-bg-soft); color: var(--text-main); }
.mavinform-filter-clear:hover { background: var(--hover-bg-strong); }
.mavinform-filter-groups {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
.mavinform-filter-group { flex: 1 1 200px; min-width: 0; }
.mavinform-filter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
/* A "teljes listáért" gomb csak a mobil drawerben (.live-slide) látszik. */
.mavinform-mobile-cta { display: none; }

.mavinform-filter-modalitas { display: flex; flex-wrap: wrap; gap: 6px; }
.mavinform-mod-chip {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border-glass);
    background: var(--card-bg-soft);
    color: var(--text-main);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.mavinform-mod-chip:hover { border-color: var(--accent); }
.mavinform-mod-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.mavinform-filter-checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    max-height: 168px;
    overflow-y: auto;
}
.mavinform-check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--text-main);
    cursor: pointer;
    line-height: 1.25;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background .15s ease;
}
.mavinform-check:hover { background: var(--hover-bg-strong); }
/* Natív checkbox elrejtve, saját "pipa-doboz" a helyén */
.mavinform-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.mavinform-check-box {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid var(--border-glass);
    background: var(--card-bg-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
}
.mavinform-check:hover .mavinform-check-box { border-color: var(--accent); }
.mavinform-check-box::after {
    content: '';
    width: 5px;
    height: 9px;
    margin-top: -2px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .15s ease;
}
.mavinform-check input:checked + .mavinform-check-box {
    background: var(--accent);
    border-color: var(--accent);
}
.mavinform-check input:checked + .mavinform-check-box::after { transform: rotate(45deg) scale(1); }
.mavinform-check input:focus-visible + .mavinform-check-box {
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.mavinform-check-text { min-width: 0; }

@media (max-width: 760px) {
    .mavinform-browser {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }
    .mavinform-browser-list {
        width: 100%;
        border-right: none;
    }
    .mavinform-browser.showing-detail .mavinform-browser-list { display: none; }
    .mavinform-browser:not(.showing-detail) .mavinform-browser-detail { display: none; }
    .mavinform-browser-back { display: inline-block; }
    .mavinform-filter-groups { flex-direction: column; gap: 16px; }
    /* Oszlopos elrendezésnél a flex-basis MAGASSÁGGÁ válna (200px), ami nagy üres
       részeket okoz – ezért a csoportok a tartalmuk szerint magasak. */
    .mavinform-filter-group { flex: 0 0 auto; }
    .mavinform-filter { max-height: 54vh; }
}
.station-disrupt-rating {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 2px; flex-shrink: 0;
}
.station-disrupt-score {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    color: var(--accent);
    display: flex; align-items: center; gap: 4px;
}
.station-disrupt-score::before {
    content: '';
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}
.station-disrupt-stars {
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 1px;
    line-height: 1;
}
.station-disrupt-stars .star-empty { color: var(--text-muted); opacity: 0.4; }

/* Legtöbben követett vonatok — LIVE presence */
.live-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    background: var(--red);
    border-radius: 4px;
    vertical-align: middle;
    animation: liveBlink 1.6s ease-in-out infinite;
}
@keyframes liveBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.tracked-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: color-mix(in oklab, var(--accent) 15%, transparent);
    border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
    border-radius: 999px;
    white-space: nowrap;
}

/* FR24-stílusú zöld LIVE badge (fejlécen) */
.live-badge-green {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    padding: 2px 8px 2px 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--green);
    background: color-mix(in oklab, var(--green) 14%, transparent);
    border: 1px solid color-mix(in oklab, var(--green) 45%, transparent);
    border-radius: 999px;
    vertical-align: middle;
    line-height: 1;
    text-transform: uppercase;
}
.live-badge-green .live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: liveDotPulse 1.6s ease-in-out infinite;
}
@keyframes liveDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* ============ Mobile: Élő adatok gomb + drawer ============ */
.mobile-live-toggle { display: none; }
.mobile-live-overlay { display: none; }

@media (max-width: 768px) {
    .mobile-live-toggle {
        display: inline-flex;
        position: fixed;
        top: 56px;
        left: 12px;
        z-index: 200;
        align-items: center;
        gap: 6px;
        height: 36px;
        padding: 0 12px 0 10px;
        border-radius: 999px;
        background: var(--surface-glass);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border-glass);
        box-shadow: 0 4px 16px var(--shadow-color);
        color: var(--text-main);
        font-family: 'DM Sans', system-ui, sans-serif;
        font-size: 13px;
        font-weight: 600;
        line-height: 1;
        cursor: pointer;
        pointer-events: auto;
        transition: transform .15s ease, background .2s;
    }
    .mobile-live-toggle:active { transform: scale(0.94); }
    .mobile-live-toggle::before {
        content: '';
        width: 7px; height: 7px;
        border-radius: 50%;
        background: var(--red);
        box-shadow: 0 0 8px var(--red);
        animation: liveDotPulse 1.4s ease-in-out infinite;
    }
    .mobile-live-toggle-icon { font-size: 14px; }

    .mobile-live-overlay {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 300;
        height: 88vh;
        max-height: calc(100vh - 40px);
        background: var(--surface-glass);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-top: 1px solid var(--border-glass);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 40px var(--shadow-color);
        pointer-events: auto;
        transform: translateY(100%);
        transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
        overflow: hidden;
    }
    .mobile-live-overlay.open { transform: translateY(0); }

    .live-tabs {
        display: flex;
        gap: 6px;
        padding: 10px 16px 4px;
        flex-shrink: 0;
    }
    .live-tab {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 8px 6px;
        border-radius: 10px;
        background: var(--card-bg-soft);
        border: 1px solid transparent;
        color: var(--text-muted);
        font-family: 'DM Sans', system-ui, sans-serif;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: background .18s, color .18s, border-color .18s;
    }
    .live-tab:active { transform: scale(0.97); }
    .live-tab.active {
        background: var(--hover-bg-strong);
        border-color: var(--border-glass);
        color: var(--text-main);
        box-shadow: 0 0 0 1px var(--accent-glow) inset;
    }
    .live-tab-icon { font-size: 14px; }

    .live-pager {
        flex: 1;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .live-pager::-webkit-scrollbar { display: none; }

    .live-slide {
        flex: 0 0 100%;
        width: 100%;
        scroll-snap-align: start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 14px 20px;
    }

    /* Kártyák a drawerben: állandóan nyitva, header nélkül */
    .live-slide .top-delay-card {
        display: block !important;
        margin: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .live-slide .top-delay-card.collapsed .top-delay-content { display: block; }
    .live-slide .top-delay-header { display: none; }
    .live-slide .top-delay-content { display: block !important; padding: 0; }
    /* A drawerben a .live-slide görget függőlegesen; a kártya/tartalom ne vágja
       le és ne görgessen belül (különben a sticky gomb nem tapadna). */
    .live-slide .top-delay-card { overflow: visible; }
    .live-slide .top-delay-content { max-height: none !important; overflow: visible !important; }

    /* Telefonon a Mávinform listája fölött fixen (sticky) ott marad a gomb, ami a
       teljes, lapozható/szűrhető listát (Részletek) nyitja meg. */
    .live-slide .mavinform-mobile-cta {
        display: block;
        position: sticky;
        top: 0;
        z-index: 6;
        width: 100%;
        margin-bottom: 10px;
        padding: 12px 14px;
        border: none;
        border-radius: var(--radius-md);
        background: var(--accent);
        color: #000000;
        font: inherit;
        font-weight: 700;
        font-size: 13.5px;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(0,0,0,.38);
    }
    .live-slide .mavinform-mobile-cta:active { filter: brightness(.94); }

    .live-pager-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: 8px 0 12px;
        flex-shrink: 0;
    }
    .live-dot-pip {
        width: 6px; height: 6px;
        border-radius: 50%;
        background: var(--handle-color);
        transition: background .2s, transform .2s;
    }
    .live-dot-pip.active {
        background: var(--accent);
        transform: scale(1.4);
    }
}

/* ==== Vonat ikonok mérete (Beállítások) ==== */
html[data-icon-size="small"] .marker-holder  { transform: scale(0.72); }
html[data-icon-size="large"] .marker-holder  { transform: scale(1.30); }
html[data-icon-size="small"] .marker-holder:hover { transform: scale(0.9); }
html[data-icon-size="large"] .marker-holder:hover { transform: scale(1.5); }

.settings-section {
    margin-top: 14px;
    text-align: left;
}
.settings-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    opacity: 0.9;
}
.settings-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Beállítások: „Összes beállítás visszaállítása" gomb (a panel legalján) */
.settings-reset-btn {
    width: 100%;
    padding: 10px 14px;
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .35);
    border-radius: 10px;
    color: #ef4444;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.settings-reset-btn:hover {
    background: #ef4444;
    color: #000000;
    border-color: #ef4444;
}
.settings-reset-btn:active {
    filter: brightness(.94);
}

/* Beállítások visszaállítása: megerősítő ablak gombsora (Mégse / Visszaállítás) */
.reset-confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.reset-confirm-actions .btn-secondary,
.reset-confirm-actions .settings-reset-btn {
    flex: 1;
    padding: 10px 14px;
}

/* Beállítások: be/ki kapcsoló (pl. Vasútvonal mutatása) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: left 0.2s ease;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
    left: 21px;
}

.icon-size-options {
    display: flex;
    gap: 8px;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 4px;
}
.icon-size-btn {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.icon-size-btn:hover {
    background: var(--hover-bg);
}
.icon-size-btn.active {
    background: var(--accent);
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 12px var(--accent-glow);
}
html[data-theme="light"] .icon-size-btn.active {
    color: #fff;
}

/* Beállítások: téma választó - ugyanaz a stílus, mint az ikon méretnél */
.theme-mode-btn {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.theme-mode-btn:hover {
    background: var(--hover-bg);
}
.theme-mode-btn.active {
    background: var(--accent);
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 12px var(--accent-glow);
}
html[data-theme="light"] .theme-mode-btn.active {
    color: #fff;
}

/* Beállítások: minőség választó - ugyanaz a stílus, mint a téma választó. */
.quality-btn {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.quality-btn:hover { background: var(--hover-bg); }
.quality-btn.active {
    background: var(--accent);
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 12px var(--accent-glow);
}
html[data-theme="light"] .quality-btn.active { color: #fff; }

/* Rövid magyarázó szöveg egy beállítás alatt. */
.settings-hint {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-sub, #94a3b8);
}

/* Első látogatós minőség-választó ablak gombjai. */
.quality-choice-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.quality-choice-btn {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
    padding: 12px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.quality-choice-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.quality-choice-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
}
.quality-choice-desc {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-sub, #94a3b8);
}

/* ── Alacsony minőség: teljesítmény-optimalizálás gyenge gépekhez/telefonhoz ──
   A homályosítás (backdrop-filter/blur) a leglassabb effekt; kikapcsoljuk. A
   paneljeink háttere 85%-ban átlátszatlan, így blur nélkül is olvashatók. A
   folyamatos mozgás / fényeffekt / nappal-éjszaka réteg kapcsolóit a JS preset
   kezeli. */
html[data-quality="low"] * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
html[data-quality="low"] .train-marker {
    transition: none !important;
}

/* Vonat ikon belső tartalom - kis pötty a szolgáltatóhoz */
.train-marker-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 1.5px rgba(255,255,255,0.9);
}
.train-marker-dot-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    color: #000;
    font-family: 'DM Sans', sans-serif;
}
/* Vonat ikon belső tartalom - vonatnem kép (pl. Személyvonat.png).
   A .train-marker flex-konténer, és a Leaflet `.leaflet-container img`
   szabályai + a flex-elem alap `min-width:auto`-ja a fekvő (pl. 69x41) képet
   a magasság * képarány szélességre "fújta fel" (~32px), ezért túlnyúlt és
   nagynak látszott. Nagyobb fajsúllyal (.train-marker leszármazott) és
   !important-tal rögzítjük a dobozt, `min-width:0`-val engedjük zsugorodni,
   az object-fit:contain pedig kicsire, középre igazítja a képet. */
.train-marker .train-marker-nem-img {
    width: 18px !important;
    height: 18px !important;
    min-width: 0 !important;
    max-width: 18px !important;
    max-height: 18px !important;
    object-fit: contain;
    pointer-events: none;
    display: block;
}

/* Beállítások: ikon tartalom választó - ugyanaz a stílus, mint a mérete */
.icon-content-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-top: 6px;
}
.icon-content-btn {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-main);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.icon-content-btn:hover {
    background: var(--hover-bg);
}
.icon-content-btn.active {
    background: var(--accent);
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 12px var(--accent-glow);
}
html[data-theme="light"] .icon-content-btn.active {
    color: #fff;
}
.icon-content-dots {
    display: inline-flex;
    gap: 3px;
    flex-shrink: 0;
}
.icon-content-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.85);
}
.icon-content-btn.active .icon-content-dot {
    box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}

/* Beállítások: térkép stílus választó (rács, mini előnézetekkel) */
.map-style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.map-style-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: var(--input-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
    font-family: 'DM Sans', sans-serif;
}
.map-style-btn:hover {
    background: var(--hover-bg-strong);
}
.map-style-btn.active {
    border-color: var(--accent);
    background: color-mix(in oklab, var(--accent) 12%, var(--input-bg));
    box-shadow: 0 0 12px var(--accent-glow);
}
.map-style-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.map-style-name {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    line-height: 1.2;
}
.map-style-btn.active .map-style-name {
    color: var(--accent);
    font-weight: 700;
}

/* Mini előnézeti "térképek" - valódi csempék helyett stilizált gradiensek,
   hogy a beállítások panel gyorsan és hálózat nélkül is jól nézzen ki. */
.thumb-terrain {
    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,0.35), transparent 40%),
        linear-gradient(135deg, #8ba888 0%, #c9b385 45%, #7c9e6b 100%);
}
.thumb-roadmap {
    background:
        linear-gradient(0deg, rgba(255,255,255,0.5) 0 2px, transparent 2px 100%),
        linear-gradient(90deg, rgba(255,255,255,0.5) 0 2px, transparent 2px 100%),
        linear-gradient(120deg, #bfe3f0 0%, #eef3d8 55%, #cfe8c8 100%);
    background-size: 100% 18px, 22px 100%, 100% 100%;
}
.thumb-radardark {
    background:
        radial-gradient(circle at 65% 35%, rgba(255,255,255,0.08), transparent 45%),
        linear-gradient(160deg, #0a0b0d 0%, #1c1f24 100%);
}
.thumb-satellite {
    background:
        radial-gradient(circle at 30% 70%, rgba(255,255,255,0.12), transparent 40%),
        linear-gradient(135deg, #3c4a2e 0%, #6b5b3a 55%, #23331f 100%);
}
.thumb-hybrid {
    background:
        linear-gradient(0deg, rgba(255,255,255,0.55) 0 1.5px, transparent 1.5px 100%),
        linear-gradient(90deg, rgba(255,255,255,0.55) 0 1.5px, transparent 1.5px 100%),
        linear-gradient(135deg, #3c4a2e 0%, #6b5b3a 55%, #23331f 100%);
    background-size: 100% 16px, 16px 100%, 100% 100%;
}
.thumb-radarlight {
    background:
        linear-gradient(0deg, rgba(0,0,0,0.4) 0 1.5px, transparent 1.5px 100%),
        linear-gradient(90deg, rgba(0,0,0,0.4) 0 1.5px, transparent 1.5px 100%),
        linear-gradient(135deg, #f5f5f5 0%, #cfcfcf 100%);
    background-size: 100% 16px, 16px 100%, 100% 100%;
}

/* Beállítások: fényerő csúszka */
.brightness-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brightness-icon {
    font-size: 15px;
    flex-shrink: 0;
    opacity: 0.85;
    line-height: 1;
}
.brightness-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--_fill, 50%), var(--input-bg) var(--_fill, 50%), var(--input-bg) 100%);
    background: var(--input-bg);
    outline: none;
    cursor: pointer;
}
.brightness-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.35);
    cursor: pointer;
    margin-top: -7px;
}
.brightness-slider::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: var(--input-bg);
}
.brightness-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.35);
    cursor: pointer;
}

/* Beállítások: vasútvonal szín választó (kis színes körök) */
.railway-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.railway-color-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--swatch, #94a3b8);
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), inset 0 0 0 1px rgba(0,0,0,0.15);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.2s ease, transform 0.15s ease;
}
.railway-color-btn:hover {
    transform: scale(1.08);
}
.railway-color-btn.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px var(--accent), inset 0 0 0 1px rgba(0,0,0,0.15);
}

/* Vasútvonal színezési mód – gombcsoport rugalmas tördeléssel */
.railway-mode-options {
    flex-wrap: wrap;
    gap: 6px;
}
.railway-mode-btn {
    flex: 0 1 auto;
}

/* Jelmagyarázat az aktív színezési módhoz */
.railway-mode-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 10px;
}
.railway-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
}
.railway-legend-dot {
    width: 14px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
/* =========================================================================
   Világos mód javítások — állomáskereső / állomási menetrend
   A JS sablonokban sok inline / komponens szín sötét háttérre készült.
   Itt írjuk felül őket, hogy világos módban is olvashatók legyenek.
   ========================================================================= */
html[data-theme="light"] .station-train-btn {
    background: var(--surface-solid);
    border-top: 1px solid var(--border-glass);
    border-right: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-main);
    box-shadow: 0 1px 2px var(--shadow-color);
}
html[data-theme="light"] .station-train-btn:hover {
    background: var(--hover-bg-strong);
    border-color: var(--accent);
}
html[data-theme="light"] .station-train-type {
    color: var(--text-muted);
}
html[data-theme="light"] .station-train-route {
    color: var(--text-main);
    border-left-color: var(--border-glass);
}
html[data-theme="light"] .station-table-wrapper {
    background: var(--surface-solid) !important;
    border-color: var(--border-glass);
}
html[data-theme="light"] .station-tabs {
    background: var(--surface-glass) !important;
    border-bottom-color: var(--border-glass);
}
html[data-theme="light"] .station-tab-btn {
    color: var(--text-muted) !important;
}
html[data-theme="light"] .station-tab-btn.active {
    color: var(--text-main) !important;
}
html[data-theme="light"] .timetable-table th,
html[data-theme="light"] .timetable-table td,
html[data-theme="light"] .station-table th,
html[data-theme="light"] .station-table td {
    color: var(--text-main);
    border-color: var(--border-glass);
}
/* ── Elavult verzió figyelmeztetés (a karbantartáshoz hasonló, középre igazított,
      homályosított hátterű ablak) ── */
.update-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}
.update-overlay.visible { display: flex; }
.update-box {
    background: var(--surface-solid);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 28px 40px;
    text-align: center;
    max-width: min(92vw, 440px);
    box-shadow: 0 20px 60px var(--shadow-color, rgba(0, 0, 0, .5));
    animation: update-box-in 0.3s ease;
}
@keyframes update-box-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.update-refresh-btn {
    margin-top: 22px;
    padding: 12px 26px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #111;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.update-refresh-btn:hover { filter: brightness(1.1); }

/* Beállítások: verziószám a lista alján */
.app-version-section { text-align: center; }
.app-version-text {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
}
.map-attribution-text {
    margin-top: 8px;
    font-size: 10px;
    line-height: 1.5;
    color: var(--text-muted);
    opacity: 0.85;
}
.map-attribution-text a {
    color: inherit;
    text-decoration: underline;
}

/* ── Vonat ikon stílus: KÉP mód (1haza_trainicon.png a színes kör helyett) ──
   A .train-marker inline background/color-ját !important-tal írjuk felül, a
   belső tartalmat (szám/ikon/pötty) elrejtjük, így csak a kép látszik. Az
   irány-nyíl (a .train-marker testvére) továbbra is megmarad. */
html[data-icon-style="image"] .train-marker {
    /* A képet MASZKKÉNT használjuk: a marker inline háttere (a késés színe) a
       vonat alakjára vágva jelenik meg -> a vonat a késésének megfelelő színű.
       Nagyobb, mint a kör, és a --mk-rot (haladási irány) szerint elfordul. */
    width: 46px !important;
    height: 46px !important;
    -webkit-mask: url('icons/1haza_trainicon.png') center / contain no-repeat;
    mask: url('icons/1haza_trainicon.png') center / contain no-repeat;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    color: transparent !important;
    font-size: 0 !important;
    overflow: visible;
    /* Elforgatás a haladási irányba, ÉS a kijelölt vonat nagyítása - a kettő
       együtt, hogy a megnyitott vonat is a menetirányba nézzen. */
    transform: rotate(var(--mk-rot, 0deg)) scale(var(--mk-scale, 1));
}
html[data-icon-style="image"] .train-marker > * {
    display: none !important;
}
/* Kép módban nincs külön nyíl - maga a kép fordul a haladási irányba. */
html[data-icon-style="image"] .mk-arrow {
    display: none !important;
}
/* Kép módban a belső szöveg ("Vonat ikonok tartalma") nem választható. */
html[data-icon-style="image"] #iconContentSection {
    opacity: 0.4;
    pointer-events: none;
}
