:root {
  --doc-ink: #1d1d1f;
  --doc-secondary: #6e6e73;
  --doc-line: #d2d2d7;
  --doc-line-soft: #e8e8ed;
  --doc-canvas: #ffffff;
  --doc-canvas-soft: #f5f5f7;
  --doc-blue: #0066cc;
  --doc-blue-focus: #0071e3;
}

/* Apple-style itinerary document. This layer intentionally affects only delivery output. */
.itinerary-preview {
  background: var(--doc-canvas-soft);
}

.preview-toolbar {
  min-height: 58px;
  padding: 12px 18px;
  background: rgba(245, 245, 247, .92);
  border-bottom-color: var(--doc-line);
  backdrop-filter: saturate(180%) blur(20px);
}

.doc-dot {
  width: 7px;
  height: 7px;
  background: var(--doc-blue-focus);
}

.preview-tool-button {
  min-height: 34px;
  color: var(--doc-blue);
  background: rgba(0, 102, 204, .08);
  font-weight: 600;
}

.doc-badge {
  color: var(--doc-blue);
  background: rgba(0, 102, 204, .08);
}

.itinerary-document {
  color: var(--doc-ink);
  background: var(--doc-canvas);
  font-family: "SF Pro Text", "PingFang SC", "Microsoft YaHei UI", "Helvetica Neue", Arial, sans-serif;
}

.route-cover {
  position: relative;
  display: flex;
  min-height: 280px;
  align-items: flex-end;
  padding: 48px;
  overflow: hidden;
  color: #fff;
  background: #1d1d1f var(--hero-image) center 45% / cover no-repeat;
  border-bottom: 1px solid var(--doc-line);
}

.route-cover::before {
  position: absolute;
  top: 38px;
  left: 48px;
  content: "XINJIANG CUSTOM ITINERARY";
  z-index: 3;
  color: rgba(255, 255, 255, .76);
  background: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
}

.route-cover::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background: rgba(0, 0, 0, .38);
}

.route-cover strong {
  position: relative;
  z-index: 3;
  max-width: 820px;
  color: #fff;
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei UI", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -.045em;
}

.route-meta-row,
.route-client-brief {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--doc-canvas);
  border-bottom: 1px solid var(--doc-line);
}

.route-client-brief {
  background: var(--doc-canvas-soft);
}

.route-meta-row div,
.route-client-brief div {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 18px 22px;
  border-right: 1px solid var(--doc-line-soft);
}

.route-meta-row div:last-child,
.route-client-brief div:last-child {
  border-right: 0;
}

.route-meta-row span,
.route-client-brief span {
  color: var(--doc-secondary);
  font-size: 11px;
  font-weight: 400;
}

.route-meta-row strong,
.route-client-brief strong {
  overflow: hidden;
  color: var(--doc-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
}

.route-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--doc-canvas);
}

.route-table th {
  height: 50px;
  padding: 12px 20px;
  color: var(--doc-secondary);
  background: var(--doc-canvas-soft);
  border-bottom: 1px solid var(--doc-line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  text-align: left;
}

.route-table th:first-child,
.route-table td:first-child {
  width: 146px;
}

.route-table th:last-child,
.route-table td:last-child {
  width: 250px;
}

.route-table td {
  position: relative;
  padding: 22px 20px;
  color: var(--doc-ink);
  background: var(--doc-canvas);
  border-bottom: 1px solid var(--doc-line-soft);
  vertical-align: top;
}

.route-table tbody tr:nth-child(even) td {
  background: #fbfbfd;
}

.date-editable {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--doc-blue);
  background: rgba(0, 102, 204, .08);
  font-size: 13px;
  font-weight: 600;
}

.route-main {
  display: grid;
  gap: 7px;
}

