:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #607080;
  --line: #d9e1e4;
  --paper: #fbfcfb;
  --panel: #ffffff;
  --navy: #14213d;
  --green: #2a9d8f;
  --gold: #f4a261;
  --orange: #e76f51;
  --shadow: 0 18px 50px rgba(20, 33, 61, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef4f1;
  color: var(--ink);
}

body.map-mode-active {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--navy);
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

h1,
h2,
p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
}

.brand p,
.trip-mini span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #fff;
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.tab.is-active {
  background: #fff;
  color: var(--navy);
}

.settings-button {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 9500;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(20, 33, 61, 0.12);
}

.settings-button.is-active {
  background: var(--navy);
  color: #fff;
}

.pwa-install-button {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: calc(max(16px, env(safe-area-inset-right)) + 56px);
  z-index: 9500;
  min-height: 44px;
  border: 1px solid rgba(42, 157, 143, 0.35);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-weight: 950;
  padding: 0 14px;
  box-shadow: 0 10px 28px rgba(20, 33, 61, 0.12);
}

.pwa-install-button.is-hidden {
  display: none;
}

.workspace {
  padding: 28px;
  overflow: auto;
  min-width: 0;
}

.view {
  display: none;
  min-width: 0;
}

.view.is-active {
  display: block;
}

.view-header,
.panel-heading,
.header-actions,
.form-actions,
menu,
.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.view-header {
  margin-bottom: 20px;
}

