@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 100%;
    font-display: swap;
    src: url('/static/fonts/roboto-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 100%;
    font-display: swap;
    src: url('/static/fonts/roboto-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #1C1B1F; --surface: #2B2930; --primary: #D0BCFF;
    --on-primary: #381E72; --on-surface: #E6E1E5; --outline: #938F99;
    --error: #FFB4AB; --green: #81C784; --base-font: 16px; 
    --tram: #F2B8B5; --bus: #D0BCFF; --trolley: #C2E7FF;
}

body.oled { --bg: #000000; --surface: #111111; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }
input, .expert-text, .b-input, .res-item, .bm-res-item { user-select: auto; }

body {
    background: var(--bg); color: var(--on-surface);
    font-family: 'Roboto', sans-serif; margin: 0;
    display: flex; justify-content: center; height: var(--vh, 100dvh);
    overflow: hidden; font-size: var(--base-font);
    transition: background 0.3s ease;
}

#app { background: var(--bg); width: 100%; max-width: 500px; height: 100%; display: flex; flex-direction: column; position: relative; border-left: 1px solid rgba(255,255,255,0.05); border-right: 1px solid rgba(255,255,255,0.05); }

#board::-webkit-scrollbar, #settings-page::-webkit-scrollbar, #results::-webkit-scrollbar, .sheet::-webkit-scrollbar { display: none; }
#board, #settings-page, #results, .sheet { scrollbar-width: none; -ms-overflow-style: none; }

header { padding: calc(10px + env(safe-area-inset-top)) 20px 10px; display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.header-top { width: 100%; display: flex; position: relative; align-items: center; justify-content: space-between; }
.header-right { display: flex; }
.branding { font-size: 10px; font-weight: 900; opacity: 0.3; letter-spacing: 4px; text-transform: uppercase; margin-bottom: 8px; }
#stop-display { flex: 1; min-width: 0; margin: 0; font-size: 1.6rem; font-weight: 900; letter-spacing: -0.5px; text-align: center; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }

#settings-page {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg); z-index: 2000; display: none;
    flex-direction: column; padding: calc(10px + env(safe-area-inset-top)) 20px 24px; overflow-y: auto;
}
.settings-header { display: flex; align-items: center; width: 100%; margin-bottom: 30px; position: relative; min-height: 44px; }
.settings-header h2 { width: 100%; text-align: center; margin: 0; font-size: 1.3rem; font-weight: 900; }
.back-btn { position: absolute; left: 0; background: transparent; border: none; color: var(--on-surface); font-size: 28px; cursor: pointer; z-index: 10; padding: 5px; }

.settings-item { background: var(--surface); padding: 1.2em; border-radius: 20px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.s-label { flex: 1; padding-right: 10px; }
.s-title { font-weight: 700; font-size: 1rem; }
.s-desc { font-size: 0.75rem; opacity: 0.5; font-weight: 400; margin-top: 2px; }
.settings-section-label { margin: 25px 0 12px; font-weight: 900; opacity: 0.3; font-size: 0.75rem; letter-spacing: 2px; }
.bookmarks-settings { margin-top: 20px; }
.bookmarks-settings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.bookmarks-settings-title { font-size: 1.1rem; }
.changelog-card { margin-top: 18px; background: var(--surface); border-radius: 20px; border: 1px solid rgba(255,255,255,0.05); }
.changelog-toggle { width: 100%; border: none; background: transparent; color: var(--on-surface); padding: 1.05em 1.1em; display: flex; justify-content: space-between; align-items: center; gap: 14px; cursor: pointer; text-align: left; }
.changelog-title { font-size: 0.98rem; font-weight: 800; }
.changelog-subtitle { font-size: 0.75rem; opacity: 0.5; margin-top: 2px; }
.changelog-chevron { font-size: 1.1rem; opacity: 0.7; transition: transform 0.2s ease; flex-shrink: 0; }
.changelog-card.is-open .changelog-chevron { transform: rotate(180deg); }
.changelog-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.changelog-body:not(.hidden) { max-height: 600px; padding: 0 1.1em 1.05em; }
.changelog-list { display: flex; flex-direction: column; gap: 10px; }
.changelog-item { font-size: 0.9rem; line-height: 1.5; opacity: 0.85; padding-left: 16px; position: relative; word-wrap: break-word; }
.changelog-item::before { content: "•"; position: absolute; left: 0; top: 0; color: var(--primary); }
.settings-footer { height: 120px; opacity: 0.3; text-align: center; font-size: 11px; padding-top: 20px; }
.b-inputs-group { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.b-inputs-top { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.b-input { background: rgba(0,0,0,0.25) !important; border: 1px solid rgba(255,255,255,0.12) !important; color: white !important; padding: 12px; border-radius: 14px; font-size: 14px; width: 100%; outline: none; }
.b-edit-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.b-edit-content { flex: 1; min-width: 0; }
.drag-handle { flex-shrink: 0; width: 28px; display: flex; align-items: center; justify-content: center; cursor: grab; opacity: 0.4; font-size: 24px; padding-top: 8px; touch-action: none; user-select: none; letter-spacing: -2px; }
.drag-handle:active { cursor: grabbing; opacity: 0.9; }
.bm-dragging { opacity: 0.35; }
.bm-drag-over { outline: 2px solid var(--primary); border-radius: 20px; }
.b-actions { display: flex; justify-content: flex-end; align-items: center; margin-top: 5px; }
.btn-delete { background: rgba(255, 180, 171, 0.15); color: var(--error); border: 1px solid var(--error); padding: 8px 16px; border-radius: 12px; font-weight: 900; font-size: 11px; cursor: pointer; text-transform: uppercase; }

.icon-selector { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 8px; scrollbar-width: none; border-bottom: 1px solid rgba(255,255,255,0.05); }
.selectable-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); border-radius: 14px; font-size: 22px; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; }
.selectable-icon.active { border-color: var(--primary); background: rgba(208, 188, 255, 0.15); }

.header-btn { background: transparent; border: none; font-size: 24px; cursor: pointer; color: var(--on-surface); display: flex; align-items: center; justify-content: center; }

#bookmarks-bar { display: flex; justify-content: center; gap: 14px; padding: 10px 20px 20px; overflow-x: auto; flex-shrink: 0; width: 100%; }
.bookmark-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; min-width: 60px; }
.bookmark-icon { width: 54px; height: 54px; background: var(--surface); border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 26px; border: 1px solid rgba(255,255,255,0.05); }
.bookmark-label { font-size: 11px; opacity: 0.7; font-weight: 500; }

#board { flex: 1; overflow-y: auto; padding: 0 16px 160px; -webkit-overflow-scrolling: touch; }
.board-status { text-align: center; padding-top: 100px; opacity: 0.4; font-weight: 500; }
.board-status.error { font-weight: 600; color: var(--error); }
.card { 
    background: var(--surface); border-radius: 1.6em; padding: 1.1em 1.3em; margin-bottom: 0.9em; 
    display: flex; justify-content: space-between; align-items: center; border: 1px solid rgba(255,255,255,0.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); gap: 10px;
}

.line-badge { width: 2.8em; height: 2.8em; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.1em; margin-right: 4px; flex-shrink: 0; background: var(--bus); color: #000; }
.line-badge.tram { background: var(--tram); color: #601410; }
.line-badge.trolley { background: var(--trolley); color: #001D35; }

.info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dest { font-weight: 700; font-size: 1.15em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.meta { font-size: 0.75em; opacity: 0.6; text-transform: uppercase; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.meta-row { display: flex; align-items: center; gap: 7px; min-width: 0; margin-top: 2px; }
.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68em;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(230,225,229,0.85);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 0.22em 0.58em;
    line-height: 1.1;
    white-space: nowrap;
}
.meta-status.live::before {
    content: "";
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(129,199,132,0.2);
}
.meta-status.planned { color: rgba(230,225,229,0.7); }
.meta-icons { display: inline-flex; align-items: center; gap: 3px; margin-left: 1px; }
.meta-icon { font-size: 0.95em; line-height: 1; }
.expert-text {
    font-size: 0.65em;
    color: var(--primary);
    margin-top: 5px;
    font-weight: 400;
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    line-height: 1.2;
    word-break: break-word;
    width: 100%;
}

.time-box { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.eta-mins { color: var(--green); font-weight: 900; font-size: 1.45rem; line-height: 1; white-space: nowrap; }
.eta-clock { font-size: 0.85rem; opacity: 0.6; font-weight: 500; margin-top: 4px; }
.delay-tag { color: var(--error); font-size: 0.72rem; font-weight: 800; margin-top: 2px; white-space: nowrap; text-transform: uppercase; }
.planned .eta-mins { color: var(--outline); }

.dots-container { display: inline-flex; gap: 4px; color: var(--green); font-weight: 900; font-size: 2rem; line-height: 0.8; animation: blinker 1.2s step-start infinite; }
@keyframes blinker { 50% { opacity: 0; } }

/* --- UNIFIKOVANÉ VYHĽADÁVANIE (DOPLŇAČ) --- */

/* 1. Hlavné výsledky a výsledky v plánovači */
#results, .planner-res { 
    position: absolute; 
    background: var(--surface); 
    border-radius: 24px; 
    border: 1px solid #555; 
    overflow-y: auto; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.6); 
    z-index: 4000;
    padding: 8px 0;
}

/* Pozícia pre hlavné hľadanie */
#results { 
    bottom: 95px; 
    left: 20px; 
    right: 20px; 
    max-height: 380px; 
}

/* Pozícia pre hľadanie v plánovači */
.planner-res { 
    top: 100%; 
    left: 0; 
    right: 0; 
    max-height: 200px; 
    margin-top: 5px;
    border-radius: 16px;
}

/* Spoločný štýl pre položky v zozname */
.res-item, .bm-res-item { 
    padding: 16px 24px; 
    border-bottom: 1px solid #444; 
    font-size: 1.15rem; 
    font-weight: 700; 
    text-align: left; 
    color: var(--on-surface);
    cursor: pointer;
    display: block;
    width: 100%;
    transition: background 0.1s;
}

.res-item:last-child, .bm-res-item:last-child { border-bottom: none; }

.res-item:active, .bm-res-item:active { 
    background: var(--primary); 
    color: var(--on-primary); 
}

/* --- PLÁNOVAČ --- */
.fab { position: absolute; bottom: 100px; right: 20px; width: 56px; height: 56px; background: var(--primary); border-radius: 16px; border: none; box-shadow: 0 4px 15px rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 99; font-size: 24px; color: var(--on-primary); }
.sheet { position: absolute; bottom: 0; left: 0; right: 0; background: var(--surface); border-radius: 28px 28px 0 0; padding: 16px 24px calc(30px + env(safe-area-inset-bottom)); z-index: 3000; box-shadow: 0 -10px 40px rgba(0,0,0,0.6); transition: transform 0.3s ease, visibility 0.3s ease; overflow: visible; font-size: var(--base-font); }
.sheet.hidden { transform: translateY(100%); pointer-events: none !important; visibility: hidden; }
.sheet-handle { width: 32px; height: 4px; background: var(--outline); border-radius: 2px; margin: 0 auto 16px; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; width: 100%; }
.sheet-header h3 { margin: 0; font-size: 1.4em; font-weight: 900; color: var(--on-surface); }
.close-btn-circle { width: 40px; height: 40px; background: var(--outline) !important; border-radius: 50%; border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 20px; }

.planner-form { display: flex; flex-direction: column; gap: 16px; width: 100%; }
#planner-sheet input[type="text"],
.planner-form input[type="text"] {
    background: transparent !important;
    color: #ffffff !important;
    border: none !important;
    outline: none !important;
    -webkit-appearance: none;
    appearance: none;
}
.input-group { position: relative; width: 100%; display: block; }

.btn-filled { width: 100% !important; background: var(--primary) !important; color: var(--on-primary) !important; border: none !important; padding: 0.9em 1em !important; border-radius: 1em !important; font-weight: 900 !important; font-size: 1em !important; cursor: pointer !important; margin-top: 6px; transition: transform 0.15s ease, filter 0.15s ease; }
.btn-filled:active { transform: scale(0.98); filter: brightness(0.95); }

/* BOTTOM NAV */
.bottom-nav { position: absolute; bottom: 0; width: 100%; padding: 20px; background: linear-gradient(to top, var(--bg) 75%, transparent); z-index: 1000; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.search-box { background: var(--surface); border-radius: 30px; padding: 14px 24px; border: 1px solid #444; display: flex; }
.search-box input { background: transparent !important; border: none !important; color: white !important; font-size: 1rem !important; width: 100%; outline: none; }

.btn-font { background: #4A4458; color: var(--primary); border: none; width: 36px; height: 36px; border-radius: 12px; font-size: 20px; cursor: pointer; }
.btn-font-circle { background: #4A4458; color: var(--primary); border: none; width: 38px; height: 38px; border-radius: 50%; font-size: 22px; cursor: pointer; }
#ticket-overlay, #install-overlay { position: fixed; inset: 0; z-index: 2999; }
#ticket-overlay.hidden, #install-overlay.hidden { display: none !important; pointer-events: none !important; }
#planner-overlay { position: fixed; inset: 0; z-index: 2999; }
#planner-overlay.hidden { display: none !important; }
#ticket-sheet .sheet-header { margin-bottom: 12px; }
.sms-ticket-buttons { display: flex; gap: 10px; width: 100%; }
.btn-sms-ticket { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #4A4458; color: var(--primary); border-radius: 16px; padding: 12px 8px; text-decoration: none; cursor: pointer; }
.sms-ticket-duration { font-size: 0.95rem; font-weight: 700; }
.sms-ticket-price { font-size: 0.75rem; opacity: 0.6; }

.m3-switch { position: relative; width: 52px; height: 32px; display: inline-block; }
.m3-switch input { opacity: 0; width: 0; height: 0; }
.m3-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #4A4458; border-radius: 32px; transition: .4s; }
.m3-slider:before { position: absolute; content: ""; height: 24px; width: 24px; left: 4px; bottom: 4px; background: white; border-radius: 50%; transition: .4s; }
input:checked + .m3-slider { background: var(--primary); }
input:checked + .m3-slider:before { transform: translateX(20px); background: var(--on-primary); }

.hidden { display: none !important; }

/* --- TRIP DETAIL MODAL --- */
.line-badge { cursor: pointer; }

.trip-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 3500;
    display: flex;
    align-items: flex-end;
}
.trip-modal-overlay.hidden { display: none !important; }

.trip-modal {
    background: var(--surface);
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-height: 82dvh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
    overflow: hidden;
    font-size: var(--base-font);
}

.trip-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.trip-modal-badge { cursor: default; }
.trip-modal-title { flex: 1; min-width: 0; }
.trip-modal-dep  { font-size: 1em; font-weight: 900; }
.trip-modal-dest { font-size: 0.82em; opacity: 0.55; margin-top: 3px; }
.trip-modal-delay { text-align: right; flex-shrink: 0; }
.trip-modal-delay-val { font-size: 1.1em; font-weight: 900; color: var(--error); line-height: 1; }
.trip-modal-delay-label { font-size: 0.65em; opacity: 0.45; margin-top: 3px; white-space: nowrap; }

.trip-modal-stops {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.trip-modal-stops::-webkit-scrollbar { display: none; }

.trip-stop-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.trip-stop-row.current {
    background: rgba(208,188,255,0.10);
}
.trip-stop-row:last-child { border-bottom: none; }

.trip-stop-seq {
    min-width: 1.8em;
    font-size: 0.75em;
    color: var(--outline);
    font-weight: 700;
    text-align: center;
    flex-shrink: 0;
}
.trip-stop-dot {
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.65em;
    color: var(--primary);
    line-height: 1;
}
.trip-stop-time {
    min-width: 2.8em;
    font-size: 1em;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--on-surface);
}
.trip-stop-name {
    flex: 1;
    min-width: 0;
    font-size: 1em;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.trip-stop-row.current .trip-stop-name {
    font-weight: 900;
    color: var(--primary);
}
.trip-stop-row.current .trip-stop-time {
    color: var(--primary);
    font-weight: 900;
}
.trip-stop-delay {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--error);
    white-space: nowrap;
    flex-shrink: 0;
}
.trip-stop-zone {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 0.75em;
    font-weight: 800;
    color: var(--outline);
}
.trip-zone-icon {
    width: 16px;
    height: 16px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 900;
    color: var(--outline);
}

.trip-modal-footer {
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.trip-modal-footer .btn-filled {
    flex: 1;
    width: auto !important;
    margin-top: 0;
}
.btn-share {
    width: 54px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
}
.btn-share:active { opacity: 0.6; }

.trip-stop-row.past { opacity: 0.3; }

.share-toast {
    position: fixed;
    bottom: calc(90px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--on-primary);
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.88rem;
    font-weight: 700;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    z-index: 9999;
}
.share-toast.visible { opacity: 1; }

.trip-info-msg {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.45;
    font-size: 0.9rem;
    font-weight: 500;
}

@media (max-width: 560px) {
    .card {
        padding: 1em 1.05em;
        border-radius: 1.45em;
        gap: 8px;
    }

    .line-badge {
        width: 2.65em;
        height: 2.65em;
        font-size: 1.04em;
    }

    .dest {
        font-size: 1.08em;
    }

    .meta-row {
        flex-wrap: wrap;
        gap: 6px;
        overflow: visible;
        width: 100%;
    }

    .meta-icons {
        margin-left: 0;
        width: auto;
        justify-content: flex-start;
        flex: 0 0 auto;
    }

    .meta-badge {
        font-size: 0.66em;
        padding: 0.2em 0.52em;
        flex: 0 0 auto;
    }

    .expert-text {
        display: block;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .time-box {
        min-width: unset;
    }
}

a.settings-item { text-decoration: none; color: var(--on-surface); }

.install-prompt-card {
    text-decoration: none;
    color: var(--on-surface);
    border: 1px solid rgba(208, 188, 255, 0.25);
    background: rgba(208, 188, 255, 0.07);
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
}

button.pwa-banner-link {
    background: transparent;
    border: none;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    text-align: left;
    font-size: inherit;
    outline: none;
}

.install-step-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 10px 0 6px;
}

.install-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.install-step-num {
    background: var(--primary);
    color: var(--on-primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.install-step-content {
    flex: 1;
    min-width: 0;
}

.install-step-title {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--on-surface);
}

.install-step-desc {
    font-size: 0.8rem;
    opacity: 0.65;
    margin-top: 2px;
    line-height: 1.35;
}

.install-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: -3px;
    margin: 0 3px;
    color: var(--primary);
}

.install-note {
    background: rgba(208, 188, 255, 0.08);
    border: 1px solid rgba(208, 188, 255, 0.18);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--on-surface);
    opacity: 0.9;
    margin-top: 14px;
}

#pwa-install-banner { display: flex; align-items: center; background: rgba(208, 188, 255, 0.07); border: 1px solid rgba(208, 188, 255, 0.25); border-radius: 16px; margin: 0 12px 10px; padding: 10px 14px; gap: 6px; }
#pwa-install-banner.hidden { display: none !important; }
.pwa-banner-link { display: flex; align-items: center; gap: 8px; flex: 1; text-decoration: none; color: var(--on-surface); }
.pwa-banner-icon { font-size: 1.05rem; }
.pwa-banner-text { font-size: 0.875rem; flex: 1; }.pwa-banner-close { background: none; border: none; color: var(--outline); cursor: pointer; padding: 4px 7px; font-size: 0.85rem; line-height: 1; border-radius: 8px; flex-shrink: 0; }
.pwa-banner-close:active { background: rgba(255,255,255,0.08); }

.install-prompt-card .s-title { color: var(--primary); }

.install-prompt-arrow {
    font-size: 1.6rem;
    opacity: 0.6;
    color: var(--primary);
    flex-shrink: 0;
}

/* --- LINE SEARCH SUGGESTIONS --- */
.res-line-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(208, 188, 255, 0.05);
}
.res-line-item:hover, .res-line-item:active {
    background: rgba(208, 188, 255, 0.14);
}
.res-line-badge {
    width: 2.3em !important;
    height: 2.3em !important;
    font-size: 0.95em !important;
    margin-right: 0 !important;
    flex-shrink: 0;
}
.res-line-info {
    flex: 1;
    min-width: 0;
}
.res-line-name {
    font-weight: 700;
    font-size: 0.95em;
}
.res-line-dests {
    font-size: 0.75em;
    opacity: 0.65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.res-line-arrow {
    opacity: 0.4;
    font-size: 0.85em;
    color: var(--primary);
}

/* --- LINE TIMETABLE MODAL --- */
.line-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.line-modal-overlay.hidden { display: none !important; }

.line-modal {
    background: var(--surface);
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-width: 720px;
    max-height: 90dvh;
    height: 90dvh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    font-size: var(--base-font);
}

.line-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.line-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.line-modal-badge {
    width: 2.4em;
    height: 2.4em;
    font-size: 1.05em;
    margin-right: 0;
}
.line-modal-name {
    font-size: 1.15em;
    font-weight: 900;
}
.line-modal-subtitle {
    font-size: 0.75em;
    opacity: 0.5;
    margin-top: 2px;
}
.line-modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--on-surface);
    border-radius: 50%;
    width: 2.2em;
    height: 2.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.15s;
}
.line-modal-close:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Direction Bar */
.lt-direction-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(0, 0, 0, 0.15);
}
.lt-direction-bar::-webkit-scrollbar { display: none; }

.lt-dir-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--on-surface);
    border-radius: 20px;
    padding: 7px 15px;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lt-dir-chip.active {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(208, 188, 255, 0.25);
}

/* Mobile View Tabs */
.lt-view-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.lt-view-tab {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-bottom: 2.5px solid transparent;
    color: var(--on-surface);
    opacity: 0.6;
    font-size: 0.88em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.lt-view-tab.active {
    opacity: 1;
    border-bottom-color: var(--primary);
    color: var(--primary);
}

/* Content Area */
.lt-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Left Column: Route diagram */
.lt-stops-col {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.lt-stops-col::-webkit-scrollbar { display: none; }
.lt-stops-col.active-panel {
    display: flex;
}
.lt-col-title {
    font-size: 0.75em;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.35;
    padding: 12px 18px 4px;
}
.lt-stops-list {
    padding: 6px 12px 20px;
    display: flex;
    flex-direction: column;
}
.lt-stop-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
}
.lt-stop-row:hover {
    background: rgba(255, 255, 255, 0.04);
}
.lt-stop-row.selected {
    background: rgba(208, 188, 255, 0.12);
}
.lt-stop-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 16px;
    flex-shrink: 0;
    position: relative;
    height: 100%;
}
.lt-stop-track-line {
    position: absolute;
    width: 2px;
    background: rgba(255, 255, 255, 0.12);
    top: -12px;
    bottom: -12px;
    left: 7px;
    z-index: 1;
}
.lt-stop-row:first-child .lt-stop-track-line {
    top: 50%;
}
.lt-stop-row:last-child .lt-stop-track-line {
    bottom: 50%;
}
.lt-stop-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--outline);
    background: var(--surface);
    z-index: 2;
    transition: all 0.2s;
    box-sizing: border-box;
}
.lt-stop-row.selected .lt-stop-dot {
    border-color: #E53935;
    background: #E53935;
    box-shadow: 0 0 10px rgba(229, 57, 53, 0.7);
    transform: scale(1.25);
}
.lt-stop-min {
    min-width: 3.2em;
    font-size: 0.75em;
    font-weight: 700;
    color: var(--outline);
    text-align: right;
    flex-shrink: 0;
}
.lt-stop-row.selected .lt-stop-min {
    color: var(--primary);
    font-weight: 900;
}
.lt-stop-name {
    flex: 1;
    font-size: 0.9em;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lt-stop-row.selected .lt-stop-name {
    color: #fff;
    font-weight: 700;
}
.lt-stop-zone {
    font-size: 0.68em;
    opacity: 0.4;
    flex-shrink: 0;
}

/* Right Column: Timetable Grid */
.lt-table-col {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.lt-table-col::-webkit-scrollbar { display: none; }
.lt-table-col.active-panel {
    display: flex;
}
.lt-table-header {
    padding: 12px 18px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.lt-selected-stop-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lt-stop-icon {
    font-size: 1.2em;
}
.lt-stop-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.lt-selected-stop-name {
    font-weight: 900;
    font-size: 1.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lt-selected-stop-sub {
    font-size: 0.72em;
    opacity: 0.5;
}

.lt-day-tabs {
    display: flex;
    gap: 8px;
}
.lt-day-tab {
    flex: 1;
    padding: 7px 12px;
    font-size: 0.8em;
    font-weight: 700;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--on-surface);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.lt-day-tab.active {
    background: var(--on-surface);
    color: var(--bg);
    border-color: var(--on-surface);
}

.lt-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 6px 18px 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.lt-grid-container::-webkit-scrollbar { display: none; }

.lt-grid {
    display: flex;
    flex-direction: column;
}
.lt-hour-row {
    display: flex;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 14px;
}
.lt-hour-row:last-child {
    border-bottom: none;
}
.lt-hour-row.is-current-hour {
    background: rgba(208, 188, 255, 0.06);
    border-radius: 8px;
}
.lt-hour-cell {
    min-width: 1.8em;
    width: auto;
    font-weight: 900;
    font-size: 0.95em;
    color: var(--outline);
    text-align: right;
    flex-shrink: 0;
}
.lt-hour-row.is-current-hour .lt-hour-cell {
    color: var(--primary);
}
.lt-minutes-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    flex: 1;
}
.lt-min-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.28em 0.6em;
    font-size: 0.88em;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    user-select: none;
    display: inline-flex;
    align-items: baseline;
}
.lt-min-pill:active {
    transform: scale(0.92);
    background: var(--primary);
    color: var(--on-primary);
}
.lt-min-pill.past {
    opacity: 0.45;
}
.lt-min-suffix {
    font-size: 0.72em;
    color: #FF8A80;
    font-weight: 900;
    margin-left: 1.5px;
}

.lt-notes {
    padding: 10px 18px 16px;
    font-size: 0.75em;
    opacity: 0.7;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    line-height: 1.5;
}
.lt-notes.hidden { display: none !important; }
.lt-note-item {
    display: flex;
    gap: 6px;
    margin-bottom: 3px;
}
.lt-note-key {
    font-weight: 900;
    color: #FF8A80;
}

/* Tablet & Desktop side-by-side view */
@media (min-width: 640px) {
    .lt-view-tabs {
        display: none !important;
    }
    .lt-stops-col {
        width: 250px;
        flex-shrink: 0;
        display: flex !important;
        border-right: 1px solid rgba(255, 255, 255, 0.06);
    }
    .lt-table-col {
        display: flex !important;
    }
}



/* --- DOMAIN MIGRATION MODAL --- */
.migration-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.migration-modal-overlay.hidden {
    display: none !important;
}
.migration-modal {
    background: var(--surface);
    color: var(--on-surface);
    border-radius: 24px;
    max-width: 460px;
    width: 100%;
    border: 1px solid rgba(255, 180, 171, 0.4);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
    padding: 24px 20px 18px;
    box-sizing: border-box;
    animation: migrationPopIn 0.22s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.migration-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 14px 0 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
body.oled .migration-steps {
    background: #181818;
    border-color: #262626;
}
.migration-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    line-height: 1.4;
}
.migration-step strong {
    color: var(--primary);
}
.migration-step-num {
    background: var(--primary);
    color: var(--on-primary);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 1px;
}
.migration-btn-dismiss:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
body.oled .migration-modal {
    background: #111111;
}
@keyframes migrationPopIn {
    from { transform: scale(0.93); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.migration-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.migration-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}
.migration-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--error);
    line-height: 1.2;
}
.migration-subtitle {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 3px;
}
.migration-modal-body {
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--on-surface);
}
.migration-modal-body p {
    margin: 0 0 10px;
}
.migration-new-domain-box {
    background: rgba(208, 188, 255, 0.12);
    border: 1px solid rgba(208, 188, 255, 0.3);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: center;
    margin: 12px 0;
}
.migration-link {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 900;
    text-decoration: none;
    letter-spacing: 0.5px;
}
.migration-link:hover, .migration-link:active {
    text-decoration: underline;
}
.migration-note {
    font-size: 0.82rem;
    opacity: 0.75;
    line-height: 1.4;
    margin-bottom: 0 !important;
}
.migration-modal-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}
.migration-btn-primary {
    text-align: center;
    text-decoration: none;
    display: block;
    box-sizing: border-box;
}
.migration-btn-dismiss {
    background: transparent;
    border: none;
    color: var(--outline);
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
}
.migration-btn-dismiss:hover, .migration-btn-dismiss:active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--on-surface);
}


