/* CDO Discovery 0.4.49
 * Search business logic remains in Discovery; shared visual structure is owned by CDO LAB.
 * Layout shell, quantity controls, search context/refine, summary and results typography
 * use the same canonical LAB classes as Products/Cruise where the function is shared.
 */

.cdo-discovery-wrap,
.cdo-discovery-results-page,
.cdo-discovery-people-popover,
.cdo-discovery-calendar-layer {
  /* Visual colors come from the canonical CDO LAB root tokens. Discovery owns layout only. */
  --cdo-discovery-font: var(--cdo-font-family, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif);
  --cdo-discovery-control-height: 56px;
  --cdo-discovery-control-radius: var(--cdo-ds-radius-control, var(--cdo-radius-sm, 10px));
  --cdo-discovery-inner-gutter: 10px;
  color: var(--cdo-navy);
  font-family: var(--cdo-discovery-font);
}

.cdo-discovery-wrap,
.cdo-discovery-wrap *,
.cdo-discovery-results-page,
.cdo-discovery-results-page *,
.cdo-discovery-people-popover,
.cdo-discovery-people-popover *,
.cdo-discovery-calendar-layer,
.cdo-discovery-calendar-layer * {
  box-sizing: border-box;
}

/* Semantic controls keep native accessibility while owning their visual contract. */
.cdo-discovery-wrap button.cdo-discovery-tab,
.cdo-discovery-wrap button.cdo-discovery-control,
.cdo-discovery-wrap button.cdo-discovery-submit,
.cdo-discovery-calendar-layer button {
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  font-family: var(--cdo-discovery-font);
  letter-spacing: normal;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
}

/* ---------- Search shell ---------- */
.cdo-discovery-wrap {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: visible;
}

.cdo-discovery-layout { min-width: 0; }

.cdo-discovery-shell {
  width: 100%;
  margin: 0;
  overflow: visible;
  border: 1px solid var(--cdo-line);
  border-radius: var(--cdo-radius-lg);
  background: var(--cdo-surface);
  box-shadow: none;
}

.cdo-discovery-wrap--compact .cdo-discovery-shell {
  width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Compact search is rendered inside the shared Search Refine shell.
 * The outer details owns border/radius; Discovery owns one inset for its tabs
 * and fields, matching the visual breathing room already validated in Cruise. */
.cdo-discovery-wrap--compact {
  --cdo-discovery-refine-gutter: 18px;
}

.cdo-discovery-wrap--compact .cdo-discovery-tabs {
  padding-left: var(--cdo-discovery-refine-gutter);
  padding-right: var(--cdo-discovery-refine-gutter);
}

.cdo-discovery-wrap--compact .cdo-discovery-form {
  padding: 18px var(--cdo-discovery-refine-gutter) 4px;
}

/* ---------- Tabs ---------- */
.cdo-discovery-tabs {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 8px var(--cdo-discovery-inner-gutter);
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--cdo-line);
  scrollbar-width: none;
}

.cdo-discovery-tabs::-webkit-scrollbar { display: none; }

.cdo-discovery-wrap button.cdo-discovery-tab {
  position: relative;
  display: flex;
  flex: 1 0 124px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 124px;
  min-height: 54px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--cdo-muted);
  font-family: var(--cdo-discovery-font);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.cdo-discovery-wrap button.cdo-discovery-tab i {
  flex: 0 0 auto;
  color: currentColor;
  font-size: 17px;
}

.cdo-discovery-wrap button.cdo-discovery-tab:hover {
  border-color: color-mix(in srgb, var(--cdo-secondary) 24%, transparent);
  background: color-mix(in srgb, var(--cdo-secondary) 9%, var(--cdo-surface));
  color: var(--cdo-navy);
}

.cdo-discovery-wrap button.cdo-discovery-tab[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--cdo-primary) 14%, transparent);
  background: color-mix(in srgb, var(--cdo-primary) 10%, var(--cdo-surface));
  color: var(--cdo-primary);
}

.cdo-discovery-wrap button.cdo-discovery-tab:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--cdo-secondary) 38%, transparent);
  outline-offset: 2px;
}

/* ---------- Form ---------- */
.cdo-discovery-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  align-items: end;
  gap: 12px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 22px 24px 24px;
}

.cdo-discovery-field--term {
  grid-column: 1;
}

