/* Home — 06 Quote / enquiry -----------------------------------------------------
   Night "board" (heading + compact direct contact) with a paper form card pinned
   over its right edge. Mobile/tablet: the board frames intro → form → contact,
   so "Free Quote" lands close to the fields.
   ----------------------------------------------------------------------------- */

.mx-quote { overflow-x: clip; }

.mx-quote__layout {
  --q-line: color-mix(in srgb, var(--mx-on-night) 13%, transparent);
  --q-tint: color-mix(in srgb, var(--mx-on-night) 8%, transparent);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "intro" "form" "aside";
}

/* Board ------------------------------------------------------------------------ */
.mx-quote__board {
  grid-row: 1 / -1; grid-column: 1 / -1;
  position: relative; overflow: hidden;
  border-radius: var(--mx-radius-lg);
  background:
    radial-gradient(120% 60% at 0% 0%, color-mix(in srgb, var(--mx-accent) 16%, transparent) 0, transparent 55%),
    radial-gradient(90% 50% at 100% 100%, color-mix(in srgb, var(--mx-brand) 45%, transparent) 0, transparent 60%),
    var(--mx-night);
}
/* No reveal on the board: it is the backdrop for white text and must always paint,
   even when the visitor lands mid-section (scroll restore, deep link). */
.mx-quote__board::after { /* hairline inner frame */
  content: ""; position: absolute; inset: 10px; pointer-events: none;
  border: 1px solid var(--q-line); border-radius: calc(var(--mx-radius-lg) - 8px);
  opacity: .55;
}

.mx-quote__intro, .mx-quote__aside { position: relative; z-index: 1; min-width: 0; color: var(--mx-on-night); }
.mx-quote__intro { grid-area: intro; padding: clamp(30px, 6vw, 64px) clamp(24px, 5vw, 56px) clamp(26px, 4vw, 36px); }
.mx-quote__aside {
  grid-area: aside; container-type: inline-size;
  display: grid; gap: 18px;
  padding: clamp(32px, 5vw, 44px) clamp(24px, 5vw, 56px) clamp(32px, 6vw, 60px);
}
/* Focus on the night board: marigold ring (the global ring is brand blue for light surfaces) */
.mx-quote .mx-quote__intro :focus-visible,
.mx-quote .mx-quote__aside :focus-visible { outline-color: var(--mx-accent); }

/* Intro */
.mx-quote__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.mx-quote__eyebrow { margin-bottom: 0; color: var(--mx-accent); }
.mx-quote__title { margin-top: 20px; max-width: 17ch; color: var(--mx-paper); }
.mx-quote__title em { color: var(--mx-accent); }
.mx-quote__lead { margin-top: 18px; max-width: 40ch; color: var(--mx-on-night-muted); }

/* Paint-swatch deck: one chip per service, fans out when revealed */
.mx-quote__deck { position: relative; flex: none; width: calc(30px + 5 * 15px); height: 50px; margin-right: 6px; }
.mx-quote__deck span {
  position: absolute; left: 0; bottom: 0; width: 30px; height: 44px; border-radius: 6px;
  background:
    linear-gradient(var(--mx-line-strong), var(--mx-line-strong)) 6px 37px / 14px 2px no-repeat,
    linear-gradient(to bottom, var(--svc) 0 70%, var(--mx-paper) 70%);
  box-shadow: -5px 6px 14px -6px rgba(0, 0, 0, .55);
  transform-origin: 50% 130%;
  transform: translateX(calc(var(--k) * 15px)) rotate(calc((var(--k) - 2) * 7deg));
  transition: transform .8s var(--mx-ease-out);
  transition-delay: calc(var(--k) * 60ms + 250ms);
}
.mx-js .mx-quote__deck:not(.is-in) span { transform: translateX(36px) rotate(0deg); }

/* What happens next: the first two process steps, word for word (wide boards only;
   on phones and tablets the form stays close to its heading) */