/* --- 10. PLÁNOVAČ TRAS & SWIPE ENGINE (M3 / OLED COMPATIBLE) --- */
#planner-sheet {
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    font-size: var(--base-font);
}
#planner-sheet::-webkit-scrollbar {
    display: none;
}

/* --- PLANNER FIELDS STACK & CENTERING (STRICT 50/50 SYMMETRY) --- */
.planner-fields-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
    gap: 0;
}

.p-field-box {
    width: 100%;
    background: rgba(0, 0, 0, 0.28);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 8px 14px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
    cursor: text;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.p-field-box:focus-within {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.45);
}

.p-field-tag {
    font-size: 0.68em;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1;
    margin-bottom: 4px;
    pointer-events: none;
}

.p-input-row {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}
.p-input-row input {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 1.05em !important;
    font-weight: 600 !important;
    padding: 0 !important;
    padding-right: 48px !important;
    outline: none !important;
    box-sizing: border-box !important;
    min-height: 1.4em !important;
    line-height: 1.3 !important;
}
.p-input-row input::placeholder {
    color: rgba(255, 255, 255, 0.35);
    font-weight: 400;
}
#p-to {
    padding-right: 0 !important;
}

.p-gps-inline-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5em !important;
    height: 2.5em !important;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50% !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: var(--primary) !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 5;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.p-gps-inline-btn:hover {
    background: rgba(208, 188, 255, 0.12) !important;
}
.p-gps-inline-btn:active {
    background: rgba(208, 188, 255, 0.22) !important;
    transform: translateY(-50%) scale(0.92);
}
.p-gps-inline-btn.is-locating {
    animation: gps-spin 1.1s linear infinite;
    opacity: 0.85;
}

