:root {
  --apple-bg: #f5f5f7;
  --apple-surface: #ffffff;
  --apple-surface-soft: #f9f9fb;
  --apple-text: #1d1d1f;
  --apple-muted: #6e6e73;
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-green: #248a3d;
  --apple-orange: #bf5b00;
  --apple-red: #d70015;
  --apple-line: rgba(0, 0, 0, 0.09);
  --apple-shadow: 0 18px 60px rgba(0, 0, 0, 0.08);
  --apple-radius: 30px;
  --apple-radius-small: 18px;
  --apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --hero-image: url("assets/xinjiang-reference-lake.png");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--apple-bg);
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--apple-text);
  background: var(--apple-bg);
  font-family: var(--apple-font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  z-index: 500;
  top: 0;
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(22px, calc((100vw - 1280px) / 2));
  background: rgba(250, 250, 252, 0.78);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: saturate(180%) blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #fff;
  background: var(--apple-text);
  font-size: 0.82rem;
  font-weight: 750;
}

.brand > span:last-child {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.brand strong {
  font-size: 0.92rem;
  font-weight: 650;
}

.brand small {
  color: var(--apple-muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.topnav a {
  color: rgba(29, 29, 31, 0.78);
  font-size: 0.76rem;
  font-weight: 500;
  transition: color 180ms ease;
}

.topnav a:hover {
  color: #000;
}

.topnav .nav-primary {
  border-radius: 999px;
  padding: 7px 14px;
  color: #fff;
  background: var(--apple-blue);
}

.topnav .nav-primary:hover {
  color: #fff;
  background: var(--apple-blue-hover);
}

main {
  min-width: 0;
}

.hero {
  position: relative;
  display: grid;
  min-height: 720px;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: #07131d var(--hero-image) center 42% / cover no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(9, 69, 105, 0.06), rgba(0, 0, 0, 0.3) 68%),
    linear-gradient(180deg, rgba(3, 13, 21, 0.12), rgba(2, 9, 15, 0.62));
}

.hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 170px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(1020px, calc(100% - 40px));
  justify-items: center;
  margin-top: -80px;
  text-align: center;
  animation: hero-in 800ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.16em;
}

.hero h1 {
  max-width: 1000px;
  margin: 18px 0 34px;
  font-size: clamp(3.8rem, 6.65vw, 6.35rem);
  font-weight: 720;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-shadow: 0 8px 38px rgba(0, 0, 0, 0.2);
}

.hero-copy > p:last-of-type {
  max-width: 670px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 1.55vw, 1.35rem);
  font-weight: 450;
  letter-spacing: 0.01em;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 30px;
}

.hero-primary {
  border-radius: 999px;
  padding: 12px 23px;
  color: #fff;
  background: var(--apple-blue);
  font-size: 0.92rem;
  font-weight: 550;
  transition: transform 180ms ease, background 180ms ease;
}

.hero-primary:hover {
  transform: scale(1.025);
  background: var(--apple-blue-hover);
}

.hero-link {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
}

.hero-link span {
  margin-left: 4px;
  font-size: 1.25em;
}

.hero-stats {
  position: absolute;
  z-index: 3;
  right: max(24px, calc((100vw - 1280px) / 2));
  bottom: 32px;
  left: max(24px, calc((100vw - 1280px) / 2));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(26px) saturate(150%);
}

.hero-stats div {
  display: grid;
  min-height: 92px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.hero-stats strong {
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -0.04em;
}

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

.project-overview,
.control-strip {
  display: none;
}

.workspace {
  max-width: 1480px;
  margin: 0 auto;
  padding: 118px 24px 130px;
}

.mobile-workflow-nav {
  display: none;
}

.planner-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.6fr) minmax(330px, 0.74fr);
  grid-template-areas:
    "setup setup"
    "days detail"
    "spots spots";
  gap: 30px;
  align-items: start;
}

.planner-grid > * {
  min-width: 0;
}

.builder-controls,
.day-board,
.detail-panel,
.spot-library {
  border-radius: var(--apple-radius);
  background: var(--apple-surface);
  box-shadow: var(--apple-shadow);
}