.cdo-discovery-optional {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.cdo-discovery-optional__summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0;
  padding: 2px 0;
  color: var(--cdo-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}

.cdo-discovery-optional__summary::-webkit-details-marker { display: none; }
.cdo-discovery-optional__summary::marker { display: none; content: ''; }
.cdo-discovery-optional__summary i { color: var(--cdo-primary); }
.cdo-discovery-optional__summary small { font-size: 11px; font-weight: 600; }

.cdo-discovery-optional__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding-top: 12px;
}

.cdo-discovery-field {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.cdo-discovery-field__label {
  display: block;
  min-height: 16px;
  margin: 0;
  padding: 0 2px;
  color: var(--cdo-navy);
  font-family: var(--cdo-discovery-font);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.cdo-discovery-wrap .cdo-discovery-control {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  height: var(--cdo-discovery-control-height);
  min-height: var(--cdo-discovery-control-height);
  margin: 0;
  padding: 0 15px;
  overflow: hidden;
  border: 1px solid var(--cdo-line);
  border-radius: var(--cdo-discovery-control-radius);
  background: var(--cdo-surface);
  color: var(--cdo-navy);
  box-shadow: none;
  font-family: var(--cdo-discovery-font);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.cdo-discovery-wrap button.cdo-discovery-date-trigger,
.cdo-discovery-wrap button.cdo-discovery-people-trigger {
  user-select: none;
  cursor: pointer;
}

.cdo-discovery-wrap .cdo-discovery-control:hover {
  border-color: color-mix(in srgb, var(--cdo-secondary) 52%, transparent);
}

.cdo-discovery-wrap .cdo-discovery-control:focus-within,
.cdo-discovery-wrap .cdo-discovery-control:focus-visible,
.cdo-discovery-wrap button.cdo-discovery-people-trigger[aria-expanded="true"],
.cdo-discovery-wrap button.cdo-discovery-date-trigger[aria-expanded="true"] {
  outline: 0;
  border-color: var(--cdo-secondary);
  background: var(--cdo-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cdo-secondary) 10%, transparent);
}

.cdo-discovery-wrap .cdo-discovery-control > i:first-child {
  flex: 0 0 auto;
  width: 20px;
  color: var(--cdo-primary);
  font-size: 18px;
  text-align: center;
}


.cdo-discovery-wrap .cdo-discovery-control input[type="text"] {
  display: block;
  width: 100%;
  min-width: 0;
  height: 24px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--cdo-navy);
  box-shadow: none;
  font-family: var(--cdo-discovery-font);
  font-size: 15px;
  font-weight: 500;
  line-height: 24px;
}

.cdo-discovery-wrap .cdo-discovery-control input[type="text"]::placeholder {
  color: var(--cdo-muted);
  opacity: 1;
}


.cdo-discovery-wrap .cdo-discovery-date-value,
.cdo-discovery-wrap button.cdo-discovery-people-trigger [data-people-summary] {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--cdo-navy);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cdo-discovery-date-value--placeholder {
  color: var(--cdo-muted);
  font-weight: 500;
}

.cdo-discovery-wrap .cdo-discovery-control__chevron {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--cdo-muted);
  font-size: 11px;
}

.cdo-discovery-wrap button.cdo-discovery-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  height: var(--cdo-discovery-control-height);
  min-height: var(--cdo-discovery-control-height);
  margin: 0;
  padding: 0 18px;
  border: 1px solid var(--cdo-primary);
  border-radius: var(--cdo-discovery-control-radius);
  background: var(--cdo-primary);
  color: var(--cdo-surface);
  box-shadow: none;
  font-family: var(--cdo-discovery-font);
  font-size: 14px;
  font-weight: var(--cdo-ds-weight-strong, 700);
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.cdo-discovery-wrap button.cdo-discovery-submit:hover {
  border-color: var(--cdo-primary);
  background: var(--cdo-primary);
  color: var(--cdo-surface);
  opacity: 0.92;
  text-decoration: none;
}

.cdo-discovery-wrap button.cdo-discovery-submit:active {
  transform: scale(0.98);
}

.cdo-discovery-wrap button.cdo-discovery-submit:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cdo-secondary) 38%, transparent);
  outline-offset: 2px;
}


