@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

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

/* ---- CSS variables: dark (default) ---- */
:root {
    --bg:             #0f0f0f;
    --bg-panel:       #161616;
    --bg-hover:       #1e1e1e;
    --border:         #2a2a2a;
    --border-light:   #333;
    --accent:         #005B99;
    --accent-light:   #0070bb;
    --amber:          #f5a623;
    --green:          #3ecf6e;
    --text-primary:   #f0f0f0;
    --text-secondary: #888;
    --text-dim:       #444;
    --font-ui:        'Barlow', sans-serif;
    --font-mono:      'DM Mono', monospace;
    --popup-bg:       #161616;
    --popup-detail:   #888;
    --tooltip-bg:     #161616;
    --shadow:         rgba(0,0,0,0.5);
    --marker-border:  rgba(255,255,255,0.6);
    --marker-border-light: rgba(255,255,255,0.25);
}

/* ---- CSS variables: light ---- */
:root.light {
    --bg:             #f0f2f4;
    --bg-panel:       #ffffff;
    --bg-hover:       #e8eaed;
    --border:         #d0d4d8;
    --border-light:   #b0b6bc;
    --text-primary:   #0f0f0f;
    --text-secondary: #555;
    --text-dim:       #aaa;
    --popup-bg:       #ffffff;
    --popup-detail:   #555;
    --tooltip-bg:     #ffffff;
    --shadow:         rgba(0,0,0,0.12);
    --marker-border:  rgba(0,0,0,0.4);
    --marker-border-light: rgba(0,0,0,0.15);
}

/* GPU-accelerated smooth marker movement */
.leaflet-marker-icon.smooth-move { will-change: transform; }

body {
    background: var(--bg);
    font-family: var(--font-ui);
    overflow: hidden;
    color: var(--text-primary);
}

#map { width: 100vw; height: 100vh; }

/* ---- Toolbar ---- */
.toolbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    height: 52px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
}

.toolbar-title {
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border);
    gap: 10px;
    transition: background 0.15s;
}

.toolbar-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

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

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

.toolbar-sub {
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 0;
    text-transform: none;
}

.toolbar-chips {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 12px;
    flex: 1;
    min-width: 0;
    height: 100%;
}

.toolbar-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: 2px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.toolbar-chip:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.toolbar-chip.off { opacity: 0.3; }

.toolbar-chip .chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---- Theme toggle — desktop toolbar ---- */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 16px;
    height: 100%;
    flex-shrink: 0;
    transition: all 0.15s;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ---- Hamburger ---- */
.toolbar-menu {
    display: none;
    background: none;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px 16px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
    height: 100%;
    margin-left: auto;
}

.toolbar-menu:hover { color: var(--text-primary); }

/* ---- Toolbar dropdown ---- */
.toolbar-dropdown {
    position: absolute;
    top: 52px; right: 0;
    z-index: 1001;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-top: none;
    padding: 8px 0;
    min-width: 220px;
    box-shadow: 0 8px 24px var(--shadow);
}

.toolbar-dropdown.hidden { display: none; }

.dropdown-chips {
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px 10px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Theme toggle row inside dropdown (mobile) */
.dropdown-theme-btn {
    display: block;
    width: 100%;
    padding: 9px 16px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}

.dropdown-theme-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    padding-left: 20px;
}

@media (max-width: 1024px) {
    .toolbar-sub    { display: none; }
    .toolbar-chips  { display: none; }
    .theme-toggle   { display: none; }
    .toolbar-menu   { display: block; }
    .dropdown-chips { display: flex; }
}

/* ---- Status bar ---- */
.status-bar {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px var(--shadow);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    white-space: nowrap;
    gap: 8px;
}

.status-bar .count    { color: var(--text-primary); font-weight: 500; }
.status-bar .separator { color: var(--text-dim); }
.status-bar a          { color: var(--text-dim); text-decoration: none; transition: color 0.15s; }
.status-bar a:hover    { color: var(--text-secondary); }