.planner-grid > .builder-controls {
  grid-area: setup;
}

.day-board {
  grid-area: days;
}

.detail-panel {
  grid-area: detail;
}

.spot-library {
  grid-area: spots;
}

.builder-controls {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 1.06fr) minmax(390px, 1fr) minmax(280px, 0.72fr);
  gap: 22px;
  padding: 36px;
}

.setup-heading {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 5px;
}

.setup-heading .section-kicker {
  color: var(--apple-blue);
}

.setup-heading h3 {
  margin: 5px 0 0;
  font-size: clamp(2rem, 3vw, 3.25rem);
  font-weight: 680;
  letter-spacing: -0.05em;
  line-height: 1.04;
}

.setup-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.setup-status span,
.setup-status strong {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-live {
  color: var(--apple-green);
  background: #eaf6ed;
}

#planReadiness {
  color: var(--apple-orange);
  background: #fff3e8;
}

#planReadiness[data-state="ready"] {
  color: var(--apple-green);
  background: #eaf6ed;
}

.route-controls,
.customer-brief,
.plan-dashboard {
  min-width: 0;
  border-radius: 22px;
  padding: 22px;
  background: var(--apple-surface-soft);
}

.route-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-content: start;
  gap: 13px;
}

.trip-field,
.vehicle-control,
.field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.trip-field > span,
.vehicle-control > span,
.field > span,
.mini-label {
  color: var(--apple-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.trip-title-field {
  grid-column: span 4;
}

.route-controls > .trip-field:nth-of-type(2) {
  grid-column: span 2;
}

.vehicle-control {
  grid-column: 1 / -1;
}

.route-controls > .trip-field:nth-of-type(3),
.route-controls > .trip-field:nth-of-type(4) {
  grid-column: span 3;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  outline: none;
  padding: 0 13px;
  color: var(--apple-text);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--apple-line);
  font-size: 0.84rem;
  font-weight: 560;
  transition: box-shadow 180ms ease, background 180ms ease;
}

input {
  min-height: 44px;
}

textarea {
  min-height: 92px;
  padding-top: 12px;
  resize: vertical;
}

input:focus,
textarea:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--apple-blue), 0 0 0 4px rgba(0, 113, 227, 0.11);
}

.compact-tier-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.compact-tier-button,
.filter-button,
.day-action-button,
.text-button,
.icon-button,
.history-status,
.preview-tool-button,
.output-action-button {
  border: 0;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.compact-tier-button {
  display: grid;
  min-width: 0;
  min-height: 54px;
  align-content: center;
  gap: 2px;
  border-radius: 13px;
  padding: 8px;
  color: var(--apple-muted);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--apple-line);
}

.compact-tier-button strong {
  font-size: 0.78rem;
  font-weight: 600;
}

.compact-tier-button small {
  display: none;
}

.compact-tier-button.active {
  color: #fff;
  background: var(--apple-text);
  box-shadow: none;
}

.mini-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.mini-section-head strong {
  font-size: 0.95rem;
  font-weight: 650;
}

.mini-section-head span {
  color: var(--apple-muted);
  font-size: 0.68rem;
}

.customer-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.customer-field-grid .trip-field:nth-child(1),
.customer-field-grid .trip-field:nth-child(2) {
  grid-column: span 2;
}

.customer-wide-field {
  grid-column: 1 / -1;
}

.budget-field input {
  color: var(--apple-green);
  font-weight: 650;
}

.plan-dashboard {
  display: grid;
  align-content: start;
  gap: 10px;
}

.plan-health-card,
.quote-card {
  display: grid;
  gap: 4px;
  border-radius: 16px;
  padding: 16px;
}

.plan-health-card {
  color: #843f00;
  background: #fff1e6;
}

.quote-card {
  color: #0e5528;
  background: #eaf6ed;
}

.plan-health-card > span,
.quote-card > span {
  font-size: 0.67rem;
  font-weight: 650;
  opacity: 0.75;
}