.cdo-discovery-field-error {
  display: block;
  margin: -2px 2px 0;
  color: var(--cdo-danger);
  font-size: 11px;
  font-weight: var(--cdo-ds-weight-strong, 700);
  line-height: 1.25;
}

.cdo-discovery-field-error[hidden] {
  display: none;
}

.cdo-discovery-wrap--validation-error .cdo-discovery-field--term .cdo-discovery-control {
  border-color: var(--cdo-danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cdo-danger) 8%, transparent);
}

/* ---------- Traveler picker portal ---------- */
.cdo-discovery-people-popover {
  position: fixed;
  z-index: 200000;
  display: grid;
  width: 340px;
  max-width: calc(100vw - 24px);
  max-height: min(430px, calc(100vh - 32px));
  margin: 0;
  padding: 14px 18px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--cdo-line);
  border-radius: var(--cdo-quantity-radius, var(--cdo-radius-lg));
  background: var(--cdo-quantity-background, var(--cdo-surface));
  box-shadow: none;
}

.cdo-discovery-people-popover[hidden],
.cdo-discovery-calendar-layer[hidden] {
  display: none;
}

.cdo-discovery-counter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 12px 0;
}

.cdo-discovery-counter-row + .cdo-discovery-counter-row {
  border-top: 1px solid var(--cdo-line);
}

.cdo-discovery-counter-copy {
  min-width: 0;
}

.cdo-discovery-counter-copy strong {
  color: var(--cdo-quantity-title-color, var(--cdo-navy));
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

/* Quantity visual grammar is owned entirely by LAB shared-quantity-control-v1.
 * Discovery keeps only hook class names in markup for JS; no consumer visual CSS lives here. */

.cdo-discovery-people-note {
  margin: 2px 0 0;
  padding: 10px 0 2px;
  border-top: 1px solid var(--cdo-line);
  color: var(--cdo-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

/* ---------- Calendar portal ---------- */
.cdo-discovery-calendar-layer {
  position: fixed;
  z-index: 200000;
  width: min(520px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 32px));
  margin: 0;
  padding: 14px 16px 12px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--cdo-line);
  border-radius: 20px;
  background: var(--cdo-surface);
  box-shadow: none;
}

.cdo-discovery-calendar-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  margin: 0 0 6px;
}

.cdo-discovery-calendar-close,
.cdo-discovery-calendar-nav {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  text-decoration: none;
  user-select: none;
  cursor: pointer;
}

.cdo-discovery-calendar-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: transparent;
  color: var(--cdo-muted);
}

.cdo-discovery-calendar-nav {
  width: 40px;
  height: 40px;
  border-radius: var(--cdo-radius-sm);
  background: transparent;
  color: var(--cdo-navy);
  font-size: 15px;
}

.cdo-discovery-calendar-close:hover {
  background: color-mix(in srgb, var(--cdo-secondary) 9%, var(--cdo-surface));
  color: var(--cdo-navy);
}

.cdo-discovery-calendar-nav:hover {
  background: color-mix(in srgb, var(--cdo-primary) 8%, var(--cdo-surface));
  color: var(--cdo-primary);
}

.cdo-discovery-calendar-nav:disabled {
  background: transparent;
  color: var(--cdo-muted);
  opacity: .35;
  cursor: not-allowed;
}

.cdo-discovery-calendar-close:focus-visible,
.cdo-discovery-calendar-nav:focus-visible,
.cdo-discovery-calendar-clear:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--cdo-secondary) 42%, transparent);
  outline-offset: 2px;
}

.cdo-discovery-calendar-navrow {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
}

.cdo-discovery-calendar-navrow strong {
  color: var(--cdo-navy);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
  text-transform: none;
}

.cdo-discovery-calendar-months {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}


.cdo-discovery-calendar-month {
  min-width: 0;
  overflow: hidden;
}
.cdo-discovery-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  min-width: 0;
}

