/* StopBoard — app.css */
* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens — Light (base) ── */
:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --live: #16a34a;
    --dim: #e2e8f0;
    --label: #475569;
    --bus-glow: rgba(22, 163, 74, 0.25);
    --text-secondary: #334155;
    --route-meta: #64748b;
    --card-bg: rgba(255, 255, 255, 0.85);
    --hero-card-bg: rgba(255, 255, 255, 0.97);
    --separator: rgba(0, 0, 0, 0.07);
    --hover-bg: rgba(0, 0, 0, 0.03);
    --chip-bg: rgba(0, 0, 0, 0.06);
    --map-overlay-bg: rgba(248, 250, 252, 0.92);
    --eta-green: #22c55e;
    --eta-amber: #f59e0b;
    --eta-red:   #ef4444;
    --eta-blue:  #60a5fa;
    --eta-muted: #6b7280;
    --font-mono: 'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --font-sans: 'Instrument Sans', system-ui, -apple-system, sans-serif;
    --bg-secondary: #eef2f7;
}

/* ── Dark theme ── */
[data-theme="dark"] {
    --bg: #050a0e;
    --surface: #0c1219;
    --border: #1a2332;
    --text: #e8edf2;
    --muted: #5a6a7a;
    --live: #34d27b;
    --dim: #2a3442;
    --label: #8fa3b8;
    --bus-glow: rgba(52, 210, 123, 0.25);
    --text-secondary: #cbd5e1;
    --route-meta: #4b5563;
    --card-bg: rgba(15, 23, 42, 0.7);
    --hero-card-bg: rgba(15, 23, 42, 0.85);
    --separator: rgba(255, 255, 255, 0.06);
    --hover-bg: rgba(255, 255, 255, 0.03);
    --chip-bg: rgba(255, 255, 255, 0.06);
    --map-overlay-bg: rgba(12, 14, 20, 0.82);
    --eta-muted: #9ca3af;
    --bg-secondary: #0f1923;
}

body {
    font-family: 'Instrument Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'Space Mono', monospace; }

@keyframes shimmer {
    0% { background-position: -300px 0; }
    100% { background-position: 300px 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
    background-size: 600px 100%;
    animation: shimmer 1.8s infinite;
    border-radius: 4px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.route-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.route-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.route-number {
    font-family: 'Space Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.route-destination {
    color: var(--label);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    flex: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-destination.is-empty {
    display: none;
}

.route-eta {
    font-family: 'Space Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Track ── */
.track {
    position: relative;
    height: 56px;
    overflow: visible;
    -webkit-user-select: none;
    user-select: none;
}

.track-rail {
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
}

.track-node {
    position: absolute;
    top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
}

.track-node-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--label);
}

.track-node-label {
    font-size: 12px;
    line-height: 1.25;
    color: var(--label);
    margin-top: 4px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    font-weight: 500;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
}

.track-you {
    position: absolute;
    right: 0;
    top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
    -webkit-user-select: none;
    user-select: none;
}

.track-you-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 8px var(--bus-glow);
}

.track-you-label {
    font-size: 9px;
    color: var(--label);
    margin-top: 4px;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.track-bus {
    position: absolute;
    left: 42%;
    top: -4px;
    z-index: 5;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.track-bus img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px var(--bus-glow));
}

@keyframes busIdle {
    0%   { transform: translateX(-50%) translateY(0px) rotate(0deg); }
    10%  { transform: translateX(-50%) translateY(-0.6px) rotate(0.3deg); }
    20%  { transform: translateX(-50%) translateY(0.3px) rotate(-0.2deg); }
    35%  { transform: translateX(-50%) translateY(-0.8px) rotate(0.4deg); }
    50%  { transform: translateX(-50%) translateY(0px) rotate(0deg); }
    60%  { transform: translateX(-50%) translateY(-0.4px) rotate(-0.3deg); }
    75%  { transform: translateX(-50%) translateY(0.5px) rotate(0.2deg); }
    85%  { transform: translateX(-50%) translateY(-0.3px) rotate(-0.15deg); }
    100% { transform: translateX(-50%) translateY(0px) rotate(0deg); }
}

.track-bus.is-live {
    animation: busIdle 1.8s ease-in-out infinite;
}

.track-bus.is-live img {
    filter: drop-shadow(0 0 8px var(--bus-glow));
}

.track-bus.is-stale img {
    filter: grayscale(0.7) brightness(0.7);
}

@keyframes busGlow {
    0%, 100% { filter: drop-shadow(0 0 6px var(--bus-glow)); }
    50% { filter: drop-shadow(0 0 14px var(--bus-glow)) drop-shadow(0 0 22px rgba(52, 210, 123, 0.12)); }
}

.track-counter {
    position: absolute;
    left: 56%;
    top: 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--label);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 4;
}

.track-counter.is-next {
    color: var(--live);
}

.track-arrived {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    animation: fadeIn 0.3s ease-out;
    will-change: opacity;
}

.track-arrived img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.track-arrived-text {
    font-family: 'Space Mono', monospace;
    font-size: 15px;
    font-weight: 700;
    color: var(--live);
    letter-spacing: 0.02em;
}

.track-empty {
    font-size: 11px;
    color: var(--muted);
    line-height: 56px;
    text-align: center;
}

.eta-disclaimer {
    font-size: 0.8rem;
    opacity: 0.6;
    text-align: center;
}

/* ── Bottom sheet ── */
.bottom-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 60;
    max-height: 60vh;
    overflow-y: auto;
    max-width: 420px;
    margin: 0 auto;
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 55;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.bottom-sheet-overlay.open { opacity: 1; pointer-events: auto; }

/* ── Footer attribution ── */
.footer-attribution {
    font-size: 0.65rem;
    color: var(--muted);
    text-align: center;
    padding-top: 2px;
    padding-bottom: 4px;
}
.footer-attribution .footer-link {
    color: inherit;
    text-decoration: none;
}
.footer-attribution .footer-link:hover { text-decoration: underline; }

.hidden { display: none !important; }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Header ── */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    margin: -20px -20px 12px;
    padding: 12px 16px;
    cursor: pointer;
}
.header-brand { display: flex; align-items: center; gap: 8px; }
.header-logo { width: 22px; height: 22px; border-radius: 5px; }
.header-title { font-size: 18px; font-weight: 500; color: var(--muted); }
.header-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: inline-block; }

