/* Quotes tab (money layer M1) — Claude's Billdr-discipline restyle,
   ported in full as Wave 10 (2026-10-15): the list, the wizard
   frame with its pinned action row, the Edit grid with the totals
   ledger below it and the navy Total bar, Add details, Customize,
   the pickers, and the template cards (markup notes
   03-MARKUP-NOTES.md §1/§2/§3 — all ported; the named adaptations
   are in WAVE1_BUILD_LOG.md).

   Gold appears in exactly two places: the primary button (portal
   .btn-primary, untouched here) and the grand Total. Everything
   else is navy, grey and white.

   Scope: every rule hangs off a quotes class (.quote-*, .quotes-*,
   .qe-*, .qd-*, .qc-*, .qcd-*, .qs-*) or a quotes id. The only
   global declaration is the --q-* custom-property set on :root —
   tokens, not element styles — each falling back to the portal
   token it shadows. Two carried-over sections ride at the end:
   WS6's Preview / Record send styles and the WS8 hardening rules,
   both of which postdate Claude's wave-3 base; they are preserved,
   with the WS8 focus rings re-tokened from gold to this sheet's
   navy ink so the gold discipline above holds. */

:root {
  --q-ink: var(--ink, #0f2233);
  --q-navy: #0f2233;                 /* the portal's document-band navy (PDF header) */
  --q-muted: var(--muted, #66717f);
  --q-faint: #98a1ad;
  --q-line: var(--line, #e1e5ea);
  --q-line-strong: #cbd2da;
  --q-hair: #edf0f3;
  --q-card: var(--card, #fff);
  --q-bg: var(--bg, #f4f6f8);
  --q-tint: #f8f9fb;
  --q-gold: var(--gold, #b08d3e);
  --q-danger: #b3261e;
  --q-warn-ink: #8a5a00;
  --q-warn-bg: #fdf6e7;
  --q-warn-line: #ecd9ac;
  --q-focus: 0 0 0 3px rgba(15, 34, 51, .10);

  /* One type scale for all four steps and the list. */
  --q-fs-xs: 12px;
  --q-fs-sm: 13px;
  --q-fs: 14px;
  --q-fs-md: 16px;
  --q-fs-lg: 18px;
  --q-fs-xl: 22px;

  /* One spacing rhythm. */
  --q-r: 12px;
  --q-r-sm: 8px;
  --q-ctl: 36px;                     /* control height */
  --q-sticky-top: 0px;               /* raise if the portal header is fixed */
}

/* ============================================================
   Shared quiet controls. :where() keeps these at single-class
   weight so every component rule below overrides them cleanly.
   Read-only quotes render their inputs as plain text.
   ============================================================ */
.quote-wizard :where(input[type="text"], input[type="date"], input:not([type]), select, textarea) {
  font: inherit;
  font-size: var(--q-fs);
  color: var(--q-ink);
  background: var(--q-card);
  border: 1px solid var(--q-line);
  border-radius: var(--q-r-sm);
  height: var(--q-ctl);
  padding: 0 10px;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.quote-wizard :where(textarea) { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.quote-wizard :where(input, select, textarea):hover:not(:disabled) { border-color: var(--q-line-strong); }
.quote-wizard :where(input, select, textarea):focus { outline: none; border-color: var(--q-ink); box-shadow: var(--q-focus); }
.quote-wizard :where(input[type="text"], input[type="date"], select, textarea):disabled {
  background: transparent;
  border-color: transparent;
  color: var(--q-ink);
  opacity: 1;
  -webkit-text-fill-color: var(--q-ink);
  appearance: none;
}
.quote-wizard :where(.qm-field) > span {
  display: block;
  font-size: var(--q-fs-xs);
  font-weight: 500;
  color: var(--q-muted);
  margin-bottom: 6px;
}
.quote-wizard :where(.qm-field) :where(input, select, textarea) { width: 100%; }

/* Numbers line up everywhere money or quantity appears. */
.quotes-table .q-num,
.quote-wizard :where(.q-n, .quote-calc, .quote-cat-total, .quote-panel-rows dd, .qd-ms-amt, .qd-ms-pctval, .qcd-table td.q-n, .qcd-total-row),
.quote-totalbar-amt {
  font-variant-numeric: tabular-nums;
}

/* Section cards inside the wizard: white, hairline, no lift. */
.quote-wizard .sum-card {
  background: var(--q-card);
  border: 1px solid var(--q-line);
  border-radius: var(--q-r);
  box-shadow: none;
  padding: 20px 24px;
}
.quote-wizard .sum-card-h { font-size: var(--q-fs-lg); font-weight: 600; color: var(--q-ink); margin: 0 0 14px; letter-spacing: 0; text-transform: none; }

/* Pill toggle — one shape for every on/off control in quotes. The knob is
   a radial gradient (no pseudo-elements on inputs), so it renders the
   same in every browser. Used by .quote-check (Optional upgrade, In client
   PDF) and by the Customize rail's .fx-switch rows. */
.quote-check { display: inline-flex; align-items: center; gap: 10px; font-size: var(--q-fs-sm); color: var(--q-ink); cursor: pointer; user-select: none; }
.quote-check input[type="checkbox"],
.qc-toggle-row .fx-switch input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: static;
  opacity: 1;
  pointer-events: auto;
  flex: 0 0 auto;
  width: 34px;
  height: 20px;
  margin: 0;
  border: 0;
  border-radius: 99px;
  background: var(--q-line-strong) radial-gradient(circle, #fff 7px, transparent 7.5px) no-repeat 0 0 / 20px 20px;
  cursor: pointer;
  transition: background-color .15s, background-position .15s;
}
.quote-check input[type="checkbox"]:checked,
.qc-toggle-row .fx-switch input[type="checkbox"]:checked { background-color: var(--q-ink); background-position: 14px 0; }
.quote-check input[type="checkbox"]:focus-visible,
.qc-toggle-row .fx-switch input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--q-focus); }
.quote-check input[type="checkbox"]:disabled,
.qc-toggle-row .fx-switch input[type="checkbox"]:disabled { opacity: .5; cursor: default; }
.qc-toggle-row .fx-switch { display: inline-flex; align-items: center; position: relative; width: auto; height: auto; }
.qc-toggle-row .fx-switch > span { display: none; }

/* Small text links (Add discount, Edit taxes, + Add internal note). */
.quote-link-btn {
  appearance: none; background: none; border: 0; padding: 0;
  font: inherit; font-size: var(--q-fs-sm); font-weight: 500;
  color: var(--q-ink); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--q-line-strong); text-underline-offset: 3px;
}
.quote-link-btn:hover { text-decoration-color: var(--q-ink); }
.danger-text { color: var(--q-danger) !important; }

/* Segmented control (Markup | Margin, Percentage | Amount). */
.quote-mode-toggle { display: inline-flex; padding: 2px; background: var(--q-bg); border: 1px solid var(--q-line); border-radius: var(--q-r-sm); gap: 2px; margin-bottom: 10px; }
.quote-mode-toggle button { appearance: none; border: 0; background: transparent; border-radius: 6px; font: inherit; font-size: var(--q-fs-sm); font-weight: 500; padding: 5px 14px; cursor: pointer; color: var(--q-muted); }
.quote-mode-toggle button:hover:not(:disabled) { color: var(--q-ink); }
.quote-mode-toggle button.active { background: var(--q-card); color: var(--q-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 34, 51, .12); }
.quote-mode-toggle button:disabled { cursor: default; }

/* Icon buttons: muted until wanted. */
.quote-icon-btn { appearance: none; background: none; border: 1px solid transparent; border-radius: 7px; width: 28px; height: 28px; padding: 0; cursor: pointer; color: var(--q-faint); display: inline-flex; align-items: center; justify-content: center; }
.quote-icon-btn:hover:not(:disabled) { color: var(--q-ink); background: var(--q-bg); }
.quote-icon-btn:focus-visible { outline: none; box-shadow: var(--q-focus); color: var(--q-ink); }
.quote-icon-btn:disabled { opacity: .3; cursor: default; }
.quote-icon-btn.danger:hover:not(:disabled) { color: var(--q-danger); background: #fdf3f2; }
.quote-icon-btn svg.flip { transform: rotate(180deg); }

/* Warnings: calm amber, small. */
.quote-warn { margin: 0 0 16px; font-size: var(--q-fs-sm); border-radius: var(--q-r-sm); }
.quote-warn ul { margin: 6px 0 0; padding-left: 18px; }
.quote-warn li { margin: 3px 0; }

/* ============================================================
   The quotes list — Billdr's quotes table: one white card, airy
   rows, title over a muted description, amount right.
   ============================================================ */
.quote-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.quote-head p { margin: 0; font-size: var(--q-fs-sm); max-width: 62ch; }
/* While the New-quote form is open, its Create button is the screen's one
   primary — the opener steps back to an outline. */
.quote-head:has(+ #quote-form-slot > form) #quotes-new { background: var(--q-card); color: var(--q-ink); border: 1px solid var(--q-line); box-shadow: none; }

#quote-form-slot > .qm-form,
#quote-form-slot > .sum-card { background: var(--q-card); border: 1px solid var(--q-line); border-radius: var(--q-r); box-shadow: none; padding: 20px 24px; margin-bottom: 20px; }
#quote-form-slot .qm-form-head h3 { font-size: var(--q-fs-lg); font-weight: 600; margin: 0 0 14px; }
#quote-form-slot > .qm-form > p.muted { font-size: var(--q-fs-sm); margin: 12px 0 0; }
#quote-form-slot .qm-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.quotes-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--q-card); border: 1px solid var(--q-line); border-radius: var(--q-r); overflow: hidden; }
.quotes-table th { font-size: var(--q-fs-xs); font-weight: 500; color: var(--q-muted); text-transform: none; letter-spacing: 0; text-align: left; padding: 12px 16px; background: var(--q-card); border-bottom: 1px solid var(--q-line); white-space: nowrap; }
.quotes-table td { font-size: var(--q-fs-sm); color: var(--q-muted); padding: 16px; border-bottom: 1px solid var(--q-hair); vertical-align: top; }
.quotes-table tbody tr:last-child td { border-bottom: 0; }
.quotes-table tbody tr { cursor: pointer; transition: background .12s; }
.quotes-table tbody tr:hover td { background: var(--q-tint); }
.quotes-table th.q-num, .quotes-table td.q-num { text-align: right; }
.quotes-table td.q-num { font-size: var(--q-fs); font-weight: 600; color: var(--q-ink); white-space: nowrap; }
.quotes-table td:nth-child(5) { white-space: nowrap; }
.quote-title { display: block; font-size: var(--q-fs); font-weight: 600; color: var(--q-ink); }
.quote-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; color: var(--q-muted); font-size: var(--q-fs-sm); font-weight: 400; max-width: 60ch; }

/* Template cards for the New-quote form — [markup], gated (see notes §3). */
.quote-tpl-picker { border: 0; margin: 0; padding: 0; min-width: 0; grid-column: 1 / -1; }
.quote-tpl-picker legend { font-size: var(--q-fs-xs); font-weight: 500; color: var(--q-muted); padding: 0; margin-bottom: 8px; }
.quote-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.quote-tpl-card { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 14px; background: var(--q-card); border: 1px solid var(--q-line); border-radius: var(--q-r); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.quote-tpl-card:hover { border-color: var(--q-line-strong); }
.quote-tpl-card input { position: absolute; opacity: 0; pointer-events: none; }
.quote-tpl-card:has(input:checked) { border-color: var(--q-ink); box-shadow: 0 0 0 1px var(--q-ink); }
.quote-tpl-card:has(input:focus-visible) { box-shadow: 0 0 0 1px var(--q-ink), var(--q-focus); }
.quote-tpl-thumb { width: 64px; height: 64px; border-radius: var(--q-r-sm); background: var(--q-bg); border: 1px solid var(--q-hair); display: grid; place-items: center; font-size: var(--q-fs-xl); font-weight: 600; color: var(--q-faint); }
.quote-tpl-body { display: grid; gap: 3px; min-width: 0; }
.quote-tpl-name { font-size: var(--q-fs-md); font-weight: 600; color: var(--q-ink); }
.quote-tpl-meta { font-size: var(--q-fs-xs); color: var(--q-muted); }

/* ============================================================
   The wizard frame. Billdr's arrangement: the title block scrolls
   away; one action row pins to the top carrying the step strip,
   the save state and the step's single filled Next.
   ============================================================ */
.quote-wizard { padding-bottom: 8px; }

.quote-wiz-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.quote-wiz-head > .btn { flex: 0 0 auto; }
.quote-wiz-title { flex: 1; min-width: 0; }
.quote-wiz-title h3 { margin: 2px 0 4px; font-size: var(--q-fs-xl); font-weight: 700; line-height: 1.25; color: var(--q-ink); }
.quote-wiz-title p { margin: 0; font-size: var(--q-fs-xs); }
.quote-wiz-title .quote-wiz-contact { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 6px; font-size: var(--q-fs-sm); color: var(--q-muted); }
.quote-wiz-contact span + span::before { content: "" / ""; display: inline-block; width: 1px; height: 12px; background: var(--q-line-strong); margin: 0 10px; vertical-align: -1px; }

.quote-save { font-size: var(--q-fs-xs); color: var(--q-muted); white-space: nowrap; padding-top: 8px; }
.quote-save.err { color: var(--q-danger); font-weight: 600; }

/* The pinned action row — [markup]. */
.quote-toolbar {
  position: sticky;
  top: var(--q-sticky-top);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 6px 8px 6px 12px;
  background: var(--q-card);
  border: 1px solid var(--q-line);
  border-radius: var(--q-r);
  box-shadow: 0 6px 16px -12px rgba(15, 34, 51, .35);
}
.quote-toolbar .quote-steps { flex: 1; min-width: 0; margin: 0; border: 0; }
.quote-toolbar .quote-save { padding-top: 0; }
.quote-nav { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
@media (max-width: 900px) {
  .quote-toolbar { flex-wrap: wrap; }
  .quote-toolbar .quote-steps { flex-basis: 100%; }
  .quote-nav { margin-left: auto; }
}

/* Step strip: numbered circles; passed steps show a check. Works in the
   old markup (under the head) and inside the pinned row. */
.quote-steps { display: flex; gap: 2px; border-bottom: 1px solid var(--q-line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.quote-step {
  appearance: none; background: none; border: 0; border-radius: var(--q-r-sm); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: var(--q-fs-sm); font-weight: 500; color: var(--q-muted);
  padding: 8px 12px; white-space: nowrap;
}
.quote-step:hover { color: var(--q-ink); background: var(--q-tint); }
.quote-step:focus-visible { outline: none; box-shadow: var(--q-focus); }
.quote-step .q-step-n {
  position: relative;
  width: 22px; height: 22px; margin: 0; flex: 0 0 auto;
  display: inline-grid; place-items: center;
  border-radius: 50%; border: 1.5px solid var(--q-line-strong);
  font-size: var(--q-fs-xs); font-weight: 600; color: var(--q-muted);
}
.quote-step.active { color: var(--q-ink); font-weight: 600; }
.quote-step.active .q-step-n { background: var(--q-ink); border-color: var(--q-ink); color: #fff; }
.quote-step:has(~ .quote-step.active) { color: var(--q-ink); }
.quote-step:has(~ .quote-step.active) .q-step-n { border-color: var(--q-ink); color: transparent; }
.quote-step:has(~ .quote-step.active) .q-step-n::after { content: "\2713" / ""; position: absolute; inset: 0; display: grid; place-items: center; color: var(--q-ink); font-size: 12px; font-weight: 700; }

/* The step body. (#quote-panel shares the .quote-panel class with the
   Edit step's pricing aside; only the aside is ever pinned or styled as
   a ledger — the old sheet made both sticky.) */
.quote-wizard > .quote-panel { position: static; }
.quote-wizard > .quote-panel > .sum-card { margin-bottom: 16px; }
.quote-wizard > .quote-panel > p.muted:first-child { font-size: var(--q-fs-sm); margin: 0 0 12px; }

/* Old-markup footer (Back / Next under the step); the [markup] snippet
   moves both into the pinned row and this block goes quiet. */
.quote-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--q-line); }
.quote-foot .spacer { flex: 1; }

/* Step 1 header: client strip + the quote's title fields. */
.quote-client-rows { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: 0 0 6px; }
.quote-client-rows dt { color: var(--q-muted); font-size: var(--q-fs-xs); }
.quote-client-rows dd { margin: 0 18px 0 0; font-size: var(--q-fs-sm); color: var(--q-ink); overflow-wrap: anywhere; }
.quote-wizard > .quote-panel > .sum-card:has(.quote-client-rows) { padding: 14px 20px; margin-bottom: 20px; }
.quote-wizard > .quote-panel > .sum-card:has(.quote-client-rows) .sum-card-h { font-size: var(--q-fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--q-muted); margin: 0 0 8px; }
.quote-wizard > .quote-panel > .sum-card > p.muted { font-size: var(--q-fs-xs); margin: 0; }

.quote-edit-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 0 0 24px; }
.quote-edit-fields .qm-field-wide { grid-column: 1 / -1; }
.quote-edit-fields #qe-title { font-size: var(--q-fs-md); font-weight: 600; }
.quote-edit-fields #qe-scope { min-height: 76px; }
@media (max-width: 700px) { .quote-edit-fields { grid-template-columns: 1fr; } }

.quote-step-list { margin: 0 0 10px; padding-left: 18px; }
.quote-step-list li { margin: 5px 0; font-size: var(--q-fs-sm); }
.quote-step-list .q-def { color: var(--q-muted); font-size: var(--q-fs-xs); }

.quote-parallel-note { border: 1px solid var(--q-line); border-left: 3px solid var(--q-ink); border-radius: var(--q-r-sm); background: var(--q-tint); padding: 12px 16px; margin: 0 0 12px; }
.quote-parallel-note p { margin: 0; font-size: var(--q-fs-sm); line-height: 1.5; }

/* ============================================================
   Edit step. The grid takes the full width; the pricing panel
   drops beneath it as Billdr's right-aligned ledger (CSS only).
   ============================================================ */
.quote-edit-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }

.quote-patch-note { margin: 0 0 12px; font-size: var(--q-fs-xs); }

/* Edit tools: quiet outline buttons, right-aligned like Billdr's row;
   the template starter sits at the left. */
.quote-edit-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.quote-edit-tools .btn,
.quote-cat-labour-edit .btn,
.qd-sched-actions .btn,
.qd-card > .btn,
.qc-cover-btns .btn,
.qc-preview-btns .btn,
.qc-textblock-row .btn,
.quote-panel-head .btn,
.quote-detail-actions .btn,
.qlp-box-acts .btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  font-size: var(--q-fs-sm); font-weight: 500;
  color: var(--q-ink); background: var(--q-card);
  border: 1px solid var(--q-line); border-radius: var(--q-r-sm); box-shadow: none;
}
.quote-edit-tools .btn:hover,
.quote-cat-labour-edit .btn:hover,
.qd-sched-actions .btn:hover,
.qd-card > .btn:hover,
.qc-cover-btns .btn:hover,
.qc-preview-btns .btn:hover,
.qc-textblock-row .btn:hover,
.quote-panel-head .btn:hover,
.quote-detail-actions .btn:hover,
.qlp-box-acts .btn:hover { border-color: var(--q-line-strong); background: var(--q-tint); }
.quote-edit-tools .btn:disabled, .qd-sched-actions .btn:disabled { opacity: .45; cursor: default; }
.quote-tpl-start { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; order: -1; font-size: var(--q-fs-sm); color: var(--q-muted); }
.quote-tpl-start select { height: 34px; padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs-sm); background: var(--q-card); color: var(--q-ink); }

.quote-sec-head { font-size: var(--q-fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--q-muted); margin: 24px 0 10px; }

/* Category cards — quiet white, name as plain text, total right. */
.quote-cat { background: var(--q-card); border: 1px solid var(--q-line); border-radius: var(--q-r); box-shadow: 0 1px 2px rgba(15, 34, 51, .04); padding: 0; margin-bottom: 16px; }
.quote-cat-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px 4px 10px; min-height: 50px; box-sizing: border-box; }
.quote-cat-head > .quote-icon-btn:first-child { color: var(--q-muted); }
.quote-cat.collapsed .quote-cat-head .quote-icon-btn:first-child svg { transform: rotate(-90deg); }
.quote-cat-name { flex: 1; min-width: 140px; height: 36px; font: inherit; font-size: var(--q-fs-md); font-weight: 600; color: var(--q-ink); padding: 0 8px; border: 1px solid transparent; border-radius: var(--q-r-sm); background: transparent; }
.quote-cat-name:hover:not(:disabled) { border-color: var(--q-line); }
.quote-cat-name:focus { outline: none; border-color: var(--q-ink); box-shadow: var(--q-focus); background: var(--q-card); }
/* wave528: the category name's cost-code suggestions anchor under it */
.quote-cat-name-wrap { position: relative; flex: 1; min-width: 140px; display: flex; }
.quote-cat-name-wrap .quote-cat-name { flex: 1; width: 100%; }
.quote-cat-suggest { position: absolute; top: calc(100% + 4px); left: 0; min-width: 300px; max-width: 440px; z-index: 60; margin-top: 0; }
.quote-cat-code { flex: 0 1 230px; min-width: 120px; height: 32px; padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs-sm); color: var(--q-ink); background: var(--q-tint); }
.quote-cat-markup { display: inline-flex; align-items: center; gap: 3px; }
.quote-cat-markup input { width: 54px; height: 32px; text-align: right; padding: 0 6px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs-sm); }
.quote-pct-sign { color: var(--q-muted); font-size: var(--q-fs-xs); }
.quote-cat-total { min-width: 100px; text-align: right; font-size: var(--q-fs-md); font-weight: 600; color: var(--q-ink); white-space: nowrap; padding: 0 6px 0 12px; background: none; border: 0; }

/* Sub-lines under the name: buckets, then labour time · rate. */
.quote-cat-buckets,
.quote-cat-labour { margin: 0 16px 0 52px; color: var(--q-muted); font-size: var(--q-fs-xs); line-height: 1.5; }
.quote-cat-labour { display: flex; align-items: center; gap: 4px; padding-bottom: 6px; }
.quote-cat-labour b { color: var(--q-ink); font-weight: 500; }
.quote-cat-labour .quote-icon-btn { width: 24px; height: 24px; }
.quote-cat-buckets:last-child { padding-bottom: 10px; }
.quote-cat-labour-edit { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 6px 16px 10px 52px; padding: 12px 14px; border: 1px solid var(--q-line); border-radius: 10px; background: var(--q-tint); }
.quote-cat-labour-edit .qm-field input { width: 130px; height: 34px; padding: 0 9px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs-sm); background: var(--q-card); }
.quote-cat-labour-edit .muted { font-size: var(--q-fs-xs); padding-bottom: 9px; }

.quote-cat-body { margin-top: 8px; border-top: 1px solid var(--q-hair); }
.quote-cat.collapsed .quote-cat-body,
.quote-cat.collapsed .quote-cat-buckets,
.quote-cat.collapsed .quote-cat-labour-edit { display: none; }
.quote-cat.collapsed .quote-cat-labour { padding-bottom: 10px; }
.quote-no-lines { margin: 0; padding: 18px 20px 14px 52px; font-size: var(--q-fs-sm); }

/* Category footer — Billdr's tinted strip of text links. */
.quote-cat-add { display: flex; gap: 4px; margin: 0; padding: 8px 16px 8px 44px; background: var(--q-tint); border-top: 1px solid var(--q-hair); border-radius: 0 0 var(--q-r) var(--q-r); }
.quote-cat-add .btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 8px;
  font-size: var(--q-fs-sm); font-weight: 500; color: var(--q-ink);
  background: transparent; border: 0; border-radius: 6px; box-shadow: none;
}
.quote-cat-add .btn:hover { background: var(--q-card); }

