/* EaseAway planner entry shell
 *
 * One layout contract owns destination, origin, trip details, lodging, planning
 * method, and the primary action. Everything is namespaced so legacy planner
 * cards can keep rendering while the entry flow stays independently testable.
 */
html {
  overflow-x: hidden;
}

.tp-setup {
  container-type: inline-size;
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
  color: var(--ea-ink, #20271f);
}

body.tp-companion {
  overflow-x: clip;
}

.tp-setup__intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.tp-setup__eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--ea-terracotta, #e8734a);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tp-setup__intro h1 {
  max-width: 17ch;
  margin: 0;
  color: var(--ea-forest, #1b2e1f);
  font: 700 clamp(2rem, 4vw, 3.6rem)/0.98 "Fraunces", Georgia, serif;
  letter-spacing: -0.035em;
}

.tp-setup__intro p {
  max-width: 54ch;
  margin: 0;
  color: var(--ea-forest-soft, #58705e);
  font-size: 0.93rem;
  line-height: 1.6;
}

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

.tp-setup__step {
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--ea-sand, #e7dec8);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 10px 28px rgba(27, 46, 31, 0.055);
}

.tp-setup__step:nth-child(3) {
  grid-column: 1 / -1;
}

.tp-setup:not(.has-destination) .tp-setup__step:first-child {
  grid-column: 1 / -1;
}

.tp-setup__destinations {
  width: 100%;
  margin-top: 16px;
}

.tp-setup__step-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 18px 20px 12px;
}

.tp-setup__number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ea-forest, #1b2e1f);
  font-size: 0.78rem;
  font-weight: 800;
}

