:root {
  color-scheme: light;
  --ink: #172321;
  --ink-soft: #53615e;
  --paper: #f4f2ea;
  --paper-deep: #e8e5da;
  --panel: #fbfaf5;
  --sea: #d9e9e7;
  --land: #f1dfbc;
  --land-edge: #9f8c69;
  --route: #1f6668;
  --route-soft: #5f8989;
  --ferry: #5973a7;
  --accent: #d45f3f;
  --accent-dark: #a53d24;
  --stay: #a54768;
  --line: rgba(23, 35, 33, 0.16);
  --shadow: 0 18px 50px rgba(25, 37, 34, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% -10%, rgba(212, 95, 63, 0.12), transparent 32rem),
    linear-gradient(180deg, #f7f5ef 0, var(--paper) 20rem);
}

body.map-fullscreen-open {
  overflow: hidden;
  overscroll-behavior: none;
}

button,
select,
textarea {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--route);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-dark);
}

:focus-visible {
  outline: 3px solid rgba(212, 95, 63, 0.45);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px clamp(18px, 4vw, 64px) 24px;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 8px 0 30px;
}

.eyebrow,
.map-kicker,
.details-kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-block h1,
.timeline-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 6vw, 5.7rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.trip-line {
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: clamp(0.92rem, 1.5vw, 1.08rem);
}

.trip-line span {
  padding: 0 0.35em;
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.view-switch,
.mode-switch {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 250, 245, 0.72);
  box-shadow: 0 8px 26px rgba(25, 37, 34, 0.06);
  backdrop-filter: blur(12px);
}

.view-button,
.mode-button {
  min-height: 40px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.view-button:hover,
.mode-button:hover {
  background: rgba(31, 102, 104, 0.08);
}

.view-button.is-active,
.mode-button.is-active {
  color: #fffdf8;
  background: var(--ink);
}

.inbox-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--route);
  background: rgba(251, 250, 245, 0.82);
  box-shadow: 0 8px 26px rgba(25, 37, 34, 0.06);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 750;
  white-space: nowrap;
}

.inbox-trigger:hover {
  border-color: rgba(31, 102, 104, 0.38);
  background: #fffef9;
}

.inbox-badge {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent-dark);
  font-size: 0.65rem;
  font-weight: 850;
  line-height: 1;
}

.inbox-badge[hidden] {
  display: none;
}

.view[hidden] {
  display: none;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-controls {
  display: grid;
  width: clamp(310px, 38vw, 390px);
  padding: 7px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(251, 250, 245, 0.86);
  box-shadow: 0 8px 26px rgba(25, 37, 34, 0.06);
  backdrop-filter: blur(12px);
}

.day-controls[hidden] {
  display: none;
}

.day-stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.day-step-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: var(--route);
  background: transparent;
  cursor: pointer;
}

.day-step-button:hover {
  background: rgba(31, 102, 104, 0.09);
}

.day-step-button:disabled {
  cursor: not-allowed;
  opacity: 0.28;
}

.day-step-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.day-readout {
  min-width: 0;
  text-align: center;
}

.day-readout-count {
  display: block;
  margin-bottom: 2px;
  color: var(--accent-dark);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.day-readout strong {
  display: block;
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-scrubber {
  padding: 0 3px 2px;
}

.day-scrubber-input {
  --day-progress: 0%;
  display: block;
  width: calc(100% - 24px);
  height: 28px;
  margin: 0 12px;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
  touch-action: pan-y;
}

.day-scrubber-input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) 0 var(--day-progress), rgba(23, 35, 33, 0.16) var(--day-progress) 100%);
}

.day-scrubber-input::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -8px;
  appearance: none;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dark), 0 3px 10px rgba(23, 35, 33, 0.2);
}

.day-scrubber-input:focus-visible {
  outline: 0;
}

.day-scrubber-input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px var(--accent-dark), 0 0 0 5px rgba(212, 95, 63, 0.2), 0 3px 10px rgba(23, 35, 33, 0.2);
}

.day-scrubber-input::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(23, 35, 33, 0.16);
}

.day-scrubber-input::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.day-scrubber-input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dark), 0 3px 10px rgba(23, 35, 33, 0.2);
}