@keyframes gps-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

.planner-swap-row {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 100%;
    position: relative;
    z-index: 5;
    margin: 0;
}
.p-swap-btn {
    width: 2.4em;
    height: 2.4em;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    background: #2B2930;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: var(--primary);
    font-size: 1.15em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), background 0.2s ease, border-color 0.2s ease;
}
.p-swap-btn:hover {
    background: #383440;
    border-color: var(--primary);
}
.p-swap-btn:active {
    transform: rotate(180deg) scale(0.92);
    background: var(--primary);
    color: var(--on-primary);
}

/* --- PLANNER TIME SECTION (M3 SEGMENTED + 24H SELECTOR) --- */
.planner-time-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.planner-time-segmented {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 4px;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}
.p-time-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.p-time-tab.active {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.p-time-tab:active {
    transform: scale(0.98);
}
.p-tab-icon {
    font-size: 1em;
    line-height: 1;
}

/* 24h Time Custom Panel */
.p-time-custom-panel {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 12px 14px;
    animation: pTimeFadeIn 0.2s ease-out;
}
.p-time-custom-panel.hidden {
    display: none !important;
}
@keyframes pTimeFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.p-time-24h-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 6px 14px;
    height: 50px;
    position: relative;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}
.p-time-24h-box:focus-within {
    border-color: var(--primary);
}