.mx-quote__next { display: none; }
@media (min-width: 1024px) {
  .mx-quote__next {
    display: block; max-width: 40ch;
    margin-top: clamp(28px, 3vw, 40px); padding-top: 22px; border-top: 1px solid var(--q-line);
  }
}
.mx-quote__steps { list-style: none; display: grid; gap: 12px; margin-top: 12px; }
.mx-quote__steps li {
  display: grid; grid-template-columns: 34px 1fr; align-items: baseline;
  font-size: 15px; line-height: 1.5; color: var(--mx-on-night-muted);
}
.mx-quote__steps span { font: 700 12px/1 var(--mx-font); letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--mx-accent); }
.mx-quote__steps strong { font-weight: 700; color: var(--mx-paper); }

/* Direct contact (compact) ------------------------------------------------------- */
.mx-quote__subhead {
  margin-bottom: 8px;
  font: 700 12px/1.2 var(--mx-font); letter-spacing: .16em; text-transform: uppercase;
  color: var(--mx-on-night-muted);
}
.mx-quote__line { font-size: 15.5px; line-height: 1.6; color: var(--mx-paper); }

.mx-quote__contacts { list-style: none; display: grid; column-gap: 28px; border-top: 1px solid var(--q-line); }
.mx-quote__contacts > li { min-width: 0; border-bottom: 1px solid var(--q-line); }
@container (min-width: 560px) {
  .mx-quote__contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mx-quote__contact {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 2px;
  color: var(--mx-paper); text-decoration: none;
}
.mx-quote__contact--static { align-items: flex-start; padding-block: 14px 6px; }
.mx-quote__contact-icon {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px;
  background: var(--q-tint); color: var(--mx-accent); font-size: 15px;
  transition: background-color .2s var(--mx-ease);
}
.mx-quote__contact--wa .mx-quote__contact-icon { font-size: 18px; }
.mx-quote__contact-text { display: grid; gap: 3px; min-width: 0; }
.mx-quote__contact-text small { font: 700 12px/1.2 var(--mx-font); letter-spacing: .12em; text-transform: uppercase; color: var(--mx-on-night-muted); }
.mx-quote__contact-text strong { font: 600 15.5px/1.3 var(--mx-font); color: var(--mx-paper); overflow-wrap: anywhere; transition: color .2s var(--mx-ease); }
a.mx-quote__contact:hover .mx-quote__contact-icon { background: color-mix(in srgb, var(--mx-on-night) 16%, transparent); }
a.mx-quote__contact:hover strong { color: var(--mx-accent); }
.mx-quote__hours { font-size: 13px; line-height: 1.4; color: var(--mx-on-night-muted); }
.mx-quote__contact .mx-locate__status { margin-top: 5px; }
.mx-quote__address { font-size: 14.5px; line-height: 1.55; color: var(--mx-on-night); }
.mx-quote__map {
  display: inline-flex; align-items: center; width: fit-content; min-height: 44px;
  color: var(--mx-paper); font-weight: 700; white-space: nowrap;
  text-decoration: underline; text-decoration-color: var(--mx-accent);
  text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.mx-quote__map:hover { color: var(--mx-accent); }

/* Form card ---------------------------------------------------------------------- */
.mx-quote__formwrap { grid-area: form; position: relative; z-index: 2; min-width: 0; margin-inline: clamp(8px, 2.6vw, 28px); }
.mx-quote__card {
  position: relative; overflow: hidden;
  padding: clamp(28px, 3.4vw, 44px) clamp(18px, 3.4vw, 44px) clamp(22px, 3vw, 34px);
  background: var(--mx-paper); border: 1px solid var(--mx-line); border-radius: var(--mx-radius-lg);
  box-shadow: var(--mx-shadow-lg);
}

/* Paint band: one stripe per service; the picked service stays at full strength */
.mx-quote__band { position: absolute; inset: 0 0 auto 0; display: flex; height: 7px; }
.mx-quote__band span { flex: 1; background: var(--svc); transition: opacity .35s var(--mx-ease); }
.mx-quote__band.is-picked span { opacity: .18; }
.mx-quote__band.is-picked span.is-on { opacity: 1; }

.mx-quote__cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 22px; }
.mx-quote__formtitle { font-size: clamp(1.5rem, 1.2rem + .9vw, 1.9rem); }
.mx-quote__reqnote { font: 600 12.5px/1.2 var(--mx-font); color: var(--mx-muted); }
.mx-quote .mx-req { color: var(--mx-danger); }
.mx-quote [hidden] { display: none !important; } /* the form, its head and the result swap with [hidden] */

/* Result: sent (replaces the form inside the card) ------------------------------- */
.mx-quote__done { display: grid; justify-items: start; gap: 14px; padding-top: 4px; }
.mx-quote__done:focus, .mx-quote__alert:focus { outline: none; } /* focused on arrival for screen readers only */
.mx-quote__done-mark {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 4px;
  border-radius: 16px; background: var(--mx-success); color: var(--mx-paper);
  box-shadow: 0 10px 24px -14px var(--mx-success);
}
.mx-quote__done-mark svg {
  width: 28px; height: 28px;
  fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
}
.mx-quote__done-text { max-width: 46ch; font-size: 16px; line-height: 1.6; color: var(--mx-ink-2); }
.mx-quote__done-next {
  max-width: 52ch; padding: 14px 16px; border-radius: var(--mx-radius-sm);
  background: var(--mx-canvas); border: 1px solid var(--mx-line);
  font-size: 14.5px; line-height: 1.55; color: var(--mx-ink-2);
}
.mx-quote__done-next strong { display: block; margin-bottom: 2px; color: var(--mx-ink); }
.mx-quote__done-actions { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; max-width: 440px; margin-top: 4px; }
.mx-quote__done-actions .mx-btn { flex: 1 1 auto; }
.mx-quote__again { display: none; min-height: 44px; padding: 0; border: 0; cursor: pointer; } /* needs JS to bring the form back */
.mx-js .mx-quote__again { display: inline-flex; }

/* Result: not sent (above the form; the draft is restored by 06-quote.js) */
.mx-quote__alert {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start;
  margin-bottom: 22px; padding: 14px 16px 10px 14px;
  border-left: 4px solid var(--svc); border-radius: var(--mx-radius-sm);
  background: var(--svc-soft); color: var(--mx-ink-2); font-size: 14.5px; line-height: 1.55;
}
.mx-quote__alert-icon {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--svc); color: var(--svc-ink); font-size: 14px;
}
.mx-quote__alert-body { display: grid; gap: 4px; min-width: 0; }
.mx-quote__alert-body > p:first-child { font-weight: 600; color: var(--mx-ink); }
.mx-quote__alert-actions { display: flex; flex-wrap: wrap; gap: 0 20px; }
.mx-quote__alert-actions a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px;
  font-weight: 700; color: var(--mx-ink);
  text-decoration: underline; text-decoration-color: var(--svc); text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.mx-quote__alert-actions a:hover { color: var(--svc); }