.day-scrubber-input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 1px var(--accent-dark), 0 0 0 5px rgba(212, 95, 63, 0.2), 0 3px 10px rgba(23, 35, 33, 0.2);
}

.day-scrubber-ticks {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
}

.day-scrubber-tick {
  display: grid;
  justify-items: center;
  width: 24px;
  font-size: 0.58rem;
  line-height: 1;
}

.day-scrubber-tick span {
  opacity: 0.72;
  text-transform: uppercase;
}

.day-scrubber-tick strong {
  margin-top: 3px;
  font-size: 0.7rem;
}

.day-scrubber-tick.is-past,
.day-scrubber-tick.is-active {
  color: var(--accent-dark);
}

.day-scrubber-tick.is-active strong {
  font-weight: 900;
}

.icon-button,
.reset-button {
  display: inline-grid;
  place-items: center;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}

.icon-button {
  width: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.1rem;
}

.reset-button {
  padding: 0 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
}

.icon-button:hover,
.reset-button:hover {
  border-color: rgba(31, 102, 104, 0.5);
  background: #fffefa;
}

.location-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.location-button[aria-pressed="true"] {
  border-color: rgba(31, 102, 104, 0.58);
  color: #fff;
  background: var(--route);
}

.icon-button:disabled,
.reset-button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 340px);
  gap: 18px;
  align-items: start;
}

.map-card,
.details-panel,
.timeline-day {
  border: 1px solid var(--line);
  background: rgba(251, 250, 245, 0.94);
  box-shadow: var(--shadow);
}

.map-card {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.map-layout.maplibregl-pseudo-fullscreen {
  display: block !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  border: 0;
  background: var(--sea);
}

.map-layout.maplibregl-pseudo-fullscreen .map-card {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.map-layout.maplibregl-pseudo-fullscreen .map-heading {
  position: absolute;
  z-index: 12;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  display: block;
  padding: 0;
  pointer-events: none;
}

.map-layout.maplibregl-pseudo-fullscreen .map-heading > div:first-child,
.map-layout.maplibregl-pseudo-fullscreen .map-legend {
  display: none;
}

.map-layout.maplibregl-pseudo-fullscreen .zoom-controls {
  pointer-events: auto;
}

.map-layout.maplibregl-pseudo-fullscreen .icon-button,
.map-layout.maplibregl-pseudo-fullscreen .reset-button {
  height: 44px;
  background: rgba(251, 250, 245, 0.94);
  box-shadow: 0 8px 24px rgba(23, 35, 33, 0.16);
  backdrop-filter: blur(10px);
}

.map-layout.maplibregl-pseudo-fullscreen .icon-button {
  width: 44px;
}

.map-layout.maplibregl-pseudo-fullscreen .map-stage {
  height: 100%;
  min-height: 0;
  border: 0;
}

.map-layout.maplibregl-pseudo-fullscreen #trip-map {
  height: 100%;
  min-height: 0;
}

.map-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
}

.map-heading h3,
.details-panel h3,
.timeline-day h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.15;
}

.map-stage {
  position: relative;
  width: 100%;
  min-height: 620px;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background:
    radial-gradient(circle at 56% 52%, rgba(255, 255, 255, 0.48), transparent 48%),
    var(--sea);
}

#trip-map {
  position: absolute;
  z-index: 2;
  inset: 0;
  height: 620px;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition: opacity 240ms ease;
}

.outline-map,
.outline-markers {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 180ms ease;
}

.outline-markers {
  z-index: 1;
  overflow: hidden;
}

.outline-markers[hidden] {
  display: none;
}

#trip-map.is-ready {
  opacity: 1;
  pointer-events: auto;
}

.map-stage.is-detailed .outline-map {
  opacity: 0;
}

.outline-land {
  fill: var(--land);
  stroke: var(--land-edge);
  stroke-width: 1.25px;
  vector-effect: non-scaling-stroke;
}

.outline-route {
  fill: none;
  stroke: var(--route);
  stroke-width: 3.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.94;
  vector-effect: non-scaling-stroke;
  transition: opacity 180ms ease, stroke-width 180ms ease;
}

