/* Маршрут через зарядки. Токены — из map-page.css. */
.panel-ctas{display:grid;gap:6px}
.route-cta{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:0 14px;border:1px solid var(--edge);background:var(--dc);color:#fff;font:700 11px var(--display);transition-property:scale,background-color}
.route-cta:has(>i:first-child){padding-left:12px}
.route-cta:hover{background:var(--ink)}
.route-cta i{font-size:17px}
.tool--route{display:none}

.route-sheet{position:fixed;z-index:13;top:var(--gap);right:var(--gap);bottom:var(--gap);width:420px;display:flex;flex-direction:column;background:var(--surface);color:var(--ink);border:1px solid var(--edge);box-shadow:var(--shadow);overflow:hidden;overflow:clip}
.route-sheet[hidden]{display:none}
.route-sheet:not([hidden]){animation:card-in .3s var(--ease-out) both}
.route-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 18px 20px;display:grid;align-content:start;gap:16px}
body.is-route-open .map-tools,body.is-route-open .map-label,body.is-route-open .credit-toggle{visibility:hidden}
body.is-route-open .detail{display:none}

.route-form{display:grid;gap:10px}
.route-field{position:relative;display:grid;gap:6px}
.route-field label{display:flex;align-items:center;gap:8px;font:700 10px var(--display)}
.route-dot{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;border:2px solid var(--black);font:800 9px var(--display);color:#fff}
.route-dot--from{background:var(--ink)}
.route-dot--to{background:var(--dc)}
.route-input{display:flex;border:1px solid var(--edge);background:#fff}
.route-input input{flex:1;min-width:0;height:46px;padding:0 12px;border:0;outline:0;background:none;color:var(--ink);font:600 14px var(--body)}
.route-input input::placeholder{color:var(--muted);opacity:.85}
.route-input button{flex:none;display:grid;place-items:center;width:44px;border:0;border-left:1px solid var(--line);background:none;color:var(--ink);font-size:18px;cursor:pointer}
.route-input button:hover{background:var(--surface-2)}
.route-input:focus-within{outline:3px solid var(--accent);outline-offset:-1px}
.route-suggest{position:absolute;z-index:3;top:100%;left:0;right:0;display:grid;max-height:240px;overflow-y:auto;border:1px solid var(--edge);border-top:0;background:#fff;box-shadow:0 12px 24px #12063a33}
.route-suggest[hidden]{display:none}
.route-suggest:not([hidden]){transform-origin:top center;animation:route-pop .25s var(--ease-out) both}
@keyframes route-pop{from{opacity:0;transform:translateY(-7px) scaleY(.94)}to{opacity:1;transform:none}}
.route-suggest button{display:grid;gap:2px;padding:10px 12px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left;cursor:pointer}
.route-suggest button:hover,.route-suggest button:focus-visible{background:var(--surface-2)}
.route-suggest b{font-size:13px;font-weight:800;color:var(--ink)}
.route-suggest span{font-size:11px;line-height:1.35;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.route-suggest p{margin:0;padding:12px;font-size:12px;color:var(--muted)}
.route-swap{position:relative;justify-self:end;margin:-6px 4px -6px 0;display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--edge);background:var(--surface);color:var(--ink);font-size:16px;cursor:pointer}
.route-row{display:grid;grid-template-columns:110px minmax(0,1fr);gap:10px;align-items:end}
.route-range{display:grid;gap:6px}
.route-range span,.route-corridor>span{font:700 9px var(--display);color:var(--muted)}
.route-range input{width:100%;height:42px;padding:0 10px;border:1px solid var(--edge);border-radius:0;background:#fff;color:var(--ink);font:700 14px var(--body)}
.route-corridor{display:flex;flex-wrap:wrap;align-items:center;gap:4px}
.route-corridor>span{flex-basis:100%;margin-bottom:2px}
.route-corridor button{flex:1;min-height:42px;padding:0 6px;border:1px solid var(--edge);background:#fff;color:var(--ink);font-size:12px;font-weight:800;cursor:pointer}
.route-corridor button[aria-pressed=true]{background:var(--ink);color:var(--on-ink)}

.route-results{display:grid;gap:12px}
.route-results[hidden]{display:none}
.route-results:not([hidden]){animation:route-result-in .48s var(--ease-out) both}
@keyframes route-result-in{from{opacity:0;translate:0 15px}to{opacity:1;translate:0 0}}
.route-results h3{margin:4px 0 0;font:800 15px var(--display);letter-spacing:-.04em}
.route-summary{display:grid;gap:4px;margin:0;padding:14px;background:var(--ink);color:var(--on-ink)}
.route-summary b{font:800 18px var(--display);letter-spacing:-.05em}
.route-summary span{font-size:12px;line-height:1.45;color:#d8d0ee}
.route-hint{margin:0;padding:10px 12px;border:1px solid var(--warn);background:#fff;font-size:12px;font-weight:700;line-height:1.5}
.route-hint[hidden]{display:none}
.route-list{display:grid;border-top:1px solid var(--edge)}
.route-stop{display:grid;grid-template-columns:22px minmax(0,1fr);gap:10px;align-items:start;padding:11px 0;border-bottom:1px solid var(--line);cursor:pointer}
.route-stop input{width:20px;height:20px;margin:1px 0 0;accent-color:var(--dc)}
.route-stop b{display:block;font-size:13px;font-weight:800;line-height:1.3}
.route-stop small{display:block;margin-top:3px;font-size:11px;line-height:1.4;color:var(--muted)}
.route-stop em{grid-column:2;justify-self:start;margin-top:-4px;padding:2px 6px;background:var(--dc);color:#fff;font:700 8px var(--display);font-style:normal}
.route-stop.is-down b{color:var(--muted);text-decoration:line-through}
.route-empty{margin:0;padding:14px 0;font-size:13px;color:var(--muted)}
.route-export{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:6px}
.route-export .btn{min-height:46px;font-size:10px}

.route-end{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;border:2px solid #fff;color:#fff;font:800 12px var(--display);box-shadow:0 4px 12px #0009}
.route-end--from{background:var(--ink)}
.route-end--to{background:var(--dc)}
.route-pick{position:fixed;z-index:16;top:var(--gap);left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:12px;width:max-content;max-width:calc(100vw - 24px);padding:10px 10px 10px 16px;background:var(--paper);border:1px solid var(--edge);box-shadow:var(--shadow-card);font-size:13px;font-weight:800}
.route-pick[hidden]{display:none}
.route-pick .btn{min-height:38px}
body.is-route-picking .route-sheet{opacity:.35;pointer-events:none}

@media (max-width:820px){
  .route-cta{display:none}
  .tool--route{display:grid;position:fixed;right:26px;bottom:calc(var(--peek-h) + 138px);width:44px;height:44px;background:var(--dc);color:#fff}
  .detail:not([hidden])~.map-tools .tool--route{display:none}
  .route-sheet{top:auto;left:0;right:0;bottom:0;width:auto;max-height:min(78dvh,720px);border-width:0;box-shadow:var(--shadow-sheet);padding-bottom:env(safe-area-inset-bottom)}
  .route-sheet:not([hidden]){animation:sheet-in .3s var(--ease-out) both}
  .route-body{padding:14px 16px 18px}
  body.is-route-picking .route-sheet{transform:translateY(calc(100% - 64px));opacity:1}
  .route-pick{top:calc(env(safe-area-inset-top) + 66px)}
}
@media (prefers-reduced-motion:reduce){.route-sheet:not([hidden]),.route-suggest:not([hidden]),.route-results:not([hidden]){animation:none}}

.route-collapsed{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;padding:8px 12px;border:1px solid var(--edge);background:#fff;color:var(--ink);text-align:left;cursor:pointer}
.route-collapsed[hidden]{display:none}
.route-collapsed span:nth-child(2){flex:1;min-width:0;font-size:12px;font-weight:700;line-height:1.35;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.route-collapsed b{flex:none;font:700 10px var(--display);color:#b5179e;text-decoration:underline;text-underline-offset:3px}
.route-form[hidden]{display:none}
@media (max-width:820px){
  .route-sheet{max-height:min(62dvh,620px)}
  #route-title{font-size:17px}
}
/* Время и расстояния маршрута — цифры одной ширины (после шорткатов font). */
.route-summary b,.route-summary span,.route-stop small,.route-stop em{font-variant-numeric:tabular-nums}

/* Mobile route states: full form, hidden during picking, compact result. */
.route-expand[hidden]{display:none}
@media(max-width:820px){
  body.fs-map .route-sheet:not([hidden]){animation:none;transition:transform .52s cubic-bezier(.22,1,.36,1),opacity .32s ease}
  body.fs-map.is-route-picking .route-sheet{transform:translateY(calc(100% + 32px));opacity:0;pointer-events:none}
  .fs-map .route-sheet>.add-bar h2{flex:1;min-width:0}
  .fs-map .route-sheet>.add-bar{gap:8px}
  .fs-map .route-sheet.is-compact{max-height:38dvh}
  .route-sheet.is-compact .route-collapsed,.route-sheet.is-compact .route-form,
  .route-sheet.is-compact .route-results>h3,.route-sheet.is-compact .route-list,
  .route-sheet.is-compact .route-hint,.route-sheet.is-compact .route-results>.add-note{display:none}
  .route-sheet.is-compact .route-body{gap:0;padding-top:8px}
  .route-sheet.is-compact .route-summary span{font-size:11px}
  .route-sheet.is-compact .route-summary{padding:12px}
  .route-sheet.is-compact .route-summary b{font-size:17px}
}
@media(prefers-reduced-motion:reduce){.fs-map .route-sheet:not([hidden]){transition:none}}

/* Route motion: tactile controls, staggered content and a calm loading cue. */
body.fs-map .route-results:not([hidden]){animation:none}
.route-expand i{transition:rotate .38s cubic-bezier(.22,1,.36,1)}
.route-sheet .detail-close,.route-sheet .route-input button,.route-swap{transition:scale .16s ease,background-color .2s ease}
.route-sheet .detail-close:active,.route-sheet .route-input button:active,.route-swap:active{scale:.91}
.route-sheet .btn:active{scale:.975}
.route-end>span{display:grid;place-items:center;width:100%;height:100%;border-radius:inherit;background:inherit}
#route-build[aria-busy=true]{animation:route-working 1.2s ease-in-out infinite}
@keyframes route-working{50%{opacity:.65}}
@media(prefers-reduced-motion:reduce){
  #route-build[aria-busy=true]{animation:none}
  .route-expand i,.route-sheet .detail-close,.route-sheet .route-input button,.route-swap{transition:none}
  .route-sheet .btn:active,.route-sheet .detail-close:active,.route-sheet .route-input button:active,.route-swap:active{scale:1}
}

/* Route station names: matte capsules; placement is collision-tested in screen space. */
.route-station-labels{position:absolute;inset:0;z-index:3;pointer-events:none;overflow:hidden}
.route-station-label{position:absolute;display:flex;align-items:center;max-width:230px;height:34px;padding:0 12px;border:1px solid #d3cbf3;border-radius:999px;background:#f4f2ff;color:#170845;box-shadow:0 3px 12px #12063a30;font:800 12px Manrope,sans-serif;pointer-events:auto;cursor:pointer;white-space:nowrap;visibility:hidden}
.route-station-label span{overflow:hidden;text-overflow:ellipsis;min-width:0}
.route-station-label small{flex:none;font:700 11px Manrope,sans-serif;color:#564d80}
.route-station-label[aria-pressed=true]{border:2px solid #f72585;background:#f9dff3}
.route-station-label:focus-visible{outline:3px solid #f72585;outline-offset:2px}
.route-station-label:active{scale:.97}
@media(max-width:820px){.route-station-label{max-width:190px;height:32px;font-size:11px;padding:0 10px}.route-station-label small{font-size:10px}}
@media(prefers-reduced-motion:reduce){.route-station-label:active{scale:1}}

.route-station-label{transform-origin:top left;will-change:transform}
