* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, "Segoe UI", sans-serif;
  background: #cfe8f7;
  color: #142033;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: #14395f;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button.secondary,
.chip {
  border: 1px solid rgba(20, 57, 95, 0.22);
  background: #fff;
  color: #14395f;
}

.link-button {
  min-height: auto;
  padding: 4px 0;
  background: transparent;
  color: #0c5f69;
  box-shadow: none;
  font-size: 0.9rem;
  text-decoration: underline;
}

.link-button:hover,
.link-button:focus-visible {
  color: #14395f;
  outline: none;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(20, 57, 95, 0.2);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: #142033;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(20, 57, 95, 0.2);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: #142033;
}

.app-shell {
  min-height: 100vh;
  padding: 14px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.62), transparent 25%),
    linear-gradient(135deg, #f3e6c5, #bfe4f8 56%, #95d1ef);
}

.auth-mode .app-shell {
  display: grid;
  align-content: start;
  background:
    linear-gradient(rgba(222, 241, 248, 0.16), rgba(246, 250, 252, 0.34)),
    linear-gradient(135deg, #f3e6c5, #bfe4f8 56%, #95d1ef);
}

.auth-mode .topbar {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1500px;
  margin: 0 auto 12px;
}

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

.brand-logo {
  display: block;
  width: clamp(96px, 10vw, 156px);
  height: clamp(96px, 10vw, 156px);
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: contain;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: clamp(96px, 10vw, 156px);
  height: clamp(96px, 10vw, 156px);
  flex: 0 0 auto;
  border: 1px solid rgba(20, 57, 95, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(204, 235, 245, 0.78)),
    #fff;
  color: #14395f;
  box-shadow: 0 10px 24px rgba(24, 46, 62, 0.12);
  font-size: clamp(0.92rem, 1.3vw, 1.2rem);
  font-weight: 900;
}

.brand-text {
  min-width: 0;
  max-width: min(68vw, 780px);
}

.eyebrow {
  margin: 0 0 2px;
  color: #0c5f69;
  font-size: clamp(0.72rem, 1vw, 0.9rem);
  font-weight: 900;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  color: #0f2f4f;
  font-size: clamp(1.08rem, 2.05vw, 1.82rem);
  line-height: 1.08;
  white-space: nowrap;
  transform-origin: left center;
  text-shadow: 0 4px 14px rgba(15, 47, 79, 0.12);
  animation: headerStoryPulse 4.8s ease-in-out infinite;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-label {
  max-width: 220px;
  overflow: hidden;
  color: #14395f;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-view {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 28px);
  padding: 7vh 0;
}

.landing-brand {
  display: grid;
  align-content: end;
  justify-items: center;
  width: min(94vw, 820px);
  min-height: min(78vh, 720px);
  border-radius: 8px;
  padding: 34px 28px;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.78), transparent 26%),
    linear-gradient(135deg, #eef8fb, #ffffff 45%, #d1edf7);
  box-shadow: 0 16px 36px rgba(24, 46, 62, 0.14);
  text-align: center;
}

.destination-entry .landing-brand {
  display: none;
}

.landing-logo {
  display: block;
  width: min(58vw, 310px);
  aspect-ratio: 1;
  object-fit: contain;
}

.landing-brand p,
.landing-name {
  margin: 12px 0 5px;
  color: #0c5f69;
  font-size: clamp(1.18rem, 2.5vw, 1.7rem);
  font-weight: 900;
  text-transform: uppercase;
}

.landing-brand h2 {
  max-width: 520px;
  margin: 10px 0 0;
  color: #0f2f4f;
  font-size: clamp(1.08rem, 1.85vw, 1.35rem);
  line-height: 1.18;
  font-weight: 900;
}

.journey-animation {
  position: relative;
  width: min(100%, 760px);
  height: auto;
  aspect-ratio: 760 / 430;
  margin: 0 auto 16px;
  overflow: hidden;
}

.world-landing-map {
  border: 1px solid rgba(20, 57, 95, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.74), transparent 28%),
    linear-gradient(135deg, #cfe8f7, #f8fcff 52%, #b7e0ee);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68);
}

.world-land {
  fill: rgba(20, 57, 95, 0.14);
  stroke: rgba(20, 57, 95, 0.2);
  stroke-width: 2;
}

.landing-route-animation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.landing-route {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 8 11;
  opacity: 0.3;
  animation: routeDash 1.25s linear infinite;
}

.route-plane {
  stroke: #ef3b3b;
}

.route-limo {
  stroke: #e6a700;
}

.route-kayak {
  stroke: #0c8f8f;
}

.route-cable {
  stroke: #218a36;
}

.route-hike {
  stroke: #7651d6;
}

.route-cruise {
  stroke: #0b7285;
}

.route-gold {
  stroke: #d9a106;
}

.route-teal {
  stroke: #0b7285;
}

.route-coral {
  stroke: #e56b45;
}

.route-violet {
  stroke: #7651d6;
}

.route-stop {
  fill: #fff;
  stroke: #14395f;
  stroke-width: 2;
  filter: drop-shadow(0 2px 4px rgba(8, 22, 36, 0.18));
}

.route-label {
  fill: #14395f;
  font-size: 12px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 4px;
  text-anchor: middle;
}

.route-label-halong {
  text-anchor: end;
}

.landing-vehicle {
  font-size: 27px;
  filter: drop-shadow(0 5px 6px rgba(8, 22, 36, 0.28));
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
  transform: translate(-15px, 10px);
}

.vehicle-limo,
.vehicle-kayak,
.vehicle-cable,
.vehicle-hike,
.vehicle-cruise {
  font-size: 25px;
  transform: translate(-14px, 10px);
}

.landing-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.landing-actions a {
  min-width: 142px;
  border: 1px solid rgba(20, 57, 95, 0.18);
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.88);
  color: #14395f;
  box-shadow: 0 10px 24px rgba(24, 46, 62, 0.14);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.landing-actions a:hover,
.landing-actions a:focus-visible {
  background: #14395f;
  color: #fff;
  outline: 3px solid rgba(20, 57, 95, 0.18);
}

.policy-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.72), transparent 24%),
    linear-gradient(135deg, #f3e6c5, #bfe4f8 56%, #95d1ef);
}