.outline-route.is-all {
  stroke: var(--route-soft);
  stroke-width: 2px;
  opacity: 0.32;
}

.outline-route.is-ferry {
  stroke: var(--ferry);
  stroke-dasharray: 7 7;
}

.maplibregl-map {
  color: var(--ink);
  font: inherit;
}

#trip-map .maplibregl-ctrl-top-right .maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid rgba(23, 35, 33, 0.18);
  border-radius: 50%;
  background: rgba(251, 250, 245, 0.94);
  box-shadow: 0 8px 24px rgba(23, 35, 33, 0.16);
  backdrop-filter: blur(10px);
}

#trip-map .maplibregl-ctrl-fullscreen,
#trip-map .maplibregl-ctrl-shrink {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

#trip-map .maplibregl-ctrl-fullscreen:focus-visible,
#trip-map .maplibregl-ctrl-shrink:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(212, 95, 63, 0.52);
}

.map-layout.maplibregl-pseudo-fullscreen #trip-map .maplibregl-ctrl-top-right .maplibregl-ctrl {
  margin-top: 12px;
  margin-right: max(12px, env(safe-area-inset-right));
}

.map-layout.maplibregl-pseudo-fullscreen .map-hint {
  left: max(12px, env(safe-area-inset-left));
  bottom: max(56px, calc(12px + env(safe-area-inset-bottom)));
}

.maplibregl-canvas:focus-visible {
  outline: 3px solid rgba(212, 95, 63, 0.52);
  outline-offset: -4px;
}

.maplibregl-ctrl-attrib {
  color: var(--ink-soft);
  background: rgba(251, 250, 245, 0.88) !important;
  backdrop-filter: blur(8px);
}

.maplibregl-ctrl-attrib a {
  color: var(--route);
}

.map-marker {
  width: 44px;
  height: 44px;
  user-select: none;
}

.map-marker[hidden] {
  display: none !important;
}

.outline-marker {
  position: absolute;
  transform: translate(-50%, -50%);
}

.map-marker-button {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.marker-visual {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border: 1.5px solid rgba(31, 102, 104, 0.72);
  border-radius: 50%;
  background: rgba(251, 250, 245, 0.92);
  box-shadow: 0 1px 4px rgba(23, 35, 33, 0.18);
  transform: translate(-50%, -50%);
  transition: width 160ms ease, height 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.map-marker.is-active .marker-visual {
  width: 13px;
  height: 13px;
  border: 2.5px solid #fffaf0;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(165, 61, 36, 0.45), 0 3px 8px rgba(23, 35, 33, 0.2);
}

.map-marker.is-stay .marker-visual {
  width: 12px;
  height: 12px;
  border: 2px solid #fffaf0;
  border-radius: 2px;
  background: var(--stay);
  box-shadow: 0 0 0 1px rgba(122, 44, 72, 0.42), 0 3px 8px rgba(23, 35, 33, 0.18);
  transform: translate(-50%, -50%) rotate(45deg);
}

.map-marker.is-selected .marker-visual {
  width: 16px;
  height: 16px;
  border: 3px solid #fffaf0;
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(23, 35, 33, 0.55), 0 4px 12px rgba(23, 35, 33, 0.28);
}

.map-marker.is-muted:not(.is-stay) .marker-visual {
  opacity: 0.58;
}

.map-marker-button:hover .marker-visual,
.map-marker-button:focus-visible .marker-visual {
  border-color: #fffaf0;
  box-shadow: 0 0 0 3px rgba(212, 95, 63, 0.3), 0 4px 12px rgba(23, 35, 33, 0.24);
}

.marker-label {
  --label-anchor-shift: 0%;
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 180px;
  padding: 2px 5px 3px;
  border: 1px solid rgba(23, 35, 33, 0.1);
  border-radius: 5px;
  color: var(--ink);
  background: rgba(251, 250, 245, 0.9);
  box-shadow: 0 2px 8px rgba(23, 35, 33, 0.12);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.15;
  text-align: left;
  white-space: nowrap;
  transform: translate(calc(var(--label-x) + var(--label-anchor-shift)), calc(var(--label-y) - 50%));
}

.map-marker.label-middle .marker-label {
  --label-anchor-shift: -50%;
}

.map-marker.label-end .marker-label {
  --label-anchor-shift: -100%;
}

.marker-label[hidden],
.marker-night-badge[hidden] {
  display: none;
}

.marker-night-badge {
  position: absolute;
  top: calc(50% - 11px);
  left: calc(50% + 10px);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--panel);
  border-radius: 50%;
  color: #fff;
  background: var(--stay);
  box-shadow: 0 2px 6px rgba(23, 35, 33, 0.2);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.current-location-marker {
  z-index: 35;
  width: 44px;
  height: 44px;
  pointer-events: none;
  user-select: none;
}

.current-location-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #287ac1;
  box-shadow: 0 0 0 5px rgba(40, 122, 193, 0.2), 0 3px 10px rgba(23, 35, 33, 0.28);
  transform: translate(-50%, -50%);
}

.current-location-marker.is-stale .current-location-dot {
  opacity: 0.58;
}

.outline-current-location {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
}

.outline-current-location[hidden] {
  display: none;
}

.map-overlap-menu {
  position: absolute;
  z-index: 8;
  width: min(248px, calc(100% - 24px));
  max-height: 270px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(23, 35, 33, 0.18);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(251, 250, 245, 0.97);
  box-shadow: 0 14px 34px rgba(23, 35, 33, 0.2);
  backdrop-filter: blur(12px);
  transform: translate(-50%, -100%);
}

.map-overlap-menu.is-below {
  transform: translateX(-50%);
}

.map-overlap-menu[hidden] {
  display: none;
}

.map-overlap-menu p {
  margin: 2px 4px 7px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

#map-overlap-options {
  display: grid;
  gap: 4px;
}

#map-overlap-options button {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1.25;
  text-align: left;
}