/* ---- Leaflet popup ---- */
.leaflet-popup-content-wrapper {
    background: var(--popup-bg) !important;
    color: var(--text-primary) !important;
    border-radius: 2px !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: 0 8px 32px var(--shadow) !important;
}

.leaflet-popup-tip { background: var(--popup-bg) !important; }

.leaflet-popup-content {
    margin: 12px 14px !important;
    font-family: var(--font-ui) !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
}

.leaflet-popup-close-button { color: var(--text-secondary) !important; }

.popup-line {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.popup-detail { color: var(--popup-detail); font-size: 0.82rem; }

/* ---- Leaflet attribution ---- */
.leaflet-control-attribution {
    background: var(--bg-panel) !important;
    color: var(--text-dim) !important;
    font-size: 0.62rem !important;
    border-top: 1px solid var(--border) !important;
}

.leaflet-control-attribution a { color: var(--text-secondary) !important; }

/* ---- Zoom control ---- */
.leaflet-control-zoom {
    position: fixed !important;
    bottom: 140px; right: 12px;
    z-index: 1000;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.leaflet-control-zoom a {
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    font-size: 1.2rem !important;
    background: var(--bg-panel) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    transition: all 0.15s !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-light) !important;
}

/* ---- Tooltips ---- */
.vehicle-tooltip {
    background: var(--tooltip-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 2px !important;
    padding: 2px 7px !important;
    font-family: var(--font-mono) !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 10px var(--shadow) !important;
}

.vehicle-tooltip::before { border-top-color: var(--border-light) !important; }

/* ---- Vehicle dot markers ---- */
.veh-dot { display: flex; align-items: center; justify-content: center; cursor: pointer; }

.veh-dot .veh-body {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--marker-border);
    box-shadow: 0 1px 6px var(--shadow);
    display: flex; align-items: center; justify-content: center;
}

.veh-dot .veh-line {
    color: #fff;
    font-family: var(--font-mono);
    font-size: 7px; font-weight: 500;
    line-height: 1; letter-spacing: -0.5px;
}

.veh-dot.minimal-bus .veh-body {
    width: 7px; height: 7px;
    border-radius: 50%;
    border: 1px solid var(--marker-border-light);
    box-shadow: none;
}

.veh-dot.minimal-rail .veh-body {
    width: 13px; height: 13px;
    border-radius: 50%;
    border: 1.5px solid var(--marker-border);
    box-shadow: 0 1px 3px var(--shadow);
}

.veh-dot.rail .veh-body      { border: 2px solid var(--marker-border); border-radius: 50%; }
.veh-dot.large .veh-body      { width: 28px; height: 28px; border-radius: 50%; }
.veh-dot.large.rail .veh-body { border: 2.5px solid var(--marker-border); }
.veh-dot.large .veh-line      { font-size: 10px; }
.veh-dot.mobile .veh-body     { width: 16px; height: 16px; border-radius: 50%; }
.veh-dot.mobile .veh-line     { font-size: 6px; }
.veh-dot.mobile.large .veh-body { width: 22px; height: 22px; border-radius: 50%; }
.veh-dot.mobile.large .veh-line { font-size: 8px; }

/* ---- Geolocation button ---- */
.locate-btn {
    position: absolute;
    bottom: 54px; right: 12px;
    z-index: 1000;
    width: 40px; height: 40px;
    border-radius: 2px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 12px var(--shadow);
    transition: all 0.15s;
}

.locate-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-light); }
.locate-btn.active { color: var(--accent-light); border-color: var(--accent); }

/* ---- Share button ---- */
.share-btn {
    position: absolute;
    bottom: 100px; right: 12px;
    z-index: 1000;
    width: 40px; height: 40px;
    border-radius: 2px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 12px var(--shadow);
    transition: all 0.15s;
}

.share-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-light); }
.share-btn.copied { color: var(--green); border-color: var(--green); }

