: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);
}

button,
select {
  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);
}

.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);
}

.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;
}

.icon-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-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);
  cursor: grab;
  touch-action: none;
}

.map-stage:active {
  cursor: grabbing;
}

#trip-map {
  display: block;
  width: 100%;
  height: 620px;
  user-select: none;
}

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

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

.map-route.is-visible {
  opacity: 0.94;
}

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

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

.map-node {
  cursor: pointer;
  outline: none;
}

.map-node .node-hit {
  fill: transparent;
}

.map-node .node-shape {
  fill: var(--panel);
  stroke: var(--route);
  stroke-width: 1.8px;
  vector-effect: non-scaling-stroke;
  transition: opacity 160ms ease, fill 160ms ease, stroke 160ms ease;
}

.map-node.is-muted .node-shape {
  fill: rgba(251, 250, 245, 0.68);
  stroke: rgba(31, 102, 104, 0.56);
  opacity: 0.68;
}

.map-node.is-active .node-shape {
  fill: var(--accent);
  stroke: #fffaf0;
  stroke-width: 2.4px;
}

.map-node.is-stay .node-shape {
  fill: var(--stay);
  stroke: #fffaf0;
}

.map-node.is-selected .node-shape {
  fill: var(--ink);
  stroke: #fffaf0;
  stroke-width: 3px;
}

.map-node:hover .node-shape,
.map-node:focus-visible .node-shape {
  stroke: var(--accent-dark);
  stroke-width: 3px;
}

.node-label {
  fill: var(--ink);
  stroke: var(--panel);
  stroke-width: 4px;
  paint-order: stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  font-size: 12px;
  font-weight: 750;
  pointer-events: none;
}

.node-night-badge {
  fill: var(--stay);
  stroke: var(--panel);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}

.node-night-text {
  fill: #fff;
  font-size: 9px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
}

.map-hint {
  position: absolute;
  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-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 {
  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);
}

.details-panel {
  position: sticky;
  top: 18px;
  min-height: 280px;
  padding: 24px;
  border-radius: var(--radius-lg);
}

.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;
}

.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: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;
  color: var(--ink-soft);
  line-height: 1.62;
}

.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;
}

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

  .details-panel {
    position: static;
    min-height: 0;
  }
}

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

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

  .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;
  }
}