/* The line grid — airy rows on hairlines (Billdr's shape, delta D1). */
.quote-lines-table { width: 100%; border-collapse: collapse; margin: 0; border: 0; background: transparent; }
.quote-lines-table th {
  font-size: var(--q-fs-xs); font-weight: 500; color: var(--q-muted);
  text-transform: none; letter-spacing: 0; text-align: left;
  padding: 10px 8px; background: var(--q-card); border-bottom: 1px solid var(--q-hair); white-space: nowrap;
}
.quote-lines-table th:first-child, .quote-lines-table td:first-child { padding-left: 20px; }
.quote-lines-table th:last-child, .quote-lines-table td:last-child { padding-right: 12px; }
.quote-lines-table th:nth-child(2) { width: 170px; }
.quote-lines-table th:nth-child(3), .quote-lines-table th:nth-child(4) { width: 116px; }
.quote-lines-table th:nth-child(5) { width: 104px; }
.quote-lines-table th:nth-child(6) { width: 112px; }
.quote-lines-table th.q-n, .quote-lines-table td.q-n { text-align: right; }
.quote-lines-table tbody tr { cursor: default; }
.quote-lines-table td { padding: 18px 8px; border-bottom: 1px solid var(--q-hair); vertical-align: top; background: var(--q-card); }
.quote-lines-table tbody tr:last-child td { border-bottom: 0; }
.quote-lines-table td input[type="text"] { width: 100%; height: var(--q-ctl); padding: 0 10px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs); color: var(--q-ink); background: var(--q-card); box-sizing: border-box; }
.quote-lines-table td input.q-n { text-align: right; font-variant-numeric: tabular-nums; }
.quote-lines-table td select { height: var(--q-ctl); padding: 0 6px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs-sm); color: var(--q-ink); background: var(--q-card); }
.quote-lines-table td input[type="text"]:focus,
.quote-lines-table td select:focus { outline: none; border-color: var(--q-ink); box-shadow: var(--q-focus); }

