/* ===========================================================================
   THE RESULTS SURFACE  (rp-)
   Loaded only when idrive_rp_enabled(). Unlayered, by design: app.css is
   unlayered, and an unlayered declaration beats one inside any @layer, so
   wrapping this in @layer would silently hand the page back to app.css.

   Every class here is new. Nothing reuses booking-shell__*, results-* or
   result-card, so app.css's .results-header / .results-boundary /
   .results-tools block stops applying by construction rather than by a
   cascade fight.
   ========================================================================= */

:root{
  --rp-header-h:88px;
  --rp-alert:#8A2718;          /* 7.62:1 on white */
}
@media (max-width:760px){ :root{ --rp-header-h:76px } }

/* --- the page shell -----------------------------------------------------
   Sticky preconditions. Nothing in this ancestor chain may gain overflow,
   transform, filter, contain or container-type: any one of them silently
   kills position:sticky on .rp-summary and drops the address suggestions
   behind the header. There is no warning when it happens. */
.search-page,
.search-page > .container,
.rp{ overflow:visible }

.rp{
  --rp-content:min(1096px, 100%);
  display:grid;
  gap:clamp(16px,2vw,24px);
  padding-block:clamp(20px,3vw,28px) clamp(48px,6vw,88px);
}

.rp-skip{
  position:absolute; left:-9999px; top:0;
  padding:12px 18px; border-radius:var(--corr-r-sm);
  background:var(--corr-action); color:#fff; z-index:var(--z-skip);
}
.rp-skip:focus{ left:16px; top:16px }

/* --- the sticky summary ------------------------------------------------ */
.rp-summary{
  position:sticky; top:calc(var(--rp-header-h) + 8px); z-index:var(--z-raised);
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:12px 20px;
  min-height:64px; padding:12px 20px;
  border-radius:var(--corr-r-md);
  background:var(--corr-surface);
  box-shadow:inset 0 0 0 1px var(--corr-hair), 0 1px 2px rgba(4,17,13,.04);
}
.rp-summary__line{
  margin:0; max-width:none;
  display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 8px;
  font-size:.9375rem; line-height:1.4; color:var(--corr-ink);
}
/* Punctuation, not prose, so generated content is right here: it keeps the
   separator glued to the item that follows it, which is what stops a lone
   dot being orphaned at the end of a wrapped line on a narrow screen. */
.rp-summary__line > span + span::before{
  content:"·"; margin-inline-end:8px; color:var(--rp-muted);
}
.rp-summary__edit{
  display:inline-flex; align-items:center; gap:8px;
  min-height:44px; padding:0 16px;
  border:1px solid var(--corr-rule); border-radius:999px;
  background:transparent; color:var(--corr-action);
  font:600 .875rem/1 Archivo, system-ui, sans-serif;
  cursor:pointer;
}
.rp-summary__edit:hover{ border-color:var(--corr-action); background:var(--corr-stone) }
.rp-summary__chev{ transition:transform 160ms ease }
.rp-summary__edit[aria-expanded="true"] .rp-summary__chev{ transform:rotate(180deg) }

/* While the editor is open the bar has nothing left to summarise, and a
   sticky bar over an open form is just something in the way. */
.rp:has(.rp-editor.is-open) .rp-summary{ position:static }

.rp-editor[hidden]{ display:none }

/* --- the results band -------------------------------------------------- */
.rp-results{ display:grid; gap:clamp(12px,1.6vw,16px) }

.rp-heading{
  margin:0; max-width:22ch;
  font-family:var(--corr-serif); font-weight:400;
  font-size:clamp(1.625rem,3.2vw,2.125rem); line-height:1.2;
  letter-spacing:-.02em; color:var(--corr-ink);
  text-wrap:balance;
}
.rp-heading:focus-visible{ outline:2px solid var(--corr-action); outline-offset:6px }