.policy-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 28px 16px 54px;
}

.policy-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 36px rgba(24, 46, 62, 0.14);
}

.policy-home {
  display: grid;
  place-items: center;
  width: clamp(96px, 14vw, 150px);
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.policy-home img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.policy-hero h1 {
  margin: 4px 0 8px;
  color: #0f2f4f;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.98;
}

.policy-hero p {
  max-width: 620px;
  margin: 0;
  color: #31506b;
  font-size: clamp(1rem, 1.7vw, 1.14rem);
  font-weight: 700;
}

.policy-card {
  padding: clamp(22px, 4vw, 42px);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 36px rgba(24, 46, 62, 0.12);
}

.policy-card p,
.policy-card li,
.policy-card address {
  color: #24384e;
  font-size: 1rem;
  line-height: 1.68;
}

.policy-card a {
  color: #0c5f69;
  font-weight: 900;
}

.policy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.policy-meta p {
  margin: 0;
  border: 1px solid rgba(20, 57, 95, 0.14);
  border-radius: 999px;
  padding: 8px 14px;
  background: #f3fbff;
  color: #14395f;
  font-weight: 800;
}

.policy-section {
  padding-top: 18px;
  border-top: 1px solid rgba(20, 57, 95, 0.12);
}

.policy-section h2 {
  margin: 0 0 10px;
  color: #0f2f4f;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.policy-section h3 {
  margin: 18px 0 8px;
  color: #0c5f69;
  font-size: 1.08rem;
}

.policy-section h4 {
  margin: 14px 0 6px;
  color: #14395f;
  font-size: 0.98rem;
}

.policy-section ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px 18px;
  margin: 8px 0 14px;
  padding-left: 18px;
}

.policy-section address {
  margin: 10px 0 0;
  font-style: normal;
  font-weight: 700;
}

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 22px auto 0;
  color: rgba(20, 57, 95, 0.56);
  font-size: 0.82rem;
  font-weight: 800;
}

.site-footer a {
  color: #0c5f69;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #14395f;
  text-decoration: underline;
  outline: none;
}

.app-footer {
  position: relative;
  z-index: 2;
  margin: 12px auto 18px;
}

.auth-popover {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 20;
  width: min(340px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
}

.auth-popover::before {
  content: "";
  position: fixed;
  inset: -100vh -100vw;
  z-index: -1;
  background: rgba(7, 18, 30, 0.48);
  backdrop-filter: blur(4px);
}

.auth-close {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  border-radius: 50%;
  padding: 0;
  background: #eef6fb;
  color: #14395f;
  font-size: 22px;
  line-height: 1;
}

.reset-shell {
  display: grid;
  place-items: center;
}

.reset-panel {
  width: min(380px, calc(100vw - 28px));
}

.reset-logo {
  display: block;
  width: 150px;
  margin: 0 auto 8px;
}

.reset-login-link {
  color: #0c5f69;
  font-weight: 800;
  text-align: center;
}

.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.72), transparent 24%),
    linear-gradient(135deg, #f3e6c5, #bfe4f8 56%, #95d1ef);
}

.admin-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 22px 14px 46px;
}

.admin-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 30px rgba(24, 46, 62, 0.13);
}

.admin-header img {
  width: 104px;
  height: 104px;
  object-fit: contain;
}

.admin-header h1 {
  margin: 0;
  color: #0f2f4f;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.admin-logout {
  border: 1px solid rgba(20, 57, 95, 0.16);
  border-radius: 999px;
  padding: 9px 14px;
  background: #fff;
  color: #14395f;
  font-weight: 800;
  text-decoration: none;
}

.admin-login-panel {
  display: grid;
  gap: 12px;
  width: min(390px, 100%);
  margin: 10vh auto 0;
  padding: 20px;
}

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

.admin-stats article {
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(24, 46, 62, 0.12);
}

.admin-stats strong {
  display: block;
  color: #0f2f4f;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.admin-stats span {
  color: #5c6f83;
  font-weight: 800;
}

.admin-table-panel {
  padding: 18px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(20, 57, 95, 0.12);
  padding: 11px 12px;
  text-align: left;
}

.admin-table th {
  color: #14395f;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.admin-table td {
  color: #24384e;
}

.admin-share-links {
  display: grid;
  gap: 5px;
  min-width: 180px;
}

.admin-share-links a {
  width: fit-content;
  color: #0c5c8f;
  font-weight: 800;
  text-decoration: none;
}

.admin-share-links a:hover {
  text-decoration: underline;
}

.admin-muted {
  color: #7b8794;
  font-size: 0.92rem;
}

.admin-settings-form {
  display: grid;
  gap: 14px;
}

.admin-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.admin-setting-row strong {
  display: block;
  color: #14395f;
  font-size: 1rem;
}

.admin-setting-row p {
  margin: 5px 0 0;
  color: #55677c;
  line-height: 1.45;
}

.admin-setting-toggle {
  justify-self: end;
}

.auth-popover.auth-panel {
  gap: 10px;
  padding: 16px;
}

.auth-popover h2 {
  padding-right: 34px;
  font-size: 1rem;
}

.auth-popover input {
  min-height: 38px;
  padding: 8px 10px;
}

.auth-popover button[type="submit"] {
  min-height: 36px;
}

.terms-confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(20, 57, 95, 0.12);
  border-radius: 8px;
  padding: 8px;
  background: #f6fbff;
}

.terms-confirm span {
  color: #526a80;
  font-size: 0.84rem;
  font-weight: 800;
}