.cdo-discovery-calendar-dow {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  color: var(--cdo-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.cdo-discovery-calendar-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--cdo-radius-sm);
  background: transparent;
  color: var(--cdo-navy);
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  user-select: none;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.cdo-discovery-calendar-day--empty {
  visibility: hidden;
  pointer-events: none;
}

.cdo-discovery-calendar-layer button.cdo-discovery-calendar-day:not(.cdo-discovery-calendar-day--disabled):not(.cdo-discovery-calendar-day--start):not(.cdo-discovery-calendar-day--end):not(.cdo-discovery-calendar-day--range):hover {
  background: color-mix(in srgb, var(--cdo-primary) 8%, var(--cdo-surface));
  color: var(--cdo-navy);
}

.cdo-discovery-calendar-layer button.cdo-discovery-calendar-day:focus-visible {
  outline: 2px solid var(--cdo-primary);
  outline-offset: 2px;
}

.cdo-discovery-calendar-layer button.cdo-discovery-calendar-day--disabled {
  background: transparent;
  color: var(--cdo-muted);
  opacity: .36;
  text-decoration: none;
  cursor: not-allowed;
}

/* Shared CDO date-range semantic contract: start = teal, middle = neutral, end = purple. */
.cdo-discovery-calendar-layer button.cdo-discovery-calendar-day--range {
  background: var(--cdo-ds-color-neutral-soft, var(--cdo-soft));
  color: var(--cdo-ds-color-heading, var(--cdo-navy));
}

.cdo-discovery-calendar-layer button.cdo-discovery-calendar-day--start,
.cdo-discovery-calendar-layer button.cdo-discovery-calendar-day--start:hover {
  background: color-mix(in srgb, var(--cdo-ds-color-secondary, var(--cdo-secondary)) 18%, var(--cdo-surface));
  color: var(--cdo-ds-color-secondary, var(--cdo-secondary));
  opacity: 1;
  font-weight: var(--cdo-ds-weight-strong, 700);
}

.cdo-discovery-calendar-layer button.cdo-discovery-calendar-day--end,
.cdo-discovery-calendar-layer button.cdo-discovery-calendar-day--end:hover {
  background: color-mix(in srgb, var(--cdo-ds-color-primary, var(--cdo-primary)) 14%, var(--cdo-surface));
  color: var(--cdo-ds-color-primary, var(--cdo-primary));
  opacity: 1;
  font-weight: var(--cdo-ds-weight-strong, 700);
}

.cdo-discovery-calendar-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 34px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid color-mix(in srgb, var(--cdo-line) 75%, transparent);
}

.cdo-discovery-calendar-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 0;
  min-height: 30px;
  margin: 0;
  padding: 0 9px;
  border: 0;
  border-radius: var(--cdo-radius-sm);
  background: transparent;
  color: var(--cdo-muted);
  box-shadow: none;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  text-transform: none;
  user-select: none;
  cursor: pointer;
}

.cdo-discovery-calendar-clear:hover {
  background: color-mix(in srgb, var(--cdo-secondary) 9%, var(--cdo-surface));
  color: var(--cdo-navy);
  text-decoration: none;
}

/* ---------- Results page ----------
 * Layout/rhythm is owned by LAB shared-search-layout-v1. Discovery only owns
 * its result cards and optional source metadata. */
.cdo-discovery-results-page {
  min-height: 70vh;
  padding: 0;
  background: var(--cdo-surface);
}
.cdo-discovery-results-hero { border: 0; }
.cdo-discovery-date-summary > .cdo-search-summary { width: 100%; }
.cdo-discovery-results-sources { display: flex; flex-wrap: wrap; gap: 8px; }
.cdo-discovery-results-sources span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--cdo-line); border-radius: 999px; background: var(--cdo-surface); color: var(--cdo-muted); font-size: 11px; font-weight: 700; }
.cdo-discovery-results-sources i { color: var(--cdo-primary); }

.cdo-discovery-results-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cdo-discovery-results-grid .cdo-product-card { height: 100%; margin: 0; }
.cdo-discovery-results-grid .cdo-product-card__body { height: 100%; }
.cdo-discovery-results-grid .cdo-product-card__cta { margin-top: auto; }

.cdo-discovery-empty { display: grid; justify-items: center; gap: 8px; padding: 48px 28px; border: 1px solid var(--cdo-line); border-radius: 22px; background: var(--cdo-surface); text-align: center; }
.cdo-discovery-empty > i { color: var(--cdo-secondary); font-size: 32px; }
.cdo-discovery-empty h2 { margin: 5px 0; color: var(--cdo-navy); }
.cdo-discovery-empty p { max-width: 620px; margin: 0; color: var(--cdo-muted); }