/* Title reads as plain text until touched. */
.quote-line-task { position: relative; min-width: 200px; }
.quote-lines-table .quote-line-task input[type="text"] { border-color: transparent; background: transparent; font-weight: 500; padding-left: 8px; margin-left: -8px; width: calc(100% + 8px); }
.quote-lines-table .quote-line-task input[type="text"]:hover:not(:disabled) { border-color: var(--q-line); background: var(--q-card); }
.quote-lines-table .quote-line-task input[type="text"]:focus { border-color: var(--q-ink); background: var(--q-card); }
.quote-line-flags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.quote-line-flags:empty { display: none; }

.quote-pill { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: var(--q-card); color: var(--q-ink); border: 1px solid var(--q-line); white-space: nowrap; }
.quote-pill.muted-pill { color: var(--q-muted); background: var(--q-tint); border-color: var(--q-hair); }
.quote-badge-unpriced { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--q-warn-bg); color: var(--q-warn-ink); border: 1px solid var(--q-warn-line); }

.quote-qty-cell { white-space: nowrap; }
.quote-lines-table td.quote-qty-cell input[type="text"] { width: 64px; }
.quote-qty-cell select { margin-left: 6px; width: 92px; }

/* Material "+" Labour, as Billdr shows it (decorative, CSS only). */
.quote-lines-table tr.quote-line > td:nth-child(4) { position: relative; padding-left: 20px; }
.quote-lines-table tr.quote-line > td:nth-child(4)::before { content: "+" / ""; position: absolute; left: 5px; top: 26px; font-size: var(--q-fs-xs); color: var(--q-faint); }

