/* ==========================================================================
   Planning sheet v3 (flag globe_sheet_v3; owner pick 2026-10-11 from
   mockups/plan-sheet-routes-2026-10-11, "Proposed").

   Two layers:
   1. #ag-dir.bm-sheet3 ... -- the legacy Trip Studio sheet as it still shows
      in the rest state (no destination yet): the navy-to-indigo header band,
      the icon mode tabs, the glossy footer CTA. Every selector carries
      .bm-trip.bm-light so it out-ranks trip.css's ".bm-first-light
      #ag-dir.bm-trip ..." rules.
   2. #ag-globe-shell #ag-dir.bm-s3 ... -- planning, computing, failed and
      route ready: sheet3.js renders the mockup's own structure (.s3) and the
      legacy inner is hidden. These rules are the mockup's mock.css (.p-*),
      class for class; two ids beat every legacy rule, and the shell's
      !important button resets are beaten with !important here.
   ========================================================================== */

/* ---- shell ------------------------------------------------------------ */
#ag-dir.bm-sheet3.bm-trip.bm-light.bm-trip-on {
  width: 384px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
  box-shadow: 0 30px 80px rgba(8, 15, 40, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #0f1e3d;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .ag-dir__inner {
  padding: 0;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .ag-dir__body {
  padding: 12px 12px 6px;
}

/* ---- header band -------------------------------------------------------- */
#ag-dir.bm-sheet3.bm-trip.bm-light .ag-dir__top {
  position: relative;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #0b1a3d 0%, #1e3a8a 55%, #4338ca 100%);
  color: #fff;
  border-radius: 23px 23px 0 0;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .ag-dir__top::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 80% at 100% 0%, rgba(255, 180, 140, 0.28), transparent 60%);
  pointer-events: none;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .ag-dir__top > * {
  position: relative;
  z-index: 1;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .ag-dir__title {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  opacity: 1;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-state-badge {
  display: none;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .ag-dir__grabber {
  background: rgba(255, 255, 255, 0.45);
}
#ag-dir.bm-sheet3.bm-trip.bm-light .ag-dir__top .ag-dir__toggle {
  color: #e0e7ff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 700;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .ag-dir__top .ag-dir__toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* the mode tabs, in the band, with line icons */
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-seg--icons {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 2px 0 0;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-seg--icons .bm-seg__b {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #c7d2fe;
  background: transparent;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-seg--icons .bm-seg__b svg {
  flex: none;
  width: 18px;
  height: 18px;
  max-width: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-seg--icons .bm-seg__b:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-seg--icons .bm-seg__b.bm-on {
  color: #fff;
  background-color: #059669 !important;
  background-image: linear-gradient(180deg, #34d399, #059669) !important;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}


/* ---- footer: glossy Get route, the hint as a caption under it ------------ */
#ag-dir.bm-sheet3.bm-trip.bm-light #bm-dir-footer {
  padding: 10px 12px 14px;
  background: linear-gradient(180deg, rgba(247, 249, 255, 0), #f2f5fd 30%);
  border-top: 1px solid #e8edf7;
}
#ag-globe-shell #ag-dir.bm-sheet3.bm-trip.bm-light #bm-dir-footer .ag-btn--primary {
  min-height: 50px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  background-color: #2563eb !important;
  background-image: linear-gradient(180deg, #3b82f6 0%, #2563eb 50%, #4338ca 100%) !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
#ag-globe-shell #ag-dir.bm-sheet3.bm-trip.bm-light #bm-dir-footer .ag-btn--primary:hover {
  background-image: linear-gradient(180deg, #2563eb 0%, #1d4ed8 50%, #3730a3 100%) !important;
}
#ag-globe-shell #ag-dir.bm-sheet3.bm-trip.bm-light #bm-dir-footer .ag-btn--primary:disabled {
  background-image: linear-gradient(180deg, #64748b, #475569) !important;
  box-shadow: none;
}
#ag-dir.bm-sheet3.bm-trip.bm-light #bm-dir-footer .ag-btn--primary.is-ready {
  animation: none;
}
#ag-dir.bm-sheet3.bm-trip.bm-light #bm-dir-footer .ag-route-hint--ready {
  order: 5;
  flex: 1 0 100%;
  margin: 0;
  padding: 0 4px;
  border: 0;
  background: none;
  text-align: center;
  color: #64748b;
  font-size: 11.5px;
}
#ag-dir.bm-sheet3.bm-trip.bm-light #bm-dir-footer .ag-route-hint--failed {
  order: 0;
  padding: 8px 10px;
  text-align: start;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff1f2, #fff7ed);
  color: #7f1d1d;
  font-size: 12px;
}
#ag-dir.bm-sheet3.bm-trip.bm-light #bm-dir-footer .ag-route-hint--stale {
  border-radius: 14px;
  border-color: #fde68a;
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  color: #78350f;
}


/* ---- the Ambient Drift button: off the sheet, above the map's scale bar ---- */
@media (min-width: 721px) {
  body:has(#ag-dir.bm-sheet3.bm-trip.bm-light) .ag-drift-btn {
    left: auto !important;
    right: 18px !important;
    bottom: 110px !important;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* ---- phone: the bottom sheet keeps its own height rules ------------------ */
@media (max-width: 720px) {
  #ag-dir.bm-sheet3.bm-trip.bm-light.bm-trip-on {
    width: 100%;
    border-radius: 24px 24px 0 0;
  }
  #ag-dir.bm-sheet3.bm-trip.bm-light .ag-dir__top {
    border-radius: 23px 23px 0 0;
  }
}

/* ==========================================================================
   2. The sheet (sheet3.js): mock.css's proposed sheet, class for class.
      .p-sheet -> .s3   .p-head -> .s3-head   .p-modes -> .s3-modes
      .p-body -> .s3-body   .p-card -> .s3-card / .ag-itin__card / .ag-itin__trip
      .p-stop -> .ag-itin__item   .p-leg -> .ag-itin__leg   .p-addrow -> .ag-itin__add
      .p-toggle -> .ag-itin__loop   .p-sum/.p-adv -> .ag-itin__tripchips/.ag-itin__trek
      .p-prog -> .s3-prog   .p-err -> .s3-err   .p-foot -> .s3-foot   .p-cta -> .s3-cta
      .p-hero/.p-elev/.p-terr/.p-leg-key -> .s3-hero/.s3-elev/.s3-terr/.s3-key
      .p-opt -> .s3-opt   .p-actions -> .s3-actions   .p-note -> .s3-note
   ========================================================================== */
#ag-globe-shell #ag-dir.bm-s3 {
  width: 384px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}
#ag-globe-shell #ag-dir.bm-s3 > .ag-dir__inner {
  display: none;
}
#ag-dir:not(.bm-s3) > .s3 {
  display: none;
}
#ag-globe-shell #ag-dir.bm-s3 > .s3 {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 30px 80px rgba(8, 15, 40, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.9);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #0f1e3d;
  text-align: start;
}
/* resets at (2,1,0) via :where(), so every rule below (2,2,0) beats them */
#ag-globe-shell #ag-dir.bm-s3 :where(.s3 button) {
  font: inherit;
  color: inherit;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  min-height: 0;
  -webkit-appearance: none;
  appearance: none;
}
#ag-globe-shell #ag-dir.bm-s3 :where(.s3 h3, .s3 h4, .s3 h5, .s3 b, .s3 small, .s3 p, .s3 span, .s3 em) {
  font-family: inherit;
}
#ag-globe-shell #ag-dir.bm-s3 :where(.s3 svg) {
  flex: none;
}
#ag-globe-shell #ag-dir.bm-s3 :where(#bm-itin) {
  font-family: inherit;
}