#map-overlap-options button:hover,
#map-overlap-options button:focus-visible {
  border-color: rgba(31, 102, 104, 0.26);
  background: rgba(31, 102, 104, 0.09);
  outline: none;
}

.map-status {
  position: absolute;
  z-index: 5;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 28px);
  padding: 8px 10px;
  border: 1px solid rgba(23, 35, 33, 0.13);
  border-radius: 10px;
  color: var(--ink-soft);
  background: rgba(251, 250, 245, 0.9);
  box-shadow: 0 6px 18px rgba(23, 35, 33, 0.1);
  backdrop-filter: blur(10px);
  font-size: 0.74rem;
  font-weight: 700;
}

.map-status[hidden] {
  display: none;
}

.map-status.is-fallback {
  color: var(--accent-dark);
}

.map-status button {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(31, 102, 104, 0.36);
  border-radius: 999px;
  color: var(--route);
  background: #fffef9;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.map-hint {
  position: absolute;
  z-index: 4;
  left: 14px;
  bottom: 14px;
  padding: 7px 10px;
  border: 1px solid rgba(23, 35, 33, 0.12);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(251, 250, 245, 0.86);
  box-shadow: 0 6px 18px rgba(23, 35, 33, 0.08);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

.map-hint[hidden] {
  display: none;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 13px 22px 15px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-line {
  display: inline-block;
  width: 24px;
  border-top: 3px solid var(--route);
}

.legend-line.ferry {
  border-color: var(--ferry);
  border-top-style: dashed;
}

.legend-stay {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border: 2px solid #fffaf0;
  border-radius: 2px;
  background: var(--stay);
  box-shadow: 0 0 0 1px var(--stay);
  transform: rotate(45deg);
}

.legend-current-location {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #287ac1;
  box-shadow: 0 0 0 3px rgba(40, 122, 193, 0.2);
}

.details-panel {
  position: sticky;
  top: 18px;
  min-height: 280px;
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border-radius: var(--radius-lg);
}

.fullscreen-details-close {
  display: none;
}

.map-layout.maplibregl-pseudo-fullscreen .details-panel {
  display: none;
}

.map-layout.maplibregl-pseudo-fullscreen .details-panel.has-selected-poi {
  position: absolute;
  z-index: 14;
  top: auto;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(56px, calc(12px + env(safe-area-inset-bottom)));
  display: block;
  width: min(360px, calc(100vw - 24px));
  min-height: 0;
  max-height: min(42dvh, 360px);
  overflow: auto;
  padding: 22px 62px 22px 22px;
  border-radius: 20px;
  background: rgba(251, 250, 245, 0.97);
  box-shadow: 0 18px 50px rgba(23, 35, 33, 0.24);
  backdrop-filter: blur(14px);
}

.map-layout.maplibregl-pseudo-fullscreen .fullscreen-details-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: #fffef9;
  cursor: pointer;
}

.fullscreen-details-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.details-panel > p {
  color: var(--ink-soft);
  line-height: 1.6;
}

.details-panel > p:last-child {
  margin-bottom: 0;
}

.details-route {
  margin: 16px 0;
  padding: 14px 0;
  border-block: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.travel-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.travel-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(31, 102, 104, 0.16);
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(31, 102, 104, 0.07);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.details-travel-summary {
  margin: 16px 0 0;
}

.route-legs {
  margin: -1px 0 16px;
  border-bottom: 1px solid var(--line);
}

.route-legs summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 2px;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  list-style: none;
}

.route-legs summary::-webkit-details-marker {
  display: none;
}

.route-legs summary::after {
  content: "+";
  font-size: 1.1rem;
  font-weight: 500;
}

.route-legs[open] summary::after {
  content: "−";
}

.route-legs ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-legs li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 11px 2px;
  border-top: 1px solid rgba(23, 35, 33, 0.08);
}

