/* ════════════════════════════════════════════════════════════════════════════
   quotation-builder.css — Create Quotation, the four-step builder (v4.158).
   Colours are the app's own tokens (theme.css), so it follows the rep's
   theme: near-black panels and amber actions in dark, white panels in light.
   Mobile first: 16px gutters, 44-48px inputs, a 52px action, a footer that
   sits BELOW the scrolling body (never over it) with the safe-area padding.
   ════════════════════════════════════════════════════════════════════════════ */
.qw {
  position: fixed; inset: 0; z-index: 1500; display: flex; flex-direction: column;
  background: var(--canvas, #0d0f11); color: var(--ink, #fff); font-family: var(--ui, system-ui, sans-serif);
}
html.qw-open { overflow: hidden; }
.qw > * { width: 100%; max-width: 640px; margin-inline: auto; }
.qw__bar { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 8px; }
.qw__t h1 { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.2; }
.qw__t p { margin: 1px 0 0; font-size: 13px; color: var(--ink-subtle, #9aa3ad); }
.qw-round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--e1-border, rgba(255,255,255,.12)); background: var(--e1-bg, #1b1d20);
  color: var(--ink, #fff); display: grid; place-items: center; cursor: pointer; flex: none; }
.qw-round svg, .qw-x svg, .qw-del svg, .qw-add svg, .qw-qty svg, .qw-search svg, .qw-field svg, .qw-go svg, .qw-res__ic svg, .qw-sel__ic svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.qw-steps { list-style: none; margin: 0 auto; padding: 6px 16px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 0; position: relative; }
.qw-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.qw-step::before { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--hairline, rgba(255,255,255,.14)); z-index: 0; }
.qw-step:first-child::before { display: none; }
.qw-step.is-done::before, .qw-step.is-on::before { background: var(--accent, #f7a11a); }
.qw-step button { position: relative; z-index: 1; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 2px solid var(--hairline-strong, rgba(255,255,255,.22));
  background: var(--canvas, #0d0f11); color: var(--ink-subtle, #9aa3ad); font: 700 14px var(--ui); display: grid; place-items: center; cursor: pointer; }
.qw-step button:disabled { cursor: default; }
.qw-step.is-on button { background: var(--accent, #f7a11a); border-color: var(--accent, #f7a11a); color: var(--on-accent, #1a1206); }
.qw-step.is-done button { border-color: var(--accent, #f7a11a); color: var(--accent-ink, #f7a11a); }
.qw-step button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.qw-step__l { font-size: 12px; font-weight: 600; color: var(--ink-subtle, #9aa3ad); }
.qw-step.is-on .qw-step__l { color: var(--ink, #fff); }

.qw__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 12px; outline: none; }
.qw-card { padding: 14px; border-radius: 16px; background: var(--e1-bg, #1b1d20); border: 1px solid var(--e1-border, rgba(255,255,255,.1)); display: flex; flex-direction: column; gap: 10px; flex: none; }
.qw-card h2 { margin: 0; font-size: 16px; font-weight: 800; }
.qw-card__h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qw-l { display: block; font-size: 13px; font-weight: 600; color: var(--ink-subtle, #9aa3ad); margin-top: 2px; }
.qw-l--sm { margin-top: 0; }
.qw-req { color: var(--accent-ink, #f7a11a); }
.qw-opt { font-weight: 500; opacity: .8; }
.qw-hint { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-subtle, #9aa3ad); }
.qw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qw-err { margin: 0; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--danger, #f2555a); background: var(--danger-wash, rgba(242,85,90,.12)); color: var(--ink, #fff); font-size: 14px; font-weight: 600; flex: none; }

.qw-search, .qw-field { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 12px; background: var(--wash, rgba(255,255,255,.05)); border: 1px solid var(--e1-border, rgba(255,255,255,.12)); color: var(--ink-subtle, #9aa3ad); }
.qw-search:focus-within, .qw-field:focus-within, .qw-in:focus, .qw-sel-in:focus { border-color: var(--accent-ink, #f7a11a); box-shadow: 0 0 0 3px var(--accent-focus, rgba(247,161,26,.4)); outline: none; }
.qw-search input, .qw-field input { flex: 1; align-self: stretch; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink, #fff); font: 500 16px var(--ui); }
.qw-in, .qw-sel-in { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; background: var(--wash, rgba(255,255,255,.05)); border: 1px solid var(--e1-border, rgba(255,255,255,.12)); color: var(--ink, #fff); font: 500 16px var(--ui); }
.qw-ta { padding: 12px 14px; resize: vertical; line-height: 1.5; }
.qw-ro { min-height: 48px; display: flex; align-items: center; padding: 0 14px; border-radius: 12px; background: var(--wash, rgba(255,255,255,.04)); border: 1px solid var(--e1-border, rgba(255,255,255,.1)); font-size: 15px; font-weight: 600; }
.qw-ro--text { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 10px 14px; font-weight: 500; font-size: 14px; line-height: 1.45; }
.qw-ro--text small { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-subtle, #9aa3ad); }
.qw-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.qw-sel { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--accent-wash, rgba(247,161,26,.12)); border: 1px solid var(--accent-ink, #f7a11a); }
.qw-sel__ic, .qw-res__ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--wash, rgba(255,255,255,.07)); color: var(--accent-ink, #f7a11a); flex: none; }
.qw-sel__t, .qw-res__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; text-align: start; }
.qw-sel__t b, .qw-res__t b { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }   /* v4.240 layout audit: wraps, never cut */
.qw-sel__t small, .qw-res__t small { font-size: 12.5px; color: var(--ink-subtle, #9aa3ad); overflow-wrap: anywhere; }   /* v4.240 layout audit: wraps, never cut */
.qw-x, .qw-del { width: 44px; height: 44px; border-radius: 12px; border: 0; background: none; color: var(--ink-subtle, #9aa3ad); display: grid; place-items: center; cursor: pointer; flex: none; }
.qw-del { color: var(--danger, #f2555a); }
.qw-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.qw-res { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--e1-border, rgba(255,255,255,.1)); background: var(--wash, rgba(255,255,255,.04)); color: var(--ink, #fff); cursor: pointer; font-family: inherit; }
.qw-res:hover { border-color: var(--accent-ink, #f7a11a); }
.qw-res--new .qw-res__ic { background: var(--accent-wash, rgba(247,161,26,.14)); }
.qw-empty { padding: 12px; font-size: 14px; color: var(--ink-subtle, #9aa3ad); }
.qw-empty-card { align-items: center; text-align: center; padding: 28px 16px; }
.qw-empty-card p { margin: 0; color: var(--ink-subtle, #9aa3ad); }

.qw-add { min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--accent-ink, #f7a11a); background: none; color: var(--accent-ink, #f7a11a); font: 700 15px var(--ui); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.qw-add--sm { min-height: 44px; padding: 0 12px; font-size: 14px; }
.qw-card--lines { gap: 12px; }
.qw-line { padding: 12px; border-radius: 14px; background: var(--wash, rgba(255,255,255,.04)); border: 1px solid var(--e1-border, rgba(255,255,255,.1)); display: flex; flex-direction: column; gap: 10px; }
.qw-line.is-missing { border-color: var(--danger, #f2555a); }
.qw-line__top { display: flex; align-items: center; gap: 12px; }
.qw-pic { width: 48px; height: 56px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex: none; padding: 3px; }
.qw-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.qw-pic--s { width: 40px; height: 46px; }
.qw-line__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qw-line__t b { font-size: 15.5px; font-weight: 700; line-height: 1.25; }
.qw-line__t small { font-size: 12.5px; color: var(--ink-subtle, #9aa3ad); }
.qw-line__grid { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.qw-qty { display: inline-flex; align-items: center; border-radius: 12px; border: 1px solid var(--e1-border, rgba(255,255,255,.14)); background: var(--e2-bg, #232629); overflow: hidden; }
.qw-qty button { width: 44px; height: 46px; border: 0; background: none; color: var(--ink, #fff); display: grid; place-items: center; cursor: pointer; }
.qw-qty input { width: 54px; height: 46px; border: 0; background: none; text-align: center; color: var(--ink, #fff); font: 700 16px var(--mono, ui-monospace, monospace); -moz-appearance: textfield; }
.qw-qty input::-webkit-outer-spin-button, .qw-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qw-pack select { width: 100%; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--e1-border, rgba(255,255,255,.14)); background: var(--e2-bg, #232629); color: var(--ink, #fff); font: 600 15px var(--ui); }
.qw-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; background: var(--e2-bg, #232629); border: 1px solid var(--e1-border, rgba(255,255,255,.12)); font-weight: 600; }
.qw-line__sum { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--hairline, rgba(255,255,255,.1)); }
.qw-line__sum span { display: flex; flex-direction: column; gap: 1px; }
.qw-line__sum .is-r { text-align: end; align-items: flex-end; }
.qw-line__sum small { font-size: 12px; color: var(--ink-subtle, #9aa3ad); }
.qw-line__sum b { font: 700 16px var(--mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.qw-line__sum i { font-style: normal; font-size: 11.5px; color: var(--ink-subtle, #9aa3ad); font-family: var(--ui); }
.qw-sub { margin: 0; text-align: end; font-size: 14px; }
.qw-sub b { font-family: var(--mono, ui-monospace, monospace); }

.qw-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.qw-chip-b { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--e1-border, rgba(255,255,255,.14)); background: none; color: var(--ink-subtle, #9aa3ad); font: 700 14px var(--ui); cursor: pointer; }
.qw-chip-b.is-on { border-color: var(--accent-ink, #f7a11a); background: var(--accent-wash, rgba(247,161,26,.14)); color: var(--accent-ink, #f7a11a); }
.qw-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--wash, rgba(255,255,255,.06)); }
.qw-seg button { min-height: 44px; border: 0; border-radius: 9px; background: none; color: var(--ink-subtle, #9aa3ad); font: 700 15px var(--ui); cursor: pointer; }
.qw-seg button.is-on { background: var(--accent, #f7a11a); color: var(--on-accent, #1a1206); }

.qw-edit { min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--accent-ink, #f7a11a); font: 700 14px var(--ui); cursor: pointer; }
.qw-kv { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; font-size: 14.5px; }
.qw-kv span { color: var(--ink-subtle, #9aa3ad); flex: none; }
.qw-kv b { font-weight: 600; text-align: end; min-width: 0; overflow-wrap: anywhere; }
.qw-kv--g { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--hairline, rgba(255,255,255,.12)); font-size: 16px; }
.qw-kv--g span, .qw-kv--g b { color: var(--accent-ink, #f7a11a); font-weight: 800; }
.qw-rv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.qw-rv li { display: flex; justify-content: space-between; gap: 12px; }
.qw-rv__n { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14.5px; }
.qw-rv__n small { font-size: 12.5px; color: var(--ink-subtle, #9aa3ad); }
.qw-rv__t { font-family: var(--mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; flex: none; }

.qw__foot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hairline, rgba(255,255,255,.12)); background: var(--e1-bg, #17181b); display: flex; flex-direction: column; gap: 10px; flex: none; }
.qw-total { display: flex; justify-content: space-between; align-items: baseline; }
.qw-total span { font-size: 14px; color: var(--ink-subtle, #9aa3ad); font-weight: 600; }
.qw-total b { font: 800 22px var(--mono, ui-monospace, monospace); color: var(--accent-ink, #f7a11a); font-variant-numeric: tabular-nums; }
.qw-total i { font-style: normal; font-size: 13px; font-family: var(--ui); }
.qw-go { width: 100%; min-height: 52px; border-radius: 14px; border: 0; background: var(--accent, #f7a11a); color: var(--on-accent, #1a1206); font: 800 16px var(--ui);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.qw-go:disabled { opacity: .6; cursor: progress; }
.qw-out { width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--e1-border, rgba(255,255,255,.2)); background: none; color: var(--ink, #fff); font: 700 15px var(--ui); cursor: pointer; }

.qw-done { align-items: center; text-align: center; padding: 28px 16px; gap: 6px; }
.qw-done__ic { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-wash, rgba(247,161,26,.14)); color: var(--accent-ink, #f7a11a); display: grid; place-items: center; }
.qw-done__ic svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.qw-done__no { margin: 4px 0 0; font: 800 22px var(--mono, ui-monospace, monospace); }
.qw-done__s { margin: 0; color: var(--ink-subtle, #9aa3ad); }
.qw-done__acts { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.qw-pick { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom)); background: var(--canvas, #0d0f11); max-width: none; }
.qw-pick > * { width: 100%; max-width: 640px; margin-inline: auto; }
.qw-pick__h { display: flex; align-items: center; justify-content: space-between; font-size: 18px; }
.qw-pick__l { list-style: none; margin: 0 auto; padding: 0; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }

.qt-calc { background: none; border: 0; padding: 4px 2px; text-align: start; color: var(--accent-ink, #f7a11a); font: 700 14px var(--ui); cursor: pointer; text-decoration: underline; }
@media (min-width: 700px) {
  .qw__body { padding-inline: 24px; }
  .qw-card { padding: 18px; }
}
.qw-step__n { line-height: 1; }
.qw-tot { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--hairline, rgba(255,255,255,.12)); }

/* Native pickers: the list the browser draws follows the app's theme, so its
   words are readable (white on white before v4.159). */
.qw select { color-scheme: dark; }
:root[data-scheme="light"] .qw select { color-scheme: light; }
.qw select option { background: Canvas; color: CanvasText; }
.qw-vat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--wash, rgba(255,255,255,.04)); border: 1px solid var(--e1-border, rgba(255,255,255,.1)); }
.qw-vat__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qw-vat__t b { font-size: 15px; }
.qw-vat__t small { font-size: 12.5px; color: var(--ink-subtle, #9aa3ad); line-height: 1.4; }
.qw-sw { position: relative; width: 52px; height: 32px; flex: none; border-radius: 999px; border: 0; background: var(--hairline-strong, rgba(255,255,255,.22)); cursor: pointer; }
.qw-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.qw-sw[aria-checked="true"] { background: var(--accent, #f7a11a); }
.qw-sw[aria-checked="true"]::after { transform: translateX(20px); }
.qw-sw:focus-visible { outline: 2px solid var(--accent-ink, #f7a11a); outline-offset: 2px; }

/* The rep's own price per pack on a catalogue line (2026-11-03): the box, "Use app price", and how far it is from the app's. */
.qw-l[for^="qwOp"] { margin-top: 12px; }
.qw-own { display: flex; gap: 8px; align-items: center; }
.qw-own .qw-in { flex: 1; min-width: 0; }
.qw-reset { flex: none; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--hairline-strong, rgba(127,127,127,.35));
  background: transparent; color: var(--ink, inherit); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.qw-reset:focus-visible { outline: 2px solid var(--accent, #F7A11A); outline-offset: 2px; }
.qw-hint--own { margin-top: 6px; }
.qw-hint--own b { color: var(--ink, inherit); font-variant-numeric: tabular-nums; }
.qw-hint--own b.is-up { color: var(--success, #2FB36B); }
.qw-hint--own b.is-dn { color: var(--accent-ink, #C2410C); }   /* readable orange in both themes (AA) */
