/* SpeedySpares quote flow (My Garage -> sign in -> new/used -> category -> part -> quote).
   Uses the site tokens only, so night and day mode both follow tokens.css. */
.qw { --qw-progress: 0; }
.qw [hidden] { display: none !important; }   /* component display rules must never beat the hidden attribute */
.qw .finder-intro { margin-bottom: var(--space-8); }

.qw-steps { display: grid; grid-template-columns: repeat(var(--step-count, 5), minmax(0, 1fr)); gap: var(--space-2); margin: 0 0 var(--space-3); padding: 0; list-style: none; }
.qw-steps button { display: flex; align-items: baseline; gap: var(--space-2); width: 100%; padding: var(--space-2) 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer; }
.qw-steps b { font-family: var(--display-font); font-size: var(--text-lg); color: var(--line); transition: color var(--motion-state) var(--ease-out); }
.qw-steps .is-done b { color: var(--accent-light); }
.qw-steps .is-current { color: var(--text); }
.qw-steps .is-current b { color: var(--accent-light); }
.qw-bar { position: relative; height: .1875rem; margin-bottom: var(--space-8); background: var(--line); overflow: hidden; }
.qw-bar span { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(calc(.04 + var(--qw-progress) * .96)); transition: transform var(--motion-reveal) var(--ease-out); }

.qw-body { min-height: 19rem; }
.qw-panel:focus { outline: none; }
.qw-panel { scroll-margin-top: calc(var(--header-height) + var(--preview-height) + 1.25rem); }
@media (min-width: 851px) { .qw-panel { scroll-margin-top: 1.25rem; } }
.qw-title { margin: 0 0 var(--space-2); font-family: var(--display-font); font-size: var(--title-md); line-height: 1; text-transform: uppercase; }
.qw-sub { margin: 0 0 var(--space-6); color: var(--muted); font-size: var(--text-sm); max-width: 38rem; }

.qw-grid { display: grid; gap: var(--space-4); margin-bottom: var(--space-4); }
.qw-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qw-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qw-field { display: grid; gap: var(--space-2); }
.qw-field > span { color: var(--muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.qw-field em { font-style: normal; font-weight: 400; letter-spacing: .02em; text-transform: none; opacity: .8; }
.qw-field input, .qw-field select, .qw-field textarea {
  width: 100%; min-height: 3.25rem; padding: var(--space-3) var(--space-4); border: var(--rule) solid var(--line); border-radius: var(--radius-control);
  background: var(--ink); color: var(--text); font: inherit; font-size: var(--text-base);
  transition: border-color var(--motion-state) var(--ease-out), box-shadow var(--motion-state) var(--ease-out);
}
.qw-field textarea { resize: vertical; min-height: 6rem; }
.qw-field input:focus, .qw-field select:focus, .qw-field textarea:focus { outline: none; border-color: var(--accent-light); box-shadow: 0 0 0 .1875rem rgb(206 37 43 / 22%); }
.qw-vin { max-width: 32rem; }
.qw-vin input { text-transform: uppercase; letter-spacing: .08em; }

.qw-garage-list { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-6); }
.qw-chip { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 3rem; padding: var(--space-2) var(--space-5); border: var(--rule) solid var(--line); background: var(--ink); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; clip-path: polygon(0 0, 100% 0, 100% 72%, 94% 100%, 0 100%); transition: border-color var(--motion-state), background var(--motion-state); }
.qw-chip:hover { border-color: var(--accent-light); }
.qw-chip.is-active { border-color: var(--accent); background: var(--accent); color: var(--white); }
.qw-chip-dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; opacity: .6; }
.qw-add-toggle { border-style: dashed; color: var(--muted); font-weight: 500; }

.qw-signed-in { display: flex; align-items: center; gap: var(--space-4); max-width: 34rem; padding: var(--space-5); border: var(--rule) solid var(--line); background: var(--ink); }
.qw-signed-in small { display: block; color: var(--muted); font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; }
.qw-signed-in strong { font-size: var(--text-lg); }
.qw-signed-in .qw-not-you { margin-left: auto; }
.qw-check { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--whatsapp); position: relative; }
.qw-check::after { content: ''; position: absolute; left: .8rem; top: .55rem; width: .5rem; height: .95rem; border: solid var(--white); border-width: 0 .17rem .17rem 0; transform: rotate(45deg); }

