/* --- ZMIENNE I MOTYWY --- */
:root {
    /* Default Dark Theme */
    --color-bg: #121212;
    --color-surface: #1E1E1E;
    --color-surface-active: #2C2C2C;
    --color-primary: #FDD835;
    --color-primary-dim: rgba(253, 216, 53, 0.1);
    --color-text-main: #FFFFFF;
    --color-text-dim: #AAAAAA;
    --color-text-inv: #000000;
    --color-on-primary: #000000;
    --color-danger: #ef5350;
    --color-info: #2196f3;
    --color-success: #4caf50;
    --border-color: #333;
    --header-bg: rgba(18, 18, 18, 0.95);
    --nav-height: 65px;
    --header-height: 60px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Map filter for dark mode */
    --map-filter: grayscale(100%) invert(100%) contrast(90%);
}

/* Light Theme Override */
[data-theme="light"] {
    --color-bg: #F5F5F5;
    --color-surface: #FFFFFF;
    --color-surface-active: #EEEEEE;
    --color-primary: #F57F17;
    /* Darker yellow/orange for contrast on white */
    --color-primary-dim: rgba(245, 127, 23, 0.1);
    --color-text-main: #121212;
    --color-text-dim: #666666;
    --color-text-inv: #FFFFFF;
    --color-danger: #d32f2f;
    --color-info: #1976d2;
    --color-success: #388e3c;
    --border-color: #E0E0E0;
    --header-bg: rgba(255, 255, 255, 0.95);

    /* Map filter for light mode (none) */
    --map-filter: none;
}

/* PRELOADER TRICK - prevents color flashing */
.preload * {
    transition: none !important;
    animation-duration: 0.001s !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- UI STRUKTURALNE --- */
.app-header {
    height: var(--header-height);
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background-color 0.3s;
}

.app-logo {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Logo Shadow */
.app-logo img {
    filter: drop-shadow(2px 4px 2px black);
}

.user-status {
    font-size: 0.85rem;
    color: var(--color-text-dim);
    background: var(--color-surface);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.user-status:active {
    background: var(--color-surface-active);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-success);
}

#app-container {
    flex: 1;
    position: relative;
    margin-top: var(--header-height);
    margin-bottom: var(--nav-height);
    overflow: hidden;
    transition: margin 0.3s ease;
}

.view-section {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 20px 20px 100px 20px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s;
    background-color: var(--color-bg);
    z-index: 1;
}

.view-section.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
    z-index: 10;
}

.view-section::-webkit-scrollbar {
    width: 4px;
}

.view-section::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* --- IMMERSIVE MODE (NAVIGATION) --- */
body.mode-immersive .app-header {
    transform: translateY(-100%);
}

body.mode-immersive .bottom-nav {
    transform: translateY(100%);
}

body.mode-immersive #app-container {
    margin-top: 0;
    margin-bottom: 0;
}

/* Pilot HUD 2.0 — pływająca karta (design handoff): mapa pod spodem, karta top 12/12/12 */
#pilot-top-fade {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 210px;
    background: linear-gradient(rgba(0, 0, 0, .45), transparent);
    z-index: 40;
    pointer-events: none;
}

[data-theme="light"] #pilot-top-fade {
    background: linear-gradient(rgba(0, 0, 0, .12), transparent);
}

#pilot-hud {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
    overflow: hidden;
    z-index: 50;
    transition: background-color 0.3s;
}

[data-theme="light"] #pilot-hud {
    box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}

.hud-row-next {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
}

#pilot-hud-logo {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--color-surface-active);
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#pilot-hud-logo:active {
    filter: brightness(1.25);
}

#pilot-hud-logo svg {
    width: 27px;
    height: 27px;
}

/* --- AUTH STYLES --- */
.huge-input {
    font-size: 1.8rem !important;
    text-align: center;
    letter-spacing: 2px;
    padding: 20px !important;
    font-weight: 700;
}

.otp-letter-spacing {
    letter-spacing: 0.5em;
    /* Rozstrzelenie cyfr kodu OTP */
}

/* Ukrywanie loadera domyślnie */
#login-loader,
#otp-loader {
    display: none;
    margin-top: 20px;
}

#pilot-hud-next {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
    color: var(--color-text-main);
    border-radius: 12px;
}

#pilot-hud-next:active {
    background: var(--color-surface-active);
}

.hud-next-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.hud-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-plat-wrap {
    flex: 0 0 auto;
    font-size: 0.74rem;
    color: var(--color-text-dim);
    text-transform: none;   /* „st." małą literą (ujednolicony skrót stanowiska) */
    letter-spacing: .5px;
    white-space: nowrap;
}

.hud-platform {
    font-size: 1.25rem;
    color: var(--color-primary);
    font-weight: 800;
}

/* brak numeru stanowiska -> schowaj cały napis "Stan." */
.hud-plat-wrap:has(.hud-platform:empty) {
    visibility: hidden;
}

.hud-main-text-container {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    padding: 6px 0 8px 0;
    /* safe buffer for diacritics (Ś, Ź) and descenders (p, q, j) */
}

.hud-main-wrapper {
    grid-area: name;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    margin-top: -8px;
    /* visually pulls the element up to compensate for padding without clipping */
}

#nav-next-badges {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}

#nav-next-badges:empty {
    display: none;
}

.hud-main-text {
    font-size: 1.95rem;
    font-weight: 800;
    color: var(--color-text-main);
    display: inline-block;
    line-height: 1.2;
    vertical-align: middle;
}

/* wiersz 2: manewr + opóźnienie */
#pilot-hud-status {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--color-surface);
}

.hud-pictogram {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(76, 139, 245, .16);
    color: #4c8bf5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

[data-theme="light"] .hud-pictogram {
    background: rgba(27, 110, 243, .12);
    color: #1b6ef3;
}

.hud-pictogram svg {
    width: 36px;
    height: 36px;
    stroke-width: 2.4;
}

.hud-directions-wrap {
    min-width: 0;
    overflow: hidden;
}

.hud-man-dist {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-text-dim);
    white-space: nowrap;
}

.hud-man-dist:empty {
    display: none;
}

.hud-delay-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 6px 9px;
    border-radius: 14px;
    background: var(--color-surface-active);
    color: var(--color-text-main);
    transition: background 0.3s;
    flex: 0 0 auto;
}

.hud-delay-val {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1;
    color: inherit;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.hud-delay-unit {
    font-size: 0.66rem;
    font-weight: 700;
    color: inherit;
    opacity: .75;
    text-transform: uppercase;
    margin-top: 2px;
}

.delay-early {
    background: rgba(239, 83, 80, 0.25);
    color: #ef5350;
}

/* Red */
.delay-late {
    background: rgba(33, 150, 243, 0.25);
    color: #64b5f6;
}

/* Blue */
.delay-ok {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

/* Green */

/* Jasny motyw: „spóźniony" niebieski w odliczaniu HUD — #64b5f6 był nieczytelny na białym tle */
[data-theme="light"] .hud-delay-box.delay-late {
    background: rgba(21, 101, 192, 0.16);
    color: #1565c0;
}

.hud-directions {
    color: var(--color-text-main);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.15;
    margin-top: 1px;
    /* nazwa zajmuje tyle linii, ile fizycznie się zmieści (bez ucinania wielokropkiem);
       długie nazwy łamią się w słowie zamiast wychodzić poza kartę */
    overflow-wrap: anywhere;
}

/* --- BOCZNY PASEK AKCJI PILOTA --- */
#pilot-rail {
    position: absolute;
    /* poniżej karty HUD ORAZ komunikatu „Brak sygnału GPS" (do 2 linii) — prędkość zawsze widoczna */
    top: calc(max(10px, env(safe-area-inset-top)) + 244px);
    right: 14px;
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.rail-tile {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
    cursor: pointer;
    color: var(--color-text-main);
}

.rail-tile:active {
    transform: scale(0.94);
}

.rail-tile svg {
    width: 34px;
    height: 34px;
}

.rail-hazard {
    background: rgba(255, 82, 82, .16);
    border-color: rgba(255, 82, 82, .45);
    color: #ff5252;
}

[data-theme="light"] .rail-hazard {
    background: rgba(211, 47, 47, .12);
    border-color: rgba(211, 47, 47, .5);
    color: #d32f2f;
}

.rail-theme {
    color: var(--color-primary);
}

/* --- ARKUSZE OD DOŁU (bottom sheet): zagrożenia + wybór przystanku --- */
@keyframes sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes sheet-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pilot-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
    display: none;
    align-items: flex-end;
    animation: sheet-fade .2s ease;
}

.pilot-sheet-backdrop.open {
    display: flex;
}

.pilot-sheet {
    width: 100%;
    background: var(--color-surface);
    border-top: 1px solid var(--border-color);
    border-radius: 22px 22px 0 0;
    padding: 10px 16px calc(22px + env(safe-area-inset-bottom));
    max-height: 82%;
    overflow: hidden;
    /* nagłówek i „Anuluj" stałe — przewija się tylko lista (.sheet-list) */
    display: flex;
    flex-direction: column;
    box-shadow: 0 -12px 34px rgba(0, 0, 0, .45);
    animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1);
}

.sheet-handle,
.sheet-head,
.sheet-sub,
.hazard-grid,
.sheet-cancel {
    flex: 0 0 auto;
}

.sheet-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    margin: 2px auto 14px;
}

.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}

.sheet-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-text-main);
}

.sheet-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-surface-active);
    color: var(--color-text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sheet-sub {
    font-size: .82rem;
    color: var(--color-text-dim);
    margin-bottom: 16px;
}

.hazard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.hazard-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 8px;
    border-radius: 16px;
    background: var(--color-surface-active);
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--color-text-main);
    font-size: .92rem;
    font-weight: 700;
}

.hazard-tile:active {
    transform: scale(0.97);
}

.hazard-ico {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sheet-cancel {
    margin-top: 14px;
    text-align: center;
    padding: 13px;
    border-radius: 14px;
    background: var(--color-surface-active);
    color: var(--color-text-dim);
    font-weight: 700;
    cursor: pointer;
}

/* wiersze selektora przystanków (arkusz) */
.sheet-stop-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 10px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--color-text-main);
}

.sheet-stop-row:active {
    background: var(--color-surface-active);
}

.sheet-stop-row.served {
    opacity: .42;
}

.sheet-stop-row.current {
    background: rgba(76, 139, 245, .15);
    border: 1px solid rgba(76, 139, 245, .55);
}

.sheet-stop-time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--color-text-dim);
    min-width: 58px;
    flex: 0 0 auto;
}

.sheet-stop-row.current .sheet-stop-time {
    color: #4c8bf5;
    font-weight: 800;
}