@media (prefers-reduced-motion: no-preference) {
  .mx-quote__done, .mx-quote__alert { animation: mxq-rise .6s var(--mx-ease-out) both; }
  .mx-quote__done-mark path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: mxq-draw .6s var(--mx-ease-out) .25s forwards; }
  .mx-quote[data-quote-result="sent"] .mx-quote__band span { animation: mxq-sweep .6s var(--mx-ease-out) calc(var(--k, 0) * 60ms) both; }
  /* wait for the card's own reveal, so the moment is not spent off screen */
  .mx-js .mx-quote__formwrap:not(.is-in) :is(.mx-quote__done, .mx-quote__alert, .mx-quote__done-mark path, .mx-quote__band span) { animation-play-state: paused; }
}
@keyframes mxq-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes mxq-draw { to { stroke-dashoffset: 0; } }
@keyframes mxq-sweep { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }

.mx-quote__form { gap: 22px; container-type: inline-size; }
.mx-quote__form .mx-field { align-content: start; } /* row neighbours with a hint must not stretch the input */
.mx-quote__opt { font-weight: 500; color: var(--mx-muted); }

/* Optional pair (email + property type): side by side when the card is wide enough */
.mx-quote__pair { display: grid; gap: 22px; min-width: 0; }
@container (min-width: 560px) {
  .mx-quote__pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .mx-quote__pair .mx-quote__legend { margin-bottom: 7px; } /* same label gap as .mx-field */
  .mx-quote__pair .mx-quote__pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mx-quote__pair .mx-quote__pill-face { width: 100%; min-height: 52px; justify-content: center; padding: 0 12px; }
}
.mx-quote__form .mx-form-note { margin-top: 1px; font-size: 13px; }
.mx-quote__form .mx-textarea { min-height: 112px; }
.mx-quote__form .mx-field-error { display: flex; align-items: flex-start; gap: 7px; }
.mx-quote__form .mx-field-error i { font-size: 12.5px; margin-top: 1px; }
.mx-quote__form .mx-field-error[hidden] { display: none; }