/* ── Header action buttons (bookmark, share, theme) ── */
.btn-header-action {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--label);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.2s;
}
.btn-header-action:active { background: var(--border); }
.btn-header-action svg { fill: none; }
.btn-header-action.btn-bookmark--active svg { fill: currentColor; }

/* ── Theme toggle ── */
.btn-theme-toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--label);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.2s;
}
.btn-theme-toggle:active { background: var(--border); }
[data-theme="dark"] .btn-theme-toggle {
    background: rgba(52, 210, 123, 0.10);
    border-color: rgba(52, 210, 123, 0.20);
    color: #34d27b;
}
/* Light mode: show sun icon */
.icon-sun  { display: flex; align-items: center; justify-content: center; }
.icon-moon { display: none; }
/* Dark mode: swap to moon */
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: flex; align-items: center; justify-content: center; }

.skeleton-title { height: 24px; width: 60%; margin-bottom: 8px; }
.skeleton-subtitle { height: 14px; width: 30%; margin-bottom: 32px; }
.skeleton-row { height: 48px; width: 100%; margin-bottom: 8px; }
.skeleton-row:last-child { margin-bottom: 0; }


.bookmark-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    margin-top: 0;
    padding-bottom: 12px;
    scrollbar-width: none;
}
.bookmark-chips::-webkit-scrollbar { display: none; }
.bookmark-chip {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: background 0.15s;
}
.bookmark-chip--active {
    background: var(--live);
    border-color: var(--live);
    color: #fff;
}
.bookmark-chip:not(.bookmark-chip--active):active { background: var(--border); }

.board-header { margin-bottom: 24px; }
.btn-bookmark,
.btn-share {
    background: var(--chip-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--label);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.2s;
}
.btn-bookmark { margin-left: auto; }
.btn-bookmark:active,
.btn-share:active { background: var(--border); }
.btn-bookmark svg { fill: none; }
.btn-bookmark--active svg { fill: currentColor; }
.stop-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.stop-name { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.stop-status-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding-bottom: 1px;
}
.stop-status { font-size: 13px; color: var(--muted); margin-top: 4px; }

