:root {
  --ux-orange: #bf5b00;
  --ux-orange-soft: #fff4e8;
  --ux-red: #d70015;
  --ux-green: #248a3d;
}

.route-check-details {
  overflow: hidden;
  border: 1px solid var(--apple-line);
  border-radius: 16px;
  background: #fff;
}

.route-check-details summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  color: var(--apple-text);
  cursor: pointer;
  list-style: none;
  font-size: .71rem;
  font-weight: 620;
}

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

.route-check-details summary::after {
  content: "›";
  color: var(--apple-muted);
  font-size: 1rem;
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.route-check-details[open] summary::after {
  transform: rotate(-90deg);
}

.route-check-details summary strong {
  margin-left: auto;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--ux-orange);
  background: var(--ux-orange-soft);
  font-size: .61rem;
  font-weight: 650;
}

.route-check-details summary strong[data-state="ready"] {
  color: var(--ux-green);
  background: #eaf6ed;
}

.route-check-list {
  display: grid;
  max-height: 280px;
  overflow-y: auto;
  border-top: 1px solid var(--apple-line);
}

.route-check-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 11px 13px;
  border-bottom: 1px solid #f0f0f2;
}

.route-check-item:last-child {
  border-bottom: 0;
}

.route-check-item > span {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--apple-blue);
  background: #edf6ff;
  font-size: .62rem;
  font-weight: 700;
}

.route-check-item > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.route-check-item strong {
  overflow: hidden;
  color: var(--apple-text);
  font-size: .66rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-check-item small {
  color: var(--apple-muted);
  font-size: .6rem;
  line-height: 1.4;
}

.route-check-item em {
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--apple-muted);
  background: #f5f5f7;
  font-size: .58rem;
  font-style: normal;
  font-weight: 650;
  white-space: nowrap;
}

.route-check-item.is-critical small {
  color: var(--ux-red);
}

.route-check-item.is-warning small {
  color: var(--ux-orange);
}

.route-check-item.is-ready > span {
  color: var(--ux-green);
  background: #eaf6ed;
}

.map-service-card {
  display: grid;
  gap: 9px;
  overflow: hidden;
  border: 1px solid #dbeaff;
  border-radius: 18px;
  padding: 15px;
  background: linear-gradient(145deg, #f5faff, #fff);
}

.map-route-quick-button {
  color: #fff;
  background: linear-gradient(135deg, #0071e3, #0a84ff);
  box-shadow: 0 7px 18px rgba(0, 113, 227, .2);
}

.map-route-quick-button:hover {
  color: #fff;
  background: linear-gradient(135deg, #0077ed, #148cff);
}

.map-service-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.map-service-head > div {
  display: grid;
  gap: 3px;
}

.map-service-head span {
  color: var(--apple-blue);
  font-size: .58rem;
  font-weight: 760;
  letter-spacing: .13em;
}

.map-service-head strong {
  color: var(--apple-text);
  font-size: .78rem;
  font-weight: 680;
}

.map-service-head em {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--apple-muted);
  background: #f1f1f3;
  font-size: .58rem;
  font-style: normal;
  font-weight: 650;
}

.map-service-head em[data-state="ready"] {
  color: var(--ux-green);
  background: #eaf6ed;
}

.map-service-head em[data-state="working"] {
  color: var(--apple-blue);
  background: #eaf4ff;
}

.map-service-head em[data-state="warning"] {
  color: var(--ux-orange);
  background: var(--ux-orange-soft);
}

.map-service-card p {
  margin: 0;
  color: var(--apple-muted);
  font-size: .64rem;
  line-height: 1.5;
}

.map-service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.map-service-button,
.map-dialog-button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--apple-blue);
  background: #eaf4ff;
  cursor: pointer;
  font-family: inherit;
  font-size: .64rem;
  font-weight: 650;
}

.map-service-button.primary,
.map-dialog-button.primary {
  color: #fff;
  background: var(--apple-blue);
}

.map-service-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.map-service-button:hover:not(:disabled),
.map-dialog-button:hover {
  transform: translateY(-1px);
}

.route-map {
  width: 100%;
  height: 230px;
  overflow: hidden;
  border-radius: 14px;
  background: #eaf4ff;
}

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

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

.map-service-dialog {
  position: fixed;
  z-index: 10010;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 24px;
}

.map-service-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px) saturate(120%);
}

.map-service-dialog-panel {
  position: relative;
  width: min(520px, 100%);
  border-radius: 26px;
  padding: 25px;
  background: rgba(251, 251, 253, .97);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .23);
}