.plan-health-card strong,
.quote-card strong {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.plan-health-card small,
.quote-card small {
  font-size: 0.68rem;
  line-height: 1.45;
}

.quote-breakdown {
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid rgba(14, 85, 40, 0.14);
  overflow-wrap: anywhere;
}

.quote-settings {
  padding-top: 4px;
}

.quote-settings summary {
  color: var(--apple-blue);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
}

.quote-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.quote-field-grid label {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.quote-field-grid span {
  color: var(--apple-muted);
  font-size: 0.65rem;
}

.trip-controls {
  position: relative;
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.text-button,
.history-status,
.day-input {
  min-height: 40px;
  border-radius: 999px;
}

.icon-button {
  width: 40px;
  color: var(--apple-blue);
  background: #edf6ff;
  font-size: 1rem;
}

.day-input {
  display: flex;
  width: 92px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  background: var(--apple-surface-soft);
  box-shadow: inset 0 0 0 1px var(--apple-line);
}

.day-input span {
  color: var(--apple-muted);
  font-size: 0.7rem;
}

.day-input input {
  width: 28px;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.text-button,
.history-status {
  padding: 0 15px;
  color: var(--apple-text);
  background: #ededf0;
  font-size: 0.75rem;
  font-weight: 600;
}

.text-button:not(.quiet) {
  color: #fff;
  background: var(--apple-blue);
}

.text-button:hover,
.history-status:hover {
  transform: translateY(-1px);
}

.history-panel {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 10px);
  width: min(420px, calc(100vw - 40px));
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--apple-line);
  border-radius: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(24px);
}

.history-panel[hidden] {
  display: none;
}

.history-item,
.history-empty {
  border-radius: 14px;
  padding: 12px;
  color: var(--apple-muted);
  background: var(--apple-surface-soft);
  font-size: 0.75rem;
}

.history-item + .history-item {
  margin-top: 7px;
}

.day-board,
.detail-panel,
.spot-library {
  padding: 30px;
}

.panel-heading,
.day-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.panel-heading .section-kicker,
.day-board-head .section-kicker {
  color: var(--apple-blue);
}

.panel-heading h3,
.day-board-head h3,
.detail-panel h3 {
  margin: 5px 0 0;
  font-size: 1.55rem;
  font-weight: 660;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.panel-heading > span,
#activeDayLabel,
#detailCount {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--apple-blue);
  background: #edf6ff;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.day-board-head {
  display: grid;
  grid-template-columns: 1fr;
}

.day-board-actions {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(145px, 1fr) repeat(3, minmax(86px, auto));
  gap: 8px;
}

.day-action-button {
  min-height: 38px;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--apple-blue);
  background: #edf6ff;
  font-size: 0.72rem;
  font-weight: 600;
}

.day-action-button:hover {
  background: #e2f0fd;
}

.day-action-button.danger {
  color: var(--apple-red);
  background: #fff0f1;
}

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

.day-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--apple-surface-soft);
  box-shadow: inset 0 0 0 1px var(--apple-line);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.day-card:hover {
  transform: translateY(-2px);
}

.day-card.active {
  background: #f2f8ff;
  box-shadow: inset 0 0 0 2px var(--apple-blue), 0 12px 30px rgba(0, 113, 227, 0.1);
}