.view-header h2 {
  font-size: 30px;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(360px, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.planner-grid > * {
  min-width: 0;
}

.panel,
.route-map {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.saved-panel {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.saved-panel .status-pill {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.trip-mini {
  display: grid;
  gap: 5px;
  margin: 14px 0;
}

form,
.route-form {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  overflow: clip;
  position: relative;
  z-index: 1;
}

.route-form > * {
  min-width: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  position: relative;
  min-width: 0;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  min-width: 0;
  width: 100%;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

textarea {
  resize: vertical;
}

.unit {
  position: absolute;
  right: 11px;
  bottom: 12px;
  color: var(--muted);
  font-weight: 600;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.split.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: #edf3f0;
  border-radius: 8px;
  padding: 5px;
}

.mode-switch label {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--navy);
}

.mode-switch label:has(input:checked) {
  background: #fff;
  box-shadow: 0 8px 20px rgba(20, 33, 61, 0.1);
}

.mode-switch input {
  width: 16px;
  height: 16px;
}

.mode-fields {
  display: grid;
  gap: 12px;
}

.search-summary {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.search-summary strong,
.search-summary span {
  display: block;
}

.search-summary strong {
  color: var(--ink);
  font-size: 18px;
}

.search-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-top: 3px;
}

.route-form.is-search-collapsed > label,
.route-form.is-search-collapsed > .mode-switch,
.route-form.is-search-collapsed > .mode-fields,
.route-form.is-search-collapsed > .search-include-row,
.route-form.is-search-collapsed > .goal-card,
.route-form.is-search-collapsed > .advanced-card,
.route-form.is-search-collapsed > .form-actions {
  display: none;
}

.route-form.is-search-collapsed .search-summary {
  display: flex;
}

.mode-fields.is-hidden {
  display: none;
}

.goal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  contain: layout paint;
}

.goal-card summary {
  cursor: pointer;
  list-style: none;
  min-width: 0;
}

.goal-card summary::-webkit-details-marker {
  display: none;
}

.goal-card summary h2::before {
  content: "\25B8";
  display: inline-block;
  margin-right: 8px;
  transition: transform 140ms ease;
}

.goal-card[open] summary h2::before {
  transform: rotate(90deg);
}

.goal-card .panel-heading {
  margin-bottom: 0;
}

.goal-card[open] .panel-heading {
  margin-bottom: 12px;
}

.goal-card-body {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.goal-card .split,
.advanced-card .split {
  grid-template-columns: 1fr;
}

.goal-summary {
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  min-height: 43px;
  padding: 11px 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.pota-profile-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

.stats-profile {
  color: var(--muted);
}

.stats-profile-main {
  display: grid;
  gap: 6px;
}

.stats-profile-main strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.stats-profile-main span {
  font-size: 14px;
  font-weight: 750;
}

.stats-profile-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-options {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.route-options-under-map {
  border-width: 1px 0 0;
  border-radius: 0;
  background: #fff;
  padding: 14px 16px 16px;
}

.route-options.is-hidden {
  display: none;
}

.route-options-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--navy);
  font-weight: 900;
}

.route-options-heading small,
.route-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-option-list {
  display: grid;
  gap: 8px;
}

.route-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: var(--ink);
  cursor: pointer;
}

.route-option.is-selected {
  border-color: rgba(42, 157, 143, 0.55);
  background: #eef8f5;
}

.route-option span {
  display: grid;
  gap: 3px;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.results-note {
  border: 1px solid rgba(244, 162, 97, 0.5);
  background: #fff8ed;
  color: #76502a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}

.results-note {
  margin-top: 12px;
}

.advanced-card,
.preferences-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f6faf8;
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  contain: layout paint;
}

.advanced-card > *,
.preferences-card > *,
.goal-card > *,
.goal-card-body > * {
  min-width: 0;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.about-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.about-grid strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.about-grid span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.search-include-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.advanced-card summary,
.preferences-card summary {
  color: var(--navy);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
  min-width: 0;
}

.advanced-card summary::-webkit-details-marker,
.preferences-card summary::-webkit-details-marker {
  display: none;
}

.advanced-card summary::before,
.preferences-card summary::before {
  content: "\25B8";
  display: inline-block;
  margin-right: 8px;
  transition: transform 140ms ease;
}

.advanced-card[open] summary::before,
.preferences-card[open] summary::before {
  transform: rotate(90deg);
}

.advanced-card[open] summary,
.preferences-card[open] summary {
  margin-bottom: 4px;
}

.advanced-card.is-disabled label:not(.advanced-toggle) {
  opacity: 0.58;
}

.advanced-card.is-disabled input:disabled {
  background: #eef3f1;
}

.advanced-toggle {
  display: flex;
  color: var(--navy);
  font-size: 14px;
}

.preference-grid {
  display: grid;
  gap: 10px;
}

.preference-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.preference-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--navy);
  font-size: 14px;
}

.button,
.icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.button {
  background: var(--green);
  color: #fff;
  padding: 11px 15px;
  font-weight: 800;
}

.button.secondary {
  background: var(--navy);
}

.button.ghost {
  background: #edf3f0;
  color: var(--navy);
}

.button.full {
  width: 100%;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: #edf3f0;
  color: var(--navy);
  font-size: 18px;
}

.route-map {
  overflow: hidden;
  min-width: 0;
  align-self: start;
}

.map-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.map-focus-button {
  margin-left: auto;
}

.map-close-button {
  display: none;
}

.map-toolbar span,
.status-pill {
  background: #edf3f0;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

#map-mode-chip {
  background: #fff8ed;
  color: #76502a;
}

.map-stage {
  aspect-ratio: 16 / 9;
  min-height: 360px;
  position: relative;
  background: #dfe9e5;
}

.map-stage svg,
.interactive-map {
  width: 100%;
  height: 100%;
  display: block;
}

.interactive-map {
  min-height: 360px;
  z-index: 1;
  touch-action: none;
}

.interactive-map.is-hidden,
.fallback-map.is-hidden {
  display: none;
}

.route-map.is-map-mode {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100vw;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

.route-map.is-map-mode .map-stage {
  aspect-ratio: auto;
  min-height: 0;
  height: calc(100dvh - 67px);
  overflow: hidden;
}

.route-map.is-map-mode .interactive-map,
.route-map.is-map-mode .fallback-map {
  min-height: 0;
  height: 100%;
}

.route-map.is-map-mode .route-options-under-map {
  display: none;
}

.route-map.is-map-mode .map-focus-button {
  display: none;
}

.route-map.is-map-mode .map-close-button {
  display: inline-flex;
  align-items: center;
}

.route-map.is-map-mode .leaflet-container {
  min-height: 100%;
}

.leaflet-container {
  color: var(--ink);
  font-family: inherit;
  background: #dfe9e5;
}

.leaflet-control-attribution {
  border-radius: 999px 0 0 0;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(20, 33, 61, 0.68);
  font-size: 9px;
  line-height: 1.2;
  padding: 2px 5px;
}

.leaflet-control-attribution a {
  color: inherit;
}

.leaflet-route-pane {
  z-index: 420;
}

.leaflet-marker-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 1200;
}

.leaflet-popup {
  z-index: 1201;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  position: relative;
  z-index: 1202;
}

.route-overlay-svg {
  position: absolute;
  inset: 0;
  z-index: 430;
  pointer-events: none;
  overflow: visible;
}

.route-overlay-svg.is-hidden {
  display: none;
}

.route-overlay-shadow,
.route-overlay-casing,
.route-overlay-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-overlay-shadow {
  stroke: #07142d;
  stroke-width: 17px;
  stroke-opacity: 0.28;
}

.route-overlay-casing {
  stroke: #fff;
  stroke-width: 12px;
  stroke-opacity: 1;
}

.route-overlay-line {
  stroke: #006cff;
  stroke-width: 6px;
  stroke-opacity: 1;
  filter: drop-shadow(0 3px 8px rgba(0, 55, 150, 0.5));
}

.main-route-shadow {
  stroke: #0a1224;
  stroke-opacity: 0.26;
  stroke-width: 16px;
}

.main-route-casing {
  stroke: #fff;
  stroke-opacity: 1;
  stroke-width: 11px;
}

.main-route-line {
  stroke: #006cff;
  stroke-width: 6px;
  stroke-opacity: 1;
  filter: drop-shadow(0 3px 8px rgba(0, 55, 150, 0.48));
}

.main-route-breadcrumb {
  stroke: #fff;
  fill: #006cff;
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
}

.leaflet-popup-content strong {
  color: var(--navy);
}

.map-park-sheet {
  position: relative;
  z-index: 1;
  min-width: 240px;
  max-width: 300px;
  display: grid;
  gap: 9px;
}

.map-park-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-park-sheet h3 {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
  line-height: 1.2;
}

.map-park-stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.map-park-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 7px;
}

.map-park-stats dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.map-park-stats dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.map-park-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.map-park-actions .button {
  padding: 8px 10px;
  font-size: 12px;
}

.leaflet-park-marker {
  background: transparent;
  border: 0;
  z-index: 700 !important;
}

.leaflet-park-marker span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #14213d;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.leaflet-park-marker.is-planned span {
  background: #2a9d8f;
  box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.22), 0 10px 22px rgba(20, 33, 61, 0.24);
}

.leaflet-route-marker {
  background: transparent;
  border: 0;
}

.leaflet-route-marker span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 8px;
  background: #14213d;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.24);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.us-map-shape {
  fill: #f6faf8;
  stroke: rgba(96, 112, 128, 0.28);
  stroke-width: 1.5;
}