.cdo-discovery-result-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--cdo-line); border-radius: 22px; background: var(--cdo-surface); }
.cdo-discovery-result-card__media { display: block; height: 190px; overflow: hidden; background: var(--cdo-soft); }
.cdo-discovery-result-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cdo-discovery-result-card__body { display: grid; gap: 9px; padding: 18px; }
.cdo-discovery-result-card__body > span { color: var(--cdo-primary); font-size: var(--cdo-ds-text-caption, 13px); font-weight: var(--cdo-ds-weight-strong, 700); text-transform: uppercase; }
.cdo-discovery-result-card__body h3 { margin: 0; font-size: 21px; font-weight: var(--cdo-ds-weight-heading, 800); }
.cdo-discovery-result-card__body h3 a { color: var(--cdo-navy); text-decoration: none; }
.cdo-discovery-result-card__body p { margin: 0; color: var(--cdo-muted); font-size: var(--cdo-ds-text-description, 15px); }
.cdo-discovery-result-card__price { margin-top: auto; padding-top: 8px; }
.cdo-discovery-result-card__price .cdo-price--card { display: inline-flex; flex-direction: column; gap: 4px; line-height: 1; }
.cdo-discovery-result-card__price .cdo-price--card small { font-size: 11px; line-height: 1.15; font-weight: 800; color: #aaaaaa; text-transform: uppercase; }
.cdo-discovery-result-card__price .cdo-price--card strong { font-size: 22px; line-height: 1; font-weight: 800; letter-spacing: -.035em; color: #1f3556; }
.cdo-discovery-result-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; margin-top: 8px; padding: 0 18px; border-radius: 14px; background: var(--cdo-primary); color: var(--cdo-surface); font-size: 13px; font-weight: var(--cdo-ds-weight-strong, 700); text-decoration: none; text-transform: uppercase; }

/* ---------- Tablet ---------- */
@media (max-width: 1180px) {
  .cdo-discovery-results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .cdo-discovery-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .cdo-discovery-field--term { grid-column: 1 / -1; }

  .cdo-discovery-field--destination,
  .cdo-discovery-field--dates,
  .cdo-discovery-field--people,
  .cdo-discovery-wrap button.cdo-discovery-submit {
    grid-column: auto;
  }
}

/* Compact desktop/tablet calendar: one month before mobile bottom sheet. */
@media (max-width: 1020px) and (min-width: 721px) {
  .cdo-discovery-calendar-layer { width: min(400px, calc(100vw - 32px)); }
  .cdo-discovery-calendar-navrow { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 10px; }
  .cdo-discovery-calendar-navrow [data-calendar-title="second"] { display: none; }
  .cdo-discovery-calendar-navrow .cdo-discovery-calendar-nav:last-child { grid-column: 3; }
  .cdo-discovery-calendar-months { grid-template-columns: 1fr; gap: 0; }
  .cdo-discovery-calendar-month:nth-child(2) { display: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .cdo-discovery-wrap { --cdo-discovery-control-height: 52px; --cdo-discovery-control-radius: var(--cdo-ds-radius-control, var(--cdo-radius-sm, 10px)); }
  .cdo-discovery-shell { border-radius: 18px; }

  .cdo-discovery-tabs { gap: 5px; padding: 7px 8px; }

  .cdo-discovery-wrap button.cdo-discovery-tab {
    flex: 0 0 auto;
    min-width: 104px;
    min-height: 50px;
    padding: 8px 10px;
    gap: 6px;
    font-size: 10px;
  }
  .cdo-discovery-wrap button.cdo-discovery-tab i { font-size: 15px; }

  .cdo-discovery-form { grid-template-columns: 1fr; gap: 11px; padding: 16px 12px 14px; }
  .cdo-discovery-wrap--compact { --cdo-discovery-refine-gutter: 12px; }
  .cdo-discovery-wrap--compact .cdo-discovery-tabs { padding-left: var(--cdo-discovery-refine-gutter); padding-right: var(--cdo-discovery-refine-gutter); }
  .cdo-discovery-wrap--compact .cdo-discovery-form { padding: 14px var(--cdo-discovery-refine-gutter) 2px; }
  .cdo-discovery-field--term,
  .cdo-discovery-field--destination,
  .cdo-discovery-field--people,
  .cdo-discovery-wrap button.cdo-discovery-submit { grid-column: auto; }
  .cdo-discovery-wrap button.cdo-discovery-submit { width: 100%; min-width: 0; }

  body.cdo-discovery-layer-open { overflow: hidden; }
  body.cdo-discovery-layer-open::before {
    content: "";
    position: fixed;
    z-index: 199999;
    inset: 0;
    background: color-mix(in srgb, var(--cdo-navy) 24%, transparent);
  }

  .cdo-discovery-people-popover,
  .cdo-discovery-calendar-layer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    max-height: 86vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--cdo-radius-lg) var(--cdo-radius-lg) 0 0;
    box-shadow: none;
  }

  .cdo-discovery-people-popover { padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); }
  .cdo-discovery-calendar-layer { padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); }

  .cdo-discovery-calendar-head { align-items: flex-start; margin-bottom: 10px; }
  .cdo-discovery-calendar-close { background: var(--cdo-surface); }
  .cdo-discovery-calendar-navrow { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 8px; }
  .cdo-discovery-calendar-navrow [data-calendar-title="second"] { display: none; }
  .cdo-discovery-calendar-navrow .cdo-discovery-calendar-nav:last-child { grid-column: 3; }
  .cdo-discovery-calendar-months { grid-template-columns: 1fr; gap: 0; }
  .cdo-discovery-calendar-month:nth-child(2) { display: none; }
  .cdo-discovery-calendar-grid { gap: 4px 2px; }
  .cdo-discovery-calendar-day { height: 40px; }

  .cdo-discovery-results-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .cdo-discovery-counter-row { gap: 12px; }
}

