/* ==========================================================================
   Premium Quotation Builder.

   Two surfaces in one stylesheet:
     .qb*   the builder — a design tool, not a form
     .qdoc  the document — an A4 page that is ALSO what the browser prints,
            so the live preview and the exported PDF can never drift apart.

   Every template is a set of CSS custom properties written onto .qdoc by the
   view (element.style.setProperty — CSSOM, so the strict style-src CSP holds).
   Changing template re-skins the document without touching its content.
   ========================================================================== */

/* --- Builder shell -------------------------------------------------------- */
.qb {
  display: grid;
  grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
  gap: var(--s5);
  align-items: start;
}
.qb__side {
  position: sticky;
  top: var(--s4);
  display: grid;
  gap: var(--s4);
  max-height: calc(100vh - var(--s7));
  overflow-y: auto;
  padding-right: 4px;
}
.qb__stage {
  display: grid;
  gap: var(--s3);
  justify-items: center;
  padding: var(--s5);
  background:
    repeating-linear-gradient(45deg, var(--plate-sunken) 0 10px, transparent 10px 20px);
  border: 1px solid var(--keyline);
  border-radius: var(--r-plate);
  overflow-x: auto;
}

/* --- Template picker ------------------------------------------------------ */
.qtpl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--s3);
}
.qtpl__card {
  display: grid;
  gap: 8px;
  padding: 12px;
  text-align: left;
  background: var(--plate);
  border: 1.5px solid var(--keyline);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.qtpl__card:hover { transform: translateY(-2px); box-shadow: var(--lift-2); }
.qtpl__card[aria-pressed=true] {
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-text) 18%, transparent);
}
/* A miniature of the template: header band, accent rule, text lines. */
.qtpl__chip {
  height: 54px;
  border-radius: 5px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 18px 1fr;
  background: #fff;
  border: 1px solid var(--keyline);
}
.qtpl__chip b { display: block; background: var(--qc-head-bg, #0F172A); }
.qtpl__chip i { display: block; margin: 5px 6px 0; height: 3px; border-radius: 2px; background: var(--qc-accent, #1D4ED8); }
.qtpl__chip u { display: block; margin: 4px 6px 0; height: 2px; border-radius: 2px; background: #D8DDE5; }
.qtpl__name { font-size: .8125rem; font-weight: 650; }
.qtpl__blurb { font-size: .6875rem; line-height: 1.4; color: var(--text-muted); }

/* --- Section list (the layout builder) ------------------------------------ */
.qsec { display: grid; gap: 8px; }
.qsec__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--plate);
  border: 1px solid var(--keyline);
  border-radius: var(--r-md);
  cursor: grab;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), opacity .18s;
}
.qsec__row:hover { border-color: var(--keyline-strong); box-shadow: var(--lift-1); }
.qsec__row.is-active { border-color: var(--accent-text); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-text) 16%, transparent); }
.qsec__row.is-dragging { opacity: .4; cursor: grabbing; }
.qsec__row.is-over { border-color: var(--accent-text); border-style: dashed; }
.qsec__row[data-hidden=true] .qsec__name { opacity: .45; text-decoration: line-through; }
.qsec__grip { color: var(--text-faint); display: grid; place-items: center; }
.qsec__name { font-size: .8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qsec__kind { font-size: .625rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); }
.qsec__acts { display: flex; gap: 2px; }
.qsec__btn {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  background: none; border: 1px solid transparent; border-radius: 6px;
  color: var(--text-muted); cursor: pointer;
}
.qsec__btn:hover { border-color: var(--keyline-strong); color: var(--text); background: var(--plate-sunken); }
.qsec__btn .ico { width: 14px; height: 14px; }

