:root {
  color-scheme: light;
  --bg: #f6f0e7;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --ink: #18212b;
  --muted: #667085;
  --line: rgba(24, 33, 43, 0.12);
  --accent: #b85c38;
  --accent-dark: #7a351f;
  --blue: #315f72;
  --green: #53795b;
  --shadow: 0 20px 60px rgba(76, 58, 40, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(184, 92, 56, 0.18), transparent 34rem),
    linear-gradient(135deg, #f8f0e5 0%, #edf4f5 52%, #f7efe4 100%);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

button {
  font: inherit;
}

.hero {
  padding: 32px clamp(18px, 4vw, 56px) 42px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto 34px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  max-width: 780px;
  overflow-wrap: anywhere;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.version-badge {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1px solid rgba(122, 53, 31, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(76, 58, 40, 0.08);
}

.local-weather-panel {
  max-width: 1180px;
  margin: 0 auto 22px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(242, 201, 76, 0.18), transparent 24rem),
    linear-gradient(145deg, #203744, #315f72);
  color: #fff;
  box-shadow: var(--shadow);
}

.local-weather-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.local-weather-heading .eyebrow,
.local-weather-heading h2,
.local-weather-heading p {
  color: inherit;
}

.local-weather-heading h2 {
  margin-bottom: 6px;
  font-size: clamp(24px, 3.5vw, 34px);
}

.local-weather-heading p {
  margin-bottom: 0;
  opacity: 0.72;
}

#localWeatherCoordinates {
  margin-bottom: 4px;
}

.local-weather-heading button,
.hotel-overview-card button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

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

.local-weather-grid article {
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.local-weather-grid span,
.weather-forecast-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.68;
}

.local-weather-grid strong {
  display: block;
  margin-bottom: 7px;
  font-size: 20px;
  line-height: 1.3;
}

.local-weather-grid p,
.local-weather-grid em {
  margin: 0;
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
  opacity: 0.74;
}

.local-weather-grid .weather-current strong {
  font-size: 32px;
}

.local-weather-grid .weather-clothing strong {
  font-size: 14px;
  line-height: 1.55;
}

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

.weather-forecast-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 16px;
  background: rgba(12, 29, 39, 0.24);
}

.weather-forecast-card span {
  margin: 0;
}

.weather-forecast-card strong {
  font-size: 14px;
}

.weather-forecast-card em {
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.daily-overview,
main {
  margin: 0 auto;
}

.daily-overview {
  max-width: 1180px;
  min-width: 0;
}

.daily-overview-heading {
  margin-bottom: 14px;
}

.daily-overview-heading .eyebrow {
  margin-bottom: 5px;
}

.daily-overview-heading h2 {
  margin-bottom: 0;
  font-size: clamp(25px, 3vw, 34px);
}

.overview-date-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding: 4px 0 10px;
  overflow-x: auto;
  scrollbar-color: rgba(49, 95, 114, 0.28) transparent;
  scrollbar-width: thin;
}

.overview-date-tab {
  flex: 0 0 auto;
  min-width: 94px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.overview-date-tab:hover {
  border-color: rgba(184, 92, 56, 0.32);
  transform: translateY(-1px);
}

.overview-date-tab[aria-selected="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(184, 92, 56, 0.2);
}

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

.overview-card {
  min-height: 172px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.overview-card.primary {
  background: linear-gradient(145deg, #213846, #315f72);
  color: #fff;
}

.overview-card span {
  display: block;
  margin-bottom: 12px;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.72;
}

.overview-card strong {
  display: block;
  margin-bottom: 16px;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.overview-card p {
  margin-bottom: 0;
  color: inherit;
  line-height: 1.65;
  opacity: 0.76;
}

.overview-card .overview-advice {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 700;
  opacity: 0.9;
}

.overview-card .overview-oxygen {
  margin: -7px 0 9px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  opacity: 0.9;
}

.overview-card .overview-distance-title {
  font-size: 21px;
  line-height: 1.25;
}

.route-summary-card strong {
  font-size: 20px;
  line-height: 1.35;
}

.route-summary-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.route-summary-card .overview-route-path {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(49, 95, 114, 0.08);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.route-summary-card .overview-route-brief {
  font-size: 13px;
}

.overview-segment-list {
  display: grid;
  gap: 7px;
}

.overview-segment-list p {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.4;
}

.overview-segment-list p:first-child {
  padding-top: 0;
  border-top: 0;
}

.overview-segment-list button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.overview-segment-list button:hover {
  text-decoration: underline;
}

.overview-segment-list .overview-segment-distance {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 11px;
  text-align: right;
}

.overview-hotel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: nowrap;
}

.hotel-overview-card .overview-hotel-actions button {
  min-width: 0;
  margin: 0;
  border-color: rgba(49, 95, 114, 0.2);
  background: rgba(49, 95, 114, 0.1);
  color: var(--blue);
  white-space: nowrap;
}

.overview-hotel-navigation {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.overview-hotel-navigation[hidden] {
  display: none;
}

.overview-hotel-navigation svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.overview-hotel-navigation span {
  display: inline;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  opacity: 1;
}

main {
  max-width: calc(1180px + clamp(36px, 8vw, 112px));
  padding: 0 clamp(18px, 4vw, 56px) 56px;
}

.feature-strip {
  position: sticky;
  top: 0;
  z-index: 1100;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 12px clamp(18px, 4vw, 56px);
  background: linear-gradient(180deg, rgba(246, 240, 231, 0.95), rgba(246, 240, 231, 0.72));
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(76, 58, 40, 0.08);
}

.feature {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.feature-version {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(184, 92, 56, 0.12);
  color: var(--accent-dark);
  font-size: 11px;
}

.feature-label-short {
  display: none;
}

.feature.disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.68;
}

.feature.disabled .feature-version {
  background: rgba(102, 112, 133, 0.12);
  color: var(--muted);
}

.panel,
.local-weather-panel,
.daily-overview {
  scroll-margin-top: 86px;
}

.panel {
  margin-top: 18px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 24px;
}

.section-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.75;
}

.route-map {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.map-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
}

.leaflet-map {
  width: 100%;
  min-height: 480px;
  background: #dce7e5;
}

.map-touch-hint {
  display: none;
}

.leaflet-map.touch-gesture-map {
  touch-action: none;
}

.leaflet-map.touch-gesture-map + .map-touch-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 1000;
  display: block;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(24, 33, 43, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
  transform: translateX(-50%);
  transition:
    background 160ms ease,
    opacity 160ms ease;
}

.leaflet-map.touch-map-active + .map-touch-hint {
  background: var(--blue);
}

.map-note {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.altitude-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.altitude-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.altitude-legend i {
  display: inline-block;
  width: 22px;
  height: 8px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(24, 33, 43, 0.12);
}

.route-sidebar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.collapsible-section {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
}

.collapsible-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 26px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.collapsible-section summary::-webkit-details-marker {
  display: none;
}

.collapsible-section summary strong,
.collapsible-section summary em {
  display: block;
}

.collapsible-section summary strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 18px;
}

.collapsible-section summary em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}

.collapsible-section summary i {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(184, 92, 56, 0.12);
}

.collapsible-section summary i::before,
.collapsible-section summary i::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-dark);
  content: "";
  transition: transform 0.18s ease;
}

.collapsible-section summary i::before {
  transform: translate(-50%, -50%);
}

.collapsible-section summary i::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.collapsible-section[open] > summary {
  border-bottom: 1px solid var(--line);
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.collapsible-section[open] > summary i::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.route-list-section .route-sidebar {
  padding: 16px;
}

.route-date-filter {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 14px 16px 0;
  scrollbar-width: thin;
}

.route-date-filter button {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid rgba(49, 95, 114, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.route-date-filter button[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.route-builder {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  padding: 18px 20px 20px;
}

.destination-library,
.route-sequence-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
}

.nested-collapsible {
  align-self: start;
}

.nested-collapsible > summary {
  padding: 15px 16px;
  border-radius: 22px;
}

.nested-collapsible > summary strong {
  font-size: 17px;
}

.nested-collapsible > summary i {
  width: 30px;
  height: 30px;
}

.builder-heading {
  padding: 16px 16px 0;
}

.builder-heading strong,
.builder-heading span {
  display: block;
}

.builder-heading strong {
  color: var(--ink);
  font-size: 17px;
}

.builder-heading span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.destination-select-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px 0;
}

.destination-select-toolbar button {
  padding: 9px 14px;
  border: 1px solid rgba(49, 95, 114, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-weight: 900;
  cursor: pointer;
}

.destination-select-toolbar button:hover {
  border-color: rgba(49, 95, 114, 0.32);
  background: rgba(49, 95, 114, 0.08);
}

.destination-select-toolbar .primary-route-action {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.destination-select-toolbar .primary-route-action:hover {
  border-color: #244c5e;
  background: #244c5e;
}

.route-save-status {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.destination-select-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
}

.destination-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.destination-option:hover {
  border-color: rgba(184, 92, 56, 0.34);
  background: rgba(184, 92, 56, 0.08);
}

.destination-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.destination-option .option-order {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(49, 95, 114, 0.1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.destination-option strong,
.destination-option em {
  display: block;
}

.destination-option strong {
  color: var(--ink);
}

.destination-option em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.route-sequence {
  display: grid;
  gap: 10px;
  min-height: 220px;
  margin: 0;
  padding: 16px;
  list-style: none;
}

.route-sequence-item {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: grab;
  -webkit-touch-callout: none;
  user-select: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.route-drag-handle {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 40px;
  place-content: center;
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(49, 95, 114, 0.09);
  color: var(--blue);
  cursor: grab;
  touch-action: none;
  -webkit-touch-callout: none;
}

.route-drag-handle i {
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  pointer-events: none;
}

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

.route-drag-handle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.route-sequence-item:active {
  cursor: grabbing;
}

.route-sequence.touch-sorting {
  touch-action: none;
}

.route-sequence-item.touch-dragging {
  z-index: 2;
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(49, 95, 114, 0.2);
  opacity: 0.72;
  transform: scale(0.98);
}

.route-sequence-item.mouse-dragging {
  opacity: 0.52;
}

.route-sequence-item.insertion-before::before,
.route-sequence-item.insertion-after::after {
  position: absolute;
  right: 8px;
  left: 8px;
  z-index: 4;
  height: 4px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow:
    0 0 0 3px rgba(49, 95, 114, 0.13),
    0 3px 10px rgba(49, 95, 114, 0.28);
  content: "";
  pointer-events: none;
  animation: insertion-preview-pulse 0.8s ease-in-out infinite alternate;
}

.route-sequence-item.insertion-before::before {
  top: -8px;
}

.route-sequence-item.insertion-after::after {
  bottom: -8px;
}

@keyframes insertion-preview-pulse {
  from {
    opacity: 0.65;
    transform: scaleX(0.97);
  }

  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.route-sequence-item strong,
.route-sequence-item em {
  display: block;
}

.route-sequence-item strong {
  color: var(--ink);
}

.route-sequence-item em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.sequence-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.route-remove-button {
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(102, 112, 133, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.route-remove-button:hover {
  background: rgba(184, 92, 56, 0.14);
  color: var(--accent-dark);
}

.segment-card {
  scroll-margin-top: 90px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.segment-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.segment-card .segment-date {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(184, 92, 56, 0.12);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.segment-source {
  font-size: 11px;
  font-weight: 900;
}

.segment-source.actual {
  color: var(--green);
}

.segment-source.estimated {
  color: var(--muted);
}

.segment-card h3 {
  margin-bottom: 12px;
  font-size: 18px;
  line-height: 1.35;
}

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

.segment-meta span {
  display: block;
  padding: 10px;
  border-radius: 14px;
  background: rgba(49, 95, 114, 0.08);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.segment-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.segment-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.segment-actions a,
.segment-actions button {
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.segment-actions button {
  background: rgba(49, 95, 114, 0.1);
  color: var(--blue);
}

.segment-actions button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.segment-card.estimated {
  border-style: dashed;
}

.route-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed rgba(49, 95, 114, 0.24);
  border-radius: 18px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.coordinate-audit > p {
  margin: 16px 20px;
  color: var(--muted);
  line-height: 1.7;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
}

.coordinate-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.coordinate-grid strong,
.coordinate-grid span {
  display: block;
}

.coordinate-grid span {
  margin: 6px 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.coordinate-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.leaflet-popup-content {
  margin: 12px 14px;
  color: var(--ink);
  line-height: 1.55;
}

.destination-popup {
  width: 280px;
}

.destination-popup img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 12px;
  border-radius: 16px;
  background: #edf4f5;
}

.destination-popup strong,
.segment-popup strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.destination-popup p,
.segment-popup p {
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.55;
}

.destination-popup p:last-child,
.segment-popup p:last-child {
  margin-bottom: 0;
}

.stop-marker {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(24, 33, 43, 0.24);
}

.stop-name-label {
  border: 1px solid rgba(49, 95, 114, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(24, 33, 43, 0.12);
  backdrop-filter: blur(8px);
}

.stop-name-label::before {
  display: none;
}

.altitude-route-base {
  stroke-linecap: round;
}

.directional-route-line {
  stroke: var(--blue);
  stroke-dasharray: 3 12;
  stroke-linecap: round;
  animation: route-flow 1.1s linear infinite;
}

.route-click-target {
  cursor: pointer;
  stroke-linecap: round;
}

@keyframes route-flow {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -15;
  }
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.tab {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.day-detail {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}

.day-summary,
.detail-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
}

.day-summary {
  background: linear-gradient(150deg, #fff, #f8efe4);
}

.day-summary .date {
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(184, 92, 56, 0.12);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.day-summary h3 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.04em;
}

.meta-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.meta-item strong {
  color: var(--ink);
  text-align: right;
}

.detail-card ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.destination-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.destination-info-section .destination-grid {
  padding: 18px;
}

.destination-card {
  scroll-margin-top: 90px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
}

.destination-card:target,
.segment-card:target {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(49, 95, 114, 0.12);
}

.destination-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.destination-card-body {
  padding: 20px;
}

.destination-card .altitude {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(83, 121, 91, 0.14);
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.destination-card p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.destination-weather {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.destination-weather-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.destination-weather button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.destination-weather .destination-navigation.unmatched {
  border: 1px solid rgba(102, 112, 133, 0.2);
  background: rgba(102, 112, 133, 0.1);
  color: var(--muted);
}

.destination-weather .destination-navigation.matched {
  background: var(--blue);
  color: #fff;
}

.destination-navigation svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.destination-weather button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.destination-weather-result {
  margin-top: 12px;
}

.destination-weather-result strong,
.destination-weather-result span {
  display: block;
}

.destination-weather-result strong {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 15px;
}

.destination-weather-result span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.destination-weather-location {
  margin: 9px 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(49, 95, 114, 0.07);
}

.destination-weather-location span:first-child {
  color: var(--ink);
  font-weight: 900;
}

.hotel-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.hotel-form,
.hotel-list-panel[open] {
  background: #fff;
}

.hotel-form {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
}

.hotel-list-panel .hotel-list {
  margin-top: 0;
  padding: 16px 20px 20px;
}

.hotel-add-button {
  justify-self: start;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.hotel-form[hidden] {
  display: none;
}

.hotel-form-heading,
.hotel-list-heading,
.hotel-form-actions,
.hotel-query-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.hotel-form-heading {
  align-items: flex-start;
  margin-bottom: 18px;
}

.hotel-form-heading h3,
.hotel-form-heading p,
.hotel-list-heading h3,
.hotel-list-heading p {
  margin-bottom: 0;
}

.hotel-form-heading p,
.hotel-list-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hotel-query-status {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.hotel-query-row {
  margin-bottom: 16px;
}

.hotel-query-row label {
  flex: 1;
}

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

.hotel-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.hotel-form input,
.hotel-form select,
.hotel-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  outline: none;
}

.hotel-form input,
.hotel-form select {
  min-height: 44px;
  padding: 9px 12px;
}

.hotel-form textarea {
  padding: 11px 12px;
  resize: vertical;
}

.hotel-form input:focus,
.hotel-form select:focus,
.hotel-form textarea:focus {
  border-color: rgba(49, 95, 114, 0.5);
  box-shadow: 0 0 0 3px rgba(49, 95, 114, 0.1);
}

.hotel-date-field {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.hotel-date-field legend {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.hotel-date-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.hotel-form .hotel-date-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(49, 95, 114, 0.04);
  color: var(--muted);
  cursor: pointer;
}

.hotel-form .hotel-date-option:has(input:checked) {
  border-color: rgba(49, 95, 114, 0.45);
  background: rgba(49, 95, 114, 0.11);
  color: var(--blue);
}

.hotel-form .hotel-date-option input {
  flex: 0 0 auto;
  width: 16px;
  min-height: 0;
  height: 16px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--blue);
}

.hotel-form .hotel-date-option span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hotel-form-wide {
  grid-column: 1 / -1;
}

.hotel-ai-button,
.hotel-save-button,
.hotel-reset-button,
.hotel-card-actions button {
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.hotel-ai-button,
.hotel-save-button {
  background: var(--blue);
  color: #fff;
}

.hotel-ai-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.hotel-reset-button,
.hotel-card-actions button {
  background: rgba(49, 95, 114, 0.1);
  color: var(--blue);
}

.hotel-form-actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.hotel-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.hotel-empty {
  margin: 0;
  padding: 26px 16px;
  border: 1px dashed rgba(102, 112, 133, 0.35);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.hotel-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, #fff, #f8f4ee);
}

.hotel-card-header,
.hotel-card-meta,
.hotel-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hotel-card-header h4 {
  margin: 0;
  font-size: 17px;
}

.hotel-card-header span,
.hotel-card-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(83, 121, 91, 0.12);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.hotel-card-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 12px 0;
}

.hotel-card-meta span {
  background: rgba(49, 95, 114, 0.09);
  color: var(--blue);
}

.hotel-card p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hotel-card-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.hotel-card-actions .hotel-delete {
  background: rgba(184, 92, 56, 0.12);
  color: var(--accent-dark);
}

.v2-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.v2-grid article {
  padding: 24px;
  border: 1px dashed rgba(102, 112, 133, 0.38);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.62);
}

.v2-grid p {
  color: var(--muted);
  line-height: 1.7;
}

.v2-grid button {
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(102, 112, 133, 0.14);
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 980px) {
  .overview-grid,
  .destination-grid,
  .route-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .local-weather-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .local-weather-grid .weather-clothing {
    grid-column: span 2;
  }

  .hotel-layout {
    grid-template-columns: 1fr;
  }

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

  .day-detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    display: block;
  }

  .version-badge {
    display: inline-block;
    margin-top: 18px;
  }

  .overview-grid,
  .route-map,
  .route-sidebar,
  .coordinate-grid,
  .destination-select-grid,
  .destination-grid,
  .hotel-form-grid,
  .v2-grid {
    grid-template-columns: 1fr;
  }

  .overview-date-tab {
    min-width: 88px;
    padding: 11px 17px;
  }

  .local-weather-panel {
    padding: 18px;
    border-radius: 24px;
  }

  .local-weather-heading {
    display: block;
  }

  .local-weather-heading button {
    margin-top: 14px;
  }

  .local-weather-grid,
  .weather-forecast-row {
    grid-template-columns: 1fr;
  }

  .local-weather-grid .weather-clothing {
    grid-column: auto;
  }

  .hotel-form-wide {
    grid-column: auto;
  }

  .hotel-query-row,
  .hotel-form-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .feature-strip {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    padding: 8px 6px;
  }

  .feature {
    position: relative;
    min-height: 42px;
    gap: 2px;
    padding: 6px 2px;
    border-radius: 12px;
    font-size: 13px;
  }

  .feature-label-full {
    display: none;
  }

  .feature-label-short {
    display: inline;
  }

  .feature-version {
    position: absolute;
    top: 2px;
    right: 3px;
    padding: 1px 3px;
    font-size: 8px;
    line-height: 1.2;
  }

  .panel,
  .local-weather-panel,
  .daily-overview {
    scroll-margin-top: 66px;
  }

  .leaflet-map {
    min-height: 345px;
  }
}