/* Markup: the calculated $ sits over the editable % box, quietly. */
.quote-markup-cell { text-align: right; }
.quote-markup-badge { display: block; font-size: var(--q-fs-xs); font-weight: 500; color: var(--q-muted); background: none; border: 0; padding: 0; margin: -14px 0 2px; height: 12px; line-height: 12px; white-space: nowrap; }
.quote-markup-input { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.quote-lines-table td .quote-markup-input input[type="text"] { width: 64px; }

.quote-calc { font-size: var(--q-fs); white-space: nowrap; line-height: var(--q-ctl); }
.quote-line-total { font-weight: 600; color: var(--q-ink); }

/* Row actions: compact and muted; full strength on the row in use. */
.quote-line-acts { white-space: nowrap; width: 1%; text-align: right; }
.quote-line-acts .quote-icon-btn { opacity: .55; transition: opacity .12s; }
.quote-line:hover .quote-line-acts .quote-icon-btn,
.quote-line:focus-within .quote-line-acts .quote-icon-btn { opacity: 1; }
@media (hover: none) { .quote-line-acts .quote-icon-btn { opacity: 1; } }

/* Optional lines: priced, set apart calmly — a rail, a dashed pill,
   a muted total. Never faded to the point of looking disabled. */
.quote-line.is-optional td { opacity: 1; background: var(--q-tint); }
.quote-line.is-optional td:first-child { box-shadow: inset 3px 0 0 var(--q-line-strong); }
.quote-line.is-optional .quote-line-total { color: var(--q-muted); font-weight: 500; }
.quote-line.is-optional .quote-pill:not(.muted-pill) { border-style: dashed; border-color: var(--q-line-strong); color: var(--q-muted); }
.quote-line.is-unpriced .quote-line-total { color: var(--q-faint); }

/* Autocomplete under the title. */
/* wave491: in-flow, NOT absolute — the lines table sits in .quote-lines-scroll
   (overflow-x: auto, so overflow-y computes to auto too), which clips any
   absolutely-positioned dropdown to the table's box: the catalogue answers
   rendered but were invisible until keyboard focus scrolled them into view.
   In-flow the row grows while the list is open, so it can never be clipped. */
.quote-suggest { position: static; margin-top: 6px; background: var(--q-card); border: 1px solid var(--q-line); border-radius: 10px; box-shadow: 0 12px 28px -8px rgba(15, 34, 51, .25); max-height: 264px; overflow-y: auto; }
.quote-suggest button { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; padding: 10px 12px; background: none; border: 0; border-bottom: 1px solid var(--q-hair); font: inherit; font-size: var(--q-fs-sm); color: var(--q-ink); cursor: pointer; text-align: left; }
.quote-suggest button:last-child { border-bottom: 0; }
.quote-suggest button:hover, .quote-suggest button:focus-visible { background: var(--q-tint); outline: none; }
.quote-suggest small { color: var(--q-muted); white-space: nowrap; font-size: var(--q-fs-xs); }

/* wave308 (2026-10-31): the keyboard highlight in the suggestion
   list, the line-row tools (quotes-line-tools.js) and the staff
   document's hidden-line mark. */
.quote-suggest button.is-active { background: var(--q-tint); box-shadow: inset 3px 0 0 var(--q-gold, #c8a24a); }
.quote-icon-btn.qlt-del { color: var(--q-danger); }
.quote-icon-btn.qlt-del:hover:not(:disabled) { background: #fdf3f2; }
.quote-icon-btn.qlt-eye.is-on { color: var(--q-danger); background: #fdf3f2; }
.quote-line.is-hidden-client .quote-line-task input[data-qe-f="line-title"] { color: var(--q-muted); font-style: italic; }
.qlt-hidden-pill { background: #fdf3f2; color: var(--q-danger); }
.qcd-hidden-tag { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 999px; background: #fdf3f2; color: #b3261e; font-size: 10.5px; font-weight: 600; vertical-align: 1px; }

/* Line detail row (delta D2) — continues the line, same tint. */
.quote-line:has(+ .quote-line-detail) td { background: var(--q-tint); border-bottom: 0; }
.quote-lines-table .quote-line-detail td { background: var(--q-tint); padding: 2px 20px 20px 20px; }
.quote-detail-grid { display: grid; grid-template-columns: 1fr 260px; gap: 12px 20px; align-items: end; }
.quote-detail-grid textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs); line-height: 1.5; resize: vertical; background: var(--q-card); }
.quote-detail-grid select { width: 100%; height: var(--q-ctl); padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs-sm); background: var(--q-card); }
.quote-detail-grid .quote-check { grid-column: 1 / -1; }
@media (max-width: 760px) { .quote-detail-grid { grid-template-columns: 1fr; } }
.quote-prov { margin: 10px 0 0; font-size: var(--q-fs-xs); }
.quote-detail-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* Internal note — crew-only; never reaches the client document. */
.quote-note-row { margin-top: 12px; }
.quote-note-field { display: block; margin-top: 12px; }
.quote-note-field textarea { width: 100%; padding: 8px 10px; border: 1px dashed var(--q-line-strong); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs-sm); line-height: 1.5; resize: vertical; background: var(--q-card); }
.quote-line-note { margin: 12px 0 0; font-size: var(--q-fs-sm); }
.quote-line-note span { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--q-muted); margin-bottom: 2px; }

/* The ledger: the pricing aside, below the grid, right-aligned. */
aside.quote-panel { position: static; justify-self: end; width: min(100%, 440px); margin-top: 8px; }
aside.quote-panel .sum-card { background: transparent; border: 0; padding: 4px 0 0; margin: 0; }
.quote-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quote-panel-head .sum-card-h { margin: 0; font-size: var(--q-fs); font-weight: 600; }
.quote-panel-head .btn { height: 28px; padding: 0 10px; font-size: var(--q-fs-xs); }
.quote-panel-mode { margin: 4px 0 0; font-size: var(--q-fs-sm); color: var(--q-ink); }
.quote-panel-mode .muted { font-size: var(--q-fs-xs); }
.quote-panel-editor { border: 1px solid var(--q-line); border-radius: 10px; padding: 12px 14px; margin: 10px 0 4px; background: var(--q-card); }
.quote-panel-editor .qm-field input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs); }
.quote-panel-editor p { margin: 8px 0 0; font-size: var(--q-fs-xs); line-height: 1.5; }
.quote-panel-rows { margin: 10px 0 0; }
.quote-panel-rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 0; }
.quote-panel-rows dt { color: var(--q-ink); font-size: var(--q-fs-sm); }
.quote-panel-rows dt .quote-link-btn { margin-left: 8px; font-size: var(--q-fs-xs); }
.quote-panel-rows dt.muted { color: var(--q-muted); }
.quote-panel-rows dd { margin: 0; font-size: var(--q-fs-sm); font-weight: 500; color: var(--q-ink); white-space: nowrap; }
.quote-panel-rows dd .quote-link-btn { font-size: var(--q-fs-xs); }
.quote-panel-editrow dd { display: flex; gap: 10px; align-items: center; }
.quote-panel-editrow input { width: 110px; height: 32px; padding: 0 8px; border: 1px solid var(--q-line); border-radius: 7px; font: inherit; font-size: var(--q-fs-sm); text-align: right; }
/* Fallback: while the total still lives in the ledger (old markup) it is
   the grand Total — gold, the only gold on the step besides Next. */
.quote-panel-rows .quote-panel-total { border-top: 1px solid var(--q-line); margin-top: 8px; padding-top: 12px; }
.quote-panel-rows .quote-panel-total dt { font-weight: 700; font-size: var(--q-fs-md); }
.quote-panel-rows .quote-panel-total dd { color: var(--q-gold); font-weight: 700; font-size: var(--q-fs-xl); }
.quote-breakdown { border-top: 1px solid var(--q-line); margin-top: 12px; padding-top: 12px; }
.quote-breakdown h4 { margin: 0; font-size: var(--q-fs-sm); font-weight: 600; }
.quote-breakdown h4 .muted { font-weight: 400; font-size: var(--q-fs-xs); }
.quote-breakdown > .quote-link-btn { margin-top: 4px; font-size: var(--q-fs-xs); }
.quote-breakdown-cats { border-top: 1px dashed var(--q-line); margin-top: 8px; padding-top: 6px; }
.quote-breakdown-cats dt { color: var(--q-muted); }

/* The running Total — [markup]. Navy bar pinned to the bottom of the
   Edit step, Total in gold (Billdr's dark bar, our colours). */
.quote-totalbar {
  position: sticky;
  bottom: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 24px;
  padding: 14px 24px;
  background: var(--q-navy);
  color: #fff;
  border-radius: var(--q-r) var(--q-r) 0 0;
  box-shadow: 0 -8px 20px -12px rgba(15, 34, 51, .45);
}
/* wave244 (2026-10-29, audit walk): the sticky total bar rode over the
 * line-item table's last rows. The categories carry bottom clearance
 * taller than the bar, so the last row can always be scrolled clear
 * of it — the bar never sits on a row. */
#qe-cats { padding-bottom: 104px; }
.quote-totalbar-label { font-size: var(--q-fs-md); font-weight: 600; color: rgba(255, 255, 255, .82); }
.quote-totalbar-amt { font-size: var(--q-fs-xl); font-weight: 700; color: var(--q-gold); letter-spacing: .01em; }

@media (max-width: 760px) {
  .quote-cat-head { flex-wrap: wrap; }
  .quote-cat-name { flex-basis: calc(100% - 40px); }
  .quote-cat-buckets, .quote-cat-labour, .quote-cat-labour-edit { margin-left: 16px; }
  .quote-lines-table th:nth-child(2) { width: auto; }
}

/* Catalogue picker (delta D5) and the document / cover pickers, which
   share its rows. Dialog chrome is the portal's fxDialog. */
.quote-pick-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--q-line); margin-bottom: 14px; }
.quote-pick-tabs button { appearance: none; background: none; border: 0; font: inherit; font-size: var(--q-fs-sm); font-weight: 500; color: var(--q-muted); padding: 9px 12px; cursor: pointer; }
.quote-pick-tabs button:hover { color: var(--q-ink); }
.quote-pick-tabs button.active { color: var(--q-ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--q-ink); }
.quote-pick-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.quote-pick-tools input { flex: 1; height: 38px; padding: 0 12px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs); }
.quote-pick-tools select { height: 38px; padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs-sm); background: var(--q-card); }
.quote-pick-tools :is(input, select):focus { outline: none; border-color: var(--q-ink); box-shadow: var(--q-focus); }
.quote-pick-results { max-height: 50vh; overflow-y: auto; border: 1px solid var(--q-line); border-radius: 10px; padding: 0; }
.quote-pick-results > p { padding: 14px 16px; margin: 0; }
.quote-pick-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--q-hair); cursor: pointer; transition: background .12s; }
.quote-pick-row:last-child { border-bottom: 0; }
.quote-pick-row:hover { background: var(--q-tint); }
.quote-pick-row:has(input:checked) { background: var(--q-tint); }
.quote-pick-row input { accent-color: var(--q-ink); width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
.quote-pick-name { flex: 1; font-size: var(--q-fs); color: var(--q-ink); min-width: 0; }
.quote-pick-name small { display: block; margin-top: 2px; color: var(--q-muted); font-size: var(--q-fs-xs); }
.quote-pick-costs { font-size: var(--q-fs-xs); color: var(--q-muted); text-align: right; white-space: nowrap; line-height: 1.6; font-variant-numeric: tabular-nums; }
.quote-pick-more { margin: 10px 14px 12px; }

.quote-import-groups { margin: 6px 0; padding-left: 18px; font-size: var(--q-fs-sm); }

/* ============================================================
   Add details step — Billdr V2's section cards, one column,
   boxed inputs in airy rows. No gold here (the step's big
   number is the quote total, which lives on Edit).
   ============================================================ */
#quote-details-mount { max-width: none; }   /* wave493: was 960px — the Customize step sat in a narrow band on wide screens; Micheal: full width like the Edit step */
.qd-card { margin-bottom: 16px; }
.qd-note { margin: 12px 0 0; font-size: var(--q-fs-xs); line-height: 1.5; }
.qd-wide { display: block; }
.qd-wide textarea { width: 100%; min-height: 96px; padding: 10px 12px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs); line-height: 1.5; resize: vertical; margin-top: 0; background: var(--q-card); }

/* Payment schedule */
.qd-sched-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.qd-sched-head .quote-mode-toggle { margin-bottom: 0; }
.qd-progress { flex: 1; min-width: 240px; }
.qd-progress p { margin: 6px 0 0; font-size: var(--q-fs-xs); }
.qd-progress-bar { height: 6px; border-radius: 99px; background: var(--q-hair); border: 0; overflow: hidden; }
.qd-progress-bar span { display: block; height: 100%; width: 0; background: var(--q-ink); border-radius: 99px; transition: width .2s ease; }
.qd-progress-bar span.over { background: var(--q-danger); }