/* --- Rich text toolbar ---------------------------------------------------- */
.qrt { display: grid; gap: 6px; }
.qrt__bar { display: flex; flex-wrap: wrap; gap: 3px; padding: 5px; background: var(--plate-sunken); border: 1px solid var(--keyline); border-radius: var(--r-md) var(--r-md) 0 0; }
.qrt__btn {
  min-width: 28px; height: 28px; padding: 0 7px;
  background: var(--plate); border: 1px solid var(--keyline); border-radius: 5px;
  font-size: .75rem; font-weight: 650; color: var(--text); cursor: pointer;
}
.qrt__btn:hover { border-color: var(--accent-text); color: var(--accent-text); }
.qrt__sep { width: 1px; margin: 2px 3px; background: var(--keyline); }
.qrt__area {
  min-height: 120px; max-height: 340px; overflow-y: auto;
  padding: 11px 13px;
  background: var(--plate);
  border: 1px solid var(--keyline); border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-size: .875rem; line-height: 1.6;
}
.qrt__area:focus { outline: 2px solid var(--accent-text); outline-offset: -2px; }
.qrt__area:empty::before { content: attr(data-placeholder); color: var(--text-faint); }

/* --- Repeating editors (lists, tables, pricing) --------------------------- */
.qrep { display: grid; gap: 6px; }
.qrep__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.qrep__row input { width: 100%; }
.qrep__grid { display: grid; gap: 6px; }
.qprice { display: grid; gap: 8px; padding: 10px; background: var(--plate-sunken); border: 1px solid var(--keyline); border-radius: var(--r-md); }
.qprice__amounts { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 6px; align-items: center; }

/* ==========================================================================
   THE DOCUMENT — one A4 page, on screen and on paper.
   ========================================================================== */
.qdoc {
  /* Template tokens; JS overwrites these per template and per company brand. */
  --qc-accent: #1D4ED8;
  --qc-accent-soft: #EFF4FF;
  --qc-ink: #0F172A;
  --qc-muted: #5B667A;
  --qc-rule: #DCE3EE;
  --qc-head-bg: #0F172A;
  --qc-head-fg: #FFFFFF;
  --qc-radius: 10px;
  --qc-paper: #FFFFFF;
  --qc-card: #FFFFFF;
  --qc-accent2: var(--qc-accent);
  --qc-band: var(--qc-head-bg);
  --qc-band-fg: var(--qc-head-fg);
  --qc-display: 'Helvetica Neue', Arial, sans-serif;

  width: 210mm;
  min-height: 297mm;
  padding: 16mm 15mm 20mm;
  background: var(--qc-paper);
  color: var(--qc-ink);
  font-family: var(--qc-display);
  font-size: 10.5pt;
  line-height: 1.55;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .16);
  box-sizing: border-box;
}

/* Masthead ---------------------------------------------------------------- */
.qdoc__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--qc-head-bg);
  color: var(--qc-head-fg);
  border-radius: var(--qc-radius);
}
.qdoc__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qdoc__logo { max-height: 46px; max-width: 150px; object-fit: contain; }
.qdoc__company { font-size: 13pt; font-weight: 700; letter-spacing: -0.01em; }
.qdoc__contact { font-size: 7.5pt; opacity: .82; line-height: 1.5; }
.qdoc__ref { text-align: right; font-size: 7.5pt; opacity: .82; }
.qdoc__ref b { display: block; font-size: 11pt; opacity: 1; }

.qdoc__title { margin: 0 0 2px; font-size: 22pt; font-weight: 750; letter-spacing: -0.025em; line-height: 1.12; }
.qdoc__subtitle { margin: 0 0 12px; font-size: 10.5pt; color: var(--qc-muted); }
.qdoc__cover { width: 100%; height: 46mm; object-fit: cover; border-radius: var(--qc-radius); margin-bottom: 12px; }

/* The client block: who this is for, and until when it stands. */
.qdoc__for {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px 14px;
  padding: 11px 14px;
  margin-bottom: 14px;
  background: var(--qc-accent-soft);
  border-left: 3px solid var(--qc-accent);
  border-radius: 0 var(--qc-radius) var(--qc-radius) 0;
}
.qdoc__for div { min-width: 0; }
.qdoc__for dt { font-size: 6.5pt; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--qc-muted); }
.qdoc__for dd { margin: 1px 0 0; font-size: 9.5pt; font-weight: 600; overflow-wrap: break-word; }

