:root {
    color-scheme: light dark;
    --radius: 28px;
    --menu-h: 60px;
}
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
}
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: system-ui;
    background: Canvas;
    color: CanvasText;
    /* bezpečné odsazení pro případné overlay UI */
}
#map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: Canvas;
}
.leaflet-control-rotate {
    display: none !important;
}
.noteText {
    font-size: .75rem;
    opacity: .6;
}

/* Sdílené Apple glass proměnné */
:root {
    --apple-glass-surface-bg: rgba(255,255,255,0.6);
    --apple-glass-surface-border: rgba(255,255,255,1);
    --apple-glass-surface-shadow: 0 6px 20px rgba(0,0,0,0.18);

    --apple-glass-panel-bg:
            linear-gradient(
                    to bottom,
                    rgba(255,255,255,0.25),
                    rgba(255,255,255,0.05)
            ),
            rgba(255,255,255,0.7);
    --apple-glass-panel-shadow: 0 8px 25px rgba(0,0,0,0.25);

    --apple-glass-oval-border: rgba(255,255,255,0.4);
    --apple-glass-oval-shadow:
            0 10px 28px rgba(0,0,0,0.12),
            inset 0 1px 0 rgba(255,255,255,0.34);
}

@media (prefers-color-scheme: dark) {
    :root {
        --apple-glass-surface-bg: rgba(28,28,30,0.6);
        --apple-glass-surface-border: rgba(255,255,255,0.4);
        --apple-glass-surface-shadow: 0 10px 28px rgba(0,0,0,0.34);

        --apple-glass-panel-bg:
                linear-gradient(
                        to bottom,
                        rgba(255,255,255,0.06),
                        rgba(255,255,255,0.02)
                ),
                rgba(28,28,30,0.7);
        --apple-glass-panel-shadow: 0 8px 25px rgba(0,0,0,0.32);

        --apple-glass-oval-border: rgba(255,255,255,0.4);
        --apple-glass-oval-shadow:
                0 10px 28px rgba(0,0,0,0.34),
                inset 0 1px 0 rgba(255,255,255,0.07);
    }

    .leaflet-container .leaflet-control-attribution {
        background-color: rgba(0, 0, 0, 0.3) !important;
        color: #888 !important;
    }

    .leaflet-top.leaflet-right,
    .leaflet-top.leaflet-left,
    body[data-map-tone="osm-dark"] .leaflet-tile-pane {
        filter: invert(90%) hue-rotate(180deg) brightness(100%) contrast(100%);
    }
}

.line-pink {
    color: rgb(177, 80, 177) !important;
    border-color: rgb(177, 80, 177) !important;
}


/*noinspection CssNonIntegerLengthInPixels*/
.content-delimiter {
    border: .5px solid rgba(0, 0, 0, 0.2);
}
@media (prefers-color-scheme: dark) {
    /*noinspection ALL*/
    .content-delimiter {
        border: .5px solid rgba(255, 255, 255, 0.2);
    }
}
.group-content {
    list-style: none;
    padding: 0;
    margin: 0;

    display: grid;

    /* klíč */
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));

    gap: 6px; /* místo paddingu na li */
}

.group-content li a {
    display: block;
    text-align: center;
    text-decoration: none;
    color: white;
    padding: 6px;
    font-size: 18px;


    box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.25),
            0 2px 6px rgba(0,0,0,0.15);
}

.group-content li a:hover {
    opacity: 0.8;
}
.text-labels {
    width: 50px !important;
    height: 40px !important;
    border-radius: 10px;
    font-weight: bold;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.9) !important;
    font-size: 2em;
    text-align: center;
    vertical-align: middle;
    line-height: 40px;       /* The same as your div height */
}
.detail-linky {
    margin-bottom: 8px;
}

/* samotná "karta" */
.detail-linky a {
    display: block;

    padding: 10px 12px;

    border-radius: 14px;

    text-decoration: none;
    color: CanvasText;

    font-size: 13px;
    line-height: 1.3;

    /* glass-ish surface */
    background: rgba(255,255,255,0.45);

    border: 0.5px solid rgba(255,255,255,0.25);

    box-shadow:
            0 2px 8px rgba(0,0,0,0.12),
            inset 0 1px 0 rgba(255,255,255,0.25);

    backdrop-filter: blur(6px) saturate(140%);
    -webkit-backdrop-filter: blur(6px) saturate(140%);

    transition:
            transform 0.12s ease,
            background 0.18s ease,
            box-shadow 0.18s ease;

    -webkit-tap-highlight-color: transparent;
}

/* hover (desktop) */
@media (hover: hover) {
    .detail-linky a:hover {
        background: rgba(255,255,255,0.65);
    }
}

/* active (tap) */
.detail-linky a:active {
    transform: scale(0.97);

    box-shadow:
            0 1px 4px rgba(0,0,0,0.18),
            inset 0 1px 0 rgba(255,255,255,0.2);
}
.detail-linky a.selected {
    background: rgba(0,122,255,0.14);

    border: 0.5px solid rgba(0,122,255,0.35);

    box-shadow:
            0 2px 8px rgba(0,0,0,0.12),
            inset 0 0 0 1px rgba(0,122,255,0.25);
}
@media (prefers-color-scheme: dark) {
    .detail-linky a {
        background: rgba(60,60,65,0.55);

        border: 0.5px solid rgba(255,255,255,0.10);

        box-shadow:
                0 2px 10px rgba(0,0,0,0.4),
                inset 0 1px 0 rgba(255,255,255,0.05);
    }
    .detail-linky a.selected {
        background: rgba(10,132,255,0.18);

        border: 0.5px solid rgba(10,132,255,0.35);

        box-shadow:
                0 2px 10px rgba(0,0,0,0.4),
                inset 0 0 0 1px rgba(10,132,255,0.25);
    }

    @media (hover: hover) {
        .detail-linky a:hover {
            background: rgba(70,70,75,0.65);
        }
    }
}

/* Sytyl pro tlačítko "Reset variant linky" */
.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    gap: 8px;
    font-size: 1em;
    cursor: pointer;
    width: 92%;
    margin: 20px auto 0;

    padding: 10px 16px;

    border-radius: 14px;

    text-decoration: none;
    color: rgb(0,122,255);

    font-weight: 500;

    background: rgba(0,122,255,0.14);
    border: 0.5px solid rgba(0,122,255,0.35);

    box-shadow:
            0 2px 8px rgba(0,0,0,0.12),
            inset 0 1px 0 rgba(255,255,255,0.25);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    transition: all 0.15s ease;

    -webkit-tap-highlight-color: transparent;
}
@media (prefers-color-scheme: dark) {
    .reset-btn {
        color: rgb(10,132,255);

        background: rgba(10,132,255,0.22);
        border: 0.5px solid rgba(10,132,255,0.45);

        box-shadow:
                0 2px 10px rgba(0,0,0,0.5),
                inset 0 1px 0 rgba(255,255,255,0.08);
    }
}
.reset-btn:active {
    transform: scale(0.96);

    box-shadow:
            0 1px 4px rgba(0,0,0,0.2),
            inset 0 1px 0 rgba(255,255,255,0.2);
}
.reset-btn:disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}
.reset-btn .icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Styl pro přepínač zobrazení zastávek při zvětšené klasické mapě */
/* wrapper */
.toggle-row {
    margin-top: 12px;
}