.map-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.map-dialog-head > div {
  display: grid;
  gap: 4px;
}

.map-dialog-head span {
  color: var(--apple-blue);
  font-size: .62rem;
  font-weight: 760;
  letter-spacing: .15em;
}

.map-dialog-head h2 {
  margin: 0;
  color: var(--apple-text);
  font-size: 1.45rem;
  letter-spacing: -.04em;
}

.map-dialog-close {
  display: inline-flex;
  width: 33px;
  height: 33px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: var(--apple-muted);
  background: #e8e8ed;
  cursor: pointer;
  font-size: 1.2rem;
}

.map-dialog-intro,
.map-dialog-note {
  color: var(--apple-muted);
  font-size: .66rem;
  line-height: 1.6;
}

.map-dialog-intro {
  margin: 18px 0;
}

.map-dialog-note {
  margin-top: 12px;
  border-radius: 12px;
  padding: 10px 12px;
  color: #6b4a12;
  background: #fff7df;
}

.map-config-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.map-config-field span {
  color: var(--apple-text);
  font-size: .68rem;
  font-weight: 650;
}

.map-config-field input {
  min-height: 42px;
  border: 1px solid var(--apple-line);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--apple-text);
  background: #fff;
  font: inherit;
  font-size: .72rem;
  outline: none;
}

.map-config-field input:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .14);
}

.map-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.map-dialog-button.quiet {
  color: var(--apple-muted);
  background: #e8e8ed;
}

@media (max-width: 700px) {
  .map-service-dialog {
    align-items: end;
    padding: 10px;
  }

  .map-service-dialog-panel {
    padding: 20px;
    border-radius: 23px;
  }
}

.editable-field-shell {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 4px;
}

.editable-field-shell.is-manual > .editable-field {
  background: #fffaf2;
  box-shadow: inset 3px 0 0 #ff9f0a;
}

.manual-edit-badge {
  width: max-content;
  max-width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--ux-orange);
  background: var(--ux-orange-soft);
  cursor: pointer;
  font-family: inherit;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.25;
}

.manual-edit-badge:hover {
  color: #8a3d00;
  background: #ffe8cf;
}

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

.primary-preview-tool {
  color: #fff;
  background: var(--apple-blue);
}

.primary-preview-tool:hover {
  color: #fff;
  background: #0077ed;
}

body.export-center-open {
  overflow: hidden;
}

.export-center[hidden] {
  display: none;
}

.export-center {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 24px;
}

.export-center-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px) saturate(120%);
}

.export-center-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 28px;
  padding: 26px;
  background: rgba(251, 251, 253, .96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .24);
}

.export-center-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.export-center-head > div {
  display: grid;
  gap: 4px;
}

.export-center-head span {
  color: var(--apple-blue);
  font-size: .65rem;
  font-weight: 750;
  letter-spacing: .16em;
}

.export-center-head h2 {
  margin: 0;
  color: var(--apple-text);
  font-size: 1.8rem;
  letter-spacing: -.04em;
}

.export-center-close {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: var(--apple-muted);
  background: #e8e8ed;
  cursor: pointer;
  font-size: 1.25rem;
}

.export-center-summary {
  display: grid;
  gap: 6px;
  margin-top: 22px;
  border-radius: 20px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #1d1d1f, #303036);
}

.export-center-summary > span {
  width: max-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: #ffd6a3;
  background: rgba(255, 159, 10, .16);
  font-size: .62rem;
  font-weight: 680;
}

.export-center-summary > span[data-state="ready"] {
  color: #a8f0ba;
  background: rgba(48, 209, 88, .16);
}

.export-center-summary strong {
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -.02em;
}

.export-center-summary small {
  color: rgba(255, 255, 255, .66);
  font-size: .68rem;
}

.export-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.export-option {
  position: relative;
  display: grid;
  min-height: 190px;
  align-content: start;
  gap: 9px;
  border: 1px solid var(--apple-line);
  border-radius: 20px;
  padding: 17px;
  color: var(--apple-text);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.export-option:hover {
  border-color: rgba(0, 113, 227, .4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
}

.export-option-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--apple-blue);
  background: #edf6ff;
  font-size: .78rem;
  font-weight: 750;
}

.export-option strong {
  font-size: .87rem;
  font-weight: 650;
}

.export-option small {
  color: var(--apple-muted);
  font-size: .65rem;
  line-height: 1.55;
}