/* Sections ---------------------------------------------------------------- */
.qdoc__section { margin-bottom: 13px; break-inside: avoid; }
.qdoc__sechead {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  padding-bottom: 5px;
  border-bottom: 1.5px solid var(--qc-rule);
}
.qdoc__sechead h3 { margin: 0; font-size: 12pt; font-weight: 700; letter-spacing: -0.01em; }
.qdoc__secico {
  display: grid; place-items: center;
  width: 22px; height: 22px; flex: none;
  background: var(--qc-accent-soft); color: var(--qc-accent);
  border-radius: 5px;
}
.qdoc__secico .ico { width: 13px; height: 13px; }
.qdoc__banner { width: 100%; height: 30mm; object-fit: cover; border-radius: var(--qc-radius); margin-bottom: 8px; }
.qdoc__body { font-size: 9.5pt; line-height: 1.6; }
.qdoc__body p { margin: 0 0 6px; }
.qdoc__body ul, .qdoc__body ol { margin: 0 0 6px; padding-left: 17px; }

/* Bullet list section */
.qdoc__list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; font-size: 9.5pt; }
.qdoc__list li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; }
.qdoc__list li::before {
  content: '';
  flex: none;
  width: 6px; height: 6px; margin-top: 5px;
  background: var(--qc-accent);
  border-radius: 50%;
}

/* Table section */
.qdoc__table { width: 100%; border-collapse: collapse; font-size: 9pt; }
.qdoc__table th {
  padding: 7px 9px;
  text-align: left;
  background: var(--qc-accent-soft);
  color: var(--qc-ink);
  font-size: 7.5pt; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 1.5px solid var(--qc-rule);
}
.qdoc__table td { padding: 7px 9px; border-bottom: 1px solid var(--qc-rule); vertical-align: top; }
.qdoc__table tr:nth-child(even) td { background: color-mix(in srgb, var(--qc-accent-soft) 45%, transparent); }

/* Facts strip */
.qdoc__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 8px; }
.qdoc__fact {
  padding: 9px 11px;
  background: var(--qc-accent-soft);
  border-radius: var(--qc-radius);
  border: 1px solid var(--qc-rule);
}
.qdoc__fact dt { font-size: 6.5pt; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--qc-muted); }
.qdoc__fact dd { margin: 2px 0 0; font-size: 10pt; font-weight: 650; }

/* Pricing — the money moment, so it carries the most weight on the page. */
.qdoc__prices { display: grid; gap: 7px; }
.qdoc__price {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 13px;
  border: 1.5px solid var(--qc-rule);
  border-radius: var(--qc-radius);
}
.qdoc__price--hot {
  border-color: var(--qc-accent);
  background: var(--qc-accent-soft);
}
.qdoc__price-label { font-size: 10pt; font-weight: 700; }
.qdoc__price-note { font-size: 7.5pt; color: var(--qc-muted); }
.qdoc__price-amounts { display: flex; gap: 14px; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; }
.qdoc__amount { text-align: right; }
.qdoc__amount span { display: block; font-size: 6.5pt; font-weight: 700; letter-spacing: .08em; color: var(--qc-muted); }
.qdoc__amount b { font-size: 13pt; font-weight: 750; letter-spacing: -0.02em; color: var(--qc-accent); }
.qdoc__basis { margin-top: 6px; font-size: 8pt; color: var(--qc-muted); }

/* Gallery */
.qdoc__gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(45mm, 1fr)); gap: 8px; }
.qdoc__gallery figure { margin: 0; }
.qdoc__gallery img { width: 100%; height: 32mm; object-fit: cover; border-radius: var(--qc-radius); }
.qdoc__gallery figcaption { margin-top: 3px; font-size: 7.5pt; color: var(--qc-muted); }

/* Terms + footer */
.qdoc__terms {
  margin-top: 14px; padding: 11px 13px;
  background: var(--qc-accent-soft);
  border-radius: var(--qc-radius);
  font-size: 8.5pt; line-height: 1.55;
}
.qdoc__terms h4 { margin: 0 0 4px; font-size: 9pt; font-weight: 700; }
.qdoc__foot {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 9px;
  border-top: 1.5px solid var(--qc-rule);
  font-size: 7.5pt; color: var(--qc-muted);
}