.p-native-time-trigger {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--primary);
    font-size: 1.15em;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    padding: 0;
}
.p-native-time-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
}
.p-native-time-trigger:active {
    transform: scale(0.92);
}

.p-time-24h-text {
    width: 78px !important;
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 1.45em !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
    text-align: center;
    padding: 0 !important;
    outline: none !important;
}

.p-time-format-tag {
    font-size: 0.7em;
    font-weight: 800;
    color: var(--primary);
    background: rgba(208, 188, 255, 0.12);
    border: 1px solid rgba(208, 188, 255, 0.25);
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.p-time-native-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.p-time-hint {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    line-height: 1.3;
}

/* RESULTS VIEW */
.planner-results {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}
.planner-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.planner-back-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9em;
    cursor: pointer;
    padding: 4px 0;
}
.planner-summary-title {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.planner-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 36px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95em;
}
.planner-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.planner-itineraries-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.planner-itinerary-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s ease;
}
.planner-itinerary-card.has-conflict {
    border-color: rgba(244, 67, 54, 0.4);
    background: rgba(244, 67, 54, 0.03);
}

.planner-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.planner-badges-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.planner-line-pill {
    padding: 3px 8px;
    background: #332d41;
    color: #f3edf7;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.85em;
    border: 1px solid var(--outline);
}
.planner-arrow {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8em;
}
.planner-duration-pill {
    font-size: 0.95em;
    font-weight: 800;
    color: var(--primary);
}
.planner-time-span {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 6px;
}