.qw-tiles { display: grid; gap: var(--space-3); }
.qw-tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qw-tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qw-tile { position: relative; display: grid; align-content: start; gap: var(--space-2); min-height: 9rem; padding: var(--space-6); border: var(--rule) solid var(--line); background: var(--ink); color: var(--text); font: inherit; text-align: left; cursor: pointer; overflow: hidden;
  transition: border-color var(--motion-state) var(--ease-out), transform var(--motion-press) var(--ease-out), background var(--motion-state); }
.qw-tile-sm { min-height: 6.5rem; padding: var(--space-5); }
.qw-tile strong { font-family: var(--display-font); font-size: 1.5rem; line-height: 1.05; text-transform: uppercase; }
.qw-tile-sm strong { font-size: 1.2rem; }
.qw-tile small { color: var(--muted); font-size: var(--text-sm); line-height: 1.4; }
.qw-tile::after { content: ''; position: absolute; left: 0; bottom: 0; height: .1875rem; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--motion-state) var(--ease-out); }
.qw-tile:hover { border-color: var(--accent-light); }
.qw-tile:hover::after, .qw-tile.is-active::after { transform: scaleX(1); }
.qw-tile:active { transform: scale(.985); }
.qw-tile.is-active { border-color: var(--accent); background: linear-gradient(160deg, rgb(206 37 43 / 18%), transparent 70%), var(--ink); }
.qw-tag { justify-self: start; padding: .2rem .55rem; border: var(--rule) solid var(--accent-light); color: var(--accent-light); font-size: var(--text-xs); font-weight: 600; letter-spacing: .14em; }

.qw-hint { margin: var(--space-4) 0 0; color: var(--muted); font-size: var(--text-sm); }