.sheet-stop-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.sheet-stop-name>span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sheet-stop-chip {
    flex: 0 0 auto;
    background: var(--color-surface-active);
    color: var(--color-text-dim);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: .84rem;
    white-space: nowrap;
}

.sheet-stop-row.current .sheet-stop-chip {
    background: rgba(76, 139, 245, .2);
    color: #4c8bf5;
    border-color: rgba(76, 139, 245, .4);
}

/* mini-toast potwierdzeń pilota (np. wysłane zgłoszenie) */
#pilot-toast {
    position: fixed;
    left: 50%;
    bottom: calc(90px + env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(16px);
    background: var(--color-surface);
    color: var(--color-text-main);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 11px 18px;
    font-weight: 700;
    font-size: .95rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
    z-index: 4000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}

#pilot-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#map {
    width: 100%;
    height: calc(200vh - 400px);
    background: var(--color-bg);
}

/* Filter controlled by theme variable */
.dark-map-tile {
    filter: var(--map-filter);
}

/* --- BREAK VIEW MODAL --- */
.break-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transform: translateY(110%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px20px 40px 20px;
    /* Top Right Bottom Left */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.break-modal.open {
    transform: translateY(0);
    padding: 30px;
}

/* Minimized State overrides */
.break-modal.minimized {
    transform: translateY(0);
    /* Stays visible at bottom since content shrinks */
    padding: 0;
    background: var(--color-primary);
    color: #000;
    cursor: pointer;
    gap: 0;
}

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

.break-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-text-main);
}

.break-timer-container {
    text-align: center;
    margin: 10px 0;
}

.break-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-dim);
}

.break-timer-val {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--color-primary);
    font-family: monospace;
}

.break-next-info {
    background: var(--color-bg);
    padding: 15px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 5px;
}

.break-trip-line {
    font-size: 1.5rem;
    font-weight: bold;
    grid-column: 1;
}

.break-trip-dir {
    font-size: 1rem;
    color: var(--color-text-dim);
    grid-column: 1;
}

.break-trip-time {
    font-size: 1.5rem;
    font-weight: bold;
    grid-column: 2;
    grid-row: 1/3;
    align-self: center;
    text-align: right;
}

.technical-box {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-start-next {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: bold;
    background: var(--color-primary);
    color: #000;
    border: none;
    border-radius: 12px;
    margin-top: 10px;
    cursor: pointer;
}

.btn-start-next:active {
    filter: brightness(0.9);
    transform: scale(0.98);
}

/* Minimized Content Logic */
.break-minimized-content {
    height: 60px;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}

.break-modal.minimized .break-content,
.break-modal.minimized .break-header {
    display: none !important;
}

.break-modal.minimized .break-minimized-content {
    display: flex !important;
}

.break-mini-timer {
    font-weight: 900;
    font-size: 1.5rem;
    font-family: monospace;
}

.break-mini-label {
    font-weight: 600;
    text-transform: uppercase;
}

/* Theming tweaks for the modal */
[data-theme="light"] .break-timer-val {
    color: #000;
}

[data-theme="light"] .break-modal.minimized {
    color: #fff;
}


/* Light Theme Overrides for Alerts */
[data-theme="light"] .kurs-alert.danger {
    color: var(--color-danger);
    background: rgba(211, 47, 47, 0.1);
}

[data-theme="light"] .kurs-alert.success {
    color: var(--color-success);
    background: rgba(56, 142, 60, 0.1);
}

[data-theme="light"] .kurs-alert.info {
    color: var(--color-info);
    background: rgba(25, 118, 210, 0.1);
}

/* Light Theme Override for Platform Badge */
[data-theme="light"] .kurs-stop-platform {
    background: var(--color-surface);
    color: var(--color-text-main);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .stop-platform {
    background: var(--color-surface);
    color: var(--color-text-main);
    border: 1px solid var(--border-color);
}

/* OpenLayers overrides */
.ol-control {
    display: none !important;
}

.btn-recenter {
    position: absolute;
    top: calc(100vh - 120px);
    right: 16px;
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    color: var(--color-primary);
    border: 1px solid var(--border-color);
    padding: 11px 17px;
    border-radius: 22px;
    font-size: 17px;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
}

.btn-recenter.visible {
    opacity: 1;
    pointer-events: auto;
}

.btn-recenter:active {
    transform: scale(0.95);
    background-color: var(--color-surface-active);
}

.ol-attribution {
    display: none !important;
}

/* --- MODAL (SERVICE DAY & EXIT) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--color-surface);
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.btn-back-float {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: var(--color-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    cursor: pointer;
    color: var(--color-text-main);
    border: 1px solid var(--border-color);
}


/* max-width: 400px;
border-radius: 16px;
padding: 20px;
border: 1px solid var(--border-color);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
transform: scale(0.9);
transition: transform 0.3s;
max-height: 80vh;
display: flex;
flex-direction: column;
} */

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--color-primary);
}

.modal-header h4 {
    font-size: 1rem;
    color: var(--color-text-main);
}