/* ---- grab handle (phone) ---- */
#ag-globe-shell #ag-dir.bm-s3 .s3-grab {
  display: none;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-grab .ag-dir__grabber {
  display: block;
  width: 40px;
  height: 5px;
  border-radius: 9px;
  background: #cbd5e1;
  margin: 8px auto 0;
  cursor: grab;
}

/* ---- head: .p-head ---- */
#ag-globe-shell #ag-dir.bm-s3 .s3-head {
  flex: none;
  position: relative;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #0b1a3d 0%, #1e3a8a 55%, #4338ca 100%);
  color: #fff;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-head::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, rgba(255, 180, 140, 0.28), transparent 60%);
  pointer-events: none;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-hrow {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-hrow h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.3;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-ib {
  margin-inline-start: auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14) !important;
  background-image: none !important;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex: none;
  cursor: pointer;
  box-shadow: none;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-ib:hover {
  background: rgba(255, 255, 255, 0.24) !important;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-ib svg {
  width: 16px;
  height: 16px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-back {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #dbe6ff;
  background: rgba(255, 255, 255, 0.12) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 11px 5px 8px;
  cursor: pointer;
  box-shadow: none;
  line-height: 1.45;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-back:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-back svg {
  width: 14px;
  height: 14px;
}
[dir="rtl"] #ag-globe-shell #ag-dir.bm-s3 .s3-back svg {
  transform: scaleX(-1);
}
#ag-globe-shell #ag-dir.bm-s3 .s3-sub {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 12.5px;
  color: #c7d2fe;
  font-weight: 600;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-modes {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
#ag-globe-shell #ag-dir.bm-s3 .s3-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 6px;
  border: 0;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #c7d2fe;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none;
  cursor: pointer;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-mode svg {
  width: 18px;
  height: 18px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-mode:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08) !important;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-mode.on {
  color: #fff;
  background-color: #059669 !important;
  background-image: linear-gradient(180deg, #34d399, #059669) !important;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
#ag-globe-shell #ag-dir.bm-s3 .s3 button:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

/* ---- body: .p-body ---- */
#ag-globe-shell #ag-dir.bm-s3 .s3-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-top:empty,
#ag-globe-shell #ag-dir.bm-s3 .s3-routed:empty {
  display: none;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-top,
#ag-globe-shell #ag-dir.bm-s3 .s3-routed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3--routed #bm-itin {
  display: none;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-card,
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__card,
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__trip {
  background: #fff;
  border: 1px solid #e3e8f4;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

/* ---- the stops card (#bm-itin, moved into the sheet) ---- */
#ag-globe-shell #ag-dir.bm-s3 #bm-itin {
  --ag-itin-ui: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--ag-itin-ui);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: #0f1e3d;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin[hidden] {
  display: none;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__card {
  position: relative;
  padding: 0;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__ch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px 4px;
  margin: 0;
  border: 0;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__cht {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__chsp {
  flex: 1;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__ch .ag-itin__pill,
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__tchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  min-height: 0;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid #dbe3f3;
  background: #fff !important;
  background-image: none !important;
  color: #1e3a8a;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__tchip {
  cursor: default;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__ch .ag-itin__pill svg,
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__tchip svg {
  width: 14px;
  height: 14px;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__ch .ag-itin__pill--opt {
  border: 0;
  color: #fff;
  background-color: #7c3aed !important;
  background-image: linear-gradient(135deg, #7c3aed, #c026d3) !important;
  box-shadow: 0 6px 14px rgba(192, 38, 211, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__ch .ag-itin__pill--opt em {
  font-style: normal;
  font-weight: 600;
  opacity: 0.9;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__ch .ag-itin__pill--best {
  background: #ecfdf5 !important;
  border-color: #a7f3d0;
  color: #065f46;
  cursor: default;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__list {
  list-style: none;
  margin: 0;
  padding: 4px 6px 6px;
  position: relative;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__item {
  border-radius: 12px;
  background: none;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__body {
  gap: 10px;
  min-height: 0;
  padding: 7px 6px;
  border-radius: 12px;
  background: #fff;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__item:hover .ag-itin__body {
  background: #f4f7ff;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__pin {
  width: 26px;
  height: 26px;
  font-size: 12.5px;
  font-weight: 800;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 55%), var(--c);
  box-shadow: 0 3px 8px color-mix(in srgb, var(--c) 45%, transparent), inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__nm {
  background: none !important;
  background-image: none !important;
  border: 0;
  padding: 0;
  box-shadow: none;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__nm b {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f1e3d;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__l2 small {
  font-size: 11.5px;
  color: #64748b;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__hd,
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__x {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #94a3b8;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none;
  opacity: 0;
  transition: opacity 0.15s;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__hd svg,
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__x svg {
  width: 14px;
  height: 14px;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__item:hover .ag-itin__hd,
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__item:hover .ag-itin__x,
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__item:focus-within .ag-itin__hd,
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__item:focus-within .ag-itin__x,
#ag-globe-shell #ag-dir.bm-s3 #bm-itin.ag-itin--remove .ag-itin__x {
  opacity: 1;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__x:hover {
  background: #fee2e2 !important;
  color: #dc2626;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin.ag-itin--remove .ag-itin__x {
  color: #dc2626;
  background: #fee2e2 !important;
}
/* touch: no hover, so the controls stay findable at a lower weight */
@media (hover: none) {
  #ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__hd,
  #ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__x {
    opacity: 0.55;
  }
}
/* legs: .p-leg -- a rail from one stop's colour to the next, and the chip */
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__leg {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 22px;
  padding-inline-start: 44px;
  position: relative;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__leg::before {
  content: "";
  position: absolute;
  inset-inline-start: 18px;
  inset-block: -6px;
  width: 3px;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(var(--a), var(--b));
  opacity: 0.85;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5fb;
  border: 1px solid #e3e8f4;
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__chip::before {
  content: none;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__chip--done {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__chip--now {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__chip--wait {
  color: #94a3b8;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__chip--bad {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__ring {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #dbeafe;
  border-top-color: #2563eb;
  animation: s3-spin 1s linear infinite;
  flex: none;
}
/* + Add a waypoint: .p-addrow */
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__add {
  list-style: none;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__addbtn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding: 7px 6px;
  border: 0;
  border-radius: 12px;
  background: none !important;
  background-image: none !important;
  box-shadow: none;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__addbtn:hover {
  background: #f4f7ff !important;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__plus {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px dashed #93b4f5;
  display: grid;
  place-items: center;
  flex: none;
  font-style: normal;
  font-weight: 700;
  color: #1d4ed8;
  background: none;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__addn {
  margin-inline-start: auto;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}
/* Return to start: .p-toggle */
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__loop {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid #eef2f9;
  border-radius: 0 0 18px 18px;
  background: none !important;
  background-image: none !important;
  box-shadow: none;
  font-size: 13px;
  font-weight: 650;
  color: #0f1e3d;
  text-align: start;
  cursor: pointer;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__loopt small {
  display: block;
  font-weight: 500;
  color: #64748b;
  font-size: 11.5px;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__sw {
  margin-inline-start: auto;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex: none;
  transition: background 0.15s;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__sw::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: inset-inline-start 0.15s;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__sw--on {
  background: linear-gradient(135deg, #10b981, #059669);
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__sw--on::after {
  inset-inline-start: 19px;
}
/* the trip card: .p-sum + .p-adv */
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__trip {
  margin: 0;
  padding: 0;
  display: block;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__tripchips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__tgl {
  height: 28px;
  min-height: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__trek {
  display: block;
  margin: 0 12px 12px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  background: linear-gradient(135deg, #fff7ed, #fffbeb);
  border: 1px solid #fed7aa;
  color: #7c2d12;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__trek b {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}
/* the itinerary's own failure card (a leg with no road, a stop to move): .p-err */
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__err {
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff1f2, #fff7ed);
  border: 1.5px solid #fecaca;
  color: #7f1d1d;
  font-size: 12.5px;
}
#ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__est {
  margin: 0;
}

/* ---- computing: .p-prog ---- */
#ag-globe-shell #ag-dir.bm-s3 .s3-prog {
  padding: 12px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-prog__ttl {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 14px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-prog__ttl em {
  margin-inline-start: auto;
  font-style: normal;
  color: #1d4ed8;
  font-size: 15px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-prog__sub {
  font-size: 12.5px;
  color: #475569;
  margin-top: 4px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-prog__bar {
  height: 8px;
  border-radius: 5px;
  background: #e2e8f0;
  overflow: hidden;
  margin: 10px 0 6px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-prog__bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #10b981);
  transition: width 0.4s;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-prog__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: #64748b;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-prog__meta svg {
  vertical-align: -2px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-ring {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #dbeafe;
  border-top-color: #2563eb;
  animation: s3-spin 1s linear infinite;
  flex: none;
}
@keyframes s3-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  #ag-globe-shell #ag-dir.bm-s3 .s3-ring,
  #ag-globe-shell #ag-dir.bm-s3 #bm-itin .ag-itin__ring {
    animation: none;
  }
}

/* ---- failed: .p-err ---- */
#ag-globe-shell #ag-dir.bm-s3 .s3-err {
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff1f2, #fff7ed);
  border: 1.5px solid #fecaca;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-err h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
  color: #7f1d1d;
  display: flex;
  gap: 8px;
  align-items: center;
  line-height: 1.3;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-err h4 svg {
  width: 18px;
  height: 18px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-err p {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #7f1d1d;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-err--quiet h4 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-err__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-err__b {
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  background: #fff !important;
  background-image: none !important;
  border: 1px solid #fecaca;
  color: #991b1b;
  box-shadow: none;
  cursor: pointer;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-err__b.p {
  border: 0;
  color: #fff;
  background-color: #dc2626 !important;
  background-image: linear-gradient(180deg, #ef4444, #b91c1c) !important;
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.3);
}

/* ---- route ready: .p-hero / .p-elev / .p-terr / .p-leg-key / .p-opt / .p-note ---- */
#ag-globe-shell #ag-dir.bm-s3 .s3-hero {
  padding: 14px 14px 10px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-hero__big {
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #0b1a3d;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-hero__big small {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  margin-inline-start: 6px;
  letter-spacing: 0;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #dbe3f3;
  background: #fff;
  color: #1e3a8a;
  white-space: nowrap;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-chip svg {
  width: 14px;
  height: 14px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-chip.ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-chip.cau {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-chip.bad {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-elev {
  padding: 0 12px 10px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-elev {
  position: relative;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-elev svg {
  width: 100%;
  height: 84px;
  display: block;
  cursor: crosshair;
  touch-action: pan-y;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-elev .bm-elevhero__hoverline {
  stroke: #1e3a8a;
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-elev .bm-elevhero__hovertip {
  top: -6px;
  background: #0b1a3d;
  border-color: #0b1a3d;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(8, 15, 40, 0.3);
}
#ag-globe-shell #ag-dir.bm-s3 .s3-elev__ax {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 600;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-terr {
  display: flex;
  height: 8px;
  border-radius: 5px;
  overflow: hidden;
  margin: 4px 12px 6px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-terr i {
  display: block;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-key {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 12px 12px;
  font-size: 11px;
  color: #475569;
  font-weight: 600;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-key i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-inline-end: 4px;
  vertical-align: -1px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-opts {
  display: grid;
  gap: 8px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1.5px solid #e3e8f4;
  background: #fff !important;
  background-image: none !important;
  box-shadow: none;
  text-align: start;
  cursor: pointer;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-opt.sel {
  border-color: #3b82f6;
  background: #eff6ff !important;
  background-image: linear-gradient(135deg, #eff6ff, #f5f3ff) !important;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.18);
  cursor: default;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-opt__rad {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  flex: none;
  box-sizing: border-box;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-opt.sel .s3-opt__rad {
  border: 5px solid #2563eb;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-opt__t {
  flex: 1;
  min-width: 0;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-opt__t b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f1e3d;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-opt__t small,
#ag-globe-shell #ag-dir.bm-s3 .s3-opt__v small {
  color: #64748b;
  font-size: 11.5px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-opt__v {
  font-weight: 800;
  font-size: 14px;
  text-align: end;
  color: #0f1e3d;
  white-space: nowrap;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-opt__v small {
  display: block;
  font-weight: 600;
  font-size: 11px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-note {
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  padding: 0 4px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-note--in {
  padding: 6px 12px 12px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-note svg {
  width: 14px;
  height: 14px;
  margin-top: 1px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-routed .bm-corridor-save {
  margin: 0;
}

/* ---- foot: .p-foot / .p-cta / .p-cap / .p-actions ---- */
#ag-globe-shell #ag-dir.bm-s3 .s3-foot {
  flex: none;
  padding: 10px 12px 14px;
  background: linear-gradient(180deg, rgba(247, 249, 255, 0), #f2f5fd 30%);
  border-top: 1px solid #e8edf7;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-cta {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: #2563eb !important;
  background-image: linear-gradient(180deg, #3b82f6 0%, #2563eb 50%, #4338ca 100%) !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  cursor: pointer;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-cta:hover {
  background-image: linear-gradient(180deg, #2563eb 0%, #1d4ed8 50%, #3730a3 100%) !important;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-cta svg {
  width: 18px;
  height: 18px;
}
[dir="rtl"] #ag-globe-shell #ag-dir.bm-s3 .s3-cta svg {
  transform: scaleX(-1);
}
#ag-globe-shell #ag-dir.bm-s3 .s3-cta span {
  position: relative;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-cta:disabled {
  cursor: default;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-cta--busy,
#ag-globe-shell #ag-dir.bm-s3 .s3-cta--busy:hover,
#ag-globe-shell #ag-dir.bm-s3 .s3-cta:disabled {
  background-color: #475569 !important;
  background-image: linear-gradient(180deg, #64748b, #475569) !important;
  box-shadow: none;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-cta--ghost {
  color: #1e3a8a;
  background-color: #eef3ff !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 1.5px #c7d2fe;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-cta__fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  transition: width 0.4s;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-ring--w {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-cap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 11.5px;
  color: #64748b;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-link {
  border: 0;
  padding: 0;
  background: none !important;
  background-image: none !important;
  box-shadow: none;
  color: #b91c1c;
  font-weight: 700;
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-link:hover {
  text-decoration: underline;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-link--blue {
  color: #1d4ed8;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-confirm {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5 !important;
  background-image: none !important;
  color: #065f46;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-actions {
  display: grid;
  grid-template-columns: repeat(var(--n, 5), 1fr);
  gap: 4px;
  margin-top: 10px;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none !important;
  background-image: none !important;
  box-shadow: none;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  color: #1e3a8a;
  text-align: center;
  cursor: pointer;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-act {
  height: auto !important; /* a legacy button height squeezed the circles to 21 px */
}
#ag-globe-shell #ag-dir.bm-s3 .s3-act i {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef3ff;
  border: 1px solid #dbe4fb;
  color: #1d4ed8;
  transition: background 0.15s;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-act:hover i {
  background: #dfe8ff;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-act svg {
  width: 17px;
  height: 17px;
}

/* ---- the terrain key on the map (route ready, hiking): .maplegend ---- */
.s3-maplegend {
  position: absolute;
  inset-inline-start: 420px;
  bottom: 40px; /* above the map's attribution bar */
  z-index: 5;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 420px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  font: 700 11px/1.3 Inter, system-ui, sans-serif;
  color: #0f1e3d;
  pointer-events: none;
}
.s3-maplegend:empty {
  display: none;
}
.s3-maplegend i {
  display: inline-block;
  width: 18px;
  height: 6px;
  border-radius: 3px;
  margin-inline-end: 5px;
  vertical-align: 1px;
  box-shadow: 0 0 0 1.5px #0b1230;
}
.s3-maplegend i.dots {
  background-image: radial-gradient(circle, #fff 1.2px, transparent 1.6px);
  background-size: 6px 6px;
}

/* ---- the spot the elevation hover points at, on the route ---- */
#ag-globe-shell.bm-sheet3-on .ag-elev-hover-puck {
  width: 16px;
  height: 16px;
  background: #3b82f6;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(11, 18, 48, 0.55), 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* ---- the lettered map pins: glossy, with a ring (mock.css .mpin.p) ---- */
#ag-globe-shell.bm-sheet3-on .ag-itin-pin::before {
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45), transparent 55%), var(--c);
  border-width: 3px;
  box-shadow: 0 0 0 3px rgba(11, 18, 39, 0.25);
}

@media (max-width: 720px) {
  #ag-globe-shell #ag-dir.bm-s3 {
    width: 100%;
    border-radius: 24px 24px 0 0;
  }
  #ag-globe-shell #ag-dir.bm-s3 > .s3 {
    border-radius: 24px 24px 0 0;
  }
  /* .p-grab: a grey handle on the white sheet, above the band */
  #ag-globe-shell #ag-dir.bm-s3 .s3-grab {
    display: block;
    flex: none;
  }
  .s3-maplegend {
    inset-inline: 10px;
    top: auto;
    bottom: calc(var(--ag-dir-h, 55vh) + 10px);
    max-width: none;
  }
}

/* ---- a saved route, and the sheet's own confirmation toast ---- */
#ag-globe-shell #ag-dir.bm-s3 .s3-act.on i {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
#ag-globe-shell #ag-dir.bm-s3 > .s3 {
  position: relative;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-toast {
  position: absolute;
  inset-inline: 12px;
  bottom: 150px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #0b1a3d;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 12px 26px rgba(8, 15, 40, 0.35);
}
#ag-globe-shell #ag-dir.bm-s3 .s3-toast[hidden] {
  display: none;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-toast span {
  flex: 1;
}
#ag-globe-shell #ag-dir.bm-s3 .s3-toast__a {
  border: 0;
  padding: 0;
  background: none !important;
  background-image: none !important;
  color: #93c5fd;
  font-weight: 800;
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

/* ---- the Saved list (legacy sheet's sub-panel, rest state) ---- */
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-saved__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px;
  border-bottom: 1px solid #eef2f9;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-saved__t {
  flex: 1;
  min-width: 0;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-saved__t b {
  display: block;
  font-size: 13px;
  color: #0f1e3d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-saved__t span {
  font-size: 11.5px;
  color: #64748b;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-saved__open {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12.5px;
}
#ag-dir.bm-sheet3.bm-trip.bm-light .bm-saved__del {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  color: #b91c1c;
}