/* ---- Station markers ---- */
.station-icon {
    display: flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    border-radius: 2px;
    background: var(--bg-panel);
    font-family: var(--font-mono);
    font-size: 8px; font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
    border: 2px solid;
    box-shadow: 0 1px 4px var(--shadow);
}

.station-tooltip {
    background: var(--tooltip-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 2px !important;
    padding: 4px 8px !important;
    font-family: var(--font-ui) !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase !important;
    box-shadow: 0 4px 16px var(--shadow) !important;
}

.station-tooltip::before { border-top-color: var(--border-light) !important; }

/* ---- Update banner ---- */
.update-banner {
    position: absolute;
    top: 62px; left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    display: flex; align-items: center; gap: 12px;
    padding: 8px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-top: 2px solid var(--accent);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.82rem; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 4px 16px var(--shadow);
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.update-banner button {
    background: var(--accent);
    border: none; color: #fff;
    padding: 4px 12px;
    font-family: var(--font-ui);
    font-size: 0.78rem; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    cursor: pointer; transition: background 0.15s;
}

.update-banner button:hover { background: var(--accent-light); }

/* ---- Screensaver mode ---- */
body.screensaver .toolbar-chips,
body.screensaver .theme-toggle,
body.screensaver .toolbar-menu,
body.screensaver .toolbar-dropdown,
body.screensaver .share-btn,
body.screensaver .locate-btn,
body.screensaver .leaflet-control-zoom,
body.screensaver .leaflet-control-attribution { display: none !important; }
body.screensaver { cursor: none; }

/* ---- Departures Sidebar ---- */
.departures-sidebar {
    position: fixed;
    top: 52px; right: 0; bottom: 0;
    width: 300px;
    z-index: 999;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow: hidden;
    box-shadow: -4px 0 24px var(--shadow);
}

.departures-sidebar.open { transform: translateX(0); }

.departures-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.departures-header-icon {
    width: 26px; height: 26px;
    border-radius: 2px;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0;
}

.departures-header-text { flex: 1; min-width: 0; }

.departures-station-name {
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 1rem; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.departures-subtitle {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.65rem; margin-top: 2px;
}

.departures-close {
    background: none;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-size: 1rem; cursor: pointer;
    padding: 4px 6px; line-height: 1;
    transition: all 0.15s; flex-shrink: 0;
    font-family: var(--font-mono);
}

.departures-close:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.departures-list {
    flex: 1; overflow-y: auto; padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.departures-list::-webkit-scrollbar { width: 3px; }
.departures-list::-webkit-scrollbar-track { background: transparent; }
.departures-list::-webkit-scrollbar-thumb { background: var(--border-light); }

.departure-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.departure-row:hover { background: var(--bg-hover); }
.departure-row:last-child { border-bottom: none; }

.departure-line-badge {
    width: 34px; height: 22px;
    border-radius: 2px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.72rem; font-weight: 500;
    color: #fff; flex-shrink: 0;
}

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

.departure-destination {
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.88rem; font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.departure-platform {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.65rem; margin-top: 1px;
}

.departure-time {
    font-family: var(--font-mono);
    font-size: 0.85rem; font-weight: 500;
    flex-shrink: 0; min-width: 38px; text-align: right;
}

.departure-time.now   { color: var(--amber); }
.departure-time.soon  { color: var(--text-primary); }
.departure-time.later { color: var(--text-secondary); }

.departures-loading {
    display: flex; align-items: center; justify-content: center;
    height: 80px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.78rem; letter-spacing: 0.05em;
}

.departures-footer {
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.65rem; text-align: center; flex-shrink: 0;
}

/* ---- Journey planner toolbar button ---- */
.journey-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0 16px;
    height: 100%;
    flex-shrink: 0;
    transition: all 0.15s;
}

.journey-btn:hover,
.journey-btn.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.journey-btn.active {
    border-bottom: 2px solid var(--accent);
}

/* ---- Journey planner panel ---- */
.journey-panel {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: 0;
    width: 320px;
    z-index: 999;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px var(--shadow);
    overflow: hidden;
}

.journey-panel.hidden { display: none; }
.journey-panel.open   { display: flex; }

.journey-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg);
}

.journey-panel-title {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.journey-panel-close {
    background: none;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 3px 6px;
    font-family: var(--font-mono);
    transition: all 0.15s;
}

.journey-panel-close:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--bg-hover);
}

/* ---- Inputs ---- */
.journey-inputs {
    padding: 12px 14px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
}

.journey-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.journey-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

.journey-input {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.15s;
    border-radius: 0;
    -webkit-appearance: none;
}

.journey-input:focus {
    border-color: var(--accent);
}

.journey-input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

/* ---- Autocomplete dropdown ---- */
.journey-suggestions {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    z-index: 1010;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-top: none;
    list-style: none;
    margin: 0; padding: 0;
    box-shadow: 0 6px 20px var(--shadow);
    max-height: 200px;
    overflow-y: auto;
}

.journey-suggestions.hidden { display: none; }

.journey-suggestions li {
    padding: 8px 12px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: all 0.1s;
}

.journey-suggestions li:last-child { border-bottom: none; }

.journey-suggestions li:hover,
.journey-suggestions li.selected {
    background: var(--bg-hover);
    color: var(--text-primary);
    padding-left: 16px;
}

/* ---- Swap button ---- */
.journey-swap {
    align-self: flex-end;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1rem;
    width: 28px; height: 28px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
    z-index: 1;
}

.journey-swap:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--bg-panel);
}