/* celý klikací blok */
.toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 10px 12px;

    border-radius: 14px;

    cursor: pointer;

    text-decoration: none;
    color: CanvasText;

    background: rgba(255,255,255,0.45);
    border: 0.5px solid rgba(255,255,255,0.25);

    box-shadow:
            0 2px 8px rgba(0,0,0,0.12),
            inset 0 1px 0 rgba(255,255,255,0.25);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* text */
.toggle-text {
    font-size: 13px;
    line-height: 1.3;
}

/* skrytý checkbox */
.toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* vizuální switch */
.toggle-ui {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 11px;

    background: rgba(120,120,120,0.4);

    transition: background 0.2s ease;
}

/* knob */
.toggle-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;

    width: 18px;
    height: 18px;

    border-radius: 50%;
    background: white;

    transition: transform 0.2s ease;
}

/* checked state */
.toggle input:checked + .toggle-ui {
    background: rgb(0,122,255);
}

.toggle input:checked + .toggle-ui::after {
    transform: translateX(18px);
}
.toggle.disabled {
    opacity: 0.45;
    pointer-events: none;
}
@media (prefers-color-scheme: dark) {
    .toggle {
        background: rgba(60,60,65,0.55);
        border: 0.5px solid rgba(255,255,255,0.10);

        box-shadow:
                0 2px 10px rgba(0,0,0,0.4),
                inset 0 1px 0 rgba(255,255,255,0.05);
    }

    .toggle-ui {
        background: rgba(120,120,120,0.3);
    }

    .toggle input:checked + .toggle-ui {
        background: rgb(10,132,255);
    }
}

/* Obecný wrap kontejner pro sekce uvnitř panelů */

.main-section {
    margin-top: 14px;
}

.main-section-title {
    margin: 20px 0 8px 2px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: rgba(60, 60, 67, 0.72);
}

.main-section-content {
    padding: 8px 20px 20px 20px;
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.22),
            0 8px 24px rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
    .main-section-title {
        color: rgba(235, 235, 245, 0.72);
    }

    .main-section-content {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.05),
                0 8px 24px rgba(0, 0, 0, 0.18);
    }
}

/* kontejner seznamu zastávek */

/*noinspection CssUnusedSymbol*/
#detailDivZast,
.detail-zastavky {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

/* jedna zastávka */
.zastavka {
    position: relative;
    padding-left: 28px; /* místo pro linku a puntík */
    padding-bottom: 0;
}

/* svislá linka */
.zastavka::before {
    content: "";
    position: absolute;
    left: 11px;
    top: -10px;
    bottom: -10px;
    width: 2px;
    background: rgba(120, 120, 128, 0.35);
    border-radius: 2px;
}

/* puntík */
.zastavka::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 50%;
    width: 12px;
    height: 12px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow:
            0 0 0 2px rgba(100, 100, 110, 0.22),
            0 1px 4px rgba(0, 0, 0, 0.12);
}

/* první zastávka – linka začíná až pod puntíkem */
.zastavka.is-first::before {
    top: 50%;
}
/* první a poslední zastávka - výraznější puntík */
.zastavka.is-first::after, .zastavka.is-last::after {
    width: 14px;
    height: 14px;
    left: 5px;
    background: rgba(0, 122, 255, 0.55);
    box-shadow:
            0 0 0 3px rgba(100, 100, 110, 0.18),
            0 1px 6px rgba(0, 0, 0, 0.14);
}

/* poslední zastávka – linka končí nad puntíkem */
.zastavka.is-last::before {
    bottom: 50%;
}

/* pokud je jen jedna zastávka */
.zastavka.is-first.is-last::before {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .zastavka.is-first::after, .zastavka.is-last::after {
        background: rgba(255, 255, 255, 0.92);
        box-shadow:
                0 0 0 3px rgba(255, 255, 255, 0.10),
                0 1px 6px rgba(0, 0, 0, 0.35);
    }
}

/* klikací karta zastávky */
.zastavka a {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 6px 14px;
    border-radius: 16px;

    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.32);

    box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.06),
            inset 0 1px 0 rgba(255, 255, 255, 0.28);

    line-height: 1.3;
    transition:
            transform 0.16s ease,
            background 0.16s ease,
            box-shadow 0.16s ease;
}

/* hover / tap */
.zastavka a:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.zastavka a:active {
    transform: scale(0.985);
}

/* focus pro přístupnost */
.zastavka a:focus-visible {
    outline: 2px solid rgba(0, 122, 255, 0.55);
    outline-offset: 2px;
}

/* dark mode */
@media (prefers-color-scheme: dark) {
    .zastavka::before {
        background: rgba(140, 140, 150, 0.34);
    }

    .zastavka::after {
        background: rgba(28, 28, 30, 0.95);
        box-shadow:
                0 0 0 2px rgba(255, 255, 255, 0.18),
                0 1px 4px rgba(0, 0, 0, 0.35);
    }

    .zastavka a {
        color: rgba(255, 255, 255, 0.92);
        background: rgba(40, 40, 44, 0.52);
        border: 1px solid rgba(255, 255, 255, 0.10);
        box-shadow:
                0 8px 24px rgba(0, 0, 0, 0.24),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .zastavka a:hover {
        background: rgba(52, 52, 58, 0.60);
    }
}

/* Vykreslování linek */

.bus-type-line {
    border: 5px solid rgb(37, 91, 218);
    color: rgb(37, 91, 218);
}
.bus-type {
    background-color: rgb(44,137,200);
    font-weight: 500;
}

/*noinspection CssUnusedSymbol*/
.trolleybus-type-line {
    border: 5px solid rgb(7, 172, 0);
    color: rgb(7, 172, 0);
}
.trolleybus-type {
    background-color: rgb(0,128,51);
    font-weight: 500;
}

/*noinspection CssUnusedSymbol*/
.tram-type-line {
    border: 5px solid rgb(255, 20, 20);
    color: rgb(255, 20, 20);
}
.tram-type {
    background-color: rgb(226,30,35);
    font-weight: 500;
}

/*noinspection CssUnusedSymbol*/
.night-type-line {
    border: 5px solid rgb(0, 0, 0);
    color: rgb(0, 0, 0);
}
.night-type {
    background-color: rgba(0, 0, 0);
    font-weight: 500;
}

/*noinspection CssUnusedSymbol*/
.rez-type-line {
    border: 5px solid rgb(255, 128, 0);
    color: rgb(255, 128, 0);
}
.rez-type {
    background-color: rgb(238,126,30);
    font-weight: 500;
}
.menu-border {
    border-radius: 6px;
}

/*noinspection CssUnusedSymbol*/
.locate-button,
.vehicle-button {
    background: white;
    border: none;
    border-radius: 5px;
    padding: 5px;
    cursor: pointer;
    font-weight: bold;
}

.arrow-icon {
    transition: transform 2s ease; /* Plynulý přechod pro transformaci */
}
.arrow-icon.move {
    transform: translate(0, 0); /* Výchozí pozice */
}

.stop-tooltip {
    font-size: 15px;
    font-weight: 500;
    background-color: #fff;
    filter: invert(90%) hue-rotate(0deg) brightness(100%) contrast(100%);
}
#show-stops:disabled + label {
    opacity: 0.3 !important;
    cursor: not-allowed;
}