.board-actions {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 20px max(8px, env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.18);
}
.board-actions .eta-disclaimer {
    margin-top: 0;
    font-size: 0.65rem;
}

.app-container { max-width: 420px; margin: 0 auto; padding: 20px 20px calc(140px + env(safe-area-inset-bottom, 0px)); min-height: 100vh; }


.footer-link { color: var(--muted); text-decoration: underline; }

/* ── Inline search bar ── */
.board-search-wrap {
    position: relative;
    width: 100%;
}
.board-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 10px 8px 12px;
}
.search-bar-icon {
    color: var(--muted);
    flex-shrink: 0;
}
.search-bar-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    min-width: 0;
}
.search-bar-input::placeholder { color: var(--muted); }
.search-results {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    z-index: 1;
    padding: 6px 0;
}
.search-results .search-overline { padding: 6px 16px 4px; }
.search-results .search-recents-chips { padding: 0 16px 8px; }
.search-results .stop-result-row { padding-left: 16px; padding-right: 16px; }
.search-results .search-no-results { padding: 8px 16px; }
.search-bar-hint {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    padding: 5px 0 0;
    opacity: 0.7;
    line-height: 1.4;
}
.hint-locate-icon {
    display: inline-block;
    vertical-align: middle;
    margin: 0 1px -1px;
    color: var(--muted);
}