/* ---- Search button ---- */
.journey-search-btn {
    width: 100%;
    padding: 9px;
    background: var(--accent);
    border: none;
    color: #fff;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 4px;
}

.journey-search-btn:hover { background: var(--accent-light); }
.journey-search-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Results area ---- */
.journey-results {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.journey-results::-webkit-scrollbar { width: 3px; }
.journey-results::-webkit-scrollbar-thumb { background: var(--border-light); }

.journey-placeholder {
    padding: 24px 16px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.6;
    text-align: center;
}

.journey-loading {
    padding: 32px 16px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-align: center;
}

.journey-error {
    padding: 16px;
    color: #e05050;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    border: 1px solid rgba(224, 80, 80, 0.2);
    margin: 12px;
    background: rgba(224, 80, 80, 0.05);
}

/* ---- Trip card ---- */
.journey-trip {
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.1s;
}

.journey-trip:hover { background: var(--bg-hover); }

.journey-trip.active {
    background: var(--bg-hover);
    border-left: 2px solid var(--accent);
    padding-left: 12px;
}

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

.journey-trip-duration {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.journey-trip-times {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.journey-trip-legs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.journey-leg-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: #fff;
    border-radius: 2px;
}

.journey-leg-walk {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.journey-leg-arrow {
    color: var(--text-dim);
    font-size: 0.65rem;
}

/* ---- Leg detail (shown below selected trip) ---- */
.journey-trip-detail {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.journey-stop-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.journey-stop-time {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
    min-width: 36px;
    flex-shrink: 0;
}

.journey-stop-name {
    color: var(--text-primary);
    font-weight: 500;
}

.journey-stop-name.transfer {
    color: var(--accent-light);
    font-weight: 600;
}

a.journey-btn { text-decoration: none; }

/* ---- Mobile ---- */
@media (max-width: 600px) {
    .departures-sidebar { width: 100%; top: 52px; }
    .status-bar { bottom: 8px; font-size: 0.65rem; padding: 0 12px; }
    .journey-panel { width: 85%; max-width: 320px; }

    /* Toolbar fixes */
    .toolbar-title { font-size: 0.85rem; padding: 0 12px; }
    .toolbar-sub { display: none; }
    .journey-btn { padding: 0 10px; font-size: 0.75rem; }
    .theme-toggle { padding: 0 10px; }
    .journey-input { font-size: 16px; }
}