.qd-ms-row { display: grid; grid-template-columns: minmax(180px, 1fr) 112px 136px auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 0; }
.qd-ms-name { width: 100%; height: var(--q-ctl); padding: 0 10px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs); font-weight: 400; color: var(--q-ink); background: var(--q-card); }
.qd-ms-name:focus, .qd-ms-pct input:focus, .qd-ms-amtin input:focus { outline: none; border-color: var(--q-ink); box-shadow: var(--q-focus); }
.qd-ms-pct { display: inline-flex; align-items: center; gap: 4px; }
.qd-ms-pct input { width: 86px; height: var(--q-ctl); text-align: right; padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs); }
.qd-ms-pctval { font-size: var(--q-fs-sm); color: var(--q-muted); text-align: right; white-space: nowrap; }
.qd-ms-amt { font-size: var(--q-fs); font-weight: 600; color: var(--q-ink); white-space: nowrap; text-align: right; }
.qd-ms-amtin { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.qd-ms-amtin input { width: 110px; height: var(--q-ctl); text-align: right; padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs); font-variant-numeric: tabular-nums; }
.qd-cur { color: var(--q-muted); font-size: var(--q-fs-sm); }
.qd-ms-acts { white-space: nowrap; display: inline-flex; }
.qd-sched-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .qd-ms-row { grid-template-columns: 1fr 110px; padding: 10px 0; border-bottom: 1px solid var(--q-hair); }
  .qd-ms-amt, .qd-ms-amtin, .qd-ms-pctval { text-align: right; }
}

/* Validity */
.qd-validity-grid { display: grid; grid-template-columns: 180px 220px; gap: 12px 16px; }
@media (max-width: 620px) { .qd-validity-grid { grid-template-columns: 1fr; } }
.qd-validity-grid input { width: 100%; height: var(--q-ctl); padding: 0 10px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs); margin-top: 0; }
#qd-val-sentence { margin: 12px 0 0; font-size: var(--q-fs-sm); color: var(--q-ink); font-weight: 500; }

/* Terms */
.qd-terms-pick { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.qd-terms-select { flex: 0 1 360px; min-width: 240px; }
.qd-terms-select select { width: 100%; height: var(--q-ctl); padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs-sm); background: var(--q-card); margin-top: 0; }
.qd-terms-pick .quote-link-btn { margin-left: auto; padding-bottom: 9px; }
.qd-terms-tools { display: flex; gap: 2px; align-items: center; margin: 14px 0 0; border: 1px solid var(--q-line); border-bottom: 0; border-radius: var(--q-r-sm) var(--q-r-sm) 0 0; padding: 4px 6px; background: var(--q-card); }
.qd-terms-tools button { appearance: none; background: none; border: 0; border-radius: 6px; min-width: 30px; height: 28px; padding: 0 8px; font: inherit; font-size: var(--q-fs-sm); cursor: pointer; color: var(--q-muted); }
.qd-terms-tools button:hover { background: var(--q-bg); color: var(--q-ink); }
.qd-terms-sep { width: 1px; height: 16px; background: var(--q-line); margin: 0 4px; }
.qd-terms-edit { border: 1px solid var(--q-line); border-radius: 0 0 var(--q-r-sm) var(--q-r-sm); padding: 12px 14px; min-height: 160px; max-height: 420px; overflow-y: auto; font-size: var(--q-fs); line-height: 1.55; background: var(--q-tint); color: var(--q-ink); }
.qd-terms-edit:focus { outline: none; border-color: var(--q-ink); box-shadow: var(--q-focus); background: var(--q-card); }
.qd-terms-edit p, .qd-terms-read p { margin: 0 0 8px; }
.qd-terms-edit ul, .qd-terms-edit ol, .qd-terms-read ul, .qd-terms-read ol { margin: 0 0 8px; padding-left: 22px; }
.qd-terms-read { font-size: var(--q-fs); line-height: 1.55; }

/* Attached documents */
.qd-doc-row { display: grid; grid-template-columns: minmax(180px, 1fr) 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--q-hair); }
.qd-doc-row:last-child { border-bottom: 0; }
@media (max-width: 760px) { .qd-doc-row { grid-template-columns: 1fr auto; } .qd-doc-meta { display: none; } }
.qd-doc-name { display: inline-flex; align-items: center; gap: 8px; font-size: var(--q-fs); font-weight: 500; color: var(--q-ink); min-width: 0; }
.qd-doc-name svg { color: var(--q-muted); flex: 0 0 auto; }
.qd-doc-name span { overflow-wrap: anywhere; }
.qd-doc-meta { color: var(--q-muted); font-size: var(--q-fs-xs); }
.qd-doc-gone { color: var(--q-warn-ink); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.quote-check.qd-doc-inc { white-space: nowrap; font-size: var(--q-fs-xs); color: var(--q-muted); }
.qd-card > .btn { margin-top: 12px; }

/* ============================================================
   Customize step + the client document. The document controls
   down the main column, Display options + the cost summary in
   the rail, the client document on paper below. The paper's
   accent is the quote's own main colour (gold when unset —
   the same default the PDF prints, so preview and PDF agree).
   ============================================================ */
.qc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .qc-layout { grid-template-columns: 1fr; } }
.qc-card { margin-bottom: 16px; }
.quote-wizard .qc-sub-h { margin-top: 24px; }
.qc-note { margin: 12px 0 0; font-size: var(--q-fs-xs); line-height: 1.5; }
.qc-rail { position: sticky; top: calc(var(--q-sticky-top) + 72px); }
@media (max-width: 980px) { .qc-rail { position: static; } }

/* Cover */
.qc-cover-img { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; border: 1px solid var(--q-line); }
.qc-cover-empty { border: 1.5px dashed var(--q-line-strong); border-radius: 10px; padding: 32px 16px; text-align: center; color: var(--q-muted); font-size: var(--q-fs-sm); background: var(--q-tint); }
.qc-cover-btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.qc-cover-upload { margin-top: 16px; border-top: 1px solid var(--q-line); padding-top: 14px; }
.qc-cover-upload p { margin: 6px 0 0; font-size: var(--q-fs-xs); }
.qc-pick-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; border: 1px solid var(--q-line); background: var(--q-bg); flex: 0 0 auto; }

.qc-textblock-row { margin-top: 14px; }

/* Display options rail */
.qc-amount { display: block; margin-bottom: 8px; }
.qc-amount select { width: 100%; height: var(--q-ctl); padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs-sm); background: var(--q-card); margin-top: 0; }
.qc-toggle-group-h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--q-muted); margin: 18px 0 2px; }
.qc-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--q-hair); font-size: var(--q-fs-sm); color: var(--q-ink); }
.qc-toggle-row:last-of-type { border-bottom: 0; }
/* wave496 — the template picker (top of Display options) + the step's Undo. */
.qc-tpl { margin: 0 0 14px; padding: 0 0 14px; border-bottom: 1px solid var(--q-hair); }
.qc-tpl-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qc-tpl-btns .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-social-ico { display: inline-flex; vertical-align: -4px; margin-right: 8px; }
.quote-nav .qc-undo[disabled] { opacity: .45; cursor: default; }