.rp-assumption{
  margin:0; max-width:68ch;
  font-size:.875rem; line-height:1.55; color:var(--corr-body);
}
.rp-assumption__more{
  margin-left:6px; padding:0;
  border:0; background:none; cursor:pointer;
  color:var(--corr-action); font:inherit;
  text-decoration:underline; text-underline-offset:3px;
}
.rp-moves{ margin:0; padding:14px 18px; border-radius:var(--corr-r-sm); background:var(--corr-stone) }
.rp-moves[hidden]{ display:none }
.rp-moves ul{ margin:0; padding-left:1.1rem }
.rp-moves li{ max-width:none; font-size:.875rem; line-height:1.6; color:var(--corr-body) }

/* --- sort -------------------------------------------------------------- */
.rp-controls{
  display:flex; flex-wrap:wrap; align-items:center; gap:12px 28px;
  padding-block:4px;
}
.rp-controls__group{ display:flex; flex-wrap:wrap; align-items:center; gap:10px 12px }
.rp-controls__note{
  flex:0 0 100%; margin:0; max-width:none;
  font-size:.8125rem; line-height:1.5; color:var(--corr-body);
}
.rp-controls__note a{ color:var(--corr-action) }
.rp-controls__label{
  margin:0; font:600 .75rem/1 Archivo, system-ui, sans-serif;
  letter-spacing:.09em; text-transform:uppercase; color:var(--rp-muted);
}
.rp-controls__list{ display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:0; list-style:none }
.rp-controls__list li{ max-width:none }
.rp-chip{
  display:inline-flex; align-items:center; min-height:40px; padding:0 16px;
  border:1px solid var(--corr-hair); border-radius:999px;
  background:var(--corr-surface); color:var(--corr-body);
  font-size:.875rem; text-decoration:none;
}
.rp-chip:hover{ border-color:var(--corr-rule); color:var(--corr-ink) }
.rp-chip.is-on{
  border-color:var(--corr-action); background:var(--corr-action); color:#F4F9F5;
}

/* --- the card ---------------------------------------------------------- */
.rp-list{ list-style:none; margin:0; padding:0; display:grid; gap:12px }
.rp-list > li{ max-width:none }   /* beats corridor-v1 `p,li{max-width:...}` */

/* Three columns, because there are exactly three things a reader compares
   across these cards: which vehicle it is, what it carries, and what it
   costs. The spec's fourth column was a photograph; the catalogue publishes
   no image for a class, and a placeholder box would be a 168px hole doing no
   work. Capacity takes that column instead, which is the more useful thing
   to be able to read straight down. */
.rp-card__inner{
  display:grid; gap:20px 24px; align-items:start;
  /* 248, measured: "From Rs 12,000" + the 13px qualifier + two 8px gaps
     needs 221px, and at 216 the qualifier wrapped onto its own line - which
     breaks the one rule the price block has, that the qualifier sits on the
     figure's baseline where it cannot be read as optional. */
  grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr) 248px;
  grid-template-areas:"body cap rail" "detail detail detail";
  padding:20px 24px;
  border-radius:var(--corr-r-lg);
  background:var(--corr-surface);
  box-shadow:inset 0 0 0 1px var(--corr-hair);
  transition:box-shadow 140ms ease;
}
.rp-card__inner:hover{
  box-shadow:inset 0 0 0 1px var(--corr-rule), 0 6px 18px rgba(4,17,13,.08);
}
.rp-card__inner > *{ min-width:0 }
.rp-card__body  { grid-area:body }
.rp-card__rail  { grid-area:rail; display:grid; gap:12px; justify-items:end; align-content:start }
.rp-card__detail{ grid-area:detail }
.rp-card__detail[hidden]{ display:none }

.rp-card__name{
  margin:0; font-family:var(--corr-serif); font-weight:400;
  font-size:1.375rem; line-height:1.25; color:var(--corr-ink);
}
.rp-card__models{ margin:6px 0 0; max-width:none; font-size:.9375rem; color:var(--rp-muted) }

/* Its own column at desktop, with the label that makes a bare sentence
   like "13 passengers plus the driver" legible as an answer to a question. */
.rp-card__capacity{
  grid-area:cap; margin:0; max-width:none;
  font-size:.9375rem; line-height:1.45; color:var(--corr-body);
}
/* A real element, not generated content: CSS content is invisible to
   translation and this string ships in a localised theme. */