.day-card-select {
  display: block;
  width: 100%;
  min-height: 210px;
  border: 0;
  padding: 20px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.day-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.day-card-head strong {
  font-size: 1.2rem;
  font-weight: 660;
  letter-spacing: -0.03em;
}

.day-card-head span {
  max-width: 52%;
  overflow: hidden;
  color: var(--apple-muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-route-line {
  margin: 15px 0 0;
  color: var(--apple-text);
  font-size: 0.84rem;
  font-weight: 580;
  line-height: 1.55;
}

.day-empty {
  margin: 30px 0 0;
  color: var(--apple-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.day-spot-list {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.day-spot-list li {
  display: grid;
  gap: 2px;
  border-radius: 12px;
  padding: 9px 11px;
  background: #fff;
}

.day-spot-list strong {
  font-size: 0.75rem;
}

.day-spot-list small {
  color: var(--apple-muted);
  font-size: 0.66rem;
}

.day-delete-button {
  display: none;
}

.detail-panel {
  position: sticky;
  top: 76px;
}

.route-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.route-summary div,
.current-day-summary {
  display: grid;
  gap: 4px;
  border-radius: 15px;
  padding: 14px;
  background: var(--apple-surface-soft);
}

.route-summary span,
.current-day-summary > span {
  color: var(--apple-muted);
  font-size: 0.65rem;
  font-weight: 550;
}

.route-summary strong,
.current-day-summary strong {
  font-size: 0.83rem;
  font-weight: 630;
}

.current-day-summary {
  margin-bottom: 16px;
  color: #fff;
  background: var(--apple-text);
}

.current-day-summary > span {
  color: rgba(255, 255, 255, 0.58);
}

.detail-panel > .field,
.detail-panel > .mini-label {
  margin-top: 16px;
}

.day-hotel-options,
.selected-spots,
.project-row {
  display: grid;
  gap: 9px;
}

.hotel-tier-button,
.project-toggle {
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: 15px;
  padding: 13px;
  color: var(--apple-text);
  background: var(--apple-surface-soft);
  box-shadow: inset 0 0 0 1px var(--apple-line);
  text-align: left;
}

.hotel-tier-button strong,
.project-toggle strong {
  font-size: 0.78rem;
  font-weight: 630;
}

.hotel-tier-button small,
.hotel-tier-button span,
.project-toggle small,
.project-toggle span,
.hotel-empty,
.empty-detail {
  color: var(--apple-muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.hotel-tier-button.active,
.project-toggle.active {
  color: #fff;
  background: var(--apple-text);
  box-shadow: none;
}

.hotel-tier-button.active small,
.hotel-tier-button.active span,
.project-toggle.active small,
.project-toggle.active span {
  color: rgba(255, 255, 255, 0.65);
}

.selected-card {
  margin-top: 12px;
  border-top: 1px solid var(--apple-line);
  padding-top: 16px;
}

.selected-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.selected-card-head > div {
  display: grid;
  gap: 4px;
}

.selected-card-head strong {
  font-size: 0.9rem;
}

.selected-card-head small {
  color: var(--apple-muted);
  font-size: 0.66rem;
  line-height: 1.45;
}

.remove-button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: var(--apple-red);
  background: #fff0f1;
}

.project-caution {
  color: #ffb9b9;
  font-size: 0.64rem;
  font-style: normal;
  line-height: 1.4;
}

.spot-library {
  padding-bottom: 34px;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.search-box > span {
  color: var(--apple-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--apple-muted);
  background: #ededf0;
  font-size: 0.72rem;
  font-weight: 600;
}

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

.spot-list {
  display: grid;
  max-height: 750px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  overflow: auto;
  padding: 2px 6px 2px 2px;
  scrollbar-color: #c7c7cc transparent;
  scrollbar-width: thin;
}

.spot-card {
  display: grid;
  min-width: 0;
  min-height: 154px;
  grid-template-columns: 116px minmax(0, 1fr);
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  padding: 0;
  color: var(--apple-text);
  background: var(--apple-surface-soft);
  box-shadow: inset 0 0 0 1px var(--apple-line);
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.spot-card:hover {
  transform: translateY(-3px);
  background: #fff;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.09);
}

.spot-thumb {
  display: block;
  min-height: 100%;
  background: var(--hero-image) 30% 50% / auto 130% no-repeat;
}

.spot-thumb-1 { background-position: 48% 55%; }
.spot-thumb-2 { background-position: 67% 45%; }
.spot-thumb-3 { background-position: 78% 54%; }
.spot-thumb-4 { background-position: 18% 59%; }
.spot-thumb-5 { background-position: 87% 43%; }

.spot-card-body {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 8px;
  padding: 16px;
}

.spot-card-body > strong {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.meta-row span,
.tag-row span {
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--apple-muted);
  background: #ededf0;
  font-size: 0.6rem;
  font-weight: 550;
}

.spot-card p,
.tag-row {
  display: none;
}

.output-section {
  display: grid;
  max-width: 1480px;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.58fr);
  gap: 30px;
  align-items: start;
  margin: 0 auto;
  padding: 0 24px 130px;
}

.output-copy {
  position: sticky;
  top: 76px;
  overflow: hidden;
  border-radius: 34px;
  padding: 42px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 0%, rgba(0, 113, 227, 0.38), transparent 38%),
    #000;
  box-shadow: var(--apple-shadow);
}

.output-copy .section-kicker {
  color: #63a9ff;
}

.output-copy h2 {
  margin: 12px 0 16px;
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.output-copy > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.88rem;
  line-height: 1.65;
}

.output-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 28px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.output-metrics span {
  display: grid;
  gap: 5px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.output-metrics small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.65rem;
}

.output-metrics strong {
  font-size: 1rem;
  font-weight: 620;
}

.output-actions {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.output-action-button {
  min-height: 46px;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 0.78rem;
  font-weight: 600;
}

.output-action-button.primary {
  color: #fff;
  background: var(--apple-blue);
}

.output-action-button.secondary {
  color: var(--apple-blue);
  background: #fff;
}

.output-action-button:hover {
  transform: scale(1.012);
}

.itinerary-preview {
  overflow: hidden;
  border-radius: 34px;
  background: #fff;
  box-shadow: var(--apple-shadow);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--apple-line);
}

.preview-toolbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #30d158;
}

.preview-toolbar strong {
  font-size: 0.82rem;
}

.preview-toolbar small {
  color: var(--apple-muted);
  font-size: 0.67rem;
}

.preview-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.preview-tool-button {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--apple-blue);
  background: #edf6ff;
  font-size: 0.67rem;
  font-weight: 600;
}

.doc-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--apple-green);
  background: #eaf6ed;
  font-size: 0.67rem;
  font-weight: 600;
}

.itinerary-document {
  min-width: 0;
  background: #fff;
}

.route-cover {
  position: relative;
  display: flex;
  min-height: 170px;
  align-items: flex-end;
  padding: 28px;
  overflow: hidden;
  color: #fff;
  background: #09223a var(--hero-image) center 45% / cover no-repeat;
}

.route-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.62));
}