.route-leg-copy,
.route-leg-metrics {
  display: grid;
  gap: 4px;
}

.route-leg-copy strong {
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.35;
}

.route-leg-copy span,
.route-leg-metrics span,
.route-legs > p {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.route-leg-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.route-leg-meta a {
  font-size: 0.7rem;
  font-weight: 750;
}

.route-leg-metrics {
  justify-items: end;
  min-width: 68px;
  font-variant-numeric: tabular-nums;
}

.route-leg-metrics strong {
  color: var(--accent-dark);
  font-size: 0.76rem;
}

.route-legs > p {
  margin: 3px 2px 14px;
  line-height: 1.5;
}

.details-day-list,
.details-stop-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.details-day-button,
.details-stop-button {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: left;
  background: #fffef9;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 650;
}

.details-day-button {
  display: grid;
  gap: 4px;
}

.details-day-button small {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.details-day-button:hover,
.details-stop-button:hover {
  border-color: rgba(31, 102, 104, 0.55);
}

.place-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.place-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-size: 0.72rem;
  font-weight: 750;
}

.map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 16px;
  border-radius: 999px;
  color: #fffdf8;
  background: var(--route);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.map-link:hover {
  color: #fff;
  background: var(--accent-dark);
}

.timeline-view {
  max-width: 1060px;
  margin: 0 auto;
  padding: 22px 0 36px;
}

.timeline-heading {
  max-width: 760px;
  margin-bottom: 36px;
}

.timeline-heading h2 {
  font-size: clamp(2.8rem, 7vw, 6.2rem);
}

.timeline-heading > p:last-child {
  max-width: 650px;
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.65;
}

.timeline {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: itinerary-day;
}

.timeline-day {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius-lg);
  counter-increment: itinerary-day;
}

.timeline-day-number {
  display: grid;
  place-items: center;
  align-self: start;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fffdf8;
  background: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
}

.timeline-day-number::before {
  content: counter(itinerary-day);
}

.timeline-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.timeline-date {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overnight {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--stay);
  background: rgba(165, 71, 104, 0.1);
  font-size: 0.72rem;
  font-weight: 800;
}

.timeline-summary {
  margin: 15px 0 12px;
  color: var(--ink-soft);
  line-height: 1.62;
}

.timeline-travel-summary {
  margin: 0 0 15px;
}

.timeline-items {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 15px;
  padding: 13px 0;
  border-top: 1px solid rgba(23, 35, 33, 0.09);
}

.timeline-item:first-child {
  border-top: 0;
}