/* Stylování floating okna pro Zoom Info */
.zoom-info {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%) translateY(-6px);

    padding: 10px 14px;
    border-radius: 999px;

    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.2;

    color: rgba(0, 0, 0, 0.75);

    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.35);

    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    box-shadow:
            0 8px 24px rgba(0, 0, 0, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.35);

    display: none;
    opacity: 0;

    transition:
            opacity 0.35s ease,
            transform 0.25s ease;

    z-index: 1000;
    pointer-events: none;
}

.zoom-info.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (prefers-color-scheme: dark) {
    .zoom-info {
        color: rgba(255, 255, 255, 0.92);
        background: rgba(40, 40, 44, 0.55);
        border: 1px solid rgba(255, 255, 255, 0.10);
        box-shadow:
                0 8px 24px rgba(0, 0, 0, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
}

/* Styly pro klikající kružnici pro zobrazení přesnosti polohy - #static-circle nyní nepoužíváme */
#blink {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,87,0,1);
    box-shadow: 0 0 0 rgba(255, 0, 0, .5);
    animation: blink 3s infinite;
    transform: translate(-50%, -50%);
    z-index: 998; /* Z-index pro pulzující kružnici */
    display: none;
    filter: blur(2px);
}
#static-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    border: 3px solid rgba(255,87,0,.3); /* Barva hrany */
    background: transparent; /* Průhledný vnitřek */
    transform: translate(-50%, -50%);
    z-index: 1001; /* Z-index pro statickou kružnici */
    display: none;
}
@keyframes blink {
    0% {
        opacity: .1;
    }
    50% {
        opacity: .3;
    }
    100% {
        opacity: .1;
    }
}

/* Stylování ikon v záložce Výluky */
/* ===== Výluky: layout filtrů ===== */

.diversions-filter-row,
.diversions-input-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: nowrap;
    width: 100%;
}

.diversions-filter-row {
    margin-bottom: 12px;
}

.diversions-input-row {
    gap: 12px;
}

/* společný základ */
.diversions-icon-item {
    box-sizing: border-box;
}

/* ===== Horní ikonové volby ===== */

#diversions-all,
#diversions-current,
#diversions-future {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;

    min-width: 78px;
    padding: 6px 6px;

    border-radius: 14px;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.001);

    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;

    font-size: 1em;
    line-height: 1.1;
    font-weight: 500;
    color: #1c1c1e;
    text-align: center;

    transition:
            background-color 0.18s ease,
            border-color 0.18s ease,
            transform 0.12s ease,
            box-shadow 0.18s ease;
}

#diversions-all:hover,
#diversions-current:hover,
#diversions-future:hover {
    background: rgba(0,0,0,0.04);
}

#diversions-all:active,
#diversions-current:active,
#diversions-future:active {
    transform: scale(0.97);
    background: rgba(0,122,255,0.08);
    border-color: rgba(0,122,255,0.18);
    box-shadow:
            0 2px 8px rgba(0,0,0,0.06),
            inset 0 1px 0 rgba(255,255,255,0.25);
}

#diversions-all img,
#diversions-current img,
#diversions-future img {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* ===== Datum + hledání ===== */

#diversions-date,
#diversions-search {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 0;
    min-width: 0;
}

.diversions-input-label {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.15;
    font-weight: 500;
    color: #1c1c1e;
    text-align: center;
}

/* ===== Inputy ===== */

#date-picker,
#search-input {
    height: 34px;
    line-height: 34px;
    box-sizing: border-box;
    padding: 0 12px;

    border-radius: 11px;
    border: 1px solid rgba(60, 60, 67, 0.18);

    background: rgba(255, 255, 255, 0.72);
    color: #1c1c1e;

    font-size: 1em;
    font-weight: 500;
    text-align: center;

    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);

    box-shadow:
            0 2px 8px rgba(0,0,0,0.08),
            inset 0 1px 0 rgba(255,255,255,0.35);

    outline: none;
    transition:
            border-color 0.18s ease,
            background-color 0.18s ease,
            box-shadow 0.18s ease,
            transform 0.12s ease;

    -webkit-appearance: none;
    appearance: none;
}

#date-picker {
    width: 112px;
}

#search-input {
    width: 132px;
    text-align: center;
}

#search-input::placeholder {
    color: rgba(60, 60, 67, 0.55);
}

#date-picker:focus,
#search-input:focus {
    border-color: rgba(0, 122, 255, 0.45);
    background: rgba(255, 255, 255, 0.86);
    box-shadow:
            0 0 0 4px rgba(0,122,255,0.10),
            0 2px 10px rgba(0,0,0,0.10),
            inset 0 1px 0 rgba(255,255,255,0.40);
}

#date-picker:active,
#search-input:active {
    transform: scale(0.99);
}

/* ===== Dark mode ===== */

@media (prefers-color-scheme: dark) {
    #diversions-all,
    #diversions-current,
    #diversions-future,
    .diversions-input-label {
        color: #f5f5f7;
    }

    #diversions-all:hover,
    #diversions-current:hover,
    #diversions-future:hover {
        background: rgba(255,255,255,0.06);
    }

    #diversions-all:active,
    #diversions-current:active,
    #diversions-future:active {
        background: rgba(10,132,255,0.14);
        border-color: rgba(10,132,255,0.24);
        box-shadow:
                0 2px 10px rgba(0,0,0,0.28),
                inset 0 1px 0 rgba(255,255,255,0.05);
    }

    #date-picker,
    #search-input {
        background: rgba(44, 44, 46, 0.72);
        color: #f5f5f7;
        border: 1px solid rgba(255,255,255,0.12);

        box-shadow:
                0 2px 10px rgba(0,0,0,0.35),
                inset 0 1px 0 rgba(255,255,255,0.05);
    }

    #search-input::placeholder {
        color: rgba(235,235,245,0.42);
    }

    #date-picker:focus,
    #search-input:focus {
        border-color: rgba(10,132,255,0.50);
        background: rgba(58, 58, 60, 0.86);
        box-shadow:
                0 0 0 4px rgba(10,132,255,0.14),
                0 2px 12px rgba(0,0,0,0.42),
                inset 0 1px 0 rgba(255,255,255,0.06);
    }
}