/* Main colour — Billdr's rounded squares. */
.qc-swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qc-sw { appearance: none; width: 32px; height: 32px; border-radius: 7px; border: 1px solid rgba(0, 0, 0, .12); cursor: pointer; padding: 0; transition: transform .1s; }
.qc-sw:hover:not(:disabled) { transform: translateY(-1px); }
.qc-sw:disabled { cursor: default; opacity: .55; }
.qc-sw.sel { box-shadow: 0 0 0 2px var(--q-card), 0 0 0 4px var(--q-ink); }
.qc-sw:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--q-card), 0 0 0 4px var(--q-ink); }
.qc-sw-red { background: #e53935; }
.qc-sw-orange { background: #fb8c00; }
.qc-sw-yellow { background: #fdd835; }
.qc-sw-green { background: #43a047; }
.qc-sw-teal { background: #00897b; }
.qc-sw-blue { background: #1e88e5; }
.qc-sw-purple { background: #8e24aa; }
.qc-sw-gray { background: #757575; }
.qc-sw-black { background: #212121; }
.qc-sw-custom { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 4px 0 10px; border-radius: 7px; background: var(--q-bg); font-size: var(--q-fs-sm); color: var(--q-muted); cursor: pointer; }
.qc-sw-custom input { width: 32px; height: 24px; padding: 0; border: 1px solid var(--q-line); border-radius: 5px; background: var(--q-card); cursor: pointer; }
.qc-swatches .btn { height: 32px; font-size: var(--q-fs-xs); }

/* The paper preview — an A4-width sheet on a grey desk. */
.qc-preview-card { margin-top: 4px; }
.qc-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.qc-preview-head .sum-card-h { margin: 0 0 4px; }
.qc-preview-head p { margin: 0; font-size: var(--q-fs-xs); max-width: 56ch; }
.qc-preview-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.qc-paper { --acc: var(--gold); max-width: 820px; margin: 0 auto; background: #fff; border: 1px solid var(--q-line); border-radius: 4px; box-shadow: 0 1px 2px rgba(15, 34, 51, .06), 0 12px 32px -16px rgba(15, 34, 51, .25); padding: 40px 44px; color: #14181d; }
.qc-preview-card:has(.qc-paper) { background: var(--q-bg); }
.qc-paper.qc-acc-red { --acc: #e53935; }
.qc-paper.qc-acc-orange { --acc: #fb8c00; }
.qc-paper.qc-acc-yellow { --acc: #fdd835; }
.qc-paper.qc-acc-green { --acc: #43a047; }
.qc-paper.qc-acc-teal { --acc: #00897b; }
.qc-paper.qc-acc-blue { --acc: #1e88e5; }
.qc-paper.qc-acc-purple { --acc: #8e24aa; }
.qc-paper.qc-acc-gray { --acc: #757575; }
.qc-paper.qc-acc-black { --acc: #212121; }
@media (max-width: 760px) { .qc-paper { padding: 22px 16px; } }

/* ==================== BEGIN .qcd — client quote document (Wave 13) ====================
   Replaces quotes.css lines 711–755 (from "/* The client document — shared
   words…" through the four #qc-summary-preview rules) as one block.

   The PDF is the primary surface; this preview follows it. The same model
   and the same section order feed both (quoteClientDocHtml / quoteClientPdfDoc),
   and these rules mirror 03-QUOTE-DOCUMENT-PDF-SPEC.md at screen scale:
   one A4 millimetre ≈ 3.9 px on the 820 px paper, type at pt × 1.38 with an
   11 px floor so nothing on screen is smaller than the portal allows.

   Colour: the Wave 12 tokens (--ds-*, with print-matched fallbacks). Gold
   appears once on the document: the grand Total, in --acc-on-navy on the navy
   bar. --acc and --acc-on-navy are set inline on .qcd by quoteClientDocHtml from
   the quote's own colour, so the preview and the PDF can no longer disagree
   (the old .qc-acc-* class values differed from the stored swatch hexes and a
   custom colour previewed as gold). Nothing here carries meaning by colour
   alone: the Total is the largest, boldest figure on a solid bar; optional
   upgrades sit in a dashed box under a "Not Included" heading.

   Depends on .qc-paper's padding (40px 44px; 22px 16px at ≤760px) for the
   band's full-bleed, and on logo-lockup-band.png beside logo.png. */

.qcd {
  --qd-ink: var(--ds-ink, #14202e);
  --qd-navy: var(--ds-navy, #0b2235);
  --qd-muted: #5c6775;              /* --ds-muted one step darker: 7.5–9 pt print */
  --qd-line: var(--ds-line-strong, #cbd2da);
  --qd-hair: var(--ds-line, #e1e5ea);
  --qd-tint: var(--ds-bg, #f4f6f8);
  --qd-band-pad-x: 44px;
  --qd-band-pad-top: 40px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;   /* the PDF's face */
  color: var(--qd-ink);
  font-size: 13.8px;
  line-height: 1.5;
}
@media (max-width: 760px) { .qcd { --qd-band-pad-x: 16px; --qd-band-pad-top: 22px; } }
:where(.qcd) p { margin: 0; }

/* Band — the logo's own navy, logo left, business block right. */
.qcd-band {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin: calc(-1 * var(--qd-band-pad-top)) calc(-1 * var(--qd-band-pad-x)) 0;
  padding: 26px var(--qd-band-pad-x) 24px;
  background: var(--qd-navy);
  border-bottom: 3px solid var(--acc, #c0a060);
  border-radius: 4px 4px 0 0;
}
.qcd-band-logo { display: block; height: 55px; width: auto; max-width: 52%; margin-left: -6px; }
.qcd-biz { text-align: right; }
.qcd-biz p { font-size: 11px; line-height: 1.55; color: #d6dde5; }
.qcd-biz .qcd-biz-name { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
@media (max-width: 620px) {
  .qcd-band { flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 20px; padding-bottom: 18px; }
  .qcd-band-logo { height: 44px; max-width: 100%; }
  .qcd-biz { text-align: left; }
}

.qcd-cover { display: block; width: 100%; aspect-ratio: 174 / 78; max-width: 100%; height: auto; object-fit: cover; margin: 34px 0 0; }

/* Title block */
.qcd-eyebrow {
  margin: 34px 0 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--qd-muted);
}
.qcd-title { font-size: 27.5px; line-height: 1.18; font-weight: 700; margin: 0; letter-spacing: -.005em; text-wrap: balance; }
.qcd-subtitle { margin-top: 6px; font-size: 15px; color: var(--qd-muted); }

/* Facts row: Prepared for · Project · Valid until */
.qcd-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 30px;
  margin: 22px 0 0; padding: 18px 0 16px;
  border-top: 1px solid var(--qd-hair); border-bottom: 1px solid var(--qd-hair);
}
.qcd-fact { min-width: 0; }
.qcd-fact-k { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--qd-muted); }
.qcd-fact p { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.qcd-fact .qcd-client-name, .qcd-fact .qcd-fact-strong { font-weight: 700; }

.qcd-scope { margin-top: 24px; font-size: 13.8px; line-height: 1.6; white-space: pre-wrap; }   /* wave497: full width, same as the letter */
.qcd-text { margin-top: 2px; font-size: 13.8px; line-height: 1.6; white-space: pre-wrap; }

/* Section heading: spaced navy capitals over a structural rule. */
.qcd-h {
  margin: 34px 0 14px; padding-bottom: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--qd-navy);
  border-bottom: 1px solid var(--qd-line);
}

/* Cost summary table — one row shape for every mode. */
.qcd-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.qcd-table th {
  padding: 0 0 8px; border-bottom: 1px solid var(--qd-line);
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--qd-muted); text-align: left;
}
.qcd-table td { padding: 9px 0; font-size: 13px; vertical-align: top; border-bottom: 1px solid var(--qd-hair); }
.qcd-table th.q-n, .qcd-table td.q-n { text-align: right; white-space: nowrap; padding-left: 16px; }
.qcd-table tbody tr:last-child td { border-bottom-color: var(--qd-line); }
/* Per categories carries no task rows, so its Quantity column is always empty:
   hide it (the PDF drops the same head). */
.qcd-table:not(.qcd-pay):not(:has(.qcd-row-line)):has(thead th:nth-child(3)) :is(th, td):nth-child(2) { display: none; }
.qcd-row-section td {
  padding: 7px 8px; background: var(--qd-tint); border-bottom: 0;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--qd-muted);
}
.qcd-row-category td { font-size: 13.8px; font-weight: 700; }
.qcd-row-line td { border-bottom: 0; padding-top: 3px; padding-bottom: 7px; }
.qcd-row-line td:first-child { padding-left: 20px; }
.qcd-row-line td.q-n:not(:last-child) { color: var(--qd-muted); font-size: 12.4px; }
/* Per tasks: a category opens its group with a rule above it. */
.qcd-row-line + .qcd-row-category td { border-top: 1px solid var(--qd-line); }
.qcd-row-category:has(+ .qcd-row-line) td { border-bottom: 0; }
.qcd-row-split td { font-style: italic; color: var(--qd-muted); font-size: 12.4px; border-bottom: 0; padding: 2px 0 6px; }
.qcd-row-split td:first-child { padding-left: 20px; }
.qcd-desc { display: block; margin-top: 2px; font-size: 11.7px; line-height: 1.45; color: var(--qd-muted); font-weight: 400; font-style: normal; white-space: pre-wrap; }

/* Per total: the one number on a full-width navy bar. */
.qcd-table:has(.qcd-row-total-only) thead { display: none; }
.qcd-row-total-only td { background: var(--qd-navy); color: #fff; border: 0; padding: 16px 20px; font-size: 13.8px; font-weight: 700; }
.qcd-row-total-only td:first-child { border-radius: 4px 0 0 4px; }
.qcd-row-total-only td:last-child { border-radius: 0 4px 4px 0; font-size: 20.7px; color: var(--acc-on-navy, #c0a060); }
.qcd-row-total-only td.q-n:not(:last-child) { padding: 16px 0; }

/* Totals block: quiet rows ending in the navy bar. */
.qcd-totals { margin: 14px 0 0 auto; width: min(100%, 312px); font-variant-numeric: tabular-nums; }
.qcd-total-row { display: flex; justify-content: space-between; gap: 18px; padding: 4px 4px; font-size: 13px; }
.qcd-total-row:first-child { border-top: 1px solid var(--qd-line); padding-top: 12px; }
.qcd-total-row.grand {
  align-items: baseline; margin-top: 10px; padding: 14px 16px;
  background: var(--qd-navy); color: #fff; border-radius: 4px;
  font-size: 13.8px; font-weight: 700;
}
.qcd-total-row.grand span:last-child { font-size: 20.7px; font-weight: 700; color: var(--acc-on-navy, #c0a060); }

/* Optional upgrades: a dashed box — "not included" without colour. */
.qcd-optional { border: 1px dashed var(--qd-line); border-radius: 4px; padding: 6px 18px 14px; }
.qcd-optional .qcd-table td { border-bottom: 0; padding: 9px 0 5px; }
.qcd-optional .qcd-row-line td:first-child { padding-left: 0; }
.qcd-note { margin-top: 8px; font-size: 11.7px; font-style: italic; color: var(--qd-muted); }

/* Payment schedule: numbered, footed by the engine's total. */
.qcd-pay .qcd-pay-n { width: 26px; padding-right: 0; font-size: 12.4px; font-weight: 700; color: var(--qd-muted); }
.qcd-pay th[colspan] { padding-left: 0; }
.qcd-pay td { font-size: 13.8px; }
.qcd-pay td.q-n:nth-child(3) { color: var(--qd-muted); }
.qcd-pay tfoot td { padding-top: 12px; font-weight: 700; border-bottom: 0; }

/* Terms: ONE full-width column at body size (Micheal 2026-11-08, wave497 —
   same ruling as the letter/scope width and his Nov 6 PDF standard: terms
   print one full-width column; the old two-newspaper-column setting is gone). */
.qcd-terms {
  font-size: 13.8px; line-height: 1.6; white-space: pre-wrap; hyphens: auto; overflow-wrap: break-word;
}

/* wave309 — the presentation pack: trust badges, the cover letter,
   the closing socials. Neutral only — gold belongs to the one main
   action and the one key number; a badge is neither. */
.qcd-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.qcd-badge { border: 1px solid var(--qd-line); border-radius: 99px; padding: 5px 12px; font-size: 12px; line-height: 1.4; color: var(--qd-ink); background: #fff; }
.qcd-badge strong { font-weight: 600; }
.qcd-badge span { color: var(--qd-muted); }
/* wave497: program logos on their own row — no outline, just the logo, bigger. */
.qcd-badgelogos { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-top: 14px; }
.qcd-badgelogos a { display: inline-flex; text-decoration: none; }
.qcd-badgelogo { display: inline-flex; align-items: center; gap: 8px; }
.qcd-badgelogo img { height: 52px; width: auto; }
.qcd-badgelogo span { font-size: 12px; color: var(--qd-muted); }
.qcd-letter { margin-top: 24px; font-size: 13.8px; line-height: 1.6; white-space: pre-wrap; }   /* wave497: was max-width 70ch — Micheal: the words run the full width of the page */
.qcd-socials { margin-top: 26px; font-size: 12.4px; color: var(--qd-muted); }
.qcd-socials a { color: var(--qd-navy); text-decoration: none; }
.qcd-socials a:hover { text-decoration: underline; }
/* wave496 — "Follow us on social": brand icons right after the badges
   (the PDF's Awards & certifications order). Names ride aria-label only. */
.qcd-follow { margin-top: 16px; }
.qcd-follow-h { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--qd-navy); }
.qcd-follow-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qcd-follow-i { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--qd-line); border-radius: 50%; background: #fff; text-decoration: none; }
.qcd-follow-i:hover, .qcd-follow-i:focus-visible { border-color: var(--qd-navy); }
.qcd-follow-i svg { width: 18px; height: 18px; display: block; }

/* wave327 — the Baeumler Approved letter section: text-led like
   the badges (no badge artwork), the document's own type. */
.qcd-bae-conduct { margin: 16px 0 0; font-size: 13.8px; line-height: 1.6; font-weight: 600; }
.qcd-bae-list { margin: 6px 0 0; padding-left: 22px; font-size: 13.8px; line-height: 1.6; }
.qcd-bae-list li { padding: 2px 0; }

.qcd-docs { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
/* wave382: document cards, matching the PDF + client page */
.qcd-docs li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 13px; border: 1px solid var(--qd-hair); border-radius: 10px; background: #fbfcfd; }
.qcd-doc-sheet { position: relative; flex: none; display: grid; place-items: center; width: 28px; height: 35px; background: #fff; border: 1px solid var(--qd-hair); border-radius: 3px; color: var(--qd-navy, #123); font-size: 8px; font-weight: 700; }
.qcd-doc-main { display: flex; flex-direction: column; min-width: 0; }
.qcd-doc-main b { font-size: 13px; overflow-wrap: anywhere; }
.qcd-doc-main small { color: var(--qd-muted); font-size: 11px; overflow-wrap: anywhere; }

/* Signatures: heading, reference line and both blocks stay together. */
.qcd-sign { break-inside: avoid; }
.qcd-sig-ref { margin: -4px 0 0; font-size: 11.7px; color: var(--qd-muted); }
.qcd-sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
@media (max-width: 620px) { .qcd-sig-grid { grid-template-columns: 1fr; gap: 28px; } }
.qcd-sig-script { font-family: "Snell Roundhand", "Brush Script MT", "Segoe Script", cursive; font-size: 22px; line-height: 1.1; min-height: 26px; color: var(--qd-ink); }
.qcd-sig-line { border-bottom: 1px solid #78828e; margin-top: 2px; }
.qcd-sig-cap { margin-top: 6px; font-size: 11.7px; color: var(--qd-muted); }
.qcd-sig-date { display: flex; align-items: baseline; gap: 8px; margin-top: 22px; font-size: 11.7px; color: var(--qd-muted); }
.qcd-sig-date span { display: block; width: 150px; border-bottom: 1px solid #78828e; }

/* The rail's cost summary uses the document's table at rail size. On the
   Customize screen the paper's Total is the one gold number, so the rail's
   copy is ink on white. */
#qc-summary-preview .qcd-table td { font-size: var(--q-fs-sm); padding: 6px 0; }
#qc-summary-preview .qcd-table th { padding: 0 0 6px; }
#qc-summary-preview .qcd-row-line td:first-child { padding-left: 12px; }
#qc-summary-preview .qcd-totals { width: 100%; }
#qc-summary-preview .qcd-total-row { font-size: var(--q-fs-sm); padding: 3px 0; }
#qc-summary-preview .qcd-total-row.grand { background: none; color: var(--q-ink); border-top: 1px solid var(--q-line); border-radius: 0; padding: 8px 0 0; margin-top: 6px; font-size: var(--q-fs); }
#qc-summary-preview .qcd-total-row.grand span:last-child { font-size: var(--q-fs-md); color: var(--q-ink); }
#qc-summary-preview .qcd-row-total-only td { background: none; color: var(--q-ink); padding: 8px 0; border-top: 1px solid var(--q-line); }
#qc-summary-preview .qcd-row-total-only td:last-child { color: var(--q-ink); font-size: var(--q-fs-md); }
#qc-summary-preview .qcd-optional { border: 0; padding: 0; }
/* ==================== END .qcd ==================== */

/* ============================================================
   Carried over — WS6's Preview / Record send styles follow,
   verbatim from the pre-restyle sheet (Claude's wave-3 base
   predates the step). Gold discipline holds there too: the
   step's one primary action (Record send) is the portal
   .btn-primary, and the internal ledger's Total is ink.
   ============================================================ */

/* ============================================================
   WS6 — the Preview / Record send step: the frozen preview
   card, the internal (Your) view, the record actions, the
   sends history, and the record panel. Written after the
   design pass (D34) in its system: quiet cards, the mode
   toggle for the view switch, gold only on the step's one
   primary action (Record send) — the footer bar already
   carries the Total.
   ============================================================ */

.qs-preview-card { padding: 16px 18px; }
.qs-preview-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.qs-preview-head .quote-mode-toggle { margin-bottom: 0; }
.qs-preview-note { font-size: 12.5px; }

.qs-internal-note { margin: 0 0 10px; font-size: 13px; }
.qs-table { width: 100%; }
.qs-table th.q-num, .qs-table td.q-num { text-align: right; }
.qs-table td.q-num { white-space: nowrap; }
.qs-cat-row td { background: var(--bg); font-size: 13.5px; }
.qs-line-row td { vertical-align: top; }
.qs-line-title { font-weight: 600; }
.qs-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; white-space: normal; }
.qs-desc { margin-top: 2px; }
.qs-note { margin-top: 2px; font-style: italic; }
.qs-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; margin-left: 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); vertical-align: 1px; }
.qs-badge-warn { color: #b3261e; border-color: #ecc9c6; background: #fdf3f2; }
.qs-ledger { margin-top: 12px; margin-left: auto; max-width: 340px; }
.qs-ledger p { display: flex; justify-content: space-between; gap: 24px; margin: 3px 0; font-size: 13.5px; }
.qs-ledger p span { color: var(--muted); }
.qs-ledger .qs-ledger-total { border-top: 1px solid var(--line); padding-top: 7px; margin-top: 8px; font-size: 15px; }
.qs-ledger .qs-ledger-total span { color: var(--ink); font-weight: 600; }

.qs-actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qs-record-row { margin-top: 12px; }
.qs-pdf-line { margin: 6px 0 0; font-size: 13.5px; }
.qs-retry { margin-left: 10px; }

.qs-result p { margin: 4px 0; }
.qs-history .qs-send-row { padding: 9px 0; border-top: 1px solid var(--line); }
.qs-history .qs-send-row:first-of-type { border-top: 0; }
.qs-send-main { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.qs-send-status { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; }
.qs-send-meta { font-size: 12.5px; margin-top: 2px; }

.qs-cc-row { display: flex; gap: 8px; align-items: end; margin-bottom: 8px; }
.qs-cc-row .grow { flex: 1; min-width: 0; }
.qs-panel-summary { margin-top: 12px; font-size: 13px; }

/* ============================================================
   Carried over — WS8 hardening: the per-unit "/<unit>" echo
   beside the Material / Labour cost inputs, the switch-row
   layout the line-detail and document rows use, narrow-screen
   scrolling for the two wide quote tables, and visible
   keyboard focus where the wizard's controls had none.
   Preserved from the pre-restyle sheet; the focus rings are
   re-tokened from the house gold to this sheet's navy ink
   (the .quote-step ring is Claude's, in the step strip
   above). Presentation only.
   ============================================================ */

/* The per-unit echo beside the Material / Labour cost inputs
   (Billdr prints the unit against the per-unit costs). */
.quote-cost-cell { display: flex; align-items: center; gap: 4px; }
.quote-cost-cell input { flex: 1 1 auto; min-width: 58px; }
.quote-unit-echo { color: var(--q-muted); font-size: var(--q-fs-xs); white-space: nowrap; }

/* The switch row on the line detail row and the document
   rows: a label and the portal's fx-switch pill, side by side. */
.quote-switch-row { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; }
.quote-switch-row .fx-switch { flex: none; }

/* Narrow screens: the line grid and the internal-view table
   scroll sideways inside their cards instead of crushing
   their inputs below usable width. */
.quote-lines-scroll { overflow-x: auto; }
.quote-lines-scroll .quote-lines-table { min-width: 660px; }
.qs-internal { overflow-x: auto; }
.qs-internal .qs-table { min-width: 560px; }

/* Keyboard focus: the fx-switch's real input is visually
   hidden, so its ring rides the track; dialog controls get
   the same treatment (dialogs are body-level, shared with
   Files — the rule is additive and changes nothing for the
   mouse). */
/* Wave 22 (plan L2): the quotes list table scrolls inside its
 * wrap on a narrow screen instead of clipping. */
.quotes-table-wrap { overflow-x: auto; }

.fx-switch input:focus-visible + span { outline: 2px solid var(--q-ink); outline-offset: 2px; }
.fx-dialog input:focus, .fx-dialog select:focus, .fx-dialog textarea:focus { outline: 2px solid var(--q-ink); border-color: var(--q-ink); }
.fx-dialog button:focus-visible { outline: 2px solid var(--q-ink); outline-offset: 1px; }

/* ============================================================
   DW2 P08 — quotes completeness: list row ⋯ menu, the
   Presentation score, Preview as customer, text blocks
   (Customize card + client document), optional add-ons as
   priced deltas, the record-panel note. Structure in plain
   selectors (works in the Navy appearance too); the q-* tokens
   already fall back across both skins.
   ============================================================ */
.quotes-table .q-menu-cell { width: 44px; text-align: right; padding-left: 0; padding-right: 8px; }
.q-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Presentation score */
.qs-score-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.qs-score-num b { font-size: 28px; line-height: 1; color: var(--q-navy); font-variant-numeric: tabular-nums; }
.qs-score-num span { color: var(--q-muted); font-size: var(--q-fs-sm); }
.qs-score-bar { height: 8px; border-radius: 999px; background: var(--q-hair); overflow: hidden; margin: 10px 0 8px; }
.qs-score-bar span { display: block; height: 100%; background: var(--q-gold); border-radius: inherit; }
.qs-score-note { font-size: var(--q-fs-sm); margin: 0 0 8px; }
.qs-score-list { list-style: none; margin: 0; padding: 0; }
.qs-score-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--q-hair); font-size: var(--q-fs); }
.qs-score-item:first-child { border-top: 0; }
.qs-score-pts { flex: none; min-width: 40px; text-align: center; font-weight: 700; font-size: var(--q-fs-xs); color: var(--q-navy); background: var(--q-tint); border: 1px solid var(--q-line); border-radius: 999px; padding: 2px 8px; }
.qs-score-txt { flex: 1 1 auto; min-width: 0; }
.qs-score-all { margin: 6px 0 0; font-weight: 600; color: var(--q-navy); }
.qs-score-done { margin-top: 8px; font-size: var(--q-fs-sm); }
.qs-score-done summary { cursor: pointer; color: var(--q-muted); }
.qs-score-done ul { list-style: none; margin: 6px 0 0; padding: 0; }
.qs-score-done li { display: flex; align-items: center; gap: 6px; padding: 3px 0; }

/* Preview as customer */
.qs-preview-head .qs-customer-btn { margin-left: auto; }
.fx-dialog.qs-customer-dlg { width: min(960px, calc(100vw - 32px)); max-width: none; }
.qs-customer-view { max-height: calc(100vh - 200px); overflow: auto; background: var(--q-bg); padding: 16px; border-radius: 8px; }
.qs-panel-note { font-size: var(--q-fs-sm); margin-top: 10px; }

/* Text blocks — the Customize card */
.qc-tb-list { list-style: none; margin: 0 0 10px; padding: 0; }
.qc-tb-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--q-hair); }
.qc-tb-item:first-child { border-top: 0; }
.qc-tb-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--q-fs); }
.qc-tb-main .muted { font-size: var(--q-fs-xs); }
.qc-tb-snip { color: var(--q-muted); font-size: var(--q-fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-tb-acts { flex: none; display: flex; gap: 2px; }

/* Text blocks — on the client document */
.qcd-tb { margin-top: 4px; }
.qcd-tb .qcd-tb-body { white-space: pre-wrap; }
.qcd-row-text td { padding-top: 10px; padding-bottom: 10px; }
.qcd-row-text .qcd-tb-title { display: block; font-weight: 700; color: var(--qd-ink, var(--q-ink)); margin-bottom: 2px; }
.qcd-row-text .qcd-tb-body { display: block; white-space: pre-wrap; font-size: 12.5px; line-height: 1.55; color: var(--qd-ink, var(--q-ink)); }

/* Optional add-ons read as what they add */
.qcd-delta { font-weight: 600; }

body.skin-billdr #app .qs-score-num b { color: var(--ds-navy); }
body.skin-billdr #app .qs-score-bar span { background: var(--ds-gold); }
body.skin-billdr #app .qs-score-pts { color: var(--ds-navy); background: var(--ds-gold-tint); border-color: var(--ds-gold-line); }

/* DW2 P08 fix: the template chooser (parity5.css, loaded after this
 * sheet) reuses the class names .qc-layout / .qc-card for its own
 * 200px-nav grid and its 64px+1fr pick cards, which crushed the
 * Customize step into a 200px column with grid cards. Scoped back
 * to the Customize step's own layout here. */
#quote-customize-mount .qc-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
@media (max-width: 980px) { #quote-customize-mount .qc-layout { grid-template-columns: 1fr; } }
#quote-customize-mount .qc-card { display: block; padding: 20px 24px; text-align: left; cursor: default; }
#quote-customize-mount .qc-card:hover { border-color: var(--q-line); }

/* FIX-3 B4 (2026-10-20): the placeholder row ("No tasks in this category
   yet.", the no-lines line) — quiet and italic, like the split rows. */
.qcd-row-note td { padding: 4px 0 8px; border-bottom: 0; }
.qcd-row-note .qcd-desc { margin-top: 0; font-style: italic; }
.qcd-row-line + .qcd-row-note td, .qcd-row-category + .qcd-row-note td { padding-left: 20px; }

/* wave241: opened line + per-open times under a send-history row */
.qs-send-opened { margin-top: 2px; font-size: 13px; color: var(--ink); }
.rk-opens { margin-top: 2px; }
.rk-opens summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--navy); }
.rk-opens ul { margin: 4px 0 2px; padding-left: 18px; }
.rk-opens li { font-size: 13px; color: var(--ink); }

/* wave296-quotesteps (2026-10-31, D3): the folded Customize step's
   section headings — Quote details above the details sections,
   Document & presentation above the document controls. */
.quote-fold-h { margin: 24px 0 10px; font-size: 15px; font-weight: 700; color: var(--navy); }
.quote-fold-h:first-child { margin-top: 0; }

/* ---------------------------------------------------------------
   wave351-quotes (supplement 2, Micheal Nov 2)
   The REAL logo on the client document: logo-full.png on a clean
   white header (its lettering is navy on transparent, so it reads on
   white), never stretched or re-coloured; the standard cover is the
   banner logo contained on its own navy ground (the logo's ground is
   #0b2235 exactly — no seam), never cropped. And the category
   picture: beside its heading when set; nothing at all when not.
   --------------------------------------------------------------- */
.qcd-band.qcd-band-full { background: #fff; border-bottom: 3px solid var(--acc, #c0a060); }
.qcd-band-full .qcd-band-logo { height: 96px; width: auto; max-width: 40%; margin-left: 0; object-fit: contain; }
.qcd-band-full .qcd-biz p { color: var(--qd-muted, #5c6775); }
.qcd-band-full .qcd-biz .qcd-biz-name { color: var(--qd-navy, #0b2235); }
@media (max-width: 620px) { .qcd-band-full .qcd-band-logo { height: 72px; max-width: 60%; } }
.qcd-cover.qcd-cover-logo { object-fit: contain; background: #0b2235; padding: 7% 13%; box-sizing: border-box; }
.qcd-row-category td .qcd-cat-pic { float: left; width: auto; height: 64px; max-width: 120px; object-fit: cover; border-radius: 3px; margin: 0 12px 4px 0; }
/* wave385: an allowance's product picture + description in the preview */
.qcd-allow-pic { float: left; width: 84px; height: 84px; object-fit: cover; border-radius: 6px; margin: 1px 10px 2px 0; }
.qcd-allow-desc { font-size: 12px; color: #5b6472; }
.qcd-row-category td::after { content: ''; display: block; clear: both; }
.qcp-door { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.qcp-door .qcp-thumb { height: 34px; width: auto; max-width: 60px; object-fit: cover; border-radius: 3px; border: 1px solid var(--ds-line, #e1e5ea); }

/* wave451: the Buildern-shaped register — ID cell, Seen cell and
   the search / status filter bar above the table. */
.quotes-filter { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; }
.quotes-filter input[type="search"] { flex: 1 1 220px; max-width: 340px; padding: 7px 10px; border: 1px solid var(--q-line, #d8dce3); border-radius: 6px; font: inherit; }
.quotes-filter select { padding: 7px 10px; border: 1px solid var(--q-line, #d8dce3); border-radius: 6px; font: inherit; background: #fff; }
.quotes-table td.q-id { white-space: nowrap; font-weight: 600; color: var(--q-ink); }
.quotes-table td.q-seen { min-width: 170px; vertical-align: top; }

/* wave502 — pictures on quote lines (quote-line-pictures.js). The editor's
   row thumbnail and the line-detail picture box; the client document reuses
   the allowance card's .qcd-allow-pic / .qcd-allow-desc unchanged. */
.qlp-thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; border: 1px solid var(--q-line, #d8dce3); flex: none; }
.qlp-box { display: flex; gap: 14px; align-items: center; margin: 12px 0 0; }
.qlp-pic { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--q-line, #d8dce3); flex: none; }
.qlp-box-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qlp-box-k { font-size: var(--q-fs-sm, 13px); font-weight: 600; color: var(--q-ink, #14202e); }
.qlp-box-from { font-size: var(--q-fs-xs, 12px); }
.qlp-box-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.qlp-box-acts .danger-text { color: var(--q-danger, #b42318); }

/* ============================================================
   wave539: payment schedule templates — the quote editor's
   picker bar (in .qd-sched-actions, the .quote-tpl-start select
   shape) and the Settings editor (Settings → Project settings).
   ============================================================ */
.qst-bar { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qst-pickwrap { display: inline-flex; align-items: center; gap: 8px; font-size: var(--q-fs-sm); color: var(--q-muted); }
.qst-pickwrap select { height: 34px; padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); font: inherit; font-size: var(--q-fs-sm); background: var(--q-card); color: var(--q-ink); max-width: 280px; }
.qst-loading { font-size: var(--q-fs-sm); }
.qst-dlg .rk-field input { width: 100%; }
.qst-tpl { border: 1px solid var(--q-line); border-radius: var(--q-r); padding: 12px; margin-bottom: 12px; background: var(--q-card); }
.qst-tpl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.qst-tpl-head [data-qst-tname] { flex: 1; min-width: 180px; height: 36px; font: inherit; font-size: var(--q-fs-md); font-weight: 600; color: var(--q-ink); padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); background: var(--q-card); }
.qst-tpl-head .quote-mode-toggle { margin-bottom: 0; }
.qst-tpl-head [data-qst-tdel] { margin-left: auto; }
.qst-row { display: grid; grid-template-columns: minmax(180px, 1fr) 150px auto; gap: 10px; align-items: center; padding: 4px 0; }
.qst-row [data-qst-rname] { height: 34px; font: inherit; font-size: var(--q-fs-sm); color: var(--q-ink); padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); background: var(--q-card); width: 100%; box-sizing: border-box; }
.qst-val { display: inline-flex; align-items: center; gap: 4px; }
.qst-val [data-qst-rval] { height: 34px; font: inherit; font-size: var(--q-fs-sm); color: var(--q-ink); padding: 0 8px; border: 1px solid var(--q-line); border-radius: var(--q-r-sm); background: var(--q-card); width: 100%; box-sizing: border-box; text-align: right; }
.qst-tpl [data-qst-addrow] { margin-top: 6px; }
