/* Quotation builder (build.py renders it from quotes.json; x-quote.js totals it and writes the PDF).
   Options on the left, a dark summary that stays in view on the right; on phones the summary follows the
   options and a slim total bar rides along the bottom of the list. Neutral and ink components only. */

.qb { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px 28px; align-items: start; }
.qb-main { display: grid; gap: 14px; min-width: 0; }

/* ---------- the package itself */
.qb-base { padding: clamp(24px, 3vw, 36px); background: #fff; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-sm); }
.qb-base-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.qb-k { font: 600 12.5px/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.qb-base-name { margin-top: 10px; font: 600 clamp(1.4rem, 2.1vw, 1.8rem)/1.15 var(--sans); letter-spacing: -.02em; }
.qb-base-sum { max-width: 34em; margin-top: 8px; font-size: 16px; line-height: 1.55; color: var(--muted); }
.qb-base-price { flex: none; text-align: right; font: 600 clamp(1.9rem, 3vw, 2.5rem)/1 var(--sans); letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qb-base-price small { margin-right: 5px; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.qb-base-price span { display: block; margin-top: 10px; font-size: 14.5px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }

/* ---------- option groups */
.qb-group { min-width: 0; margin: 0; padding: clamp(20px, 2.6vw, 30px); background: #fff; border: 1px solid var(--line); border-radius: 28px; }
.qb-legend { float: left; width: 100%; margin-bottom: 6px; padding: 0; }
.qb-legend h3 { font: 600 19px/1.25 var(--sans); letter-spacing: -.01em; }
.qb-legend span { display: block; margin-top: 4px; font-size: 14.5px; color: var(--muted); }
.qb-items { clear: both; }
.qb-group--month { background: var(--surface); border-color: transparent; }

.qb-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.qb-items > .qb-item:first-child { border-top: 0; }
.qb-group--month .qb-item { border-color: rgba(18, 18, 18, .08); }
.qb-check { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.qb-label { display: flex; gap: 14px; min-width: 0; cursor: pointer; }
.qb-box { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; background: #fff; border: 1.5px solid #c4c3bd; border-radius: 7px; transition: background-color .2s var(--ease), border-color .2s var(--ease); }
.qb-box svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.6); transition: opacity .2s var(--ease), transform .25s var(--ease); }
.qb-label:hover .qb-box { border-color: var(--ink); }
.qb-check:checked + .qb-label .qb-box { background: var(--ink); border-color: var(--ink); }
.qb-check:checked + .qb-label .qb-box svg { opacity: 1; transform: none; }
.qb-check:focus-visible + .qb-label .qb-box { outline: 2px solid var(--ink); outline-offset: 3px; }
.qb-txt strong { display: block; font: 600 16.5px/1.3 var(--sans); color: var(--ink); }
.qb-txt > span { display: block; margin-top: 4px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.qb-cost { align-self: start; text-align: right; font: 600 17px/1.2 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qb-cost small { margin-right: 3px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.qb-cost em { display: block; margin-top: 4px; font-size: 13px; font-style: normal; font-weight: 500; color: var(--muted); }

.qb-qty { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 2px; margin: 12px 0 0 36px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.qb-qty[hidden] { display: none; }
.qb-step { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; background: var(--surface); border: 0; border-radius: 50%; color: var(--ink); cursor: pointer; transition: background-color .2s var(--ease); }
.qb-step:hover { background: var(--line); }
.qb-step:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.qb-step svg { width: 16px; height: 16px; }
.qb-qty input { width: 52px; height: 40px; padding: 0; text-align: center; font: 600 16px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); background: transparent; border: 0; -moz-appearance: textfield; appearance: textfield; }
.qb-qty input::-webkit-inner-spin-button, .qb-qty input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.qb-qty input:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 10px; }

/* ---------- not in the price, and running costs */
.qb-extra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.qb-extra > div, .qb-details { padding: clamp(20px, 2.6vw, 30px); background: var(--surface); border-radius: 28px; }
.qb-h { margin-bottom: 12px; font: 600 17.5px/1.25 var(--sans); letter-spacing: -.01em; }
.qb-x li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.qb-x li + li { margin-top: 8px; }
.qb-x li::before { content: ""; position: absolute; left: 1px; top: .72em; width: 8px; height: 1.6px; border-radius: 2px; background: var(--soft); }
.qb-run > div + div { margin-top: 10px; }
.qb-run dt { font-size: 15px; font-weight: 600; color: var(--ink); }
.qb-run dd { margin: 2px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* ---------- your details */
.qb-details { background: #fff; border: 1px solid var(--line); }
.qb-hint { margin: -4px 0 18px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.qb-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.qb .field { display: grid; gap: 8px; }
.qb .field--full { grid-column: 1 / -1; }
.qb .field label { font: 600 15px/1.2 var(--sans); color: var(--ink); }
.qb .field label small { margin-left: 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.qb .field input, .qb .field textarea { width: 100%; padding: 13px 16px; font: 400 16.5px/1.5 var(--sans); color: var(--ink); background: var(--surface); border: 1px solid transparent; border-radius: 14px; transition: border-color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease); }
.qb .field textarea { min-height: 96px; resize: vertical; }
.qb .field input::placeholder, .qb .field textarea::placeholder { color: var(--muted); opacity: 1; }
.qb .field input:hover, .qb .field textarea:hover { border-color: var(--line); }
.qb .field input:focus, .qb .field textarea:focus { outline: none; background: #fff; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(245, 165, 36, .2); }
.qb .field.is-missing input { border-color: var(--ink); background: #fff; }
.qb .hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.qb .form-note { margin-top: 16px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.qb .form-note a { color: var(--ink); border-bottom: 1px solid var(--marigold); }

/* ---------- the summary: dark card, in view while you choose */
.qb-sum { position: sticky; top: calc(var(--hdr) + 20px); min-width: 0; }
.qb-card { max-height: calc(100vh - var(--hdr) - 40px); max-height: calc(100dvh - var(--hdr) - 40px); overflow-y: auto; overscroll-behavior: contain; padding: clamp(24px, 2.6vw, 32px); background: #151514 radial-gradient(90% 60% at 100% 0%, rgba(245, 165, 36, .2), rgba(245, 165, 36, 0) 70%); border-radius: 28px; box-shadow: var(--shadow-lg); color: #fff; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.qb-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.qb-card .qb-k { color: rgba(255, 255, 255, .62); }
.qb-no { font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .78); text-align: right; }
.qb-total { margin-top: 16px; font: 600 clamp(2.4rem, 3.6vw, 3.1rem)/1 var(--sans); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.qb-total small { margin-right: 8px; font-size: 15px; font-weight: 500; letter-spacing: 0; color: rgba(255, 255, 255, .62); }
.qb-total-v { display: inline-block; }
.qb-total-v.is-bump { animation: qb-bump .32s var(--ease); }
@keyframes qb-bump { from { opacity: .4; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.qb-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 14.5px; color: rgba(255, 255, 255, .62); }
.qb-meta .qb-time { color: #fff; font-weight: 500; }

.qb-lines { max-height: 216px; overflow-y: auto; margin-top: 20px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .12); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.qb-lines li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: 14.5px; line-height: 1.4; color: rgba(255, 255, 255, .78); }
.qb-lines li + li { border-top: 1px solid rgba(255, 255, 255, .07); }
.qb-lines b { flex: none; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.qb-lines .is-rush b { color: var(--marigold); }
.qb-month { margin-top: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .78); background: rgba(255, 255, 255, .06); border-radius: 14px; }
.qb-month b { color: #fff; font-weight: 600; }

.qb-pay { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); }
.qb-sub { margin-bottom: 10px; font: 600 12.5px/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: rgba(255, 255, 255, .62); }
.qb-pay ol { display: grid; gap: 10px; counter-reset: qb; }
.qb-pay li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "n t b" "n t s"; column-gap: 10px; font-size: 14px; line-height: 1.4; color: rgba(255, 255, 255, .78); counter-increment: qb; }
.qb-pay li::before { content: counter(qb); grid-area: n; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .1); font: 600 11.5px/1 var(--sans); color: #fff; }
.qb-pay li span { grid-area: t; }
.qb-pay li b { grid-area: b; text-align: right; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qb-pay li small { grid-area: s; text-align: right; font-size: 12.5px; color: rgba(255, 255, 255, .55); }

.qb-actions { display: grid; gap: 10px; margin-top: 24px; }
.qb-actions .btn { justify-content: center; width: 100%; border: 0; cursor: pointer; }
.qb-actions .btn[hidden] { display: none; }
.btn--ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .4); transition: box-shadow .2s var(--ease), transform .25s var(--ease); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px #fff; transform: translateY(-1px); }
.qb-actions .btn:focus-visible, .qb-wa:focus-visible { outline: 2px solid var(--marigold); outline-offset: 3px; }
.qb-actions .btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.qb-wa { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14.5px; color: rgba(255, 255, 255, .78); border-bottom: 1px solid rgba(255, 255, 255, .3); transition: color .2s var(--ease), border-color .2s var(--ease); }
.qb-wa:hover { color: #fff; border-color: #fff; }
.qb-wa svg { width: 16px; height: 16px; }
.qb-status { margin-top: 14px; font-size: 14.5px; line-height: 1.5; color: #fff; }
.qb-status:empty { display: none; }
.qb-status a { border-bottom: 1px solid var(--marigold); }
.qb-status.is-ok::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--marigold); vertical-align: 1px; }

/* the slim total bar only appears on phones */
.qb-bar { display: none; }

@media (max-width: 1000px) {
  .qb { grid-template-columns: minmax(0, 1fr); }
  .qb-sum { position: static; }
  .qb-card { max-height: none; overflow: visible; }
  .qb-lines { max-height: none; }
  .qb-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; padding: 10px 10px 10px 20px; background: #151514; border-radius: 999px; box-shadow: var(--shadow-lg); color: #fff; font-size: 15px; }
  .qb-bar p { color: rgba(255, 255, 255, .7); }
  .qb-bar b { margin-left: 4px; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
  .qb-bar a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; background: #fff; border-radius: 999px; color: var(--ink); font-weight: 500; white-space: nowrap; }
  .qb-bar svg { width: 15px; height: 15px; }
}
@media (max-width: 640px) {
  .qb-base-top, .qb-card-head { flex-direction: column; }
  .qb-card-head { gap: 8px; }
  .qb-no { text-align: left; }
  .qb-base-price { text-align: left; }
  .qb-extra, .qb-fields { grid-template-columns: minmax(0, 1fr); }
  .qb-item { grid-template-columns: minmax(0, 1fr); }
  .qb-cost { grid-column: 1; margin: 8px 0 0 36px; text-align: left; }
  .qb-cost em { display: inline; margin-left: 6px; }
  .qb-qty { margin-left: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .qb-total-v.is-bump { animation: none; }
  .qb-box, .qb-box svg, .btn--ghost { transition: none; }
}