.mx-quote__group { min-width: 0; margin: 0; padding: 0; border: 0; }
.mx-quote__legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; }
.mx-quote__legend + * { clear: both; }

/* Visually hidden but real, focusable radio covering its whole chip */
.mx-quote__radio {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none;
}

/* Service paint chips */
.mx-quote__chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
@container (min-width: 430px) { .mx-quote__chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mx-quote__chip { --_fill: var(--svc); --_icon: var(--svc); position: relative; display: block; min-width: 0; }
.mx-quote__chip.mx-svc-2 { --_icon: color-mix(in srgb, var(--svc) 55%, var(--mx-ink)); }
.mx-quote__chip--unsure { --svc: var(--mx-ink); --svc-ink: var(--mx-paper); --svc-soft: var(--mx-sand); --_fill: var(--mx-ink); --_icon: var(--mx-muted); }

.mx-quote__chip-face {
  display: flex; flex-direction: column; height: 100%;
  border: 1.5px solid var(--mx-subtle); border-radius: 14px; overflow: hidden; background: var(--mx-paper);
  transition: border-color .2s var(--mx-ease), box-shadow .2s var(--mx-ease), transform .2s var(--mx-ease);
}
.mx-quote__chip-swatch {
  position: relative; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 10px 0 12px; flex: none;
  background: var(--svc-soft); color: var(--_icon); font-size: 16px;
  transition: background-color .2s var(--mx-ease), color .2s var(--mx-ease);
}
.mx-quote__chip--unsure .mx-quote__chip-swatch {
  background: repeating-linear-gradient(135deg, var(--mx-sand) 0 7px, var(--mx-canvas) 7px 14px);
}
/* Service number, same as the Services cards; the tick takes its place when picked */
.mx-quote__chip-num {
  margin-left: auto;
  font: 700 12px/1 var(--mx-font); letter-spacing: .06em; font-variant-numeric: tabular-nums;
  color: var(--mx-muted); transition: opacity .2s var(--mx-ease);
}
.mx-quote__chip-tick {
  position: absolute; top: 50%; right: 9px; margin-top: -11px;
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--mx-paper); color: var(--mx-ink); font-size: 11px;
  opacity: 0; transform: scale(.5);
  transition: opacity .2s var(--mx-ease), transform .25s var(--mx-ease-out);
}
.mx-quote__chip-name {
  display: block; padding: 9px 12px 11px;
  font: 600 14px/1.3 var(--mx-font); color: var(--mx-ink);
  overflow-wrap: anywhere; hyphens: auto;
}