/* --- Print: the document alone, at true A4 -------------------------------- */
@page {
  size: A4 portrait;
  margin: 12mm 0 14mm;
}
@media print {
  /* Everything that is not the document leaves the page. */
  body > *:not(.qprint) { display: none !important; }
  .qprint, .qprint * { visibility: visible; }
  .qprint {
    position: absolute; inset: 0;
    display: block !important;
    background: #fff;
  }
  .qdoc {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0 15mm;
    box-shadow: none;
  }
  .qdoc__section { break-inside: avoid; page-break-inside: avoid; }
  .qdoc__head, .qdoc__price, .qdoc__fact, .qdoc__table tr { break-inside: avoid; }
  .qdoc__table thead { display: table-header-group; }   /* repeat headers */
  .qdoc__break { break-before: page; page-break-before: always; }
  a { text-decoration: none; color: inherit; }
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 1180px) {
  .qb { grid-template-columns: minmax(0, 1fr); }
  .qb__side { position: static; max-height: none; overflow: visible; }
  /* Scale the A4 sheet down to fit narrow screens without reflowing it, so
     the preview stays a truthful proof of the printed page. Scaling from the
     top-left keeps the whole sheet inside the stage: from the centre, the
     right-hand half of the page falls off a phone screen. */
  .qb__stage { padding: var(--s3); justify-items: start; overflow: hidden; }
  .qdoc { transform: scale(var(--qzoom, .62)); transform-origin: top left; margin-bottom: -120mm; }
}
@media (max-width: 760px) {
  .qdoc { --qzoom: .42; margin-bottom: -175mm; }
  .qtpl { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
}

/* Variants that replace inline style attributes (blocked by the CSP). */
.qrep__grid--pair { grid-template-columns: 1fr 1fr; }
.qrep__grid--thumb { grid-template-columns: 44px minmax(0, 1fr); }
.qrep__grid--sched { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.qrep__thumb { width: 44px; height: 34px; object-fit: cover; border-radius: 5px; }
.qrt__btn--wide { width: auto; }
.qrt__btn--color { width: 34px; padding: 2px; }
.qset__head { margin: 16px 0 6px; }

/* --- Commercial side panels ------------------------------------------------ */
.qrep__grid--cost { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 64px minmax(0, .9fr); }

.qcost { list-style: none; margin: 0 0 var(--s3); padding: 0; display: grid; }
.qcost li {
  display: flex; justify-content: space-between; gap: var(--s3);
  padding: 7px 0; border-bottom: 1px solid var(--keyline); font-size: .8125rem;
}
.qcost li:last-child { border-bottom: none; }
.qcost b { font-variant-numeric: tabular-nums; }

.qmargin {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px;
  background: var(--keyline); border: 1px solid var(--keyline);
  border-radius: var(--r-md); overflow: hidden;
}
.qmargin > div { display: grid; gap: 2px; padding: 10px 12px; background: var(--plate); }
.qmargin b { font-size: .9375rem; font-variant-numeric: tabular-nums; }
.qmargin > div.is-bad b { color: var(--signal-red); }

.qwarn {
  margin-top: var(--s3); padding: 8px 11px;
  background: var(--signal-red-100); border-radius: var(--r-md);
  color: var(--signal-red); font-size: .8125rem; font-weight: 600;
}

/* --- Package options (tiers) ----------------------------------------------- */
.qdoc__tiers {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-top: 6px;
}
.qdoc__tier {
  position: relative; display: grid; gap: 6px; align-content: start;
  padding: 14px 13px; border: 1px solid var(--qc-rule);
  border-radius: var(--qc-radius); background: var(--qc-accent-soft);
}
.qdoc__tier.is-pick { border-color: var(--qc-accent); border-width: 2px; }
.qdoc__tier-flag {
  position: absolute; top: -9px; left: 12px; padding: 1px 8px; border-radius: 100px;
  background: var(--qc-accent); color: #fff; font-size: .5625rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
}
.qdoc__tier h4 { margin: 0; font-size: .9375rem; }
.qdoc__tier-blurb { margin: 0; font-size: .6875rem; color: var(--qc-muted); }
.qdoc__tier-price { display: flex; align-items: baseline; gap: 5px; }
.qdoc__tier-price span { font-size: .625rem; font-weight: 700; letter-spacing: .05em; }
.qdoc__tier-price b { font-size: 1.125rem; font-variant-numeric: tabular-nums; color: var(--qc-accent); }
.qdoc__tier ul { margin: 2px 0 0; padding-left: 15px; display: grid; gap: 3px; }
.qdoc__tier li { font-size: .6875rem; line-height: 1.45; }

/* ===========================================================================
   Flyer layout — the package sheet a travel agency actually sends
   ===========================================================================
   The reference sheets share one grammar: a cream page, white cards floating
   on it, a ribbon header carrying the package name and its headline number,
   two columns of blocks, and a contact bar along the foot. Nothing here
   touches the letterhead templates; it applies only to .qdoc--flyer. */

.qdoc--flyer { padding: 12mm 11mm 0; }

/* --- Ribbon header --------------------------------------------------------- */
.qrib {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 14px 12px;
  background: var(--qc-head-bg);
  border-radius: var(--qc-radius);
  color: var(--qc-head-fg);
}
.qrib__badge {
  display: grid;
  place-items: center;
  gap: 1px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--qc-card);
  border: 2px solid var(--qc-accent2);
  color: var(--qc-accent);
  text-align: center;
}
.qrib__logo { max-width: 46px; max-height: 30px; object-fit: contain; }
.qrib__mark { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.qrib__badge-word {
  max-width: 62px;
  font-size: .625rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.1;
  overflow: hidden;
}
.qrib__badge:has(.qrib__logo) .qrib__badge-word { font-size: .5rem; margin-top: 2px; }
.qrib__say { min-width: 0; }
.qrib__title {
  margin: 0;
  font-family: var(--qc-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.015em;
  text-transform: uppercase;
}
.qrib__sub {
  margin: 3px 0 0;
  font-size: .8125rem;
  color: var(--qc-accent2);
  font-weight: 600;
}
.qrib__pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.qrib__pills span {
  padding: 2px 9px;
  border-radius: 100px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.qrib__tile {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 96px;
  padding: 9px 13px;
  border-radius: calc(var(--qc-radius) - 3px);
  background: var(--qc-accent2);
  color: #fff;
  text-align: center;
}
.qrib__tile-label,
.qrib__tile-note {
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .92;
}
.qrib__tile-value {
  font-size: 1.4375rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.qrib__tile-value i { font-style: normal; font-size: .5625rem; vertical-align: super; margin-right: 2px; }

/* The reference line under the ribbon: who it is for, and until when. */
.qrib__strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 9px 2px 12px;
  padding: 8px 12px;
  background: var(--qc-card);
  border: 1px solid var(--qc-rule);
  border-radius: calc(var(--qc-radius) - 4px);
  font-size: .75rem;
  font-weight: 600;
}
.qrib__strip i {
  display: block;
  font-style: normal;
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--qc-muted);
}

/* --- Two columns of blocks ------------------------------------------------- */
/* Columns rather than a grid: the blocks are different heights and should
   flow, and CSS columns page-break correctly in print. */
.qdoc--flyer .qdoc__cols { columns: 2; column-gap: 9px; }
.qdoc--flyer .qdoc__section {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 9px;
  padding: 0;
  border: none;
}
.qdoc--flyer .qdoc__sechead {
  gap: 7px;
  margin: 0 0 5px;
  padding: 0 2px;
  border: none;
}
.qdoc--flyer .qdoc__sechead h3 {
  font-family: var(--qc-display);
  font-size: .9375rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--qc-accent);
}
.qdoc--flyer .qdoc__secico {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 6px;
  background: var(--qc-accent2);
  color: #fff;
}
.qdoc--flyer .qdoc__secico .ico { width: 13px; height: 13px; }
.qdoc--flyer .qdoc__card {
  padding: 10px 12px;
  background: var(--qc-card);
  border: 1px solid var(--qc-rule);
  border-radius: calc(var(--qc-radius) - 3px);
}
.qdoc--flyer .qdoc__card > :first-child { margin-top: 0; }
.qdoc--flyer .qdoc__card > :last-child { margin-bottom: 0; }
.qdoc--flyer .qdoc__list { margin: 0; padding-left: 15px; }
.qdoc--flyer .qdoc__list li { margin-bottom: 3px; }
.qdoc--flyer .qdoc__table { margin: 0; }
.qdoc--flyer .qdoc__table th { background: transparent; }

/* The offer runs full width and leads with the band. */
.qdoc--flyer .qdoc__section--lead,
.qdoc--flyer .qdoc__section--band { column-span: all; margin-bottom: 11px; }
.qdoc--flyer .qdoc__section--band .qdoc__card { padding: 9px 12px; }
.qdoc--flyer .qdoc__section--lead .qdoc__sechead {
  margin: 0;
  padding: 8px 12px;
  background: var(--qc-band);
  border-radius: calc(var(--qc-radius) - 3px) calc(var(--qc-radius) - 3px) 0 0;
}
.qdoc--flyer .qdoc__section--lead .qdoc__sechead h3 { color: var(--qc-band-fg); }
.qdoc--flyer .qdoc__section--lead .qdoc__secico { background: rgba(255, 255, 255, .18); }
.qdoc--flyer .qdoc__section--lead .qdoc__card {
  border-radius: 0 0 calc(var(--qc-radius) - 3px) calc(var(--qc-radius) - 3px);
  border-top: none;
}

/* --- Rates ----------------------------------------------------------------- */
/* One row per occupancy, currencies side by side: the comparison a client
   makes is across the row, so that is the axis the layout gives them. */
.qdoc__rates { display: grid; gap: 7px; }
.qrate {
  display: grid;
  gap: 5px;
  padding: 9px 11px 10px;
  background: var(--qc-accent-soft);
  border: 1px solid var(--qc-rule);
  border-radius: calc(var(--qc-radius) - 5px);
  justify-items: center;
}
.qrate.is-pick { border-color: var(--qc-accent2); border-width: 1.5px; }
.qrate__chip {
  padding: 2px 13px;
  border-radius: 100px;
  background: var(--qc-accent);
  color: #fff;
  font-size: .625rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.qrate__amounts {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0;
  width: 100%;
}
.qrate__amount {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 6px;
  text-align: center;
  border-left: 1px solid var(--qc-rule);
}
.qrate__amount:first-child { border-left: none; }
.qrate__amount i {
  display: block;
  font-style: normal;
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--qc-accent2);
}
.qrate__amount b {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.qrate__note { margin: 0; font-size: .625rem; color: var(--qc-muted); }

/* --- Contact bar ----------------------------------------------------------- */
.qbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  align-items: center;
  gap: 6px 18px;
  margin: 10px -11mm 0;
  padding: 10px 11mm 11px;
  background: var(--qc-head-bg);
  color: var(--qc-head-fg);
}
.qbar__who { display: grid; gap: 1px; min-width: 0; }
.qbar__who strong { font-size: .875rem; font-weight: 800; }
.qbar__who span { font-size: .6875rem; opacity: .85; }
.qbar__calls {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 1px 14px;
  font-size: .6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.qbar__mail { font-size: .6875rem; font-weight: 600; opacity: .9; }
.qbar__note {
  grid-column: 1 / -1;
  margin: 3px 0 0;
  font-size: .5625rem;
  letter-spacing: .03em;
  opacity: .7;
}

/* A facts section on a flyer reads as a labelled band, filling its card. */
.qdoc--flyer .qdoc__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px 14px;
  margin: 0;
}
.qdoc--flyer .qdoc__fact {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}
.qdoc--flyer .qdoc__fact dt {
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--qc-muted);
}
.qdoc--flyer .qdoc__fact dd { margin: 1px 0 0; font-size: .8125rem; font-weight: 700; }

/* The chip labels the rates band rather than sitting on top of it. */
.qrate__chip { margin-bottom: 1px; }
