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

:root {
  --font-main: 'DM Sans', sans-serif;
  --font-mono: 'DM Sans', sans-serif;
  --text-primary: #172d32;
  --text-secondary: #42585b;
  --text-muted: #7c8989;
  --border-default: #e5eae7;
  --border-subtle: #edf0ed;
  --ucsd-sky: #2e6b61;
  --ucsd-blue: #172d32;
  --live-green: #3f8068;
  --lime: #d4f77d;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-main); color: var(--text-primary); background: #f6f8f4; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button, a, input, [tabindex] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid #6da88d; outline-offset: 3px; }
.icon { width: 20px; height: 20px; display: block; flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; }
.app-container { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.top-nav { height: 52px; flex-shrink: 0; display: flex; align-items: center; padding: 0 20px; gap: 16px; background: #fff; border-bottom: 1px solid var(--border-default); z-index: 1000; }
.brand-section { display: flex; align-items: center; gap: 9px; border: 0; background: none; text-align: left; flex-shrink: 0; padding: 0; }
.brand-icon-wrapper, .brand-icon-wrapper img { width: 30px; height: 30px; display: block; }
.brand-name { font-family: Manrope, sans-serif; font-size: 16px; font-weight: 750; letter-spacing: -.4px; color: var(--text-primary); }
.search-container { position: relative; width: 340px; max-width: 45%; margin-left: auto; }
.search-input-box { background: #f4f6f3; border: 1px solid #edf0eb; border-radius: 9px; height: 36px; width: 100%; padding: 0 14px 0 36px; font-size: 12.5px; color: var(--text-primary); transition: border-color .15s, background .15s; }
.search-input-box:focus { background: #fff; border-color: #6da88d; }
.search-icon { position: absolute; left: 11px; top: 9px; color: #7b8980; }
.search-icon .icon { width: 16px; height: 16px; }
.search-results-panel { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; box-shadow: 0 10px 30px #172d3220; border: 1px solid var(--border-default); border-radius: 12px; max-height: 360px; overflow-y: auto; z-index: 1100; }
.search-results-panel.active { display: block; }
.search-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; gap: 10px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; }
.search-item:hover { background: #f3f7ef; }
.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.live-badge { display: flex; align-items: center; gap: 6px; color: #42705e; font-size: 11px; font-weight: 500; white-space: nowrap; }
.live-indicator-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #589979; box-shadow: 0 0 0 3px #58997918; }
.is-stale { color: #8c7960; }
.is-stale .live-indicator-dot { background: #b19a73; box-shadow: none; }
.nav-btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-default); border-radius: 8px; width: 34px; height: 34px; background: white; transition: background .15s, border-color .15s; }
.nav-btn .icon { width: 16px; height: 16px; transition: transform .2s ease; }
.nav-btn:hover { background: #f1f5ed; border-color: #cbd5c5; }
.nav-btn:active .icon { transform: rotate(45deg); }
.nav-btn.is-refreshing .icon { animation: spin-refresh 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes spin-refresh { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.main-view { flex: 1; min-height: 0; display: flex; position: relative; }
.sidebar-drag-handle { display: none; }
.sidebar { width: 392px; flex-shrink: 0; display: flex; flex-direction: column; background: #fcfdfb; border-right: 1px solid var(--border-default); z-index: 500; }
.sidebar-intro { padding: 32px 28px 26px; }
.eyebrow { display: flex; align-items: center; gap: 7px; font-size: 9px; letter-spacing: 1.8px; font-weight: 700; color: #6e8473; }
.tiny-orbit { width: 10px; height: 10px; border: 1.5px solid #849d6a; border-radius: 50%; box-shadow: inset 0 0 0 2px #fcfdfb; background: #b7d98c; }
h1 { font-family: Manrope, sans-serif; font-size: 34px; font-weight: 750; line-height: 1.2; letter-spacing: -1.7px; margin-top: 17px; }
.accent { color: #78a051; }
.sidebar-intro p { color: #819084; font-size: 13px; margin-top: 12px; }
.segmented-control { display: flex; width: 100%; margin: 0; background: #eef1eb; border-radius: 0; padding: 8px 14px; gap: 6px; box-sizing: border-box; }
.segment-btn { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; padding: 10px 8px; border: 0; border-radius: 8px; background: transparent; color: #788579; font-size: 12px; font-weight: 600; transition: background .15s, color .15s, box-shadow .15s; }
.segment-btn .icon { width: 16px; height: 16px; }
.segment-btn.active { color: var(--text-primary); background: white; box-shadow: 0 2px 5px #20332314; }
.segment-btn:hover { color: var(--text-primary); }
.sidebar-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 24px 16px; scrollbar-width: thin; scrollbar-color: #d9e2d5 transparent; }
.list-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 7px 0 16px; }
.list-heading h2 { font-size: 13px; font-weight: 700; }
.list-heading > span { font-size: 10px; color: #859085; }
.stop-item { position: relative; padding: 17px 16px; margin-bottom: 10px; background: white; border: 1px solid #e5eae2; border-radius: 13px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.stop-item:hover { border-color: #a4bc93; box-shadow: 0 3px 12px #213b2210; }
.stop-item.selected { border-color: #1d4ed8; background: #f0f7ff; box-shadow: 0 0 0 2px #bfdbfe40; }
.stop-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 15px; }
.stop-name { font-family: Manrope, sans-serif; font-size: 13px; font-weight: 750; line-height: 1.5; }
.stop-distance { flex-shrink: 0; font-size: 10px; font-weight: 500; color: #899384; padding-top: 3px; }
.stop-arrivals-list { display: flex; flex-direction: column; gap: 10px; }
.arrival-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.arrival-route-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.arrival-headsign { font-size: 11px; color: #768074; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arrival-times-right { flex-shrink: 0; display: flex; align-items: center; gap: 5px; }
.route-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 29px; height: 23px; padding: 0 6px; border-radius: 6px; color: white; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.eta-pill { font-size: 10px; font-weight: 600; color: #4e8068; background: #eef6ed; border-radius: 5px; padding: 4px 6px; white-space: nowrap; }
.eta-pill.secondary { color: #8b9488; background: #f4f5f1; font-weight: 400; }
.eta-pill.urgent { color: #a47024; background: #fff5df; }
.sidebar-footer { width: 100%; padding: 0; display: flex; align-items: center; border-top: 1px solid var(--border-default); background: #f4f6f2; flex-shrink: 0; box-sizing: border-box; }
.map-workspace { flex: 1; min-width: 0; position: relative; background: #e9ede6; }
#map { width: 100%; height: 100%; z-index: 10; background: #e9ede6; }
.map-agency-filters { position: absolute; z-index: 400; top: 25px; left: 25px; display: flex; gap: 4px; padding: 5px; border: 1px solid #ffffff90; border-radius: 14px; background: #fffffff5; box-shadow: 0 4px 20px #243e2912; }
.map-filter-chip { display: flex; align-items: center; gap: 7px; border: 0; border-radius: 9px; padding: 11px 15px; font-size: 11px; font-weight: 600; background: transparent; color: #7c8679; white-space: nowrap; }
.map-filter-chip .icon { width: 17px; height: 17px; }
.map-filter-chip.active { background: var(--text-primary); color: var(--lime); }
.map-filter-chip:not(.active):hover { background: #f0f4e9; }
.map-floating-bar { position: absolute; z-index: 400; right: 24px; top: 25px; display: flex; flex-direction: column; gap: 9px; }
.floating-ctrl-btn { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid #fff; background: #fff; border-radius: 12px; color: #637263; box-shadow: 0 3px 16px #243e2914; }
.floating-ctrl-btn:hover { background: #f0f7e6; }
.map-caption { position: absolute; z-index: 400; bottom: 29px; left: 25px; background: #fffffff2; border: 1px solid white; box-shadow: 0 3px 18px #243e2912; padding: 13px 16px; border-radius: 10px; display: flex; align-items: center; gap: 10px; font-size: 11px; }
.caption-divider { height: 12px; width: 1px; background: #dfe5dc; margin: 0 2px; }
#map-fleet-count { color: #85907f; }
.map-legend { display: flex; align-items: center; gap: 7px; position: absolute; z-index: 400; right: 83px; bottom: 39px; color: #6e7b65; font-size: 10px; }
.legend-stop { height: 9px; width: 9px; border: 2px solid #62745e; border-radius: 50%; background: white; }
.legend-bus { margin-left: 12px; }
.legend-bus .icon { width: 15px; height: 15px; }
.leaflet-control-zoom { border: 0 !important; border-radius: 11px !important; overflow: hidden; box-shadow: 0 3px 16px #243e2914 !important; margin: 0 24px 29px 0 !important; }
.leaflet-control-zoom a { width: 40px !important; height: 38px !important; line-height: 38px !important; font-size: 20px !important; font-weight: 400 !important; color: #54674c !important; }
.leaflet-control-attribution { font-size: 9px !important; background: #ffffffaa !important; color: #7d8578; }
.bus-pill { height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 9px; color: white; border: 2.5px solid white; border-radius: 11px; font-size: 11px; font-weight: 700; white-space: nowrap; box-shadow: 0 3px 8px #172d3235; transition: transform .15s; }
.bus-pill .icon { width: 17px; height: 17px; }
.bus-pill:hover, .selected-bus { transform: translateY(-3px); box-shadow: 0 0 0 4px #d4f77d90; }
.stop-marker-dot { width: 12px; height: 12px; border: 3px solid #6d8275; border-radius: 50%; background: white; box-shadow: 0 1px 3px #172d3225; transition: transform .15s, background .15s, border-color .15s; }
.stop-marker-dot.active, .stop-marker-dot:hover { background: #1d4ed8; border-color: #1e3a8a; box-shadow: 0 0 0 4px #bfdbfe; transform: scale(1.4); }
.route-group-title { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: #83907d; padding: 14px 0; }
.route-detail-header { padding: 10px 0 20px; border-bottom: 1px solid var(--border-default); margin-bottom: 18px; }
.back-btn { display: inline-flex; border: 0; background: none; color: #698660; font-size: 12px; margin: 0 0 18px; padding: 6px 0; }
.route-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.route-full-name { font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.route-direction-label { font-size: 12px; color: #82907d; margin-top: 5px; }
.route-status-strip { display: flex; justify-content: space-between; font-size: 11px; margin-top: 16px; color: #7a8974; }
.timeline-list { padding: 5px 0; }
.timeline-step { position: relative; display: flex; padding-bottom: 28px; cursor: pointer; transition: background .15s; }
.timeline-line { position: absolute; top: 12px; bottom: 0; left: 7px; width: 2px; background: var(--route-color, #bac8b0); opacity: .4; }
.timeline-node { position: relative; width: 16px; height: 16px; border: 3px solid #a4b599; border-radius: 50%; background: #fff; flex-shrink: 0; margin: 2px 14px 0 0; transition: transform .15s, background .15s, border-color .15s, box-shadow .15s; }
.timeline-stop-name { font-size: 13.5px; line-height: 1.4; color: var(--text-primary); transition: color .15s, font-weight .15s; }
.bus-near .timeline-node { background: #10b981; border-color: #047857; box-shadow: 0 0 0 3px #a7f3d0; }
.selected-stop .timeline-node { background: #1d4ed8; border-color: #1e3a8a; box-shadow: 0 0 0 4px #bfdbfe; transform: scale(1.15); }
.selected-stop.bus-near .timeline-node { background: #1d4ed8; border-color: #047857; box-shadow: 0 0 0 3px #bfdbfe, 0 0 0 6px #a7f3d0; }
.selected-stop .timeline-stop-name { font-weight: 750; color: #1d4ed8; }
.timeline-info { flex: 1; font-size: 13px; line-height: 1.5; }
.timeline-bus-indicator { display: flex; align-items: center; gap: 5px; color: #047857; font-size: 11px; font-weight: 600; margin-top: 4px; }
.timeline-bus-indicator .icon { width: 14px; height: 14px; color: #047857; }
.state-message { padding: 36px 12px; font-size: 13px; line-height: 1.8; text-align: center; color: #7c8975; }
.state-message > .icon { width: 32px; height: 32px; margin: 10px auto 20px; color: #91a77d; }
.state-message h3 { font-size: 14px; color: #43583a; margin-bottom: 8px; }
.state-message .back-btn { margin: 12px 0 0; }
.is-saved .icon { fill: #e9c474; }
.leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: 0 5px 25px #203c2625; }
.leaflet-popup-content { font-family: var(--font-main); line-height: 1.6; }
.map-popup-card { min-width: 180px; }
.map-popup-header { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.map-popup-dest { font-size: 12px; margin-top: 9px; color: #697f60; }
.map-popup-eta { font-size: 11px; color: #618252; margin-top: 7px; }
.user-location-dot { width: 18px; height: 18px; border: 3px solid white; background: #478ebc; border-radius: 50%; box-shadow: 0 0 0 8px #478ebc22; }
.flex { display: flex; min-width: 0; } .items-center { align-items: center; } .justify-between { justify-content: space-between; gap: 12px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .text-sm { font-size: 12px; } .text-xs { font-size: 10px; } .font-bold, .font-semibold { font-weight: 600; } .text-gray-500, .text-gray-400 { color: #889281; } .text-emerald-600 { color: #5b855c; } .text-right { text-align: right; flex-shrink: 0; } .p-3 { padding: 16px; } .text-red-500 { color: #aa5742; }
@media (min-width: 1500px) { .sidebar { width: 420px; } .sidebar-intro { padding-top: 42px; padding-bottom: 32px; } h1 { font-size: 39px; } }
@media (max-width: 1100px) { .top-nav { padding: 0 16px; gap: 12px; } .sidebar { width: 350px; } .sidebar-body { padding-left: 18px; padding-right: 18px; } .map-legend { display: none; } .map-agency-filters { left: 16px; } .map-filter-chip { padding: 10px; } .map-floating-bar { right: 16px; top: 94px; } }
@media (max-width: 700px) {
  .top-nav { height: 48px; padding: 0 12px; gap: 8px; position: relative; }
  .brand-icon-wrapper, .brand-icon-wrapper img { width: 24px; height: 24px; }
  .brand-name { font-size: 13.5px; white-space: nowrap; }
  .search-container { flex: 1; max-width: none; margin: 0; position: relative; }
  .search-input-box { height: 34px; border-radius: 8px; font-size: 16px; padding: 0 10px 0 30px; -webkit-text-size-adjust: 100%; }
  .search-icon { left: 8px; top: 9px; }
  .search-icon .icon { width: 14px; height: 14px; }
  .live-badge span#live-freshness-text { display: none; }
  .live-badge { padding: 2px; }
  .nav-actions { gap: 6px; margin-left: 0; }
  .nav-actions .nav-btn { width: 30px; height: 30px; border-radius: 7px; }
  .nav-actions .nav-btn .icon { width: 14px; height: 14px; }
  .floating-ctrl-btn.is-locating { background: #e0f2fe; border-color: #38bdf8; animation: pulse-locating 1s infinite alternate; }
  @keyframes pulse-locating { from { transform: scale(1); } to { transform: scale(1.12); } }
  .main-view { flex-direction: column; }
  .map-workspace { order: 0; flex: 1; min-height: 120px; }
  .sidebar-drag-handle { display: flex; justify-content: center; align-items: center; width: 100%; padding: 10px 0 6px; cursor: pointer; background: #fcfdfb; border-radius: 20px 20px 0 0; flex-shrink: 0; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
  .drag-pill { width: 40px; height: 4.5px; background: #c5d2c2; border-radius: 4px; transition: background .2s, transform .2s; }
  .sidebar-drag-handle:active .drag-pill { background: #7c9474; transform: scaleX(1.2); }
  .sidebar { order: 1; width: 100%; height: 48%; flex-shrink: 0; border: 0; border-top: 1px solid #dce5d5; border-radius: 20px 20px 0 0; margin-top: -12px; overflow: hidden; box-shadow: 0 -6px 25px #283d2315; transition: height .3s cubic-bezier(0.32, 0.72, 0, 1); }
  .sidebar.collapsed { height: 58px; }
  .sidebar.collapsed .sidebar-body { display: none; }
  .sidebar.collapsed .drag-pill { background: #8fa688; }
  .sidebar-body { padding-bottom: 10px; } .list-heading { margin: 8px 0 13px; }
  .sidebar-footer { display: flex; width: 100%; padding: 0; margin-top: auto; }
  .segmented-control { width: 100%; margin: 0; padding: 6px 10px; }
  .segment-btn { padding: 9px 4px; }
  .map-agency-filters { top: 14px; left: 14px; padding: 4px; border-radius: 12px; }
  .map-filter-chip { font-size: 10px; padding: 9px 10px; gap: 5px; }
  .map-filter-chip .icon { width: 14px; height: 14px; }
  .map-floating-bar { top: 73px; right: 14px; gap: 7px; }
  .floating-ctrl-btn { width: 35px; height: 35px; border-radius: 10px; }
  .map-caption { left: 14px; bottom: 35px; padding: 10px 12px; font-size: 10px; gap: 7px; }
  .leaflet-control-zoom { display: none; }
  .leaflet-control-attribution { margin-bottom: 18px !important; font-size: 8px !important; }
  .route-detail-header { padding-top: 8px; } .stop-item { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

.leaflet-tile-pane { filter: saturate(.45) contrast(.94) brightness(1.035); }