.mx-quote__chip:hover .mx-quote__chip-face { border-color: color-mix(in srgb, var(--_fill) 75%, var(--mx-ink)); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .mx-quote__chip:hover .mx-quote__chip-face { transform: translateY(-2px); box-shadow: var(--mx-shadow-sm); }
}
.mx-quote__radio:checked + .mx-quote__chip-face { border-color: var(--_fill); box-shadow: inset 0 0 0 1px var(--_fill), var(--mx-shadow-sm); }
.mx-quote__radio:checked + .mx-quote__chip-face .mx-quote__chip-swatch { background: var(--_fill); color: var(--svc-ink); }
.mx-quote__radio:checked + .mx-quote__chip-face .mx-quote__chip-num { opacity: 0; }
.mx-quote__radio:checked + .mx-quote__chip-face .mx-quote__chip-tick { opacity: 1; transform: none; }
.mx-quote__radio:checked + .mx-quote__chip-face .mx-quote__chip-name { font-weight: 700; }
.mx-quote__radio:focus-visible + .mx-quote__chip-face,
.mx-quote__radio:focus-visible + .mx-quote__pill-face {
  outline: none; box-shadow: 0 0 0 3px var(--mx-paper), 0 0 0 5px var(--mx-brand);
}
@media (prefers-reduced-motion: no-preference) { /* press feedback */
  .mx-quote__radio:active + .mx-quote__chip-face,
  .mx-quote__radio:active + .mx-quote__pill-face { transform: scale(.98); transition-duration: var(--mx-dur-press, .09s); }
}
.mx-quote__chip.is-flash .mx-quote__chip-face { animation: mxq-flash .9s var(--mx-ease-out); }
@keyframes mxq-flash { 0% { transform: none; } 35% { transform: translateY(-4px) scale(1.04); } 100% { transform: none; } }
.mx-quote__group[aria-invalid="true"] .mx-quote__chip-face { border-color: var(--mx-danger); }
.mx-quote__group > .mx-field-error { margin-top: 9px; }

/* Property type pills */
.mx-quote__pills { display: flex; flex-wrap: wrap; gap: 10px; }
.mx-quote__pill { position: relative; display: inline-flex; }
.mx-quote__pill-face {
  display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 0 20px 0 16px;
  border: 1.5px solid var(--mx-subtle); border-radius: var(--mx-radius-pill); background: var(--mx-paper);
  font: 600 14.5px/1 var(--mx-font); color: var(--mx-ink-2);
  transition: border-color .2s var(--mx-ease), background-color .2s var(--mx-ease), color .2s var(--mx-ease);
}
.mx-quote__pill-face i { color: var(--mx-brand); font-size: 14px; transition: color .2s var(--mx-ease); }
.mx-quote__pill:hover .mx-quote__pill-face { border-color: var(--mx-brand); }
.mx-quote__radio:checked + .mx-quote__pill-face { background: var(--mx-brand); border-color: var(--mx-brand); color: var(--mx-paper); }
.mx-quote__radio:checked + .mx-quote__pill-face i { color: var(--mx-accent); }

/* Submit */
.mx-quote__submit { display: grid; gap: 12px; margin-top: 4px; }
.mx-quote__submit .mx-btn.is-busy { cursor: progress; transform: none; box-shadow: none; }
.mx-quote__submit .mx-btn.is-busy::before { display: none; }
.mx-quote__privacy { font-size: 13px; line-height: 1.5; color: var(--mx-muted); text-align: center; }