/* ── Route card ── */
.route-card {
    position: relative;
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 10px;
    background: var(--card-bg);
    border-left: 3px solid var(--border);
    animation: fadeIn 0.4s ease-out both;
}
.route-card.live-ontime     { border-left-color: #22c55e; }
.route-card.live-delayed    { border-left-color: #f59e0b; }
.route-card.live-early      { border-left-color: #3b82f6; }
.route-card.live-approaching { border-left-color: #ef4444; }
.route-card.scheduled-only  { border-left-color: #374151; opacity: 0.7; }

/* ETA prominent */
.eta-primary {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1;
    transition: color 0.3s ease;
}
.eta-primary.eta-green { color: var(--eta-green); }
.eta-primary.eta-amber { color: var(--eta-amber); }
.eta-primary.eta-red   { color: var(--eta-red); }
.eta-primary.eta-blue  { color: var(--eta-blue); }
.eta-primary.eta-muted { color: var(--eta-muted); }
.eta-unit {
    font-size: 14px;
    color: var(--eta-muted);
    margin-left: 4px;
}
@keyframes etaPulse {
    0%   { opacity: 0.5; transform: scale(1.08); }
    100% { opacity: 1;   transform: scale(1); }
}
.eta-corrected { animation: etaPulse 0.6s ease-out; }

/* Status pills */
.status-pill {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.pill-ontime     { background: rgba(34, 197, 94, 0.12);  color: var(--eta-green); }
.pill-delayed    { background: rgba(245, 158, 11, 0.12); color: var(--eta-amber); }
.pill-early      { background: rgba(96, 165, 250, 0.12); color: var(--eta-blue);  }
.pill-approaching { background: rgba(239, 68, 68, 0.12);  color: var(--eta-red);  }

/* Live dot pulse */
.live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: livePulse 1.5s infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Metadata line */
.route-meta {
    font-size: 11px;
    color: var(--route-meta);
    margin-top: 6px;
}
.sched-dim {
    font-size: 11px;
    color: var(--muted);
}
.live-age-text {
    font-size: 11px;
    color: var(--route-meta);
    margin-top: 4px;
}
.arrival-tap-wrap {
    margin-top: 6px;
}
.btn-arrival-tap {
    font-size: 11px;
    color: var(--route-meta);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.btn-arrival-tap:disabled {
    text-decoration: none;
    color: var(--live);
    cursor: default;
}

/* ── "I see this bus" sighting button ── */
.btn-see-bus {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    color: var(--label);
    background: var(--chip-bg);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 3px 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-see-bus:active { background: var(--border); }

/* ── Micro-toast ── */
.sb-toast {
    position: fixed;
    bottom: 128px;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 50;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    white-space: normal;
    word-wrap: break-word;
    max-width: min(360px, calc(100vw - 32px));
    text-align: center;
}
.sb-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Live Map button — absolute square on right, vertically centred ── */
.route-card.has-map-btn { padding-right: 4.5rem; }

.btn-track-map {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(52, 210, 123, 0.08);
    border: 1px solid rgba(52, 210, 123, 0.2);
    border-radius: 8px;
    color: var(--live);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.3;
    letter-spacing: 0.01em;
}
.btn-track-map:active { background: rgba(52, 210, 123, 0.15); }

/* ── Map screen ── */
.map-screen {
    position: fixed;
    top: 0; bottom: 0; left: 0; right: 0;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    z-index: 100;
}
.map-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.map-back-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    flex-shrink: 0;
}
.map-route-label {
    font-size: 13px;
    color: var(--label);
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.map-leaflet-container {
    flex: 1;
    min-height: 0;
    position: relative;
}
.leaflet-container img {
    max-width: none;
    box-shadow: none;
}
.leaflet-container {
    visibility: visible !important;
    filter: none !important;
}
.map-bottom-card {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    max-height: 40vh;
    overflow-y: auto;
}
.map-eta-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}
.map-eta-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--live);
    font-family: 'Space Mono', monospace;
}
.map-eta-label {
    font-size: 13px;
    color: var(--muted);
}
.map-position-meta {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

/* Reliability section on map screen */
.map-reliability-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.reliability-bar-heading {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
}
.reliability-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    background: var(--border);
}
.reliability-seg { height: 100%; }
.reliability-seg--late   { background: #ef4444; }
.reliability-seg--ontime { background: #22c55e; }
.reliability-seg--early  { background: #3b82f6; }
.reliability-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}
.reliability-bar-label             { font-size: 11px; font-weight: 500; }
.reliability-bar-label--late       { color: #ef4444; }
.reliability-bar-label--ontime     { color: #22c55e; }
.reliability-bar-label--early      { color: #3b82f6; }

/* Bus marker on map */
.bus-map-pin {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--live);
    border: 2.5px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35), 0 0 0 4px rgba(52,210,123,0.18);
    transition: transform 0.5s ease;
}

/* ETA badge — floats over bottom-left of map tiles */
.map-eta-badge {
    background: var(--map-overlay-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 72px;
    text-align: center;
    pointer-events: none;
    margin-left: 2px;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.map-eta-badge-value {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    line-height: 1.2;
}
.map-eta-badge-label {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.03em;
}
.map-eta-badge .eta-red   { color: #ef4444; }
.map-eta-badge .eta-amber { color: #f59e0b; }
.map-eta-badge .eta-green { color: var(--live); }

/* Connector curve animation */
.bus-connector-line { animation: connectorDash 1.4s linear infinite; }
@keyframes connectorDash { to { stroke-dashoffset: -28; } }

/* Stop marker on map */
.stop-map-icon { background: none; border: none; }

/* ── Board header live dot ── */
.stop-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--live);
    animation: livePulse 1.5s infinite;
    margin-right: 5px;
    vertical-align: middle;
}

/* ── NEXT BUS eyebrow ── */
.hero-eyebrow {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding-left: 4px;
    margin-bottom: 8px;
    margin-top: 4px;
}

/* ── Hero card ── */
.hero-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 18px 18px 16px 20px;
    border-radius: 14px !important;
    background: var(--hero-card-bg) !important;
    margin-bottom: 0;
    cursor: pointer;
}
.hero-card.tappable { cursor: pointer; }
.hero-card .hero-eta-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    min-width: 72px;
    padding-right: 0;
}
.hero-card .route-eta-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}
.hero-card .eta-primary {
    font-family: 'Space Mono', monospace;
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    transition: color 0.3s ease;
}
.hero-card .eta-primary.eta-due {
    font-size: 38px;
    letter-spacing: -0.02em;
}
.hero-card .eta-unit {
    font-family: 'Space Mono', monospace;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--eta-muted);
    margin-left: 0;
    margin-top: 6px;
    letter-spacing: 0;
}
.hero-info-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 5px;
}
.hero-row1 {
    display: flex;
    align-items: center;
    gap: 8px;
}
.route-chip {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    background: var(--chip-bg);
    padding: 3px 8px;
    border-radius: 4px;
}
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--live);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.live-dot-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--live);
    animation: livePulse 1.5s infinite;
}
.live-indicator.stale { color: var(--muted); }
.live-indicator.stale .live-dot-indicator { background: var(--muted); animation: none; }

.hero-dest {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hero-meta {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.4;
}
.hero-chevron {
    position: absolute;
    top: 14px;
    right: 14px;
}

/* State-coloured meta prefixes */
.meta-state-ontime      { color: #22c55e; }
.meta-state-delayed     { color: #fbbf24; }
.meta-state-early       { color: #60a5fa; }
.meta-state-approaching { color: #ef4444; }

/* ── Section divider ── */
.section-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 20px 0 4px;
}
.section-divider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--live);
    animation: livePulse 1.5s infinite;
    flex-shrink: 0;
}
.section-divider-rule {
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.14);
}
[data-theme="light"] .section-divider-rule { background: rgba(0,0,0,0.12); }
.section-divider-count {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
}

/* ── Departure row ── */
.departure-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-radius: 0 !important;
    border-left: none !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 0;
    animation: none;
    cursor: pointer;
}
[data-theme="light"] .departure-row { border-bottom-color: var(--separator); }
.departure-row:active { opacity: 0.75; }
.departure-row.scheduled-row { opacity: 0.65; cursor: default; }

.dep-row-info { flex: 1; min-width: 0; }
.dep-row-dest {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
[data-theme="light"] .dep-row-dest { color: var(--text-secondary); }

.dep-row-eta { text-align: right; flex-shrink: 0; }
.dep-eta-num {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 22px;
    line-height: 1;
    transition: color 0.3s ease;
}
.dep-eta-num.eta-green { color: #22c55e; }
.dep-eta-num.eta-amber { color: #f59e0b; }
.dep-eta-num.eta-red   { color: #ef4444; }
.dep-eta-num.eta-blue  { color: #60a5fa; }
.dep-eta-num.eta-muted { color: #9ca3af; }
.dep-eta-unit {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #9ca3af;
    margin-left: 3px;
}

/* Keep these for additional-bus rows that still use old structure */
.dep-route {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.02em;
}
.dep-info { min-width: 0; }
.dep-dest {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dep-meta {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.3;
}
.dep-eta {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0;
}
.departure-row .route-eta-block {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
}
.departure-row .eta-primary {
    font-family: 'Space Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    transition: color 0.3s ease;
}
.departure-row .eta-primary.eta-due { font-size: 20px; }
.departure-row .eta-primary.sched-time { font-size: 17px; font-weight: 500; }
.dep-chevron { display: flex; justify-content: flex-end; align-items: center; flex-shrink: 0; }
.dep-arrival-tap { margin-top: 0; padding: 0; }
.departure-row .arrival-tap-wrap { margin-top: 2px; flex-basis: 100%; }

/* ── Map route label area ── */
.map-route-num {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    color: var(--text);
    margin-right: 4px;
}
.map-route-arrow { color: var(--label); }
.map-topbar-eta-wrap {
    display: flex;
    align-items: baseline;
    gap: 3px;
    flex-shrink: 0;
}
.map-topbar-eta-value {
    font-family: 'Space Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--live);
    line-height: 1;
    letter-spacing: -0.02em;
}
.map-topbar-eta-value.eta-red   { color: #ef4444; }
.map-topbar-eta-value.eta-amber { color: #f59e0b; }
.map-topbar-eta-value.map-eta-live { color: var(--live); }
.map-topbar-eta-value.eta-muted { color: var(--eta-muted); }
.map-topbar-eta-unit {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--eta-muted);
}

/* ── New bus map pin ── */
.bus-marker-container {
    position: relative;
    width: 48px;
    height: 48px;
}
.bus-map-pin-new {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: 2.5px solid var(--live);
    box-shadow: 0 2px 14px rgba(0,0,0,0.45), 0 0 0 5px rgba(52,210,123,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}
.bearing-cone-svg {
    position: absolute;
    left: 50%;
    top: 50%;
    pointer-events: none;
    overflow: visible;
}

/* ── Stop marker with YOUR STOP tag ── */
.stop-marker-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.stop-map-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 10px var(--bus-glow), 0 0 0 4px rgba(52,210,123,0.15);
}
.stop-map-tag {
    font-size: 10px;
    font-weight: 700;
    color: #0c1219;
    background: var(--live);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 5px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* ── Recenter FAB ── */
.map-recenter-fab {
    position: absolute;
    right: 12px;
    bottom: 32px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--map-overlay-bg);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    color: var(--live);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.map-recenter-fab:active { background: var(--surface); }

/* ── Map bottom card ── */
.map-bottom-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    color: var(--label);
    margin-bottom: 12px;
}
.map-to-label { color: var(--label); }
.map-dest-label { color: var(--text); font-weight: 600; }
.map-updated-label {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--muted);
}

/* ── Empty state ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 48px 28px;
    min-height: 40vh;
}
.empty-state-headline {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}
.empty-state-body {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.6;
    max-width: 280px;
}
.empty-state-icon {
    display: inline-block;
    vertical-align: middle;
    margin: 0 1px -1px;
    color: var(--muted);
}
.empty-state-note {
    font-size: 12px;
    color: var(--muted);
    opacity: 0.65;
    max-width: 260px;
}
.search-overline {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 8px;
}
.search-recents-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.recent-chip {
    font-size: 12px;
    padding: 4px 8px 4px 12px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.recent-chip:active { background: var(--border); }
.recent-chip-label {
    background: none;
    border: none;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    padding: 2px 0;
}
.recent-chip-remove {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 10px;
    cursor: pointer;
    font-family: inherit;
    padding: 2px 3px;
    line-height: 1;
    opacity: 0.6;
    border-radius: 99px;
}
.recent-chip-remove:hover { opacity: 1; }
.recent-chip-remove:active { background: var(--border); opacity: 1; }
.stop-result-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--separator);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.stop-result-row:active { background: var(--hover-bg); }
.stop-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(52,210,123,0.08);
    border: 1px solid rgba(52,210,123,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--live);
    font-size: 14px;
    flex-shrink: 0;
}
.stop-result-info { flex: 1; min-width: 0; }
.stop-result-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}
.stop-result-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
    text-align: left;
}
.stop-result-dist {
    font-family: 'Space Mono', monospace;
    color: var(--label);
}
.stop-result-routes {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100px;
}
.route-num-chip {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--chip-bg);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.search-no-results {
    color: var(--muted);
    font-size: 13px;
    padding: 8px 0;
}
.stop-dest-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.nearby-dest-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ── Locate button ── */
.btn-locate {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--chip-bg);
    border: none;
    color: var(--label);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.2s;
}
.btn-locate:active { background: var(--border); }
@keyframes locateSpin {
    to { transform: rotate(360deg); }
}
.btn-locate--loading svg {
    animation: locateSpin 0.8s linear infinite;
    transform-origin: center;
}

/* ── Save prompt ── */
.save-prompt {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text);
}
.save-prompt-text { flex: 1; color: var(--text-secondary); }
.save-prompt-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--live);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 2px 6px;
    white-space: nowrap;
}
.save-prompt-dismiss {
    font-size: 12px;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 2px 4px;
    line-height: 1;
    opacity: 0.6;
}
.save-prompt-dismiss:hover { opacity: 1; }

/* ── Tailwind utility replacements ────────────────────────────────────────── */
/* Exact Tailwind default-scale values; replaces cdn.tailwindcss.com          */

/* Colors */
.bg-stone-50      { background-color: #fafaf9; }
.text-stone-300   { color: #d6d3d1; }
.text-stone-400   { color: #a8a29e; }
.text-stone-600   { color: #57534e; }
.text-stone-800   { color: #292524; }
.border-stone-200 { border-color: #e7e5e4; }

/* Typography */
.text-xs          { font-size: 0.75rem;  line-height: 1rem; }
.text-sm          { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg          { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl         { font-size: 1.5rem;   line-height: 2rem; }
.leading-relaxed  { line-height: 1.625; }
.underline        { text-decoration-line: underline; }

/* Margin */
.mt-2             { margin-top: 0.5rem; }
.mt-6             { margin-top: 1.5rem; }
.mt-10            { margin-top: 2.5rem; }
.mb-2             { margin-bottom: 0.5rem; }
.mb-8             { margin-bottom: 2rem; }
.mx-auto          { margin-left: auto; margin-right: auto; }

/* Padding */
.px-5             { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-10            { padding-top: 2.5rem;   padding-bottom: 2.5rem; }
.pt-6             { padding-top: 1.5rem; }

/* Layout */
.max-w-lg         { max-width: 32rem; }
.min-h-screen     { min-height: 100vh; }
.border-t         { border-top-width: 1px; border-top-style: solid; }

/* Stacked-children spacing */
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Hover variants */
.hover\:text-stone-600:hover { color: #57534e; }
.hover\:text-stone-800:hover { color: #292524; }

/* ── Stop pills nav wrapper ── */
.pills-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 20px;
    max-width: 420px;
    margin: 0 auto 16px;
}

/* Scrollable pills track with right-edge fade */
.pills-track {
    position: relative;
    flex: 1;
    min-width: 0;
}
.pills-track::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 52px;
    background: linear-gradient(to right, transparent, var(--bg));
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 1;
}
.pills-nav.at-end .pills-track::after { opacity: 0; }

/* ── Stop pills row ── */
.stop-pills-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}
.stop-pills-row::-webkit-scrollbar { display: none; }

/* ── Pills chevron buttons ── */
.pills-chevron {
    /* hidden on touch devices by default */
    display: none;
}
@media (hover: hover) {
    .pills-chevron {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        flex-shrink: 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
        color: var(--label);
        cursor: pointer;
        padding: 0;
        transition: background 0.15s, opacity 0.15s;
        opacity: 1;
    }
    .pills-chevron:active { background: var(--border); }
    .pills-chevron.is-hidden {
        opacity: 0;
        pointer-events: none;
    }
}
.stop-pill {
    background: transparent;
    color: var(--label);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.15s;
}
.stop-pill:active { background: var(--border); }
.stop-pill.active {
    background: #34d27b;
    color: #050a0e;
    border-color: transparent;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.stop-pill.active::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(0,0,0,0.30);
    flex-shrink: 0;
}

/* ── Stop meta row (direction badge + area) ── */
.stop-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
    flex-wrap: wrap;
}
.direction-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--label);
    background: rgba(255,255,255,0.06);
    padding: 2px 9px;
    border-radius: 4px;
    letter-spacing: 0.01em;
}
[data-theme="light"] .direction-badge { background: rgba(0,0,0,0.06); }
.stop-area {
    font-size: 11px;
    color: var(--muted);
}

/* ── Section overline ── */
.section-overline {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding-left: 4px;
    margin-bottom: 8px;
    margin-top: 4px;
}

/* ── Hero card V3 ── */
.route-card--hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 3px;
    padding: 14px 14px 12px 16px;
    border-radius: 14px !important;
    cursor: pointer;
    margin-bottom: 0;
}

/* Route badge chip */
.route-badge {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    color: #e8edf2;
    background: rgba(255,255,255,0.08);
    padding: 3px 9px;
    border-radius: 5px;
    line-height: 1.2;
}
[data-theme="light"] .route-badge { color: var(--text); background: var(--chip-bg); }
.route-badge--variant {
    color: #a5b4fc;
    background: rgba(165,180,252,0.10);
}

/* ETA right column for new hero */
.route-card--hero .hero-eta-col {
    grid-column: 3;
    grid-row: 1 / 4;
    align-self: center;
    justify-self: end;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.route-card--hero .hero-eta-number {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 72px;
    line-height: 1;
    letter-spacing: -0.05em;
    transition: color 0.3s ease;
}
.route-card--hero .hero-eta-number.eta-green { color: #22c55e; }
.route-card--hero .hero-eta-number.eta-amber { color: #f59e0b; }
.route-card--hero .hero-eta-number.eta-red   { color: #ef4444; }
.route-card--hero .hero-eta-number.eta-blue  { color: #60a5fa; }
.route-card--hero .hero-eta-number.eta-muted { color: #9ca3af; }
.route-card--hero .hero-eta-unit-v3 {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: #9ca3af;
    margin-top: 3px;
    text-align: right;
}
.route-card--hero .hero-due-time {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    margin-top: 5px;
}

/* Hero grid cell placements */
.route-card--hero .hero-route-num {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #e8edf2;
    background: rgba(255,255,255,0.10);
    padding: 8px 12px;
    border-radius: 8px;
    white-space: nowrap;
}
[data-theme="light"] .route-card--hero .hero-route-num { color: var(--text); background: var(--chip-bg); }

.hero-live-cell {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    padding-top: 1px;
}

.hero-stops-away-line {
    grid-column: 1 / 3;
    grid-row: 3;
    align-self: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 3px;
}

.route-card--hero .hero-progress-wrap {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 2px;
}

.route-card--hero .hero-strip {
    grid-column: 1 / -1;
    grid-row: 5;
}

.route-card--hero .arrival-tap-wrap {
    grid-column: 1 / -1;
}

/* Live indicator (new naming avoids conflict) */
.live-indicator-v3 {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #34d27b;
}
.live-dot-v3 {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #34d27b;
    animation: livePulse 1.5s infinite;
    flex-shrink: 0;
}
.live-indicator-v3.is-stale { color: var(--muted); }
.live-indicator-v3.is-stale .live-dot-v3 { background: var(--muted); animation: none; }

/* Hero dest (overrides old .hero-dest if needed) */
.route-card--hero .hero-dest {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    padding-bottom: 1px;
    font-size: 15px;
    font-weight: 600;
    color: #e8edf2;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
[data-theme="light"] .route-card--hero .hero-dest { color: var(--text); }

.route-card--hero .hero-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--muted);
}
.route-card--hero .hero-meta svg { flex-shrink: 0; }
.route-card--hero .meta-loc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.route-card--hero .meta-stops-away {
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.meta-sep { color: rgba(255,255,255,0.15); }
[data-theme="light"] .meta-sep { color: rgba(0,0,0,0.15); }

/* Bottom strip */
.hero-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 4px;
}
[data-theme="light"] .hero-strip { border-top-color: rgba(0,0,0,0.10); }
.btn-track-bus {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 8px;
}
.btn-track-bus:hover { color: var(--label); }

/* ── Section dividers (new BEM naming) ── */
.section-divider--live .section-divider-label,
.section-divider--live .section-divider-count {
    color: #34d27b;
}
.section-divider--live .section-divider-dot { background: #34d27b; }

/* ── Flat scheduled list ── */
.sched-list-scroll {
    max-height: 320px;
    overflow-y: auto;
}
.sched-flat-row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sched-list-scroll--secondary .sched-flat-row { opacity: 0.82; }
.sched-flat-row:last-child { border-bottom: none; }
[data-theme="light"] .sched-flat-row { border-bottom-color: var(--separator); }
.sched-flat-dest-icon {
    display: flex;
    align-items: center;
    color: var(--muted);
    opacity: 0.5;
    flex-shrink: 0;
}
.sched-flat-dest-icon svg { display: block; }
.sched-flat-badge { display: flex; }
.sched-flat-row .route-badge {
    font-size: 13px;
    padding: 3px 9px;
    background: rgba(255,255,255,0.13);
}
[data-theme="light"] .sched-flat-row .route-badge { background: rgba(0,0,0,0.10); }
.sched-flat-dest {
    font-size: 13px;
    color: var(--label);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.sched-flat-mins {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
}
.sched-flat-mins--due { color: var(--live); }
.section-divider-label svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
    margin-top: -1px;
    opacity: 0.7;
}

/* ── Hero progress bar ── */
.hero-progress-wrap {
    margin-bottom: 2px;
}
.hero-progress-bar-wrap {
    position: relative;
    padding: 7px 0;
}
.hero-progress-bus-pin {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}
.hero-progress-bus-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--live);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    box-shadow: 0 0 0 3px var(--bg);
}
[data-theme="light"] .hero-progress-bus-dot { color: white; }
.hero-progress-bus-dot--late { background: var(--eta-amber); }
.hero-progress-track {
    position: relative;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.15);
    overflow: hidden;
}
[data-theme="light"] .hero-progress-track { border-color: rgba(0,0,0,0.15); }
.hero-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--live) 85%, transparent 100%);
}
.hero-progress-fill--late {
    background: linear-gradient(90deg, var(--eta-amber) 85%, transparent 100%);
}

/* ── Hero strip left cluster ── */
.hero-strip-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.hero-strip-lastseen {
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
