:root { --route-pink: #ff4fb8; --route-pink-soft: #ff9bd5; }
.status-rack .route-planner-toggle { border-color: var(--route-pink); color: var(--route-pink); }
.status-rack .route-planner-toggle:hover { border-color: var(--route-pink-soft); color: var(--route-pink-soft); background: rgba(255, 79, 184, .08); }
.route-planner {
  position: fixed; z-index: 62; top: 0; right: 0; width: min(430px, calc(100vw - 28px)); height: 100%;
  padding: 14px; overflow-y: auto; color: var(--cyan-pale); border-left: 1px solid var(--line-strong);
  background: rgba(4, 11, 32, .985); box-shadow: -18px 0 42px rgba(0, 0, 0, .56);
  font-family: var(--body); transform: translateX(103%); transition: transform 160ms ease;
  scrollbar-color: var(--cyan) #06101f;
}
.route-planner.open { transform: translateX(0); }
.route-planner-head {
  position: sticky; z-index: 2; top: -14px; display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin: -14px -14px 14px; padding: 14px; border-bottom: 1px solid var(--line);
  background: rgba(4, 11, 32, .99);
}
.route-planner-kicker, .route-planner-title, .route-section-title, .route-label > span,
.route-button, .route-status { font-family: var(--hud); letter-spacing: .08em; text-transform: uppercase; }
.route-planner-kicker { color: var(--yellow); font-size: .66rem; }
.route-planner-title { margin: 2px 0 0; color: var(--cyan); font-size: 1.35rem; letter-spacing: .035em; }
.route-planner-close { width: 34px; height: 34px; color: var(--cyan-muted); border: 1px solid var(--line); background: #061126; cursor: pointer; }
.route-planner-warning { margin: 0 0 15px; padding: 9px 10px; color: #f2f5a4; border: 1px solid rgba(214, 234, 62, .42); background: rgba(77, 79, 15, .24); font-size: .7rem; font-weight: 750; line-height: 1.4; }
.route-section { margin: 0 0 15px; padding: 0 0 15px; border-bottom: 1px solid rgba(79, 213, 244, .2); }
.route-section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; color: var(--cyan); font-size: .75rem; }
.route-status { padding: 3px 6px; color: var(--cyan-muted); border: 1px solid var(--line); font-size: .58rem; }
.route-label { display: block; margin-bottom: 9px; }
.route-label > span { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: var(--cyan-muted); font-size: .64rem; }
.route-control { width: 100%; min-height: 38px; padding: 7px 9px; color: var(--cyan-pale); border: 1px solid rgba(79, 213, 244, .42); border-radius: 0; background: #050d22; font: inherit; }
.route-control:disabled { opacity: .55; cursor: not-allowed; }
.route-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.route-mode-switch { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 10px; }
.route-mode-button { min-height: 38px; padding: 7px 9px; color: var(--cyan-muted); border: 1px solid rgba(79, 213, 244, .42); background: #050d22; font-family: var(--hud); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.route-mode-button + .route-mode-button { border-left: 0; }
.route-mode-button:hover { color: var(--yellow); }
.route-mode-button.active { position: relative; z-index: 1; color: #190918; border-color: var(--route-pink); background: var(--route-pink); box-shadow: 0 0 13px rgba(255, 79, 184, .24); }
.route-toggle { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px; border: 1px solid rgba(79, 213, 244, .25); background: rgba(8, 19, 41, .76); cursor: pointer; }
.route-toggle input { flex-shrink: 0; margin: 0; accent-color: var(--route-pink); }
.route-toggle strong { color: var(--cyan-pale); font-size: .72rem; line-height: 1.3; }
.route-toggle:has(:disabled) { opacity: .55; cursor: not-allowed; }
.route-button { min-height: 36px; padding: 7px 9px; color: var(--cyan); border: 1px solid rgba(79, 213, 244, .55); border-radius: 0; background: #07142c; font-size: .65rem; font-weight: 800; cursor: pointer; }
.route-button:hover:not(:disabled) { color: var(--yellow); border-color: var(--yellow); }
.route-button.primary { color: #180a19; border-color: var(--route-pink); background: var(--route-pink); }
.route-button.primary:hover:not(:disabled) { color: #080308; background: var(--route-pink-soft); }
.route-button:disabled { opacity: .42; cursor: not-allowed; }
.route-button.armed { color: #180a19; border-color: var(--yellow); background: var(--yellow); animation: route-pulse 900ms ease-in-out infinite alternate; }
@keyframes route-pulse { to { box-shadow: 0 0 15px rgba(214, 234, 62, .42); } }
.route-selection { margin: 8px 0; padding: 8px; color: var(--cyan-muted); border: 1px solid rgba(79, 213, 244, .22); background: var(--panel-soft); font-size: .69rem; line-height: 1.4; }
.route-selection strong { display: block; color: var(--cyan-pale); }
.route-selection[hidden] { display: none; }
.route-endpoint-search { position: relative; }
.route-endpoint-results { display: grid; max-height: 218px; margin: -1px 0 8px; overflow-y: auto; border: 1px solid rgba(79, 213, 244, .38); background: #030b1d; }
.route-endpoint-results[hidden] { display: none; }
.route-endpoint-option { display: block; width: 100%; padding: 8px 9px; color: var(--cyan-pale); border: 0; border-bottom: 1px solid rgba(79, 213, 244, .16); background: transparent; text-align: left; cursor: pointer; }
.route-endpoint-option:last-child { border-bottom: 0; }
.route-endpoint-option:hover, .route-endpoint-option.active { background: rgba(79, 213, 244, .11); }
.route-endpoint-option strong { display: block; font-size: .72rem; line-height: 1.3; }
.route-endpoint-option span { display: block; margin-top: 2px; color: var(--cyan-dim); font-size: .62rem; line-height: 1.35; }
.route-endpoint-empty { padding: 9px; color: var(--cyan-dim); font-size: .67rem; }
.route-waypoints { display: grid; gap: 4px; }
.route-legs { display: grid; gap: 6px; }
.route-waypoint { display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: start; gap: 7px; padding: 6px 7px; border: 1px solid rgba(79, 213, 244, .28); background: var(--panel-soft); }
.route-leg { padding: 8px; border: 1px solid rgba(79, 213, 244, .28); background: var(--panel-soft); }
.route-waypoint.endpoint { border-color: rgba(255, 79, 184, .62); }
.route-waypoint-copy { min-width: 0; }
.route-waypoint-name { color: var(--cyan-pale); font-size: .74rem; font-weight: 750; line-height: 1.3; }
.route-meta { margin-top: 3px; color: var(--cyan-dim); font-size: .64rem; line-height: 1.4; }
.route-waypoint .route-meta { margin-top: 1px; overflow-wrap: anywhere; }
.route-waypoint-remove { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; color: var(--cyan-muted); border: 0; background: transparent; font-size: 1.05rem; line-height: 1; cursor: pointer; }
.route-waypoint-remove:hover { color: var(--yellow); }
.route-waypoint-remove:focus-visible { color: var(--yellow); outline: 1px solid var(--yellow); outline-offset: 1px; }
.route-empty { padding: 12px 7px; color: var(--cyan-muted); font-size: .73rem; line-height: 1.45; text-align: center; }
.route-summary { margin: 9px 0; padding: 10px; border: 1px solid rgba(255, 79, 184, .5); background: rgba(76, 12, 59, .22); }
.route-summary-value { color: var(--route-pink); font-family: var(--hud); font-size: 1.35rem; font-weight: 800; }
.route-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 7px; color: var(--cyan-muted); font-size: .66rem; }
.route-summary-grid strong { display: block; color: var(--cyan-pale); font-size: .74rem; }
.route-leg strong { display: block; color: var(--cyan-pale); font-size: .71rem; line-height: 1.35; }
.route-error { margin-top: 8px; padding: 8px; color: #ffcbd0; border: 1px solid rgba(255, 101, 93, .4); background: rgba(94, 17, 27, .25); font-size: .68rem; line-height: 1.45; }
.route-toast { position: fixed; z-index: 64; left: 50%; bottom: 18px; max-width: min(620px, calc(100vw - 28px)); padding: 8px 12px; color: var(--cyan-muted); border: 1px solid var(--line); background: rgba(3, 10, 25, .96); font-size: .72rem; transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity 120ms ease; }
.route-toast.show { opacity: 1; }
.route-backdrop { position: fixed; z-index: 61; inset: 0; display: none; border: 0; background: rgba(0, 2, 9, .52); }
@media (max-width: 760px) {
  .route-planner { top: auto; bottom: 0; width: 100%; max-height: 88%; height: auto; border-top: 1px solid var(--line-strong); border-left: 0; transform: translateY(103%); }
  .route-planner.open { transform: translateY(0); }
  .route-backdrop.open { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .route-planner, .route-toast { transition: none; }
  .route-button.armed { animation: none; }
}