/* Nový glass style vzhled */

/* ===== GLASS ===== */
.glass {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: var(--apple-glass-surface-bg);
}

/* ===== SDÍLENÝ APPLE GLASS SURFACE ZÁKLAD ===== */
.bottom-menu,
.panel,
.map-actions {
    color: CanvasText;
    border: 0.5px solid var(--apple-glass-surface-border);
    isolation: isolate;
}

.bottom-menu,
.map-actions,
.glass {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.bottom-menu,
.map-actions {
    background: var(--apple-glass-surface-bg);
    box-shadow: var(--apple-glass-oval-shadow);
}

.panel {
    background: var(--apple-glass-panel-bg);
    box-shadow: var(--apple-glass-panel-shadow);
}

/* ===== MENU ===== */
.bottom-menu {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);

    width: min(92%, 360px);
    height: var(--menu-h);

    display: flex;
    justify-content: space-around;
    align-items: center;

    border-radius: var(--radius);
    z-index: 1000;
}

/* ===== BUTTONS ===== */
.bottom-menu button {
    all: unset;
    cursor: pointer;

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

    width: 44px;
    height: 44px;

    color: inherit;

    position: relative;
    z-index: 1;

    -webkit-tap-highlight-color: transparent;
}

/* ===== SVG ===== */
.bottom-menu svg {
    width: 24px;
    height: 24px;
    display: block;

    fill: currentColor;

    opacity: 1;
    filter: none;

    position: relative;
    z-index: 1;

    transition: transform 0.2s ease;
}

/* aktivní */
.bottom-menu button.active,
.settings-btn.active {
    color: rgb(0,122,255);
}

@media (prefers-color-scheme: dark) {
    .bottom-menu button.active,
    .settings-btn.active {
        color: rgb(10,132,255);
    }
}

/* search větší */
#search-btn svg {
    transform: scale(1.5);
}

/* ===== PANEL ===== */
.panel {
    position: fixed;
    bottom: calc(var(--menu-h) + 28px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);

    width: min(92%, 660px);

    max-height: calc(
            100dvh
            - max(8px, env(safe-area-inset-top))
            - (var(--menu-h) + 28px)
    );
    display: flex;
    flex-direction: column;

    border-radius: var(--radius);
    padding: 20px;

    opacity: 0;
    pointer-events: none;

    transition: all .25s ease;
    z-index: 1001;

    overflow: hidden;
    box-sizing: border-box;
    transform-origin: bottom center;
}

.panel.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.panel.dragging {
    transition: none !important;
}

/* ===== HANDLE ===== */
.handle {
    position: relative;

    width: 56px;
    height: 24px;
    margin: 0 auto 0;
    cursor: pointer;
    flex: 0 0 auto;

    touch-action: none;
    -webkit-user-select: none;
    user-select: none;

    background: transparent;
}

.handle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 20%;
    transform: translate(-50%, -50%);

    width: 60px;
    height: 5px;
    border-radius: 3px;

    background: linear-gradient(
            to bottom,
            rgba(0,0,0,0.6),
            rgba(0,0,0,0.2)
    );

    opacity: 0.35;
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .handle::after {
        background: linear-gradient(
                to bottom,
                rgba(255,255,255,0.8),
                rgba(255,255,255,0.4)
        );
    }
}

/* ===== CONTENT ===== */
.panel-content {
    font-size: .85em;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.panel-content .text-center {
    text-align: center;
}

/* Akční tlačítka v mapě vpravo */
/* ===== MAP ACTIONS (pravý horní ovál) ===== */
.map-actions {
    position: fixed;
    right: 14px;
    z-index: 1000;
    top: max(16px, env(safe-area-inset-top));

    display: flex;
    flex-direction: column;
    gap: 4px;

    padding: 4px;
    border-radius: 999px;
}

/* ===== JEDNOTLIVÁ TLAČÍTKA ===== */
.map-action-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 999px;

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

    background: transparent;
    color: rgba(0, 0, 0, 0.78);

    box-shadow: none;
    cursor: pointer;

    transition:
            transform 0.16s ease,
            color 0.16s ease,
            background 0.16s ease,
            opacity 0.16s ease;
}

.map-action-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.map-action-btn:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.24);
}

.map-action-btn:focus-visible {
    outline: 2px solid rgba(0, 122, 255, 0.55);
    outline-offset: 2px;
}

.map-action-btn.is-active {
    color: rgba(0, 122, 255, 1);
    background: transparent;
}

#mapStyleBtn.is-active {
    color: rgba(0, 0, 0, 0.78);
    background: transparent;
}

#mapStyleBtn:hover {
    background: rgba(255, 255, 255, 0.18);
}

#mapStyleBtn:active {
    background: rgba(255, 255, 255, 0.24);
}

/* ===== IKONY ===== */
.map-action-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.map-action-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

@media (prefers-color-scheme: dark) {
    .map-action-btn {
        color: rgba(255, 255, 255, 0.92);
    }

    .map-action-btn:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .map-action-btn:active {
        background: rgba(255, 255, 255, 0.12);
    }

    .map-action-btn.is-active {
        color: rgba(10, 132, 255, 1);
    }

    #mapStyleBtn.is-active {
        color: rgba(255, 255, 255, 0.92);
        background: transparent;
    }

    #mapStyleBtn:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    #mapStyleBtn:active {
        background: rgba(255, 255, 255, 0.12);
    }
}

/* Stylování ovládacích tlačítek vlevo nahoře */

.map-controls {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}


/* ===== zoom pill ===== */
.zoom-control {
    width: 38px;
    border-radius: 19px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 0.5px solid var(--apple-glass-oval-border);

    box-shadow: var(--apple-glass-oval-shadow);
}

.zoom-control button {
    height: 38px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: inherit;
}

.zoom-control button:active {
    background: rgba(0,0,0,0.1);
}

.divider {
    height: 1px;
    background: rgba(0,0,0,0.15);
}

@media (prefers-color-scheme: dark) {
    .divider {
        background: rgba(255,255,255,0.2);
    }
}


/* ===== settings button ===== */
.settings-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0.5px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    cursor: pointer;

    box-shadow:
            0 10px 28px rgba(0, 0, 0, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

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

.settings-btn:active {
    background: rgba(0,0,0,0.1);
}
@media (prefers-color-scheme: dark) {
    .settings-btn {
        border-color: rgba(255, 255, 255, 0.4);
        box-shadow:
                0 10px 28px rgba(0, 0, 0, 0.34),
                inset 0 1px 0 rgba(255, 255, 255, 0.07);
    }
}

/* Vyhledávání */

#search-panel {
    display: flex;
    flex-direction: column;
}