.modal-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-item {
    padding: 12px;
    background: rgba(125, 125, 125, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-item:active {
    background: var(--color-surface-active);
}

.modal-item.selected {
    border: 1px solid var(--color-primary);
    background: var(--color-primary-dim);
}

.btn-close {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--color-text-dim);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

/* Custom styles for Exit Modal */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-confirm {
    flex: 1;
    background: var(--color-primary);
    color: #000;
    border: none;
    font-weight: 700;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-cancel {
    flex: 1;
    background: var(--color-surface-active);
    color: var(--color-text-main);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* --- DASHBOARD --- */
.dashboard-welcome h2 {
    font-size: 1.5rem;
    color: var(--color-text-main);
    margin-bottom: 5px;
}

.dashboard-welcome p {
    color: var(--color-text-dim);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.service-day-info {
    background: var(--color-primary-dim);
    color: var(--color-primary);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.dash-card {
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    aspect-ratio: 1/1;
    transition: var(--transition);
    cursor: pointer;
}

.dash-card:active {
    transform: scale(0.96);
    background: var(--color-surface-active);
}

.dash-card svg {
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
    color: var(--color-primary);
}

.dash-card span {
    font-weight: 600;
    font-size: 0.95rem;
}

/* --- NEW BRYGADY VIEW CSS --- */
.line-section {
    margin-bottom: 20px;
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.line-header {
    padding: 12px 15px;
    background: rgba(125, 125, 125, 0.05);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.line-icon-box {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: #000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
}

.line-icon-box svg {
    width: 24px;
    height: 24px;
    fill: #000;
}

.line-number {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-text-main);
}

.line-brigades-scroll {
    display: flex;
    overflow-x: auto;
    padding: 15px;
    gap: 10px;
    scrollbar-width: thin;
}

.line-brigades-scroll::-webkit-scrollbar {
    height: 4px;
}

.line-brigades-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.brigade-square {
    flex: 0 0 70px;
    height: 70px;
    background: var(--color-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.brigade-square:active {
    background: var(--color-surface-active);
    border-color: var(--color-primary);
}

.brigade-square.active-vehicle {
    border-color: var(--color-success);
    background: rgba(76, 175, 80, 0.1);
}

.bs-id {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text-main);
    padding: 0 10px;
    inline-size: max-content;
}

.bs-vehicle-num {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 0.75rem;
    color: var(--color-success);
    font-weight: 700;
    background: rgba(0, 0, 0, 0.4);
    padding: 1px 4px;
    border-radius: 4px;
}

[data-theme="light"] .bs-vehicle-num {
    background: transparent;
}

/* --- LISTY I ELEMENTY --- */
.page-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--color-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-main);
    font-size: 1.2rem;
    font-weight: 700;
}

.search-bar {
    width: 100%;
    padding: 14px;
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    color: var(--color-text-main);
    border-radius: 12px;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.search-bar:focus {
    outline: none;
    border-color: var(--color-primary);
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    background: var(--color-surface);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}

.list-item:active {
    transform: scale(0.98);
}

.list-item.active {
    border-left-color: var(--color-primary);
}

.item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-title {
    font-weight: 600;
    font-size: 1rem;
}

.item-subtitle {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

.item-meta {
    font-size: 0.9rem;
    color: var(--color-primary);
    font-weight: 500;
    text-align: right;
}

.item-meta small {
    display: block;
    color: var(--color-text-dim);
    font-size: 0.75rem;
    font-weight: 400;
}

.lines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.line-box {
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--color-text-main);
    cursor: pointer;
}

.line-box:active {
    background: var(--color-primary);
    color: #000;
}

.loader {
    display: none;
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-surface);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    color: var(--color-text-dim);
    padding: 40px;
    display: none;
}

.btn {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn:active {
    background: var(--color-primary-dim);
}

/* --- SZCZEGÓŁY BRYGADY (TIMELINE) --- */
.brigade-info-card {
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.brigade-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.brigade-info-label {
    color: var(--color-text-dim);
}

.brigade-info-value {
    font-weight: 600;
    color: var(--color-text-main);
}

.actual-status {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    color: var(--color-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.timeline-container {
    position: relative;
    padding-bottom: 40px;
}

/* Trip Card */
.trip-card {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 0;
    /* Margines realizowany przez gap w flex containerze */
    position: relative;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    display: block;
}

.trip-card.active-trip {
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(253, 216, 53, 0.15);
}

.trip-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.trip-line-badge {
    background: #fff;
    color: #000;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 1.1rem;
    flex-shrink: 0;
    /* badge linii zawsze pełnej szerokości */
}

.trip-direction {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-main);
    min-width: 0;
    /* pozwól się kurczyć, by długa krańcówka nie rozpychała kafelka */
    overflow-wrap: anywhere;
    /* łam długie nazwy zamiast poziomego przewijania */
    text-align: center;
}

.trip-times {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    align-items: center;
}

.time-group {
    text-align: center;
    flex: 1;
    min-width: 0;
    /* Allow truncation */
    padding: 0 5px;
}

.time-val {
    font-size: 1.2rem;
    font-weight: 700;
    display: block;
    color: var(--color-text-main);
}

.stop-val {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trip-duration-arrow {
    flex: 1;
    width: 40px;
    height: 2px;
    background: #333;
    margin: 0 5px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.trip-duration-arrow span {
    background: var(--color-surface);
    padding: 0 5px;
    color: var(--color-text-dim);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Responsive Vertical Layout for Small Screens */
@media (max-width: 480px) {
    .trip-times {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .trip-duration-arrow {
        width: auto;
        flex: 0 0 auto;
    }

    .time-group {
        text-align: left;
        display: grid;
        grid-template-columns: 50px 1fr;
        align-items: center;
        gap: 10px;
        padding: 0;
    }

    .time-val {
        text-align: right;
        font-size: 1.1rem;
    }

    .stop-val {
        white-space: normal;
        overflow: visible;
        overflow-wrap: anywhere;
        text-align: left;
        font-size: 0.95rem;
        padding-left: 10px;
    }
}

.trip-meta {
    background: rgba(125, 125, 125, 0.1);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.8rem;
    color: var(--color-text-dim);
    display: flex;
    justify-content: space-between;
}

/* Break / Gap */
.timeline-break {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
    color: var(--color-text-dim);
    font-size: 0.85rem;
    gap: 10px;
}

.break-badge {
    background: rgba(33, 150, 243, 0.15);
    color: #64b5f6;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.technical-badge {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.placeholder-content {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-dim);
}

/* --- TIMETABLE / ROZKŁAD JAZDY (NEW CSS) --- */
.timetable-direction-card {
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-bottom: 20px;
}

.timetable-direction-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.timetable-stop-row {
    padding: 10px 5px;
    border-bottom: 1px solid rgba(125, 125, 125, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.timetable-stop-row:last-child {
    border-bottom: none;
}

.timetable-stop-row:active {
    background: var(--color-surface-active);
}

/* Styl dla przystanków wariantowych */
.timetable-stop-row.variant-stop {
    padding-left: 15px;
    border-left: 3px solid var(--color-text-dim);
    font-style: italic;
    background: rgba(125, 125, 125, 0.05);
}

.timetable-stop-row.variant-stop span:first-child {
    color: var(--color-text-dim);
}

.stop-platform {
    background: #333;
    color: #aaa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Grid godzinowy */
.timetable-header-info {
    text-align: center;
    margin-bottom: 20px;
}

.timetable-header-info h2 {
    font-size: 1.5rem;
    color: var(--color-text-main);
}

.timetable-header-info h3 {
    font-size: 1.1rem;
    color: var(--color-text-dim);
    font-weight: 400;
}

.timetable-grid {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.timetable-row {
    border-bottom: 1px solid var(--border-color);
    display: flex;
}

.timetable-row:last-child {
    border-bottom: none;
}

.timetable-hour-cell {
    width: 50px;
    background: rgba(125, 125, 125, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.timetable-minutes-cell {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.minute-box {
    padding: 4px 6px;
    background: transparent;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
    display: inline-flex;
    align-items: flex-start;
}

.minute-box:active {
    background: var(--color-primary-dim);
    color: var(--color-primary);
}

.minute-sup {
    font-size: 0.6rem;
    color: var(--color-text-dim);
    margin-left: 2px;
    vertical-align: super;
}

.minute-variant {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-left: 2px;
}

.timetable-legend,
.timetable-brigades {
    margin-top: 20px;
    padding: 15px;
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--color-text-dim);
}

.legend-item {
    margin-bottom: 5px;
}

.brigade-item {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.brigade-link {
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

/* --- KURS / TRIP DETAIL CSS --- */
.kurs-info-card {
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 25px;
}

.kurs-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.kurs-meta-item {
    display: flex;
    flex-direction: column;
}

.kurs-meta-label {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

.kurs-meta-val {
    font-weight: 600;
    font-size: 0.95rem;
}

.kurs-alert {
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #fff;
}

.kurs-alert.danger {
    background: rgba(239, 83, 80, 0.2);
    border: 1px solid var(--color-danger);
    color: #ffcdd2;
}

.kurs-alert.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid var(--color-success);
    color: #c8e6c9;
}

.kurs-alert.info {
    background: rgba(33, 150, 243, 0.2);
    border: 1px solid var(--color-info);
    color: #bbdefb;
}

.kurs-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.kurs-btn {
    flex: 1;
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
    background: rgba(125, 125, 125, 0.1);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-wrap-mode: nowrap;
}

.kurs-btn:active {
    background: var(--color-surface-active);
}

.kurs-timeline {
    position: relative;
    padding-left: 20px;
    border-left: 3px solid var(--border-color);
    margin-left: 15px;
    margin-top: 20px;
}

.kurs-stop-row {
    position: relative;
    padding: 15px 0 15px 15px;
    border-bottom: 1px solid rgba(125, 125, 125, 0.1);
    display: flex;
    align-items: baseline;
}

.kurs-stop-row:last-child {
    border-bottom: none;
}

.kurs-stop-marker {
    position: absolute;
    left: -28px;
    top: 20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 3px solid var(--border-color);
    z-index: 2;
}

.busicon-live {
    position: absolute;
    left: -35px;
    top: 12px;
    width: 30px;
    height: 30px;
    background: var(--color-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 0 10px var(--color-success);
    display: none;
}

.busicon-live svg {
    width: 18px;
    height: 18px;
    fill: #000;
}

.kurs-stop-time {
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 10px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.kurs-stop-name {
    font-size: 1rem;
    flex: 1;
    min-width: 0;
    /* pozwól kurczyć się w flexie, by stanowisko nie było wypychane poza wiersz */
    overflow-wrap: anywhere;
    /* łam bardzo długie nazwy przystanków zamiast rozpychać wiersz */
    padding-right: 10px;
}

.kurs-stop-platform {
    background: #333;
    color: #aaa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    flex-shrink: 0;
    align-self: center;
}

.kurs-stop-badge {
    background: #333;
    color: #aaa;
    padding: 0px 6px;
    flex-shrink: 0;
    align-self: center;
    display: inline-block;
    vertical-align: text-bottom;
    margin-bottom: 5px;
    line-height: 1.3;
    font-variant: small-caps;
    font-size: 1.2rem;
    font-weight: bold;
}

.kurs-stop-badge.technical {
    padding: 3px 6px 0 6px;
    background: var(--color-primary);
    margin-top: 4px;
}

.kurs-stop-badge.nz {
    background: var(--color-danger);
    color: #fff;
}

.kurs-stop-row.skipped {
    opacity: 0.5;
    text-decoration: line-through;
}

.kurs-stop-row.technical {
    opacity: 0.5;
}

.kurs-stop-row.variant {
    color: var(--color-success);
}

.live-location-box {
    margin-top: 15px;
    padding: 10px;
    background: rgba(76, 175, 80, 0.15);
    border-radius: 8px;
    border: 1px solid var(--color-success);
    display: none;
}

/* --- POJAZD SZCZEGÓŁY / VEHICLE DETAIL CSS (NEW) --- */
#pojazd-detail-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

@media (min-width: 768px) {
    #pojazd-detail-content {
        flex-direction: row;
        align-items: flex-start;
    }

    #vehicle-card-block {
        flex: 0 0 50%;
        max-width: 500px;
        position: sticky;
        top: 20px;
    }

    .vehicle-history-container {
        flex: 1;
    }
}

.brigade-history-day-header {
    font-weight: bold;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    width: 100%;
    margin-bottom: 10px;
    color: var(--color-primary);
}

.brigade-history-entry {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}

.brigade-history-entry:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.brigade-history-entry-title {
    flex: 1;
}

.brigade-history-entry-time {
    text-align: right;
    flex-shrink: 0;
}

.brigade-history-entry-details {
    font-weight: normal;
    font-size: 0.9rem;
    color: var(--color-text-dim);
    margin-top: 4px;
    line-height: 1.4;
}

.vehicle-photo-container {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.vehicle-photo-container img {
    max-width: 100%;
    height: auto;
    max-height: 200px;
}

.vehicle-brand-model {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-main);
    text-align: center;
    margin-bottom: 25px;
}

.vehicle-plate-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 15px;
}

.vehicle-identity {
    display: flex;
    flex-direction: column;
}

.vehicle-side-number {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--color-text-main);
}

.vehicle-operator {
    font-size: 0.95rem;
    color: var(--color-text-dim);
    margin-top: 5px;
}

.vehicle-registration-plate {
    display: flex;
    align-items: center;
    border: 2px solid #000;
    border-radius: 4px;
    background: #fffc;
    color: #000;
    font-family: monospace;
    font-size: 1.2rem;
    letter-spacing: 1px;
    padding: 0;
    overflow: hidden;
}

.vehicle-registration-plate::before {
    content: "PL";
    background: #003399;
    color: #fff;
    font-size: 0.7rem;
    padding: 10px 4px;
    display: inline-flex;
    align-items: end;
    margin-right: 8px;
}

.vehicle-registration-text {
    padding-right: 8px;
    font-weight: bold;
}

.vehicle-status-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    align-items: flex-start;
}

@media (min-width: 480px) {
    .vehicle-status-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.vehicle-status-text {
    font-size: 1rem;
    color: var(--color-text-dim);
    max-width: 70%;
    flex: 2;
}

.vehicle-status-text.online {
    color: var(--color-success);
    font-weight: bold;
}

.btn-vehicle-details {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--color-text-main);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-vehicle-details:hover {
    background: var(--color-surface-hover);
}

.vehicle-meta-collapsed {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.vehicle-meta-collapsed.open {
    display: grid;
}

.vehicle-history-title-new {
    margin: 0 0 15px 0;
    font-weight: bold;
    color: var(--color-text-dim);
    font-size: 1.1rem;
}

.vehicle-history-item {
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-bottom: 10px;
}

.vehicle-history-online {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid var(--color-success);
}

.vehicle-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.vehicle-history-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-main);
}

.vehicle-history-date {
    font-size: 0.85rem;
    color: var(--color-text-dim);
    text-align: right;
}

.vehicle-history-route {
    font-size: 0.9rem;
    color: var(--color-text-dim);
    line-height: 1.4;
}

.vehicle-history-link {
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

.vehicle-status-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 4px;
    margin-top: 8px;
    font-weight: 600;
}

.status-online-badge {
    background: var(--color-success);
    color: #000;
}

/* --- PILOT SPEED GAUGE --- */
/* prędkość = kompaktowy kafel na pasku akcji (JS steruje display flex/none — bez zmian) */
.pilot-speed-box {
    display: none;
    /* Changed via JS */
    cursor: default;
    color: var(--color-text-main);
}

.pilot-speed-box .pilot-speed-val {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1;
}

.pilot-speed-box .pilot-speed-unit {
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: .5px;
    margin-top: 2px;
    text-transform: uppercase;
    color: var(--color-text-dim);
}

.pilot-warning-bar {
    position: absolute;
    top: calc(max(10px, env(safe-area-inset-top)) + 182px);
    /* niżej pod kartą HUD; z-index 90 = nad paskiem akcji */
    left: 12px;
    right: 12px;
    border-radius: 12px;
    background: #ff9800;
    /* Orange */
    color: #000;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px;
    z-index: 90;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #e65100;
}

.pilot-warning-bar svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* --- PILOT POPUP CSS --- */
.pilot-stop-popup {
    position: absolute;
    background-color: var(--color-surface);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    min-width: 200px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    z-index: 1000;
    transform: translate(-50%, calc(-100% - 15px));
}

.pilot-stop-popup.active {
    opacity: 1;
    pointer-events: auto;
}

.pilot-stop-popup:after,
.pilot-stop-popup:before {
    top: 100%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}

.pilot-stop-popup:after {
    border-color: rgba(255, 255, 255, 0);
    border-top-color: var(--color-surface);
    border-width: 10px;
    left: 50%;
    margin-left: -10px;
}

.pilot-stop-popup:before {
    border-color: rgba(0, 0, 0, 0);
    border-top-color: var(--border-color);
    border-width: 11px;
    left: 50%;
    margin-left: -11px;
}

.popup-close-btn {
    text-decoration: none;
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 1.2rem;
    color: var(--color-text-dim);
    font-weight: bold;
}

.popup-close-btn:hover {
    color: var(--color-text-main);
}

.popup-stop-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text-main);
    margin-bottom: 8px;
    padding-right: 15px;
}

.popup-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.popup-stop-platform {
    display: inline-block;
    background: var(--color-surface-active);
    color: var(--color-text-dim);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.popup-stop-time {
    font-weight: bold;
    color: var(--color-primary);
    font-size: 1.1rem;
}

/* --- PILOT SEARCH CUSTOM CSS --- */
.pilot-search-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.pilot-input-group {
    position: relative;
}

.pilot-input-group input {
    margin-bottom: 0;
    width: 100%;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    display: none;
}

.autocomplete-item {
    padding: 12px;
    border-bottom: 1px solid rgba(125, 125, 125, 0.1);
    cursor: pointer;
}

.autocomplete-item:active {
    background: var(--color-surface-active);
}

.autocomplete-item strong {
    color: var(--color-primary);
}

.pilot-choice-card {
    background: var(--color-surface);
    border: 1px solid var(--color-primary);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    text-align: center;
    animation: fadeIn 0.3s;
}

.pilot-choice-header {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--color-text-main);
}

.pilot-main-action {
    display: block;
    width: 100%;
    background: var(--color-primary);
    color: #000;
    font-weight: 700;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.pilot-main-action small {
    display: block;
    font-weight: 400;
    font-size: 0.85rem;
    margin-top: 4px;
}

.pilot-secondary-action {
    display: inline-block;
    color: var(--color-text-dim);
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- NAV --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
    transition: transform 0.3s ease, background-color 0.3s;
    backdrop-filter: blur(10px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-dim);
    font-size: 0.7rem;
    gap: 4px;
    width: 100%;
    height: 100%;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-item.active svg {
    fill: var(--color-primary-dim);
}

/* NEW HERO BANNER STYLE */
.hero-banner {
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-active) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.hero-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    color: var(--color-text-dim);
}

.hero-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--color-text-main);
}

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-dim);
}

/* --- ZMODYFIKOWANY BANER GRAFIKU --- */
.hero-banner.planner-mode {
    display: block;
    text-align: left;
    cursor: default;
    padding: 20px;
}

.planner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.hero-icon.small {
    margin-bottom: 0;
    width: 32px;
    height: 32px;
}

/* Sekcje Dnia */
.planner-day-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(125, 125, 125, 0.2);
}

.planner-day-section:last-of-type {
    border-bottom: none;
    margin-bottom: 5px;
    padding-bottom: 0;
}

.day-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-dim);
    margin-bottom: 8px;
    font-weight: 600;
}

/* Stan Pusty */
.planner-empty-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.empty-text-group {
    display: flex;
    flex-direction: column;
}

.empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-main);
}

.empty-desc {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

.btn-planner-add {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--color-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

/* Stan Aktywny (Active Brigade) */
.planner-active-content {
    display: none;
    /* Domyślnie ukryte, JS to włączy */
}

.active-brigade-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.active-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-text-main);
    line-height: 1;
}

.active-operator {
    font-size: 0.85rem;
    color: var(--color-text-dim);
    margin-top: 4px;
}

.active-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-active-primary {
    background: var(--color-primary);
    color: #000;
    border: none;
    padding: 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-active-secondary {
    background: transparent;
    color: var(--color-text-main);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.planner-footer-link {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-primary);
    cursor: pointer;
    margin-top: 15px;
    padding-top: 10px;
}

.profile-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-text-main);
    margin-bottom: 5px;
}

.profile-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-dim);
}

/* Siatka akcji 2x1 */
.profile-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.action-card {
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    min-height: 120px;
}

.action-card:active {
    transform: scale(0.96);
    background: var(--color-surface-active);
}

/* Style wariantów kart */
.action-card.primary {
    background: var(--color-primary);
    color: #000;
    border: none;
}

.action-card.primary .action-icon {
    color: #000;
}

.action-card.primary .action-label {
    color: #000;
    font-weight: 800;
}

.action-card.outline {
    border: 2px solid var(--border-color);
    background: transparent;
}

.action-card.gold {
    background: linear-gradient(135deg, #FFD700, #FDB931);
    color: #000;
    border: none;
}

.action-card.gold .action-label {
    color: #000;
    font-weight: 800;
}

.action-icon {
    margin-bottom: 10px;
    color: var(--color-primary);
}

.action-label {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}

/* Linki na pełną szerokość */
.full-width-link {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--color-text-main);
}

.full-width-link:last-child {
    border-bottom: none;
}

.full-width-link:active {
    background: var(--color-surface-active);
}

.full-width-link.danger {
    color: var(--color-danger);
}

.profile-footer {
    text-align: center;
    margin: 40px 0 20px 0;
    font-size: 0.75rem;
    color: var(--color-text-dim);
    opacity: 0.6;
}

/* --- ONBOARDING --- */
.ob-source-grid {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 10px;
    gap: 5px;
}

.ob-source-btn {
    cursor: pointer;
    text-align: center;
    padding: 10px;
    border: 2px solid var(--border-color);
    user-select: none;
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
    color: var(--color-text-main);
    margin-bottom: 0px;
}

.ob-source-btn.selected {
    border-color: var(--color-primary);
    background: rgba(255, 200, 0, 0.15);
}

.ob-save-btn {
    background: var(--color-primary) !important;
    color: #000 !important;
    font-weight: bold;
}

.ob-modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.ob-header-title {
    font-size: 1.4rem;
}

.ob-desc {
    color: var(--color-text-dim);
    margin-top: 10px;
    line-height: 1.4;
    text-align: left;
}

.ob-form-group {
    margin-top: 20px;
    text-align: left;
}

.ob-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--color-text-dim);
}

.ob-input-container {
    margin-top: 5px;
}

.ob-input {
    width: 100%;
}

.ob-actions {
    margin-top: 30px;
}

/* --- TABS --- */
.tabs-container {
    display: flex;
    background: var(--color-surface);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--color-text-dim);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--color-primary);
    color: #000;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- PLATFORM MODAL --- */
.platform-list-item {
    margin-bottom: 8px;
    padding: 12px;
    background: var(--color-surface);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.platform-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.platform-item-title {
    color: var(--color-text-main);
    font-weight: bold;
}

.platform-item-subtitle {
    color: var(--color-text-dim);
    font-size: 0.85rem;
}

.platform-item-arrow {
    color: var(--color-text-dim);
    align-self: center;
}

.platform-lines-container {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.platform-line-item {
    font-size: 0.85rem;
    color: var(--color-text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.platform-line-badge {
    background: var(--color-primary);
    color: #000;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    min-width: 28px;
    text-align: center;
}

.platform-no-data {
    color: var(--color-text-dim);
    font-size: 0.8rem;
    margin-top: 8px;
}

.platform-error {
    color: var(--color-danger);
    text-align: center;
    padding: 10px;
}

/* --- TABLICA PRZYSTANKOWA / ODJAZDY --- */
.departure-list-item {
    padding: 12px;
    text-decoration: none;
}

.departure-list-item.departure-departed {
    opacity: 0.5;
}

.departure-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.departure-badge {
    font-size: 1.1rem;
    padding: 6px 10px;
    min-width: 45px;
}

.departure-info {
    flex: 1;
}

.departure-headsign {
    font-weight: bold;
    color: var(--color-text-main);
    font-size: 1.1rem;
}

.departure-time-left {
    color: var(--color-primary);
    font-size: 0.85rem;
}

.departure-times {
    text-align: right;
}

.departure-main-time {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--color-text-main);
}

.departure-main-time.realtime {
    color: var(--color-primary);
}

.departure-delay {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    line-height: 1.35;
}

/* Kolory (tło+tekst) plakietki opóźnienia dziedziczą ze współdzielonych .delay-late/.delay-early/
   .delay-ok — ta sama paleta co pilot: spóźniony=niebieski, wcześniejszy=czerwony, OK=zielony.
   Różnica względem pilota jest tylko w ZNAKU (u pasażera opóźnienie to +, w JS). Wcześniej
   .departure-delay.delay-late/early nadpisywał sam TEKST na odwrotny (danger/info) → niebieskie tło
   z czerwonym tekstem i na odwrót ("rozjechana kolorystyka") — usunięte. */
[data-theme="light"] .departure-delay.delay-late {
    background: rgba(21, 101, 192, 0.16);
    color: #1565c0;
}

/* --- TABLICA PRZYSTANKOWA / ROZKŁADY --- */
.timetable-empty {
    padding: 20px;
    text-align: center;
    color: var(--color-text-dim);
}

.timetable-section {
    margin-bottom: 30px;
}

.timetable-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.timetable-badge {
    font-size: 1.2rem;
    padding: 4px 10px;
}

.timetable-headsign-container {
    display: flex;
    flex-direction: column;
}

.timetable-headsign {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--color-text-main);
    line-height: 1.2;
}

.timetable-platform {
    font-size: 0.85rem;
    color: var(--color-text-dim);
}

.timetable-variants-list {
    margin-top: 10px;
    font-size: 0.85rem;
}

.timetable-variant-item {
    margin-bottom: 4px;
}

.variant-letter {
    color: var(--color-primary);
}

/* --- TABLICA PRZYSTANKOWA / LEGENDA --- */
.legend-header {
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--color-text-main);
}

.legend-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
}

.legend-btn-small {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--color-text-dim);
    cursor: pointer;
}

/* --- ULUBIONE (gwiazdka + widok) --- */
.fav-star {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    margin-left: 12px;
    cursor: pointer;
    color: var(--color-text-dim);
    flex-shrink: 0;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
}
.fav-star svg { width: 26px; height: 26px; display: block; transition: var(--transition); }
.fav-star.is-fav { color: #f5b301; }
.fav-star.is-fav svg { fill: #f5b301; stroke: #f5b301; }
.fav-star:active { transform: scale(0.8); }

.fav-group { margin-bottom: 26px; }
.fav-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-text-main);
    margin: 0 2px 12px;
}
.fav-group-title svg { width: 20px; height: 20px; color: var(--color-primary); flex-shrink: 0; }
.fav-group-title .fav-count {
    color: var(--color-text-dim);
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1px 8px;
}
.fav-brigades-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.fav-lines-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.fav-list { display: flex; flex-direction: column; gap: 10px; }
.fav-item { position: relative; }
.fav-empty-global { text-align: center; color: var(--color-text-dim); padding: 50px 20px; }
.fav-empty-global svg { width: 52px; height: 52px; opacity: 0.35; margin-bottom: 14px; }
.fav-empty-global p { margin: 6px 0; }


/* --- SELEKTOR STANOWISKA (widok przystanku) --- */
.platform-selector {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.platform-selector-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
.platform-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.platform-chips::-webkit-scrollbar { display: none; }
.platform-chip {
    flex: 0 0 auto;
    min-width: 42px;
    padding: 7px 12px;
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--color-text-main);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}
.platform-chip.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #000;
}
.platform-chip:active { transform: scale(0.94); }
.platform-chip-all { font-weight: 800; padding-left: 14px; padding-right: 14px; }

