.route-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  pointer-events: none;
  visibility: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

.route-modal.is-open {
  pointer-events: auto;
  visibility: visible;
}

.route-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 14%, rgba(0, 113, 227, 0.2), transparent 34%),
    linear-gradient(90deg, rgba(8, 19, 43, 0.7), rgba(8, 19, 43, 0.18)),
    rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  opacity: 0;
}

.route-modal__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "head map"
    "form map"
    ". footer";
  width: min(1120px, calc(100vw - 2rem));
  height: min(92vh, 720px);
  max-height: min(92vh, 760px);
  overflow: hidden;
  border-radius: clamp(2rem, 4vw, 2.85rem);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.68));
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 50px 140px rgba(15, 23, 42, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(34px) saturate(150%);
  -webkit-backdrop-filter: blur(34px) saturate(150%);
  transform: translateY(18px) scale(0.985);
  opacity: 0;
}

.route-modal__panel::before {
  content: "";
  position: absolute;
  inset: -120px auto auto -90px;
  width: 310px;
  height: 310px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.22), transparent 68%);
  pointer-events: none;
}

.route-modal__head {
  position: relative;
  z-index: 1;
  grid-area: head;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.55rem, 3vw, 2.35rem);
  border-right: 1px solid rgba(16, 24, 40, 0.08);
}

.route-modal__kicker {
  width: fit-content;
  padding: 0.62rem 0.95rem;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.route-modal__head h2 {
  max-width: 8.6ch;
  margin: 0;
  font-size: clamp(2.75rem, 5.2vw, 4.25rem);
  line-height: 0.9;
  letter-spacing: -0.075em;
  font-weight: 850;
  color: #101828;
}

.route-modal__head p {
  margin: 0;
  max-width: 27rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: #667085;
}

.route-modal__chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.62rem;
}

.route-modal__chips span {
  min-height: 3.45rem;
  display: flex;
  align-items: flex-end;
  border-radius: 1.45rem;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.76);
  padding: 0.8rem;
  color: #344054;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.18;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.route-modal__close {
  position: absolute;
  top: clamp(1rem, 2.5vw, 1.6rem);
  right: clamp(1rem, 2.5vw, 1.65rem);
  z-index: 4;
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #101828;
  border: 1px solid rgba(255, 255, 255, 0.72);
  font-size: 1.75rem;
  line-height: 1;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.12);
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1), background 300ms ease;
}

.route-modal__close:hover {
  transform: scale(1.04);
  background: #fff;
}

.route-modal__form {
  grid-area: form;
  align-self: end;
  margin-top: auto;
  padding: 0 clamp(1.55rem, 3vw, 2.35rem) clamp(1.55rem, 3vw, 2.35rem);
}

.route-modal__form label {
  display: block;
  margin: 0 0 0.65rem 0.25rem;
  color: #7b8494;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.route-modal__inputrow {
  display: grid;
  gap: 0.72rem;
  padding: 0.85rem;
  border-radius: 1.9rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.route-modal__inputrow input {
  min-height: 3.6rem;
  width: 100%;
  border-radius: 1.35rem;
  border: 1px solid rgba(0, 113, 227, 0.18);
  background: #fff;
  padding: 0 1.2rem;
  color: #101828;
  outline: 5px solid rgba(0, 113, 227, 0.08);
  font-size: 1rem;
  font-weight: 760;
}

.route-modal__inputrow input:focus {
  border-color: rgba(0, 113, 227, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.route-modal__inputrow button {
  display: inline-flex;
  min-height: 3.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 1.35rem;
  border: 0;
  background: linear-gradient(135deg, #4b8dff, #1357d8);
  padding: 0 1.4rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 18px 45px rgba(0, 113, 227, 0.25);
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 300ms ease;
}

.route-modal__inputrow button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 55px rgba(0, 113, 227, 0.32);
}

.route-modal__mapwrap {
  grid-area: map;
  position: relative;
  min-width: 0;
  align-self: stretch;
  margin: 1rem 1rem 0 0;
  overflow: hidden;
  border-radius: 2.1rem;
  min-height: 0;
  background:
    radial-gradient(circle at 22% 58%, rgba(0, 113, 227, 0.16), transparent 14%),
    radial-gradient(circle at 72% 34%, rgba(80, 190, 120, 0.18), transparent 18%),
    linear-gradient(30deg, transparent 0 45%, rgba(255, 255, 255, 0.78) 45% 48%, transparent 48% 100%),
    linear-gradient(125deg, transparent 0 38%, rgba(255, 255, 255, 0.82) 38% 41%, transparent 41% 100%),
    linear-gradient(78deg, transparent 0 55%, rgba(255, 255, 255, 0.88) 55% 58%, transparent 58% 100%),
    #eaf1f7;
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 28px 90px rgba(15, 23, 42, 0.13);
}

.route-modal__mapwrap::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.route-modal__mapwrap::before {
  content: none;
}

.route-modal__mapwrap::after {
  width: 1.4rem;
  height: 1.4rem;
  inset: 53% auto auto 55%;
  border-radius: 999px 999px 999px 0;
  background: #e5484d;
  border: 4px solid #fff;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.2);
  transform: rotate(-45deg);
}

.route-modal__mapwrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  opacity: 1;
  filter: none;
}

.route-modal__map-card {
  position: absolute;
  left: 1.55rem;
  top: 1.55rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: min(26rem, calc(100% - 3.1rem));
  padding: 0.95rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.route-modal__map-card > span {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  border-radius: 1.1rem;
  background: #101828;
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.2);
}

.route-modal__map-card strong,
.route-modal__map-card small {
  display: block;
}

.route-modal__map-card strong {
  color: #101828;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.route-modal__map-card small {
  margin-top: 0.2rem;
  color: #667085;
  font-size: 0.78rem;
  font-weight: 680;
}

.route-modal__footer {
  grid-area: footer;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  align-items: stretch;
  padding: 0.85rem 1rem 1rem 0;
  color: #667085;
  font-size: 0.95rem;
  line-height: 1.5;
}

.route-modal__footer p {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0.72rem 0.95rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.68);
}

.route-modal__footer strong {
  color: #101828;
}

.route-modal__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.route-modal__actions a {
  display: flex;
  min-height: 3.65rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  border-radius: 1.65rem;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.78);
  padding: 0.85rem 1rem;
  color: #101828;
  text-decoration: none;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.09);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 450ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