.export-option em {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--apple-blue);
  background: #edf6ff;
  font-size: .58rem;
  font-style: normal;
  font-weight: 700;
}

.export-center-tip {
  margin: 14px 2px 0;
  color: var(--apple-muted);
  font-size: .64rem;
  line-height: 1.5;
}

.advanced-tools {
  overflow: hidden;
  border: 1px solid var(--apple-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}

.advanced-tools > summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  color: var(--apple-muted);
  cursor: pointer;
  list-style: none;
  font-size: .62rem;
}

.advanced-tools > summary::-webkit-details-marker { display: none; }
.advanced-tools > summary span { font-weight: 620; }
.advanced-tools > summary strong { color: var(--apple-text); font-weight: 620; }
.advanced-tools > summary::after { content: "+"; color: var(--apple-blue); font-size: .8rem; }
.advanced-tools[open] > summary::after { content: "−"; }
.advanced-tools .map-service-card { border: 0; border-top: 1px solid var(--apple-line); border-radius: 0; }

.utility-button {
  color: var(--apple-blue);
  background: #edf6ff;
}

body.workflow-dialog-open,
body.client-view-open {
  overflow: hidden;
}

.workflow-dialog {
  position: fixed;
  z-index: 2200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.workflow-dialog[hidden],
.client-view[hidden] { display: none; }

.workflow-dialog-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(20, 20, 24, .42);
  backdrop-filter: blur(16px);
}

.workflow-dialog-panel {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 28px;
  padding: 24px;
  background: rgba(250, 250, 252, .96);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .22);
}

.template-dialog-panel { width: min(920px, 100%); }

.workflow-dialog-head,
.client-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.workflow-dialog-head > div,
.client-view-toolbar > div:first-child { display: grid; gap: 4px; }
.workflow-dialog-head span,
.client-view-toolbar span { color: var(--apple-blue); font-size: .62rem; font-weight: 760; letter-spacing: .14em; }
.workflow-dialog-head h2 { margin: 0; color: var(--apple-text); font-size: 1.45rem; letter-spacing: -.035em; }
.workflow-dialog-head > button { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--apple-muted); background: #e9e9ed; cursor: pointer; font-size: 1.1rem; }
.workflow-dialog-intro { margin: 14px 0 20px; color: var(--apple-muted); font-size: .76rem; line-height: 1.55; }