.route-cover strong {
  position: relative;
  z-index: 1;
  max-width: 760px;
  font-size: clamp(1.65rem, 3vw, 3rem);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

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

.route-meta-row div,
.route-client-brief div {
  display: grid;
  gap: 4px;
  padding: 16px 20px;
  border-right: 1px solid var(--apple-line);
}

.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(--apple-muted);
  font-size: 0.64rem;
}

.route-meta-row strong,
.route-client-brief strong {
  font-size: 0.8rem;
  font-weight: 620;
  line-height: 1.4;
}

.route-client-brief {
  background: var(--apple-surface-soft);
}

.route-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.route-table th {
  padding: 13px 18px;
  color: var(--apple-muted);
  background: #fff;
  border-bottom: 1px solid var(--apple-line);
  font-size: 0.65rem;
  font-weight: 600;
  text-align: left;
}

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

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

.route-table td {
  position: relative;
  padding: 18px;
  border-bottom: 1px solid var(--apple-line);
  vertical-align: top;
}

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

.editable-field {
  min-height: 1.35em;
  border-radius: 8px;
  outline: none;
  padding: 3px 5px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.editable-field:hover {
  background: rgba(0, 113, 227, 0.05);
}

.editable-field:focus {
  background: #fff;
  box-shadow: 0 0 0 2px var(--apple-blue);
}

.date-editable {
  font-size: 0.82rem;
  font-weight: 650;
}

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

.route-line {
  font-size: 0.9rem;
  font-weight: 630;
  line-height: 1.5;
}

.route-projects {
  color: var(--apple-blue);
  font-size: 0.74rem;
  font-weight: 550;
  line-height: 1.5;
}

.route-note,
.stay-cell {
  color: var(--apple-muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.preview-row-remove,
.preview-row-insert {
  margin-top: 7px;
  border: 0;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--apple-blue);
  background: #edf6ff;
  font-size: 0.6rem;
}

.preview-row-remove {
  color: var(--apple-red);
  background: #fff0f1;
}

.itinerary-output {
  display: none;
}

.footer {
  display: flex;
  max-width: 1280px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 28px 24px 36px;
  border-top: 1px solid var(--apple-line);
  color: var(--apple-muted);
  font-size: 0.68rem;
}

@media (max-width: 1180px) {
  .builder-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-dashboard {
    grid-column: 1 / -1;
    grid-template-columns: minmax(170px, 0.7fr) repeat(2, minmax(220px, 1fr));
    align-items: center;
  }

  .plan-dashboard .mini-section-head {
    display: grid;
    margin: 0;
  }

  .quote-settings {
    grid-column: 1 / -1;
  }

  .spot-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    min-height: 50px;
    padding: 0 16px;
  }

  .brand small,
  .topnav a:not(.nav-primary) {
    display: none;
  }

  .topnav {
    gap: 0;
  }

  .hero {
    min-height: 620px;
  }

  .hero-copy {
    margin-top: -65px;
  }

  .hero h1 {
    font-size: clamp(3.05rem, 11.4vw, 4.75rem);
  }

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

  .hero-stats div {
    min-height: 78px;
    padding: 12px 6px;
  }

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

  .workspace {
    padding: 74px 14px 90px;
  }

  .mobile-workflow-nav {
    position: sticky;
    z-index: 100;
    top: 58px;
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(22px) saturate(170%);
  }

  .mobile-workflow-nav button {
    display: grid;
    min-width: 0;
    min-height: 48px;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 5px;
    border: 0;
    border-radius: 13px;
    padding: 6px;
    color: var(--apple-muted);
    background: transparent;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: left;
  }

  .mobile-workflow-nav button span {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e8e8ed;
    font-size: 0.66rem;
  }

  .mobile-workflow-nav button.active {
    color: #fff;
    background: var(--apple-text);
  }

  .mobile-workflow-nav button.active span {
    color: var(--apple-text);
    background: #fff;
  }

  .planner-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "setup"
      "days"
      "spots"
      "detail";
  }

  .builder-controls,
  .day-board,
  .detail-panel,
  .spot-library {
    border-radius: 24px;
  }

  .builder-controls {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 22px;
  }

  .setup-heading,
  .trip-controls,
  .plan-dashboard {
    grid-column: 1;
  }

  .setup-heading {
    align-items: flex-start;
  }

  .setup-heading h3 {
    font-size: 2.4rem;
  }

  .route-controls,
  .customer-brief,
  .plan-dashboard {
    grid-column: 1;
  }

  .plan-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .plan-dashboard .mini-section-head,
  .quote-settings {
    grid-column: 1 / -1;
  }

  .trip-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .day-input {
    width: auto;
  }

  .day-board,
  .detail-panel,
  .spot-library {
    padding: 22px;
  }

  .detail-panel {
    position: static;
  }

  .spot-list {
    grid-template-columns: 1fr;
  }

  body[data-mobile-panel="setup"] .planner-grid > .spot-library,
  body[data-mobile-panel="setup"] .planner-grid > .day-board,
  body[data-mobile-panel="setup"] .planner-grid > .detail-panel,
  body[data-mobile-panel="days"] .planner-grid > .builder-controls,
  body[data-mobile-panel="days"] .planner-grid > .spot-library,
  body[data-mobile-panel="days"] .planner-grid > .detail-panel,
  body[data-mobile-panel="spots"] .planner-grid > .builder-controls,
  body[data-mobile-panel="spots"] .planner-grid > .day-board,
  body[data-mobile-panel="spots"] .planner-grid > .detail-panel,
  body[data-mobile-panel="detail"] .planner-grid > .builder-controls,
  body[data-mobile-panel="detail"] .planner-grid > .spot-library,
  body[data-mobile-panel="detail"] .planner-grid > .day-board {
    display: none;
  }

  .output-section {
    grid-template-columns: 1fr;
    padding: 0 14px 90px;
  }

  .output-copy {
    position: static;
  }

  .itinerary-preview {
    overflow-x: auto;
  }

  .route-table {
    min-width: 720px;
  }
}

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

  .hero h1 {
    font-size: 3.25rem;
  }

  .hero-copy > p:last-of-type {
    font-size: 0.9rem;
  }

  .hero-actions {
    gap: 16px;
    margin-top: 24px;
  }

  .hero-primary {
    padding: 10px 18px;
  }

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

  .mobile-workflow-nav button {
    grid-template-columns: 1fr;
    justify-items: center;
    font-size: 0.6rem;
    text-align: center;
  }

  .setup-heading {
    display: grid;
  }

  .setup-status {
    justify-content: flex-start;
  }

  .route-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trip-title-field,
  .route-controls > .trip-field:nth-of-type(2),
  .vehicle-control,
  .route-controls > .trip-field:nth-of-type(3),
  .route-controls > .trip-field:nth-of-type(4) {
    grid-column: 1 / -1;
  }

  .customer-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-field-grid .trip-field:nth-child(1),
  .customer-field-grid .trip-field:nth-child(2),
  .customer-wide-field {
    grid-column: 1 / -1;
  }

  .plan-dashboard {
    grid-template-columns: 1fr;
  }

  .plan-dashboard .mini-section-head,
  .quote-settings {
    grid-column: 1;
  }

  .trip-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .day-board-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #activeDayLabel {
    grid-column: 1 / -1;
    justify-content: center;
  }

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

  .spot-card {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .output-copy {
    border-radius: 26px;
    padding: 30px 24px;
  }

  .preview-toolbar {
    display: grid;
  }

  .preview-tools {
    justify-content: flex-start;
  }

  .footer {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .topbar,
  .hero,
  .workspace,
  .output-copy,
  .preview-toolbar,
  .footer {
    display: none !important;
  }

  body,
  .output-section,
  .itinerary-preview {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
}

/* Apple-native creation studio */
.studio-intro {
  display: grid;
  max-width: 1040px;
  justify-items: center;
  margin: 0 auto 64px;
  text-align: center;
}

.studio-intro p {
  margin: 0 0 12px;
  color: var(--apple-blue);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.15em;
}

.studio-intro h2 {
  margin: 0;
  font-size: clamp(3.42rem, 6.65vw, 6.08rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.04;
}

.studio-intro > span {
  max-width: 680px;
  margin-top: 30px;
  color: var(--apple-muted);
  font-size: clamp(1rem, 1.7vw, 1.32rem);
  line-height: 1.55;
}

.studio-shell {
  overflow: clip;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 38px;
  background: #e9e9ee;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.14);
}

.studio-toolbar {
  position: sticky;
  z-index: 80;
  top: 52px;
  display: grid;
  min-height: 70px;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(250, 250, 252, 0.86);
  backdrop-filter: blur(30px) saturate(180%);
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.window-controls i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}

.window-controls i:nth-child(2) {
  background: #febc2e;
}

.window-controls i:nth-child(3) {
  background: #28c840;
}

.studio-document {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.studio-document span {
  color: var(--apple-muted);
  font-size: 0.62rem;
}

.studio-document strong {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  border-radius: 12px;
  padding: 3px;
  background: #e8e8ed;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.035);
}

.studio-tabs a {
  border-radius: 9px;
  padding: 7px 15px;
  color: var(--apple-muted);
  font-size: 0.7rem;
  font-weight: 580;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.studio-tabs a:hover,
.studio-tabs a.active {
  color: var(--apple-text);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.studio-sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--apple-muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.studio-sync i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 4px rgba(48, 209, 88, 0.12);
}

.studio-shell .planner-grid {
  gap: 14px;
  padding: 14px;
}

.studio-shell .builder-controls,
.studio-shell .day-board,
.studio-shell .detail-panel,
.studio-shell .spot-library {
  border-radius: 26px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 28px rgba(0, 0, 0, 0.055);
}

.studio-shell .builder-controls {
  padding: 30px;
}

.studio-shell .day-board,
.studio-shell .detail-panel,
.studio-shell .spot-library {
  padding: 26px;
}

.studio-shell .route-controls,
.studio-shell .customer-brief,
.studio-shell .plan-dashboard {
  background: #f5f5f7;
}

.studio-shell .day-grid {
  display: grid;
  grid-template-columns: none;
  grid-auto-columns: minmax(310px, 44%);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 2px 14px;
  scroll-padding-inline: 2px;
  scroll-snap-type: inline mandatory;
  scrollbar-color: #b8b8bd transparent;
  scrollbar-width: thin;
}

.studio-shell .day-card {
  scroll-snap-align: start;
}

.studio-shell .day-card-select {
  min-height: 260px;
}

.studio-shell .day-card.active {
  background: #fff;
}

.studio-shell .spot-list {
  max-height: 680px;
}

.studio-shell .trip-controls {
  padding-top: 4px;
  border-top: 1px solid var(--apple-line);
}

.studio-shell .text-button,
.studio-shell .history-status,
.studio-shell .icon-button,
.studio-shell .day-input {
  min-height: 36px;
}

@media (max-width: 900px) {
  .studio-intro {
    margin-bottom: 42px;
  }

  .studio-intro h2 {
    font-size: clamp(2.95rem, 12.35vw, 4.75rem);
  }

  .studio-shell {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .studio-toolbar {
    position: relative;
    top: auto;
    min-height: 58px;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 12px;
    border: 1px solid var(--apple-line);
    border-radius: 18px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.9);
  }

  .window-controls,
  .studio-tabs,
  .studio-sync {
    display: none;
  }

  .studio-document {
    justify-items: center;
    text-align: center;
  }

  .studio-shell .planner-grid {
    padding: 0;
  }

  .studio-shell .builder-controls,
  .studio-shell .day-board,
  .studio-shell .detail-panel,
  .studio-shell .spot-library {
    border-radius: 24px;
  }

  .studio-shell .day-grid {
    grid-auto-columns: minmax(280px, 84%);
  }
}

@media (max-width: 560px) {
  .studio-intro {
    margin-bottom: 34px;
  }

  .studio-intro h2 {
    font-size: 2.9rem;
  }

  .studio-intro > span {
    max-width: 390px;
    font-size: 0.92rem;
  }

  .studio-shell .builder-controls {
    padding: 20px;
  }

  .studio-shell .day-board,
  .studio-shell .detail-panel,
  .studio-shell .spot-library {
    padding: 20px;
  }

  .studio-shell .day-grid {
    grid-template-columns: none;
    grid-auto-columns: 88%;
  }
}

@media print {
  .studio-intro,
  .studio-toolbar {
    display: none !important;
  }
}

/* Compact two-track studio layout */
@media (min-width: 901px) {
  .studio-shell .planner-grid {
    grid-template-areas:
      "setup setup"
      "days detail"
      "spots detail";
  }

  .studio-shell .detail-panel {
    grid-area: detail;
    align-self: start;
  }

  .studio-shell .spot-library {
    grid-area: spots;
  }

  .studio-shell .spot-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Subtle motion system */
.hero {
  background-position: center calc(42% + var(--hero-shift, 0px));
  will-change: background-position;
}

.studio-shell {
  position: relative;
  isolation: isolate;
  --pointer-x: 50%;
  --pointer-y: 20%;
}

.studio-shell::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  opacity: 0.5;
  background: radial-gradient(620px circle at var(--pointer-x) var(--pointer-y), rgba(255, 255, 255, 0.72), transparent 64%);
  pointer-events: none;
  transition: opacity 280ms ease;
}

.studio-shell > * {
  position: relative;
  z-index: 1;
}

.studio-shell:not(:hover)::before {
  opacity: 0.22;
}

.motion-reveal {
  opacity: 0;
  transform: translateY(36px) scale(0.985);
  transition:
    opacity 760ms cubic-bezier(.2,.8,.2,1),
    transform 760ms cubic-bezier(.2,.8,.2,1);
}

.motion-reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.day-card.just-selected {
  animation: day-focus 560ms cubic-bezier(.2,.8,.2,1);
}

@keyframes day-focus {
  0% { transform: scale(0.965); }
  55% { transform: scale(1.018); }
  100% { transform: scale(1); }
}

.spot-card:active,
.compact-tier-button:active,
.day-action-button:active,
.text-button:active,
.output-action-button:active {
  transform: scale(0.975);
}

.quote-card strong,
.plan-health-card strong,
.hero-stats strong {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .motion-reveal,
  .motion-reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .studio-shell::before {
    display: none;
  }
}
