.visit-route { min-width: 0; }
.route-card {
  overflow: hidden;
  min-width: 0;
  color: var(--on-dark);
  background: var(--night-2);
  border: 1px solid var(--line-dark);
  border-radius: .5rem;
}
.route-header { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; padding: .45rem .55rem .45rem 1.05rem; }
.route-heading-text { margin-right: auto; font-size: clamp(1.1rem, 1.55vw, 1.4rem); font-weight: 680; letter-spacing: -.035em; }
.route-tabs { display: inline-flex; gap: .2rem; padding: .2rem; border-radius: 2rem; background: var(--night); border: 1px solid var(--line-dark); }
.route-tab { min-height: 2.3rem; padding: .25rem .85rem; border: 0; border-radius: 2rem; background: transparent; color: var(--muted-on-dark); font-size: .86rem; font-weight: 620; }
.route-tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.route-toggle {
  display: inline-flex; align-items: center; gap: .48rem; min-height: 44px; padding: .35rem .5rem;
  background: none; border: 0; color: var(--accent); font-size: .88rem; font-weight: 600;
}
.route-toggle::before { display: block; width: .62rem; height: .7rem; content: ''; }
.route-toggle[data-state="pause"]::before { border-inline: .18rem solid currentColor; }
.route-toggle[data-state="play"]::before { background: currentColor; clip-path: polygon(8% 0,100% 50%,8% 100%); }
.route-toggle[data-state="replay"]::before { width: .84rem; height: .84rem; content: '↻'; line-height: .75; font-size: 1.12rem; }
.route-panel { position: relative; }
.route-drawing { display: block; width: 100%; height: auto; font-family: Roboto, Arial, sans-serif; }
.route-map { aspect-ratio: 600 / 404; background: var(--night); }
.route-frame { display: block; width: 100%; height: 100%; border: 0; }
.route-map-link {
  position: absolute; right: .7rem; bottom: .7rem; display: inline-flex; align-items: center; min-height: 2.5rem; padding: .3rem .9rem;
  border-radius: 2rem; background: var(--night); color: var(--on-dark); font-size: .86rem; font-weight: 620; text-decoration: none;
  box-shadow: 0 6px 18px rgb(0 0 0 / .3);
}