.us-map-shape.is-hidden {
  display: none;
}

.us-state-labels text {
  fill: rgba(96, 112, 128, 0.72);
  font-size: 10px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}

.us-state-labels text.is-active {
  fill: var(--navy);
  font-size: 13px;
  font-weight: 950;
}

.state-labels text {
  font-weight: 900;
  fill: rgba(20, 33, 61, 0.28);
  font-size: 42px;
}

.results-panel {
  margin-top: 18px;
}

.projection-summary,
.insight-grid,
.score-grid,
.rover-grid,
.progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.projection-summary div,
.insight-grid div,
.score-grid div,
.rover-grid div,
.progress-grid div {
  background: #f6faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.projection-summary strong,
.insight-grid strong,
.score-grid strong,
.rover-grid strong,
.progress-grid strong {
  display: block;
  color: var(--navy);
  font-size: 18px;
}

.projection-summary span,
.insight-grid span,
.score-grid span,
.rover-grid span,
.progress-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-wide {
  grid-column: span 4;
}

.trip-score {
  margin-top: 14px;
}

.projection-summary:empty {
  display: none;
}

.trip-score-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.trip-score-details summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.trip-score-details summary::-webkit-details-marker {
  display: none;
}

.trip-score-details summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 10px;
}

.trip-score-details summary strong {
  display: block;
  color: var(--navy);
  font-size: 18px;
  line-height: 1.1;
  margin-bottom: 5px;
}

