.ame-route-open {
  align-items: center;
  background: transparent;
  border: 1px solid #2c2c2a;
  color: #2c2c2a;
  cursor: pointer;
  display: inline-flex;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  justify-content: center;
  letter-spacing: .14em;
  min-height: 42px;
  padding: 12px 18px;
  text-transform: uppercase;
  transition: background-color .2s ease, color .2s ease;
}

.ame-route-open:hover,
.ame-route-open:focus-visible {
  background: #2c2c2a;
  color: #fff;
  outline: none;
}

[data-ame-route-modal][hidden] { display: none; }

.ame-route-modal {
  align-items: center;
  background: rgba(12, 14, 11, .84);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 5svh 5vw;
  position: fixed;
  z-index: 1800;
}

.ame-route-modal,
.ame-route-modal * { box-sizing: border-box; }

.ame-route-modal__dialog {
  background: #f5f2ec;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .35);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 90svh;
  max-height: 940px;
  max-width: 1540px;
  overflow: hidden;
  width: 90vw;
}

.ame-route-modal__head {
  align-items: center;
  border-bottom: 1px solid #e2ddd3;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  min-height: 98px;
  padding: 1.1rem 1.6rem;
}

.ame-route-modal__eyebrow {
  color: #a27e4f;
  display: block;
  font: 600 .58rem/1.3 'Inter', sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.ame-route-modal__head h2 {
  color: #2c2c2a;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.85rem, 2.4vw, 2.45rem);
  font-weight: 500;
  line-height: 1;
  margin: .2rem 0 0;
}

.ame-route-modal__head p {
  color: #74766f;
  font: 300 .72rem/1.5 'Inter', sans-serif;
  margin: .42rem 0 0;
}

.ame-route-modal__close {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(44, 44, 42, .25);
  border-radius: 50%;
  color: #2c2c2a;
  cursor: pointer;
  display: flex;
  flex: 0 0 auto;
  font: 400 1.35rem/1 'Inter', sans-serif;
  height: 44px;
  justify-content: center;
  transition: background-color .2s ease, color .2s ease;
  width: 44px;
}

.ame-route-modal__close:hover,
.ame-route-modal__close:focus-visible {
  background: #2c2c2a;
  color: #fff;
  outline: none;
}

.ame-route-modal__body {
  display: grid;
  grid-template-columns: minmax(300px, 32%) minmax(0, 1fr);
  min-height: 0;
}

.ame-route-panel {
  grid-column: 1;
  grid-row: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 1.3rem 1.4rem 1.75rem;
  scrollbar-color: rgba(160, 128, 83, .55) transparent;
  scrollbar-width: thin;
}

.ame-route-panel:focus-visible {
  outline: 2px solid rgba(200, 169, 126, .78);
  outline-offset: -2px;
}

.ame-route-panel::-webkit-scrollbar { width: 6px; }
.ame-route-panel::-webkit-scrollbar-thumb { background: rgba(160, 128, 83, .5); border-radius: 99px; }
.ame-route-panel::-webkit-scrollbar-track { background: transparent; }
.ame-route-panel__toggle,
.ame-route-sheet__actions { display: none; }

.ame-route-status {
  color: #666a63;
  font: 300 .7rem/1.6 'Inter', sans-serif;
  margin: 0 0 1rem;
}

.ame-route-note {
  border-top: 1px solid rgba(44, 44, 42, .1);
  color: #777a73;
  font: 300 .62rem/1.55 'Inter', sans-serif;
  margin: 1rem 0 0;
  padding-top: .8rem;
}

.ame-route-timeline {
  --ame-route-axis-size: 42px;
  --ame-route-icon-size: 29px;
  position: relative;
}

.ame-route-timeline::before {
  background: linear-gradient(180deg, rgba(200, 169, 126, .25), #c8a97e 13%, #c8a97e 87%, rgba(200, 169, 126, .25));
  bottom: 18px;
  content: '';
  left: calc(var(--ame-route-axis-size) / 2);
  position: absolute;
  top: 18px;
  transform: translateX(-50%);
  width: 1px;
  z-index: 0;
}

.ame-route-timeline__item {
  align-items: start;
  display: grid;
  gap: .72rem;
  grid-template-columns: var(--ame-route-axis-size) minmax(0, 1fr);
  min-width: 0;
  position: relative;
}

.ame-route-timeline__item + .ame-route-timeline__item { margin-top: .2rem; }

.ame-route-timeline__node {
  align-self: start;
  background: #f5f2ec;
  border: 1px solid rgba(200, 169, 126, .72);
  border-radius: 50%;
  color: #9b7547;
  display: grid;
  height: var(--ame-route-icon-size);
  justify-self: center;
  min-height: var(--ame-route-icon-size);
  min-width: var(--ame-route-icon-size);
  place-items: center;
  position: relative;
  width: var(--ame-route-icon-size);
  z-index: 2;
}

.ame-route-timeline__node svg {
  display: block;
  height: 14px;
  stroke: currentColor;
  width: 14px;
}

.ame-route-timeline__node--stay {
  background: #c8a97e;
  border-color: #c8a97e;
  color: #242824;
  font: 700 .66rem/1 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
  height: var(--ame-route-axis-size);
  min-height: var(--ame-route-axis-size);
  min-width: var(--ame-route-axis-size);
  width: var(--ame-route-axis-size);
}

.ame-route-timeline__content {
  min-width: 0;
  padding: .22rem 0 .8rem;
}

.ame-route-stay > .ame-route-timeline__content { padding-top: 0; }

.ame-route-timeline__day {
  color: #a17d50;
  display: block;
  font: 600 .55rem/1.35 'Inter', sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ame-route-timeline__hub strong {
  color: #30322f;
  display: block;
  font: 500 1rem/1.12 'Cormorant Garamond', serif;
  margin-top: .22rem;
}

.ame-route-timeline__hub span:last-child {
  color: #777a73;
  display: block;
  font: 300 .62rem/1.45 'Inter', sans-serif;
  margin-top: .12rem;
}

.ame-route-connection {
  border-bottom: 1px solid rgba(44, 44, 42, .1);
  padding-bottom: .72rem;
}

.ame-route-connection__mode {
  color: #7a6245;
  display: block;
  font: 600 .54rem/1.35 'Inter', sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.ame-route-connection strong {
  color: #343633;
  display: block;
  font: 500 .72rem/1.45 'Inter', sans-serif;
  margin-top: .18rem;
}

.ame-route-stay { padding-bottom: .45rem; }

.ame-route-stay button {
  background: rgba(255, 255, 255, .38);
  border: 1px solid transparent;
  color: #2c2c2a;
  cursor: pointer;
  display: grid;
  gap: .72rem;
  grid-template-columns: 70px minmax(0, 1fr);
  padding: .62rem;
  text-align: left;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
  width: 100%;
}

.ame-route-stay button:hover,
.ame-route-stay button:focus-visible {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(200, 169, 126, .55);
  outline: 0;
}

.ame-route-stay img {
  height: 58px;
  object-fit: cover;
  width: 70px;
}

.ame-route-stay strong {
  display: block;
  font: 500 1.13rem/1.05 'Cormorant Garamond', serif;
}

.ame-route-stay button span {
  color: #747770;
  display: block;
  font: 300 .59rem/1.45 'Inter', sans-serif;
  margin-top: .2rem;
}

.ame-route-stay button strong + span {
  color: #9b7547;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.ame-route-stay .ame-route-location-note {
  color: #777a73;
  font-size: .54rem;
  font-style: italic;
}

.ame-route-stay.is-active button {
  background: rgba(200, 169, 126, .13);
  border-color: #c8a97e;
  box-shadow: inset 3px 0 0 #c8a97e;
}

.ame-route-map-shell {
  background: #dfe4dc;
  grid-column: 2;
  min-height: 0;
  position: relative;
}

.ame-route-map {
  height: 100%;
  min-height: 440px;
  position: relative;
  width: 100%;
}

.ame-route-map-state {
  align-items: center;
  background: linear-gradient(135deg, #e9e7df, #dce3db);
  color: #343833;
  display: flex;
  height: 100%;
  justify-content: center;
  min-height: 440px;
  padding: 2rem;
  text-align: center;
}

.ame-route-map-state__inner { max-width: 30rem; }

.ame-route-map-state strong {
  display: block;
  font: 500 clamp(1.8rem, 3vw, 2.6rem)/1 'Cormorant Garamond', serif;
}

.ame-route-map-state span {
  color: #666b65;
  display: block;
  font: 300 .75rem/1.65 'Inter', sans-serif;
  margin-top: .75rem;
}

.ame-route-legend {
  align-items: center;
  background: rgba(245, 242, 236, .94);
  bottom: 24px;
  box-shadow: 0 8px 24px rgba(28, 32, 28, .12);
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  left: 24px;
  max-width: calc(100% - 48px);
  padding: .65rem .8rem;
  position: absolute;
  pointer-events: none;
  z-index: 2;
}

.ame-route-legend[hidden] { display: none; }

.ame-route-legend span {
  align-items: center;
  color: #5d625c;
  display: flex;
  font: 600 .58rem/1.2 'Inter', sans-serif;
  gap: .42rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ame-route-legend i { display: block; height: 0; width: 28px; }
.ame-route-legend__air { border-top: 2px dashed #9b7547; }
.ame-route-legend__road { border-top: 2px dotted #58645d; }
.ame-route-legend__neutral { border-top: 2px dashed #7a7f79; }

.ame-route-marker {
  align-items: center;
  background: #c8a97e;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(22, 27, 23, .25);
  color: #242824;
  cursor: pointer;
  display: flex;
  font: 700 .65rem/1 'Inter', sans-serif;
  height: 34px;
  justify-content: center;
  transition: box-shadow .2s ease, transform .2s ease;
  width: 34px;
  z-index: 2;
}

.ame-route-marker:hover,
.ame-route-marker:focus-visible,
.ame-route-marker.is-active {
  box-shadow: 0 0 0 5px rgba(200, 169, 126, .34), 0 4px 14px rgba(22, 27, 23, .25);
  outline: 0;
  transform: scale(1.08);
}

.ame-route-gateway-marker {
  align-items: center;
  background: #f5f2ec;
  border: 1px solid #9b7547;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(22, 27, 23, .18);
  color: #9b7547;
  display: flex;
  height: 28px;
  justify-content: center;
  pointer-events: none;
  width: 28px;
  z-index: 1;
}

.ame-route-gateway-marker svg {
  height: 14px;
  stroke: currentColor;
  width: 14px;
}

.ame-route-modal .ame-route-map-controls button {
  align-items: center;
  background: #fff;
  border: 0;
  color: #303733;
  cursor: pointer;
  display: flex;
  font: 700 9px/1 'Inter', sans-serif;
  height: 34px;
  justify-content: center;
  letter-spacing: .07em;
  padding: 0 .65rem;
  text-transform: uppercase;
  width: auto;
}

.ame-route-modal .ame-route-map-controls button[aria-pressed='true'] {
  background: #2c2c2a;
  color: #fff;
}

.ame-route-modal .mapboxgl-ctrl-attrib { font-size: 10px; }

@media (max-width: 899px) {
  .ame-route-modal { align-items: stretch; padding: 0; }

  .ame-route-modal__dialog {
    height: var(--ame-route-visible-height, 100dvh);
    max-height: none;
    width: 100vw;
  }

  .ame-route-modal__head {
    min-height: 76px;
    padding: max(.72rem, env(safe-area-inset-top)) 1rem .72rem;
  }

  .ame-route-modal__head h2 { font-size: clamp(1.38rem, 6.6vw, 1.62rem); }
  .ame-route-modal__head p { display: none; }
  .ame-route-modal__close { height: 44px; width: 44px; }

  .ame-route-modal__body {
    display: block;
    min-height: 0;
    overflow: hidden;
    position: relative;
  }

  .ame-route-map-shell { inset: 0; min-height: 0; position: absolute; }
  .ame-route-map,
  .ame-route-map-state { height: 100%; min-height: 0; }

  .ame-route-legend {
    bottom: calc(var(--ame-route-sheet-height, 84px) + 48px);
    gap: .45rem .7rem;
    left: 12px;
    max-width: calc(100% - 70px);
    padding: .5rem .6rem;
    transition: bottom .28s ease;
  }

  .ame-route-legend span { font-size: .52rem; }
  .ame-route-legend i { width: 20px; }

  .ame-route-panel {
    --ame-route-sheet-collapsed: calc(84px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
    background: #f5f2ec;
    border-radius: 18px 18px 0 0;
    bottom: 0;
    box-shadow: 0 -16px 42px rgba(25, 28, 24, .17);
    display: flex;
    flex-direction: column;
    height: var(--ame-route-sheet-collapsed);
    left: 0;
    overflow: hidden;
    padding: 0;
    position: absolute;
    right: 0;
    transition: height .28s cubic-bezier(.22, .72, .26, 1);
    z-index: 5;
  }

  .ame-route-panel[data-sheet-state='half'] { height: clamp(320px, 52%, 480px); }
  .ame-route-panel[data-sheet-state='full'] { border-radius: 0; height: 100%; }

  .ame-route-panel__toggle {
    align-items: center;
    background: #f5f2ec;
    border: 0;
    color: #2c2c2a;
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) 44px;
    min-height: 84px;
    padding: 20px 20px max(12px, env(safe-area-inset-bottom));
    position: relative;
    text-align: left;
    width: 100%;
    z-index: 6;
  }

  .ame-route-sheet__handle {
    background: rgba(44, 44, 42, .28);
    border-radius: 99px;
    height: 4px;
    left: 50%;
    position: absolute;
    top: 8px;
    transform: translateX(-50%);
    width: 38px;
  }

  .ame-route-sheet__summary { display: flex; flex-direction: column; min-width: 0; }

  .ame-route-sheet__summary strong {
    color: #2c2c2a;
    font: 500 1.14rem/1.05 'Cormorant Garamond', serif;
  }

  .ame-route-sheet__summary > span {
    color: #8d7250;
    font: 600 .58rem/1.35 'Inter', sans-serif;
    letter-spacing: .14em;
    margin-top: .2rem;
    text-transform: uppercase;
  }

  .ame-route-sheet__chevron {
    align-items: center;
    border: 1px solid rgba(44, 44, 42, .18);
    border-radius: 50%;
    display: flex;
    font: 500 1rem/1 'Inter', sans-serif;
    height: 44px;
    justify-content: center;
    transition: transform .22s ease;
    width: 44px;
  }

  .ame-route-panel[data-sheet-state='half'] .ame-route-sheet__chevron,
  .ame-route-panel[data-sheet-state='full'] .ame-route-sheet__chevron { transform: rotate(180deg); }

  .ame-route-panel__content {
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 0 20px max(24px, env(safe-area-inset-bottom));
    touch-action: pan-y;
  }

  .ame-route-panel[data-sheet-state='collapsed'] .ame-route-panel__content { display: none; }

  .ame-route-sheet__actions {
    align-items: center;
    background: linear-gradient(180deg, #f5f2ec 78%, rgba(245, 242, 236, 0));
    display: flex;
    justify-content: flex-end;
    margin: 0 -2px .35rem;
    min-height: 48px;
    padding: .1rem 2px .45rem;
    position: sticky;
    top: 0;
    z-index: 4;
  }

  .ame-route-sheet__actions button {
    align-items: center;
    background: transparent;
    border: 1px solid rgba(44, 44, 42, .3);
    color: #2c2c2a;
    cursor: pointer;
    display: none;
    font: 600 .61rem/1 'Inter', sans-serif;
    justify-content: center;
    letter-spacing: .13em;
    min-height: 44px;
    padding: 0 1rem;
    text-transform: uppercase;
  }

  .ame-route-panel[data-sheet-state='half'] [data-route-sheet-full],
  .ame-route-panel[data-sheet-state='full'] [data-route-view-map] { display: inline-flex; }

  .ame-route-status { margin: .15rem 0 .85rem; }
  .ame-route-timeline { --ame-route-axis-size: 36px; --ame-route-icon-size: 27px; }
  .ame-route-timeline__item { gap: .65rem; }
  .ame-route-timeline__item + .ame-route-timeline__item { margin-top: .3rem; }
  .ame-route-timeline__node--stay { font-size: .62rem; }
  .ame-route-timeline__content { padding-bottom: .72rem; }
  .ame-route-timeline__hub strong { font-size: 1.05rem; }
  .ame-route-connection strong { font-size: .72rem; }
  .ame-route-stay button { gap: .65rem; grid-template-columns: 62px minmax(0, 1fr); min-height: 76px; padding: .58rem; }
  .ame-route-stay img { height: 52px; width: 62px; }
  .ame-route-stay strong { font-size: 1.08rem; }
  .ame-route-stay button span { font-size: .6rem; }

  .ame-route-modal .mapboxgl-ctrl-top-right { right: 8px; top: 8px; }
  .ame-route-modal .mapboxgl-ctrl-group button { height: 44px; min-width: 44px; }
  .ame-route-modal .ame-route-map-controls button { min-height: 44px; padding: 0 .7rem; width: auto; }
  .ame-route-modal .mapboxgl-ctrl-bottom-left,
  .ame-route-modal .mapboxgl-ctrl-bottom-right {
    bottom: calc(var(--ame-route-sheet-height, 84px) + 6px);
    transition: bottom .28s ease;
  }
}

@media (min-width: 900px) and (max-height: 650px) {
  .ame-route-modal { padding: 2svh 2vw; }
  .ame-route-modal__dialog { height: 96svh; width: 96vw; }
  .ame-route-modal__head { min-height: 74px; padding-block: .7rem; }
  .ame-route-modal__head p { margin-top: .2rem; }
  .ame-route-map,
  .ame-route-map-state { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ame-route-open,
  .ame-route-modal__close,
  .ame-route-stay button,
  .ame-route-marker,
  .ame-route-legend,
  .ame-route-panel,
  .ame-route-sheet__chevron { transition: none; }
}