.qw-quote-head { display: flex; justify-content: space-between; align-items: end; gap: var(--space-6); margin-bottom: var(--space-6); }
.qw-quote-head .qw-tag { margin-bottom: var(--space-3); display: inline-block; }
.qw-quote-id { font-family: var(--display-font); font-size: var(--title-md); color: var(--accent-light); letter-spacing: .04em; }
.qw-summary { display: grid; margin: 0 0 var(--space-6); border-top: var(--rule) solid var(--line); }
.qw-summary > div { display: grid; grid-template-columns: 9rem 1fr auto; gap: var(--space-4); align-items: baseline; padding: var(--space-4) 0; border-bottom: var(--rule) solid var(--line); }
.qw-summary dt { color: var(--muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.qw-summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.qw-edit, .qw-link { padding: 0; border: 0; background: none; color: var(--accent-light); font: inherit; font-size: var(--text-sm); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.qw-edit, .qw-link { min-width: 2.75rem; min-height: 2.75rem; }
.qw-send { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 3.5rem; padding: var(--space-4) var(--space-8); background: var(--whatsapp); color: var(--white); font-weight: 700; text-decoration: none; clip-path: polygon(0 0, 100% 0, 100% 74%, 94% 100%, 0 100%); transition: background var(--motion-state); }
.qw-send:hover { background: var(--whatsapp-hover); }
.qw-send .wa-button-icon { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.qw-sent { margin-top: var(--space-5); padding: var(--space-4) var(--space-5); border-left: .1875rem solid var(--whatsapp-light); background: var(--ink); font-size: var(--text-sm); }
.qw-restart { display: block; margin-top: var(--space-5); }

.qw-error { margin: var(--space-5) 0 0; padding: var(--space-3) var(--space-4); border-left: .1875rem solid var(--accent); background: rgb(206 37 43 / 12%); color: var(--text); font-size: var(--text-sm); font-weight: 600; }
/* Primary action sits left, next to Back, so the fixed WhatsApp button (bottom right) never covers it. */
.qw-nav { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-8); padding-top: var(--space-6); border-top: var(--rule) solid var(--line); }
.qw-nav .qw-back { order: 1; }
.qw-nav .qw-next { order: 2; }
.qw-nav .qw-count { order: 3; margin-left: auto; }
.qw-back { min-height: 3rem; padding: 0 var(--space-5); border: var(--rule) solid var(--line); background: none; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.qw-back:disabled { opacity: .35; cursor: default; }
.qw-count { color: var(--muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.qw-next { display: inline-flex; align-items: center; gap: var(--space-4); min-height: 3.375rem; padding: var(--space-4) var(--space-8); border: 0; background: var(--accent); color: var(--white); font: inherit; font-weight: 700; cursor: pointer; clip-path: polygon(0 0, 100% 0, 100% 78%, 92% 100%, 0 100%); }
.qw-next:hover { background: var(--accent-hover); }
.qw-next .icon { width: 1.1rem; height: 1.1rem; }
.qw-next[hidden] { display: none; }

/* Narrated preference-first flow and real VIN/part photo sharing. */
.qw .qw-condition-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qw-panel { scroll-margin-top: calc(var(--header-height) + var(--preview-height) + 1.5rem); }
.qw .qw-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qw-category-fallback { margin-top: 1.5rem; }
.qw-panel:has(.pr-stage.is-ready) .qw-category-fallback { display: none; }
.qw [data-quote-ring] { max-width: 100%; overflow: clip; padding-top: 1rem; }
.qw .pr-scene { height: 24rem; }
.qw-category-action { display: grid; justify-items: center; gap: 1rem; margin-top: 1.5rem; }
.qw-category-action p { color: var(--muted); }
.qw-category-action strong { color: var(--text); }
.qw-selection { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; color: var(--accent-light); font-weight: 600; }
.qw-account-actions { margin: 0 0 1rem; }
.qw-photo { margin: 1.5rem 0; padding: 1.25rem; border: var(--rule) solid var(--line); background: var(--ink); }
.qw-photo-rule { margin: 0 0 1rem; font-weight: 600; }
.qw-photo-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.qw-photo-button { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .75rem 1rem; border: 1px solid var(--line); color: var(--text); font-size: .875rem; cursor: pointer; }
.qw-photo-button:hover { border-color: var(--accent-light); }
.qw-photo-button:focus-within { outline: 2px solid var(--accent-light); outline-offset: 3px; }
.qw-photo-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.qw-photo-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1rem; }
.qw-photo-preview img { width: 6rem; height: 6rem; object-fit: contain; }
.qw-photo-preview span { min-width: 0; max-width: 20rem; overflow-wrap: anywhere; }
.qw-photo small, .qw-photo-status { display: block; color: var(--muted); font-size: .8125rem; line-height: 1.5; margin-top: 1rem; }
@media (max-width: 560px) {
  .qw .qw-condition-options, .qw .qw-tiles-3, .qw .qw-grid-4 { grid-template-columns: 1fr; }
  .qw .pr-scene { height: 19rem; }
  .qw .qw-selection { align-items: start; gap: .25rem; }
  .qw .qw-steps { gap: .5rem; grid-template-columns: repeat(var(--step-count, 5), minmax(0, 1fr)); }
  .qw .qw-steps button { display: grid; align-content: start; gap: .25rem; font-size: .625rem; line-height: 1.25; }
}

.site-nav .qw-garage-count:not(:empty) { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; margin-left: .35rem; padding: 0 .3rem; border-radius: 1rem; background: var(--accent); color: var(--white); font-size: .7rem; font-weight: 700; }
.condition-cta { border: 0; cursor: pointer; font: inherit; }

@media (max-width: 64rem) { .qw-tiles-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 53.125rem) {
  .qw-steps { grid-template-columns: repeat(6, auto); justify-content: space-between; }
  .qw-steps span { display: none; }
  .qw-steps .is-current span { display: inline; }
  .qw-grid-3, .qw-tiles-3 { grid-template-columns: 1fr; }
  .qw-tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qw-tile { min-height: 0; }
  .qw-summary > div { grid-template-columns: 1fr auto; }
  .qw-summary dt { grid-column: 1 / -1; }
  .qw-quote-head { flex-direction: column; align-items: start; }
  .qw-send { width: 100%; justify-content: center; }
}
@media (max-width: 30rem) { .qw-grid-2 { grid-template-columns: 1fr; } .qw-count { display: none; } }