.tp-setup__step-head h2 {
  margin: 0;
  color: var(--ea-forest, #1b2e1f);
  font: 700 1.15rem/1.2 "Fraunces", Georgia, serif;
}

.tp-setup__step-head p {
  margin: 3px 0 0;
  color: var(--ea-forest-soft, #58705e);
  font-size: 0.78rem;
  line-height: 1.45;
}

.tp-setup__body {
  min-width: 0;
  padding: 0 20px 20px;
}

/* Existing destination/origin controls become normal-flow rows in step one. */
.tp-setup .dest-picker,
.tp-setup .tp-origin-strip {
  position: static;
  z-index: auto;
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.tp-setup .dest-picker {
  padding: 0;
}

.tp-setup .dest-picker-inner {
  max-width: none;
}

.tp-setup .dest-picker > .dest-picker-inner > h2,
.tp-setup .dest-picker > .dest-picker-inner > p {
  display: none;
}

.tp-setup .dest-picker-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) minmax(340px, 1fr);
  gap: 14px 20px;
  align-items: end;
  margin: 0;
}

/* Location intent contract: only one of exact destination, straight-line
   discovery, or verified driving-time discovery is active at a time. */
.tp-travel-search {
  display: grid;
  gap: 14px;
}

.tp-search-intents {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tp-search-intent {
  display: grid;
  min-width: 0;
  min-height: 76px;
  gap: 4px;
  align-content: start;
  padding: 12px 13px;
  border: 1px solid var(--ea-sand, #e7dec8);
  border-radius: 10px;
  color: var(--ea-forest-soft, #58705e);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.tp-search-intent.is-active {
  border-color: var(--ea-forest, #1b2e1f);
  color: var(--ea-forest, #1b2e1f);
  background: #edf3e9;
  box-shadow: 0 0 0 2px rgba(27, 46, 31, 0.09);
}

.tp-search-intent__title {
  min-width: 0;
  overflow-wrap: anywhere;
  font: 700 0.82rem/1.25 "Inter", sans-serif;
}

.tp-search-intent__copy {
  min-width: 0;
  overflow-wrap: anywhere;
  font: 500 0.69rem/1.35 "Inter", sans-serif;
}

.tp-travel-search[data-intent="destination"] .dest-picker-filters,
.tp-travel-search[data-intent="destination"] .tp-travel-search__origin,
.tp-travel-search[data-intent="radius"] .dest-picker-field,
.tp-travel-search[data-intent="radius"] .tp-origin-strip label[for="tripDriveLimit"],
.tp-travel-search[data-intent="radius"] #tripDriveLimit,
.tp-travel-search[data-intent="drive"] .tp-travel-search__destination {
  display: none !important;
}

.tp-travel-search[data-intent="destination"] .dest-picker-controls,
.tp-travel-search[data-intent="radius"] .dest-picker-controls {
  display: block;
}

.tp-travel-search[data-intent="radius"] .dest-picker-filters {
  display: grid;
  grid-template-columns: auto minmax(110px, 0.65fr) minmax(180px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

.tp-travel-search[data-intent="drive"] .tp-origin-strip {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto auto minmax(120px, 0.45fr);
}

.tp-travel-search .tp-origin-help {
  grid-column: 1 / -1;
}

.tp-discovery {
  min-height: 48px;
}

.tp-discovery-note {
  margin: 0;
  padding: 11px 13px;
  border-radius: 9px;
  color: var(--ea-forest-soft, #58705e);
  background: #f6f2e9;
  font-size: 0.76rem;
  line-height: 1.5;
}

.tp-discovery-note--warning {
  color: #704121;
  background: #fff7e6;
  border: 1px solid #efd59a;
}

.tp-discovery-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.tp-discovery-result {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--ea-sand, #e7dec8);
  border-radius: 8px;
  color: var(--ea-forest, #1b2e1f);
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: 700 0.76rem/1.35 "Inter", sans-serif;
}

.tp-discovery-result:hover,
.tp-discovery-result:focus-visible {
  border-color: var(--ea-terracotta, #e8734a);
  outline: none;
  box-shadow: 0 0 0 2px rgba(232, 115, 74, 0.12);
}

.tp-setup .dest-picker-label,
.tp-setup .dest-filter-label {
  color: var(--ea-forest-soft, #58705e);
}

.tp-setup .dest-picker-filters {
  justify-content: flex-start;
  color: var(--ea-forest-soft, #58705e);
}

.tp-setup .tp-maptoggle-btn,
.tp-setup .tp-help-btn {
  color: var(--ea-forest, #1b2e1f);
  border-color: var(--ea-sand, #e7dec8);
  background: #fff;
}

.tp-setup .tp-origin-strip {
  margin-top: 14px;
  padding: 14px 0 0;
  border-top: 1px solid var(--ea-sand, #e7dec8);
}

.tp-setup #configBar {
  display: block !important;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.tp-setup #configBar .config-inner {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.tp-setup #configBar .config-summary,
.tp-setup #configBar .ea-trip-sentence {
  display: none !important;
}

.tp-setup .tp-occasion-brief {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(0, 1.6fr);
  gap: 24px;
  align-items: end;
  margin: 16px 0 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--ea-sand, #e7dec8);
  background: transparent;
  box-shadow: none;
}

.tp-setup .tp-occasion-copy h2 {
  font-size: 1.05rem;
}

.tp-setup .tp-occasion-copy p {
  margin-bottom: 0;
}

.tp-lodging {
  display: grid;
  grid-template-columns: minmax(210px, 0.55fr) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  margin-top: 14px;
}

.tp-lodging__field {
  display: grid;
  gap: 6px;
}

.tp-lodging__field span:first-child {
  color: var(--ea-forest-soft, #58705e);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tp-lodging select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--ea-sand, #e7dec8);
  border-radius: 8px;
  color: var(--ea-ink, #20271f);
  background: #fff;
  font: 600 0.88rem/1 "Inter", sans-serif;
}

.tp-lodging__status {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ea-forest-soft, #58705e);
  background: #f6f2e9;
  font-size: 0.78rem;
  line-height: 1.45;
}

.tp-lodging__status a {
  color: var(--ea-terracotta, #e8734a);
  font-weight: 700;
}

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

.tp-method {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 154px;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--ea-sand, #e7dec8);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tp-method:hover {
  transform: translateY(-1px);
  border-color: #cdbf9f;
  box-shadow: 0 8px 18px rgba(27, 46, 31, 0.07);
}

.tp-method:has(input:checked) {
  border-color: var(--ea-terracotta, #e8734a);
  box-shadow: 0 0 0 2px rgba(232, 115, 74, 0.16);
}

.tp-method input {
  position: absolute;
  top: 16px;
  right: 16px;
}

.tp-method__badge {
  width: max-content;
  max-width: calc(100% - 30px);
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--ea-forest, #1b2e1f);
  background: #edf3e9;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tp-method__title {
  color: var(--ea-forest, #1b2e1f);
  font: 700 1.05rem/1.15 "Fraunces", Georgia, serif;
}

.tp-method__copy {
  color: var(--ea-forest-soft, #58705e);
  font-size: 0.76rem;
  line-height: 1.5;
}

.tp-setup__action {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--ea-sand, #e7dec8);
  border-radius: 12px;
  background: #f6f2e9;
}

.tp-setup__action p {
  flex: 1 1 320px;
  margin: 0;
  color: var(--ea-forest-soft, #58705e);
  font-size: 0.78rem;
  line-height: 1.5;
}

.tp-setup__start {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--ea-terracotta, #e8734a);
  box-shadow: 0 8px 18px rgba(232, 115, 74, 0.24);
  cursor: pointer;
  font: 800 0.9rem/1 "Inter", sans-serif;
}

.tp-setup__start:disabled {
  color: #687064;
  background: #e8e2d8;
  box-shadow: none;
  cursor: not-allowed;
}

.tp-planning-paths {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.tp-planning-paths .mode-btn {
  min-height: 42px;
  white-space: normal;
}

.tp-ai-path-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--ea-terracotta, #e8734a);
  color: var(--ea-forest-soft, #58705e);
  background: #fff8f1;
  font-size: 0.78rem;
  line-height: 1.5;
}

/* Planner workspace layer. The setup and the generated/manual workspace share
   one spacing, type, surface, and control grammar instead of looking like two
   unrelated products. */
body.tp-companion #tpSplit {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 56px;
  overflow: hidden;
  border: 1px solid var(--ea-sand, #e7dec8);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 14px 36px rgba(27, 46, 31, 0.07);
}

body.tp-companion #tpSplit[hidden] {
  display: none !important;
}

body.tp-companion #tpSplit.tp-map-off {
  display: block;
}

body.tp-companion #tpSplit.tp-map-off .tp-split-left {
  width: 100%;
  max-width: none;
  padding: 20px;
}

body.tp-companion .planner-content {
  width: 100%;
  max-width: none;
  padding: 0;
  color: var(--ea-ink, #20271f);
  font-family: "Inter", sans-serif;
}

body.tp-companion .dest-hero {
  min-height: 170px;
  margin: 0 0 14px;
  padding: 24px;
  border-radius: 13px;
}

body.tp-companion .dest-hero h2,
body.tp-companion .sec-header h3,
body.tp-companion .ai-panel-title,
body.tp-companion .locked-title {
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.015em;
}

body.tp-companion .tp-planning-paths,
body.tp-companion #plannerModeBar {
  padding: 6px;
  border: 1px solid var(--ea-sand, #e7dec8);
  border-radius: 11px;
  background: #f6f2e9;
}

body.tp-companion #plannerModeBar .mode-btn {
  min-height: 44px;
  border-radius: 8px;
  color: var(--ea-forest-soft, #58705e);
  font-size: 0.78rem;
  font-weight: 750;
}

body.tp-companion #plannerModeBar .mode-btn.active {
  color: var(--ea-forest, #1b2e1f);
  background: #fff;
  box-shadow: 0 2px 9px rgba(27, 46, 31, 0.08);
}

body.tp-companion #secTabs.section-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 6px;
  border: 1px solid var(--ea-sand, #e7dec8);
  border-radius: 11px;
  background: #fff;
}

body.tp-companion #secTabs .sec-tab {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  font: 700 0.75rem/1.2 "Inter", sans-serif;
}

body.tp-companion #tabContent,
body.tp-companion #aiSuggestionsPanel {
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--ea-sand, #e7dec8);
  border-radius: 13px;
  background: #fff;
}

body.tp-companion #tabContent .sec-header,
body.tp-companion #aiSuggestionsPanel .sec-header {
  margin: 0 0 16px;
  padding: 0 0 13px;
  border-bottom: 1px solid var(--ea-sand, #e7dec8);
}

body.tp-companion #tabContent .sec-header h3,
body.tp-companion #aiSuggestionsPanel .sec-header h3 {
  margin: 0;
  color: var(--ea-forest, #1b2e1f);
  font-size: 1.35rem;
  line-height: 1.2;
}

body.tp-companion #tabContent .sec-header p,
body.tp-companion #aiSuggestionsPanel .sec-header p {
  margin: 4px 0 0;
  color: var(--ea-forest-soft, #58705e);
  font-size: 0.78rem;
}

body.tp-companion .activity-grid,
body.tp-companion .rest-grid,
body.tp-companion .grocery-list,
body.tp-companion .budget-grid,
body.tp-companion .ai-suggest-grid {
  gap: 14px;
}

body.tp-companion .activity-card,
body.tp-companion .rest-card,
body.tp-companion .grocery-card,
body.tp-companion .budget-box,
body.tp-companion .ai-suggest-card,
body.tp-companion .rec-card {
  border-color: var(--ea-sand, #e7dec8);
  border-radius: 11px;
  background: #fffdfa;
  box-shadow: 0 5px 14px rgba(27, 46, 31, 0.045);
}

@media (max-width: 900px) {
  .tp-setup__steps {
    grid-template-columns: 1fr;
  }

  .tp-setup__step:nth-child(3) {
    grid-column: auto;
  }

  .tp-setup__intro,
  .tp-setup .tp-occasion-brief {
    grid-template-columns: 1fr;
  }

  .tp-setup .dest-picker-controls,
  .tp-setup #configBar .config-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tp-methods {
    grid-template-columns: 1fr;
  }

  .tp-search-intents,
  .tp-discovery-results {
    grid-template-columns: 1fr;
  }

  .tp-method {
    min-height: 0;
  }
}

@media (min-width: 901px) {
  .tp-setup .dest-picker-controls,
  body.tp-companion .tp-setup .tp-occasion-brief {
    grid-template-columns: 1fr;
  }

  .tp-setup #configBar .config-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.tp-companion .tp-setup .tp-occasion-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .tp-travel-search[data-intent="radius"] .dest-picker-filters {
    grid-template-columns: auto minmax(92px, 0.55fr) minmax(0, 1fr);
  }

  .tp-travel-search[data-intent="radius"] .dest-picker-filters > label {
    grid-column: 1;
    grid-row: 1;
  }

  .tp-travel-search[data-intent="radius"] #destRadiusFilter {
    grid-column: 2;
    grid-row: 1;
  }

  .tp-travel-search[data-intent="radius"] .dest-filter-of {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
  }

  .tp-travel-search[data-intent="radius"] #destNearMeBtn {
    grid-column: 1;
    grid-row: 2;
  }

  .tp-travel-search[data-intent="radius"] #tpMapToggleBtn {
    grid-column: 2;
    grid-row: 2;
  }

  .tp-travel-search[data-intent="radius"] .tp-help-btn {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
  }

  .tp-travel-search[data-intent="radius"] .tp-origin-strip,
  .tp-travel-search[data-intent="drive"] .tp-origin-strip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .tp-travel-search .tp-origin-strip > label[for="tripOriginInput"] {
    grid-column: 1;
    grid-row: 1;
  }

  .tp-travel-search .tp-origin-strip #tripOriginInput {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
  }

  .tp-travel-search .tp-origin-strip #destSetOriginBtn {
    grid-column: 3;
    grid-row: 1;
  }

  .tp-travel-search .tp-origin-strip #destClearOriginBtn {
    grid-column: 3;
    grid-row: 2;
  }

  .tp-travel-search[data-intent="drive"] .tp-origin-strip > label[for="tripDriveLimit"] {
    grid-column: 1;
    grid-row: 3;
  }

  .tp-travel-search[data-intent="drive"] .tp-origin-strip #tripDriveLimit {
    grid-column: 2 / -1;
    grid-row: 3;
  }

  .tp-travel-search .tp-origin-strip .tp-origin-help {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .tp-travel-search[data-intent="radius"] .tp-origin-strip .tp-origin-help {
    grid-row: 3;
  }
}

@media (max-width: 620px) {
  .tp-setup {
    width: min(100% - 20px, 1180px);
    margin-top: 12px;
  }

  .tp-setup__intro {
    gap: 12px;
  }

  .tp-setup__intro h1 {
    max-width: none;
    font-size: 2.2rem;
  }

  .tp-setup__step-head,
  .tp-setup__body {
    padding-right: 14px;
    padding-left: 14px;
  }

  .tp-setup .dest-picker-controls,
  .tp-setup #configBar .config-inner,
  .tp-lodging,
  .tp-planning-paths {
    grid-template-columns: 1fr;
  }

  .tp-setup .dest-picker-filters,
  .tp-setup .tp-origin-strip {
    align-items: stretch;
  }

  .tp-setup .dest-picker-filters > *,
  .tp-setup .tp-origin-strip input,
  .tp-setup .tp-origin-strip select,
  .tp-setup .tp-origin-strip button {
    max-width: none;
  }

  .tp-setup__start {
    width: 100%;
  }

  .tp-travel-search[data-intent="radius"] .dest-picker-filters,
  .tp-travel-search[data-intent="drive"] .tp-origin-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tp-travel-search[data-intent="radius"] .dest-filter-of,
  .tp-travel-search .tp-origin-help {
    grid-column: auto;
  }

  body.tp-companion #tpSplit {
    width: min(100% - 20px, 1180px);
    border-radius: 13px;
  }

  body.tp-companion #tpSplit.tp-map-off .tp-split-left,
  body.tp-companion #tabContent,
  body.tp-companion #aiSuggestionsPanel {
    padding: 12px;
  }
}

/* Component-width protection: the planner also collapses correctly when it is
   embedded in a narrow app pane, not only when the entire browser is narrow. */
@container (max-width: 900px) {
  .tp-setup__steps,
  .tp-setup__intro,
  .tp-setup .tp-occasion-brief,
  .tp-methods {
    grid-template-columns: 1fr;
  }

  .tp-setup__step:nth-child(3) {
    grid-column: auto;
  }
}

@container (max-width: 620px) {
  .tp-setup .dest-picker-controls,
  .tp-setup #configBar .config-inner,
  .tp-setup .tp-occasion-fields,
  .tp-lodging,
  .tp-planning-paths {
    grid-template-columns: 1fr !important;
  }

  .tp-setup__intro {
    gap: 12px;
  }

  .tp-setup__intro h1 {
    max-width: none;
    font-size: 2.2rem;
  }

  .tp-setup__step-head,
  .tp-setup__body {
    padding-right: 14px;
    padding-left: 14px;
  }

  .tp-setup__start {
    width: 100%;
  }

  .tp-search-intents,
  .tp-discovery-results {
    grid-template-columns: 1fr;
  }
}
