/* Rite Maps quote form and quote pop-up (light design, contract v5).
   Uses the theme's --rm-* tokens, with the contract's hex values as fallbacks so it still looks right under another theme.
   White panels, a paper summary panel, logo-blue headings and structure, orange only on the primary button (#170900 text),
   hairline borders and blue focus rings. Contrast on white: text 17.7:1, muted 7.6:1, blue 12.3:1, orange-text 5.5:1,
   error 6.6:1 (6.0:1 on paper, 6.1:1 on the error tint). .is-on-dark (the script sets it only when the form really sits on a
   dark background) keeps a dark fallback. */

.rm-quote,
.rm-quote-dialog {
  --rmq-font: var(--rm-font-body, "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --rmq-head: var(--rm-font-head, "Barlow Condensed", "Arial Narrow", sans-serif);
  --rmq-mono: var(--rm-font-mono, "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
  --rmq-radius: var(--rm-radius, 10px);
  --rmq-orange: var(--rm-orange, #fa7818);
  --rmq-orange-hover: var(--rm-orange-hover, #ff8a33);
  --rmq-on-orange: var(--rm-on-orange, #170900);
  --rmq-blue: var(--rm-blue, #05357e);
  --rmq-surface: var(--rm-white, #ffffff);
  --rmq-surface-2: var(--rm-paper, #f4f6f9);
  --rmq-tint: var(--rm-tint, #eaf0f8);
  --rmq-text: var(--rm-text, #111827);
  --rmq-head-color: var(--rm-blue, #05357e);
  --rmq-muted: var(--rm-muted, #4b5563);
  --rmq-line: var(--rm-line, #d9dee7);
  --rmq-line-strong: #b9c2d0;
  --rmq-field: #ffffff;
  --rmq-field-line: var(--rm-field-line, #8b95a7); /* 3:1 on white for field edges */
  --rmq-field-hover: #5b6576;
  --rmq-accent-text: var(--rm-orange-text, #b04a00);
  --rmq-link: var(--rm-blue, #05357e);
  --rmq-focus: var(--rm-blue, #05357e);
  --rmq-chosen: var(--rm-blue, #05357e);
  --rmq-chosen-bg: var(--rm-tint, #eaf0f8);
  --rmq-note-bg: rgba(250, 120, 24, .08);
  --rmq-error: #b42318;
  --rmq-error-bg: #fef3f2;
  --rmq-grid: rgba(5, 53, 126, .055);
}
/* Fallback for a form placed on a genuinely dark background (the light theme has none). */
.rm-quote.is-on-dark {
  --rmq-surface: var(--rm-ink, #0c0f15);
  --rmq-surface-2: var(--rm-ink-2, #151a23);
  --rmq-tint: rgba(79, 143, 240, .14);
  --rmq-text: var(--rm-text-on-dark, #e8edf4);
  --rmq-head-color: #ffffff;
  --rmq-muted: var(--rm-muted-on-dark, #a5afbf);
  --rmq-line: var(--rm-line-dark, #262d3a);
  --rmq-line-strong: #3a4352;
  --rmq-field: #0f141c;
  --rmq-field-line: #5d6879;
  --rmq-field-hover: #8590a3;
  --rmq-accent-text: var(--rm-orange, #fa7818);
  --rmq-link: var(--rm-blue-bright, #4f8ff0);
  --rmq-focus: var(--rm-orange, #fa7818);
  --rmq-chosen: var(--rm-blue-bright, #4f8ff0);
  --rmq-chosen-bg: rgba(79, 143, 240, .14);
  --rmq-note-bg: rgba(250, 120, 24, .12);
  --rmq-error: #ff9b8f;
  --rmq-error-bg: rgba(255, 120, 100, .1);
  --rmq-grid: rgba(79, 143, 240, .06);
  color-scheme: dark;
}

/* ---------- Base ---------- */
.rm-quote {
  container: rmq / inline-size;
  position: relative;
  color: var(--rmq-text);
  font-family: var(--rmq-font);
  font-size: 1rem;
  line-height: 1.5;
  text-align: left;
  scroll-margin-top: 96px;
  color-scheme: light;
}
.rm-quote *, .rm-quote *::before, .rm-quote *::after { box-sizing: border-box; }
.rm-quote [hidden], .rm-quote-dialog [hidden] { display: none !important; }
.rm-quote:not([data-in-dialog]) {
  background: var(--rmq-surface);
  border: 1px solid var(--rmq-line);
  border-radius: calc(var(--rmq-radius) + 4px);
  padding: clamp(18px, 4.5vw, 40px);
  box-shadow: 0 1px 2px rgba(5, 30, 70, .04), 0 18px 48px -30px rgba(5, 30, 70, .28);
}
.rm-quote.is-on-dark:not([data-in-dialog]) { box-shadow: 0 18px 48px -28px rgba(0, 0, 0, .8); }
.rm-quote p { margin: 0; }
.rm-quote a:not(.rm-q-btn) { color: var(--rmq-link); text-decoration: underline; text-underline-offset: 3px; }
.rm-quote a:not(.rm-q-btn):hover { text-decoration-thickness: 2px; }
.rm-quote a:not(.rm-q-btn):focus-visible { outline: 2px solid var(--rmq-focus); outline-offset: 2px; border-radius: 2px; }
.rm-quote fieldset { border: 0; margin: 0; padding: 0; min-width: 0; background: none; }
.rm-quote legend { padding: 0; margin: 0; border: 0; float: none; width: 100%; color: inherit; }
.rm-quote [tabindex="-1"]:focus { outline: none; }
.rm-q-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.rm-q-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.rm-q-notice {
  margin: 0 0 18px !important; padding: 10px 14px; border: 1px dashed var(--rmq-accent-text); border-radius: 8px;
  background: var(--rmq-note-bg); font-family: var(--rmq-mono); font-size: .8rem; line-height: 1.45; color: var(--rmq-text);
}
.rm-q-noscript { font-family: var(--rmq-font); font-size: .95rem; border-style: solid; }
.rm-q-required-note { margin: 0 0 18px !important; font-size: .9rem; color: var(--rmq-muted); }
.rm-q-req { color: var(--rmq-accent-text); font-weight: 700; margin-left: 1px; }
.rm-q-fineprint { margin: 18px 0 0 !important; font-size: .875rem; color: var(--rmq-muted); }
.rm-q-recaptcha-note { margin-top: 8px !important; font-size: .8rem; }

/* ---------- Layout ---------- */
.rm-q-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.rm-q-main { min-width: 0; container: rmq-main / inline-size; }
.rm-quote.is-enhanced .rm-q-layout { grid-template-areas: "main" "summary" "actions"; }
/* Area names only once the script has set up the areas: an unknown area name would add implicit columns and squeeze the form. */
.rm-quote.is-enhanced .rm-q-main { grid-area: main; }
.rm-quote.is-enhanced .rm-q-summary { grid-area: summary; }
.rm-quote.is-enhanced .rm-q-actions { grid-area: actions; }
.rm-q-summary { --rmq-wide: 0; }
@container rmq (min-width: 780px) {
  .rm-quote.is-enhanced .rm-q-layout { grid-template-columns: minmax(0, 1fr) 280px; grid-template-areas: "main summary" "actions summary"; column-gap: 34px; align-items: start; }
  .rm-q-summary { --rmq-wide: 1; position: sticky; top: 16px; }
}

/* ---------- Steps ---------- */
.rm-q-step + .rm-q-step { margin-top: 36px; padding-top: 30px; border-top: 1px solid var(--rmq-line); }
.rm-quote.is-enhanced .rm-q-step + .rm-q-step { margin-top: 0; padding-top: 0; border-top: 0; }
.rm-quote .rm-q-legend { display: block; margin: 0 0 6px !important; font-family: var(--rmq-head); font-weight: 700; font-size: clamp(1.55rem, 1.25rem + 1.1vw, 2rem); line-height: 1.08; letter-spacing: .005em; color: var(--rmq-head-color); }
.rm-q-kicker { display: block; margin-bottom: 6px; font-family: var(--rmq-mono); font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--rmq-accent-text); }
.rm-quote.is-enhanced .rm-q-kicker { display: none; }
.rm-q-intro { margin: 0 0 22px !important; color: var(--rmq-muted); }

.rm-q-progress { margin: 0 0 22px; }
.rm-q-progress-text { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; margin: 0 0 10px !important; }
.rm-q-progress-count { font-family: var(--rmq-mono); font-size: .8rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--rmq-accent-text); }
.rm-q-progress-next { font-size: .875rem; color: var(--rmq-muted); }
.rm-q-progress-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.rm-q-progress-bar li { height: 4px; margin: 0; border-radius: 2px; background: var(--rmq-line); transition: background-color .25s; }
.rm-q-progress-bar li::marker { content: none; }
.rm-q-progress-bar li.is-done { background: var(--rmq-blue); }
.rm-q-progress-bar li.is-current { background: var(--rmq-orange); }

/* ---------- Fields ---------- */
.rm-q-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
/* Six tracks: full rows span 6, halves span 3, thirds span 2 once there's room for three. */
@container rmq-main (min-width: 470px) {
  .rm-q-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px 18px; }
  .rm-q-grid > .rm-q-field { grid-column: span 6; }
  .rm-q-grid > .rm-q-half, .rm-q-grid > .rm-q-third { grid-column: span 3; }
}
@container rmq-main (min-width: 640px) {
  .rm-q-grid > .rm-q-third { grid-column: span 2; }
}
.rm-q-field { min-width: 0; }
.rm-q-label { display: block; margin: 0 0 7px !important; font-family: var(--rmq-font); font-weight: 600; font-size: 1rem; line-height: 1.35; color: var(--rmq-text); }
.rm-q-cond { font-weight: 400; font-size: .875rem; color: var(--rmq-muted); }
.rm-quote.is-enhanced .rm-q-cond { display: none; }
.rm-q-help { margin: -2px 0 8px !important; font-size: .9rem; line-height: 1.45; color: var(--rmq-muted); }
.rm-q-consent .rm-q-help { margin: 8px 0 0 !important; }
.rm-quote .rm-q-help--after { margin: 8px 0 0 !important; }
/* The state's signed-surveys note (v9): an always-present live region, so it takes no space while it's empty. */
.rm-q-state-note:not(:empty) {
  margin: 10px 0 0; padding: 10px 14px; border: 1px solid var(--rmq-line); border-left: 3px solid var(--rmq-blue); border-radius: 6px;
  background: var(--rmq-chosen-bg); color: var(--rmq-text); font-size: .94rem; line-height: 1.45;
}

.rm-quote :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], select, textarea) {
  display: block; width: 100%; max-width: 100%; min-height: 48px; margin: 0; padding: 11px 14px;
  font-family: var(--rmq-font); font-size: max(16px, 1rem); font-weight: 400; line-height: 1.4; letter-spacing: normal;
  color: var(--rmq-text); background-color: var(--rmq-field); border: 1px solid var(--rmq-field-line); border-radius: 8px;
  box-shadow: none; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
.rm-quote select {
  padding-right: 42px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2305357e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.rm-quote textarea { min-height: 104px; resize: vertical; }
.rm-quote input[type="date"] { min-width: 0; }
.rm-quote input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.rm-quote input[type="number"] { -moz-appearance: textfield; }
.rm-quote :is(input, select, textarea):hover { border-color: var(--rmq-field-hover); }
.rm-quote :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], select, textarea):focus {
  outline: 2px solid var(--rmq-focus); outline-offset: 2px; border-color: var(--rmq-focus);
}
.rm-quote ::placeholder { color: var(--rmq-muted); opacity: .8; }

/* Choice pills (radios and checkboxes) */
.rm-q-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 215px), 1fr)); gap: 10px; }
.rm-q-options--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.rm-q-option, .rm-q-check {
  display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0; padding: 11px 14px;
  border: 1px solid var(--rmq-line-strong); border-radius: 8px; background: var(--rmq-field);
  font-weight: 500; font-size: 1rem; line-height: 1.3; color: var(--rmq-text); cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.rm-q-check { align-items: flex-start; background: var(--rmq-surface-2); font-weight: 600; }
.rm-q-option:hover, .rm-q-check:hover { border-color: var(--rmq-field-hover); }
.rm-quote .rm-q-option input, .rm-quote .rm-q-check input { width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--rmq-chosen); cursor: pointer; }
.rm-quote .rm-q-check input { margin-top: 1px; }
.rm-q-option:has(input:checked), .rm-q-check:has(input:checked) { border-color: var(--rmq-chosen); background-color: var(--rmq-chosen-bg); box-shadow: inset 0 0 0 1px var(--rmq-chosen); }
.rm-q-option:has(input:focus-visible), .rm-q-check:has(input:focus-visible) { outline: 2px solid var(--rmq-focus); outline-offset: 2px; }
.rm-quote .rm-q-option input:focus, .rm-quote .rm-q-check input:focus { outline: none; }

/* Service cards (built by the script from the service select) */
.rm-q-cards > legend { margin-bottom: 10px !important; }
.rm-q-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); gap: 12px; }
.rm-q-card {
  position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-items: start;
  min-height: 92px; margin: 0; padding: 16px 30px 16px 14px; border: 1px solid var(--rmq-line-strong); border-radius: var(--rmq-radius);
  background: var(--rmq-field); color: var(--rmq-text); cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s, transform .15s;
}
/* A small survey cross in the corner, blue when chosen. */
.rm-q-card::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 11px; height: 11px; pointer-events: none;
  background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
  color: var(--rmq-line-strong); transition: color .15s;
}
.rm-q-card:hover { border-color: var(--rmq-field-hover); transform: translateY(-1px); box-shadow: 0 10px 24px -20px rgba(5, 30, 70, .5); }
.rm-quote .rm-q-card input {
  grid-row: 1 / span 2; display: grid; place-content: center; width: 22px; height: 22px; min-height: 0; margin: 1px 0 0; padding: 0;
  border: 2px solid var(--rmq-field-line); border-radius: 50%; background: var(--rmq-field); -webkit-appearance: none; appearance: none; cursor: pointer;
}
/* The chosen card's dot is the orange survey target inside a blue ring. */
.rm-quote .rm-q-card input::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--rmq-orange); transform: scale(0); transition: transform .15s; }
.rm-quote .rm-q-card input:checked { border-color: var(--rmq-chosen); }
.rm-quote .rm-q-card input:checked::before { transform: scale(1); }
.rm-quote .rm-q-card input:focus { outline: none; }
.rm-q-card-title { font-family: var(--rmq-head); font-weight: 600; font-size: 1.22rem; line-height: 1.12; letter-spacing: .01em; color: var(--rmq-head-color); }
.rm-q-card-desc { grid-column: 2; font-size: .92rem; line-height: 1.4; color: var(--rmq-muted); }
.rm-q-card:has(input:checked) {
  border-color: var(--rmq-chosen); background-color: var(--rmq-chosen-bg);
  box-shadow: inset 0 0 0 1px var(--rmq-chosen);
}
.rm-q-card:has(input:checked)::after { color: var(--rmq-chosen); }
.rm-q-card:has(input:focus-visible) { outline: 2px solid var(--rmq-focus); outline-offset: 2px; }

/* Errors */
.rm-q-error { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 8px !important; font-weight: 600; font-size: .94rem; line-height: 1.35; color: var(--rmq-error); }
.rm-q-error::before {
  content: "!"; flex: none; display: grid; place-content: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: var(--rmq-error); color: #ffffff; font: 700 .75rem/1 var(--rmq-font);
}
.rm-quote.is-on-dark .rm-q-error::before { color: var(--rmq-surface); }
.rm-q-field.is-invalid :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], select, textarea) { border-color: var(--rmq-error); box-shadow: inset 0 0 0 1px var(--rmq-error); }
.rm-q-field.is-invalid .rm-q-option, .rm-q-field.is-invalid .rm-q-check, .rm-q-field.is-invalid .rm-q-card { border-color: var(--rmq-error); }
.rm-q-alert { margin: 0 0 18px; padding: 12px 14px 12px 16px; border: 1px solid #f3c4bd; border-left: 4px solid var(--rmq-error); border-radius: 6px; background: var(--rmq-error-bg); color: var(--rmq-text); font-weight: 500; }
.rm-quote.is-on-dark .rm-q-alert { border-color: transparent; border-left-color: var(--rmq-error); }

/* ---------- Buttons (match the theme's .rm-btn) ---------- */
.rm-quote .rm-q-btn, .rm-quote-dialog .rm-q-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; min-width: 44px; margin: 0; padding: 10px 22px;
  border: 1.5px solid transparent; border-radius: 6px; font-family: var(--rmq-head); font-weight: 700; font-size: 1.0625rem; line-height: 1.15;
  letter-spacing: .07em; text-decoration: none; text-transform: uppercase; white-space: nowrap; cursor: pointer; box-shadow: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .2s, transform .1s;
}
.rm-quote .rm-q-btn--primary, .rm-quote-dialog .rm-q-btn--primary { background: var(--rmq-orange); color: var(--rmq-on-orange); border-color: var(--rmq-orange); }
.rm-quote .rm-q-btn--primary:hover, .rm-quote-dialog .rm-q-btn--primary:hover { background: var(--rmq-orange-hover); border-color: var(--rmq-orange-hover); color: var(--rmq-on-orange); box-shadow: 0 8px 22px rgba(250, 120, 24, .26); }
.rm-quote .rm-q-btn--ghost, .rm-quote-dialog .rm-q-btn--ghost { background: transparent; color: var(--rmq-blue); border-color: var(--rmq-blue); }
.rm-quote .rm-q-btn--ghost:hover, .rm-quote-dialog .rm-q-btn--ghost:hover { background: rgba(5, 53, 126, .06); color: var(--rmq-blue); box-shadow: inset 0 0 0 1px var(--rmq-blue); }
.rm-quote.is-on-dark .rm-q-btn--ghost { color: var(--rmq-text); border-color: var(--rmq-field-line); }
.rm-quote .rm-q-btn:focus-visible, .rm-quote-dialog .rm-q-btn:focus-visible { outline: 2px solid var(--rmq-focus); outline-offset: 3px; }
.rm-quote .rm-q-btn:active, .rm-quote-dialog .rm-q-btn:active { transform: translateY(1px); }
.rm-quote .rm-q-btn[disabled], .rm-quote-dialog .rm-q-btn[disabled] { opacity: .6; cursor: progress; transform: none; box-shadow: none; }

.rm-q-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 18px; border-top: 1px solid var(--rmq-line); }
.rm-q-actions .rm-q-back { margin-right: auto; }
.rm-quote:not(.is-enhanced) .rm-q-actions { justify-content: flex-start; }

/* ---------- "Your request" summary: a paper panel with a faint survey grid ---------- */
.rm-q-summary {
  border: 1px solid var(--rmq-line); border-radius: var(--rmq-radius); color: var(--rmq-text);
  background-color: var(--rmq-surface-2);
  background-image: linear-gradient(var(--rmq-grid) 1px, transparent 1px), linear-gradient(90deg, var(--rmq-grid) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px; overflow: hidden;
}
.rm-q-summary > summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 16px; cursor: pointer; list-style: none; color: var(--rmq-head-color);
}
.rm-q-summary > summary::-webkit-details-marker { display: none; }
.rm-q-summary > summary::marker { content: ""; }
.rm-q-summary > summary:focus-visible { outline: 2px solid var(--rmq-focus); outline-offset: -4px; border-radius: var(--rmq-radius); }
.rm-q-summary-title { font-family: var(--rmq-head); font-weight: 700; font-size: 1.1rem; letter-spacing: .07em; text-transform: uppercase; }
.rm-q-summary-title::before {
  content: ""; display: inline-block; width: 9px; height: 9px; margin: 0 9px 2px 0; border: 2px solid var(--rmq-orange); border-radius: 50%; vertical-align: middle;
}
.rm-q-summary-count { margin-left: auto; font-family: var(--rmq-mono); font-size: .75rem; color: var(--rmq-muted); }
.rm-q-summary-chevron { flex: none; color: var(--rmq-blue); transition: transform .2s; }
.rm-q-summary[open] .rm-q-summary-chevron { transform: rotate(180deg); }
.rm-q-summary.is-pinned > summary { cursor: default; }
.rm-q-summary.is-pinned .rm-q-summary-chevron { display: none; }
.rm-q-summary-body { padding: 14px 16px 16px; border-top: 1px solid var(--rmq-line); }
.rm-q-summary-group + .rm-q-summary-group { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--rmq-line-strong); }
.rm-q-summary .rm-q-summary-step { margin: 0 0 8px !important; font-family: var(--rmq-mono); font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--rmq-accent-text); }
.rm-q-summary dl { display: grid; gap: 8px; margin: 0; }
.rm-q-summary dt { margin: 0; font-family: var(--rmq-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--rmq-muted); }
.rm-q-summary dd {
  margin: 1px 0 0; font-size: .95rem; line-height: 1.35; color: var(--rmq-text); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.rm-q-summary .rm-q-summary-empty { font-size: .92rem; color: var(--rmq-muted); }
/* On the review step the collapsed (phone) summary would only repeat the review, so it steps aside. */
.rm-quote.is-review .rm-q-summary:not(.is-pinned) { display: none; }

/* ---------- Review ---------- */
.rm-quote .rm-q-review-title { margin: 0 0 6px !important; font-family: var(--rmq-head); font-weight: 700; font-size: clamp(1.55rem, 1.25rem + 1.1vw, 2rem); line-height: 1.08; color: var(--rmq-head-color); }
.rm-q-review-groups { display: grid; gap: 12px; }
.rm-q-review-group { padding: 12px 16px 14px; border: 1px solid var(--rmq-line); border-radius: var(--rmq-radius); background: var(--rmq-surface); }
.rm-q-review-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.rm-quote .rm-q-review-step { margin: 0 !important; font-family: var(--rmq-head); font-weight: 600; font-size: 1.22rem; line-height: 1.15; color: var(--rmq-head-color); }
.rm-q-review-num { margin-right: 6px; font-family: var(--rmq-mono); font-size: .78rem; font-weight: 500; letter-spacing: .1em; color: var(--rmq-accent-text); }
.rm-quote .rm-q-edit {
  flex: none; min-height: 44px; min-width: 44px; margin: 0 -10px 0 0; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent;
  color: var(--rmq-link); font: 600 1rem/1 var(--rmq-font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.rm-quote .rm-q-edit:hover { text-decoration-thickness: 2px; background: rgba(5, 53, 126, .05); }
.rm-quote .rm-q-edit:focus-visible { outline: 2px solid var(--rmq-focus); outline-offset: 0; }
.rm-q-review dl { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; }
.rm-q-review dl > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; padding: 7px 0; border-top: 1px solid var(--rmq-line); }
.rm-q-review dl > div:first-child { border-top: 0; }
@container rmq-main (min-width: 470px) { .rm-q-review dl > div { grid-template-columns: minmax(130px, 34%) minmax(0, 1fr); } }
.rm-q-review dt { margin: 0; font-size: .9rem; color: var(--rmq-muted); }
.rm-q-review dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.rm-q-review .rm-q-review-none { color: var(--rmq-muted); font-size: .95rem; }

/* ---------- Success ---------- */
.rm-q-success { padding: 6px 0 4px; }
.rm-q-success-icon { display: block; width: 64px; height: 64px; margin-bottom: 16px; color: var(--rmq-blue); }
.rm-q-success-icon path:last-child { color: var(--rmq-orange); stroke: var(--rmq-orange); }
.rm-quote .rm-q-success-title { margin: 0 0 14px !important; font-family: var(--rmq-head); font-weight: 700; font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem); line-height: 1.04; color: var(--rmq-head-color); }
.rm-q-ref {
  display: inline-flex !important; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; max-width: 100%; margin: 0 0 16px !important; padding: 10px 16px;
  border: 1px dashed var(--rmq-field-line); border-radius: 8px; background: var(--rmq-surface-2);
}
.rm-q-ref-label { font-family: var(--rmq-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--rmq-muted); }
.rm-q-ref-value { font-family: var(--rmq-mono); font-weight: 500; font-size: 1.25rem; letter-spacing: .06em; color: var(--rmq-text); overflow-wrap: anywhere; }
.rm-q-success-text { font-size: 1.05rem; }
.rm-q-test-note { margin-top: 12px !important; padding: 10px 14px; border: 1px dashed var(--rmq-accent-text); border-radius: 8px; background: var(--rmq-note-bg); font-family: var(--rmq-mono); font-size: .8rem; line-height: 1.45; }
.rm-q-success-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- The pop-up ---------- */
html.rm-quote-open { overflow: hidden; scrollbar-gutter: stable; }
html.rm-quote-open body { overflow: hidden; }
/* While the steps are showing, the window keeps one height so it doesn't jump between steps; the success screen fits its content. */
.rm-quote-dialog {
  width: min(1080px, calc(100% - 32px)); max-width: none; height: min(880px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0;
  border: 1px solid var(--rmq-line); border-radius: 16px; background: var(--rmq-surface); color: var(--rmq-text); overflow: hidden;
  box-shadow: 0 40px 110px -30px rgba(5, 30, 70, .5), 0 2px 8px rgba(5, 30, 70, .08); color-scheme: light;
}
.rm-quote-dialog::backdrop { background: rgba(11, 27, 52, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.rm-quote-dialog[open] { animation: rmqd-in .24s cubic-bezier(.2, .8, .2, 1) both; }
.rm-quote-dialog[open]::backdrop { animation: rmqd-fade .24s ease both; }
.rmqd-shell { display: flex; flex-direction: column; height: 100%; }
.rm-quote-dialog.is-done { height: fit-content; }
.rm-quote-dialog.is-done .rmqd-shell { height: auto; max-height: calc(100dvh - 32px); }
.rmqd-head {
  position: relative; flex: none; padding: 22px 80px 20px 32px; color: var(--rmq-text); background-color: var(--rmq-surface-2);
  background-image: linear-gradient(var(--rmq-grid) 1px, transparent 1px), linear-gradient(90deg, var(--rmq-grid) 1px, transparent 1px);
  background-size: 28px 28px; background-position: -1px -1px; border-bottom: 1px solid var(--rmq-line);
}
.rmqd-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-family: var(--rmq-mono); font-size: .75rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--rmq-accent-text); }
.rmqd-eyebrow svg { flex: none; }
.rmqd-title { margin: 0 0 6px; font-family: var(--rmq-head); font-weight: 700; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); line-height: 1.04; letter-spacing: .005em; color: var(--rmq-head-color); }
.rmqd-title:focus { outline: none; }
.rmqd-title:focus-visible { outline: 2px solid var(--rmq-focus); outline-offset: 4px; }
.rmqd-desc { margin: 0; max-width: 62ch; font-family: var(--rmq-font); font-size: .95rem; line-height: 1.45; color: var(--rmq-muted); }
.rmqd-close {
  position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 48px; height: 48px; margin: 0; padding: 0;
  border: 1px solid var(--rmq-field-line); border-radius: 50%; background: var(--rmq-surface); color: var(--rmq-blue); cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s;
}
.rmqd-close:hover { border-color: var(--rmq-blue); background: var(--rmq-tint); }
.rmqd-close:focus-visible { outline: 2px solid var(--rmq-focus); outline-offset: 2px; }
.rmqd-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 26px 32px 28px; -webkit-overflow-scrolling: touch; }
.rmqd-foot { flex: none; padding: 14px 32px; border-top: 1px solid var(--rmq-line); background: var(--rmq-surface); }
.rmqd-foot:empty { display: none; }
.rmqd-foot .rm-q-actions { padding-top: 0; border-top: 0; }
/* The pinned summary sticks beside the steps; a long one scrolls inside itself instead of running off the window.
   The body is a size container (it has a definite height while the steps show), so 100cqh is its visible height. */
.rm-quote-dialog:not(.is-done) .rmqd-body { container: rmqd-body / size; }
.rm-quote-dialog .rm-q-summary { top: 0; }
.rm-quote-dialog .rm-q-summary.is-pinned .rm-q-summary-body {
  max-height: calc(100cqh - 52px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--rmq-line-strong) transparent;
}

@media (max-width: 640px) {
  .rm-quote-dialog, .rm-quote-dialog.is-done { width: 100%; height: 100%; max-height: 100%; border: 0; border-radius: 0; }
  .rmqd-shell, .rm-quote-dialog.is-done .rmqd-shell { height: 100%; max-height: none; }
  @supports (height: 100dvh) { .rm-quote-dialog, .rm-quote-dialog.is-done { height: 100dvh; max-height: 100dvh; } }
  .rmqd-head { padding: 14px 68px 14px 16px; }
  .rmqd-eyebrow { margin-bottom: 4px; font-size: .7rem; }
  .rmqd-title { font-size: 1.55rem; margin: 0; }
  .rmqd-desc { display: none; }
  .rmqd-close { top: 8px; right: 8px; }
  .rmqd-body { padding: 18px 16px 22px; }
  .rmqd-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .rmqd-foot .rm-q-actions { gap: 10px; }
  .rmqd-foot .rm-q-btn { padding-left: 18px; padding-right: 18px; }
  .rm-quote-dialog[open] { animation-name: rmqd-up; }
}
@media (max-width: 360px) {
  .rm-quote .rm-q-btn, .rm-quote-dialog .rm-q-btn { padding-left: 14px; padding-right: 14px; font-size: 1rem; letter-spacing: .05em; }
  .rm-q-card { padding-right: 26px; }
}

/* reCAPTCHA v3's floating badge is hidden: every form that sends a token shows Google's notice text instead
   (rmt_recaptcha_notice() in PHP; the chat widget's call-back form must show it too). */
.grecaptcha-badge { visibility: hidden !important; }

@keyframes rmqd-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes rmqd-up { from { opacity: .6; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes rmqd-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .rm-quote-dialog[open], .rm-quote-dialog[open]::backdrop { animation: none; }
  .rm-quote *, .rm-quote-dialog * { transition: none !important; }
  .rm-q-card:hover { transform: none; }
}
@media (forced-colors: active) {
  .rm-quote .rm-q-card input { -webkit-appearance: auto; appearance: auto; border: 0; }
  .rm-quote .rm-q-card input::before { display: none; }
  .rm-q-progress-bar li.is-done, .rm-q-progress-bar li.is-current { background: Highlight; }
  .rm-q-card:has(input:checked), .rm-q-option:has(input:checked) { outline: 2px solid Highlight; }
  .rm-quote-dialog { border: 1px solid CanvasText; }
}
@media print { .rm-quote-dialog { display: none !important; } }