/* ===== MAPA LIVE ===== */
#view-mapa { padding: 0; }
#mapa-container { position: absolute; inset: 0; background: var(--color-bg); }
#mapa-container .ol-attribution { font-size: 10px; opacity: .65; }
#mapa-container .ol-attribution ul { text-shadow: none; }

.mapa-topbar {
    position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 0 14px 0 64px; z-index: 15; pointer-events: none;
}
.mapa-live-pill {
    display: inline-flex; align-items: center;
    background: var(--color-surface); color: var(--color-text-main);
    border: 1px solid var(--border-color); border-radius: 999px;
    padding: 6px 13px; font-size: .8rem; font-weight: 800; letter-spacing: .02em;
    box-shadow: 0 4px 14px rgba(0,0,0,.25); pointer-events: auto;
}
.mapa-live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #e53935; margin-right: 7px;
    box-shadow: 0 0 0 0 rgba(229,57,53,.6); animation: mapa-pulse 1.7s infinite;
}
@keyframes mapa-pulse {
    0% { box-shadow: 0 0 0 0 rgba(229,57,53,.55); }
    70% { box-shadow: 0 0 0 7px rgba(229,57,53,0); }
    100% { box-shadow: 0 0 0 0 rgba(229,57,53,0); }
}
.mapa-legend {
    display: flex; gap: 10px; background: var(--color-surface);
    border: 1px solid var(--border-color); border-radius: 999px;
    padding: 5px 11px; font-size: .72rem; color: var(--color-text-dim);
    box-shadow: 0 4px 14px rgba(0,0,0,.25); pointer-events: auto;
}
.mapa-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.mapa-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
/* #1 wyszukiwarka linii/wozow na mapie */
.mapa-search { position: relative; flex: 1 1 190px; max-width: 420px; min-width: 130px; pointer-events: auto; }
.mapa-search input { width: 100%; box-sizing: border-box; background: var(--color-surface); color: var(--color-text-main); border: 1px solid var(--border-color); border-radius: 999px; padding: 8px 15px; font-size: .85rem; box-shadow: 0 4px 14px rgba(0,0,0,.25); outline: none; }
.mapa-search input::placeholder { color: var(--color-text-dim); }
.mapa-search input:focus { border-color: var(--color-primary); }
.mapa-search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--color-surface); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.35); max-height: min(60vh, 360px); overflow-y: auto; -webkit-overflow-scrolling: touch; display: none; }
.mapa-search-results.open { display: block; }
.mapa-search-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border-color); }
.mapa-search-row:last-child { border-bottom: none; }
.mapa-search-row:hover, .mapa-search-row:active { background: var(--color-surface-active); }
.mapa-search-badge { flex: 0 0 auto; min-width: 38px; text-align: center; font-weight: 800; color: #fff; border-radius: 7px; padding: 3px 7px; font-size: .85rem; }
.mapa-search-main { flex: 1 1 auto; min-width: 0; }
.mapa-search-dest { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapa-search-sub { font-size: .72rem; color: var(--color-text-dim); }
.mapa-search-empty { padding: 14px; text-align: center; color: var(--color-text-dim); font-size: .85rem; }
.mapa-search-hdr { padding: 8px 12px 4px; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-dim); font-weight: 700; }
.mapa-search-badge.stop { background: #0b3d91; display: inline-flex; align-items: center; justify-content: center; }
.mapa-search-chev { flex: 0 0 auto; color: var(--color-text-dim); font-size: 1.3rem; line-height: 1; padding-right: 2px; }
.mapa-search-back { padding: 9px 12px; cursor: pointer; color: var(--color-primary); font-weight: 700; font-size: .8rem; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; background: var(--color-surface); z-index: 1; }
.mapa-search-back:hover { background: var(--color-surface-active); }
.mapa-search-row.platform { align-items: flex-start; }
@media (max-width: 520px) { .mapa-search { flex-basis: 100%; order: 3; max-width: none; } }
@media (max-width: 520px) {
    .mapa-topbar { flex-wrap: wrap; justify-content: flex-start; gap: 6px; padding-left: 60px; padding-right: 12px; }
    .mapa-legend { gap: 7px; padding: 4px 9px; font-size: .64rem; }
    .mapa-legend i { width: 8px; height: 8px; }
}

.mapa-recenter {
    position: absolute; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--color-surface); color: var(--color-primary);
    border: 1px solid var(--border-color); box-shadow: 0 4px 16px rgba(0,0,0,.3);
    display: none; align-items: center; justify-content: center; z-index: 16; cursor: pointer;
}
.mapa-recenter.visible { display: flex; }
.mapa-recenter:active { transform: scale(0.92); }

/* bottom sheet — poza stackingiem widoku (fixed), nad dolną nawigacją (z-index 200) */
.mapa-sheet-backdrop {
    position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.3);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.mapa-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.mapa-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 3001;
    background: var(--color-surface); border-top: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0; box-shadow: 0 -12px 34px rgba(0,0,0,.4);
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(115%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
    max-height: 72%; overflow-y: auto;
}
.mapa-sheet.open { transform: translateY(0); }
.mapa-sheet-grip { width: 40px; height: 4px; border-radius: 3px; background: var(--border-color); margin: 4px auto 12px; }

.mapa-sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.mapa-sheet-titles { flex: 1 1 auto; min-width: 0; }
.mapa-sheet-title { font-size: 1.1rem; font-weight: 800; color: var(--color-text-main); overflow-wrap: anywhere; }
.mapa-sheet-sub { font-size: .82rem; color: var(--color-text-dim); margin-top: 2px; overflow-wrap: anywhere; }
.mapa-sheet-x { font-size: 1.7rem; line-height: 1; color: var(--color-text-dim); cursor: pointer; padding: 0 4px; flex: 0 0 auto; }
.mapa-line-badge {
    flex: 0 0 auto; min-width: 46px; height: 42px; padding: 0 11px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.02rem; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.mapa-line-badge.stop { background: #0b3d91; min-width: 42px; }

.mapa-sheet-row { margin: 2px 0 12px; }
.mapa-delay { display: inline-block; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: .86rem; }
.mapa-delay.late { background: rgba(239,83,80,.16); color: var(--color-danger); }
.mapa-delay.early { background: rgba(76,175,80,.16); color: var(--color-success); }
.mapa-delay.ontime { background: var(--color-primary-dim); color: var(--color-primary); }
.mapa-delay.technical { background: rgba(255,152,0,.16); color: #ff9800; }
.mapa-delay.offroute { background: rgba(255,87,34,.16); color: #ff5722; }
.mapa-delay.sdip { background: var(--color-surface-active); color: var(--color-text-dim); }

.mapa-sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mapa-btn {
    flex: 1 1 auto; min-width: 130px; padding: 12px 14px; border-radius: 12px; border: none;
    background: var(--color-primary); color: #000; font-weight: 700; font-size: .9rem; cursor: pointer;
}
.mapa-btn.ghost { background: transparent; color: var(--color-primary); border: 1.5px solid var(--color-primary); }
.mapa-btn:active { transform: scale(0.97); }

.mapa-dep-list { margin: 4px 0 14px; display: flex; flex-direction: column; }
.mapa-dep-loading, .mapa-dep-empty { color: var(--color-text-dim); font-size: .9rem; padding: 14px 2px; text-align: center; }
.mapa-dep-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border-color); }
.mapa-dep-row:last-child { border-bottom: none; }
.mapa-dep-row.clickable { cursor: pointer; transition: background .15s; }
.mapa-dep-row.clickable:hover { background: var(--color-surface-active); }
.mapa-dep-row.clickable:active { background: var(--color-surface-active); }
.mapa-dep-line { flex: 0 0 auto; min-width: 44px; text-align: center; font-weight: 800; background: var(--color-surface-active); border-radius: 7px; padding: 5px 6px; font-size: .9rem; }
.mapa-dep-dest { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.mapa-dep-time { flex: 0 0 auto; text-align: right; font-weight: 800; font-size: 1rem; display: flex; flex-direction: column; line-height: 1.05; }
.mapa-dep-time small { font-weight: 500; font-size: .7rem; color: var(--color-text-dim); }
.mapa-dep-live { flex: 0 0 auto; font-size: .74rem; font-weight: 800; padding: 3px 6px; border-radius: 6px; }
.mapa-dep-live.late { background: rgba(239,83,80,.16); color: var(--color-danger); }
.mapa-dep-live.early { background: rgba(76,175,80,.16); color: var(--color-success); }
.mapa-dep-live.ontime { background: rgba(76,175,80,.12); color: var(--color-success); }

/* modal pojazdu — model, następny przystanek */
.mapa-veh-model { font-size: .9rem; color: var(--color-text-dim); margin: -2px 0 10px; font-weight: 600; }
.mapa-veh-next { font-size: 1rem; color: var(--color-text-main); margin: 0 0 12px; line-height: 1.4; }
.mapa-veh-next b { color: var(--color-primary); font-weight: 800; }
.mapa-veh-lbl { display: block; color: var(--color-text-dim); font-size: .72rem; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.mapa-dim { color: var(--color-text-dim); }

/* karta mapy: minimalizacja (peek-bar) + kontrolki nagłówka */
.mapa-sheet-grip {
    width: 100%; height: 22px; margin: 0 auto 4px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.mapa-sheet-grip::before {
    content: ""; width: 42px; height: 4px; border-radius: 3px; background: var(--border-color);
}
.mapa-sheet-ctrls { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; }
.mapa-sheet-ctrl {
    width: 34px; height: 34px; border: none; background: transparent; color: var(--color-text-dim);
    border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.mapa-sheet-ctrl:active { background: var(--color-surface-active); }
.mapa-sheet-ctrl.chev svg { transition: transform .25s ease; }
.mapa-sheet.min .mapa-sheet-ctrl.chev svg { transform: rotate(180deg); }
/* w stanie zwiniętym pokazujemy tylko nagłówek — tytuł/sub w jednej linii dla czystej belki */
.mapa-sheet.min .mapa-sheet-title,
.mapa-sheet.min .mapa-sheet-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* karta mapy: nagłówek = uchwyt gestu (przeciąganie palcem/myszą zwija/rozwija), bez widocznego gripa */
.mapa-sheet { padding-top: 14px; }
.mapa-sheet-head { touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.mapa-sheet-head .mapa-sheet-title, .mapa-sheet-head .mapa-sheet-sub { cursor: inherit; }
.mapa-sheet.dragging { transition: none; }
.mapa-sheet.dragging .mapa-sheet-head { cursor: grabbing; }
/* kontrolki i tytuły klikalne normalnie (nie „grab") */
.mapa-sheet-ctrl { cursor: pointer; }

/* legenda śladu przejechanej trasy (breadcrumb) w karcie pojazdu */
.mapa-trace-legend { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--color-text-dim); margin: 2px 0 12px; }
.mapa-trace-swatch { flex: 0 0 auto; width: 22px; height: 4px; border-radius: 3px; background: #ff2d78; box-shadow: 0 0 0 1.5px rgba(255,255,255,.85); }

/* pilot: przycisk podglądu trasy w trybie aktywnym (strzałka nawigacji) — akcent */
#rail-preview.rail-preview-active { color: var(--color-primary); }

/* --- Fotoradary / pomiary odcinkowe / redlight (GITD) — karta na mapie (tap markera) --- */
.cam-sign-badge {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
    background: #fff; border: 4px solid #e53935; color: #111;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.cam-sheet-msg { font-size: .98rem; color: var(--color-text-main); margin: 2px 0 10px; line-height: 1.4; }
.cam-sheet-msg b { color: var(--color-primary); font-weight: 800; }
.cam-sheet-dirs { font-size: .84rem; color: var(--color-text-dim); margin: 0 0 8px; overflow-wrap: anywhere; }

/* --- Pilot: karta dojazdowa fotoradaru (dane pewne — bez głosowania, jeden „Zamknij") --- */
.cam-card {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 3000;
    max-width: 560px; margin: 0 auto;
    background: var(--color-surface); border-top: 1px solid var(--border-color);
    border-radius: 22px 22px 0 0; box-shadow: 0 -12px 34px rgba(0,0,0,.55);
    padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(115%); transition: transform .32s cubic-bezier(.22,.61,.36,1);
}
.cam-card.open { transform: translateY(0); }
.cam-card-row { display: flex; align-items: center; gap: 14px; }
.cam-card-ico { flex: 0 0 auto; width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.cam-card-ico.rl { background: #e11d1d; }
.cam-card-ico.sign span {
    width: 58px; height: 58px; border-radius: 50%; background: #fff; border: 6px solid #e53935; color: #111;
    display: flex; align-items: center; justify-content: center; font-weight: 850; font-size: 1.5rem;
    font-variant-numeric: tabular-nums; box-shadow: 0 3px 10px rgba(0,0,0,.4);
}
.cam-card-titles { flex: 1 1 auto; min-width: 0; }
.cam-card-title { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--color-text-main); }
.cam-card-sub { font-size: .84rem; font-weight: 600; color: var(--color-text-dim); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-card-dist { flex: 0 0 auto; font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--color-text-main); white-space: nowrap; }
.cam-card-dist.near { color: #ff5252; }
.cam-card-dist small { font-size: .95rem; font-weight: 700; color: var(--color-text-dim); margin-left: 2px; }
.cam-card-close {
    width: 100%; margin-top: 16px; padding: 16px 10px; border-radius: 15px; font-size: 1.05rem; font-weight: 750;
    cursor: pointer; background: var(--color-surface-active); color: var(--color-text-main); border: 1px solid var(--border-color);
}
.cam-card-close:active { transform: scale(.98); }

/* --- Pilot: pasek pomiaru odcinkowego (pod HUD, węższy z prawej o kolumnę #pilot-rail) --- */
.cam-sec-strip {
    position: fixed; left: 12px; right: 88px;
    top: calc(max(10px, env(safe-area-inset-top)) + 244px); z-index: 46;
    background: var(--header-bg); border: 1px solid var(--border-color);
    border-radius: 14px; padding: 9px 12px; backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    display: flex; align-items: center; gap: 11px;
    opacity: 0; pointer-events: none; transform: translateY(-12px);
    transition: opacity .26s ease, transform .26s ease;
}
.cam-sec-strip.on { opacity: 1; pointer-events: auto; transform: translateY(0); }
.cam-sec-sign {
    width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
    background: #fff; border: 5px solid #e53935; color: #111;
    display: flex; align-items: center; justify-content: center; font-weight: 850; font-size: 1.05rem; font-variant-numeric: tabular-nums;
}
.cam-sec-mid { flex: 1 1 auto; min-width: 0; }
.cam-sec-lbl { font-size: .64rem; color: var(--color-text-dim); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.cam-sec-val { font-size: .8rem; color: var(--color-text-main); font-weight: 650; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-sec-val b.over { color: #ff5252; font-weight: 800; }
.cam-sec-avg { flex: 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; }
.cam-sec-avg .a { font-size: 1.35rem; font-weight: 850; line-height: 1; color: #4caf50; }
.cam-sec-avg .a.warn { color: #ffb300; }
.cam-sec-avg .a.bad { color: #ff5252; }
.cam-sec-avg .u { font-size: .58rem; color: var(--color-text-dim); font-weight: 700; }

/* --- Pilot: panel bliskości ZDARZENIA DROGOWEGO (crowd-sourced — Z GŁOSOWANIEM; bez kolorowego paska, sam cień) --- */
.hz-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 3000;
    max-width: 560px; margin: 0 auto;
    background: var(--color-surface); border-top: 1px solid var(--border-color);
    border-radius: 22px 22px 0 0; box-shadow: 0 -12px 34px rgba(0,0,0,.55);
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(115%); transition: transform .34s cubic-bezier(.22,.61,.36,1);
}
.hz-panel.open { transform: translateY(0); }
.hz-panel-x {
    position: absolute; top: 10px; right: 12px; width: 38px; height: 38px;
    border-radius: 11px; border: none; background: var(--color-surface-active); color: var(--color-text-dim);
    display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2;
}
.hz-panel-x:active { transform: scale(.92); }
.hz-panel-row { display: flex; align-items: center; gap: 14px; padding-right: 46px; }
.hz-panel-ico { flex: 0 0 auto; width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.hz-panel-titles { flex: 1 1 auto; min-width: 0; }
.hz-panel-title { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--color-text-main); }
.hz-panel-dist { flex: 0 0 auto; font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--color-text-main); white-space: nowrap; }
.hz-panel-dist small { font-size: .95rem; font-weight: 700; color: var(--color-text-dim); margin-left: 2px; }
.hz-panel-actions { display: flex; gap: 11px; margin-top: 15px; }
.hz-vote {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 15px 10px; border-radius: 15px; font-size: 1.02rem; font-weight: 750;
    cursor: pointer; border: 1px solid transparent;
}
.hz-vote:active { transform: scale(.97); }
.hz-yes { background: rgba(76,175,80,.16); color: #85dd93; border-color: rgba(76,175,80,.42); }
.hz-no  { background: rgba(239,83,80,.13); color: #f3a4a2; border-color: rgba(239,83,80,.4); }


/* --- Ostrzeżenie o oszustwie (fraud notice) --- */
.fn-modal { padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; max-height: calc(100% - 24px); }
.fn-band { background: #d32f2f; padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.fn-band .fn-ic { font-size: 1.25rem; }
.fn-band h3 { flex: 1; font-size: 1.15rem; font-weight: 800; color: #fff; margin: 0; }
.fn-band .fn-x { color: #fff; opacity: .85; font-size: 1.5rem; line-height: 1; text-decoration: none; }
.fn-body { overflow-y: auto; padding: 16px 17px 16px; }
.fn-lead { font-size: 1.1rem; font-weight: 800; color: var(--color-text-main); margin: 0 0 6px; }
.fn-lead .fn-g { color: var(--color-primary); }
.fn-sub { font-size: .87rem; color: var(--color-text-dim); margin: 0 0 13px; }
.fn-punch { font-size: 1.06rem; font-weight: 800; color: var(--color-text-main); margin: 0 0 14px; }
.fn-legal { font-size: .85rem; color: var(--color-text-main); background: rgba(239,83,83,.09); border-left: 3px solid var(--color-danger); border-radius: 8px; padding: 10px 12px; margin-bottom: 13px; }
.fn-plea { font-size: .93rem; color: var(--color-text-main); margin: 0 0 2px; }
.fn-q { font-size: 1.04rem; font-weight: 800; color: var(--color-text-main); text-align: center; margin: 18px 0 11px; }
.fn-wa { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border-radius: 11px; font-weight: 800; text-decoration: none; padding: 14px 16px; font-size: .97rem; line-height: 1.3; text-align: center; background: var(--color-primary); color: #151515; margin-bottom: 10px; box-sizing: border-box; }
.fn-wa svg { fill: currentColor; flex: 0 0 auto; width: 19px; height: 19px; }
.fn-wa-mini { background: transparent; border: 1.5px solid var(--color-text-dim); color: var(--color-text-main); padding: 10px 12px; font-size: .86rem; font-weight: 700; }
.fn-wa-mini svg { width: 15px; height: 15px; opacity: .85; }
.fn-mail { margin-top: 12px; font-size: .86rem; color: var(--color-text-dim); text-align: center; }
.fn-mail a { color: var(--color-primary); text-decoration: none; font-weight: 600; }
.fn-sig { margin-top: 15px; font-size: .9rem; color: var(--color-text-dim); }
.fn-sig b { color: var(--color-text-main); }
.fn-foot { flex: 0 0 auto; padding: 12px 16px; border-top: 1px solid rgba(125,125,125,.2); }
.fn-close { display: block; width: 100%; text-align: center; padding: 14px; border-radius: 11px; background: rgba(125,125,125,.18); color: var(--color-text-main); font-weight: 700; font-size: .98rem; text-decoration: none; }
.fn-card { background: var(--color-surface); border: 1px solid rgba(239,83,83,.3); border-radius: 16px; padding: 16px 16px 17px; margin-top: 14px; }
.fn-chead { display: flex; align-items: center; gap: 9px; }
.fn-chead h3 { font-size: 1.08rem; font-weight: 800; color: var(--color-text-main); margin: 0; }
.fn-chead .fn-ic { font-size: 1.12rem; }
.fn-crule { height: 3px; width: 52px; background: var(--color-danger); border-radius: 3px; margin: 9px 0 13px; }
.fn-card .fn-wa:last-of-type { margin-bottom: 0; }

/* --- SPIS POJAZDÓW: zwijane zakładki właściciel -> model --- */
.fleet-owner-section { margin-bottom: 10px; }
.fleet-owner-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 4px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    border-bottom: 2px solid var(--color-primary);
}
.fleet-owner-name { font-size: 1.2rem; font-weight: 800; color: var(--color-text-main); }
.fleet-owner-count { font-size: 0.8rem; font-weight: 600; color: var(--color-text-dim); }
.fleet-owner-chevron {
    margin-left: auto;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-dim);
    transition: transform .2s ease;
}
.fleet-owner-section.expanded .fleet-owner-chevron { transform: rotate(90deg); }
.fleet-owner-body { display: none; padding-top: 14px; }
.fleet-owner-section.expanded .fleet-owner-body { display: block; }
.fleet-model-name { font-size: 1rem; font-weight: 700; color: var(--color-text-main); line-height: 1.25; }

/* ═══ [port 27.09.2026] USTAWIENIA + WYSZUKIWARKA z dev (makieta CD 19.09) ═══
   Reguly tego zakresu przeniesione z v.1.14.5.css w kolejnosci z dev; stare reguly
   ustawien/wyszukiwarki usuniete. Generator: memory/assets/tools/port_ui_20260927/port_ui.py */

/* SETTINGS FORM ELEMENTS */
.settings-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-control select {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text-main);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.9rem;
}

/* --- PROFIL / MOJE KONTO (NEW) --- */
.profile-header {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 20px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.02), transparent);
    border-bottom: 1px solid var(--border-color);
}

/* Sekcje Ustawień */
.settings-section-title {
    font-size: 0.8rem;            /* 12,8 px - skala D13 */
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--color-text-dim);
    margin: 0 4px 8px 4px;
    font-weight: 600;
}

.settings-list {
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}

.settings-row {
    min-height: 56px;
    padding: 0 16px;
    gap: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--color-surface);
}

/* Etykieta wiersza: 16/400. Może zawinąć się do 2 linii (tłumaczenia bywają dłuższe
   od polskiego) - dlatego min-height, a nie sztywna height. */
.settings-row > .settings-label {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-main);
    line-height: 1.25;
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 0;
}

.settings-row:last-child {
    border-bottom: none;
}

.setting-beta-chip {
    display: inline-block;
    vertical-align: 2px;
    font-size: 0.7rem;            /* 11,2 px */
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-primary);
    /* D15/P6: --color-text-inv ODWRACA sie miedzy motywami (w jasnym = biel),
       wiec na zoltym tle dawal bialy tekst = 2,65:1. --color-on-primary jest
       czernia w OBU motywach. NIE zamieniac z powrotem. */
    color: var(--color-on-primary);
    margin-left: 2px;
    white-space: nowrap;
}

.settings-select {
    padding: 8px 12px;
    border-radius: 8px;
    background: inherit;
    color: var(--color-text-main);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.9rem;
    field-sizing: content;
    min-width: 150px;
}

.settings-select option,
.settings-select optgroup {
    background: var(--color-bg);
    color: var(--color-text-main);
}



/* ===== [makieta CD 19.09] KONTROLKI USTAWIEN =====================================
   D2: ksztalt kontrolki mowi, jakiego typu jest decyzja.
   tak/nie -> przelacznik; 2-3 stany wykluczajace -> segment NEUTRALNY (nie zolty,
   zolty jest zarezerwowany dla "aktywne/idz" - D1); wybor z listy -> wiersz z wartoscia.
   ================================================================================= */

/* --- przelacznik 50x30 --- */
.bg-switch {
    flex: 0 0 auto;
    width: 50px;
    height: 30px;
    border-radius: 999px;
    background: var(--border-color);
    position: relative;
    cursor: pointer;
    transition: background .15s ease;
    border: none;
    padding: 0;
}
.bg-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--color-text-dim);
    transition: transform .15s ease, background .15s ease;
}
.bg-switch.on { background: var(--color-primary); }
.bg-switch.on::after { transform: translateX(20px); background: var(--color-bg); }

/* --- segment neutralny --- */
.bg-seg {
    flex: 0 0 auto;
    display: flex;
    height: 36px;
    padding: 2px;
    gap: 2px;
    background: var(--color-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.bg-seg button {
    position: relative;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.8rem;            /* 12,8 px */
    font-weight: 600;
    color: var(--color-text-dim);
    padding: 0 14px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.bg-seg.seg-3 button { padding: 0 12px; }
.bg-seg button.on {
    background: var(--color-surface-active);
    color: var(--color-text-main);
    box-shadow: inset 0 0 0 1px #444;
}
/* Cel dotykowy 44 px bez zmiany rysunku (D14) - apka uzywana w rekawiczkach. */
.bg-seg button::before {
    content: "";
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 44px;
}

/* --- wiersz z wartoscia: "Etykieta ... wartosc >" --- */
.settings-value {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-dim);
    font-size: 0.9rem;            /* 14,4 px */
    white-space: nowrap;
    cursor: pointer;
}
.settings-value .chev { font-size: 1.1rem; line-height: 1; }

/* --- karta z opisem (BETA / Program testow) - D3 --- */
.settings-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--border-color);
}
.settings-card:last-child { border-bottom: none; }
.settings-card .sc-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.settings-card .sc-desc {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text-dim);
    line-height: 1.45;
    margin-top: 6px;
}
.settings-card .bg-switch { margin-top: 2px; }

/* --- ramka deweloperska: TYLKO kanal dev (D4) --- */
.settings-dev-frame {
    border: 1px dashed #444;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
}
.settings-dev-frame .dev-title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 4px;
}
.settings-dev-frame .settings-row {
    min-height: 32px;
    padding: 0;
    border-bottom: none;
    background: none;
}
.settings-dev-frame .settings-label {
    font-size: 0.9rem;
    color: var(--color-text-dim);
}

/* --- naglowek Ustawien (D1: zolty przycisk = "idz"; D5: brak Wyloguj u gory) --- */
.profile-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 4px 4px 20px 4px;
}
.profile-head .ph-title { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.profile-head .ph-sub { font-size: 0.9rem; color: var(--color-text-dim); margin-top: 2px; }
.profile-head .ph-avatar {
    flex: 0 0 auto;
    width: 48px; height: 48px;
    border-radius: 999px;
    background: var(--color-surface-active);
    border: 1px solid #444;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; font-weight: 800;
}
.btn-login-top {
    flex: 0 0 auto;
    height: 48px;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
}
/* D5: jedyny "Wyloguj sie" - neutralny, na koncu listy. Zeby nie kusil. */
.btn-logout-bottom {
    width: 100%;
    min-height: 56px;
    /* ⚠ checkLoginState ustawia display:flex - bez wysrodkowania napis uciekal w lewo. */
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--color-text-dim);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 24px;
    cursor: pointer;
}

/* --- Wyszukiwarka połączeń: przycisk lokalizacji + suwak min. przesiadki (dev 1.14.4) --- */
.conn-geo-btn {
    position:absolute; right:6px; top:50%; transform:translateY(-50%);
    width:34px; height:34px; border-radius:8px; background:transparent; border:none;
    cursor:pointer; font-size:1.15rem; line-height:1; display:flex; align-items:center;
    justify-content:center; padding:0; opacity:.8; z-index:3;
    color:var(--color-primary);   /* [feedback CEO] ikona pinezki (SVG currentColor) */
}
.conn-geo-btn:hover { background:var(--color-bg); opacity:1; }
.conn-range {
    -webkit-appearance:none; appearance:none; width:100%; height:6px; border-radius:6px;
    background:var(--border-color); outline:none; cursor:pointer; margin:0;
}
.conn-range::-webkit-slider-thumb {
    -webkit-appearance:none; appearance:none; width:20px; height:20px; border-radius:50%;
    background:var(--color-primary); cursor:pointer; border:2px solid var(--color-surface);
}
.conn-range::-moz-range-thumb {
    width:20px; height:20px; border-radius:50%; background:var(--color-primary);
    cursor:pointer; border:2px solid var(--color-surface);
}

/* [redesign CD] Wyszukiwarka – chipy profili, segment „dojście pieszo", wiersz ustawień zaawansowanych */
.conn-form-label { display:block; color:var(--color-text-dim); margin-bottom:8px; font-size:0.78rem; font-weight:700; text-transform:uppercase; letter-spacing:1.2px; }
/* [makieta CD 19.09, D8] Chipy profilu: JEDEN wiersz przewijany poziomo zamiast pięciu
   wierszy (było 215 px pionu na telefonie = 30% ekranu). Maskę po prawej zapalamy dopiero,
   gdy naprawdę jest co przewijać - inaczej na pulpicie krawędź gasła bez powodu. */
.conn-chips { display:flex; gap:8px; flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; padding:2px 0; }
/* ⚠ WŁASNY wskaźnik przewijania zamiast systemowego paska (CEO 19.09: „zostaw pasek także
   na telefonie - będzie widać, że są inne opcje w bok").
   Dlaczego własny: na telefonie pasek systemowy jest NAKŁADKOWY - pojawia się dopiero
   w trakcie przewijania i nie rezerwuje miejsca (zmierzone: offsetHeight == clientHeight),
   więc jako STAŁY sygnał „jest więcej w bok" się nie nadaje. Własny pasek wygląda tak samo
   na telefonie i na PC, pokazuje też, GDZIE jesteśmy w liście. */
.conn-chips { scrollbar-width: none; }
.conn-chips::-webkit-scrollbar { display: none; }
/* Pasek WYGLĄDA jak kontrolka przewijania, więc MUSI nią być - inaczej ręka sama próbuje
   go złapać i nic się nie dzieje (CEO 19.09). Zewnętrzny element jest polem chwytu
   (18 px wysokości zamiast 3 px), widoczny jest tylko cienki tor w środku. */
.conn-chips-pasek {
    position: relative;
    padding: 9px 2px;
    margin: 0;
    cursor: grab;
    touch-action: none;        /* przeciąganie palcem nie ma przewijać strony */
}
.conn-chips-pasek:active { cursor: grabbing; }
.conn-chips-pasek .tor {
    display: block;
    position: relative;
    height: 3px;
    border-radius: 999px;
    background: var(--border-color);
    overflow: hidden;
}
.conn-chips-pasek i {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 999px;
    background: var(--color-text-dim);
    transition: left .12s linear, width .12s linear;
}
/* W trakcie ciągnięcia kciuk ma iść ZA palcem, bez wygładzania */
.conn-chips-pasek.ciagnie i { transition: none; }
.conn-chips-pasek.ciagnie .tor i { background: var(--color-text-main); }
.conn-chips.przewijalne { -webkit-mask-image:linear-gradient(to right, #000 88%, transparent 100%); mask-image:linear-gradient(to right, #000 88%, transparent 100%); }
.conn-chip { flex:0 0 auto; min-height:44px; display:inline-flex; align-items:center; padding:0 16px; border-radius:999px; background:var(--color-surface); border:1px solid var(--border-color); color:var(--color-text-dim); font-weight:600; font-size:0.85rem; cursor:pointer; transition:var(--transition); white-space:nowrap; }
.conn-chip.active { background:var(--color-primary); color:var(--color-on-primary); border-color:var(--color-primary); font-weight:700; }
.conn-seg { display:flex; background:var(--color-bg); border:1px solid var(--border-color); border-radius:10px; padding:3px; gap:3px; }
.conn-seg button { flex:1; padding:9px 0; text-align:center; border-radius:8px; border:none; background:transparent; color:var(--color-text-dim); font-weight:600; font-size:0.85rem; cursor:pointer; transition:var(--transition); }
/* D1: żółty tylko dla „aktywne/idź" (Zaloguj, włączony przełącznik, BETA, aktywny chip
   profilu, SZUKAJ, krawędź karty, aktywna pozycja nav). Segment nie jest na tej liście,
   więc wybrany segment jest NEUTRALNY - tak samo jak w Ustawieniach (D2). */
.conn-seg button.active { background:var(--color-surface-active); color:var(--color-text-main); box-shadow:inset 0 0 0 1px #444; font-weight:700; }
.conn-adv-row { display:flex; align-items:center; justify-content:space-between; border:1px solid var(--border-color); border-radius:12px; padding:13px 14px; cursor:pointer; }

/* ===== [makieta CD 19.09] PODEKRANY USTAWIEN (1b operator, 3c glos) ==============
   Naglowek tych ekranow = kanoniczny .page-title + .back-link, jak w calej apce. */

/* --- karta glosu (D7): glosnik NIE zmienia wyboru, tylko gra probke --- */
.glos-karta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
}
.glos-karta.on { border-color: var(--color-primary); }
.glos-probka {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--color-bg);
    color: var(--color-text-main);
    font-size: 1rem;
    cursor: pointer;
}
.glos-probka.gra { border-color: var(--color-primary); color: var(--color-primary); }
.glos-imie { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.glos-lang {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--color-surface-active);
    color: var(--color-text-dim);
}
.glos-opis {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    line-height: 1.45;
    margin-top: 4px;
}
.glos-radio {
    flex: 0 0 auto;
    width: 20px; height: 20px;
    border-radius: 999px;
    border: 2px solid #555;
    position: relative;
}
.glos-radio.on { border-color: var(--color-primary); }
.glos-radio.on::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 999px;
    background: var(--color-primary);
}

/* ===== [makieta CD 19.09, D9] WIERSZ PODSUMOWANIA PO WYSZUKANIU ================== */
.conn-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 2px 0 14px 0;
}
/* ⚠ Na realnych nazwach („Katowice Dworzec PKP → Gliwice Plac Piastów") jeden wiersz ucinał
   CEL PODRÓŻY, a w drugim wierszu ginęło „przesiadka min. 2 min". Makieta tego nie pokazała,
   bo miała krótkie nazwy przykładowe. Pozwalamy zawinąć do dwóch wierszy - treść bez zmian. */
.conn-summary .cs-trasa {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.conn-summary .cs-meta {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    margin-top: 3px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* CEO 19.09: „Zmień" było przygaszone i nie dawało się domyślić, że to klikalna funkcja.
   Dostaje kształt kontrolki - obwódka, promień, tekst w kolorze głównym. Żółtego NIE używamy:
   D1 rezerwuje go dla „aktywne/idź", a to jest wejście w edycję, nie akcja wiodąca. */
.conn-summary .cs-zmien {
    flex: 0 0 auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-main);
    background: var(--color-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.conn-summary:active .cs-zmien { background: var(--color-surface-active); }

/* Kręciołek W PRZYCISKU - widoczny nawet wtedy, gdy kierowca stoi na dole formularza
   i duży loader pod spodem jest poza kadrem. */
.conn-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, .25);
    border-top-color: var(--color-on-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    display: inline-block;
    vertical-align: -3px;
}

/* ===== [makieta CD 19.09, D10] PELNOEKRANOWY WYBOR PRZYSTANKU =================== */
.conn-picker {
    position: fixed;
    inset: 0;
    z-index: 2500;              /* nad dolna nawigacja */
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
}
.conn-picker .cp-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--border-color);
}
.conn-picker .cp-back {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    border: none; background: none;
    color: var(--color-text-main);
    display: flex; align-items: center; justify-content: center;
    border-radius: 999px; cursor: pointer;
}
.conn-picker .cp-back:active { background: var(--color-surface-active); }
.conn-picker .cp-pole { position: relative; flex: 1; min-width: 0; }
.conn-picker .cp-clear {
    position: absolute;
    right: 4px; top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
    border: none; background: none;
    color: var(--color-text-dim);
    font-size: 1.5rem; cursor: pointer;
}
/* Lista na CALA wysokosc - zadnego max-height:200px */
.conn-picker .cp-lista {
    position: static !important;
    display: block !important;
    flex: 1;
    max-height: none !important;
    overflow-y: auto;
    border: none !important;
    border-radius: 0 !important;
    background: var(--color-bg) !important;
    padding-bottom: 24px;
}
.conn-picker .cp-lista .autocomplete-item { min-height: 52px; }

/* ===== [makieta CD 19.09, D11] TABLET I PULPIT ==================================
   P15: przy oknie 1440 px karta wyniku, formularz i lista ustawien mialy po 1400 px,
   a w srodku karty ~1000 px pustki. CEO: „do poprawy", i wprost: NIE rozciagac karty
   telefonowej. Do czasu wpiecia mapy obok listy (kierunek B) ograniczamy kolumne tresci
   - pusty pas po bokach jest mniej szkodliwy niz rozjechana karta.
   ⚠ Przeniesienia dolnej nawigacji do naglowka TU NIE MA - to zmiana dotykajaca WSZYSTKICH
   widokow (takze pilota), wiec zasluguje na wlasne wdrozenie i wlasna kontrole. */
@media (min-width: 768px) {
    #view-wyszukiwarka > *,
    #view-profil > * {
        max-width: 760px;
        margin-left: auto;
        margin-right: auto;
    }
    /* Tytul strony trzyma sie tej samej kolumny co reszta */
    #view-wyszukiwarka > .page-title,
    #view-profil > .page-title { max-width: 760px; }
}
@media (min-width: 1024px) {
    #view-profil > * { max-width: 820px; }

    /* D11 kierunek B: lewa kolumna = ten sam stos co na telefonie, prawa = mapa trasy.
       Mapa jest przyklejona, wiec przewijanie listy jej nie zabiera. */
    /* ⚠ Router pokazuje widok stylem INLINE (`style.display='block'`), a inline wygrywa
       z arkuszem - bez `!important` siatka nigdy by się nie włączyła. */
    #view-wyszukiwarka.active,
    #view-wyszukiwarka[style*="display: block"] {
        display: grid !important;
        grid-template-columns: minmax(420px, 520px) 1fr;
        gap: 20px;
        align-items: start;
    }
    #view-wyszukiwarka > * { grid-column: 1; max-width: none; margin-left: 0; margin-right: 0; }
    #conn-mapa-pulpit {
        grid-column: 2;
        grid-row: 1 / 999;
        position: sticky;
        top: 20px;
        height: calc(100vh - var(--nav-height) - 60px);
        min-height: 420px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        overflow: hidden;
        background: var(--color-surface);
    }
    #conn-mapa-pulpit-cel { width: 100%; height: 100%; }
    /* Przycisk w karcie jest na pulpicie zbedny - mapa jest obok */
    .conn-map-btn { display: none !important; }
}

/* Panel mapy istnieje tylko na szerokich ekranach; na telefonie zostaje modal. */
#conn-mapa-pulpit { display: none; }
@media (min-width: 1024px) { #conn-mapa-pulpit { display: block; }
}
#conn-mapa-pulpit-pusto {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: var(--color-text-dim);
    font-size: 0.9rem;
}
#conn-mapa-pulpit.ma-trase #conn-mapa-pulpit-pusto { display: none; }

/* Oznaczenie źródła kafelków (osmAtrybucja) – stałe; w pilocie znika po 5 s */
.osm-attr { position: absolute; right: 6px; bottom: 6px; z-index: 5; pointer-events: none; font-size: 12px; line-height: 1;
    color: #C8CCD2; text-shadow: 0 0 2px #111, 0 0 2px #111, 0 0 2px #111; transition: opacity .6s; }
.osm-attr.znika { opacity: 0; }
[data-theme="light"] .osm-attr { color: #4B525B; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 2px #fff; }

/* Komunikat PLANOWANYCH PRAC (14.10.2026) – pomarańczowy z pachołkiem; stan z prace.json wstawia PHP */
.prace-baner { position: relative; display: flex; align-items: flex-start; gap: 12px; background: rgba(245, 130, 31, 0.13);
    border: 1px solid #f5821f; border-radius: 12px; padding: 14px 40px 14px 16px; margin-bottom: 20px; }
.prace-baner-ikona { flex: 0 0 auto; margin-top: 1px; color: #f5821f; }
.prace-baner-tresc { margin: 0; font-size: 0.92rem; line-height: 1.45; color: var(--color-text-main); }
.prace-baner-do { margin: 6px 0 0; font-size: 0.84rem; line-height: 1.4; color: var(--color-text-dim, #9a9a9a); }
.prace-baner-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; background: transparent;
    color: var(--color-text-dim, #9a9a9a); font-size: 1.3rem; line-height: 1; cursor: pointer; border-radius: 8px; }