#search-panel .panel-content.panel-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
}

.search-results {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.search-bar-wrap {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding-top: 22px;
    background: transparent;
    box-sizing: border-box;
    overflow: visible;
}

.search-input-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;

    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.8);
}

@media (prefers-color-scheme: dark) {
    .search-input-wrap {
        background: rgba(44,44,46,0.38);
        border: 1px solid rgba(255,255,255,0.22);
    }

    .search-bar-wrap::before {
        background: rgba(28,28,30,0.01);
    }
}

.search-input {
    width: 100%;
    min-width: 0;
    height: 44px;

    border: 0;
    outline: 0;
    border-radius: 16px;
    padding: 0 44px 0 42px;
    box-sizing: border-box;

    color: inherit;
    font: inherit;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

@media (prefers-color-scheme: dark) {
    .search-input {
        background: rgba(28,28,30,0.72);
    }
}

.search-input::placeholder {
    color: rgba(60,60,67,0.55);
}

@media (prefers-color-scheme: dark) {
    .search-input::placeholder {
        color: rgba(235,235,245,0.38);
    }
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: none;
    color: rgba(60,60,67,0.55);
}

.search-icon-svg {
    display: block;
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

@media (prefers-color-scheme: dark) {
    .search-icon {
        color: rgba(235,235,245,0.38);
    }
}

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

    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    outline: 0;
    border-radius: 50%;

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

    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    background: rgba(60,60,67,0.12);
    color: rgba(60,60,67,0.7);

    transition:
            opacity 0.16s ease,
            background 0.16s ease,
            color 0.16s ease,
            transform 0.1s ease;
}

.search-clear-icon {
    width: 14px;
    height: 14px;
    display: block;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    fill: none;
}

.search-input-wrap.has-value .search-clear-btn {
    opacity: 1;
    pointer-events: auto;
    background: rgba(0,122,255,0.14);
    color: #007aff;
}

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

@media (prefers-color-scheme: dark) {
    .search-clear-btn {
        background: rgba(235,235,245,0.12);
        color: rgba(235,235,245,0.7);
    }

    .search-input-wrap.has-value .search-clear-btn {
        background: rgba(10,132,255,0.18);
        color: #0a84ff;
    }
}

.search-empty {
    font-size: 15px;
    opacity: 0.72;
    padding: 6px 2px;
}
.search-group-title {
    padding: 6px;
    font-size: 14px;
    font-weight: 600;
}

/* =========================
   VÝLUKY VE VYHLEDÁVÁNÍ
   ========================= */

.search-diversion-group {
    margin-bottom: 12px;
    padding-top: 12px;
}

.search-diversion-group:last-child {
    margin-bottom: 0;
}

/* klikací hlavička */
.search-diversion-toggle {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* vlastní karta hlavičky */
.search-diversion-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 14px 16px;
    border-radius: 18px;

    background: rgba(255,255,255,0.58);
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);

    transition:
            transform 0.16s ease,
            background 0.16s ease,
            border-color 0.16s ease,
            box-shadow 0.16s ease;
}

.search-diversion-toggle:active .search-diversion-header {
    transform: scale(0.992);
}

.search-diversion-toggle[aria-expanded="true"] .search-diversion-header {
    background: rgba(255,255,255,0.68);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

/* malá ikona vlevo */
.search-diversion-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    object-fit: contain;
    display: block;
}

/* textová část */
.search-diversion-texts {
    min-width: 0;
    flex: 1;
}

.search-diversion-title {
    font-size: 14px;
    line-height: 1.28;
    font-weight: 600;
    color: inherit;
    letter-spacing: -0.01em;
    word-break: break-word;
}

.search-diversion-meta {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.35;
    color: rgba(60,60,67,0.82);
    word-break: break-word;
}

/* detail po rozbalení */
.search-diversion-details {
    margin-top: 8px;
    margin-left: 30px;
    padding: 14px 16px 16px;

    border-radius: 18px;
    background: rgba(255,255,255,0.52);
    border: 1px solid rgba(255,255,255,0.68);

    line-height: 1.5;
    color: inherit;

    overflow: hidden;
}

/* obsah z JSONu */
.search-diversion-details > *:first-child {
    margin-top: 0 !important;
}

.search-diversion-details > *:last-child {
    margin-bottom: 0 !important;
}

/* nadpisy uvnitř detailu */
.search-diversion-details h1,
.search-diversion-details h2,
.search-diversion-details h3,
.search-diversion-details h4 {
    margin: 0 0 10px;
    font-size: 17px;
    line-height: 1.3;
    font-weight: 600;
}

/* odstavce a seznamy */
.search-diversion-details p {
    margin: 0 0 10px;
}

.search-diversion-details ul,
.search-diversion-details ol {
    margin: 0 0 10px 18px;
    padding: 0;
}

.search-diversion-details li {
    margin: 0 0 6px;
}

/* odkazy */
.search-diversion-details a {
    color: #0a84ff;
    text-decoration: none;
}

.search-diversion-details a:hover {
    text-decoration: underline;
}

/* obrázky v detailu – klíčové kvůli obří ikoně */
.search-diversion-details img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 140px;
    margin: 0 0 12px;
    border-radius: 14px;
}

/* pokud je obrázek jediný nahoře a je varovná ikona,
   bývá hezčí ještě menší */
.search-diversion-details img:first-child {
    max-height: 96px;
}

/* tabulky, pokud by se někdy objevily */
.search-diversion-details table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 10px;
    font-size: 14px;
}

.search-diversion-details th,
.search-diversion-details td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(60,60,67,0.12);
    text-align: left;
    vertical-align: top;
}

/* jemný oddělovač mezi výlukami */
.search-diversion-group + .search-diversion-group {
    padding-top: 2px;
}

/* tmavý režim */
@media (prefers-color-scheme: dark) {
    .search-diversion-header {
        background: rgba(44,44,46,0.56);
        border-color: rgba(255,255,255,0.12);
        box-shadow: 0 2px 10px rgba(0,0,0,0.24);
    }

    .search-diversion-toggle[aria-expanded="true"] .search-diversion-header {
        background: rgba(58,58,60,0.66);
        box-shadow: 0 4px 18px rgba(0,0,0,0.28);
    }

    .search-diversion-meta {
        color: rgba(235,235,245,0.68);
    }

    .search-diversion-details {
        background: rgba(44,44,46,0.5);
        border-color: rgba(255,255,255,0.1);
    }

    .search-diversion-details th,
    .search-diversion-details td {
        border-bottom-color: rgba(255,255,255,0.1);
    }

    .search-diversion-details a {
        color: #4da3ff;
    }
}