.route-line {
  color: var(--doc-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -.015em;
}

.route-projects {
  color: var(--doc-blue);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.route-note,
.stay-cell {
  color: var(--doc-secondary);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
}

.stay-cell {
  color: var(--doc-ink);
}

.editable-field {
  border-radius: 8px;
  outline: none;
}

.editable-field:hover {
  background: rgba(0, 102, 204, .05);
}

.editable-field:focus {
  background: var(--doc-canvas);
  box-shadow: 0 0 0 2px var(--doc-blue-focus);
}

.preview-row-insert,
.preview-row-remove {
  color: var(--doc-blue);
  background: rgba(0, 102, 204, .08);
}

@media (max-width: 900px) {
  .route-cover {
    min-height: 220px;
    padding: 38px 24px;
  }

  .route-cover::before {
    top: 28px;
    left: 24px;
  }

  .route-cover strong {
    font-size: 2rem;
  }

  .route-meta-row,
  .route-client-brief {
    grid-template-columns: 1fr;
  }

  .route-meta-row div,
  .route-client-brief div {
    border-right: 0;
    border-bottom: 1px solid var(--doc-line-soft);
  }

  .route-table th:first-child,
  .route-table td:first-child {
    width: 128px;
  }

  .route-table th:last-child,
  .route-table td:last-child {
    width: 170px;
  }

  .route-table th,
  .route-table td {
    padding: 14px 10px;
  }

  .route-line {
    font-size: 14px;
  }
}

@media (max-width: 560px) {
  .route-table th:last-child,
  .route-table td:last-child {
    width: 132px;
  }

  .route-note,
  .stay-cell,
  .route-projects {
    font-size: 11px;
  }
}

@media print {
  .route-cover {
    color: #fff;
    background: #1d1d1f var(--hero-image) center 45% / cover no-repeat !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .route-cover strong {
    color: #fff;
  }

  .route-table th,
  .route-table tbody tr:nth-child(even) td,
  .date-editable {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Editorial itinerary cover and journey-at-a-glance visualization */
.route-cover {
  min-height: 340px;
  align-items: stretch;
  justify-content: space-between;
  gap: 28px;
  padding: 42px 46px;
}

.route-cover::before { display: none; }
.route-cover::after {
  background:
    linear-gradient(90deg, rgba(4, 18, 30, .78) 0%, rgba(4, 18, 30, .42) 58%, rgba(4, 18, 30, .2) 100%),
    linear-gradient(0deg, rgba(0,0,0,.42), transparent 58%);
}

.route-cover-copy {
  position: relative;
  z-index: 3;
  display: grid;
  max-width: 760px;
  align-content: end;
  gap: 14px;
}

.route-cover-copy > span {
  width: max-content;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 999px;
  padding: 6px 10px;
  color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.08);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .14em;
  backdrop-filter: blur(12px);
}

.route-cover-copy > strong {
  max-width: 720px;
  font-size: clamp(2.35rem, 4.4vw, 4rem);
  line-height: 1.02;
}

.route-cover-copy > small {
  color: rgba(255,255,255,.8);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: .04em;
}

.route-cover-stamp {
  position: relative;
  z-index: 3;
  display: grid;
  width: 78px;
  height: 94px;
  align-content: center;
  align-self: flex-start;
  justify-items: center;
  gap: 5px;
  border: 1px solid rgba(255,255,255,.42);
  color: #fff;
  background: rgba(8, 24, 37, .28);
  backdrop-filter: blur(14px);
}

.route-cover-stamp span { font-size: 1.25rem; font-weight: 700; letter-spacing: .08em; }
.route-cover-stamp small { font-size: 8px; letter-spacing: .16em; }

.journey-map {
  padding: 28px 26px 30px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 92% 12%, rgba(122, 184, 207, .26), transparent 34%),
    radial-gradient(circle at 8% 100%, rgba(198, 161, 101, .18), transparent 30%),
    linear-gradient(135deg, #102a3c, #153f56 58%, #0b2435);
}

.journey-map > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.journey-map > header div { display: grid; gap: 4px; }
.journey-map > header span { color: #83bed5; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.journey-map > header strong { color: #fff; font-size: 1.32rem; letter-spacing: -.025em; }
.journey-map > header small { color: rgba(255,255,255,.58); font-size: 10px; }

.journey-track {
  display: grid;
  grid-auto-columns: minmax(180px, 1fr);
  grid-auto-flow: column;
  gap: 10px;
  overflow-x: auto;
  padding: 3px 2px 12px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(255,255,255,.28) transparent;
  scrollbar-width: thin;
}

.journey-stop {
  position: relative;
  display: grid;
  min-height: 154px;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  gap: 11px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 18px;
  padding: 15px;
  color: #fff;
  background: rgba(255,255,255,.075);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  scroll-snap-align: start;
  backdrop-filter: blur(10px);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.journey-stop:hover {
  border-color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.12);
  transform: translateY(-2px);
}

.journey-stop-index {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #123246;
  background: #8dc8dd;
  font-size: 10px;
  font-weight: 760;
}

.journey-stop.is-pending .journey-stop-index { color: #66441f; background: #e6bb7e; }
.journey-stop.is-custom .journey-stop-index { color: #443b62; background: #c0b4df; }

.journey-stop-copy { display: grid; min-width: 0; gap: 7px; }
.journey-stop-copy small { color: #8dc8dd; font-size: 9px; font-weight: 650; }
.journey-stop-copy strong { display: -webkit-box; overflow: hidden; color: #fff; font-size: 12px; font-weight: 620; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.journey-stop-copy em { overflow: hidden; color: rgba(255,255,255,.58); font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }

.journey-stop > i {
  position: absolute;
  right: 14px;
  bottom: 13px;
  width: 22px;
  height: 1px;
  background: rgba(255,255,255,.35);
}

.journey-stop > i::after {
  position: absolute;
  top: -3px;
  right: 0;
  width: 6px;
  height: 6px;
  border-top: 1px solid rgba(255,255,255,.55);
  border-right: 1px solid rgba(255,255,255,.55);
  content: "";
  transform: rotate(45deg);
}

.route-table tbody tr { transition: background 180ms ease, box-shadow 180ms ease; }
.route-table tbody tr:hover td { background: #f3f8fc; }
.route-table tbody tr.is-focused-from-map td { animation: itinerary-row-focus 1.2s ease; }

@keyframes itinerary-row-focus {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(0,113,227,0); }
  35% { box-shadow: inset 0 0 0 2px rgba(0,113,227,.48); background: #edf6ff; }
}

@media (max-width: 900px) {
  .route-cover { min-height: 270px; padding: 30px 24px; }
  .route-cover-copy > strong { font-size: clamp(2rem, 8vw, 3rem); }
  .route-cover-stamp { width: 64px; height: 78px; }
  .journey-map { padding: 22px 18px 24px; }
  .journey-map > header { align-items: start; flex-direction: column; gap: 6px; }
  .journey-track { grid-auto-columns: minmax(168px, 72vw); }
}

@media (max-width: 560px) {
  .route-cover { min-height: 300px; }
  .route-cover-stamp { display: none; }
  .route-cover-copy > span { font-size: 8px; }
  .route-cover-copy > small { font-size: 10px; }
}

@media print {
  .journey-map { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .journey-track { grid-template-columns: repeat(4, 1fr); grid-auto-flow: row; overflow: visible; }
  .journey-stop { min-height: 118px; break-inside: avoid; }
}

/* Lighter, calmer route-board treatment */
.journey-map {
  color: #18364a;
  border-top: 1px solid #dbe6ec;
  border-bottom: 1px solid #dbe6ec;
  background:
    radial-gradient(circle at 92% 10%, rgba(157, 204, 218, .22), transparent 28%),
    linear-gradient(135deg, #f6fafc, #edf4f7);
}

.journey-map > header span { color: #4388a2; }
.journey-map > header strong { color: #18364a; }
.journey-map > header small { color: #718894; }

.journey-track {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-columns: auto;
  grid-auto-flow: row;
  gap: 12px;
  overflow: visible;
  padding: 6px 2px 2px;
  scrollbar-width: none;
}

.journey-track::-webkit-scrollbar { display: none; }

.journey-stop {
  min-height: 142px;
  grid-template-columns: auto minmax(0, 1fr);
  border: 1px solid #d9e5eb;
  border-top: 3px solid #80bfd3;
  border-radius: 16px;
  padding: 14px;
  color: #18364a;
  background: rgba(255,255,255,.88);
  box-shadow: 0 6px 18px rgba(33, 72, 94, .07);
  backdrop-filter: none;
}

.journey-stop:hover {
  border-color: #a9cfdb;
  border-top-color: #2f87a4;
  background: #fff;
  box-shadow: 0 10px 24px rgba(33, 72, 94, .12);
}

.journey-stop-index { width: 30px; height: 30px; color: #fff; background: #377e99; font-size: 9px; }
.journey-stop.is-pending .journey-stop-index { color: #785524; background: #f1d39b; }
.journey-stop.is-custom .journey-stop-index { color: #5d4c80; background: #d7cdef; }
.journey-stop-copy { gap: 6px; }
.journey-stop-copy small { color: #4388a2; font-size: 9px; }
.journey-stop-copy strong { color: #18364a; font-size: 11px; line-height: 1.45; }
.journey-stop-copy em { color: #718894; font-size: 9px; }
.journey-stop > i { background: #b7d4dd; }
.journey-stop > i::after { border-color: #7eabb9; }

.journey-stop.is-pending { border-top-color: #d6a45a; }
.journey-stop.is-custom { border-top-color: #9d8bc7; }

@media (max-width: 1120px) and (min-width: 761px) {
  .journey-track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .journey-track {
    grid-template-columns: none;
    grid-auto-columns: minmax(180px, 72vw);
    grid-auto-flow: column;
    overflow-x: auto;
    padding-bottom: 10px;
  }
}