/* Results pagination — same compact rhythm used across CDO search surfaces. */
.cdo-discovery-pagination { display:flex; justify-content:center; align-items:center; gap:7px; margin-top:28px; flex-wrap:wrap; }
.cdo-discovery-pagination__item { display:inline-flex; align-items:center; justify-content:center; min-width:40px; height:40px; padding:0 12px; border:1px solid var(--cdo-line); border-radius:10px; background:var(--cdo-surface); color:var(--cdo-navy); font-weight:700; text-decoration:none; }
.cdo-discovery-pagination__item:hover { border-color:var(--cdo-primary); color:var(--cdo-primary); }
.cdo-discovery-pagination__item.is-active { background:var(--cdo-primary); border-color:var(--cdo-primary); color:var(--cdo-surface); }

/* ---------- Search-first progressive context ---------- */
.cdo-discovery-field__label small {
  color: var(--cdo-muted);
  font-size: 11px;
  font-weight: 600;
}

@media (max-width: 980px) {
  .cdo-discovery-form {
    grid-template-columns: minmax(0, 1fr) 160px;
  }
}

@media (max-width: 720px) {
  .cdo-discovery-form {
    grid-template-columns: 1fr;
  }
  .cdo-discovery-field--term,
  .cdo-discovery-submit,
  .cdo-discovery-optional {
    grid-column: 1;
  }
  .cdo-discovery-optional__fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) and (min-width: 721px) {
  .cdo-discovery-field--term { grid-column: 1; }
  .cdo-discovery-wrap button.cdo-discovery-submit { grid-column: 2; }
}

.cdo-discovery-wrap--compact .cdo-discovery-optional__summary { display: none; }
.cdo-discovery-wrap--compact .cdo-discovery-optional__fields { padding-top: 0; }

/* 0.4.47 — whole-phrase rolling prompt; no layout padding/gap changes. */
.cdo-discovery-wrap .cdo-discovery-prompt-host {
  position: relative;
}

.cdo-discovery-wrap .cdo-discovery-prompt-stage {
  position: absolute;
  z-index: 3;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--cdo-muted);
  opacity: 1;
  transition: opacity 140ms ease;
}

.cdo-discovery-wrap .cdo-discovery-prompt-stage--hidden { opacity: 0; }

.cdo-discovery-wrap .cdo-discovery-prompt-phrase {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  will-change: transform, opacity;
}

.cdo-discovery-wrap input.cdo-discovery-prompt-input[type="text"] {
  position: relative;
  z-index: 2;
}

.cdo-discovery-wrap input.cdo-discovery-prompt-input[type="text"]::placeholder {
  color: transparent;
  opacity: 0;
}