.template-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.template-card {
  position: relative;
  display: grid;
  min-height: 225px;
  align-content: start;
  gap: 9px;
  border: 1px solid var(--apple-line);
  border-radius: 22px;
  padding: 18px;
  color: var(--apple-text);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.template-card:hover { border-color: rgba(0, 113, 227, .4); box-shadow: 0 16px 36px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.template-card.recommended { background: linear-gradient(150deg, #f3f9ff, #fff); }
.template-card > span { width: max-content; border-radius: 999px; padding: 5px 8px; color: var(--apple-blue); background: #edf6ff; font-size: .58rem; font-weight: 720; }
.template-card > strong { margin-top: 8px; font-size: 1.04rem; letter-spacing: -.025em; }
.template-card > em { color: var(--apple-blue); font-size: .7rem; font-style: normal; font-weight: 620; }
.template-card > small { color: var(--apple-muted); font-size: .7rem; line-height: 1.55; }
.template-card > b { margin-top: auto; color: var(--apple-blue); font-size: .7rem; font-weight: 650; }

.batch-choice-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.batch-choice-group button { display: grid; gap: 5px; min-height: 94px; border: 1px solid var(--apple-line); border-radius: 17px; padding: 14px; color: var(--apple-text); background: #fff; cursor: pointer; font-family: inherit; text-align: left; }
.batch-choice-group button.active { border-color: var(--apple-blue); background: #edf6ff; box-shadow: inset 0 0 0 1px var(--apple-blue); }
.batch-choice-group strong { font-size: .78rem; }
.batch-choice-group small { color: var(--apple-muted); font-size: .62rem; line-height: 1.4; }
.batch-scope-row { display: flex; gap: 8px; margin: 16px 0; }
.batch-scope-row button { min-height: 34px; border: 0; border-radius: 999px; padding: 0 14px; color: var(--apple-muted); background: #ececf0; cursor: pointer; font-family: inherit; font-size: .67rem; font-weight: 620; }
.batch-scope-row button.active { color: #fff; background: var(--apple-text); }
.workflow-primary-action { width: 100%; min-height: 44px; border: 0; border-radius: 14px; color: #fff; background: var(--apple-blue); cursor: pointer; font-family: inherit; font-size: .76rem; font-weight: 680; }

.client-view {
  position: fixed;
  z-index: 2300;
  inset: 0;
  overflow-y: auto;
  background: #f5f5f7;
}

.client-view-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 70px;
  padding: 10px max(24px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(22px) saturate(160%);
}

.client-view-toolbar strong { color: var(--apple-text); font-size: .9rem; }
.client-view-toolbar > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.client-view-toolbar button { min-height: 36px; border: 0; border-radius: 999px; padding: 0 14px; color: var(--apple-text); background: #ececf0; cursor: pointer; font-family: inherit; font-size: .68rem; font-weight: 630; }
.client-view-toolbar button.primary { color: #fff; background: var(--apple-blue); }
.client-view-stage { width: min(1120px, calc(100% - 32px)); margin: 28px auto 70px; }
.client-view-document { overflow: hidden; border-radius: 28px; background: #fff; box-shadow: 0 22px 60px rgba(0, 0, 0, .1); }
.client-view-document .editable-field { cursor: default; }
.client-view-document .manual-edit-badge,
.client-view-document [data-reset-preview-field],
.client-view-document [data-remove-preview-row],
.client-view-document [data-insert-after-row] { display: none !important; }

@media (max-width: 760px) {
  .workflow-dialog { align-items: end; padding: 10px; }
  .workflow-dialog-panel { max-height: calc(100vh - 20px); border-radius: 24px; padding: 20px; }
  .template-card-grid { grid-template-columns: 1fr; }
  .template-card { min-height: 170px; }
  .batch-choice-group { grid-template-columns: 1fr; }
  .batch-choice-group button { min-height: 74px; }
  .client-view-toolbar { align-items: flex-start; padding: 12px 16px; }
  .client-view-toolbar > div:last-child { max-width: 62%; }
  .client-view-stage { width: calc(100% - 16px); margin-top: 10px; }
  .client-view-document { border-radius: 18px; }
}

@media (max-width: 700px) {
  .export-center {
    align-items: end;
    padding: 10px;
  }

  .export-center-dialog {
    max-height: calc(100vh - 20px);
    border-radius: 24px;
    padding: 20px;
  }

  .export-option-grid {
    grid-template-columns: 1fr;
  }

  .export-option {
    min-height: 124px;
  }

  .route-check-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .route-check-item em {
    display: none;
  }
}

@media print {
  .export-center,
  .manual-edit-badge,
  .route-check-details {
    display: none !important;
  }

  .editable-field-shell.is-manual > .editable-field {
    background: transparent;
    box-shadow: none;
  }

  body.client-view-open > *:not(.client-view) { display: none !important; }
  body.client-view-open .client-view { position: static; overflow: visible; background: #fff; }
  body.client-view-open .client-view-toolbar { display: none !important; }
  body.client-view-open .client-view-stage { width: 100%; margin: 0; }
  body.client-view-open .client-view-document { border-radius: 0; box-shadow: none; }
}

/* Expanded itinerary template library */
.template-dialog-panel {
  width: min(1080px, 100%);
}

.template-library-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.template-search {
  display: grid;
  gap: 6px;
  color: var(--apple-muted);
  font-size: .64rem;
  font-weight: 650;
}

.template-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--apple-line);
  border-radius: 14px;
  padding: 0 15px;
  color: var(--apple-text);
  background: #fff;
  font: inherit;
  font-size: .76rem;
  outline: none;
}

.template-search input:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .12);
}

.save-current-template {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 14px;
  padding: 0 16px;
  color: #fff;
  background: var(--apple-text);
  cursor: pointer;
  font-family: inherit;
  font-size: .72rem;
  font-weight: 680;
}

.save-current-template span { font-size: 1.1rem; font-weight: 400; }

.template-filter-row {
  display: flex;
  gap: 7px;
  margin: 15px 0 11px;
  overflow-x: auto;
  scrollbar-width: none;
}

.template-filter-row::-webkit-scrollbar { display: none; }
.template-filter-row button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 13px;
  color: var(--apple-muted);
  background: #ececf0;
  cursor: pointer;
  font-family: inherit;
  font-size: .66rem;
  font-weight: 650;
}

.template-filter-row button.active { color: #fff; background: var(--apple-blue); }

.template-library-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--apple-muted);
  font-size: .64rem;
}

.template-library-summary strong { color: var(--apple-text); }

.template-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.template-card {
  display: grid;
  min-height: 246px;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  padding: 0;
  cursor: default;
}

.template-card-visual {
  position: relative;
  display: grid;
  align-content: space-between;
  padding: 17px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #145f91, #62a8c5);
}

.template-card-visual::after {
  position: absolute;
  right: -25px;
  bottom: -35px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 18px rgba(255,255,255,.06), 0 0 0 38px rgba(255,255,255,.04);
}

.template-card[data-template-accent="forest"] .template-card-visual { background: linear-gradient(145deg, #1f5a48, #70a27b); }
.template-card[data-template-accent="road"] .template-card-visual { background: linear-gradient(145deg, #353c49, #b1794f); }
.template-card[data-template-accent="desert"] .template-card-visual { background: linear-gradient(145deg, #8a4b2a, #db9b61); }
.template-card[data-template-accent="sunset"] .template-card-visual { background: linear-gradient(145deg, #b24e35, #efb35e); }
.template-card[data-template-accent="family"] .template-card-visual { background: linear-gradient(145deg, #5262a8, #a88ec2); }
.template-card[data-template-accent="custom"] .template-card-visual { background: linear-gradient(145deg, #18181b, #5b5b66); }

.template-card-visual span { position: relative; z-index: 1; font-size: .56rem; font-weight: 750; letter-spacing: .12em; }
.template-card-visual strong { position: relative; z-index: 1; font-size: 1.25rem; line-height: 1.05; }
.template-card-visual i { width: 34px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.72); }

.template-card-content {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  padding: 17px;
}

.template-card-topline { display: flex; justify-content: space-between; gap: 8px; }
.template-card-topline span,
.template-card-topline em { color: var(--apple-blue); font-size: .6rem; font-style: normal; font-weight: 700; }
.template-card-topline em { color: var(--apple-muted); }
.template-card-content > strong { font-size: .98rem; letter-spacing: -.02em; }
.template-card-content > small { min-height: 42px; color: var(--apple-muted); font-size: .67rem; line-height: 1.5; }

.template-highlight-row,
.template-route-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.template-highlight-row span { border-radius: 999px; padding: 4px 7px; color: #4e4e54; background: #f0f0f3; font-size: .58rem; font-weight: 650; }
.template-route-preview { color: var(--apple-muted); font-size: .58rem; }
.template-route-preview i { color: #b3b3b8; font-style: normal; }

.template-use-button {
  width: max-content;
  min-height: 34px;
  margin-top: auto;
  border: 0;
  border-radius: 999px;
  padding: 0 13px;
  color: #fff;
  background: var(--apple-blue);
  cursor: pointer;
  font-family: inherit;
  font-size: .65rem;
  font-weight: 680;
}

.template-delete-button {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  border-radius: 999px;
  padding: 5px 8px;
  color: #b42318;
  background: rgba(255,255,255,.9);
  cursor: pointer;
  font-size: .58rem;
  font-weight: 700;
}

.template-empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 1px dashed var(--apple-line);
  border-radius: 20px;
  padding: 46px 20px;
  color: var(--apple-muted);
}

.template-empty strong { color: var(--apple-text); }

/* Active-day feedback and desktop drag affordances */
.active-day-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin: 0 0 12px;
  border: 1px solid rgba(0,113,227,.18);
  border-radius: 15px;
  padding: 10px 12px;
  background: #f2f8ff;
}
.active-day-feedback-mark { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 11px; color: #fff; background: var(--apple-blue); font-size: .72rem; font-weight: 750; }
.active-day-feedback div { display: grid; gap: 2px; }
.active-day-feedback strong { font-size: .72rem; }
.active-day-feedback small { color: var(--apple-muted); font-size: .62rem; }
.active-day-feedback button { min-height: 32px; border: 0; border-radius: 999px; padding: 0 12px; color: var(--apple-blue); background: #fff; cursor: pointer; font-size: .62rem; font-weight: 680; }
.spot-card { position: relative; }
.spot-add-affordance { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 3px; border-radius: 999px; padding: 4px 7px; color: var(--apple-blue); background: rgba(255,255,255,.92); box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.spot-add-affordance b { font-size: .8rem; }
.spot-add-affordance small { font-size: .55rem; font-weight: 700; }
.day-card { position: relative; }
.day-drop-hint { position: absolute; z-index: 5; inset: 8px; display: none; place-items: center; border: 2px dashed var(--apple-blue); border-radius: 14px; color: var(--apple-blue); background: rgba(242,248,255,.94); font-size: .72rem; font-weight: 700; pointer-events: none; }
.day-card.is-drop-target .day-drop-hint { display: grid; }
.selected-drag-handle { color: #a1a1a6; cursor: grab; }

@media (max-width: 760px) {
  .template-library-toolbar { grid-template-columns: 1fr; }
  .template-library-summary span { display: none; }
  .template-card-grid { grid-template-columns: 1fr; }
  .template-card { min-height: 220px; grid-template-columns: 112px minmax(0, 1fr); }
  .template-card-visual { padding: 14px; }
  .template-card-content { padding: 14px; }
  .active-day-feedback { grid-template-columns: auto minmax(0, 1fr); }
  .active-day-feedback button { grid-column: 1 / -1; }
  .spot-add-affordance small,
  .day-drop-hint,
  .selected-drag-handle { display: none; }
}

.trip-field > span small {
  color: var(--apple-muted);
  font-size: .58rem;
  font-weight: 500;
}

.field-hint {
  margin-top: -2px;
  color: var(--apple-muted);
  font-size: .58rem;
  line-height: 1.35;
}

/* Compact plan action bar: keep only customer-facing actions visible. */
.customer-field-grid .travel-start-date-field {
  grid-column: span 2;
  min-width: 0;
}

.travel-start-date-field input[type="date"] {
  width: 100%;
  min-width: 0;
  padding-inline: 12px 8px;
  font-size: .78rem;
  letter-spacing: -.025em;
}

.studio-shell .trip-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
}

.trip-length-controls,
.trip-primary-actions,
.trip-history-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.trip-length-controls {
  padding: 4px;
  border-radius: 999px;
  background: #f5f5f7;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .045);
}

.trip-length-controls .icon-button,
.trip-length-controls .day-input {
  min-height: 34px;
}

.trip-length-controls .icon-button {
  width: 34px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
}

.trip-length-controls .day-input {
  width: 82px;
  padding-inline: 8px;
  background: transparent;
  box-shadow: none;
}

.trip-primary-actions {
  justify-content: flex-end;
}

.trip-primary-actions .text-button,
.trip-history-actions .text-button,
.trip-history-actions .history-status {
  min-height: 38px;
  white-space: nowrap;
}

.trip-primary-actions .save-plan-button {
  padding-inline: 18px;
  box-shadow: 0 7px 16px rgba(0, 113, 227, .16);
}

.trip-history-actions {
  padding-left: 12px;
  border-left: 1px solid var(--apple-line);
}

.trip-maintenance-actions {
  display: none;
}

.trip-history-actions .history-button:disabled {
  display: none;
}

@media (max-width: 1180px) {
  .studio-shell .trip-controls {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .trip-history-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding: 0;
    border: 0;
  }
}

@media (max-width: 700px) {
  .customer-field-grid .travel-start-date-field {
    grid-column: 1 / -1;
  }

  .studio-shell .trip-controls {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .trip-length-controls,
  .trip-primary-actions,
  .trip-history-actions {
    width: 100%;
  }

  .trip-length-controls {
    justify-content: center;
  }

  .trip-primary-actions {
    justify-content: stretch;
  }

  .trip-primary-actions .text-button {
    flex: 1 1 0;
    padding-inline: 9px;
  }

  .trip-history-actions {
    grid-column: auto;
    justify-content: flex-end;
  }
}

/* Warm alpine hero treatment, matched to the supplied visual reference. */
:root {
  --hero-image: url("assets/hero-alpine-meadow.png");
}

.hero {
  min-height: 760px;
  background-position: center 47%;
}

.hero::before {
  background:
    radial-gradient(circle at 70% 15%, rgba(255, 220, 180, .26), transparent 42%),
    linear-gradient(180deg, rgba(67, 45, 56, .16), rgba(16, 30, 24, .32) 74%, rgba(9, 20, 15, .52));
}

.hero::after {
  height: 210px;
  background: linear-gradient(180deg, transparent 0%, rgba(14, 24, 17, .18) 40%, rgba(8, 17, 12, .58) 100%);
}

.hero h1 {
  text-shadow:
    0 3px 0 rgba(45, 91, 137, .88),
    0 10px 30px rgba(26, 34, 30, .22);
}

.hero-primary {
  background: #0878dc;
  box-shadow: 0 10px 26px rgba(0, 74, 142, .26);
}

.hero-primary:hover {
  background: #1688ed;
}

.hero-stats {
  right: max(34px, calc((100vw - 1500px) / 2));
  bottom: 30px;
  left: max(34px, calc((100vw - 1500px) / 2));
  border-color: rgba(255, 255, 255, .3);
  border-radius: 25px;
  background: rgba(33, 39, 30, .34);
  box-shadow: 0 14px 45px rgba(18, 23, 16, .16), inset 0 1px rgba(255, 255, 255, .16);
  backdrop-filter: blur(24px) saturate(135%);
}

.hero-stats::after {
  position: absolute;
  top: 13px;
  right: 34px;
  color: rgba(255, 255, 255, .62);
  content: "✦";
  font-size: 1.8rem;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(255, 230, 183, .65);
  pointer-events: none;
}

.hero-stats div {
  min-height: 112px;
  background: rgba(40, 48, 35, .18);
}

.hero-stats div + div {
  border-left: 1px solid rgba(255, 255, 255, .2);
}

.hero-stats strong {
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  text-shadow: 0 3px 16px rgba(0, 0, 0, .15);
}

.hero-stats span {
  color: rgba(255, 255, 255, .72);
  font-size: .8rem;
}

@media (max-width: 900px) {
  .hero {
    min-height: 690px;
    background-position: 58% center;
  }

  .hero-stats {
    right: 18px;
    bottom: 20px;
    left: 18px;
  }

  .hero-stats div {
    min-height: 82px;
    padding: 12px 8px;
  }

  .hero-stats strong {
    font-size: 1.3rem;
  }

  .hero-stats span {
    font-size: .65rem;
  }
}

/* Editorial landscape palette: remove the default Apple-white shell language. */
:root {
  --apple-bg: #f1eee7;
  --apple-surface: #fffdf8;
  --apple-surface-soft: #f7f3eb;
  --apple-text: #293128;
  --apple-muted: #70756b;
  --apple-line: rgba(74, 69, 55, .15);
  --apple-shadow: 0 20px 54px rgba(65, 57, 39, .1);
  --apple-radius: 22px;
  --apple-radius-small: 14px;
}

.topbar {
  position: absolute;
  width: 100%;
  min-height: 64px;
  background: linear-gradient(180deg, rgba(25, 31, 27, .42), rgba(25, 31, 27, 0));
  border-bottom-color: rgba(255, 255, 255, .16);
  backdrop-filter: blur(14px) saturate(120%);
}

.brand,
.topnav a,
.brand small {
  color: rgba(255, 255, 255, .9);
}

.brand-mark {
  color: #fff;
  background: rgba(20, 31, 25, .62);
  border: 1px solid rgba(255, 255, 255, .28);
}

.topnav .nav-primary {
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(15, 112, 196, .82);
  box-shadow: 0 6px 16px rgba(9, 47, 74, .22);
}

.topnav a:hover,
.brand:hover {
  color: #fff;
}

.hero {
  min-height: 100svh;
  background-position: center 45%;
}

.workspace {
  background: #f1eee7;
}

.studio-intro h2 {
  color: #263029;
  font-weight: 650;
  letter-spacing: -.055em;
}

.studio-shell,
.builder-controls,
.day-board,
.detail-panel,
.spot-library {
  border: 1px solid rgba(74, 69, 55, .12);
  box-shadow: 0 20px 54px rgba(65, 57, 39, .1);
}

.route-controls,
.customer-brief,
.plan-dashboard {
  border: 1px solid rgba(74, 69, 55, .09);
  background: rgba(255, 253, 248, .84);
}

.text-button,
.history-status,
.utility-button,
.save-plan-button {
  border-radius: 13px;
}

.icon-button {
  border-radius: 12px;
}

@media (max-width: 900px) {
  .hero {
    min-height: 690px;
  }

  .topbar {
    position: absolute;
    min-height: 50px;
    background: linear-gradient(180deg, rgba(25, 31, 27, .46), rgba(25, 31, 27, 0));
  }
}

/* Keep the itinerary cover at the source image ratio so the landscape is not cropped. */
.itinerary-document .route-cover {
  aspect-ratio: 2.4 / 1;
  min-height: 0;
  background-position: center top;
  background-size: cover;
}

@media (max-width: 560px) {
  .itinerary-document .route-cover {
    aspect-ratio: 1.85 / 1;
    min-height: 0;
  }
}

/* Liquid-glass treatment: layered translucency, backdrop blur and specular edges. */
.topbar {
  isolation: isolate;
  background:
    linear-gradient(108deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .035) 42%, rgba(255, 255, 255, .09)),
    rgba(255, 255, 255, .035);
  border-bottom: 1px solid rgba(255, 255, 255, .28);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .34),
    inset 0 -1px rgba(13, 37, 44, .16),
    0 8px 26px rgba(20, 27, 26, .12);
  backdrop-filter: blur(26px) saturate(185%) contrast(108%);
  -webkit-backdrop-filter: blur(26px) saturate(185%) contrast(108%);
}

.topbar::after {
  position: absolute;
  z-index: -1;
  inset: 1px 0 auto;
  height: 42%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .18), transparent);
  content: "";
  pointer-events: none;
}

.topbar .brand-mark {
  background: linear-gradient(145deg, rgba(33, 45, 40, .48), rgba(17, 29, 24, .26));
  box-shadow: inset 0 1px rgba(255, 255, 255, .32), 0 5px 14px rgba(16, 27, 23, .15);
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
}

.topbar .nav-primary {
  background: linear-gradient(180deg, rgba(30, 143, 236, .86), rgba(0, 101, 194, .76));
  border-color: rgba(255, 255, 255, .42);
  box-shadow: inset 0 1px rgba(255, 255, 255, .38), 0 8px 22px rgba(7, 78, 143, .24);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
}

.hero-stats {
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, .34);
  background:
    linear-gradient(118deg, rgba(255, 255, 255, .19), rgba(255, 255, 255, .055) 44%, rgba(16, 35, 27, .19)),
    rgba(25, 38, 31, .17);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .38),
    inset 0 -1px rgba(12, 22, 18, .24),
    0 18px 46px rgba(7, 17, 13, .22);
  backdrop-filter: blur(38px) saturate(180%) contrast(112%);
  -webkit-backdrop-filter: blur(38px) saturate(180%) contrast(112%);
}

.hero-stats::before {
  position: absolute;
  z-index: 0;
  inset: 1px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: inherit;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, .2), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 42%);
  content: "";
  pointer-events: none;
}

.hero-stats div {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .025));
  box-shadow: inset 0 1px rgba(255, 255, 255, .12);
}

.hero-stats div + div {
  border-left-color: rgba(255, 255, 255, .22);
}

.hero-stats::after {
  z-index: 2;
  text-shadow: 0 0 18px rgba(255, 236, 190, .9), 0 2px 14px rgba(255, 255, 255, .35);
}

@supports not ((backdrop-filter: blur(1px))) {
  .topbar {
    background: rgba(45, 48, 43, .68);
  }

  .hero-stats {
    background: rgba(26, 39, 31, .68);
  }
}

/* Clear glass variant: lighter, sharper and less foggy over the meadow. */
.hero::after {
  background: linear-gradient(180deg, transparent 0%, rgba(8, 17, 12, .08) 48%, rgba(8, 17, 12, .32) 100%);
}

.hero-stats {
  background:
    linear-gradient(130deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .055) 48%, rgba(255, 255, 255, .12)),
    rgba(255, 255, 255, .065);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .52),
    inset 0 -1px rgba(20, 34, 27, .18),
    0 14px 36px rgba(7, 17, 13, .16);
  backdrop-filter: blur(15px) saturate(175%) contrast(105%);
  -webkit-backdrop-filter: blur(15px) saturate(175%) contrast(105%);
}

.hero-stats::before {
  background:
    linear-gradient(112deg, rgba(255, 255, 255, .28), transparent 34%, rgba(255, 255, 255, .055) 72%),
    radial-gradient(circle at 90% 0%, rgba(255, 255, 255, .16), transparent 25%);
}

.hero-stats div {
  background: rgba(255, 255, 255, .025);
  box-shadow: inset 0 1px rgba(255, 255, 255, .16);
}

/* Apple neutral canvas: cool white surfaces, no warm paper cast. */
html,
body {
  background: #f5f5f7;
}

.workspace {
  background: #f5f5f7;
}

.control-strip,
.workspace .studio-shell,
.workspace .builder-controls,
.workspace .day-board,
.workspace .detail-panel,
.workspace .spot-library,
.workspace .itinerary-preview {
  border-color: rgba(0, 0, 0, .08);
  box-shadow: 0 18px 52px rgba(0, 0, 0, .07);
}

.route-controls,
.customer-brief,
.plan-dashboard {
  border-color: rgba(0, 0, 0, .07);
  background: rgba(255, 255, 255, .9);
}

/* The intro copy is part of the canvas, not a floating card. */
.studio-intro {
  border: 0;
  background: transparent;
  box-shadow: none;
}