.terms-state.is-pending {
  color: #b4232a;
}

.terms-state.is-accepted {
  color: #0f7c83;
}

.terms-confirm button {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.panel {
  border: 1px solid rgba(20, 57, 95, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 35px rgba(24, 46, 62, 0.14);
}

.auth-panel,
.trip-form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.panel h2 {
  margin: 0;
  color: #14395f;
  font-size: 1.1rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  gap: 14px;
  max-width: 1500px;
  margin: 0 auto;
}

.planner {
  display: grid;
  align-content: start;
  gap: 12px;
}

.shared-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
}

.shared-mode .planner {
  display: none;
}

.shared-mode .route-area {
  max-width: 980px;
  width: 100%;
  justify-self: center;
}

.panel-head,
.row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-head {
  padding: 16px 16px 0;
}

.row-title span {
  color: #14395f;
  font-weight: 900;
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 5px;
  color: #415468;
  font-size: 0.86rem;
  font-weight: 800;
}

.destination-grid,
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border-radius: 8px;
  padding: 7px 10px;
  color: #14395f;
  font-weight: 800;
}

.chip.is-selected {
  background: #14395f;
  color: #fff;
}

.chip .dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--chip-color, #14395f);
}

.suggestion {
  align-items: flex-start;
  max-width: 100%;
  text-align: left;
}

.suggestion small {
  display: block;
  color: inherit;
  font-weight: 600;
  opacity: 0.8;
}

.duration-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.duration-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 98px 98px 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(20, 57, 95, 0.12);
  border-radius: 8px;
  padding: 8px;
  background: rgba(246, 251, 255, 0.9);
}

.duration-stop {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.duration-row strong {
  min-width: 0;
  overflow: hidden;
  color: #14395f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duration-stop small,
.hotspot-label small {
  color: inherit;
  font-size: 0.78em;
  font-weight: 800;
  opacity: 0.78;
}

.hotspot-label span,
.hotspot-label small {
  display: block;
}

.duration-row input {
  min-width: 0;
  min-height: 32px;
  border-radius: 6px;
  padding: 4px;
  text-align: center;
}

.duration-stepper {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 26px;
  gap: 4px;
  align-items: center;
}

.duration-stepper span {
  grid-column: 1 / -1;
  color: #5c6f83;
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.duration-stepper button {
  display: grid;
  place-items: center;
  min-width: 26px;
  min-height: 32px;
  border-radius: 6px;
  padding: 0;
  background: #eef6fb;
  color: #14395f;
  font-size: 1rem;
  line-height: 1;
}

.duration-stepper button:hover,
.duration-stepper button:focus-visible {
  background: #14395f;
  color: #fff;
  outline: none;
}

.stop-journal-input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid rgba(20, 57, 95, 0.16);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #142033;
  font: inherit;
  font-size: 0.9rem;
}

.stop-journal-input:focus {
  border-color: #0c5f69;
  outline: 3px solid rgba(12, 95, 105, 0.14);
}

.remove-stop {
  display: grid;
  place-items: center;
  min-width: 38px;
  padding: 0;
  background: #b4232a;
}

.status {
  min-height: 18px;
  margin: 0;
  color: #5c6f83;
  font-size: 0.9rem;
  font-weight: 700;
}

.status.is-pending {
  color: #b4232a;
}

.status.is-accepted {
  color: #13845b;
}

.share-box {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(20, 57, 95, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: #f6fbff;
}

.share-box span {
  color: #14395f;
  font-size: 0.84rem;
  font-weight: 900;
}

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

.trip-list-panel,
.admin-code-panel,
.stats-panel {
  padding: 16px;
}

.admin-code-panel {
  display: grid;
  gap: 10px;
}

.admin-code-form {
  display: grid;
  gap: 8px;
}

.trip-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.trip-list-panel {
  font-weight: 400;
}

.trip-list-panel h2 {
  font-weight: 400;
}

.trip-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
}

.trip-item {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid rgba(20, 57, 95, 0.13);
  background: #fff;
  color: #142033;
  font-weight: 400;
  text-align: left;
}

.trip-item strong,
.trip-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-item strong {
  font-weight: 400;
}

.trip-item span {
  color: #5c6f83;
  font-weight: 400;
}

.trip-item-menu {
  position: relative;
  align-self: center;
}

.trip-item-menu summary {
  list-style: none;
}

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

.trip-menu-button {
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  border: 1px solid rgba(20, 57, 95, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #14395f;
  box-shadow: 0 6px 14px rgba(24, 46, 62, 0.12);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
}

.trip-menu-button:hover,
.trip-menu-button:focus-visible {
  background: #14395f;
  color: #fff;
  outline: 3px solid rgba(20, 57, 95, 0.16);
}

.trip-menu-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 12;
  display: grid;
  min-width: 130px;
  border: 1px solid rgba(20, 57, 95, 0.16);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(24, 46, 62, 0.18);
}

.trip-menu-option {
  min-height: 34px;
  border-radius: 6px;
  padding: 7px 10px;
  background: transparent;
  color: #14395f;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
}

.trip-menu-option:hover,
.trip-menu-option:focus-visible {
  background: #eef6fb;
  color: #14395f;
  outline: none;
}

.trip-menu-option.danger {
  color: #b4232a;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.stats-grid span {
  border-radius: 8px;
  padding: 10px;
  background: #f6fbff;
  color: #415468;
}

.stats-grid strong {
  display: block;
  color: #14395f;
  font-size: 1.4rem;
}

.activity-list {
  display: grid;
  gap: 7px;
  max-height: 170px;
  overflow: auto;
  color: #415468;
  font-size: 0.86rem;
}

.route-area {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.map-stage {
  display: grid;
  place-items: center;
  width: 100%;
}

.map-scroller {
  width: 100%;
  display: grid;
  place-items: center;
  overflow: visible;
}

.map-wrap {
  position: relative;
  width: min(100%, calc((100vh - 92px) * 1122 / 1402), 1122px);
  aspect-ratio: 1122 / 1402;
  overflow: hidden;
  background: #d8edf8;
  box-shadow: 0 18px 50px rgba(24, 46, 62, 0.25);
}

.map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
}

.map-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  padding: 8%;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.72), transparent 22%),
    radial-gradient(circle at 72% 78%, rgba(247, 201, 72, 0.28), transparent 22%),
    linear-gradient(135deg, #d6eef8, #f8fbff 46%, #a9d7e8);
  color: rgba(20, 57, 95, 0.2);
  font-size: clamp(2.2rem, 8vw, 5.2rem);
  font-weight: 900;
  text-align: center;
}