.rp-card__caplabel{
  display:block; margin-bottom:4px;
  font:600 .6875rem/1 Archivo, system-ui, sans-serif;
  letter-spacing:.09em; text-transform:uppercase; color:var(--rp-muted);
}

.rp-card__toggle{
  margin:10px 0 0; padding:0; border:0; background:none; cursor:pointer;
  color:var(--corr-action); font:inherit; font-size:.875rem;
  text-decoration:underline; text-underline-offset:3px;
}

/* One figure, one adjacent permanent qualifier, one baseline. No range, no
   struck-through "was", and no slot in this grid for one. */
.rp-card__price{
  margin:0; max-width:none;
  display:flex; flex-wrap:wrap; align-items:baseline; justify-content:flex-end; gap:8px;
}
.rp-card__from  { font-size:.8125rem; color:var(--rp-muted) }
.rp-card__figure{
  font-family:var(--corr-sans); font-weight:600; font-size:1.625rem; line-height:1.1;
  color:var(--corr-ink);
  font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1;
}
.rp-card__qual{ font-size:.8125rem; color:var(--rp-gold-ink) }
.rp-card__qual--admin{ color:var(--rp-alert) }
.rp-card__cta{ width:100%; min-height:48px }

.rp-card__detail p{ margin:16px 0 0; max-width:68ch; font-size:.9375rem; line-height:1.6; color:var(--corr-body) }
.rp-card__fleet{ color:var(--rp-muted) }

/* --- partial, notes, trust, disclosure --------------------------------- */
.rp-partial,
.rp-note{
  display:grid; gap:10px;
  padding:20px; border-radius:var(--corr-r-md);
  background:var(--corr-stone);
  box-shadow:inset 0 0 0 1px var(--corr-hair);
}
.rp-partial__heading{
  margin:0; font-family:var(--corr-serif); font-weight:400;
  font-size:1.125rem; line-height:1.3; color:var(--corr-ink);
}
.rp-partial__body,
.rp-note p{ margin:0; max-width:68ch; font-size:.9375rem; line-height:1.6; color:var(--corr-body) }
.rp-partial__actions,
.rp-note__actions{ display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:6px 0 0 }
.rp-note__links{ display:flex; flex-wrap:wrap; gap:8px 18px; margin:0; padding:0; list-style:none }
.rp-note__links li{ max-width:none }
.rp-note__admin{ color:var(--rp-alert) }

.rp-alert{
  display:grid; gap:8px;
  padding:18px 20px; border-radius:var(--corr-r-md);
  background:#FCF4F2; box-shadow:inset 0 0 0 1px rgba(138,39,24,.28);
}
.rp-alert:focus-visible{ outline:2px solid var(--rp-alert); outline-offset:4px }
.rp-alert__lead{ margin:0; max-width:none; font-weight:600; color:var(--rp-alert) }
.rp-alert__list{ margin:0; padding-left:1.1rem }
.rp-alert__list li{ max-width:68ch; color:var(--corr-body) }

.rp-trust{
  display:flex; flex-wrap:wrap; gap:8px 24px;
  margin:4px 0 0; padding:14px 0 0; list-style:none;
  border-top:1px solid var(--corr-hair);
}
.rp-trust li{
  max-width:none; font-size:.875rem; color:var(--corr-body);
  padding-left:20px; position:relative;
}
.rp-trust li::before{
  content:"✓"; position:absolute; left:0; top:0;
  color:var(--corr-action); font-size:.8125rem;
}

/* Required, page-level, and never muted micro-type: 13px in --corr-body. */
.rp-disclosure{
  margin:8px 0 0; max-width:78ch;
  font-size:.8125rem; line-height:1.6; color:var(--corr-body);
}