/* mobilní jemné doladění */
@media (max-width: 640px) {
    .search-diversion-header {
        padding: 13px 14px;
        border-radius: 16px;
    }

    .search-diversion-title {
        font-size: 16px;
    }

    .search-diversion-meta {
        font-size: 12.5px;
    }

    .search-diversion-details {
        margin-left: 0;
        padding: 13px 14px 14px;
        border-radius: 16px;
        font-size: 14px;
    }

    .search-diversion-details img {
        max-height: 88px;
    }

    .search-diversion-details img:first-child {
        max-height: 72px;
    }
}

/* Filtrování vozidel z polohy vozidel v panelu search */

.vehicle-filter-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.vehicle-filter-btn {
    flex: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 10px 14px;

    border-radius: 14px;

    font-size: 0.95em;
    font-weight: 500;

    color: rgb(0,122,255);

    background: rgba(0,122,255,0.14);
    border: 0.5px solid rgba(0,122,255,0.35);

    box-shadow:
            0 2px 8px rgba(0,0,0,0.12),
            inset 0 1px 0 rgba(255,255,255,0.25);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.vehicle-filter-reset-icon {
    width: 44px;
    height: 44px;

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

    border-radius: 14px;

    color: rgb(0,122,255);

    background: rgba(0,122,255,0.12);
    border: 0.5px solid rgba(0,122,255,0.25);

    box-shadow:
            0 2px 6px rgba(0,0,0,0.1),
            inset 0 1px 0 rgba(255,255,255,0.25);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    transition: all 0.15s ease;
}

@media (prefers-color-scheme: dark) {
    .vehicle-filter-btn {
        color: rgb(10,132,255);

        background: rgba(10,132,255,0.22);
        border: 0.5px solid rgba(10,132,255,0.45);

        box-shadow:
                0 2px 10px rgba(0,0,0,0.5),
                inset 0 1px 0 rgba(255,255,255,0.08);
    }

    .vehicle-filter-reset-icon {
        color: rgb(10,132,255);

        background: rgba(10,132,255,0.18);
        border: 0.5px solid rgba(10,132,255,0.35);

        box-shadow:
                0 2px 8px rgba(0,0,0,0.5),
                inset 0 1px 0 rgba(255,255,255,0.08);
    }
}

.vehicle-filter-btn:active,
.vehicle-filter-reset-icon:active {
    transform: scale(0.96);
}

.vehicle-filter-btn .icon,
.vehicle-filter-reset-icon .icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Styly pro full screen tlačítko */

/* Plynulé animace */
.bottom-menu,
.map-actions,
#info-btn {
    transition:
            transform 1s cubic-bezier(0.22, 1, 0.36, 1),
            opacity 1s ease,
            visibility 1s ease;
}

/* Výchozí stav */
.bottom-menu {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
    visibility: visible;
}

.map-actions {
    transform: translateX(0) scale(1);
    opacity: 1;
    visibility: visible;
}

#info-btn {
    transform: translateX(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Fullscreen mapy */
body.map-fullscreen-active .bottom-menu {
    transform: translate(-50%, calc(100% + 24px)) scale(1.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.map-fullscreen-active .map-actions {
    transform: translateX(calc(100% + 24px)) scale(1.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.map-fullscreen-active #info-btn {
    transform: translateX(calc(-100% - 24px)) scale(1.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Aktivní fullscreen tlačítko */
#fullscreen-btn.fullscreen-active {
    color: rgb(0,122,255);
}

/* Jemné zvýraznění glass podkladu */
#fullscreen-btn.fullscreen-active.glass {
    box-shadow:
            0 0 0 1px rgba(10,132,255,0.22),
            0 8px 24px rgba(10,132,255,0.18);
}

/* Slider pro opacity map */

.slider-row {
    margin-top: 10px;
    margin-bottom: 10px;
}

.glass-slider {
    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 12px 14px;
    border-radius: 14px;

    color: CanvasText;
    text-decoration: none;

    background: rgba(255,255,255,0.45);
    border: 0.5px solid rgba(255,255,255,0.25);

    box-shadow:
            0 2px 8px rgba(0,0,0,0.12),
            inset 0 1px 0 rgba(255,255,255,0.25);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.glass-slider-texts {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.glass-slider-title {
    font-size: 13px;
    line-height: 1.3;
}

.glass-slider-value {
    font-size: 12px;
    line-height: 1;
    opacity: 0.7;
    white-space: nowrap;
}

/* range */
.glass-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    background: transparent;
    margin: 0;
    cursor: pointer;
}

/* track */
.glass-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(120,120,128,0.28);
}

.glass-slider input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(120,120,128,0.28);
}

/* thumb */
.glass-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;

    width: 20px;
    height: 20px;
    border-radius: 50%;

    background: #fff;
    border: none;

    box-shadow:
            0 1px 4px rgba(0,0,0,0.18),
            0 0 0 0.5px rgba(0,0,0,0.06);

    margin-top: -7px;
}

.glass-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;

    background: #fff;
    border: none;

    box-shadow:
            0 1px 4px rgba(0,0,0,0.18),
            0 0 0 0.5px rgba(0,0,0,0.06);
}

/* focus */
.glass-slider input[type="range"]:focus {
    outline: none;
}

.glass-slider input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow:
            0 1px 4px rgba(0,0,0,0.18),
            0 0 0 6px rgba(0,122,255,0.18);
}

.glass-slider input[type="range"]:focus::-moz-range-thumb {
    box-shadow:
            0 1px 4px rgba(0,0,0,0.18),
            0 0 0 6px rgba(0,122,255,0.18);
}

@media (prefers-color-scheme: dark) {
    .glass-slider {
        background: rgba(60,60,65,0.55);
        border: 0.5px solid rgba(255,255,255,0.10);

        box-shadow:
                0 2px 10px rgba(0,0,0,0.4),
                inset 0 1px 0 rgba(255,255,255,0.05);
    }

    .glass-slider input[type="range"]::-webkit-slider-runnable-track {
        background: rgba(120,120,128,0.22);
    }

    .glass-slider input[type="range"]::-moz-range-track {
        background: rgba(120,120,128,0.22);
    }

    .glass-slider input[type="range"]::-webkit-slider-thumb {
        background: rgba(255,255,255,0.95);
        box-shadow:
                0 1px 6px rgba(0,0,0,0.45),
                0 0 0 0.5px rgba(255,255,255,0.08);
    }

    .glass-slider input[type="range"]::-moz-range-thumb {
        background: rgba(255,255,255,0.95);
        box-shadow:
                0 1px 6px rgba(0,0,0,0.45),
                0 0 0 0.5px rgba(255,255,255,0.08);
    }

    .glass-slider input[type="range"]:focus::-webkit-slider-thumb {
        box-shadow:
                0 1px 6px rgba(0,0,0,0.45),
                0 0 0 6px rgba(10,132,255,0.22);
    }

    .glass-slider input[type="range"]:focus::-moz-range-thumb {
        box-shadow:
                0 1px 6px rgba(0,0,0,0.45),
                0 0 0 6px rgba(10,132,255,0.22);
    }
}