.map-fallback::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 2px dashed rgba(20, 57, 95, 0.14);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.map[src=""],
.map.is-missing {
  opacity: 0;
}

.trip-dates {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: 4.5%;
  z-index: 3;
  width: fit-content;
  max-width: min(88%, 560px);
  border: 1px solid rgba(12, 31, 119, 0.16);
  border-radius: 999px;
  padding: 9px 18px;
  background: rgba(255, 255, 255, 0.92);
  color: #0c1f77;
  box-shadow: 0 10px 24px rgba(20, 32, 51, 0.18);
  font-size: clamp(13px, 1.15vw, 18px);
  font-weight: 900;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
}

.hotspots,
.route-animation {
  position: absolute;
  inset: 0;
}

.route-animation {
  z-index: 1;
  pointer-events: none;
}

.hotspots {
  z-index: 2;
}

.flight-intro {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 34px);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.2), transparent 34%),
    rgba(5, 19, 32, 0.5);
  backdrop-filter: blur(2px);
  animation: flightIntroIn 0.55s ease both;
}

.flight-intro[hidden] {
  display: none;
}

.flight-intro.is-leaving {
  animation: flightIntroOut 0.7s ease both;
}

.flight-intro-card {
  width: min(92%, 720px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  padding: clamp(14px, 2.4vw, 24px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(229, 246, 252, 0.88)),
    linear-gradient(135deg, #0d365f, #87c7dd);
  box-shadow: 0 26px 70px rgba(5, 19, 32, 0.42);
  color: #14395f;
}

.flight-intro-copy {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  text-align: center;
}

.flight-intro-copy span {
  color: #0b7f7a;
  font-size: clamp(0.72rem, 1.2vw, 0.9rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flight-intro-copy strong {
  color: #0d2f53;
  font-size: clamp(1.25rem, 3vw, 2.1rem);
  line-height: 1.08;
}

.flight-intro-copy small {
  color: #55677c;
  font-size: clamp(0.82rem, 1.4vw, 1rem);
}

.flight-intro-map {
  display: block;
  width: 100%;
  height: auto;
  overflow: hidden;
  border-radius: 8px;
  background: #cfe7f4;
}

.flight-world-map {
  opacity: 0.92;
  filter: saturate(1.05) contrast(1.02);
}

.flight-map-soften {
  fill: rgba(255, 255, 255, 0.18);
}

.flight-intro-route {
  fill: none;
  stroke: #6636b8;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 9 10;
  animation: routeDash 1.1s linear infinite;
}

.flight-intro-dot {
  fill: #fff;
  stroke-width: 5;
}

.origin-dot {
  stroke: #e72d75;
}

.vietnam-dot {
  stroke: #0b7f7a;
}

.flight-intro-label {
  fill: #14395f;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 5px;
  paint-order: stroke fill;
  font-size: 16px;
  font-weight: 900;
  text-anchor: middle;
}

.flight-intro-plane {
  fill: #14395f;
  stroke: #fff;
  stroke-width: 4px;
  paint-order: stroke fill;
  font-size: 30px;
  transform: translate(-15px, 10px);
}

.route-legend {
  position: absolute;
  right: 3.5%;
  top: 18%;
  z-index: 4;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(20, 57, 95, 0.13);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 28px rgba(24, 46, 62, 0.16);
  color: #14395f;
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.route-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.legend-line {
  width: 30px;
  height: 0;
  border-top: 4px dashed #6636b8;
}

.legend-line.route-car {
  border-color: #0b7f7a;
}

.legend-line.route-boat {
  border-color: #176fc4;
}

.legend-line.route-cablecar {
  border-style: solid;
  border-color: #e67700;
}

.route-line {
  fill: none;
  stroke: #14395f;
  stroke-width: 5;
  stroke-dasharray: 12 12;
  stroke-linecap: round;
  opacity: 0.72;
  animation: routeDash 1.4s linear infinite;
  filter: drop-shadow(0 2px 2px rgba(255, 255, 255, 0.72));
}

.route-line.route-international {
  stroke: #6636b8;
}

.route-line.route-arrival-flight {
  stroke-width: 5;
  stroke-dasharray: 12 13;
  opacity: 0.78;
}

.route-line.route-flight {
  stroke: #d7263d;
}

.route-line.route-car {
  stroke: #0b7f7a;
}

.route-line.route-transfer {
  stroke: #d19600;
  stroke-dasharray: none;
}

.route-line.route-boat {
  stroke: #176fc4;
}

.route-line.route-cablecar {
  stroke: #e67700;
  stroke-dasharray: none;
}

.route-vehicle {
  font-size: 34px;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  filter: drop-shadow(0 5px 5px rgba(8, 22, 36, 0.3));
  transform: translate(-17px, 11px);
}

.route-arrival-vehicle {
  font-size: 38px;
}

.arrival-origin-label {
  animation: arrivalLabelPulse 6.5s linear infinite;
  filter: drop-shadow(0 8px 14px rgba(8, 22, 36, 0.24));
  pointer-events: none;
}

.arrival-origin-label rect {
  fill: rgba(255, 255, 255, 0.94);
  stroke: rgba(102, 54, 184, 0.22);
  stroke-width: 2;
}

.arrival-origin-label text {
  fill: #0c1f77;
  font-size: 15px;
  font-weight: 900;
  text-anchor: middle;
}

@keyframes arrivalLabelPulse {
  0%,
  45% {
    opacity: 1;
  }
  55%,
  100% {
    opacity: 0;
  }
}

.origin-hotspot {
  width: clamp(42px, 4.6vw, 66px);
  height: clamp(42px, 4.6vw, 66px);
  font-size: clamp(10px, 0.85vw, 13px);
  text-transform: uppercase;
}

.origin-hotspot::before {
  content: "";
  position: absolute;
  inset: -13px;
  border: 2px dashed rgba(107, 53, 185, 0.48);
  border-radius: 50%;
  animation: originPulse 2.4s ease-in-out infinite;
}

.origin-label {
  min-width: 116px;
  transform: translate(22px, -50%);
}

.origin-label.label-left {
  transform: translate(calc(-100% - 22px), -50%);
  text-align: right;
}

.origin-label.label-right {
  transform: translate(22px, -50%);
}

.origin-label.label-up {
  transform: translate(-50%, calc(-100% - 22px));
  text-align: center;
}

.origin-label.label-down {
  transform: translate(-50%, 22px);
  text-align: center;
}

.origin-label.label-left.label-up {
  transform: translate(calc(-100% - 18px), calc(-100% - 18px));
}

.origin-label.label-left.label-down {
  transform: translate(calc(-100% - 18px), 18px);
}

.origin-label.label-right.label-up {
  transform: translate(18px, calc(-100% - 18px));
}

.origin-label.label-right.label-down {
  transform: translate(18px, 18px);
}

.marker-leader {
  stroke: rgba(20, 57, 95, 0.46);
  stroke-width: 2;
  stroke-dasharray: 4 5;
  stroke-linecap: round;
}

.hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(28px, 3.2vw, 50px);
  height: clamp(28px, 3.2vw, 50px);
  border: 3px solid #fff;
  border-radius: 50%;
  padding: 0;
  background: var(--spot-color, #14395f);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.72), 0 8px 20px rgba(8, 22, 36, 0.25);
  color: #fff;
  transform: translate(-50%, -50%);
}

.hotspot.has-avatar {
  width: clamp(38px, 4vw, 58px);
  height: clamp(38px, 4vw, 58px);
  border-width: 4px;
  background: #fff;
  box-shadow: 0 0 0 5px var(--spot-color, #14395f), 0 10px 24px rgba(8, 22, 36, 0.34);
}

.hotspot.animated-stop {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.78), transparent 24%),
    linear-gradient(135deg, var(--spot-color, #14395f), #f7c948);
  animation: aiStopGlow 3s ease-in-out infinite;
}

.hotspot.has-ai-visual {
  animation: aiStopGlow 3.4s ease-in-out infinite;
}

.hotspot-avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}

.hotspot-number {
  position: absolute;
  left: -9px;
  bottom: -9px;
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--spot-color, #14395f);
  color: #fff;
  box-shadow: 0 4px 12px rgba(8, 22, 36, 0.25);
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.hotspot.has-photos::after {
  content: attr(data-photo-count);
  position: absolute;
  right: -8px;
  top: -10px;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #f7c948;
  color: #172033;
  font-size: 12px;
  font-weight: 900;
}

.hotspot-label {
  position: absolute;
  max-width: 132px;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-left: 5px solid var(--spot-color, #14395f);
  border-radius: 7px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #14395f;
  box-shadow: 0 6px 16px rgba(8, 22, 36, 0.22);
  font-size: clamp(10px, 0.95vw, 13px);
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
  text-align: left;
  transform: translate(18px, -50%);
  backdrop-filter: blur(5px);
}

.hotspot-label.is-quiet {
  min-width: 0;
  max-width: 34px;
  min-height: 24px;
  border-left-width: 4px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  font-size: 0;
}

.hotspot-label.is-quiet span {
  display: none;
}

.hotspot-label.is-quiet small {
  display: none;
}

.hotspot-label.is-quiet::before {
  content: "i";
  color: #14395f;
  font-size: 12px;
  font-weight: 900;
}

.hotspot-label.is-quiet:hover,
.hotspot-label.is-quiet:focus-visible {
  max-width: 142px;
  padding: 4px 8px;
  border-radius: 7px;
  background: #fff;
  font-size: clamp(10px, 0.95vw, 13px);
}

.hotspot-label.is-quiet:hover::before,
.hotspot-label.is-quiet:focus-visible::before {
  content: "";
}

.hotspot-label.is-quiet:hover span,
.hotspot-label.is-quiet:hover small,
.hotspot-label.is-quiet:focus-visible span,
.hotspot-label.is-quiet:focus-visible small {
  display: block;
}

.hotspot-label:hover,
.hotspot-label:focus-visible {
  background: #fff;
  outline: 2px solid var(--spot-color, #14395f);
}

.journal-preview {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  z-index: 18;
  width: min(250px, 44vw);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.78);
  color: #14395f;
  box-shadow: 0 16px 36px rgba(8, 22, 36, 0.22);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: normal;
  backdrop-filter: blur(12px);
}

.mobile-stop.has-journal {
  position: relative;
}

.mobile-stop .journal-preview {
  left: auto;
  right: 8px;
  bottom: calc(100% + 8px);
  width: min(260px, calc(100vw - 44px));
  transform: translate(0, 8px);
}

.mobile-stop.has-journal:hover .journal-preview,
.mobile-stop.has-journal:focus-visible .journal-preview {
  transform: translate(0, 0);
}

.journal-preview::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 12px;
  height: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.78);
  transform: translate(-50%, -6px) rotate(45deg);
}

.has-journal:hover .journal-preview,
.has-journal:focus-visible .journal-preview,
.has-journal:focus-within .journal-preview {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hotspot-label .journal-preview {
  left: 0;
  bottom: calc(100% + 10px);
  transform: translate(0, 8px);
}

.hotspot-label.has-journal:hover .journal-preview,
.hotspot-label.has-journal:focus-visible .journal-preview {
  transform: translate(0, 0);
}

.mobile-stops {
  display: none;
}

.quote-request {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.quote-copy h2,
.quote-copy p {
  margin: 0;
}

.quote-copy {
  display: grid;
  gap: 4px;
}

.quote-copy p {
  color: #526a80;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

.quote-toggle {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 9px;
  color: #14395f;
  font-size: 0.92rem;
  font-weight: 900;
  cursor: pointer;
}

.quote-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #c8d7e4;
  box-shadow: inset 0 0 0 1px rgba(20, 57, 95, 0.18);
  transition: background 0.2s ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(8, 22, 36, 0.24);
  transition: transform 0.2s ease;
}

.quote-toggle input:checked + .toggle-track {
  background: #0f7c83;
}

.quote-toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.quote-toggle input:focus-visible + .toggle-track {
  outline: 3px solid rgba(15, 124, 131, 0.28);
  outline-offset: 3px;
}

.quote-options {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.quote-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid rgba(20, 57, 95, 0.14);
  border-radius: 8px;
  padding: 7px 10px;
  background: #f6fbff;
  color: #14395f;
  font-size: 0.9rem;
  font-weight: 900;
}

.quote-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 57, 95, 0.1), 0 3px 10px rgba(24, 46, 62, 0.12);
  font-size: 16px;
  line-height: 1;
}

.quote-options input {
  width: 16px;
  height: 16px;
  accent-color: #0f7c83;
}

.lodging-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(20, 57, 95, 0.12);
  padding-top: 12px;
}

.lodging-group {
  display: grid;
  gap: 8px;
}

.lodging-group h3 {
  margin: 0;
  color: #102c4c;
  font-size: 1rem;
}

.quote-subtitle {
  margin: -3px 0 0;
  color: #526a80;
  font-size: 0.86rem;
  font-weight: 800;
}

.lodging-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.lodging-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(20, 57, 95, 0.13);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(24, 46, 62, 0.08);
}

.lodging-card strong {
  color: #102c4c;
  line-height: 1.22;
}

.lodging-card span {
  color: #0f7c83;
  font-size: 0.88rem;
  font-weight: 900;
}

.lodging-card small {
  color: #526a80;
  font-size: 0.82rem;
  font-weight: 800;
}

.lodging-card a {
  color: #14395f;
  font-weight: 900;
}

.gallery {
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 70px rgba(8, 22, 36, 0.35);
}

.gallery::backdrop {
  background: rgba(7, 18, 30, 0.58);
}

.welcome-guide {
  width: min(520px, calc(100vw - 30px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: #14395f;
  box-shadow: 0 24px 70px rgba(8, 22, 36, 0.34);
}

.welcome-guide::backdrop {
  background: rgba(7, 18, 30, 0.54);
  backdrop-filter: blur(3px);
}

.terms-dialog {
  width: min(620px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: #14395f;
  box-shadow: 0 24px 70px rgba(8, 22, 36, 0.34);
}

.destination-dialog {
  width: min(430px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: #14395f;
  box-shadow: 0 24px 70px rgba(8, 22, 36, 0.34);
}

.destination-dialog::backdrop {
  background: rgba(7, 18, 30, 0.58);
  backdrop-filter: blur(3px);
}

.destination-content {
  display: grid;
  gap: 14px;
  padding: 30px;
}

.destination-content h2 {
  margin: 0 42px 4px 0;
  color: #102c4c;
  font-size: 1.55rem;
}

.destination-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.terms-dialog::backdrop {
  background: rgba(7, 18, 30, 0.58);
  backdrop-filter: blur(3px);
}

.terms-content {
  display: grid;
  gap: 14px;
  padding: 30px;
}

.terms-content h2 {
  margin: 0 42px 0 0;
  color: #102c4c;
  font-size: 1.55rem;
}

.terms-scroll {
  max-height: min(30vh, 210px);
  overflow: auto;
  border: 1px solid rgba(20, 57, 95, 0.14);
  border-radius: 8px;
  padding: 14px;
  background: #f6fbff;
  color: #3e536a;
  line-height: 1.5;
}

.terms-scroll p {
  margin: 0 0 12px;
}

.terms-scroll h3 {
  margin: 16px 0 8px;
  color: #102c4c;
  font-size: 1rem;
}

.terms-scroll p:last-child {
  margin-bottom: 0;
}

.terms-agree {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #14395f;
  font-size: 0.95rem;
  font-weight: 900;
}

.terms-agree input {
  width: 18px;
  height: 18px;
  accent-color: #0f7c83;
}

.terms-agree input:disabled + span {
  opacity: 0.58;
}

.guide-close {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
}

.guide-content {
  padding: 30px;
}

.guide-kicker {
  display: block;
  margin-bottom: 8px;
  color: #0f7c83;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-content h2 {
  margin: 0 42px 18px 0;
  color: #102c4c;
  font-size: 30px;
  line-height: 1.08;
}

.guide-steps {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
  padding-left: 22px;
}

.guide-steps li {
  color: #3e536a;
  line-height: 1.45;
}

.guide-steps strong {
  color: #102c4c;
}

#startPlanningButton {
  width: 100%;
}

.close {
  position: sticky;
  top: 12px;
  float: right;
  z-index: 2;
  width: 40px;
  min-height: 40px;
  margin: 12px 12px 0 0;
  border-radius: 50%;
  padding: 0;
  background: #fff;
  color: #14395f;
  font-size: 28px;
  line-height: 1;
}

.welcome-guide .guide-close {
  position: absolute;
  top: 12px;
  right: 12px;
  float: none;
  margin: 0;
}

.gallery-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px;
  border-bottom: 1px solid rgba(30, 43, 58, 0.14);
}

.stop-number {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--stop-color, #1463c2);
  color: #fff;
  font-weight: 900;
}

.gallery-head h2,
.gallery-head p {
  margin: 0;
}

.gallery-head p {
  margin-top: 4px;
  color: #647083;
  white-space: pre-line;
}

.gallery-head .stop-journal-display {
  color: #4fb6e8;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  padding: 22px 24px 26px;
}

.photo {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(30, 43, 58, 0.14);
  border-radius: 8px;
  background: #fff;
}

.photo img,
.photo video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #101820;
}

.initial-visual-card {
  grid-column: 1 / -1;
}

.initial-visual-card img,
.animated-stop-visual {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: min(48vh, 420px);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.72), transparent 20%),
    radial-gradient(circle at 78% 76%, rgba(247, 201, 72, 0.5), transparent 22%),
    linear-gradient(135deg, var(--spot-color, #14395f), #77c6df);
}

.animated-stop-visual {
  color: #fff;
  font-size: clamp(1.8rem, 7vw, 4.5rem);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 4px 18px rgba(8, 22, 36, 0.42);
  animation: visualDrift 5s ease-in-out infinite alternate;
}

.photo video {
  object-fit: contain;
}

.photo figcaption {
  padding: 10px 12px;
  color: #647083;
  font-size: 0.92rem;
}

.media-comments {
  display: grid;
  gap: 9px;
  border-top: 1px solid rgba(20, 57, 95, 0.1);
  padding: 11px 12px 12px;
  background: #f7fbff;
}

.media-comments h4 {
  margin: 0;
  color: #14395f;
  font-size: 0.9rem;
  font-weight: 800;
}

.media-comment-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.media-comment {
  display: grid;
  gap: 2px;
  border-left: 3px solid #77c6df;
  padding-left: 8px;
}

.media-comment strong {
  color: #14395f;
  font-size: 0.78rem;
  font-weight: 800;
}

.media-comment p,
.media-comment-empty {
  margin: 0;
  color: #415468;
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.media-comment-delete {
  justify-self: start;
  min-height: 26px;
  margin-top: 3px;
  border: 1px solid rgba(180, 35, 42, 0.2);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.84);
  color: #b4232a;
  font-size: 0.76rem;
  font-weight: 800;
}

.media-comment-delete:hover,
.media-comment-delete:focus-visible {
  background: #b4232a;
  color: #fff;
  outline: none;
}

.media-comment-form {
  display: grid;
  gap: 7px;
}

.media-comment-form textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  border: 1px solid rgba(20, 57, 95, 0.16);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}

.media-comment-form button {
  justify-self: end;
  min-height: 34px;
  padding: 7px 12px;
}

.media-comment-status {
  min-height: 16px;
  font-size: 0.8rem;
}

.youtube-links {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(30, 43, 58, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.youtube-links h3 {
  margin: 0;
  color: #14395f;
  font-size: 1rem;
}

.youtube-link-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.youtube-link-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 68px;
  border: 1px solid rgba(20, 57, 95, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: #f6fbff;
  color: #142033;
  text-decoration: none;
}

.youtube-link-card:hover,
.youtube-link-card:focus-visible {
  border-color: rgba(196, 32, 32, 0.45);
  background: #fff;
  outline: 2px solid rgba(196, 32, 32, 0.18);
}

.youtube-play {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #c42020;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
}

.youtube-link-text {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.youtube-link-text strong,
.youtube-link-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youtube-link-text strong {
  color: #14395f;
  font-size: 0.94rem;
}

.youtube-link-text small {
  color: #647083;
  font-size: 0.82rem;
}

.delete-photo {
  position: absolute;
  right: 8px;
  top: 8px;
  min-height: 32px;
  padding: 5px 10px;
  background: #b4232a;
  font-size: 0.85rem;
}

.empty {
  grid-column: 1 / -1;
  padding: 36px 20px;
  border: 1px dashed rgba(30, 43, 58, 0.22);
  border-radius: 8px;
  text-align: center;
  color: #647083;
}

.admin-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid rgba(30, 43, 58, 0.14);
  background: rgba(235, 245, 255, 0.88);
}

.upload-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.upload-form input[type="password"] {
  width: 150px;
}

.upload-form input[type="file"] {
  max-width: min(100%, 280px);
}

@keyframes routeDash {
  to {
    stroke-dashoffset: -21;
  }
}

@keyframes flightIntroIn {
  from {
    opacity: 0;
    transform: scale(1.015);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes flightIntroOut {
  to {
    opacity: 0;
    transform: scale(0.985);
  }
}

@keyframes headerStoryPulse {
  0%,
  100% {
    transform: scale(1);
    letter-spacing: 0;
  }
  45% {
    transform: scale(1.045);
    letter-spacing: 0.01em;
  }
}

@keyframes originPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.12);
    opacity: 0.3;
  }
}

@keyframes aiStopGlow {
  0%,
  100% {
    filter: saturate(1);
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    filter: saturate(1.2);
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes visualDrift {
  from {
    background-position: 0% 0%, 100% 100%, 0 0;
  }
  to {
    background-position: 15% 10%, 82% 72%, 0 0;
  }
}

@media (max-width: 980px) {
  .welcome-guide {
    width: min(440px, calc(100vw - 24px));
  }

  .guide-content {
    padding: 24px 20px 20px;
  }

  .guide-content h2 {
    margin-right: 38px;
    font-size: 25px;
  }

  .guide-steps {
    gap: 10px;
    padding-left: 20px;
  }

  .terms-content {
    padding: 24px 20px 20px;
  }

  .terms-content h2 {
    margin-right: 38px;
    font-size: 1.3rem;
  }

  .terms-scroll {
    max-height: 34vh;
  }

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

  .planner {
    order: 2;
  }

  .route-area {
    order: 1;
  }

  .quote-request {
    grid-template-columns: 1fr;
  }

  .quote-toggle {
    justify-self: start;
  }

  .admin-setting-row {
    grid-template-columns: 1fr;
  }

  .admin-setting-toggle {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 6px;
  }

  .auth-mode .app-shell {
    background:
      linear-gradient(rgba(222, 241, 248, 0.16), rgba(246, 250, 252, 0.34)),
      linear-gradient(135deg, #f3e6c5, #bfe4f8 56%, #95d1ef);
  }

  .auth-view {
    min-height: calc(100svh - 12px);
    padding: 5vh 0;
  }

  .landing-brand {
    width: min(94vw, 420px);
    min-height: min(84svh, 620px);
    padding: 18px 14px 20px;
  }

  .landing-brand h2 {
    font-size: 0.92rem;
  }

  .policy-shell {
    padding: 12px 8px 32px;
  }

  .policy-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
    padding: 16px;
    text-align: center;
  }

  .policy-home {
    width: 132px;
  }

  .policy-card {
    padding: 20px 16px;
  }

  .policy-meta {
    display: grid;
  }

  .policy-meta p {
    border-radius: 8px;
  }

  .policy-section ul {
    grid-template-columns: 1fr;
  }

  .landing-brand p {
    font-size: 1.15rem;
  }

  .journey-animation {
    width: 100%;
    height: 108px;
    margin-bottom: 2px;
  }

  .landing-route {
    stroke-width: 3.5;
  }

  .landing-vehicle {
    font-size: 21px;
    transform: translate(-12px, 8px);
  }

  .route-label {
    font-size: 8.8px;
    stroke-width: 3px;
  }

  @media (max-height: 700px) {
    .landing-brand {
      min-height: min(90svh, 560px);
      padding-top: 16px;
    }

    .journey-animation {
      height: 92px;
    }
  }

  .topbar {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
  }

  .brand {
    justify-content: center;
    width: 100%;
    border: 1px solid rgba(20, 57, 95, 0.14);
    border-radius: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 22px rgba(24, 46, 62, 0.12);
    gap: 14px;
  }

  .brand-text {
    max-width: min(64vw, 320px);
  }

  .brand-logo {
    width: 104px;
    height: 104px;
  }

  .topbar h1 {
    font-size: clamp(0.72rem, 3.1vw, 0.9rem);
    line-height: 1.16;
  }

  .eyebrow {
    font-size: 0.68rem;
    line-height: 1.05;
  }

  .top-actions {
    justify-content: flex-end;
    gap: 6px;
  }

  .session-label {
    max-width: 74px;
    font-size: 0.78rem;
  }

  .top-actions button {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .auth-view {
    grid-template-columns: 1fr;
    padding: 4vh 0;
  }

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

  .admin-header,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-header {
    justify-items: center;
    text-align: center;
  }

  .trip-item-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .trip-menu-popover {
    right: 0;
  }

  .duration-row {
    grid-template-columns: minmax(0, 1fr) 92px 92px 38px;
  }

  .map-scroller {
    position: relative;
    width: 100%;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: visible;
    padding: 0;
  }

  .map-wrap {
    width: 100%;
    min-width: 0;
    max-width: 540px;
    aspect-ratio: 9 / 16;
    background: #687680;
  }

  .map {
    object-fit: contain;
  }

  .route-animation,
  .hotspots {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 1122 / 1402;
    transform: translateY(-50%);
  }

  .route-line {
    stroke-width: 7;
    opacity: 0.82;
  }

  .route-vehicle {
    font-size: 42px;
  }

  .hotspot {
    width: 36px;
    height: 36px;
  }

  .hotspot.has-avatar {
    width: 46px;
    height: 46px;
    border-width: 3px;
    box-shadow: 0 0 0 3px var(--spot-color, #14395f), 0 7px 16px rgba(8, 22, 36, 0.3);
  }

  .hotspot-number {
    left: -6px;
    bottom: -6px;
    min-width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .hotspot.has-photos::after {
    right: -6px;
    top: -7px;
    min-width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .hotspot-label {
    max-width: 118px;
    padding: 3px 7px;
    font-size: 11px;
  }

  .hotspot-label.is-quiet {
    display: none;
  }

  .route-legend {
    right: 18px;
    top: 12px;
    grid-template-columns: repeat(2, auto);
    gap: 6px 10px;
    padding: 8px 10px;
    font-size: 10px;
  }

  .legend-line {
    width: 22px;
    border-top-width: 3px;
  }

  .mobile-stops {
    display: block;
    padding: 14px 2px 6px;
  }

  .mobile-stops h2 {
    margin: 0 0 10px;
    color: #14395f;
    font-size: 1.1rem;
  }

  .mobile-stop-list {
    display: grid;
    gap: 8px;
  }

  .mobile-stop {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 60px;
    background: #fff;
    color: #142033;
    text-align: left;
  }

  .mobile-stop-number {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--spot-color);
    color: #fff;
    font-weight: 900;
  }

  .mobile-stop-text {
    display: grid;
    min-width: 0;
  }

  .mobile-stop-text strong,
  .mobile-stop-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-stop-text small {
    color: #647083;
  }

  .mobile-stop-count {
    justify-self: end;
    color: #14395f;
    font-weight: 900;
  }

  .gallery {
    width: 100vw;
    max-width: none;
    height: 100svh;
    max-height: none;
    border-radius: 0;
  }

  .photo-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .upload-form input[type="password"],
  .upload-form input[type="file"],
  .upload-form button {
    width: 100%;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .route-line,
  .landing-route,
  .landing-vehicle,
  .topbar h1 {
    animation: none;
  }
}