/* --- the initial state ------------------------------------------------- */
.rp-popular{ display:grid; gap:12px }
.rp-popular__heading{
  margin:0; font:600 .75rem/1 Archivo, system-ui, sans-serif;
  letter-spacing:.09em; text-transform:uppercase; color:var(--rp-muted);
}
.rp-popular__list{
  display:grid; gap:10px; margin:0; padding:0; list-style:none;
  grid-template-columns:minmax(0,1fr);
}
.rp-popular__list li{ max-width:none }
.rp-popular__link{
  display:flex; align-items:center; gap:10px;
  min-height:56px; padding:0 18px;
  border-radius:var(--corr-r-md);
  background:var(--corr-surface); box-shadow:inset 0 0 0 1px var(--corr-hair);
  color:var(--corr-ink); text-decoration:none; font-size:1rem;
}
.rp-popular__link:hover{ box-shadow:inset 0 0 0 1px var(--corr-action) }
.rp-popular__arrow{ color:var(--corr-gold) }

@media (min-width:620px){
  .rp-popular__list{ grid-template-columns:repeat(2,minmax(0,1fr)) }
}

/* --- mobile ------------------------------------------------------------ */
@media (max-width:760px){
  .rp-card__inner{
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"body" "cap" "rail" "detail";
    gap:14px; padding:16px;
  }
  .rp-card__rail{
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center; justify-items:stretch; gap:12px;
  }
  .rp-card__price{ justify-content:flex-start }
  .rp-card__cta{ width:auto; padding-inline:20px }
  .rp-summary{ min-height:56px; padding:10px 16px }
}

@media (prefers-reduced-motion:reduce){
  .rp-summary__chev,
  .rp-card__inner{ transition:none }
}

/* --- SLICE 87: the driver allowance note --------------------------------
   Not .rp-alert. That block is the error register (#8A2718 on #FCF4F2) and
   nothing here is wrong - a driver allowance on a five-day booking is the
   normal, expected shape of the job. This is the same geometry in the calm
   register, so it reads as information the reader needs rather than a fault
   they have to fix. It carries no figure by design; see rp-results.php. */
