/* Planner workspace: trip definition → itinerary → one selected edit context. */

:root { --panel-w: 430px; }

.panel {
  top: 18px;
  left: 18px;
  bottom: auto;
  width: var(--panel-w);
  height: auto;
  max-height: calc(100dvh - 36px);
  background: rgba(252, 250, 245, 0.97);
  border-color: rgba(126, 113, 89, 0.24);
  border-radius: 14px;
  box-shadow: 0 18px 55px rgba(31, 36, 36, 0.17);
  backdrop-filter: blur(18px);
}

.panel.state-plan { bottom: 18px; }
.panel.state-search .trip-summary,
.panel.state-search .planner-results { display: none; }
.panel.state-plan .planner-form { display: none; }
.panel.state-plan .panel-foot { display: none; }

.masthead {
  min-height: 66px;
  padding: 13px 16px;
  gap: 11px;
  background: rgba(255,255,255,0.48);
}
.masthead h1 { font-size: 23px; }
.masthead-sub { margin-top: 3px; font-size: 9.5px; letter-spacing: 0.13em; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; }
.acct-btn { height: 32px; border-radius: 9px; background: #fff; }
.panel-toggle { width: 32px; height: 32px; border-radius: 9px; }

.planner-form {
  display: grid;
  gap: 15px;
  padding: 20px;
  overflow-y: auto;
  border: 0;
  background: transparent;
}
.planner-intro { display: grid; gap: 5px; padding-bottom: 2px; }
.planner-kicker {
  color: var(--blaze);
  font: 600 10px "IBM Plex Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.planner-intro h2 {
  max-width: 340px;
  font: 700 27px/1.08 "Bricolage Grotesque", sans-serif;
  letter-spacing: -0.025em;
}
.planner-intro p { max-width: 350px; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }

.route-browser { min-width: 0; }
.route-browser > header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 9px;
}
.route-browser > header strong { font: 700 13px "Bricolage Grotesque", sans-serif; }
.route-browser > header small { color: var(--ink-soft); font-size: 9px; }
.route-card-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  max-height: min(52dvh, 560px); padding: 2px 4px 8px 2px; overflow-y: auto;
  scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #cfc6b6 transparent;
}
.route-card-loading {
  grid-column: 1 / -1; padding: 28px; border: 1px dashed var(--line); border-radius: 12px;
  color: var(--ink-soft); font-size: 11px; text-align: center;
}
.route-choice {
  position: relative; min-width: 0; overflow: hidden; border: 1px solid #d7d0c3; border-radius: 12px;
  background: #fff; box-shadow: 0 2px 8px rgba(35,40,43,.06);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.route-choice:hover { transform: translateY(-1px); border-color: var(--route-color); box-shadow: 0 7px 18px rgba(35,40,43,.12); }
.route-choice.selected { border-color: var(--route-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--route-color) 26%, transparent); }
.route-choice > button {
  width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left;
}
.route-choice > button:focus-visible { outline: 3px solid var(--route-color); outline-offset: -3px; }
.route-card-photo { position: relative; display: block; height: 108px; overflow: hidden; background: #d9ded8; }
.route-card-photo::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(18,23,24,.45)); }
.route-card-photo img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 450ms ease; }
.route-choice:hover .route-card-photo img { transform: scale(1.035); }
.route-card-photo > i {
  position: absolute; z-index: 1; top: 8px; left: 8px; padding: 4px 6px; border-radius: 999px;
  background: rgba(26,31,31,.72); color: #fff; font: 600 8px "IBM Plex Mono", monospace; font-style: normal;
}
.route-card-photo .route-coverage.complete { background: rgba(47,79,69,.84); }
.route-card-copy { display: grid; gap: 7px; padding: 11px 11px 12px; }
.route-card-title { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.route-card-title > b { color: var(--route-color); font: 700 17px "Bricolage Grotesque", sans-serif; }
.route-card-title > strong { overflow: hidden; font: 650 11px "Archivo", sans-serif; white-space: nowrap; text-overflow: ellipsis; }
.route-card-endpoints { overflow: hidden; color: var(--ink-soft); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.route-card-stats { display: grid; grid-template-columns: .7fr .8fr 1.25fr; gap: 5px; }
.route-card-stats > span { min-width: 0; padding: 6px; border-radius: 7px; background: #f3f0e8; }
.route-card-stats b, .route-card-stats small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.route-card-stats b { font: 650 10px "IBM Plex Mono", monospace; }
.route-card-stats small { margin-top: 2px; color: var(--ink-soft); font-size: 7px; text-transform: uppercase; letter-spacing: .02em; }
.route-card-description { min-height: 45px; color: #50585b; font-size: 9.5px; line-height: 1.45; }
.route-card-action { color: var(--route-color); font-size: 9px; font-weight: 700; }
.route-card-action b { margin-left: 3px; font-size: 13px; }
.route-photo-credit {
  position: absolute; z-index: 2; top: 86px; right: 6px; max-width: calc(100% - 12px); padding: 3px 5px;
  overflow: hidden; border-radius: 4px; background: rgba(18,23,24,.68); color: rgba(255,255,255,.88);
  font-size: 7px; text-decoration: none; white-space: nowrap; text-overflow: ellipsis;
}
.route-photo-credit:hover { color: #fff; text-decoration: underline; }
.route-select-fallback {
  position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important;
}

.field { gap: 6px; color: var(--ink); font: 600 11px "Archivo", sans-serif; letter-spacing: 0; text-transform: none; }
.field > span:first-child { display: block; }
.field > .field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.field-label small { color: var(--ink-soft); font: 500 9px "IBM Plex Mono", monospace; }
.field input, .field select {
  height: 43px;
  padding: 9px 11px;
  border-color: #d6cfbf;
  border-radius: 9px;
  font-size: 13px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.9);
}
.field input:hover, .field select:hover { border-color: #aba18f; }
.field input:focus, .field select:focus,
.date-range-button:focus-visible { outline: 2px solid var(--pine); outline-offset: 1px; }
.date-range-button {
  min-height: 49px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
}
.date-range-button i { color: var(--ink-soft); }
.trip-shape { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.ferrata-option { border: 1px solid #e3ddd1; border-radius: 8px; }
.ferrata-option strong { font-size: 11px; }

.plan-submit {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 10px;
  background: #2f4f45;
  font-size: 13px;
  box-shadow: 0 5px 16px rgba(47,79,69,0.2);
}
.plan-submit span { font-size: 17px; line-height: 1; }
.route-source { justify-self: center; margin: -6px 0 0; font-size: 9px; }

.planner-meta {
  padding: 10px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #f4f0e7;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.4;
}
.planner-meta:empty { display: none; }
.state-search .planner-meta { border-radius: 0 0 13px 13px; }
.panel-foot { padding: 9px 16px; border-top: 1px solid var(--line); font-size: 9.5px; }

.trip-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.58);
}
.trip-summary > div { min-width: 0; display: grid; gap: 2px; }
.trip-summary span { color: var(--blaze); font: 600 9px "IBM Plex Mono", monospace; letter-spacing: 0.07em; text-transform: uppercase; }
.trip-summary strong { overflow: hidden; font: 700 16px "Bricolage Grotesque", sans-serif; white-space: nowrap; text-overflow: ellipsis; }
.trip-summary small { color: var(--ink-soft); font-size: 9.5px; }
.trip-summary button {
  flex: none;
  padding: 7px 9px;
  border: 1px solid #cfc7b7;
  border-radius: 8px;
  background: #fff;
  color: var(--pine);
  cursor: pointer;
  font: 600 10px "Archivo", sans-serif;
}

.plan-refreshing { display: grid; place-items: center; align-content: center; gap: 12px; height: 100%; color: var(--ink-soft); font-size: 11px; }
.plan-refreshing i { width: 22px; height: 22px; border: 2px solid #d4cec2; border-top-color: var(--pine); border-radius: 50%; animation: section-spin .8s linear infinite; }
@keyframes section-spin { to { transform: rotate(360deg); } }

.planner-results { padding: 0 10px 14px; background: #f7f4ed; }
.plan-card { padding: 0; border: 0; border-radius: 0; background: transparent; }
.itinerary-overview { position: relative; padding: 12px 2px 0; }
.trip-totals { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 6px; margin: 0; }
.trip-totals span {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid #e0d9cc;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}
.trip-totals small { color: var(--ink-soft); font: 500 8px "Archivo", sans-serif; }
.trip-totals b { font: 600 11px "IBM Plex Mono", monospace; }
.route-history { display: flex; justify-content: flex-end; gap: 5px; margin-top: 6px; }
.route-history button { border-radius: 6px; font-size: 9px; }

.availability-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 11px;
  margin: 9px 2px 4px;
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 8.5px;
}
.availability-key i, .availability-dot, .hut-option-name > i {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #d39b36;
}
.availability-key .available i { background: #2f855a; }
.availability-key .unavailable i { background: #c6363c; }
.availability-key .not-released i { background: #71808a; }

.plan-days { display: grid; gap: 8px; margin-top: 10px; }
.stage {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dcd5c7;
  border-radius: 10px;
  background: #fff;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.stage.active { margin: 0; padding: 0; border-color: #7d968d; background: #fff; box-shadow: 0 4px 13px rgba(55,84,74,0.09); }
.stage-select {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  padding: 12px 13px 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.stage-select:hover { background: #fbfaf6; }
.stage.active .stage-select { background: #f0f5f2; }
.stage-day { display: flex; align-items: baseline; gap: 8px; }
.stage-day b { font: 700 11px "IBM Plex Mono", monospace; text-transform: uppercase; }
.stage-day time { color: var(--ink-soft); font-size: 9.5px; }
.stage-route { grid-column: 1 / -1; display: flex; min-width: 0; gap: 6px; margin: 0; font-size: 11.5px; }
.stage-route span, .stage-route strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stage-route span { color: var(--ink-soft); }
.stage-route i { flex: none; color: var(--blaze); font-style: normal; }
.stage-effort { display: flex; justify-content: flex-end; gap: 7px; margin: 0; color: var(--ink-soft); font: 500 8.5px "IBM Plex Mono", monospace; }
.stage-effort b { color: var(--ink); }

.night-row { border-top: 1px solid #ebe5d9; background: #fcfbf8; }
.night-photo img { height: 130px; }
.night-photo figcaption { padding: 5px 9px 6px; border-bottom: 1px solid #e4ded2; }
.night-stop {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0,1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.night-stop:hover { background: #f4f1e9; }
.night-stop.available .availability-dot, .night-stop.party_available .availability-dot { background: #2f855a; }
.night-stop.unavailable .availability-dot { background: #c6363c; }
.night-stop.not_released .availability-dot { background: #71808a; }
.night-name { min-width: 0; display: grid; gap: 1px; }
.night-name small { color: var(--ink-soft); font-size: 8px; text-transform: uppercase; }
.night-name strong { overflow: hidden; font-size: 10.5px; white-space: nowrap; text-overflow: ellipsis; }
.night-availability { color: var(--ink-soft); font: 500 8.5px "IBM Plex Mono", monospace; white-space: nowrap; }
.night-change { color: var(--pine); font-size: 9px; font-weight: 600; white-space: nowrap; }
.night-change b { font-size: 14px; }
.stay-link { display: block; padding: 0 12px 9px 28px; color: var(--pine); font-size: 9px; font-weight: 600; text-decoration: none; }
.route-finish { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-top: 1px solid #e2ddd2; background: #edf2ef; }
.route-finish > i { width: 8px; height: 8px; border-radius: 50%; background: var(--pine); }
.route-finish span { display: grid; gap: 1px; }
.route-finish small { color: var(--ink-soft); font-size: 8px; text-transform: uppercase; }
.route-finish strong { font-size: 10.5px; }

.stage-detail { margin: 0; padding: 12px; border-top: 1px solid #d8e0dc; background: #f5f7f4; }
.stage.swap-mode .stage-detail-head,
.stage.swap-mode .stage-detail-stats,
.stage.swap-mode .elevation-profile,
.stage.swap-mode .stage-actions,
.stage.swap-mode .route-edit-panel { display: none; }
.stage.swap-mode .stage-detail { padding-top: 9px; }
.stage-detail-head { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.stage-detail-head > strong { flex: 1; font: 700 11px "Archivo", sans-serif; }
.stage-detail-stats { grid-template-columns: repeat(4, 1fr); gap: 5px; }
.stage-detail-stats span { gap: 3px; padding: 7px; border: 1px solid #e3e6e2; }
.stage-detail-stats small { font-size: 7px; }
.stage-detail-stats b { font-size: 9px; }
.elevation-profile { height: 112px; margin-top: 8px; border: 1px solid #e1e6e2; background: linear-gradient(#e9f0ed, #fff); }
.stage-actions { margin-top: 8px; }
.change-night, .edit-path { min-height: 38px; border-radius: 8px; font-size: 10px; }
.detour-status, .terrain-warning { font-size: 7.5px; }

.hut-options { gap: 7px; margin-top: 10px; }
.hut-options-title { display: grid; gap: 3px; padding: 3px 1px 2px; }
.hut-options-title strong { color: var(--ink); font-size: 11px; }
.hut-options-title span { color: var(--ink-soft); font-size: 9px; line-height: 1.35; }
.hut-option {
  grid-template-columns: minmax(0,1fr) auto;
  gap: 5px 10px;
  padding: 10px;
  border-radius: 8px;
}
.hut-option:hover:not(:disabled) { border-color: #6f8c82; box-shadow: 0 2px 8px rgba(55,84,74,0.08); }
.hut-option-name { align-items: center; gap: 7px; }
.hut-option-name > span { min-width: 0; display: grid; gap: 1px; }
.hut-option-name strong { font-size: 10.5px; }
.hut-option-name small { font-size: 8px; }
.hut-option.available .hut-option-name > i, .hut-option.party_available .hut-option-name > i { background: #2f855a; }
.hut-option.unavailable .hut-option-name > i { background: #c6363c; }
.hut-option.not_released .hut-option-name > i { background: #71808a; }
.hut-option-status { font-size: 8px; }
.hut-option-days { color: var(--ink-soft); font-size: 8.5px; }
.hut-option-days b { color: var(--ink); }
.hut-option-days i { color: #b1a999; font-style: normal; }
.hut-option-pick { align-self: end; justify-self: end; color: var(--pine); font-size: 9px; font-weight: 600; }
.no-hut-options { padding: 10px; border-radius: 7px; background: #fff; }

@media (max-width: 640px) {
  :root { --panel-w: auto; }
  .panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: calc(100dvh - 70px);
    border-radius: 16px;
  }
  .panel.state-plan { bottom: 8px; height: 68dvh; }
  .masthead { min-height: 56px; padding: 10px 12px; }
  .masthead-sub { display: none; }
  .planner-form { padding: 16px; gap: 13px; }
  .planner-intro h2 { font-size: 24px; }
  .planner-intro p { font-size: 11px; }
  .trip-shape { gap: 6px; }
  .field { font-size: 10px; }
  .field input, .field select { height: 40px; padding: 7px; font-size: 12px; }
  .date-picker { position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; padding: 13px; border-radius: 14px; }
  .date-grid button { height: 38px; }
  .trip-summary { padding: 11px 13px; }
  .trip-summary strong { font-size: 14px; }
  .trip-summary small { font-size: 8.5px; }
  .planner-meta { padding: 8px 13px; }
  .planner-results { padding: 0 8px 12px; }
  .stage-select { padding: 10px; }
  .night-stop { padding: 8px 10px; }
  .night-availability { max-width: 105px; overflow: hidden; text-overflow: ellipsis; }
  .night-change { font-size: 0; }
  .night-change b { font-size: 16px; }
  .stage-detail { padding: 10px; }
  .stage-detail-stats { grid-template-columns: repeat(2, 1fr); }
  .elevation-profile { height: 100px; }
  .map-ctl { top: 10px; right: 10px; }
}

/* Map-first itinerary workspace. */
.stage-destination { min-width: 0; display: flex; align-items: center; gap: 7px; }
.stage-destination strong { overflow: hidden; font-size: 10.5px; white-space: nowrap; text-overflow: ellipsis; }
.availability-dot.available, .availability-dot.party_available { background: #2f855a; }
.availability-dot.unavailable { background: #c6363c; }
.availability-dot.not_released { background: #71808a; }
.availability-dot.unknown { background: #d39b36; }
.availability-dot.finish { background: var(--pine); }

.plan-days {
  display: flex;
  gap: 0;
  margin: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.stage { flex: 1 0 145px; scroll-snap-align: center; border-radius: 0; border-width: 0 1px 0 0; box-shadow: none; }
.stage:first-child { border-radius: 10px 0 0 10px; }
.stage:last-child { border: 0; border-radius: 0 10px 10px 0; }
.stage.active { border-color: #9aafa7; box-shadow: inset 0 -3px 0 var(--pine); }
.stage-select { height: 78px; padding: 9px 11px; gap: 5px; }
.stage-day b { font-size: 9px; }
.stage-day time { font-size: 8.5px; }
.stage-destination { grid-column: 1 / -1; }
.stage-effort { grid-column: 1 / -1; justify-content: flex-start; }

.stage-inspector { margin-top: 8px; }
.stage-inspector:empty { display: none; }
.stage-inspector-content {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.2fr);
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid #d8d1c4;
  border-radius: 11px;
  background: rgba(252,251,247,0.98);
  box-shadow: 0 8px 25px rgba(35,40,43,0.14);
}
.inspector-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.inspector-head > span:first-child { flex: 1; min-width: 0; display: grid; gap: 2px; }
.inspector-head small { color: var(--ink-soft); font: 600 8px "IBM Plex Mono", monospace; text-transform: uppercase; }
.inspector-head strong { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.inspector-head strong i { color: var(--blaze); font-style: normal; }
.inspector-flags { display: flex; gap: 5px; }
.stage-inspector .night-row { grid-column: 1; align-self: start; overflow: hidden; border: 1px solid #e1dbce; border-radius: 8px; }
.stage-inspector .route-finish { grid-column: 1; border: 1px solid #dde4e0; border-radius: 8px; }
.stage-inspector .day-analysis { grid-column: 2; grid-row: 2 / span 2; }
.stage-inspector .stage-detail-stats { grid-template-columns: repeat(4, 1fr); }
.stage-inspector .elevation-profile { height: 92px; }
.stage-inspector .stage-actions { grid-column: 1; align-self: end; }
.stage-inspector .route-edit-panel,
.stage-inspector .hut-options { grid-column: 1 / -1; }

.stage-inspector.swap-mode .day-analysis,
.stage-inspector.swap-mode .stage-actions,
.stage-inspector.swap-mode .route-edit-panel { display: none; }
.stage-inspector.swap-mode .hut-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}
.stage-inspector.swap-mode .hut-options-title { grid-column: 1 / -1; }

@media (min-width: 641px) {
  .panel.state-plan {
    inset: 0;
    width: auto;
    height: auto;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: none;
  }
  .state-plan .masthead {
    position: fixed;
    top: 18px;
    left: 18px;
    width: 250px;
    min-height: 58px;
    border: 1px solid rgba(126,113,89,0.25);
    border-radius: 12px;
    background: rgba(252,250,245,0.97);
    box-shadow: 0 8px 24px rgba(31,36,36,0.13);
    pointer-events: auto;
  }
  .state-plan .masthead-sub { display: none; }
  .state-plan .trip-summary {
    position: fixed;
    top: 18px;
    left: 280px;
    width: 390px;
    min-height: 58px;
    padding: 10px 13px;
    border: 1px solid rgba(126,113,89,0.25);
    border-radius: 12px;
    background: rgba(252,250,245,0.97);
    box-shadow: 0 8px 24px rgba(31,36,36,0.13);
    pointer-events: auto;
  }
  .state-plan .planner-meta { display: none; }
  .state-plan .planner-results {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    padding: 0;
    overflow: visible;
    background: transparent;
    pointer-events: auto;
  }
  .state-plan .plan-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; align-items: end; }
  .state-plan .itinerary-overview {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 25px;
    padding: 5px 9px;
    border: 1px solid rgba(126,113,89,0.25);
    border-radius: 9px;
    background: rgba(252,250,245,0.97);
    box-shadow: 0 5px 16px rgba(35,40,43,0.1);
  }
  .state-plan .availability-key { margin: 0; }
  .state-plan .route-history { margin: 0 0 0 12px; }
  .state-plan .plan-days {
    grid-column: 1;
    grid-row: 2;
    border: 1px solid rgba(126,113,89,0.25);
    border-radius: 11px;
    background: rgba(252,250,245,0.97);
    box-shadow: 0 8px 25px rgba(35,40,43,0.14);
  }
  .state-plan .stage-inspector { grid-column: 1; grid-row: 3; }
}

@media (max-width: 640px) {
  .panel.state-plan { height: 62dvh; }
  .state-plan .planner-meta { display: none; }
  .state-plan .planner-results { padding: 8px; }
  .state-plan .itinerary-overview { display: flex; align-items: center; gap: 8px; padding: 0 0 7px; }
  .state-plan .trip-totals { flex: 1; }
  .state-plan .availability-key { display: none; }
  .stage { flex-basis: 165px; }
  .stage-inspector-content { display: block; padding: 10px; }
  .stage-inspector .night-row, .stage-inspector .route-finish { margin-top: 9px; }
  .stage-inspector .day-analysis { margin-top: 8px; }
  .stage-inspector .stage-actions { margin-top: 8px; }
  .stage-inspector.swap-mode .hut-options { grid-template-columns: 1fr; margin-top: 9px; }
}

/* Desktop: a stable itinerary column beside the map. */
@media (min-width: 641px) {
  .panel.state-search { width: 560px; }
  .panel.state-search .planner-form { padding: 24px 26px 28px; }
  .panel,
  .panel.state-plan {
    inset: 0 auto 0 0;
    width: 440px;
    height: 100dvh;
    max-height: none;
    overflow: hidden;
    border: 0;
    border-right: 1px solid #d7d0c3;
    border-radius: 0;
    background: #fbfaf6;
    box-shadow: 8px 0 28px rgba(35,40,43,0.12);
    backdrop-filter: none;
    pointer-events: auto;
  }
  .panel.state-search .planner-form { flex: 1; align-content: start; padding: 26px 28px; }
  .state-plan .masthead {
    position: static;
    width: auto;
    min-height: 64px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }
  .state-plan .masthead-sub { display: block; }
  .state-plan .trip-summary {
    position: static;
    width: auto;
    min-height: 70px;
    padding: 13px 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }
  .state-plan .planner-results {
    position: static;
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow-y: auto;
    background: #fbfaf6;
  }
  .state-plan .plan-card { display: block; }
  .state-plan .itinerary-overview {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    min-height: 34px;
    padding: 8px 16px;
    border: 0;
    border-bottom: 1px solid #e2dccf;
    border-radius: 0;
    background: rgba(251,250,246,0.96);
    box-shadow: none;
  }
  .state-plan .availability-key { justify-content: flex-start; margin: 0; }
  .state-plan .route-history { margin-left: auto; }
  .state-plan .plan-days {
    display: block;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .state-plan .stage {
    display: block;
    width: auto;
    border: 0;
    border-bottom: 1px solid #e2dccf;
    border-radius: 0;
    background: #fff;
  }
  .state-plan .stage.active { border-color: #7e9a90; background: #eef3f0; box-shadow: inset 4px 0 0 var(--pine); }
  .state-plan .stage-select { height: auto; min-height: 76px; padding: 13px 16px; }
  .state-plan .stage-day b { font-size: 10px; }
  .state-plan .stage-day time { font-size: 9px; }
  .state-plan .stage-destination strong { font-size: 12px; }
  .state-plan .stage-effort { font-size: 9px; }
  .state-plan .stage-inspector { display: none; margin: 0; }
  .state-plan .plan-card.inspecting .stage-inspector { display: block; }
  .state-plan .plan-card.inspecting .itinerary-overview,
  .state-plan .plan-card.inspecting .plan-days { display: none; }
  .state-plan .stage-inspector-content {
    display: block;
    min-height: 100%;
    padding: 18px;
    border: 0;
    border-radius: 0;
    background: #fbfaf6;
    box-shadow: none;
  }
  .state-plan .inspector-head { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-bottom: 16px; }
  .state-plan .inspector-head > span:first-of-type { min-width: 0; }
  .state-plan .inspector-flags { grid-column: 2; }
  .inspector-back {
    grid-row: 1 / span 2;
    align-self: start;
    padding: 7px 9px;
    border: 1px solid #d4cdbf;
    border-radius: 7px;
    background: #fff;
    color: var(--pine);
    cursor: pointer;
    font: 600 9px "Archivo", sans-serif;
  }
  .state-plan .stage-inspector .night-row,
  .state-plan .stage-inspector .route-finish { margin: 0 0 12px; }
  .state-plan .stage-inspector .day-analysis { margin-top: 12px; }
  .state-plan .stage-inspector .stage-detail-stats { grid-template-columns: repeat(2, 1fr); }
  .state-plan .stage-inspector .elevation-profile { height: 135px; }
  .state-plan .stage-inspector .stage-actions { margin-top: 12px; }
  .state-plan .stage-inspector.swap-mode .hut-options { display: grid; grid-template-columns: 1fr; margin-top: 14px; }
}

@media (max-width: 640px) {
  .route-browser > header small { display: none; }
  .route-card-grid {
    display: flex; max-height: none; margin-right: -20px; padding-right: 20px;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  }
  .route-choice { flex: 0 0 min(78vw, 300px); scroll-snap-align: start; }
  .route-card-photo { height: 118px; }
  .route-photo-credit { top: 96px; }
}

@media (max-width: 640px) {
  .inspector-back { display: none; }
}

/* Route ladder: dates are columns, huts are choices, days are connectors. */
.ladder-intro { display: grid; gap: 1px; margin-right: auto; }
.ladder-intro strong { font-size: 11px; }
.ladder-intro small { color: var(--ink-soft); font-size: 8.5px; }
.ladder-nav { display: flex; gap: 4px; }
.ladder-nav button {
  width: 27px;
  height: 27px;
  border: 1px solid #d4cdbf;
  border-radius: 7px;
  background: #fff;
  color: var(--pine);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.ladder-nav button:hover { border-color: #789288; }
.route-ladder {
  display: flex;
  align-items: flex-start;
  min-height: 0;
  padding: 3px 14px 15px;
  overflow: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.ladder-column {
  width: 216px;
  flex: 0 0 216px;
  padding: 0 5px;
  scroll-snap-align: start;
}
.ladder-column.ladder-start { width: 148px; flex-basis: 148px; }
.ladder-leg-button, .ladder-start-spacer {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.ladder-start-spacer { cursor: default; }
.ladder-leg-button:hover { background: #f0eee7; }
.ladder-leg-button > span:first-child { display: grid; gap: 2px; }
.ladder-leg-button b { font: 700 9px "IBM Plex Mono", monospace; text-transform: uppercase; }
.ladder-leg-button time { color: var(--ink-soft); font-size: 8.5px; }
.ladder-leg-metrics { display: grid; justify-items: end; gap: 1px; }
.ladder-leg-metrics strong { font: 600 10px "IBM Plex Mono", monospace; }
.ladder-leg-metrics small { color: var(--ink-soft); font-size: 8px; }
.ladder-line { position: relative; height: 19px; margin: 0 -5px; }
.ladder-line::before { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 2px; background: #b8c8c2; }
.ladder-line i { position: absolute; z-index: 1; top: 3px; right: 8px; width: 11px; height: 11px; border: 3px solid #527a6c; border-radius: 50%; background: #fbfaf6; }
.ladder-column.active .ladder-line::before { background: var(--blaze); }
.ladder-column.active .ladder-line i { border-color: var(--blaze); }
.ladder-selected {
  min-height: 93px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px;
  border: 1px solid #d7d0c4;
  border-top: 3px solid #d39b36;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(35,40,43,0.06);
}
.ladder-selected.available, .ladder-selected.party_available { border-top-color: #2f855a; }
.ladder-selected.unavailable { border-top-color: #c6363c; }
.ladder-selected.not_released { border-top-color: #71808a; }
.ladder-selected.finish { border-top-color: var(--pine); background: #edf2ef; }
.route-endpoint-card { cursor: default; }
.route-endpoint-control { min-width: 0; display: flex; align-items: center; gap: 6px; }
.route-endpoint-control select {
  min-width: 0;
  width: 100%;
  padding: 3px 20px 3px 3px;
  border: 0;
  border-radius: 4px;
  background-color: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 600 10.5px/1.2 "Archivo", sans-serif;
}
.route-endpoint-control select:hover { background-color: rgba(255,255,255,.75); }
.route-endpoint-control select:focus-visible { outline: 2px solid var(--pine); outline-offset: 1px; }
.ladder-selected-label { color: var(--ink-soft); font: 600 7.5px "IBM Plex Mono", monospace; letter-spacing: .05em; text-transform: uppercase; }
.ladder-selected-name { min-width: 0; display: flex; align-items: center; gap: 6px; }
.ladder-selected-name strong { overflow: hidden; font-size: 10.5px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.ladder-selected-status { overflow: hidden; color: var(--ink-soft); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.ladder-selected button, .ladder-more {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--pine);
  cursor: pointer;
  font-size: 8.5px;
  font-weight: 600;
}
.ladder-alternatives { display: grid; gap: 5px; padding: 9px 1px 0; }
.ladder-alternatives-label { color: var(--ink-soft); font: 600 7.5px "IBM Plex Mono", monospace; letter-spacing: .04em; text-transform: uppercase; }
.ladder-choice {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 3px 7px;
  padding: 7px 8px;
  border: 1px solid #ded8cd;
  border-left: 3px solid #d39b36;
  border-radius: 7px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.ladder-choice:hover:not(:disabled) { border-color: #7f9a90; background: #fff; }
.ladder-choice.available, .ladder-choice.party_available { border-left-color: #2f855a; }
.ladder-choice.unavailable { border-left-color: #c6363c; }
.ladder-choice.not_released { border-left-color: #71808a; }
.ladder-choice:disabled { cursor: not-allowed; opacity: .58; }
.ladder-choice-name { min-width: 0; display: flex; align-items: center; gap: 5px; }
.ladder-choice-name i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #d39b36; }
.ladder-choice.available .ladder-choice-name i, .ladder-choice.party_available .ladder-choice-name i { background: #2f855a; }
.ladder-choice.unavailable .ladder-choice-name i { background: #c6363c; }
.ladder-choice.not_released .ladder-choice-name i { background: #71808a; }
.ladder-choice-name strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ladder-choice-status { color: var(--ink-soft); font-size: 7.5px; white-space: nowrap; }
.ladder-choice-impact { grid-column: 1 / -1; color: var(--ink-soft); font-size: 7.5px; }
.ladder-choice-impact b { color: var(--ink); font: 600 8px "IBM Plex Mono", monospace; }
.ladder-choice-impact i { color: #b1a999; font-style: normal; }
.ladder-no-choice { padding: 8px; color: var(--ink-soft); font-size: 8px; }
.ladder-loading span { height: 42px; border-radius: 7px; background: linear-gradient(90deg,#ebe7de,#f7f5ef,#ebe7de); background-size: 200% 100%; animation: ladder-pulse 1.4s infinite; }
@keyframes ladder-pulse { to { background-position: -200% 0; } }
.plan-card.inspecting .route-ladder, .plan-card.inspecting .itinerary-overview { display: none; }

@media (min-width: 641px) {
  .panel.state-plan {
    top: auto;
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    height: 485px;
    border: 1px solid rgba(126,113,89,.28);
    border-radius: 14px;
    background: rgba(251,250,246,.98);
    box-shadow: 0 16px 45px rgba(31,36,36,.18);
  }
  .state-plan .masthead { display: none; }
  .state-plan .trip-summary { min-height: 62px; padding: 10px 16px; }
  .state-plan .planner-meta { padding: 7px 16px; }
  .state-plan .planner-results { overflow: hidden; }
  .state-plan .itinerary-overview { position: static; min-height: 46px; display: flex; align-items: center; gap: 18px; padding: 7px 16px; }
  .state-plan .availability-key { margin-left: auto; }
  .state-plan .route-history { margin-left: 0; margin-top: 0; }
  .state-plan .stage-inspector { height: 100%; overflow-y: auto; }
  .state-plan .stage-inspector-content { min-height: 0; }
}

@media (max-width: 640px) {
  .panel.state-plan { height: 72dvh; }
  .state-plan .itinerary-overview { display: grid; grid-template-columns: 1fr auto; gap: 7px; padding: 9px 10px; }
  .state-plan .ladder-intro { grid-column: 1 / -1; }
  .state-plan .availability-key { display: flex; gap: 5px 8px; margin: 0; }
  .route-ladder { padding: 2px 7px 15px; }
  .ladder-column { width: 210px; flex-basis: 210px; }
  .ladder-column.ladder-start { width: 135px; flex-basis: 135px; }
}

/* Calm timeline + one focused choice tray. */
.route-ladder {
  align-items: flex-start;
  padding: 4px 14px 15px;
  overflow-x: auto;
  overflow-y: hidden;
}
.ladder-column { width: 190px; flex-basis: 190px; padding: 0 4px; }
.ladder-column.ladder-start { width: 130px; flex-basis: 130px; }
.ladder-leg-button, .ladder-start-spacer { min-height: 42px; padding: 4px 6px; }
.ladder-line { height: 16px; margin: 0 -4px; }
.ladder-line::before { top: 7px; height: 1px; }
.ladder-line i { top: 2px; right: 6px; width: 11px; height: 11px; }
.ladder-selected {
  width: 100%;
  min-height: 88px;
  gap: 4px;
  padding: 9px 10px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
button.ladder-selected:hover { border-color: #7f998f; transform: translateY(-1px); }
.ladder-column.choices-active .ladder-selected { border-color: var(--pine); box-shadow: 0 0 0 2px rgba(55,84,74,.13); }
.ladder-selected-name { align-items: flex-start; }
.ladder-selected-name strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.2;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.ladder-choice-count { display: flex; align-items: center; gap: 4px; margin-top: auto; color: var(--pine); font-size: 8px; font-weight: 600; }
.ladder-choice-count b { margin-left: auto; font-size: 14px; line-height: .7; }
.ladder-alternatives { display: none; }

.choice-tray {
  margin: 0 14px 14px;
  padding: 11px 12px 12px;
  border: 1px solid #d7d0c4;
  border-radius: 10px;
  background: #f3f1eb;
}
.choice-tray > header { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.choice-tray > header > span { min-width: 0; display: grid; gap: 2px; }
.choice-tray > header small { color: var(--blaze); font: 600 8px "IBM Plex Mono", monospace; text-transform: uppercase; }
.choice-tray > header strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.choice-tray > header button {
  width: 27px;
  height: 27px;
  margin-left: auto;
  border: 1px solid #d0c9bc;
  border-radius: 50%;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 17px;
}
.choice-tray-list { display: flex; gap: 7px; overflow-x: auto; padding: 1px 1px 5px; scrollbar-width: thin; }
.choice-tray .ladder-choice { width: 214px; min-height: 63px; flex: 0 0 214px; padding: 9px 10px; background: #fff; }
.choice-tray .ladder-choice-name strong { font-size: 10px; }
.choice-tray .ladder-choice-status, .choice-tray .ladder-choice-impact { font-size: 8px; }
.choice-tray-empty { padding: 9px; color: var(--ink-soft); font-size: 9px; }
.choice-tray-loading { display: flex; gap: 7px; }
.choice-tray-loading i { width: 214px; height: 63px; border-radius: 7px; background: #e6e2d9; }
.plan-card.inspecting .choice-tray { display: none; }

@media (min-width: 641px) {
  .state-plan .planner-results { overflow: hidden; }
}

@media (max-width: 640px) {
  .route-ladder { padding: 2px 7px 13px; }
  .ladder-column { width: 184px; flex-basis: 184px; }
  .ladder-column.ladder-start { width: 124px; flex-basis: 124px; }
  .choice-tray { margin: 0 8px 10px; }
}

/* The itinerary is a map dock, never a floating card. */
.panel.state-plan {
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background: #fbfaf6;
  box-shadow: 0 -1px 0 rgba(96,88,72,.18);
  backdrop-filter: none;
}
.state-plan .masthead, .state-plan .planner-meta { display: none; }
.state-plan .trip-summary {
  min-height: 52px;
  padding: 8px 18px;
  border-radius: 0;
}
.state-plan .itinerary-overview { min-height: 38px; padding: 5px 18px; }
.route-ladder { padding-bottom: 9px; }
.ladder-leg-button, .ladder-start-spacer { min-height: 36px; }
.ladder-selected { min-height: 76px; border-radius: 4px; box-shadow: none; }
.choice-tray { margin: 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 0; }
.choice-tray .ladder-choice { border-radius: 3px; }

@media (max-width: 640px) {
  .state-plan .trip-summary { padding: 8px 12px; }
  .state-plan .itinerary-overview { padding: 6px 10px; }
}

/* One permanent side workspace: itinerary, choices and details share it. */
.panel.state-plan,
.panel.state-plan:has(.plan-card.choices-open),
.panel.state-plan:has(.plan-card.inspecting) {
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  width: 440px;
  height: 100dvh;
  max-height: none;
  border-top: 0;
  border-right: 1px solid #d7d0c3;
  border-bottom: 0;
  border-left: 0;
  background: #fbfaf6;
  box-shadow: 5px 0 18px rgba(35,40,43,.08);
}
.state-plan .masthead { display: flex; }
.state-plan .planner-meta { display: none; }
.state-plan .trip-summary { min-height: 58px; padding: 9px 15px; }
.state-plan .planner-results { flex: 1; min-height: 0; overflow: hidden; }
.state-plan .plan-card { height: 100%; display: flex; flex-direction: column; align-items: stretch; }
.state-plan .itinerary-overview {
  position: static;
  min-height: 61px;
  display: grid;
  grid-template-columns: 1fr auto;
  justify-content: stretch;
  gap: 6px 10px;
  padding: 10px 15px;
  border-bottom: 1px solid #e2dccf;
}
.state-plan .ladder-intro { grid-column: 1 / -1; }
.state-plan .availability-key { margin: 0; }
.state-plan .ladder-nav { display: none; }
.state-plan .route-history { align-self: center; margin: 0; }
.state-plan .route-ladder {
  flex: 1;
  display: block;
  min-height: 0;
  padding: 10px 0 18px;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y proximity;
}
.state-plan .ladder-column,
.state-plan .ladder-column.ladder-start {
  width: auto;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  grid-template-rows: auto auto;
  padding: 0 15px;
  scroll-snap-align: start;
}
.state-plan .ladder-leg-button,
.state-plan .ladder-start-spacer {
  grid-column: 2;
  grid-row: 1;
  min-height: 38px;
  padding: 4px 7px;
}
.state-plan .ladder-start-spacer { min-height: 7px; }
.state-plan .ladder-line {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 30px;
  height: auto;
  margin: 0;
}
.state-plan .ladder-line::before {
  top: 0;
  right: auto;
  bottom: 0;
  left: 14px;
  width: 1px;
  height: auto;
}
.state-plan .ladder-line i {
  top: 14px;
  right: auto;
  left: 9px;
}
.state-plan .ladder-start .ladder-line i { top: 8px; }
.state-plan .ladder-selected {
  grid-column: 2;
  grid-row: 2;
  min-height: 76px;
  margin-bottom: 11px;
  padding: 10px 11px;
}
.state-plan .ladder-selected-name strong { font-size: 11px; }
.state-plan .choice-tray {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 14px 15px;
  overflow-y: auto;
  border-top: 0;
  background: #f5f2eb;
}
.state-plan .choice-tray-list { display: grid; gap: 7px; overflow: visible; }
.state-plan .choice-tray .ladder-choice { width: 100%; min-height: 66px; }
.state-plan .plan-card.choices-open .route-ladder { display: none; }
.state-plan .stage-inspector { flex: 1; min-height: 0; height: auto; overflow-y: auto; }

@media (max-width: 640px) {
  .panel.state-plan,
  .panel.state-plan:has(.plan-card.choices-open),
  .panel.state-plan:has(.plan-card.inspecting) {
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    width: calc(100vw - 28px);
    height: 100dvh;
    max-height: none;
  }
}

/* Journey matrix: huts down the route, travel window across the top. */
.panel.state-plan,
.panel.state-plan:has(.plan-card.choices-open),
.panel.state-plan:has(.plan-card.inspecting) { width: 540px; }

.state-plan .itinerary-overview {
  min-height: 69px;
  grid-template-columns: minmax(0,1fr) auto;
  padding: 10px 14px 9px;
}
.state-plan .ladder-intro { grid-column: auto; align-self: center; }
.state-plan .ladder-intro strong { font-size: 13px; }
.state-plan .ladder-intro small { margin-top: 2px; font-size: 8.5px; }
.state-plan .availability-key { display: flex; flex-wrap: wrap; gap: 4px 9px; font-size: 7.5px; }
.state-plan .route-history { display: flex; gap: 5px; }
.journey-days-control {
  display: grid;
  grid-template-columns: 28px auto 28px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #cfc7b9;
  border-radius: 7px;
  background: #fff;
}
.journey-days-control button {
  border: 0;
  background: #edf1ee;
  color: var(--pine);
  cursor: pointer;
  font: 700 16px "Archivo", sans-serif;
}
.journey-days-control button:hover:not(:disabled) { background: #dce6df; }
.journey-days-control button:disabled { cursor: default; opacity: .35; }
.journey-days-control span {
  min-width: 62px;
  display: grid;
  place-content: center;
  padding: 4px 7px;
  border-right: 1px solid #ded8cc;
  border-left: 1px solid #ded8cc;
  text-align: center;
}
.journey-days-control strong { font: 700 12px "IBM Plex Mono", monospace; }
.journey-days-control small { color: var(--ink-soft); font-size: 6.5px; white-space: nowrap; text-transform: uppercase; }
.journey-message {
  grid-column: 1 / -1;
  padding-top: 3px;
  color: var(--blaze);
  font-size: 9px;
}

.journey-endpoints {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-bottom: 1px solid #ddd6ca;
  background: #f5f2eb;
}
.journey-endpoints > span { color: #9b9387; }
.journey-endpoints label { min-width: 0; display: grid; gap: 2px; }
.journey-endpoints small {
  color: var(--ink-soft);
  font: 600 7px "IBM Plex Mono", monospace;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.journey-endpoints select {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 650 10px "Archivo", sans-serif;
  text-overflow: ellipsis;
}

.journey-grid-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #b9b1a3 #f1eee7;
  scrollbar-width: thin;
  background: #f8f6f0;
}
.journey-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--ink);
}
.journey-grid th, .journey-grid td { padding: 0; }
.journey-corner,
.journey-date {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 45px;
  border-bottom: 1px solid #cfc7b9;
  background: #ede9df;
}
.journey-corner {
  left: 0;
  z-index: 7;
  width: 174px;
  min-width: 174px;
  padding: 0 12px !important;
  color: var(--ink-soft);
  font: 600 8px "IBM Plex Mono", monospace;
  text-align: left;
  text-transform: uppercase;
}
.journey-date { width: 43px; min-width: 43px; border-left: 1px solid #ddd7cb; }
.journey-date > button, .journey-date > span {
  width: 100%;
  height: 45px;
  display: grid;
  place-content: center;
  gap: 1px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  text-align: center;
}
.journey-date > button { cursor: pointer; }
.journey-date > button:hover { background: #e0e8e3; color: var(--pine); }
.journey-date small { font: 600 7px "IBM Plex Mono", monospace; text-transform: uppercase; }
.journey-date strong { font: 700 11px "Archivo", sans-serif; }
.journey-date.in-itinerary { background: #e0e8e3; }
.journey-date.in-itinerary strong { color: var(--pine); }

.journey-group .journey-row:first-child > * { border-top: 5px solid #f8f6f0; }
.journey-row { height: 51px; }
.journey-row > td { border-left: 1px solid #e6e0d6; border-bottom: 1px solid #e9e4dc; background: #fbfaf6; }
.journey-hut {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 174px;
  min-width: 174px;
  border-right: 1px solid #d8d0c3;
  border-bottom: 1px solid #e0dacf;
  background: #f5f2eb;
  text-align: left;
}
.journey-group-toggle,
.journey-alternative-indent {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px 6px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.journey-group-toggle { cursor: pointer; }
.journey-group-toggle:hover { background: #ebe7de; }
.journey-group-toggle > span,
.journey-alternative-indent > span { min-width: 0; display: grid; gap: 2px; }
.journey-group-toggle small,
.journey-alternative-indent small {
  color: var(--blaze);
  font: 600 7px "IBM Plex Mono", monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.journey-group-toggle strong,
.journey-alternative-indent strong {
  overflow: hidden;
  font-size: 9.5px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.journey-group-toggle > b {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  margin-left: auto;
  border: 1px solid #cfc7ba;
  border-radius: 50%;
  color: var(--pine);
  font-size: 13px;
}
.journey-alternative-indent { padding-left: 25px; background: #eeeae1; }
.journey-alternative-indent small { color: var(--ink-soft); }
.journey-group.expanded .journey-row.current .journey-hut { background: #e6ece8; }

.journey-grid-cell {
  width: 42px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #8b8377;
  font: 650 10px "IBM Plex Mono", monospace;
}
button.journey-grid-cell { cursor: pointer; }
.journey-grid-cell.available { background: #e3eee7; color: #246b49; }
.journey-grid-cell.unavailable { background: #f3e3e0; color: #a5443e; }
.journey-grid-cell.unknown { background: #f2ead8; color: #96701f; }
.journey-grid-cell.itinerary-cell {
  position: relative;
  z-index: 1;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  box-shadow: inset 0 0 0 2px currentColor;
  font-size: 12px;
}
.journey-grid-cell.itinerary-cell > span,
.journey-grid-cell.itinerary-cell > small { grid-column: 1; grid-row: 1; }
.journey-grid-cell.itinerary-cell > small {
  place-self: start end;
  min-width: 13px;
  padding: 2px 3px;
  background: #37544a;
  color: #fff;
  font: 700 6px "IBM Plex Mono", monospace;
}
button.journey-grid-cell:hover { filter: saturate(1.25) brightness(.96); box-shadow: inset 0 0 0 2px currentColor; }
.journey-empty { height: 36px; }
.journey-empty .journey-hut { padding: 8px 12px; color: var(--ink-soft); font-size: 8px; }
.journey-empty td { background: #f8f6f0; }

.journey-finish {
  min-height: 53px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 0;
  border-top: 1px solid #d8d1c5;
  background: #edf1ee;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.journey-finish > span { display: grid; gap: 2px; }
.journey-finish small { color: var(--pine); font: 600 7.5px "IBM Plex Mono", monospace; text-transform: uppercase; }
.journey-finish strong { font-size: 10.5px; }
.journey-finish > b { margin-left: auto; color: var(--pine); font-size: 9px; }
.journey-finish:hover { background: #e2e9e4; }

.state-plan .plan-card.inspecting .journey-endpoints,
.state-plan .plan-card.inspecting .journey-grid-scroll,
.state-plan .plan-card.inspecting .journey-finish { display: none; }

@media (max-width: 640px) {
  .panel.state-plan,
  .panel.state-plan:has(.plan-card.choices-open),
  .panel.state-plan:has(.plan-card.inspecting) { width: calc(100vw - 28px); }
  .state-plan .itinerary-overview { padding-right: 10px; padding-left: 10px; }
  .journey-endpoints { padding-right: 10px; padding-left: 10px; }
  .journey-corner, .journey-hut { width: 145px; min-width: 145px; }
  .journey-date { width: 41px; min-width: 41px; }
  .journey-grid-cell { width: 40px; }
}

/* Simple journey is primary; the matrix is an optional comparison tool. */
.panel.state-plan,
.panel.state-plan:has(.plan-card.choices-open),
.panel.state-plan:has(.plan-card.inspecting) { width: 440px; }
.panel.state-plan:has(.plan-card.compare-view) { width: 540px; }

.start-date-explorer {
  padding: 10px 0 9px;
  border-bottom: 1px solid #ddd6ca;
  background: #f7f4ed;
}
.start-date-explorer > header,
.compare-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 8px;
}
.start-date-explorer > header > span,
.compare-heading > span { min-width: 0; display: grid; gap: 1px; }
.start-date-explorer > header strong,
.compare-heading strong { font-size: 10px; }
.start-date-explorer > header small,
.compare-heading small { color: var(--ink-soft); font-size: 7.5px; }
.start-date-explorer > header button,
.compare-heading button {
  margin-left: auto;
  padding: 5px 8px;
  border: 1px solid #cfc7ba;
  border-radius: 6px;
  background: #fff;
  color: var(--pine);
  cursor: pointer;
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}
.start-date-strip {
  display: flex;
  gap: 5px;
  padding: 0 14px 2px;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}
.start-date-chip {
  min-width: 65px;
  display: grid;
  flex: 0 0 65px;
  gap: 1px;
  padding: 7px 6px 6px;
  border: 1px solid #d8d1c4;
  border-top: 3px solid #bd9b53;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.start-date-chip.all-available { border-top-color: #2f855a; }
.start-date-chip.has-unavailable { border-top-color: #c45a51; }
.start-date-chip.selected {
  border-color: var(--pine);
  border-top-color: var(--pine);
  background: #e8eee9;
  box-shadow: inset 0 0 0 1px var(--pine);
}
.start-date-chip:hover { transform: translateY(-1px); }
.start-date-chip small { color: var(--ink-soft); font: 600 7px "IBM Plex Mono", monospace; text-transform: uppercase; }
.start-date-chip strong { font-size: 10px; }
.start-date-chip em { color: var(--ink-soft); font-size: 7px; font-style: normal; }

.itinerary-scroll {
  flex: 1;
  min-height: 0;
  padding: 5px 0 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #b9b1a3 #f1eee7;
  scrollbar-width: thin;
  background: #fbfaf6;
}
.itinerary-day { border-bottom: 1px solid #ddd7cb; background: #fbfaf6; }
.itinerary-day.active { background: #edf1ee; }
.itinerary-walk {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 35px minmax(0,1fr) auto 10px;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.itinerary-walk:hover { background: #f2efe8; }
.itinerary-day-number {
  width: 33px;
  height: 39px;
  display: grid;
  place-content: center;
  border-radius: 5px;
  background: var(--pine);
  color: #fff;
  text-align: center;
}
.itinerary-day-number small { font: 600 6px "IBM Plex Mono", monospace; text-transform: uppercase; }
.itinerary-day-number strong { font: 700 14px "IBM Plex Mono", monospace; }
.itinerary-leg { min-width: 0; display: grid; gap: 3px; }
.itinerary-leg time { color: var(--blaze); font: 600 7.5px "IBM Plex Mono", monospace; text-transform: uppercase; }
.itinerary-leg strong {
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.itinerary-leg i { color: #a39a8c; font-style: normal; }
.itinerary-effort { display: grid; gap: 3px; text-align: right; }
.itinerary-effort strong { font: 650 9px "IBM Plex Mono", monospace; }
.itinerary-effort small { color: var(--ink-soft); font: 500 7px "IBM Plex Mono", monospace; white-space: nowrap; }
.itinerary-walk > b { color: #9a9184; font-size: 15px; }

.itinerary-stay,
.itinerary-arrival {
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 14px 10px 58px;
  padding: 8px 9px;
  border: 1px solid #ded8cd;
  border-left: 3px solid #bf9137;
  border-radius: 6px;
  background: #fff;
}
.itinerary-stay.available, .itinerary-stay.party_available { border-left-color: #2f855a; }
.itinerary-stay.unavailable { border-left-color: #c6363c; }
.itinerary-stay > span,
.itinerary-arrival > span { min-width: 0; display: grid; flex: 1; gap: 1px; }
.itinerary-stay small,
.itinerary-arrival small { color: var(--ink-soft); font: 600 6.5px "IBM Plex Mono", monospace; text-transform: uppercase; }
.itinerary-stay strong,
.itinerary-arrival strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.itinerary-stay em { color: var(--ink-soft); font-size: 7.5px; font-style: normal; }
.itinerary-stay > button {
  flex: none;
  padding: 6px 8px;
  border: 1px solid #cfc7ba;
  border-radius: 5px;
  background: #f5f2eb;
  color: var(--pine);
  cursor: pointer;
  font-size: 8px;
  font-weight: 650;
}
.itinerary-arrival { border-left-color: var(--pine); background: #edf1ee; }
.itinerary-arrival > i { width: 9px; height: 9px; border-radius: 2px; background: var(--pine); transform: rotate(45deg); }

.itinerary-alternatives {
  display: grid;
  gap: 5px;
  margin: -3px 14px 11px 58px;
  padding: 9px;
  border: 1px solid #d6cfc2;
  border-radius: 7px;
  background: #f1eee7;
}
.itinerary-alternatives > header { display: flex; align-items: center; gap: 8px; padding: 0 1px 3px; }
.itinerary-alternatives > header strong { font-size: 8px; }
.itinerary-alternatives > header button { margin-left: auto; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 15px; }
.itinerary-alternatives > p { padding: 8px; color: var(--ink-soft); font-size: 8px; }
.itinerary-alternative {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 4px 8px;
  padding: 8px 9px;
  border: 1px solid #ddd6ca;
  border-left: 3px solid #bd913c;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.itinerary-alternative.available, .itinerary-alternative.party_available { border-left-color: #2f855a; }
.itinerary-alternative.unavailable { border-left-color: #c6363c; }
.itinerary-alternative > span { min-width: 0; display: grid; gap: 1px; }
.itinerary-alternative strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.itinerary-alternative small, .itinerary-alternative em { color: var(--ink-soft); font-size: 7px; font-style: normal; }
.itinerary-alternative em { grid-column: 1; }
.itinerary-alternative > b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--pine); font-size: 8px; }

.compare-heading { min-height: 48px; padding-top: 8px; border-bottom: 1px solid #ddd6ca; background: #f7f4ed; }
.compare-hut > span { min-height: 46px; display: grid; place-content: center start; gap: 2px; padding: 6px 12px; }
.compare-hut small { color: var(--blaze); font: 600 7px "IBM Plex Mono", monospace; text-transform: uppercase; }
.compare-hut strong { overflow: hidden; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }

.state-plan .plan-card.inspecting .start-date-explorer,
.state-plan .plan-card.inspecting .itinerary-scroll,
.state-plan .plan-card.inspecting .compare-heading { display: none; }

@media (max-width: 640px) {
  .panel.state-plan,
  .panel.state-plan:has(.plan-card.choices-open),
  .panel.state-plan:has(.plan-card.inspecting),
  .panel.state-plan:has(.plan-card.compare-view) { width: calc(100vw - 28px); }
  .itinerary-walk { grid-template-columns: 33px minmax(0,1fr) auto 8px; gap: 7px; padding-right: 10px; padding-left: 10px; }
  .itinerary-stay, .itinerary-arrival, .itinerary-alternatives { margin-right: 10px; margin-left: 50px; }
}

/* Final reduction: one header, one date strip, one row per day. */
.trip-summary { gap: 10px; }
.trip-summary > .trip-summary-copy { min-width: 0; display: grid; flex: 1; gap: 2px; }
.trip-summary > .trip-summary-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 7px;
}
.trip-summary-actions #tripDaysControl { display: block; }
.trip-summary-actions .journey-days-control { grid-template-columns: 24px auto 24px; border-radius: 6px; }
.trip-summary-actions .journey-days-control span { min-width: 42px; padding: 3px 5px; }
.trip-summary-actions .journey-days-control strong { font-size: 11px; }
.trip-summary-actions .journey-days-control button { padding: 0; font-size: 14px; }
.trip-summary-actions > #editTrip { padding: 6px 8px; }

.route-endpoint-fields { margin-top: -4px; }
.start-date-explorer { padding-top: 8px; }
.start-date-explorer > header { padding-bottom: 6px; }

.itinerary-day { position: relative; }
.itinerary-walk {
  min-height: 82px;
  grid-template-columns: 35px minmax(0,1fr) 10px;
  gap: 9px;
  padding-top: 9px;
  padding-bottom: 9px;
}
.itinerary-leg time { font-size: 7px; }
.itinerary-leg strong { padding-right: 4px; }
.itinerary-inline-status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 78px 0 0;
  color: var(--ink-soft);
  font-size: 8px;
  font-style: normal;
}
.itinerary-inline-status.available, .itinerary-inline-status.party_available { color: #276d4a; }
.itinerary-inline-status.unavailable { color: #a5443e; }
.itinerary-inline-status.finish { color: var(--pine); }
.itinerary-inline-status .availability-dot { width: 7px; height: 7px; }
.itinerary-change {
  position: absolute;
  z-index: 2;
  top: 48px;
  right: 31px;
  padding: 5px 7px;
  border: 1px solid #cfc7ba;
  border-radius: 5px;
  background: #f5f2eb;
  color: var(--pine);
  cursor: pointer;
  font-size: 7.5px;
  font-weight: 650;
}
.itinerary-change:hover { background: #e4ebe6; }
.itinerary-alternatives { margin-top: -3px; }

.toast { display: flex; align-items: center; gap: 14px; }
.toast > button {
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.7);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: 650 12px "Archivo", sans-serif;
}

@media (max-width: 640px) {
  .state-plan .trip-summary { padding-right: 9px; padding-left: 10px; }
  .trip-summary-actions { gap: 5px !important; }
  .trip-summary-actions .journey-days-control { grid-template-columns: 22px auto 22px; }
  .trip-summary-actions .journey-days-control span { min-width: 36px; }
  .itinerary-walk { grid-template-columns: 33px minmax(0,1fr) 8px; }
  .itinerary-change { right: 26px; }
}

/* Visual rhythm: three type sizes, unboxed controls, aligned row actions. */
:root {
  --planner-label: 10px;
  --planner-body: 13px;
  --planner-title: 15px;
}

.panel.state-plan,
.panel.state-plan:has(.plan-card.choices-open),
.panel.state-plan:has(.plan-card.inspecting) { width: 500px; }

.state-plan .trip-summary { min-height: 76px; padding: 11px 15px; }
.trip-summary span { font-size: var(--planner-label); }
.trip-summary strong { font-size: 18px; }
.trip-summary small { font-size: var(--planner-label); }
.trip-summary-actions > #editTrip { padding: 7px 10px; font-size: var(--planner-body); }

.trip-summary-actions .journey-days-control {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 4px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.trip-summary-actions .journey-days-control button {
  width: 25px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--pine);
  font-size: 21px;
  line-height: 1;
}
.trip-summary-actions .journey-days-control button:hover:not(:disabled) { background: transparent; color: var(--blaze); }
.trip-summary-actions .journey-days-control span {
  min-width: 39px;
  padding: 0;
  border: 0;
}
.trip-summary-actions .journey-days-control strong { font-size: var(--planner-title); }
.trip-summary-actions .journey-days-control small { font-size: var(--planner-label); }

.start-date-explorer { padding: 11px 0 10px; }
.start-date-explorer > header { padding: 0 15px 8px; }
.start-date-explorer > header strong { font-size: var(--planner-body); }
.start-date-explorer > header small { font-size: var(--planner-label); }
.start-date-strip { gap: 6px; padding: 0 15px 3px; scroll-padding-inline: 15px; }
.start-date-chip {
  min-width: 73px;
  flex-basis: 73px;
  gap: 2px;
  padding: 7px 8px 6px;
  border: 0;
  border-bottom: 3px solid #bd9b53;
  border-radius: 6px;
  background: #f0ede6;
}
.start-date-chip.all-available { border-bottom-color: #2f855a; border-top: 0; }
.start-date-chip.has-unavailable { border-bottom-color: #c45a51; border-top: 0; }
.start-date-chip.selected {
  border: 0;
  border-bottom: 3px solid var(--pine);
  background: var(--pine);
  color: #fff;
  box-shadow: none;
}
.start-date-chip.selected small, .start-date-chip.selected em { color: rgba(255,255,255,.78); }
.start-date-chip small { font-size: var(--planner-label); }
.start-date-chip strong { font-size: 12px; }
.start-date-chip em { font-size: var(--planner-label); }

.itinerary-scroll { padding-top: 0; }
.itinerary-day {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  min-height: 94px;
}
.itinerary-walk {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 94px;
  grid-template-columns: 39px minmax(0,1fr);
  gap: 11px;
  padding: 12px 10px 12px 15px;
  font-size: var(--planner-body);
}
.itinerary-day.finish .itinerary-walk { grid-column: 1 / -1; padding-right: 15px; }
.itinerary-day-number {
  width: 39px;
  height: 48px;
  border-radius: 6px;
}
.itinerary-day-number small { font-size: var(--planner-label); }
.itinerary-day-number strong { font-size: 20px; }
.itinerary-leg { gap: 5px; }
.itinerary-leg time {
  color: var(--blaze);
  font-size: var(--planner-label);
  line-height: 1.2;
}
.itinerary-leg strong {
  padding: 0;
  font-size: var(--planner-body);
  line-height: 1.3;
  white-space: normal;
}
.itinerary-inline-status {
  gap: 6px;
  padding: 0;
  font-size: var(--planner-label);
}
.itinerary-change {
  position: static;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  margin: 0 15px 0 5px;
  padding: 7px 3px;
  border: 0;
  background: transparent;
  font-size: var(--planner-label);
  white-space: nowrap;
}
.itinerary-change:hover { background: transparent; color: var(--blaze); }
.itinerary-alternatives {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0 15px 12px 65px;
  padding: 10px;
}
.itinerary-alternatives > header strong,
.itinerary-alternatives > p,
.itinerary-alternative small,
.itinerary-alternative em,
.itinerary-alternative > b { font-size: var(--planner-label); }
.itinerary-alternative strong { font-size: var(--planner-body); }

@media (max-width: 640px) {
  .panel.state-plan,
  .panel.state-plan:has(.plan-card.choices-open),
  .panel.state-plan:has(.plan-card.inspecting) { width: calc(100vw - 28px); }
  .state-plan .trip-summary { min-height: 72px; }
  .trip-summary strong { font-size: 16px; }
  .itinerary-walk { grid-template-columns: 37px minmax(0,1fr); gap: 9px; padding-left: 10px; }
  .itinerary-day-number { width: 37px; }
  .itinerary-change { margin-right: 10px; }
  .itinerary-alternatives { margin-right: 10px; margin-left: 56px; }
}

/* Detail header: date and long route title must occupy separate rows. */
.state-plan .inspector-head {
  grid-template-columns: auto minmax(0,1fr);
  align-items: start;
}
.state-plan .inspector-head > span:first-of-type {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.state-plan .inspector-head small {
  display: block;
  font-size: var(--planner-label);
  line-height: 1.3;
}
.state-plan .inspector-head strong {
  display: block;
  overflow: visible;
  font-size: var(--planner-title);
  line-height: 1.35;
  white-space: normal;
  text-overflow: clip;
}

/* Route endpoints are itinerary choices, including direct selection from the map. */
.itinerary-endpoint {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  border-bottom: 1px solid #ddd7cb;
  background: #fbfaf6;
}
.itinerary-endpoint-current {
  min-width: 0;
  min-height: 66px;
  display: grid;
  grid-template-columns: 39px minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px 15px;
}
.itinerary-endpoint-name {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.itinerary-endpoint-current small {
  color: var(--blaze);
  font: 650 var(--planner-label) "IBM Plex Mono", monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.itinerary-endpoint-current strong {
  overflow: hidden;
  font-size: var(--planner-body);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-endpoint-dot {
  justify-self: center;
  width: 13px;
  height: 13px;
  border: 3px solid var(--pine);
  border-radius: 50%;
}
.route-endpoint-dot.finish { background: var(--pine); }
.itinerary-endpoint-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.itinerary-endpoint-actions > button {
  padding: 7px 3px;
  border: 0;
  background: transparent;
  color: var(--pine);
  cursor: pointer;
  font-size: var(--planner-label);
  font-weight: 650;
}
.itinerary-endpoint-actions > button:hover { color: var(--blaze); }
.itinerary-endpoint-actions > [data-route-reverse] {
  padding-left: 8px;
  border-left: 1px solid #d8d1c5;
}
.itinerary-endpoint-actions > [data-route-reverse] i {
  font-style: normal;
  font-size: 1.15em;
}
.endpoint-alternatives {
  margin: 0 15px 12px 65px;
}
.endpoint-alternatives > header > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.endpoint-alternatives > header small {
  color: var(--ink-soft);
  font-size: var(--planner-label);
}
.endpoint-choice-list {
  max-height: 240px;
  display: grid;
  gap: 5px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.endpoint-choice { border-left-color: var(--pine); }

@media (max-width: 640px) {
  .itinerary-endpoint-current { grid-template-columns: 37px minmax(0,1fr) auto; gap: 9px; padding-right: 10px; padding-left: 10px; }
  .endpoint-alternatives { margin-right: 10px; margin-left: 56px; }
}
