.edge-action {
  --edge-action-bg: #151c20;
  position: fixed;
  top: 54%;
  right: 0;
  z-index: 45;
  translate: 0 -50%;
}

.edge-action[hidden] { display: none; }

.edge-action--price {
  top: 76%;
}

@media (min-width: 981px) {
  /* Keep the label measurable for collision checks while it is hidden. */
  .edge-action--price[hidden] {
    display: block;
    visibility: hidden;
    pointer-events: none;
  }
}

.edge-action__tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 17px 0 15px;
  border: 0;
  border-bottom: 1px solid #465259;
  background: var(--edge-action-bg);
  color: #f4f6f5;
  font: 650 13px/1.2 var(--sans, sans-serif);
  white-space: nowrap;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}

.edge-action__tab svg { flex: none; }
.edge-action--price .edge-action__tab svg { color: #ff9d99; }
.edge-action__tab:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

.edge-route {
  position: fixed;
  inset: 54% 0 auto auto;
  z-index: 46;
  translate: 0 -50%;
  box-sizing: border-box;
  width: min(332px, calc(100vw - 20px));
  max-width: none;
  max-height: min(460px, calc(100dvh - 40px));
  margin: 0;
  padding: 18px 18px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #414b50;
  background: #151c20;
  color: #f4f6f5;
}

.edge-route__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 11px;
}

.edge-route__head p {
  margin: 0 0 7px;
  color: #bcc6ca;
  font: 600 10px/1.2 var(--mono, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.edge-route__head h2 {
  margin: 0;
  color: inherit;
  font-size: 24px;
  line-height: 1.1;
}

.edge-route__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid #485359;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.edge-route__branch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 0;
  border-top: 1px solid #465259;
  color: inherit;
}

.edge-route__branch strong,
.edge-route__branch small { display: block; }
.edge-route__branch strong { font-size: 16px; }
.edge-route__branch small { margin-top: 3px; color: #bcc6ca; font-size: 12px; }
.edge-route__branch svg { flex: none; }
.edge-route :is(a, button):focus-visible { outline: 2px solid #c4ced3; outline-offset: -2px; }

@media (max-width: 980px) {
  .edge-action,
  .edge-route { display: none; }
}

@media (hover: hover) and (pointer: fine) {
  .edge-action__tab:hover,
  .edge-route :is(a, button):hover { background: #263238; }
}

@media (min-width: 981px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .edge-action__tab { transition: transform 140ms ease; }
  .edge-action__tab:hover { transform: translateX(-4px); }
}

@media (prefers-reduced-motion: no-preference) {
  .edge-action--price:not([hidden]) > .edge-action__tab {
    animation: edge-from-right 160ms cubic-bezier(.23, 1, .32, 1);
  }
  .edge-route[open][data-pointer] { animation: edge-from-right 200ms cubic-bezier(.23, 1, .32, 1); }

}

@keyframes edge-from-right {
  from { transform: translateX(16px); opacity: 0; }
}