.rp-allowance{
  display:grid; gap:6px;
  padding:16px 20px; border-radius:var(--corr-r-md);
  background:var(--corr-stone);
  box-shadow:inset 0 0 0 1px var(--corr-hair);
  border-inline-start:3px solid var(--corr-gold-lift, #C9A96A);
}
.rp-allowance--provided{ border-inline-start-color:var(--corr-action, #0E4C33) }
.rp-allowance__eyebrow{
  margin:0; max-width:none;
  font:600 11px/1.2 Archivo, system-ui, sans-serif;
  letter-spacing:.09em; text-transform:uppercase; color:var(--rp-muted);
}
.rp-allowance__body{
  margin:0; max-width:68ch;
  font-size:.9375rem; line-height:1.6; color:var(--corr-body);
}

/* ---------------------------------------------------------------------------
 * SLICE 98. Booking request (rp-book) and acknowledgement (rp-book--done).
 * Tokens and primitives are the results page's own: .button, .rp-alert,
 * the 8px grid, the 48px target floor. Nothing here restyles a card.
 * ------------------------------------------------------------------------ */
.rp-book{ display:grid; gap:24px; margin-block:8px 32px }
.rp-book__h2{ font-size:clamp(1.125rem,1rem + .6vw,1.375rem); margin:0 0 12px }
.rp-book__summary{ background:var(--rp-card-bg,#fff); border:1px solid var(--rp-card-border,rgba(0,0,0,.08)); border-radius:16px; padding:clamp(16px,2vw,24px) }
.rp-book__facts{ display:grid; gap:12px; margin:0 }
.rp-book__facts > div{ display:grid; grid-template-columns:minmax(72px,120px) 1fr; gap:8px 16px; align-items:baseline }
.rp-book__facts dt{ font-size:.75rem; letter-spacing:.08em; text-transform:uppercase; opacity:.7; margin:0 }
.rp-book__facts dd{ margin:0 }
.rp-book__facts small{ display:block; opacity:.75; font-size:.875rem }
.rp-book__fare b{ font-size:clamp(1.25rem,1rem + 1vw,1.75rem) }
.rp-book__edit{ margin:16px 0 0; font-size:.9375rem }
.rp-book__form{ background:var(--rp-card-bg,#fff); border:1px solid var(--rp-card-border,rgba(0,0,0,.08)); border-radius:16px; padding:clamp(16px,2vw,24px) }
.rp-book__grid{ display:grid; gap:16px; grid-template-columns:1fr }
.rp-book__field{ display:grid; gap:6px }
.rp-book__field > span{ font-size:.9375rem; font-weight:600 }
.rp-book__field em{ font-weight:400; opacity:.7; font-style:normal }
.rp-book__field input, .rp-book__field textarea{ width:100%; min-height:48px; padding:12px 14px; border:1px solid rgba(0,0,0,.2); border-radius:10px; font:inherit; background:#fff }
.rp-book__field textarea{ resize:vertical; min-height:96px }
.rp-book__field input:focus-visible, .rp-book__field textarea:focus-visible{ outline:2px solid currentColor; outline-offset:2px }
.rp-book__hp{ position:absolute !important; left:-10000px; width:1px; height:1px; overflow:hidden }
.rp-book__terms{ margin:16px 0 0; font-size:.9375rem; opacity:.85; max-width:65ch }
.rp-book__actions{ display:flex; flex-wrap:wrap; gap:12px; margin:16px 0 0 }
.rp-book__actions .button{ min-height:48px }
.rp-book__ref{ display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 12px; margin:0 0 12px }
.rp-book__ref span{ font-size:.75rem; letter-spacing:.08em; text-transform:uppercase; opacity:.7 }
.rp-book__ref b{ font-size:clamp(1.25rem,1rem + 1vw,1.75rem); font-variant-numeric:tabular-nums }
.rp-book__lines{ margin:0; padding-left:1.1em; display:grid; gap:4px }
.rp-book__steps{ margin:0; padding-left:1.25em; display:grid; gap:8px; max-width:65ch }
.rp-card__more{ font-size:.875rem; text-decoration:underline; text-underline-offset:3px; min-height:24px; display:inline-flex; align-items:center }
@media (min-width:720px){
  .rp-book__grid{ grid-template-columns:1fr 1fr }
  .rp-book__field--wide{ grid-column:1 / -1 }
  .rp-book{ grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); align-items:start }
  .rp-book--done{ grid-template-columns:1fr }
}

/* slice 98 gate: the summary edit link is a target, so it gets the 24px floor. */
.rp-book__edit a{ display:inline-flex; align-items:center; min-height:24px }

.rp-card__price--quote .rp-card__from{ font-size:.875rem; opacity:.8 }

/* ---------------------------------------------------------------------------
 * SLICE 101c. Vehicle cards (estimate-priced results) and the unresolved-place cue.
 * The card primitive is rp-card; this adds only the media box.
 * ------------------------------------------------------------------------ */
.rp-card--vehicle .rp-card__media{ aspect-ratio:16/9; width:100%; max-width:100%; border-radius:12px; overflow:hidden; background:var(--rp-token-bg,rgba(0,0,0,.06)); display:grid; place-items:center; margin:0 0 12px }
.rp-card--vehicle .rp-card__photo{ width:100%; height:100%; object-fit:cover; display:block }
.rp-card--vehicle .rp-card__token{ font-size:clamp(1.25rem,1rem + 1vw,1.75rem); letter-spacing:.12em; opacity:.55; font-weight:600 }
.rp-card--vehicle .rp-card__figure{ font-variant-numeric:tabular-nums }
.place-field--unresolved [data-place-input]{ outline:2px solid #b3261e; outline-offset:2px }
.place-field--unresolved [data-place-status]{ color:#b3261e }

/* SLICE 101c gate: the "What moves it" toggle measured 21.7px; 24px floor like .rp-card__more. */
.rp-assumption__more{ min-height:24px; display:inline-flex; align-items:center }

/* SLICE 101c gate: the photograph takes its own grid area instead of falling
   below the rail. Desktop: media | body | capacity | rail, detail under the
   text columns. Mobile: media first, then the existing stack. */
.rp-card--vehicle .rp-card__media{ grid-area:media; margin:0 }
.rp-card--vehicle .rp-card__inner{
  grid-template-columns:minmax(160px,220px) minmax(0,1.2fr) minmax(0,.8fr) 248px;
  grid-template-areas:"media body cap rail" "media detail detail detail";
}
@media (max-width:760px){
  .rp-card--vehicle .rp-card__inner{
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"media" "body" "cap" "rail" "detail";
  }
}