/* Street level: real-world colours of the place, softened towards the palette. */
.rm-ground { fill: color-mix(in srgb, var(--accent) 16%, #eceee9); }
.rm-green { fill: color-mix(in srgb, var(--accent) 12%, #c9ddc2); }
.rm-trees circle { fill: #9cc292; stroke: #82a97b; stroke-width: 1; }
.rm-road { fill: #4b4955; }
.rm-curb { stroke: #a9a6b6; stroke-width: 2; fill: none; }
.rm-median { stroke: #f2f1f5; stroke-width: 1.1; fill: none; }
.rm-lane { stroke: #f2f1f5; stroke-width: 1.2; stroke-dasharray: 12 10; fill: none; opacity: .8; }
.rm-zebra path { stroke: #f2f1f5; stroke-width: 4.5; opacity: .85; }
.rm-stop-line { stroke: #f2f1f5; stroke-width: 2.4; opacity: .9; fill: none; }
.rm-arrow path { fill: none; stroke: #f2f1f5; stroke-width: 1.6; stroke-linecap: round; opacity: .75; }
.rm-arrow .rm-arrow-head { fill: #f2f1f5; stroke: none; }
.rm-arrows-dark .rm-arrow path { stroke: #b9b5c8; opacity: .5; }
.rm-arrows-dark .rm-arrow .rm-arrow-head { fill: #b9b5c8; }
.rm-lot-edge { stroke: #8d8a99; stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.rm-entry-chevron { fill: none; stroke: #3ddc84; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rm-exit-chevron { fill: none; stroke: #e2453c; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.rm-ramp-line { fill: none; stroke: #b9b5c8; stroke-width: 1.2; stroke-dasharray: 8 8; opacity: .55; }
.rm-traffic .rm-parked { fill: #8e8b9c; }
.rm-road-name { fill: #f2f1f5; font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.rm-road-tag rect { fill: #4b4955; stroke: #6e6b7a; stroke-width: .8; }
.rm-lot { fill: #66646f; }
.rm-lot-marks path { stroke: #e9e7ef; stroke-width: 1; opacity: .75; }
.rm-parked { fill: #7b7888; stroke: #b3b0c0; stroke-width: .8; }
.rm-parked-glass { fill: #2c2a33; }
.rm-roof { fill: #dcdae3; stroke: #a9a5b6; stroke-width: 1.5; }
.rm-hatch-line { stroke: #c5c2d0; stroke-width: 1; }
.rm-facade { fill: #b9b4c4; stroke: #9a96a8; stroke-width: 1; }
.rm-place { fill: #2b2838; font-size: 21px; font-weight: 760; letter-spacing: -.6px; }
.rm-stairs { fill: none; stroke: #e7b11e; stroke-width: 3; stroke-linejoin: round; }
.rm-block { fill: #cdbca2; stroke: #a99677; stroke-width: 1.2; }
.rm-gate { fill: #26242c; }
.rm-entry-light { fill: #3ddc84; filter: drop-shadow(0 0 3px #3ddc84); }
.rm-exit-light { fill: #e2453c; }
.rm-block-label { fill: #fff; font-size: 7.6px; font-weight: 760; letter-spacing: .2px; paint-order: stroke; stroke: #8f7b5b; stroke-width: 2px; }
.rm-callout path { stroke: #2f9b5f; stroke-width: 1.4; fill: none; }
.rm-callout rect { fill: #3ddc84; }
.rm-callout text { fill: #0f2a1b; font-size: 11px; font-weight: 760; }
.route-base { fill: none; stroke: #ffffff; stroke-opacity: .55; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.route-base-dark { stroke: var(--accent); stroke-opacity: .16; }
.route-trace { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.route-trace-above { stroke: var(--accent-dark); }
.route-trace-below { stroke: var(--accent); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 70%, transparent)); }
.route-start { fill: var(--accent-dark); stroke: #fff; stroke-width: 2; }

/* Level −1, as in the video: grey boxes, pink columns, green pipes and the barrier. */
.rm-underground { fill: color-mix(in srgb, var(--night) 70%, #2e2c36); }
.rm-dot { fill: #ffffff; fill-opacity: .07; }
.rm-level-line { stroke: color-mix(in srgb, var(--night) 70%, black); stroke-width: 3; }
.rm-pipes path { stroke: #2f8a5a; stroke-width: 2; opacity: .55; fill: none; }
.rm-ramp-top { stop-color: #4a4855; }
.rm-ramp-bottom { stop-color: #33313c; }
.rm-ramp { stroke: #5d5a69; stroke-width: 1; }
.rm-chevrons { fill: none; stroke: #d6d2e2; stroke-width: 1.6; opacity: .45; stroke-linecap: round; }
.rm-aisle { fill: #393742; }
.rm-aisle-line { stroke: #c9c5d6; stroke-width: 1.4; stroke-dasharray: 12 10; fill: none; opacity: .7; }
.rm-boxes-north rect, .rm-boxes-south rect { fill: #4b4956; stroke: #6c6977; stroke-width: 1; }
.rm-shutter-line { stroke: #9a97a7; stroke-width: .8; }
.rm-shutters path { stroke: #a9a6b6; stroke-width: 2; fill: none; }
.rm-columns rect { fill: #c3285f; }
.rm-taxi .rm-parked { fill: #e8b61a; stroke: #f6d46a; }
.rm-doors rect:first-child { fill: #8a879a; }
.rm-flag { stroke: #6f6c7c; stroke-width: .6; }
.rm-studio-box { fill: color-mix(in srgb, var(--accent) 24%, var(--night)); stroke: var(--accent); stroke-width: 1.6; transition: filter .5s ease; }
.rm-studio-shutter { opacity: .9; }
.rm-studio .rm-shutter-line { stroke: var(--accent); }
.rm-banner { fill: #bcb9d9; }
.rm-banner-skyline { fill: none; stroke: #18171c; stroke-width: 1.2; }
.rm-pin path { fill: var(--spark); stroke: #fff; stroke-width: 1.2; }
.rm-pin circle { fill: #fff; }
.rm-studio.is-here .rm-studio-box { filter: drop-shadow(0 0 8px var(--accent)); }
.rm-level-label rect { fill: color-mix(in srgb, var(--night) 70%, black); stroke: #6b6878; }
.rm-level-label text { fill: #e5e1f0; font-size: 15px; font-weight: 650; }
.rm-annotation { fill: #d6d2e2; font-size: 14px; font-weight: 580; }
.rm-strong { fill: var(--accent); font-weight: 720; }
.rm-pointer { stroke: #a9a5b8; fill: none; }
.rm-boom-shadow { stroke: #121116; stroke-width: 7; }
.rm-boom { stroke: #f2f0f4; stroke-width: 4; }
.rm-boom-stripes { stroke: #d8343b; stroke-width: 4; stroke-dasharray: 6 6; }
.rm-boom-post { fill: #f08a24; stroke: #b75f12; stroke-width: 1; }
.rm-call { opacity: 0; transition: opacity .3s ease; }
.rm-call circle { fill: #3ddc84; }
.rm-call path { fill: #0f2a1b; }
.rm-call.is-ringing { opacity: 1; }
.rv-shadow { fill: #000; opacity: .25; }
.rv-wheels { fill: #141318; }
.rv-body { fill: #f6f5fa; stroke: var(--accent-dark); stroke-width: 1.5; }
.rv-roof { fill: var(--accent-dark); }
.rv-glass { fill: #24213a; }
.rv-lights { stroke: #ffd36b; stroke-width: 1.3; }
.rv-brake { stroke: #e2453c; stroke-width: 1.6; stroke-linecap: round; opacity: .35; }
.rv-brake.is-on { opacity: 1; filter: drop-shadow(0 0 2.5px #ff3b30); }
.rv-signal circle { fill: #f5a524; opacity: 0; }
.rv-signal.is-on circle { opacity: 1; filter: drop-shadow(0 0 2px #f5a524); }
@media (prefers-reduced-motion: no-preference) {
  .rm-call.is-ringing circle { animation: rm-ring 1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .rm-studio.is-here .rm-pin { animation: rm-pin 1.2s cubic-bezier(.3,.7,.3,1) both; transform-box: fill-box; transform-origin: center bottom; }
  .rm-entry-light { animation: rm-blink 2.4s ease-in-out infinite; }
  @keyframes rm-ring { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }
  @keyframes rm-pin { 0% { transform: translateY(-14px); opacity: 0; } 60% { transform: translateY(2px); opacity: 1; } 100% { transform: none; } }
  @keyframes rm-blink { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
}

.route-directions { border-top: 1px solid var(--line-dark); }
.route-stages { display: flex; gap: .5rem; align-items: stretch; margin: 0 .95rem; }
.route-stages button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .48rem;
  min-width: 0; min-height: 47px; padding: .45rem .15rem; background: transparent;
  border: 0; border-bottom: 2px solid var(--line-dark); color: var(--muted-on-dark); font-size: .93rem; font-weight: 600;
}
.route-stages button span {
  display: inline-grid; place-items: center; flex: none; width: 1.2rem; height: 1.2rem;
  border: 1px solid var(--line-dark-strong); border-radius: 50%; font-size: .69rem; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.route-stages button[aria-pressed=true] { color: var(--accent); border-color: var(--accent); }
.route-stages button[aria-pressed=true] span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.route-instruction { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .9rem; padding: .8rem 1rem .95rem 1.1rem; }
.route-copy { min-height: 2.8em; color: var(--on-dark); font-size: .99rem; line-height: 1.42; }
.route-phone { color: var(--accent); text-underline-offset: .2em; }
.route-photo {
  position: relative; display: block; width: clamp(7.5rem, 13vw, 9.6rem); aspect-ratio: 4 / 3; padding: 0; overflow: hidden;
  border: 1px solid var(--line-dark-strong); border-radius: .35rem; background: var(--night); cursor: pointer;
}
.route-photo:disabled { cursor: default; }
.route-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.route-photo-label {
  position: absolute; inset: auto 0 0; display: flex; align-items: center; gap: .3rem; padding: 1.2rem .45rem .35rem;
  color: #fff; font-size: .72rem; font-weight: 620; line-height: 1.15; text-align: left;
  background: linear-gradient(transparent, rgb(8 7 12 / .85));
}
.route-photo:not(:disabled) .route-photo-label::before {
  content: ''; flex: none; width: 0; height: 0; border-left: .45rem solid var(--accent); border-block: .3rem solid transparent;
}
.route-card :is(a, button):focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.route-card .route-phone:focus-visible { outline-offset: 2px; }
.visit-route .visit-film {
  display: flex; align-items: center; aspect-ratio: auto; min-height: 3.5rem; margin-top: .52rem; padding: .25rem .7rem;
  border: 1px solid var(--rule); background: transparent; color: var(--ink); isolation: auto; border-radius: .3rem;
}
.visit-route .visit-film::before { content: none; }
.visit-route .visit-still { position: static; z-index: auto; width: 3.5rem; height: 2.55rem; flex: none; object-fit: cover; border-radius: .14rem; }
.visit-route .visit-film-caption { gap: .55rem; padding: 0 0 0 .6rem; }
.visit-route .visit-play { width: 1.65rem; background: none; color: var(--accent-dark); border-color: color-mix(in srgb, var(--accent-dark) 45%, var(--paper)); }
.visit-route .visit-play::after { border-left-width: .4rem; border-block-width: .25rem; }
.visit-route .visit-film-title { font-size: .96rem; font-weight: 620; }
.visit-route .visit-time { color: var(--muted); font-size: .9rem; }
@media (hover: hover) {
  .route-toggle:hover, .route-stages button:hover, .route-tab:not([aria-selected="true"]):hover { color: var(--on-dark); }
  .route-photo:not(:disabled):hover img { transform: scale(1.06); }
  .visit-route .visit-film:hover { background: var(--paper-2); border-color: color-mix(in srgb, var(--accent-dark) 35%, var(--paper)); }
  .visit-route .visit-film:hover .visit-still { transform: none; }
}
/* On touch screens the «Схема / Яндекс Карта» switch gets a finger-sized height. */
@media (pointer: coarse) { .route-tab { min-height: 2.75rem; } }
@media (max-width: 33rem) {
  .route-header { padding-inline: .8rem .4rem; }
  .route-heading-text { flex-basis: 100%; }
  .rm-place { font-size: 24px; }
  .rm-annotation { font-size: 18px; }
  .route-stages { gap: .35rem; margin-inline: .62rem; }
  .route-stages button { font-size: .84rem; gap: .28rem; }
  .route-instruction { grid-template-columns: minmax(0, 1fr); padding: .7rem .85rem .8rem; }
  .route-copy { min-height: 4.2em; font-size: .93rem; }
  .route-photo { width: 100%; aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) {
  .route-photo img, .rm-studio-box { transition: none; }
}
