/* Route Explorer — panel, legend, nav-rail view */
#viewRoutes #routeExplorerPanel {
  position: absolute; top: 0; right: 0; width: 320px; height: 100%;
  background: var(--mu-surface, #0b0c0e); color: var(--mu-text, #e6e8eb);
  border-left: 1px solid var(--mu-dot, #454c5c);
  display: flex; flex-direction: column; z-index: 35; overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
#viewRoutes #routeExplorerPanel.visible { transform: translateX(0); }

/* Routes view hides the live-flight chrome */
body.view-active-routes #sidebar,
body.view-active-routes #liveStatusBar,
body.view-active-routes #statsBar,
body.view-active-routes #planeControls,
body.view-active-routes #layersBtn { display: none !important; }
.route-panel-header { padding: 16px; border-bottom: 1px solid var(--mu-dot, #454c5c); }
#routeExplorerPanel h2 { margin: 0 0 4px; font-weight: 300; font-size: 22px; }
.route-back {
  margin-top: 10px; background: none; border: none; cursor: pointer;
  color: var(--mu-accent, #3b82f6); font: inherit; padding: 0;
}
.route-dest-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.04);
}
.route-dest-row:hover { background: rgba(255,255,255,.04); }
.route-traffic-bar { height: 5px; border-radius: 2.5px; background: var(--mu-accent, #3b82f6); margin-top: 3px; }
.route-badge { font-size: 10px; padding: 2px 6px; border-radius: 999px; }
.route-badge.new { background: #22c55e; color: #04210f; }
.route-badge.announced { background: #fbbf24; color: #2a1d00; }
.route-badge.established { background: #1c2740; color: var(--mu-text-2, #9aa3b2); }
.route-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px;
  font-size: 12px; color: var(--mu-text-2, #9aa3b2); }
.route-search { width: calc(100% - 32px); margin: 8px 16px; padding: 6px 10px;
  background: var(--mu-bg, #000); color: var(--mu-text, #e6e8eb);
  border: 1px solid var(--mu-dot, #454c5c); border-radius: 6px; }
.route-search-hit { padding: 6px 16px; cursor: pointer; }
.route-search-hit:hover { background: rgba(255,255,255,.05); }

/* MapLibre route map surface (inside #viewRoutes view-container) */
#viewRoutes #routeMapContainer {
  position: absolute; inset: 0; z-index: 30;
  background: #0b0c0e;
  display: block;
}
#viewRoutes #routeMapContainer .maplibregl-ctrl-attrib { font-size: 10px; }

/* ============================================================
   Routes nav-rail view (#viewRoutes)
   ============================================================ */

.view-container#viewRoutes {
    display: none;
    flex-direction: column;
    background: var(--mu-bg, #0b0c0e);
}
.view-container#viewRoutes.view-visible {
    display: flex;
}

.rv-header {
    flex: 0 0 56px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--mu-surface, #181a1f);
    gap: 16px;
}
.rv-title {
    font-size: 16px; font-weight: 500; color: var(--mu-text, #e6e8eb);
    letter-spacing: -0.01em;
}
.rv-controls {
    display: flex; align-items: center; gap: 12px; flex: 1;
    justify-content: flex-end;
}
.rv-search {
    width: 220px;
    height: 32px;
    padding: 0 12px 0 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3b2' stroke-width='2'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") 10px 50% / 14px no-repeat;
    color: var(--mu-text, #e6e8eb);
    font-size: 13px;
    font-family: inherit;
}
.rv-search::placeholder { color: var(--mu-text-2, #9aa3b2); }
.rv-search:focus { outline: none; border-color: var(--mu-accent, #3b82f6); }
.rv-filter-pills { display: flex; gap: 4px; }
.rv-pill {
    height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: transparent;
    color: var(--mu-text-2, #9aa3b2);
    font: inherit; font-size: 12px; font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.rv-pill.active[data-prov="established"] { background: #3b82f6; color: white; border-color: #3b82f6; }
.rv-pill.active[data-prov="new"]         { background: #22c55e; color: #04210f; border-color: #22c55e; }
.rv-pill.active[data-prov="announced"]   { background: #fbbf24; color: #2a1d00; border-color: #fbbf24; }
.rv-scope {
    height: 32px;
    padding: 0 28px 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--mu-text, #e6e8eb);
    font: inherit; font-size: 13px;
}
.rv-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Mobile (Layout C): compact header + full-width slide-in panel */
@media (max-width: 640px) {
    .view-container#viewRoutes .rv-header {
        flex: 0 0 48px;
        padding: 0 12px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .view-container#viewRoutes .rv-search {
        width: 140px;
    }
    .view-container#viewRoutes .rv-filter-pills {
        flex-wrap: wrap;
    }
    #viewRoutes #routeExplorerPanel {
        width: 100%;
    }
    /* Layout C dock is position: fixed at bottom; pad the Routes view so
       the slide-in panel content isn't hidden behind it. */
    body.layout-c .view-container#viewRoutes {
        padding-bottom: 64px;
    }
}