.trip-score-details summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trip-score-details summary::after {
  content: "More stats";
  grid-column: 1 / -1;
  justify-self: start;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.trip-score-details[open] summary::after {
  content: "Hide stats";
}

.trip-score-details .score-grid {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.score-warning {
  margin: 0 0 10px;
  border: 1px solid rgba(231, 111, 81, 0.42);
  border-radius: 8px;
  background: #fff2ed;
  color: #8a3a22;
  padding: 10px 12px;
  font-weight: 800;
}

.park-list,
.saved-list,
.stop-timeline {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.saved-list {
  gap: 18px;
}

.saved-trip-section {
  display: grid;
  gap: 10px;
}

.saved-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding: 0 2px;
}

.saved-section-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 22px;
}

.saved-section-heading span:not(.status-pill) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.saved-section-list {
  display: grid;
  gap: 12px;
}

.saved-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
}

.park-card,
.stop-card,
.saved-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--paper);
}

.park-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.saved-card {
  display: grid;
  gap: 12px;
}

.saved-card.is-completed {
  border-color: rgba(42, 157, 143, 0.34);
  background: #fbfffd;
}

.saved-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.state-suggestion-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.state-suggestion-group + .state-suggestion-group {
  margin-top: 12px;
}

.state-suggestion-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fbfa;
  color: var(--navy);
  cursor: pointer;
  font-weight: 950;
}

.state-suggestion-group summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.state-suggestion-list {
  display: grid;
  gap: 10px;
  max-height: min(620px, 68vh);
  overflow-y: auto;
  padding: 12px;
  scrollbar-gutter: stable;
}

.park-title,
.saved-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.park-title h3,
.saved-title h3 {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.saved-trip-stats {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.saved-trip-stats summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--navy);
  font-weight: 950;
}

.saved-trip-stats summary::-webkit-details-marker {
  display: none;
}

.saved-trip-stats summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #edf4f1;
  color: var(--navy);
}

.saved-trip-stats[open] summary::after {
  content: "-";
}

.saved-trip-stats summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.saved-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.saved-stats-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.saved-stats-grid strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.saved-stats-grid span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.park-ref {
  color: #fff;
  background: var(--navy);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 900;
}

.recommendation-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef8f5;
  border: 1px solid rgba(42, 157, 143, 0.32);
  color: var(--green);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.recommendation-badge.is-alternate {
  background: #edf3f0;
  border-color: rgba(96, 112, 128, 0.24);
  color: var(--muted);
}

.goal-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.goal-badge.is-advancing {
  background: #fff8ed;
  border: 1px solid rgba(244, 162, 97, 0.42);
  color: #76502a;
}

.goal-badge.is-done {
  background: #edf3f0;
  border: 1px solid rgba(96, 112, 128, 0.24);
  color: var(--muted);
}

.lodging-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(42, 157, 143, 0.32);
  border-radius: 999px;
  color: var(--green);
  background: #eef8f5;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.type-badge {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 24px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.type-state {
  background: #2a9d8f;
}