/* Přestylování prvků v Leaflet */

/* Pop-up */
.leaflet-popup-content-wrapper {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.38);
    box-shadow:
            0 8px 30px rgba(0, 0, 0, 0.14),
            inset 0 1px 0 rgba(255, 255, 255, 0.22);
    color: #111;
}

.leaflet-popup-content {
    margin: 14px 16px;
    font-size: .85rem;
    line-height: 1.45;
}

.leaflet-popup-tip {
    width: 14px;
    height: 14px;
    padding: 0;

    transform: rotate(45deg);

    background: rgba(255,255,255,0.62);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.leaflet-container a.leaflet-popup-close-button {
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    color: rgba(0, 0, 0, 0.65);
    font-size: 20px;
    line-height: 28px;
    text-align: center;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.leaflet-container a.leaflet-popup-close-button:hover {
    background: rgba(255, 255, 255, 0.62);
    color: rgba(0, 0, 0, 0.88);
}

/* Tool-tip */
.leaflet-tooltip {
    border: 0;
    border-radius: 14px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.56);
    backdrop-filter: blur(14px) saturate(170%);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    box-shadow:
            0 4px 18px rgba(0, 0, 0, 0.10),
            inset 0 1px 0 rgba(255, 255, 255, 0.18);
    color: #111;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 500;
}

.leaflet-tooltip:before { display: none; }

.leaflet-tooltip-top:before {
    border-top-color: rgba(255, 255, 255, 0.56) !important;
}

.leaflet-tooltip-bottom:before {
    border-bottom-color: rgba(255, 255, 255, 0.56) !important;
}

.leaflet-tooltip-left:before {
    border-left-color: rgba(255, 255, 255, 0.56) !important;
}

.leaflet-tooltip-right:before {
    border-right-color: rgba(255, 255, 255, 0.56) !important;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .leaflet-popup-content-wrapper {
        background: rgba(28, 28, 30, 0.68);
        border: 1px solid rgba(255, 255, 255, 0.10);
        box-shadow:
                0 10px 32px rgba(0, 0, 0, 0.34),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
        color: rgba(255, 255, 255, 0.92);
    }

    .leaflet-popup-tip {
        background: rgba(28, 28, 30, 0.68);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .leaflet-container a.leaflet-popup-close-button {
        background: rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.72);
    }

    .leaflet-container a.leaflet-popup-close-button:hover {
        background: rgba(255, 255, 255, 0.14);
        color: rgba(255, 255, 255, 0.96);
    }

    .leaflet-tooltip {
        background: rgba(44, 44, 46, 0.62);
        color: rgba(255, 255, 255, 0.92);
        box-shadow:
                0 6px 20px rgba(0, 0, 0, 0.28),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .leaflet-tooltip-top:before {
        border-top-color: rgba(44, 44, 46, 0.62) !important;
    }

    .leaflet-tooltip-bottom:before {
        border-bottom-color: rgba(44, 44, 46, 0.62) !important;
    }

    .leaflet-tooltip-left:before {
        border-left-color: rgba(44, 44, 46, 0.62) !important;
    }

    .leaflet-tooltip-right:before {
        border-right-color: rgba(44, 44, 46, 0.62) !important;
    }
}

/* Stavové overlay okno při načítání polohy vozidel */

/*noinspection CssUnusedSymbol*/
.ws-overlay {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);

    z-index: 2147483647;
    pointer-events: none;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 16px 22px;

    border-radius: 18px;

    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.35);

    box-shadow:
            0 10px 30px rgba(0,0,0,0.18),
            inset 0 1px 0 rgba(255,255,255,0.25);

    color: #111;
    font: 600 15px system-ui, -apple-system, Inter, sans-serif;

    opacity: 0;
    transition:
            opacity 180ms ease,
            transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

/*noinspection CssUnusedSymbol*/
.ws-overlay.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* spinner */
.ws-overlay-spinner svg {
    width: 18px;
    height: 18px;
    display: block;
}

.ws-overlay-spinner circle {
    stroke: rgba(0,0,0,0.12);
    stroke-width: 4;
    fill: none;
}

.ws-overlay-spinner path {
    stroke: rgba(0,0,0,0.7);
    stroke-width: 4;
    stroke-linecap: round;
    fill: none;
    animation: ws-spin 0.8s linear infinite;
}

@keyframes ws-spin {
    from { transform: rotate(0deg); transform-origin: 50% 50%; }
    to   { transform: rotate(360deg); transform-origin: 50% 50%; }
}

@media (prefers-color-scheme: dark) {
    /*noinspection CssUnusedSymbol*/
    .ws-overlay {
        background: rgba(28,28,30,0.7);
        border: 1px solid rgba(255,255,255,0.08);
        box-shadow:
                0 12px 34px rgba(0,0,0,0.5),
                inset 0 1px 0 rgba(255,255,255,0.06);
        color: rgba(255,255,255,0.92);
    }

    .ws-overlay-spinner circle {
        stroke: rgba(255,255,255,0.12);
    }

    .ws-overlay-spinner path {
        stroke: rgba(255,255,255,0.9);
    }
}

/* Styly pro kreslení prstence u vozidla dle zpoždění */

/* ===== ZPOŽDĚNÍ VOZIDLA – PRSTENEC KOLEM IKONY ===== */

.vehicle-delay-visual {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

/*noinspection CssUnresolvedCustomProperty*/
.vehicle-delay-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;

    background:
            radial-gradient(
                    circle,
                    transparent 0%,
                    transparent 30%,
                    color-mix(in srgb, var(--delay-color, rgb(255, 170, 0)) 100%, transparent) 30%,
                    var(--delay-color, rgb(255, 170, 0)) 100%,
                    transparent 100%
            );

    filter: blur(10px);
}
@media (prefers-color-scheme: dark) {
    .vehicle-delay-ring {
        opacity: 1;
    }
}

.fixedArrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 60px;
    height: 60px;

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

    border-radius: 50%;

    visibility: hidden;
    z-index: 999;

    backdrop-filter: blur(2px) saturate(140%);
    -webkit-backdrop-filter: blur(2px) saturate(140%);

    background: rgba(255, 255, 255, 0.22);
    border: 0.5px solid rgba(255, 255, 255, 0.42);

    box-shadow:
            0 2px 10px rgba(0, 0, 0, 0.22),
            inset 0 1px 0 rgba(255, 255, 255, 0.22);

    pointer-events: none;
    isolation: isolate;
}

