/* Shared frame for the eight trip screens. */
.app:is([data-view="home"],[data-view="overview"],[data-view="days"],[data-view="map"],[data-view="ideas"],[data-view="stays"],[data-view="budget"],[data-view="check"]) > :is(.head,.hero,.nav,.bottomnav) {
  display: none;
}

.app:is([data-view="home"],[data-view="overview"],[data-view="days"],[data-view="map"],[data-view="ideas"],[data-view="stays"],[data-view="budget"],[data-view="check"]) {
  display: flex;
  flex-direction: column;
  max-width: 760px;
  background: #faf8f3;
}

.app:is([data-view="home"],[data-view="overview"],[data-view="days"],[data-view="map"],[data-view="ideas"],[data-view="stays"],[data-view="budget"],[data-view="check"]) > .main {
  flex: 1;
  padding: 0;
}

.app:is([data-view="home"],[data-view="overview"],[data-view="days"],[data-view="map"],[data-view="ideas"],[data-view="stays"],[data-view="budget"],[data-view="check"]) > .save {
  position: static;
  align-self: flex-start;
  max-width: calc(100% - 40px);
  margin: 6px 20px calc(16px + env(safe-area-inset-bottom));
  color: #475571;
  background: transparent;
  padding: 4px 0;
  overflow-wrap: anywhere;
}

.app[data-view="days"].has-shared-trip > .save {
  position: sticky;
  bottom: calc(10px + env(safe-area-inset-bottom));
  padding: 7px 11px;
  border: 1px solid #d6e1f8;
  background: #eef3ff;
  color: #143a87;
  opacity: 1;
  box-shadow: 0 3px 10px #18254810;
}

.travel-surface {
  --paper: #faf8f3;
  --tile: #fffdf9;
  --travel-line: #ebe6df;
  --travel-shadow: 0 3px 10px #18254810;
  --travel-gutter: max(clamp(13px, 4.3vw, 25px), env(safe-area-inset-left), env(safe-area-inset-right));
  color: #101a30;
  overflow-wrap: anywhere;
}

.travel-surface button { color: inherit; }
.travel-surface .btn { min-height: 44px; }
.travel-surface .btn.primary { color: white; }
.travel-surface button:disabled { opacity: .4; cursor: default; }
.travel-surface :is(button, a, summary):focus-visible {
  outline: 2px solid #075de0;
  outline-offset: 2px;
}

.travel-cover, .travel-day-cover {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--accent);
  color: white;
}

.travel-cover {
  min-height: clamp(389px, 116vw, 521px);
  padding: calc(16px + env(safe-area-inset-top)) var(--travel-gutter) 27px;
}