/* Desktop: board on the left, form card pinned over its right edge --------------- */
@media (min-width: 980px) {
  .mx-quote__layout {
    grid-template-columns: minmax(0, 1fr) clamp(44px, 5vw, 76px) minmax(0, 1.14fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "intro form form" "aside form form";
  }
  .mx-quote__board { grid-column: 1 / 3; grid-row: 1 / 3; }
  .mx-quote__title { max-width: 13ch; }
  .mx-quote__intro { padding: clamp(48px, 4.6vw, 68px) clamp(32px, 3.6vw, 52px) 0 clamp(36px, 4.4vw, 64px); }
  .mx-quote__aside { align-self: end; padding: 40px clamp(32px, 3.6vw, 52px) clamp(44px, 4.6vw, 64px) clamp(36px, 4.4vw, 64px); }
  .mx-quote__formwrap { align-self: center; margin: clamp(40px, 4vw, 60px) 0; }
}
/* Small laptops: chip names wrap, so the card (and the board) is taller. Share the extra
   height instead of leaving one empty band between "What happens next" and "Prefer to talk?" */
@media (min-width: 980px) and (max-width: 1279px) {
  .mx-quote__aside { align-self: center; }
  .mx-quote__next { margin-top: clamp(36px, 4vw, 48px); }
}
/* Sent: the board beside the card already lists the next steps (wide screens only) */
@media (min-width: 1024px) {
  .mx-quote[data-quote-result="sent"] .mx-quote__done-next { display: none; }
}

/* Tablet */
@media (min-width: 700px) and (max-width: 979px) {
  .mx-quote__formwrap { margin-inline: clamp(20px, 3vw, 32px); }
}

/* Phones: land the "Free quote" trip closer to the board. The office row is left to the
   footer location card that follows (address, map, directions). */
@media (max-width: 767px) {
  .mx-quote { padding-top: clamp(32px, 9vw, 56px); }
  .mx-quote__office { display: none; }

  /* Mobile action bar (global, mx.css): no "Free Quote" while the form card is on
     screen (the real submit is right there), and out of the way while typing */
  .mx-actionbar { transition: transform .3s var(--mx-ease); }
  body.mx-at-quote .mx-actionbar { grid-template-columns: 1fr 1fr; }
  body.mx-at-quote .mx-actionbar__quote { display: none; }
}
@media (max-width: 767px) and (min-height: 481px) { /* the bar is static on landscape phones */
  body.mx-typing .mx-actionbar { transform: translateY(110%); }
}

/* Small phones: the night board goes full-bleed so the form keeps its width */
@media (max-width: 479px) {
  .mx-quote { padding-block: 0 clamp(40px, 12vw, 56px); }
  .mx-quote > .mx-container { padding-inline: 0; }
  .mx-quote__board { border-radius: 0 0 var(--mx-radius-lg) var(--mx-radius-lg); } /* ends as a card, not a sliver above the footer */
  .mx-quote__board::after { display: none; }
  .mx-quote__intro, .mx-quote__aside { padding-inline: 16px; }
  .mx-quote__formwrap { margin-inline: 12px; }
  .mx-quote__card { padding-inline: 16px; border-radius: var(--mx-radius); }
  .mx-quote__deck { transform: scale(.82); transform-origin: right bottom; margin-right: 0; }
  .mx-quote__chip-name { font-size: 13.5px; padding: 8px 10px 10px; }
  .mx-quote__chip-swatch { padding: 0 8px 0 10px; }
  .mx-quote__pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mx-quote__pill-face { width: 100%; justify-content: center; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .mx-quote__deck span { transition: none; }
  .mx-actionbar { transition: none; }
  .mx-js .mx-quote__deck:not(.is-in) span { transform: translateX(calc(var(--k) * 15px)) rotate(calc((var(--k) - 2) * 7deg)); }
}

/* ===== Mobile layer (<=1023): m5-quote ===== */
/* 16. m5-quote (folded from _mobile-wip/m5-quote.css). JS: the last IIFE in 06-quote.js. */
/* m5-quote (<=1023px only): sideways chips, shorter rhythm, M8 flood (JS: .mxm-q/.mxm-on/origin), ticks, M9, P11 */
@media (max-width: 1023px) {
  .mx-quote__chips { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: 8px; }
  @container (min-width: 280px) { .mx-quote__chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @container (min-width: 540px) { .mx-quote__chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .mx-quote__chip-face { flex-direction: row; min-height: 52px; border-radius: 12px; }
  .mx-quote__chip-swatch { flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: auto; padding: 0; }
  .mx-quote__chip--unsure .mx-quote__chip-swatch { padding-bottom: 16px; }
  .mx-quote__chip-num { margin: 0; font-size: 11px; }
  .mx-quote__chip-tick { top: calc(50% + 1.5px); right: auto; left: 50%; width: 18px; height: 18px; margin: 0 0 0 -9px; font-size: 10px; }
  .mx-quote__chip-name { align-self: center; padding: 6px 10px; }
  .mx-quote__form .mx-textarea { min-height: 96px; max-height: 240px; field-sizing: content; }
  .mx-quote__done-actions .mx-btn { flex-basis: 100%; }
  a.mx-quote__contact { transition: transform .2s var(--mx-ease); }
  a.mx-quote__contact:active { transform: scale(.985); transition-duration: var(--mxm-dur-press, .09s); }

  /* M8: one wave from the touch point (keyboard: the centre), a soft tint over the chip and full colour over its
     swatch; scale only, so it runs on the compositor (clip-path cost 35-110ms frames at 4x CPU) */
  .mxm-q .is-flash .mx-quote__chip-face { animation: none; }
  .mxm-q .mx-quote__chip-face { position: relative; isolation: isolate; }
  .mxm-q .mx-quote__chip-swatch { isolation: isolate; overflow: hidden; }
  .mxm-q .mx-quote__chip-face::before, .mxm-q .mx-quote__chip-swatch::after {
    content: ""; position: absolute; z-index: -1; left: var(--mxm-ox, 50%); top: var(--mxm-oy, 50%); width: calc(var(--mxm-r, 150%) * 2);
    aspect-ratio: 1; border-radius: 50%; translate: -50% -50%; scale: 0; pointer-events: none; background: var(--svc-soft);
    transition: scale .22s cubic-bezier(.5, 0, .75, 0);
  }
  .mxm-q .mx-quote__chip-swatch::after { background: var(--_fill); }
  .mxm-q .mxm-on .mx-quote__chip-face::before, .mxm-q .mxm-on .mx-quote__chip-swatch::after { scale: 1; transition: scale var(--mxm-dur-flood, .32s) var(--mx-ease-out); }
  .mxm-q .mx-quote__radio:checked + .mx-quote__chip-face .mx-quote__chip-swatch { background: var(--svc-soft); color: var(--_icon); }
  .mxm-q .mxm-on .mx-quote__radio:checked + .mx-quote__chip-face .mx-quote__chip-swatch { color: var(--svc-ink); transition: color .12s linear .1s; }
  .mxm-q .mx-quote__chip:not(.mxm-on) .mx-quote__chip-tick { opacity: 0; transform: scale(.5); }
  .mxm-q .mxm-on .mx-quote__chip-tick { transition: opacity .15s linear .12s, transform .3s var(--mxm-ease-pop, cubic-bezier(.34, 1.36, .64, 1)) .12s; }
  .mxm-q .mx-quote__chip-tick i { clip-path: inset(0 100% 0 0); transition: clip-path .2s var(--mx-ease) .18s; }
  .mxm-q .mxm-on .mx-quote__chip-tick i { clip-path: inset(0); }
  .mxm-q.mxm-lit .mx-quote__chip:not(.mxm-on) .mx-quote__chip-swatch { color: var(--mx-subtle); }

  /* Band: each stripe's layer rests on its centre line; the picked one spreads, the old one pulls back */
  .mxm-q .mx-quote__band.is-picked span { opacity: 1; background: color-mix(in srgb, var(--svc) 18%, var(--mx-paper)); }
  .mxm-q .mx-quote__band.is-picked span.is-on { background: var(--svc); }
  .mxm-q .mx-quote__band span::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: var(--svc);
    transform-origin: calc((var(--k, 0) + .5) * 100% / var(--mxm-n, 5)) 50%; scale: 0 1; transition: scale .26s cubic-bezier(.5, 0, .75, 0);
  }
  .mxm-q.mxm-lit .is-picked .is-on::after,
  .mxm-q[data-quote-result="sent"] .is-in .mxm-pick::after { z-index: 2; scale: 1; transition: scale .45s var(--mx-ease-out) .08s; }
  .mxm-q[data-quote-result="sent"] .is-in .mxm-pick::after { transition-delay: .6s; } /* after the sweep */
  .mxm-q[data-quote-result="sent"] .mx-quote__band span { animation-fill-mode: backwards; } /* leaves no clip */

  /* Positive tick (decorative) once a typed field passes 06-quote's check and loses focus: the input's own
     background (no :has, so typing stays cheap); --mx-success on a 14% tint of it over paper */
  .mxm-q [data-q-field] { scroll-margin: 8px 0 16px; } /* plus html's scroll-padding */
  .mxm-q [data-q-field] > .mx-input {
    padding-right: 46px; background-repeat: no-repeat; background-position: right 12px center; background-size: 0 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%23DCECE6'/%3E%3Cpath d='M7.6 12.4l3 3 5.8-6.2' fill='none' stroke='%231F7A4F' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    transition: border-color .25s var(--mx-ease), box-shadow .25s var(--mx-ease), background-size .25s var(--mxm-ease-pop, cubic-bezier(.34, 1.36, .64, 1));
  }
  .mxm-q .mx-input[data-dirty]:user-valid:not(:focus, :placeholder-shown, [aria-invalid="true"]) { background-size: 24px 24px; }

  /* M9 recovery note; P11 summary pill in the picked service's colour */
  .mx-quote__submit [data-quote-status]:not(.mx-sr-only) { font-size: 13.5px; line-height: 1.5; text-align: center; color: var(--mx-ink-2); }
  .mxm-q-sum {
    display: inline-flex; align-items: center; gap: 9px; min-height: 34px; padding: 5px 14px 5px 6px; border-radius: var(--mx-radius-pill);
    background: var(--svc-soft, var(--mx-sand)); font: 600 14px/1.3 var(--mx-font); color: var(--mx-ink);
  }
  .mxm-q-sum::before { content: ""; flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--svc, var(--mx-ink)); }

  @keyframes mxm-coat { from { transform: scaleX(0); } to { transform: scaleX(.92); } }
  @keyframes mxm-q-nudge { 20% { transform: translateX(-4px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-3px); } }
  @keyframes mxm-pop { from { opacity: 0; transform: scale(.6); } }
}

@media (min-width: 1024px) { .mxm-q-sum { display: none; } } /* server-rendered summary pill: phones + tablets only */

/* Full-bleed board (small phones): the card and the intro/aside text share the page gutter (16px at 320-400) */
@media (max-width: 479px) {
  .mx-quote { padding-bottom: 56px; } /* the board ends as a card: a deliberate section gap before the footer, not a 40-47px sliver */
  .mx-quote__formwrap { margin-inline: var(--mx-gutter); }
  .mx-quote__intro, .mx-quote__aside { padding-inline: var(--mx-gutter); }
}

@media (max-width: 979px) { /* stacked board: tighter rhythm, same content */
  .mx-quote__intro { padding-top: clamp(26px, 6vw, 48px); padding-bottom: clamp(20px, 4vw, 30px); }
  .mx-quote__title { margin-top: 14px; }
  .mx-quote__lead { margin-top: 12px; }
  .mx-quote__card { padding-top: clamp(24px, 3.4vw, 36px); }
  .mx-quote__cardhead { margin-bottom: 16px; }
  .mx-quote__form, .mx-quote__pair { gap: 18px; }
  .mx-quote__legend { margin-bottom: 8px; }
  .mx-quote__aside { gap: 12px; padding-top: 26px; padding-bottom: clamp(26px, 6vw, 40px); }
  .mx-quote__contact { min-height: 56px; padding-block: 8px; }
}

@media (max-width: 1023px) and (prefers-reduced-motion: no-preference) {
  .mx-quote__deck span { transition-duration: .45s; transition-delay: calc(var(--k) * 35ms + 120ms); }
  .mx-quote__submit .mx-btn.is-busy::after { /* 4G: a 14% ink coat creeps across and never claims to finish */
    content: ""; position: absolute; inset: 0; z-index: -1; transform-origin: 0 50%;
    background: linear-gradient(90deg, color-mix(in srgb, var(--mx-ink) 14%, transparent) 88%, transparent); animation: mxm-coat 9s cubic-bezier(.25, .55, .3, 1) forwards;
  }
  .mxm-q-nudge { animation: mxm-q-nudge .36s var(--mx-ease-out); } /* not .mxm-nudge: 04-projects uses that on its rail */
  .mx-quote__done, .mx-quote__alert { animation-duration: .4s; }
  .mx-quote__done-mark { animation: mxm-pop .32s var(--mxm-ease-pop, cubic-bezier(.34, 1.36, .64, 1)) .12s both; }
  .mx-js .mx-quote__formwrap:not(.is-in) .mx-quote__done-mark { animation-play-state: paused; }
  .mx-quote__done-mark path { animation-duration: .3s; animation-delay: .3s; }
  .mx-quote[data-quote-result="sent"] .mx-quote__band span { animation-duration: .4s; animation-delay: calc(var(--k, 0) * 35ms); }
}
/* ===== /Mobile layer: m5-quote ===== */