.fixedArrow::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;

    background: radial-gradient(
            circle,
            rgba(0, 122, 255, 0.22) 0%,
            rgba(0, 122, 255, 0.10) 40%,
            rgba(0, 122, 255, 0.00) 72%
    );

    filter: blur(6px);
    z-index: -1;
    pointer-events: none;
}

.fixedArrow svg,
.fixedArrow .arrow-icon {
    width: 30px;
    height: 30px;
    display: block;
    fill: currentColor;

    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.arrow-icon {
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: center center;
}

@media (prefers-color-scheme: dark) {
    .fixedArrow {
        background: rgba(40, 40, 44, 0.30);
        border: 0.5px solid rgba(255, 255, 255, 0.16);

        box-shadow:
                0 4px 14px rgba(0, 0, 0, 0.38),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .fixedArrow::after {
        background: radial-gradient(
                circle,
                rgba(10, 132, 255, 0.26) 0%,
                rgba(10, 132, 255, 0.12) 42%,
                rgba(10, 132, 255, 0.00) 74%
        );
    }

    .fixedArrow svg,
    .fixedArrow .arrow-icon {
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
    }
}

/* =========================================
   MAX ÚSPORNÝ REŽIM
   Aktivuje se třídou .economy-mode na <html>
   ========================================= */

html.economy-mode {
    --apple-glass-surface-bg: rgba(255,255,255,0.94);
    --apple-glass-surface-border: rgba(0,0,0,0.08);
    --apple-glass-panel-bg: rgba(255,255,255,0.96);
    --apple-glass-panel-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --apple-glass-oval-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

@media (prefers-color-scheme: dark) {
    html.economy-mode {
        --apple-glass-surface-bg: rgba(28,28,30,0.94);
        --apple-glass-surface-border: rgba(255,255,255,0.10);
        --apple-glass-panel-bg: rgba(28,28,30,0.96);
        --apple-glass-panel-shadow: 0 2px 8px rgba(0,0,0,0.28);
        --apple-glass-oval-shadow: 0 2px 8px rgba(0,0,0,0.28);
    }
}

/* 1) Vypnutí všech drahých blur / saturate efektů */
html.economy-mode .glass,
html.economy-mode .bottom-menu,
html.economy-mode .panel,
html.economy-mode .map-actions,
html.economy-mode .detail-linky a,
html.economy-mode .reset-btn,
html.economy-mode .toggle,
html.economy-mode .glass-slider,
html.economy-mode .zoom-info,
html.economy-mode #date-picker,
html.economy-mode #search-input,
html.economy-mode .fixedArrow,
html.economy-mode .fixedArrow::after,
html.economy-mode .ws-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 2) Výrazné zjednodušení stínů */
html.economy-mode .bottom-menu,
html.economy-mode .panel,
html.economy-mode .map-actions,
html.economy-mode .detail-linky a,
html.economy-mode .reset-btn,
html.economy-mode .toggle,
html.economy-mode .glass-slider,
html.economy-mode .main-section-content,
html.economy-mode .zastavka a,
html.economy-mode .zoom-info,
html.economy-mode #date-picker,
html.economy-mode #search-input,
html.economy-mode .search-diversion-header,
html.economy-mode .search-diversion-details,
html.economy-mode #fullscreen-btn.fullscreen-active.glass,
html.economy-mode .fixedArrow,
html.economy-mode .ws-overlay {
    box-shadow: none !important;
}

/* 3) Jednodušší, téměř plné podklady místo skla */
html.economy-mode .bottom-menu,
html.economy-mode .map-actions,
html.economy-mode .panel,
html.economy-mode .toggle,
html.economy-mode .glass-slider,
html.economy-mode .detail-linky a,
html.economy-mode .reset-btn,
html.economy-mode .main-section-content,
html.economy-mode .zastavka a,
html.economy-mode .zoom-info,
html.economy-mode #date-picker,
html.economy-mode #search-input,
html.economy-mode .search-diversion-header,
html.economy-mode .search-diversion-details,
html.economy-mode .ws-overlay {
    background-image: none !important;
}

/* 4) Zjednodušení animací a transformů */
html.economy-mode .panel,
html.economy-mode .bottom-menu,
html.economy-mode .map-actions,
html.economy-mode #info-btn,
html.economy-mode .detail-linky a,
html.economy-mode .reset-btn,
html.economy-mode .toggle,
html.economy-mode .glass-slider,
html.economy-mode .search-diversion-header,
html.economy-mode .search-diversion-details,
html.economy-mode .search-clear-btn,
html.economy-mode .zoom-info,
html.economy-mode .arrow-icon,
html.economy-mode .ws-overlay {
    transition-duration: 0.01ms !important;
}

/* 5) Zrušení scale/hover/tap efektů */
html.economy-mode .detail-linky a:active,
html.economy-mode .reset-btn:active,
html.economy-mode .search-clear-btn:active,
html.economy-mode .zastavka a:active,
html.economy-mode .search-diversion-toggle:active .search-diversion-header,
html.economy-mode #diversions-all:active,
html.economy-mode #diversions-current:active,
html.economy-mode #diversions-future:active,
html.economy-mode #date-picker:active,
html.economy-mode #search-input:active {
    transform: none !important;
}

/* 6) Úsporná verze zpoždění vozidel */
html.economy-mode .vehicle-delay-visual,
html.economy-mode .vehicle-delay-ring {
    display: block !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    animation: none !important;
}

/* pokud je samotný ring kreslený přes vehicle-delay-visual */
html.economy-mode .vehicle-delay-visual {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    background: none !important;
    filter: none !important;
    box-shadow: none !important;
}
html.economy-mode .vehicle-delay-ring {
    border: 3px solid color-mix(in srgb, var(--delay-color) 70%, transparent) !important;
    background: color-mix(in srgb, var(--delay-color) 40%, transparent);
}

/* pseudo-element pro vnitřní ring */
html.economy-mode .vehicle-delay-visual::before,
html.economy-mode .vehicle-delay-ring::before {
    filter: none !important;
    box-shadow: none !important;
}

/* 7) Ztišení pulzu polohy */
html.economy-mode #blink {
    animation: none !important;
    filter: none !important;
    opacity: 0.16 !important;
}

/* 8) Jednodušší marker polohy */
html.economy-mode .fixedArrow {
    background: transparent !important;
}

/* 9) Zjednodušení mapových overlay prvků */
html.economy-mode .leaflet-control-attribution,
html.economy-mode .text-labels {
    box-shadow: none !important;
    filter: none !important;
}

/* 10) Jemnější, levnější vzhled sekcí */
html.economy-mode .main-section-content,
html.economy-mode .toggle,
html.economy-mode .glass-slider,
html.economy-mode .search-input,
html.economy-mode .fixedArrow::after {
    background: rgba(0,0,0,0.05) !important;
}

@media (prefers-color-scheme: dark) {
    html.economy-mode .main-section-content {
        background: rgba(255,255,255,0.04) !important;
    }
}