.type-wma,
.type-fws {
  background: #457b5f;
}

.type-blm {
  background: #9c6644;
}

.type-usfs {
  background: #386641;
}

.type-nps {
  background: #14213d;
}

.type-corps {
  background: #577590;
}

.type-trail {
  background: #e76f51;
}

.lodging-badge.is-none {
  color: var(--orange);
  border-color: rgba(231, 111, 81, 0.34);
  background: #fff2ed;
}

.lodging-badge.is-unknown {
  color: var(--muted);
  border-color: rgba(96, 112, 128, 0.28);
  background: #f2f5f6;
}

.tent-icon {
  width: 14px;
  height: 12px;
  display: inline-block;
  position: relative;
}

.tent-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid currentColor;
}

.tent-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 2px;
  height: 8px;
  background: #fff;
}

.lodging-badge.is-none .tent-icon::after {
  left: -1px;
  top: 5px;
  width: 17px;
  height: 2px;
  background: currentColor;
  transform: rotate(-35deg);
}

.park-meta,
.stop-meta,
.saved-meta {
  margin-top: 8px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  min-width: 0;
  max-width: 100%;
}

.park-meta span,
.stop-meta span,
.saved-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.park-actions {
  display: flex;
  gap: 8px;
  align-items: start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stop-top .park-actions {
  align-items: center;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.schedule-panel {
  margin-bottom: 18px;
}

.route-timeline-preview {
  margin-top: 16px;
  max-width: 100%;
  min-width: 0;
}

.route-preview-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.route-preview-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 22px;
}

.route-preview-heading span:not(.status-pill) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.route-timeline-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-width: 100%;
  min-width: 0;
}

.route-preview-stop {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.route-preview-details {
  grid-column: 2;
  padding-right: 188px;
  min-width: 0;
  max-width: 100%;
}

.route-preview-stop.is-active-stop {
  border-color: rgba(42, 157, 143, 0.55);
  box-shadow: 0 14px 34px rgba(42, 157, 143, 0.16);
}

.route-preview-stop.is-complete {
  background: #fbfffd;
  border-color: rgba(42, 157, 143, 0.36);
}

.route-preview-time strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.1;
}

