/* A route plan sits beside the existing map, above the collections. */
.routePanel { position: fixed; z-index: 85; left: 16px; top: 92px; bottom: 18px; width: 348px; display: flex; flex-direction: column; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 48px #0002; overflow: hidden; }
.routeHeader { position: relative; padding: 18px 20px 0; }
.routeHeader h2 { margin: 4px 24px 6px 0; font-size: 21px; line-height: 1.25; }
.routeHeader p { margin: 8px 0; font-size: 13px; color: var(--muted); }
.routeHeader > button { position: absolute; top: 10px; right: 10px; font-size: 24px; border: 0; background: none; color: var(--ink); }
.routeSettings { padding: 6px 20px 12px; border-bottom: 1px solid var(--line); }
.routeSettings > label:not(.routeCheck) { display: block; font-size: 12px; margin: 6px 0; }
.routeSettings select { display: block; width: 100%; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--ink); }
.routeCheck { display: flex; align-items: center; gap: 7px; margin: 10px 0; }
.routeTools { display: flex; flex-wrap: wrap; gap: 6px; }
.routeTools button { border: 1px solid var(--line); background: var(--soft); color: var(--ink); border-radius: 8px; padding: 6px 9px; }
.routePanel button:disabled { opacity: .4; cursor: default; }
.routeHint { font-size: 11px; margin: 8px 0 0; }
.routeList { list-style: none; margin: 0; padding: 8px 12px; overflow: auto; flex: 1; min-height: 70px; }
.routeList li { display: flex; align-items: center; gap: 4px; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: grab; border-radius: 8px; }
.routeList li.routeHighlighted { background: var(--soft); outline: 2px solid #4784ee; }
.routeList label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.routeList strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.routeList small { display: block; color: var(--muted); font-size: 11px; }
.routeNumber, .routeMapNumber { background: #4784ee; color: white; border: 2px solid white; border-radius: 50%; width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; }
.routeMapNumber { width: 34px; height: 34px; box-shadow: 0 2px 8px #0005; cursor: pointer; }
.routeExcluded { opacity: .5; }
.routeMove { display: flex; flex-direction: column; gap: 0; }
.routeMove button { display: grid; place-items: center; width: 28px; height: 24px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #92999e; }
.routeMove button:hover:not(:disabled) { color: var(--ink); }
.routeMove svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.routeStartPoint { background: #27855d; }
.routeFinishPoint { background: #ca6245; }
.routeMapNumber.routeStartPoint, .routeMapNumber.routeFinishPoint, .routeMapNumber.routeBothPoint { z-index: 2; }
.routeBothPoint { background: linear-gradient(135deg, #27855d 50%, #ca6245 50%); }
.routeHandle { display: none; }
.routeFooter { border-top: 1px solid var(--line); padding: 12px 20px 16px; max-height: 30%; overflow: auto; }
.routeFooter p { font-size: 11px; margin: 5px 0 10px; }
.routeYandex { display: block; text-align: center; background: var(--accent); color: var(--onaccent); border-radius: 10px; padding: 11px; font-weight: 650; text-decoration: none; margin-top: 6px; }
body.routing .pin { visibility: hidden; }
@media (max-width: 1100px), (pointer: coarse) {
  .routePanel { left: 0; right: 0; top: auto; bottom: calc(74px + env(safe-area-inset-bottom)); width: 100%; height: 52dvh; transition: height .22s ease; border-radius: 20px 20px 0 0; }
  .routePanel.routeExpanded { height: calc(100dvh - var(--m-nav, 74px) - env(safe-area-inset-top) - 12px); }
  .routeHandle { display: grid; place-items: center; flex-shrink: 0; width: 100%; height: 20px; padding: 0; touch-action: none; }
  .routeHandle span { width: 34px; height: 4px; border-radius: 4px; background: var(--muted); opacity: .4; }
  .routeHeader { padding: 0 16px; }
  .routeList { overscroll-behavior: contain; }
  .routeHeader h2 { font-size: 17px; }
  .routeHeader p { display: none; }
  .routeSettings { padding: 0 16px 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
  .routeSettings > label:not(.routeCheck) { flex: 1; min-width: 100px; }
  .routeCheck { font-size: 12px; margin: 3px 0; }
  .routeTools { align-items: center; }
  .routeHint { display: none; }
  .routeFooter { padding: 6px 16px 10px; max-height: 32%; }
  .routeFooter p { margin: 2px 0 4px; }
  .routeYandex { padding: 8px; }
  body.routing #sidebar, body.routing #mobileSearchDock { visibility: hidden; }
}

@media (min-width: 1101px) and (max-width: 1320px) and (pointer: fine) {
  .routePanel { top: 144px; }
}
@media (max-height: 600px) {
  .routeSettings { max-height: 34%; overflow: auto; flex-shrink: 0; }
  .routeHeader { flex-shrink: 0; }
  .routeFooter { flex-shrink: 0; max-height: 32%; }
  .routeList { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .routePanel { transition: none; }
}
