/* --- 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-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: uppercase;
    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;
}

/* 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;
}

@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;
}

/* --- 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);
}

.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;
}

/* Sekcje Ustawień */
.settings-section-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-dim);
    margin: 20px 0 10px 0;
    font-weight: 700;
    padding-left: 5px;
}

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

.settings-row {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--color-surface);
}

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

.setting-beta-chip {
    display: inline-block;
    vertical-align: 2px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-text-inv);
    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);
}

/* 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;
}

.departure-delay.delay-late {
    color: var(--color-danger);
}

.departure-delay.delay-early {
    color: var(--color-info);
}

.departure-delay.delay-ok {
    color: var(--color-success);
}

/* --- 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; }

/* pilot: przycisk podgladu trasy w trybie aktywnym (strzalka nawigacji) — akcent */
#rail-preview.rail-preview-active { color: var(--color-primary); }