.route-preview-time span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.drag-handle {
  position: relative;
  display: grid;
  width: 42px;
  height: 34px;
  margin-top: 8px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #edf3f0;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle span,
.drag-handle span::before,
.drag-handle span::after {
  display: block;
  width: 17px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.drag-handle span::before {
  transform: translateY(-7px);
}

.drag-handle span::after {
  transform: translateY(4px);
}

.route-preview-card-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
}

.route-preview-card-toolbar .drag-handle {
  margin-top: 0;
}

.route-preview-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  margin-top: 12px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.route-preview-actions::-webkit-scrollbar {
  display: none;
}

.route-preview-actions .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.stop-card-icon-actions {
  position: static;
  display: flex;
  gap: 14px;
  align-items: center;
}

.stop-card-icon-actions .icon-button {
  width: 40px;
  height: 40px;
  font-size: 18px;
  font-weight: 950;
}

.stop-card-icon-actions .icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.stop-card-icon-actions .icon-button.danger {
  color: #8a3a22;
}

.route-preview-stop.is-dragging {
  opacity: 0.88;
  transform: scale(0.99);
  box-shadow: 0 18px 42px rgba(12, 29, 56, 0.18);
  z-index: 5;
}

body.is-stop-dragging {
  cursor: grabbing;
  user-select: none;
}

.complete-stop-button.is-complete {
  background: #e7ecea;
  color: var(--muted);
}

.overnight-badge {
  background: #fff4e8;
  color: #83501b;
}

.stop-overnight-toggle {
  min-height: 48px;
  align-content: center;
}

.complete-stop-button {
  min-width: 148px;
  border: 1px solid rgba(42, 157, 143, 0.32);
}

.route-preview-edit {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.stop-edit-details[hidden] {
  display: none;
}

.trip-park-search-panel {
  margin-bottom: 18px;
}

.trip-park-results {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.trip-park-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.trip-park-result.is-added {
  border-color: rgba(42, 157, 143, 0.34);
  background: #fbfffd;
}

.status-pill.is-warning {
  color: #8a3a22;
  background: #fff2ed;
}

.status-pill.is-caution {
  color: #76502a;
  background: #fff8ed;
}

.status-pill.is-complete {
  color: #14776c;
  background: #e8f7f3;
}

.status-pill.is-open {
  color: #14776c;
  background: #e8f7f3;
}

.status-pill.is-muted {
  color: var(--muted);
  background: #e7ecea;
}

.rover-dashboard {
  border: 1px solid rgba(42, 157, 143, 0.32);
  border-radius: 8px;
  background: #f2faf7;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  padding: 18px;
}

.rover-dashboard.is-hidden {
  display: none;
}

.rover-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.rover-top h2 {
  margin: 2px 0 0;
  color: var(--navy);
  font-size: 26px;
}

.rover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.stats-strip div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.stats-strip span {
  display: block;
  font-size: 28px;
  font-weight: 900;
}

.stats-strip small {
  color: var(--muted);
  font-weight: 800;
}

.stop-card {
  display: grid;
  gap: 12px;
}

.stop-card.has-warning {
  border-color: rgba(231, 111, 81, 0.48);
  background: #fffaf8;
}

.stop-card.is-active-stop {
  border-color: rgba(42, 157, 143, 0.55);
  box-shadow: 0 14px 34px rgba(42, 157, 143, 0.16);
}

.stop-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.stop-log {
  display: grid;
  grid-template-columns: 110px 150px repeat(4, minmax(120px, 1fr)) minmax(170px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.checkbox-line input {
  width: 18px;
  height: 18px;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  max-width: 480px;
  width: calc(100% - 32px);
}

dialog::backdrop {
  background: rgba(20, 33, 61, 0.42);
}

.dialog-card {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.dialog-subtitle {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-top: 4px;
}

#share-dialog {
  max-width: 720px;
}

.share-badge-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.share-template-preview {
  display: grid;
  gap: 10px;
}

.share-template-preview img {
  display: block;
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(20, 33, 61, 0.12);
}

.share-template-preview strong,
.share-template-preview span {
  display: block;
}

.share-template-preview strong {
  color: var(--ink);
  font-size: 18px;
}

.share-template-preview span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-top: 3px;
}

.share-badge {
  --share-accent: var(--green);
  overflow: hidden;
  border-radius: 8px;
  background: #f5faf8;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(20, 33, 61, 0.08);
}

.share-brand {
  background: var(--navy);
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  padding: 16px 18px;
  border-bottom: 6px solid var(--share-accent);
}

.share-badge > span {
  display: block;
  color: var(--share-accent);
  font-size: 13px;
  font-weight: 950;
  padding: 16px 18px 0;
  text-transform: uppercase;
}

.share-badge h3 {
  margin: 8px 18px 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.share-badge p {
  margin: 10px 18px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.share-badge-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.share-badge-stats div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.share-badge-stats strong,
.share-badge-stats span {
  display: block;
}

.share-badge-stats strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.share-badge-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  margin-top: 5px;
  text-transform: uppercase;
}

.share-link-list {
  display: grid;
  gap: 7px;
  max-height: 170px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.share-links-heading {
  color: var(--navy);
  font-size: 13px;
  font-weight: 950;
}

.share-link-list a {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.install-dialog-card {
  max-width: 440px;
}

.install-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-weight: 750;
}

menu {
  padding: 0;
  margin: 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 40px));
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

a {
  color: var(--green);
  font-weight: 800;
}

@media (max-width: 980px) {
  .app-shell,
  .planner-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .tabs {
    grid-template-columns: repeat(4, 1fr);
  }

  .tab {
    text-align: center;
  }

  .stop-log {
    grid-template-columns: 1fr 1fr;
  }

  .projection-summary,
  .insight-grid,
  .score-grid,
  .rover-grid,
  .progress-grid,
  .saved-stats-grid,
  .pota-profile-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-wide {
    grid-column: span 2;
  }

  .route-form {
    order: 1;
  }

  .route-map {
    order: 2;
  }

  .map-stage,
  .interactive-map {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .pwa-install-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    left: 14px;
    right: auto;
    max-width: calc(100vw - 86px);
  }

  .pwa-install-button.is-hidden {
    display: none;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .workspace,
  .sidebar {
    padding: 14px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app-shell {
    width: 100%;
    max-width: 100vw;
    min-height: 100dvh;
    overflow-x: hidden;
  }

  .sidebar {
    gap: 14px;
  }

  .brand {
    align-items: start;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    display: none;
  }

  .tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .tab,
  .button,
  .icon-button {
    min-height: 42px;
  }

  .panel,
  .route-form {
    padding: 14px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .view-header,
  .header-actions,
  .park-card,
  .trip-park-result,
  .saved-card-main,
  .stop-top {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .split,
  .split.three,
  .split.four,
  .search-include-row,
  .stats-strip,
  .stop-log,
  .projection-summary,
  .insight-grid,
  .score-grid,
  .rover-grid,
  .progress-grid,
  .pota-profile-row {
    grid-template-columns: 1fr;
  }

  .progress-wide {
    grid-column: auto;
  }

  .view-header h2 {
    font-size: 24px;
  }

  .map-toolbar {
    align-items: stretch;
  }

  .map-toolbar span {
    flex: 1 1 auto;
    text-align: center;
  }

  .map-focus-button {
    margin-left: 0;
  }

  .map-stage,
  .interactive-map {
    min-height: 300px;
  }

  .route-map.is-map-mode {
    min-height: 100dvh;
  }

  .route-map.is-map-mode .map-toolbar {
    padding: 10px;
  }

  .route-map.is-map-mode .map-stage {
    height: calc(100dvh - 62px);
  }

  .state-suggestion-group summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .state-suggestion-list {
    max-height: 70vh;
    padding: 10px;
  }

  .saved-section-heading,
  .route-preview-heading,
  .saved-trip-stats summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .saved-trip-stats summary small {
    margin-left: 0;
  }

  .saved-stats-grid {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .route-preview-stop {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
  }

  .route-preview-actions {
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 100%;
  }

  .route-preview-card-toolbar {
    position: static;
    grid-row: 1;
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 8px;
  }

  .route-preview-time {
    grid-row: 2;
  }

  .route-preview-details {
    grid-row: 3;
    padding-right: 0;
    padding-top: 0;
  }

  .route-preview-actions .button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.05;
  }

  .complete-stop-button {
    min-width: 118px;
  }

  .stop-edit-details {
    width: 100%;
  }

  .route-preview-edit {
    width: 100%;
    margin-top: 8px;
  }

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

  .stop-card-icon-actions {
    gap: 10px;
  }

  .stop-card-icon-actions .icon-button {
    width: 38px;
    height: 38px;
  }

  .share-badge-stats {
    grid-template-columns: 1fr 1fr;
  }

  .trip-score-details summary {
    grid-template-columns: 1fr;
  }

  .park-actions,
  .map-park-actions {
    justify-content: stretch;
  }

  .park-actions .button {
    flex: 1 1 110px;
    text-align: center;
  }

  .leaflet-popup-content {
    margin: 8px;
  }

  .map-park-sheet {
    min-width: min(250px, calc(100vw - 72px));
    max-width: calc(100vw - 72px);
  }

  .map-park-stats {
    grid-template-columns: 1fr;
  }
}