.route-modal__actions a:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.14);
}

.route-modal__actions strong,
.route-modal__actions small {
  display: block;
}

.route-modal__actions strong {
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.route-modal__actions small {
  margin-top: 0.2rem;
  color: #667085;
  font-size: 0.78rem;
  font-weight: 680;
}

.route-modal__actions i {
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #0071e3;
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

@media (min-width: 901px) and (max-height: 760px) {
  .route-modal__panel {
    height: min(94vh, 660px);
  }

  .route-modal__head {
    gap: 0.82rem;
    padding: 1.35rem 1.5rem;
  }

  .route-modal__kicker {
    padding: 0.5rem 0.8rem;
    font-size: 0.68rem;
  }

  .route-modal__head h2 {
    font-size: clamp(2.45rem, 4.6vw, 3.65rem);
  }

  .route-modal__head p {
    font-size: 0.94rem;
    line-height: 1.52;
  }

  .route-modal__chips span {
    min-height: 3rem;
    padding: 0.65rem;
    font-size: 0.72rem;
  }

  .route-modal__form {
    padding: 0 1.5rem 1.35rem;
  }

  .route-modal__inputrow input,
  .route-modal__inputrow button {
    min-height: 3.25rem;
  }

  .route-modal__map-card {
    left: 1rem;
    top: 1rem;
    padding: 0.75rem;
  }

  .route-modal__footer {
    gap: 0.65rem;
    padding: 0.65rem 1rem 0.85rem 0;
    font-size: 0.88rem;
  }

  .route-modal__footer p {
    padding: 0.62rem 0.85rem;
  }

  .route-modal__actions {
    gap: 0.65rem;
  }
}

@media (max-width: 900px) {
  .route-modal__panel {
    display: flex;
    flex-direction: column;
    grid-template-areas: none;
    overflow-y: auto;
    width: min(680px, calc(100vw - 1.5rem));
    max-height: 94vh;
  }

  .route-modal__head {
    padding: 1.7rem 1.5rem 0;
    border-right: 0;
  }

  .route-modal__head h2 {
    max-width: 11ch;
    font-size: clamp(2.7rem, 11vw, 4rem);
  }

  .route-modal__form {
    padding: 1.25rem 1.5rem 0;
  }

  .route-modal__chips {
    grid-template-columns: 1fr;
  }

  .route-modal__chips span {
    min-height: 3.35rem;
    align-items: center;
  }

  .route-modal__mapwrap {
    min-height: 17rem;
    margin: 1.25rem 1rem 0;
  }

  .route-modal__mapwrap iframe {
    min-height: 17rem;
  }

  .route-modal__footer {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .route-modal__actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .route-modal {
    padding: 0.5rem;
  }

  .route-modal__panel {
    border-radius: 1.75rem;
  }

  .route-modal__map-card {
    left: 0.8rem;
    top: 0.8rem;
    width: calc(100% - 1.6rem);
  }
}

@media (hover: none) and (pointer: coarse) {
  .route-modal__inputrow button:hover,
  .route-modal__actions a:hover,
  .route-modal__close:hover {
    transform: none;
  }
}