.timeline-time {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-item-title {
  font-weight: 750;
}

.timeline-item p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.timeline-map-link {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.76rem;
  font-weight: 750;
}

.app-error {
  padding: 28px;
  border: 1px solid rgba(165, 61, 36, 0.35);
  border-radius: var(--radius-md);
  background: rgba(212, 95, 63, 0.08);
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 4px 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.inbox-dialog {
  width: min(470px, 100%);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.inbox-dialog::backdrop {
  background: rgba(23, 35, 33, 0.38);
  backdrop-filter: blur(3px);
}

.inbox-sheet {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding:
    max(28px, env(safe-area-inset-top))
    max(clamp(22px, 5vw, 34px), env(safe-area-inset-right))
    max(34px, env(safe-area-inset-bottom))
    max(clamp(22px, 5vw, 34px), env(safe-area-inset-left));
  border-left: 1px solid rgba(23, 35, 33, 0.14);
  background:
    radial-gradient(circle at 100% 0, rgba(212, 95, 63, 0.1), transparent 22rem),
    var(--panel);
  box-shadow: -22px 0 60px rgba(23, 35, 33, 0.18);
}

.inbox-header,
.inbox-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.inbox-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.inbox-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fffef9;
  cursor: pointer;
}

.inbox-close:hover,
.inbox-refresh:hover {
  border-color: rgba(31, 102, 104, 0.48);
  background: rgba(31, 102, 104, 0.07);
}

.inbox-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.inbox-description {
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.62;
}

.inbox-form {
  display: grid;
  margin-top: 26px;
}

.inbox-form label {
  margin-bottom: 9px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inbox-form textarea {
  width: 100%;
  min-height: 150px;
  padding: 14px 15px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fffef9;
  font-size: 0.94rem;
  line-height: 1.55;
}

.inbox-form textarea::placeholder {
  color: rgba(83, 97, 94, 0.72);
}

.inbox-form textarea:disabled {
  opacity: 0.64;
}

.inbox-form-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.71rem;
  line-height: 1.4;
}

.inbox-form-meta.is-near-limit {
  color: var(--accent-dark);
}

.inbox-submit {
  justify-self: start;
  min-height: 46px;
  margin-top: 18px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fffdf8;
  background: var(--route);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
}

.inbox-submit:hover {
  background: var(--accent-dark);
}

.inbox-submit:disabled,
.inbox-refresh:disabled {
  cursor: wait;
  opacity: 0.56;
}

.inbox-submit-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.inbox-submit-status[data-type="success"] {
  color: var(--route);
}

.inbox-submit-status[data-type="error"] {
  color: var(--accent-dark);
}

.inbox-sign-in {
  justify-self: start;
  margin-top: 4px;
  color: var(--route);
  font-size: 0.78rem;
  font-weight: 800;
  text-underline-offset: 3px;
}

.inbox-sign-in[hidden] {
  display: none;
}

.inbox-history-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.inbox-history-header h3 {
  margin: 0;
  font-size: 1.18rem;
}

.inbox-refresh {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffef9;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
}

.inbox-history-status {
  margin: 14px 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.inbox-history {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.inbox-history-item {
  display: grid;
  gap: 10px;
  min-height: 66px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 254, 249, 0.86);
}

.inbox-history-item-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.inbox-history-preview {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}

.inbox-history-metadata {
  display: grid;
  gap: 3px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.inbox-history time {
  color: inherit;
}

.inbox-status {
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.inbox-status.is-queued {
  color: var(--accent-dark);
  background: rgba(212, 95, 63, 0.11);
}

.inbox-status.is-done {
  color: var(--route);
  background: rgba(31, 102, 104, 0.11);
}

@media (max-width: 960px) {
  .map-layout {
    grid-template-columns: 1fr;
  }

  .details-panel {
    position: static;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding-inline: 14px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .view-switch {
    flex: 1 1 auto;
  }

  .view-button {
    flex: 1 1 0;
  }

  .inbox-trigger {
    flex: 0 0 auto;
    padding-inline: 15px;
  }

  .brand-block h1 {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .mode-button {
    padding-inline: 10px;
  }

  .day-controls {
    width: 100%;
  }

  .map-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .zoom-controls {
    align-self: flex-end;
  }

  .map-stage,
  #trip-map {
    min-height: 520px;
    height: 520px;
  }

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

  .timeline-day-number {
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
  }

  .timeline-day-head {
    flex-direction: column;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