/* SWIPABLE LEG CARD */
.planner-leg-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    touch-action: pan-y;
    user-select: none;
    position: relative;
    transition: transform 0.15s ease, background 0.15s ease;
}
.planner-swipe-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.planner-swipe-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.78em;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.planner-swipe-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}
.planner-swipe-btn:disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}
.planner-leg-title {
    font-size: 0.8em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 6px;
}
.planner-leg-dest {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.planner-stop-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}
.planner-stop-time {
    font-weight: 800;
    color: var(--on-surface);
    font-variant-numeric: tabular-nums;
    min-width: 44px;
}
.planner-stop-name {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* INTERMEDIATE STOPS */
.planner-intermediate-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    padding: 2px 0 2px 54px;
    transition: color 0.15s ease;
}
.planner-intermediate-toggle:hover {
    color: var(--primary);
}
.planner-intermediate-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 0 6px 54px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: 22px;
}
.planner-sub-stop {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78em;
    color: rgba(255, 255, 255, 0.6);
}
.planner-sub-stop-time {
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}

/* TRANSFER SEGMENT */
.planner-transfer-segment {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    border-left: 2px dashed var(--outline);
    margin-left: 20px;
}
.transfer-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78em;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    width: fit-content;
}
.transfer-status-badge.comfortable {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.transfer-status-badge.tight {
    background: rgba(255, 193, 7, 0.15);
    color: #ffd54f;
    border: 1px solid rgba(255, 193, 7, 0.3);
}
.transfer-status-badge.conflict {
    background: rgba(244, 67, 54, 0.18);
    color: #ef9a9a;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.btn-autofix {
    background: #ef5350 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 7px 12px !important;
    font-size: 0.8em !important;
    cursor: pointer !important;
    width: fit-content;
    box-shadow: 0 2px 6px rgba(239, 83, 80, 0.3);
    transition: transform 0.15s ease;
}
.btn-autofix:active {
    transform: scale(0.96);
}

.planner-maps-fallback {
    text-align: center;
    padding-top: 10px;
}
.planner-maps-fallback a {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8em;
    text-decoration: none;
    transition: color 0.15s ease;
}
.planner-maps-fallback a:hover {
    color: var(--primary);
}

.planner-stop-time.live { color: #81c784 !important; }
.delay-tag.small { font-size: 0.7em; padding: 1px 5px; border-radius: 4px; display: inline-block; font-weight: 800; vertical-align: middle; }
.delay-tag.delayed { color: #ffb74d; background: rgba(255, 183, 77, 0.15); }
.delay-tag.early { color: #81c784; background: rgba(129, 199, 132, 0.15); }

/* Ensure .hidden always hides planner flex containers */
.planner-results.hidden,
.planner-loading.hidden,
.planner-intermediate-list.hidden {
    display: none !important;
}