.travel-cover > img, .travel-day-cover > img,
.travel-cover::before, .travel-day-cover::before {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.travel-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.travel-photo[hidden] { display: none; }
.travel-cover > img { top: 20%; height: 75%; object-position: center; }
.travel-cover::before, .travel-day-cover::before { content: ""; z-index: 0; pointer-events: none; }
.travel-cover::before {
  background: linear-gradient(180deg,#002fa7 19%,#002fa7a6 25%,transparent 40%,transparent 66%,#142c6059 81%,#546f9c9e 90%,#b9c3d4 96%);
}
.travel-cover-top, .travel-cover-meta, .travel-day-controls, .travel-day-title { position: relative; }
.travel-brand { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; letter-spacing: .025em; min-height: 40px; padding-right: 48px; }
.travel-brand img { border-radius: 10px; }
.travel-cover-top h1 {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  margin: 9px 0 5px;
  padding-right: 42px;
  font-size: clamp(29px, 9.2vw, 51px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.055em;
}
.travel-cover-top p, .travel-cover-meta p { margin: 5px 0 0; font-size: 14px; line-height: 1.45; font-weight: 600; }
.travel-cover-top p, .travel-cover-meta { text-shadow: 0 1px 5px #00153b; }
.travel-cover-meta .travel-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #ffffffe0;
  background: #062761e8;
  border-radius: 30px;
  padding: 5px 10px;
}
.travel-date-pill svg { width: 16px; height: 16px; flex: 0 0 16px; }
.travel-icon-button {
  width: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
}
.travel-cover-top .travel-icon-button {
  position: absolute;
  right: 0;
  top: 0;
  background: #0724648c;
  border: 1px solid #ffffff42;
}
.travel-cover-top .travel-icon-button svg, .travel-day-controls svg { width: 21px; height: 21px; }

.travel-shortcuts {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 7px;
  padding: 0 var(--travel-gutter);
  margin-top: -12px;
  isolation: isolate;
}
.travel-shortcuts::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12px 0 0;
  background: linear-gradient(#b9c3d4,#e7e6e9 45%,var(--paper));
}
.travel-shortcuts button {
  min-height: 78px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  background: var(--tile);
  border: 1px solid #fff;
  border-radius: 15px;
  box-shadow: var(--travel-shadow);
  font-size: clamp(12px, 3.35vw, 15px);
  font-weight: 700;
  padding: 6px 3px;
}
.travel-shortcuts svg { width: 24px; height: 24px; color: var(--accent); }
.travel-shortcuts button:active, .travel-city-row:active { background: #edf2ff; }
.travel-progress {
  margin: 13px var(--travel-gutter) 14px;
  padding: 11px 14px;
  background: var(--tile);
  border: 1px solid var(--travel-line);
  border-radius: 18px;
  box-shadow: var(--travel-shadow);
}
.travel-progress div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.travel-progress h2, .travel-day-heading h2, .travel-day-note h2 { margin: 0; font-size: 16px; }
.travel-progress strong { font-size: 14px; color: var(--accent); }
.travel-progress p { margin: 0; font-size: 13px; }
.travel-progress progress {
  display: block;
  width: 100%;
  height: 8px;
  margin: 6px 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #dbe5f8;
  accent-color: var(--accent);
}
.travel-progress progress::-webkit-progress-bar { background: #dbe5f8; }
.travel-progress progress::-webkit-progress-value { background: var(--accent); border-radius: 20px; }
.travel-progress progress::-moz-progress-bar { background: var(--accent); border-radius: 20px; }
.travel-home-services { padding: 0 var(--travel-gutter) 3px; }
.travel-home-services .card { padding: 14px; margin-bottom: 10px; border-radius: 16px; }
.travel-home-services .card h2 { font-size: 19px; margin: 6px 0; }
.travel-home-services .card h3 { font-size: 16px; }
.travel-home-services > .btn { min-height: 44px; }

.travel-topbar {
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) 44px;
  align-items: center;
  min-height: 75px;
  padding: calc(6px + env(safe-area-inset-top)) var(--travel-gutter) 17px;
  background: var(--accent);
  color: white;
}
.travel-topbar h1 { font-size: 23px; margin: 0; text-align: center; letter-spacing: .045em; }
.travel-topbar button:first-child { justify-self: start; }
.travel-topbar button:last-child { justify-self: end; }
.travel-paper {
  position: relative;
  border-radius: 22px 22px 0 0;
  margin-top: -15px;
  padding: 12px var(--travel-gutter) 10px;
  background: var(--paper);
}
.travel-segments { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-bottom: 13px; }
.travel-segments button, .travel-day-strip button {
  background: #f0ede8;
  min-height: 44px;
  border: 0;
  border-radius: 32px;
  font-size: 14px;
  font-weight: 750;
  padding: 6px 4px;
}
.travel-segments [aria-pressed="true"], .travel-day-strip [aria-current] { background: var(--accent); color: white; }
.travel-city-list { display: grid; gap: 7px; }
.travel-city-row {
  display: grid;
  grid-template-columns: minmax(0,35%) minmax(0,1fr) 18px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  min-height: 91px;
  padding: 4px 8px 4px 4px;
  border-radius: 14px;
  border: 1px solid var(--travel-line);
  background: var(--tile);
  box-shadow: 0 2px 4px #18254807;
  text-align: left;
}
.travel-city-media, .travel-stop-media { display: grid; place-items: center; position: relative; overflow: hidden; background: #e6edfb; color: var(--accent); }
.travel-city-media { aspect-ratio: 3/2; border-radius: 10px; }
.travel-city-media img, .travel-stop-media img { position: absolute; inset: 0; }
.travel-placeholder { display: grid; place-items: center; }
.travel-city-content { display: grid; line-height: 1.25; font-size: 13px; }
.travel-city-content strong { font-size: clamp(17px, 5vw, 21px); }
.travel-city-content > span { color: #43516a; }
.travel-city-content .travel-city-date { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-weight: 650; color: #17213a; }
.travel-city-date svg { width: 16px; height: 16px; color: var(--accent); flex: 0 0 16px; }
.travel-city-row > svg { width: 17px; height: 17px; }
.travel-restore { margin-top: 13px; min-height: 44px; }

.travel-day-cover { min-height: clamp(238px, 69vw, 340px); }
.travel-day-cover > img { object-position: center 40%; }
.travel-day-cover::before {
  background: linear-gradient(180deg,#0824507d,transparent 37%,#0b224720 50%,#091d39ef 93%);
}
.travel-day-controls { display: flex; justify-content: space-between; padding: calc(11px + env(safe-area-inset-top)) var(--travel-gutter) 0; }
.travel-day-controls button { background: #0b204477; }
.travel-day-title { padding: 42px var(--travel-gutter) 30px; text-shadow: 0 2px 8px #041b42; }
.travel-day-title h1 { margin: 2px 0 0; line-height: 1.03; font-size: clamp(32px, 9vw, 51px); letter-spacing: -.035em; }
.travel-day-title p { margin: 3px 0; font-size: 16px; font-weight: 680; }
.travel-day-strip {
  display: flex;
  gap: 7px;
  padding: 2px 2px 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.travel-day-strip button {
  flex: 0 0 calc((100% - 28px)/5);
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 46px;
  border-radius: 12px;
}
.travel-day-strip button span { font-size: 12px; font-weight: 600; }
.travel-day-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 3px; }
.travel-order-toggle {
  border: 0;
  border-radius: 9px;
  min-height: 44px;
  padding: 5px 2px 5px 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 720;
  color: var(--accent) !important;
  flex: 0 0 auto;
}
.travel-timeline { --dot-center: 20px; padding: 0; margin: 0 0 8px; list-style: none; }
.travel-timeline-row {
  display: grid;
  grid-template-columns: 52px minmax(0,1fr);
  position: relative;
}
.travel-time { padding: calc(var(--dot-center) - 7px) 12px 0 0; font-size: 12px; font-weight: 700; line-height: 1.3; text-align: right; font-variant-numeric: tabular-nums; }
.travel-stop { position: relative; min-width: 0; border-left: 2px solid #124bd3; padding-left: 10px; }
.travel-stop::before {
  content: "";
  position: absolute;
  top: calc(var(--dot-center) - 5.5px);
  left: -6px;
  width: 7px;
  height: 7px;
  background: var(--paper);
  border: 2px solid var(--accent);
  border-radius: 50%;
}
.travel-timeline-row:first-child .travel-stop { border-image: linear-gradient(transparent var(--dot-center),#124bd3 var(--dot-center)) 1; }
.travel-timeline-row:last-child .travel-stop { border-image: linear-gradient(#124bd3 var(--dot-center),transparent var(--dot-center)) 1; }
.travel-timeline-row:only-child .travel-stop { border-color: transparent; border-image: none; }
.travel-stop-edit {
  display: grid;
  align-items: start;
  grid-template-columns: clamp(54px, 15.5vw, 74px) minmax(0,1fr);
  gap: 9px;
  width: 100%;
  min-height: 54px;
  text-align: left;
  padding: 4px 1px 3px 0;
  border: 0;
  background: transparent;
}
.travel-stop-media { aspect-ratio: 4/3; border-radius: 9px; }
.travel-stop-copy { display: grid; align-self: center; gap: 3px; color: #40506a; font-size: 13px; line-height: 1.32; }
.travel-stop-copy strong { font-size: 16px; color: #101a30; line-height: 1.2; }
.travel-stop-details, .travel-order-actions { border-bottom: 1px solid var(--travel-line); font-size: 12px; color: #475571; }
.travel-stop-details .actions { margin: 0 0 8px; }
.travel-stop-details .btn, .travel-order-actions .btn { min-height: 44px; min-width: 44px; }
.travel-stop-details a { display: inline-flex; align-items: center; text-decoration: none; }
.travel-order-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 7px; }
.travel-add-stop.btn.primary {
  min-height: 44px;
  margin: 4px 0 12px;
  padding: 8px 15px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  box-shadow: 0 2px 6px #002fa729;
  font-size: 13px;
}
.travel-day-note { border-top: 1px solid var(--travel-line); padding: 12px 0; }
.travel-day-note p { white-space: pre-wrap; font-size: 14px; color: #43516a; margin: 5px 0 0; }

@media (min-width: 751px) {
  .travel-city-row { grid-template-columns: 132px minmax(0,1fr) 20px; }
  .travel-day-strip button { flex-basis: calc((100% - 49px)/8); }
}
@media (max-width: 365px) {
  .travel-city-row { gap: 8px; }
  .travel-day-strip button { flex-basis: calc((100% - 21px)/4); }
  .travel-timeline-row { grid-template-columns: 44px minmax(0,1fr); }
}
@media print {
  .travel-surface { display: none; }
}

/* Keep the extra actions at the edge of each compact timeline row. */
.travel-stop { padding-bottom: 1px; }
.travel-stop-edit.with-details { padding-right: 43px; }
.travel-stop-details summary {
  position: absolute;
  top: 3px;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  list-style: none;
  cursor: pointer;
}
.travel-stop-details summary::-webkit-details-marker { display: none; }
.travel-stop-details summary svg { width: 18px; height: 18px; }
.travel-stop-details[open] summary { background: #e4eaf6; color: var(--accent); }
