/* ═══════════════════════════════════════════════════════════════════
   34 · CARD 4 + CARD 1 AT-REST SKIN · COR-78 (SY live review
   2026-09-24, v3): "one clean line per item, EVERY table exactly like
   the fixtures table, cells all the same size, nothing expands on
   hover; Card 1 = plain label/value rows."

   ADDITIVE, CSS-ONLY. The candidate <select>, Accept-price, Remove,
   Pricing-details, Proof, add-row controls and fact citations stay in
   the DOM with their handlers. Row actions have reserved space and
   reveal on hover/focus; drawer proof controls remain in normal flow.
   ═══════════════════════════════════════════════════════════════════ */

/* every cell anchors its own overlays */
#c3q-card { --c3q-row-control-size: 11px; }
#c3q-card table.c3q-tbl.c3q-grid td { position: relative; }

/* ── hidden at rest, in ALL sections ─────────────────────────────── */
.c3q-grid .c3q-price-candidate-select,
.c3q-grid .c3q-accept-price,
.c3q-grid .c3q-price-review-state,
.c3q-grid .c3q-row-exclude,
.c3q-grid .card4i-open,
.c3q-grid .c3q-relationship-trigger,
.c3q-grid .c3q-row-insert {
  display: none !important;
}

/* Equipment keeps one physical row while the source selector opens on demand. */
#c3q-card .c3q-grid tr[data-c3q-row="eq"] .c3q-price-picker-button {
  display: inline-flex;
  position: absolute;
  right: 0;
  top: 1px;
  width: 28px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: var(--paper, #fff);
  color: var(--ink-2);
  cursor: pointer;
  z-index: 2;
}
#c3q-card .c3q-grid tr:has(.c3q-price-picker-open) {
  position: relative;
  z-index: 5;
}
#c3q-card .c3q-grid tr[data-c3q-row="eq"] .c3q-price-picker-open > .c3q-price-candidate-select {
  display: block !important;
  position: absolute;
  top: 100%;
  right: 0;
  width: 260px;
  max-width: none;
  margin: 0;
  background: var(--paper, #fff);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
  z-index: 6;
}

/* Reserve a fixed action area in the Source cell. Hover only reveals it;
   controls never leave their owning row or cover the next row/drawer. */
#c3q-card .c3q-grid > tbody > tr:not(.c3q-component-detail-row) > td:last-child {
  padding-right: 194px;
}
#c3q-card .c3q-grid > tbody > tr > td > .card4i-open,
#c3q-card .c3q-grid > tbody > tr > td > .c3q-row-exclude {
  display: inline-block !important;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  height: 24px;
  box-sizing: border-box;
  margin: 0;
  padding: 2px 6px;
  font: 500 var(--c3q-row-control-size, 11px)/18px "JetBrains Mono", monospace;
  white-space: nowrap;
  background: var(--paper, #fff);
}
#c3q-card .c3q-grid > tbody > tr > td > .card4i-open {
  right: 76px;
  width: 112px;
}
#c3q-card .c3q-grid > tbody > tr > td > .c3q-row-exclude {
  right: 2px;
  width: 68px;
}
#c3q-card .c3q-grid > tbody > tr:hover > td > .card4i-open,
#c3q-card .c3q-grid > tbody > tr:is(:focus-visible, :has(:focus-visible)) > td > .card4i-open,
#c3q-card .c3q-grid > tbody > tr:hover > td > .c3q-row-exclude,
#c3q-card .c3q-grid > tbody > tr:is(:focus-visible, :has(:focus-visible)) > td > .c3q-row-exclude {
  opacity: 1;
  pointer-events: auto;
}

/* Status is persistent; only actionable controls reveal on hover. Completed
   decisions are badges, not disabled buttons that look like another action. */
.card4-price-status {
  display: inline-block;
  box-sizing: border-box;
  padding: 3px;
  border-radius: 4px;
  background: rgba(184, 134, 47, .10);
  color: var(--amber-ink, #8f5f18);
  font: 500 var(--c3q-row-control-size, 11px)/18px "JetBrains Mono", monospace;
  white-space: nowrap;
}
.card4-price-status[data-kind="approved"] { background: rgba(46,108,92,.10); color: #2e6c5c; }
.card4-price-status[data-approved="1"] { background: rgba(46,108,92,.14); color: #2e6c5c; }
.card4-price-status[data-approved="1"][data-kind="draft"] { background: rgba(46,108,92,.08); color: #4d8a78; box-shadow: inset 0 0 0 1px rgba(46,108,92,.35); }
#c3q-card .c3q-grid > tbody > tr.card4-row-approved > td { background: rgba(46,108,92,.07); }
#c3q-card .c3q-grid > tbody > tr.card4-row-approved > td:first-child { box-shadow: inset 3px 0 0 #2e6c5c; }
.card4-price-status[data-kind="missing"] { background: rgba(184,86,47,.08); color: var(--clay, #b8562f); }
.card4-price-status[data-kind="zero"],
.card4-price-status[data-kind="excluded"] { background: rgba(0,0,0,.04); color: var(--ink-3, #777168); }
#c3q-card .c3q-grid > tbody > tr > td > .card4-price-status {
  position: absolute;
  right: 76px;
  top: 50%;
  transform: translateY(-50%);
  width: 112px;
  height: 24px;
  text-align: center;
}
#c3q-card .card4i-open.card4-price-accept[data-price-terminal="true"] {
  display: none !important;
}
#c3q-card .c3q-grid > tbody > tr:is(:hover, :focus-visible, :has(:focus-visible)) > td > .card4-price-status[data-terminal="false"] {
  opacity: 0;
  pointer-events: none;
}

/* ── ONE physical line per row, every section ────────────────────── */
#c3q-card table.c3q-tbl.c3q-grid td {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#c3q-card table.c3q-tbl.c3q-grid td.c3q-finmat-cell,
#c3q-card table.c3q-tbl.c3q-grid td:last-child {
  overflow: visible !important;
}
.c3q-grid .c3q-fx-lbl {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* family icon, same weight in every table */
.c3q-grid .c3q-fx-lbl .ti {
  display: inline-block !important;
  font-size: 14px;
  color: var(--clay, #b8562f);
  flex: none;
}

/* ── uniform price chip — fixtures look, all sections, all states ── */
#c3q-card table.c3q-tbl.c3q-grid .c3q-finmat-in,
#c3q-card table.c3q-tbl.c3q-grid input.c3q-flat.c3q-finmat-in {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 120px !important;
  height: 24px !important;
  line-height: 18px !important;
  margin-left: auto !important;
  box-sizing: border-box !important;
  padding: 2px 8px !important;
  font-family: "JetBrains Mono", ui-monospace, monospace !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-align: right !important;
  color: #2f7d4f !important;
  background: rgba(74, 124, 89, 0.13) !important;
  border: 1px solid rgba(74, 124, 89, 0.55) !important;
  border-radius: 6px !important;
  outline: none;
}
#c3q-card table.c3q-tbl.c3q-grid .c3q-finmat-in.c3q-needs-price-in {
  color: var(--clay, #b85c3e) !important;
  background: rgba(184, 92, 62, 0.08) !important;
  border-color: rgba(184, 92, 62, 0.48) !important;
}
#c3q-card table.c3q-tbl.c3q-grid .c3q-finmat-price {
  position: relative;
  padding-right: 26px !important;
}
#c3q-card table.c3q-tbl.c3q-grid .c3q-finmat-price .c3q-quoted-lock {
  right: 6px !important;
  top: 6px !important;
}

/* Card 5 · Quote desk is shown again as its own step (SY 2026-10-02). */

/* ── CARD 1 · fact table = plain label/value rows ────────────────── */
/* (SY 2026-09-24: "why is card 1 so fucked up — should look like
   this": label left, value right, no chips / citations / review
   buttons at rest. The citation floats in on row hover.) */
.fact-table .fact-cite,
.fact-table .fact-review-controls,
.fact-table .chip-clay {
  display: none !important;
}
.fact-table td {
  position: relative;
}
.fact-table td:last-child {
  text-align: right;
  font-weight: 600;
}
.fact-table tr:hover .fact-cite {
  display: inline-block !important;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 30;
  background: var(--paper, #fff);
  padding: 2px 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── assembly pricing = excel-style component lines ────────────────
   (SY 2026-09-24: "tank · white toto ST45… · $123 · source" — one
   tight line per component, compact atlas dropdown kept, missing
   price highlighted.) */
.c3q-assembly-grid {
  grid-template-columns: minmax(210px, 1.2fr) 200px minmax(140px, 1fr) 90px !important;
  gap: 2px 10px !important;
  padding: 4px 10px !important;
  align-items: center !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
}
.c3q-assembly-grid .c3q-assembly-slot {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c3q-assembly-grid .c3q-assembly-slot .c3q-assembly-component-row {
  display: none;
}
.c3q-assembly-grid .c3q-assembly-slot small {
  display: none;
}
.c3q-assembly-grid .c3q-assembly-slot small.missing {
  display: inline-block;
  font-size: var(--c3q-row-control-size, 11px);
  color: var(--clay, #b8562f);
  font-weight: 700;
  margin-left: 6px;
}
.c3q-assembly-grid .c3q-assembly-select {
  display: block;
  grid-column: 2;
  grid-row: 1;
  width: 200px !important;
  min-height: 22px !important;
  padding: 2px 18px 2px 6px !important;
  font-size: var(--c3q-row-control-size, 11px) !important;
  border-radius: 5px !important;
}
.c3q-assembly-grid .c3q-assembly-proof {
  grid-column: 3 !important;
  grid-row: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.c3q-assembly-grid .c3q-assembly-source-proof {
  font-size: var(--c3q-row-control-size, 11px);
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c3q-assembly-grid .c3q-assembly-line-proof-button {
  font-size: var(--c3q-row-control-size, 11px);
  display: inline-flex;
  flex: none;
  margin-top: 0;
}
.c3q-assembly-grid .c3q-assembly-price {
  grid-column: 4 !important;
  grid-row: 1;
  font: 700 11px/1.2 "JetBrains Mono", monospace !important;
}
.c3q-assembly-grid .c3q-assembly-price.missing {
  color: var(--clay, #b85c3e) !important;
  background: rgba(184, 92, 62, 0.10);
  border-radius: 4px;
  padding: 1px 6px;
}
/* assembly-source component checklist: tight lines (all components,
   missing/unclassified stay visibly flagged) */
.c3q-assembly-source-item {
  padding: 2px 0 !important;
}
.c3q-assembly-source-item small,
.c3q-assembly-source-item .c3q-assembly-source-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── drawer: drop the Review-findings + Source-documents boxes ───── */
.c3q-evidence-section:has(.c3q-evidence-source-list),
.c3q-evidence-section:has(.c3q-evidence-line.review) {
  display: none !important;
}

/* ── v5 · every Card 4 row exactly 31px, all four sections ────────── */
/* (verified 2026-09-24: rough-in labor rows stacked their rate basis on
   a 2nd line → 37px; chip-less rows collapsed to 26px) */
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr {
  height: 31px;
}
#c3q-card table.c3q-tbl.c3q-grid .c3q-itemflex {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}
#c3q-card table.c3q-tbl.c3q-grid .c3q-itemflex .c3q-basis {
  display: inline !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  margin: 0 !important;
}
#c3q-card table.c3q-tbl.c3q-grid tr[data-c3q-row="rilab"] .c3q-itemflex .c3q-fx-lbl {
  flex: 1 0 65%;
  overflow: hidden;
  text-overflow: ellipsis;
}
#c3q-card table.c3q-tbl.c3q-grid tr[data-c3q-row="rilab"] .c3q-itemflex .c3q-basis {
  flex: 0 1 35%;
  min-width: 0;
}

/* ── CARD 2 · document receipt = one clean line per file ─────────── */
/* (SY 2026-09-24: "clean single lines, condense it by 50%") — icon ·
   filename (read detail ellipsized, full text on hover title) · status */
.document-receipt-scroll a.deliverable {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 3px 8px !important;
  min-height: 26px !important;
  height: auto !important;
  overflow: hidden !important;
}
.document-receipt-scroll .deliverable-name {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
}
.document-receipt-scroll .deliverable-name > span:not(.deliverable-icon) {
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
  font-size: 11px !important;
}
.document-receipt-scroll .deliverable-icon {
  flex: none !important;
  transform: scale(0.85);
}
.document-receipt-scroll .deliverable-meta {
  flex: none !important;
  white-space: nowrap !important;
  font-size: 9.5px !important;
  max-width: 34% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ── assembly: component icons + unpriced recipe lines ────────────── */
/* (SY 2026-09-24: "show all fixture assembly components as lines; if we
   don't have pricing, cortex needs to highlight that") */
.c3q-assembly-grid .c3q-assembly-icon {
  font-size: 14px;
  color: var(--clay, #b8562f);
  margin-right: 6px;
  vertical-align: -2px;
}
.c3q-assembly-grid--unpriced {
  background: rgba(184, 92, 62, 0.06);
}
.c3q-assembly-grid--unpriced.is-not-required {
  background: transparent;
  opacity: 0.7;
}
.c3q-assembly-grid .c3q-assembly-unpriced-choice {
  grid-column: 2;
  grid-row: 1;
  font-size: var(--c3q-row-control-size, 11px);
  font-style: italic;
  color: var(--clay, #b8562f);
  white-space: nowrap;
}
.c3q-assembly-grid--unpriced.is-not-required .c3q-assembly-unpriced-choice {
  color: var(--ink-4, #999);
}
/* the editor now lists every recipe component, so the separate
   Assembly-source checklist is redundant wherever the editor renders */
.c3q-component-drawer:has(.c3q-assembly-editor) .c3q-assembly-source,
.c3q-component-detail-row:has(.c3q-assembly-editor) .c3q-assembly-source {
  display: none !important;
}

/* ── v6 audit fixes (2026-09-25) ──────────────────────────────────── */
/* Rough-in: .c3q-ri-material-price WRAPS the editable price input. The
   uniform-chip rule styled both, drawing a chip inside a chip (double
   border, 9px offset). When it wraps an input, the wrapper is invisible
   and only the input is the chip; read-only wrappers keep the chip. */
#c3q-card table.c3q-tbl.c3q-grid .c3q-ri-material-price:has(input) {
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  width: 120px !important;
  min-width: 120px !important;
  max-width: 120px !important;
  height: 24px !important;
  overflow: visible !important;
  font-size: 0 !important;
  box-shadow: none !important;
}
#c3q-card table.c3q-tbl.c3q-grid .c3q-ri-material-price:has(input) > input {
  font-size: 11px !important;
  margin: 0 !important;
}
/* Source column = the pill only; quarantined rows also appended the
   workbook filename link beside it. The pill already links the source. */
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr > td:last-child > .c3q-evidence-link {
  display: none !important;
}

/* ── v7 audit (2026-09-25, after #1035) ───────────────────────────── */
/* The price chip flexed to its cell after #1035, so widths drifted per
   section (fixtures 114 · rough-in 120 overflowing a 95px column ·
   equipment 108 · indirects 79). One fixed chip that fits the narrowest
   price column (RI MAT, 95px) in every section. */
#c3q-card table.c3q-tbl.c3q-grid .c3q-finmat-in,
#c3q-card table.c3q-tbl.c3q-grid input.c3q-flat.c3q-finmat-in {
  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;
  margin-left: auto !important;
}
#c3q-card table.c3q-tbl.c3q-grid .c3q-ri-material-price:has(input) {
  display: block !important;
  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;
  margin-left: auto !important;
}
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr > td:has(.c3q-finmat-in) {
  padding-left: 3px !important;
  padding-right: 3px !important;
}
/* Proof in the price cell sat in normal flow: it wrapped indirects rows
   to 48px and hung under rough-in chips into the next row. Reveal it on
   row hover/focus beside the chip, like the other row actions. */
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr > td .c3q-provenance-button {
  position: absolute !important;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  background: var(--paper, #fff);
}
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr:is(:hover, :focus-visible, :has(:focus-visible)) > td .c3q-provenance-button {
  opacity: 1;
  pointer-events: auto;
}

/* ── v8 · columns align table-to-table; price box color by source ─── */
/* (SY 2026-09-25) Every section puts its price box in the Unit-price
   column (renderer change), all cells share one 6px inset, and the unit
   reads as plain text in every section. */
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr > td:not(:first-child):not(:last-child),
#c3q-card table.c3q-tbl.c3q-grid > thead > tr > th:not(:first-child):not(:last-child) {
  padding-left: 6px !important;
  padding-right: 6px !important;
}
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr > td:first-child { padding-right: 6px !important; }
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr > td:last-child { padding-left: 6px !important; }
#c3q-card table.c3q-tbl.c3q-grid .c3q-unit-input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 100% !important;
  font: inherit !important;
  color: inherit !important;
}
/* Price box color = where the number comes from:
   green  = vendor quote or bid sheet (document-backed)
   yellow = Atlas / portfolio estimate, or no price yet */
#c3q-card table.c3q-tbl.c3q-grid .c3q-finmat-in,
#c3q-card table.c3q-tbl.c3q-grid .c3q-finmat-in.c3q-needs-price-in {
  color: #8f5f18 !important;
  background: rgba(214, 178, 90, 0.16) !important;
  border-color: rgba(184, 134, 47, 0.55) !important;
}
#c3q-card table.c3q-tbl.c3q-grid .c3q-finmat-in.c3q-needs-price-in::placeholder {
  color: #8f5f18;
  opacity: 0.9;
}
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr:has(> td:last-child .c3q-srctag:is(.src-vendor, .src-workbook)) .c3q-finmat-in:not(.c3q-needs-price-in) {
  color: #2f7d4f !important;
  background: rgba(74, 124, 89, 0.13) !important;
  border-color: rgba(74, 124, 89, 0.55) !important;
}

/* Fixture/equipment price boxes keep 26px for the quote-lock icon; give
   rough-in and indirect boxes the same right inset so every section's
   price box lands on the identical x-position. */
#c3q-card table.c3q-tbl.c3q-grid td.c3q-finmat-cell > .c3q-ri-material-price,
#c3q-card table.c3q-tbl.c3q-grid td.c3q-finmat-cell > input.c3q-finmat-in {
  margin-right: 26px !important;
}

/* ── v9 · every value ends on the same right edge, every column ────── */
/* Price column: dashes reserve the same 26px inset as the price boxes. */
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr > td:nth-child(9):not(:has(.c3q-finmat-in)) {
  padding-right: 32px !important;
}
#c3q-card table.c3q-tbl.c3q-grid td.c3q-finmat-cell > span.c3q-mono {
  margin-right: 26px !important;
}
/* Mat $ / Total: 'NEEDS PRICE' was wider than the column; the row's
   yellow price box + status already say it — show the column dash. */
#c3q-card table.c3q-tbl.c3q-grid .c3q-missing-price {
  font-size: 0 !important;
}
#c3q-card table.c3q-tbl.c3q-grid .c3q-missing-price::after {
  content: '—';
  font-size: 11.5px;
  color: var(--ink-4, #999);
}
/* Money never spills past its column */
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr > td:nth-child(n+10):nth-child(-n+12) {
  overflow: hidden !important;
  text-overflow: clip !important;
}

/* v10 · Hours column fits 4-digit hours ("3,863.93" was clipped at 46px);
   a dash in the RI-mat column already gets the 32px cell inset, so it
   must not add the 26px chip inset a second time. */
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr > td:nth-child(9):not(:has(.c3q-finmat-in)) > span.c3q-mono {
  margin-right: 0 !important;
}

/* ── v11 · assembly = one clean line per part ────────────────────────
   (SY 2026-09-26: "dropdown should be on the left · it says we have a
   source, then asks for proof — which is it?") Part name → product
   dropdown → source chip (links to the document; green = quote / bid
   sheet, yellow = Atlas) → price. No Proof button or verified/forecast
   jargon at rest. */
.c3q-assembly-grid.c3q-assembly-line {
  grid-template-columns: 96px minmax(260px, 440px) minmax(140px, 1fr) 86px !important;
  gap: 0 12px !important;
  min-height: 34px;
  padding: 3px 14px !important;
}
.c3q-assembly-line .c3q-assembly-slot {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink, #1f1b16);
}
.c3q-assembly-line .c3q-assembly-part { overflow: hidden; text-overflow: ellipsis; }
.c3q-assembly-line .c3q-assembly-select {
  width: 100% !important;
  min-height: 26px !important;
  font-size: 11.5px !important;
  color: var(--ink, #1f1b16) !important;
  background-color: var(--paper, #fff) !important;
}
.c3q-assembly-line:has(.c3q-assembly-price.missing) .c3q-assembly-select {
  border-color: rgba(184, 134, 47, 0.55) !important;
  background-color: rgba(214, 178, 90, 0.16) !important;
}
.c3q-assembly-line .c3q-assembly-proof { justify-content: flex-start; }
.c3q-assembly-line .c3q-assembly-source-proof { flex: none; }
.c3q-assembly-line .c3q-assembly-line-proof-button { display: none !important; }
.c3q-assembly-line:hover .c3q-assembly-line-proof-button,
.c3q-assembly-line:focus-within .c3q-assembly-line-proof-button {
  display: inline-flex !important;
}
.c3q-assembly-line .c3q-assembly-price {
  text-align: right;
  font-size: 12px !important;
}
.c3q-assembly-editor .c3q-assembly-head {
  align-items: center;
  padding: 9px 14px;
}
.c3q-assembly-editor .c3q-assembly-title { font-size: 12.5px; }
.c3q-assembly-editor .c3q-assembly-total { font-size: 15px; }
.c3q-assembly-editor .c3q-assembly-total small { font-size: 10.5px; }
.c3q-assembly-editor .c3q-assembly-status { padding: 5px 14px; font-size: 10px; }
.c3q-assembly-editor .c3q-assembly-status [hidden] { display: none !important; }
.c3q-assembly-editor .c3q-assembly-equation { display: none; }

/* ── v12 · assembly price picker (replaces the native option list) ──── */
.c3q-pick {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--paper, #fff);
  border: 1px solid var(--border-2, #e2ddd3);
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(31, 27, 22, 0.18);
  overflow: hidden;
  font-size: 12px;
  color: var(--ink, #1f1b16);
}
.c3q-pick-head {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-2, #e2ddd3);
  color: var(--ink-3, #6b645a);
  font-size: 11px;
  flex-shrink: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c3q-pick-head b { color: var(--ink, #1f1b16); font-weight: 600; }
.c3q-pick-list { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 4px 0; }
.c3q-pick-group {
  padding: 8px 14px 4px;
  font: 700 9.5px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4, #8c857a);
}
.c3q-pick-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 62px 100px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 4px 14px;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.c3q-pick-row:hover, .c3q-pick-row:focus-visible { background: rgba(0, 0, 0, 0.04); outline: none; }
.c3q-pick-row.is-selected { background: rgba(74, 124, 89, 0.10); }
.c3q-pick-price { font: 700 12px/1 "JetBrains Mono", ui-monospace, monospace; text-align: right; }
.c3q-pick-name { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.c3q-pick-name b { font-weight: 600; }
.c3q-pick-name span { color: var(--ink-3, #6b645a); }
.c3q-pick-src {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.c3q-pick-src.src-quote, .c3q-pick-src.src-sheet {
  color: #2f7d4f; background: rgba(74, 124, 89, 0.12); border: 1px solid rgba(74, 124, 89, 0.35);
}
.c3q-pick-src.src-atlas {
  color: #8f5f18; background: rgba(214, 178, 90, 0.16); border: 1px solid rgba(184, 134, 47, 0.45);
}
.c3q-pick-src.src-web, .c3q-pick-src.src-other {
  color: var(--ink-3, #6b645a); background: rgba(0, 0, 0, 0.04); border: 1px solid var(--border-2, #e2ddd3);
}
.c3q-pick-when {
  color: var(--ink-4, #8c857a);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c3q-pick-empty { padding: 10px 14px; color: var(--ink-3, #6b645a); }
.c3q-pick-foot {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  border-top: 1px solid var(--border-2, #e2ddd3);
}
.c3q-pick-foot button {
  border: 0;
  background: none;
  padding: 3px 0;
  font: 600 11px/1 inherit;
  color: var(--clay, #b8562f);
  cursor: pointer;
}
.c3q-pick-foot .c3q-pick-clear { color: var(--ink-3, #6b645a); }

/* One scrolling results area; spec, search and actions never overlap it. */
.c3q-pick:has([data-assembly-atlas]) .c3q-pick-list { overflow: visible; }
.c3q-pick-saved summary { padding: 8px 14px; cursor: pointer; font-size: 11px; color: var(--ink-3, #6b645a); }
.c3q-atlas-search { display: flex; flex: 1; flex-direction: column; min-height: 0; border-top: 1px solid var(--border-2, #e2ddd3); }
.c3q-atlas-search-form { display: flex; gap: 6px; padding: 8px 12px; flex-shrink: 0; }
.c3q-atlas-search-form input { flex: 1; min-width: 0; }
.c3q-atlas-search input, .c3q-atlas-search select, .c3q-atlas-search button {
  border: 1px solid var(--border-2, #e2ddd3); border-radius: 5px; background: var(--paper, #fff);
  color: var(--ink, #1f1b16); font: inherit; padding: 6px 8px;
}
.c3q-atlas-search button { cursor: pointer; }
.c3q-atlas-search button:disabled { opacity: .5; cursor: default; }
.c3q-atlas-notice { flex-shrink: 0; padding: 0 12px 6px; color: var(--ink-3, #6b645a); font-size: 10.5px; }
.c3q-atlas-results { flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 0 12px 8px; }
.c3q-atlas-result { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-top: 1px solid var(--border-2, #e2ddd3); }
.c3q-atlas-result small { color: var(--ink-3, #6b645a); overflow-wrap: anywhere; }
.c3q-atlas-result button { align-self: start; }
.c3q-atlas-result a { color: var(--clay, #b8562f); }
.c3q-pick .c3q-atlas-result strong { font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.c3q-pick .c3q-atlas-result small { font-size: 10.5px; line-height: 1.45; }
.c3q-pick .c3q-atlas-search input, .c3q-pick .c3q-atlas-search button { font-size: 11.5px; line-height: 1.4; }
.c3q-pick .c3q-pick-foot button { font-size: 11px; line-height: 1.4; }
@media (max-width: 600px) {
  .c3q-pick-row { grid-template-columns: 60px minmax(0, 1fr) 56px; }
  .c3q-pick-when { grid-column: 2 / 4; white-space: normal; }
}

/* v13 · the Item cell carries the standard name + its qualifier; the
   "RI · finish · permit" counts repeat the Qty/hours columns and were
   truncating the qualifier ("Hose bibb · trash ro…"). */
.c3q-grid .c3q-fx-lbl .c3q-bd-counts { display: none !important; }

.c3q-price-adjustments { padding: 16px; border: 1px solid var(--line, #d8d0c4); margin-top: 18px; }
.c3q-price-adjustments p { font-size: 12px; color: var(--muted, #756e65); }
.c3q-price-adjustments label { margin-right: 16px; }
.c3q-price-adjustments input { width: 75px; padding: 6px; }
.c3q-price-adjustment-status { display: block; font-size: 12px; margin-top: 8px; }
.c3q-adjustment-controls { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 12px; }
.c3q-adjustment-controls > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.c3q-adjustment-controls label { margin: 0; }
.c3q-adjustment-entry { padding: 16px 0; border-bottom: 1px solid var(--line, #d8d0c4); }
.c3q-adjustment-impact { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr); gap: 8px 16px; font-size: 13px; }
.c3q-adjustment-impact dt { color: var(--muted, #756e65); }
.c3q-adjustment-impact dd { margin: 0; font-variant-numeric: tabular-nums; }
.c3q-adjustment-review summary { cursor: pointer; font-size: 13px; }
.c3q-adjustment-review details p, .c3q-adjustment-review li { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.c3q-adjustment-total { margin-top: 16px; }
@media (max-width: 600px) { .c3q-adjustment-impact { grid-template-columns: 1fr; gap: 4px; } .c3q-adjustment-impact dd { margin-bottom: 8px; } }
.c3q-source-tags .c3q-srctag { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Price choices remain available in the expanded native editor. */
.c3q-grid .c3q-component-detail-row .c3q-price-candidate-select {
  display: block !important;
  max-width: 100%;
  width: 100%;
}
.c3q-pick-file {display:block;font-size:11px;font-weight:400;opacity:.7;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}


/* ── Card 3 · QTO takeoff ─────────────────────────────────────────── */
#takeoff-card .tko-card { margin-bottom: 24px; }
#takeoff-card .tko-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
#takeoff-card .tko-asks { margin: 4px 0 0; color: var(--ink-3, #6f6a62); font-size: 13px; max-width: 70ch; }
#takeoff-card .tko-pill { flex: none; padding: 4px 10px; border-radius: 999px; font: 600 11px/1.4 "JetBrains Mono", monospace; }
#takeoff-card .tko-pill.warn { background: rgba(184,134,47,.12); color: var(--amber-ink, #8f5f18); }
#takeoff-card .tko-pill.ok { background: rgba(46,108,92,.12); color: #2e6c5c; }
#takeoff-card .tko-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
#takeoff-card .tko-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--line, #e6e1d8); border-radius: 8px; }
#takeoff-card .tko-stat span { color: var(--ink-3, #6f6a62); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
#takeoff-card .tko-stat b { font: 600 18px/1.2 "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
#takeoff-card .tko-table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid var(--line, #e6e1d8); border-radius: 8px; }
#takeoff-card .tko-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#takeoff-card .tko-table th { position: sticky; top: 0; background: var(--card, #faf8f4); text-align: left; font-weight: 600; color: var(--ink-3, #6f6a62); padding: 6px 10px; border-bottom: 1px solid var(--line, #e6e1d8); }
#takeoff-card .tko-table td { padding: 5px 10px; border-bottom: 1px solid var(--line-soft, #f0ece5); }
#takeoff-card .tko-table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: "JetBrains Mono", monospace; }
#takeoff-card .tko-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
#takeoff-card .tko-btn { padding: 7px 14px; border-radius: 6px; border: 1px solid var(--ink, #1d1b18); background: var(--ink, #1d1b18); color: #fff; font-weight: 600; cursor: pointer; }
#takeoff-card .tko-btn.ghost { background: transparent; color: var(--ink, #1d1b18); }
#takeoff-card .tko-done { color: #2e6c5c; font-weight: 600; }
#takeoff-card .tko-muted { color: var(--ink-3, #6f6a62); font-size: 12px; }

/* ── Card 6 · VE & alternates ────────────────────────────────────── */
#alternates-card .alt-card { margin-bottom: 24px; }
#alternates-card .alt-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
#alternates-card .alt-asks { margin: 4px 0 0; color: var(--ink-3, #6f6a62); font-size: 13px; max-width: 72ch; }
#alternates-card .alt-pill { flex: none; padding: 4px 10px; border-radius: 999px; font: 600 11px/1.4 "JetBrains Mono", monospace; background: var(--bg, #faf7f1); border: 1px solid var(--border, #e6e1d8); color: var(--ink-3, #6b6762); }
#alternates-card .alt-table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--border, #e6e1d8); border-radius: 8px; }
#alternates-card .alt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#alternates-card .alt-table th { text-align: left; font: 600 11px "JetBrains Mono", monospace; color: var(--ink-3, #6b6762); text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--border, #e6e1d8); background: var(--bg, #faf7f1); }
#alternates-card .alt-table td { padding: 0 6px; border-bottom: 1px solid var(--border, #e6e1d8); }
#alternates-card .alt-table .num { text-align: right; }
#alternates-card .alt-cell { width: 100%; box-sizing: border-box; padding: 7px 6px; border: 1px solid transparent; background: transparent; color: var(--ink, #1f1e1d); font: inherit; }
#alternates-card .alt-num { min-width: 84px; text-align: right; font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
#alternates-card .alt-markup { min-width: 56px; }
#alternates-card .alt-cell:hover { background: rgba(184,134,47,.06); }
#alternates-card .alt-cell:focus { outline: none; border-color: var(--clay, #b85c3e); background: var(--bg-card, #fff); }
#alternates-card .alt-price { font: 600 13px "JetBrains Mono", monospace; white-space: nowrap; padding-right: 10px; }
#alternates-card .alt-price.deduct { color: var(--sage-ink, #3f5a32); }
#alternates-card .alt-price.missing { color: var(--amber-ink, #8f5f18); font-weight: 500; }
#alternates-card .alt-remove { border: 0; background: transparent; color: var(--ink-4, #a4a09a); font-size: 16px; cursor: pointer; }
#alternates-card .alt-remove:hover { color: var(--clay, #b85c3e); }
#alternates-card .alt-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 10px; }
#alternates-card .alt-btn { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--ink, #1f1e1d); background: var(--ink, #1f1e1d); color: var(--bg-card, #fff); font-weight: 600; cursor: pointer; }
#alternates-card .alt-btn.ghost { background: transparent; color: var(--ink, #1f1e1d); }
#alternates-card .alt-btn:disabled { opacity: .45; cursor: not-allowed; }
#alternates-card .alt-status { color: var(--ink-3, #6b6762); font-size: 12.5px; }
#alternates-card .alt-sum { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--ink-3, #6b6762); }
#alternates-card .alt-sum b { color: var(--ink, #1f1e1d); font-family: "JetBrains Mono", monospace; }

/* Card 3 · spreadsheet-style quantity cells */
#takeoff-card .tko-keys { margin: 0 0 8px; color: var(--ink-3, #6f6a62); font: 500 11px/1.6 "JetBrains Mono", monospace; }
#takeoff-card .tko-keys kbd { font: inherit; padding: 0 5px; border: 1px solid var(--border-2, #d2ccc0); border-bottom-width: 2px; border-radius: 4px; background: var(--bg-card, #fff); }
/* Card 3 quantity boxes match Card 4's (rounded, tinted). Green = equals the
   takeoff source; amber = check (no source to match, or edited). */
#takeoff-card td.num:has(> input.tko-qty) { padding: 3px 8px; }
#takeoff-card input.tko-qty, #takeoff-card .tko-qty-box {
  display: inline-block; width: 88px; box-sizing: border-box; padding: 3px 8px; border-radius: 6px;
  border: 1px solid rgba(214,178,90,.55); background: rgba(214,178,90,.12); color: var(--ink, #1f1e1d);
  font: 500 12px "JetBrains Mono", monospace; text-align: right; font-variant-numeric: tabular-nums;
}
#takeoff-card input.tko-qty.match, #takeoff-card .tko-qty-box.match {
  border-color: rgba(86,140,96,.55); background: rgba(120,170,120,.16); color: var(--sage-ink, #3f5f44);
}
#takeoff-card .tko-qty-box.missing { border-style: dashed; background: transparent; color: var(--ink-3, #6f6a62); }
#takeoff-card .tko-keys .tko-qty-box { width: auto; padding: 0 6px; font-size: 10.5px; }
#takeoff-card input.tko-qty:hover { filter: brightness(.98); }
#takeoff-card input.tko-qty:focus { outline: none; border-color: var(--clay, #b8562f); background: var(--bg-card, #fff); box-shadow: inset 0 0 0 1px var(--clay, #b8562f); color: var(--ink, #1f1e1d); }
#takeoff-card input.tko-qty.edited { border-color: rgba(184,134,47,.8); background: rgba(214,178,90,.22); font-weight: 700; color: var(--ink, #1f1e1d); }
#takeoff-card .tko-flag { display: block; margin-top: 2px; font-size: 10px; color: var(--clay, #b8562f); }
#takeoff-card .tko-src-qty { color: var(--ink-4, #a4a09a); text-decoration: line-through; }
#takeoff-card .tko-qty-ro { color: var(--ink-3, #6f6a62); }
#takeoff-card .tko-edited-note { color: var(--amber-ink, #8f5f18); font-weight: 600; font-size: 12.5px; }

/* ── Card 3 table = Card 4 grid format (SY 2026-10-05: "make exact same
   format"). Metrics copied from #c3q-card table.c3q-grid. ─────────────── */
#takeoff-card .tko-table { width: 100%; border-collapse: collapse; font: 400 11.5px/17.825px Inter, system-ui, -apple-system, sans-serif; color: var(--ink, #1f1e1d); }
#takeoff-card .tko-table th { padding: 3px 6px; height: 34px; border-bottom: 1px solid var(--border-2, #d2ccc0); background: var(--bg-card, #fff);
  font: 600 9px/13.95px "JetBrains Mono", monospace; letter-spacing: .72px; text-transform: uppercase; color: var(--ink-4, #a4a09a); text-align: left; vertical-align: middle; white-space: nowrap; }
#takeoff-card .tko-table th.num { text-align: right; }
#takeoff-card .tko-table td { padding: 3px 6px; height: 31px; border-bottom: 1px solid var(--border-2, #d2ccc0); color: var(--ink-2, #2e2c2a); vertical-align: middle; white-space: nowrap; }
#takeoff-card .tko-table td.num { text-align: right; font-family: inherit; }
#takeoff-card .tko-table-wrap { border-radius: 10px; border-color: var(--border-2, #d2ccc0); background: var(--bg-card, #fff); }
#takeoff-card .tko-code { display: inline-block; padding: 1px 5px; border: 1px solid var(--border-2, #d2ccc0); border-radius: 4px; background: rgba(0,0,0,.02);
  color: var(--ink-3, #6b6762); font: 700 9px/13.95px "JetBrains Mono", monospace; letter-spacing: .36px; white-space: nowrap; }
#takeoff-card .tko-fx-lbl { display: inline-flex; align-items: center; gap: 6px; color: var(--ink, #1f1e1d); font-weight: 500; }
#takeoff-card .tko-fx-lbl i, #takeoff-card .tko-fx-lbl svg { color: var(--clay, #b85c3e); font-size: 14px; width: 14px; height: 14px; flex: none; }
#takeoff-card td.num:has(> input.tko-qty) { padding: 3px 6px; }
#takeoff-card input.tko-qty, #takeoff-card .tko-qty-box { width: 46px; min-width: 46px; height: 22px; padding: 3px 6px; border-radius: 5px;
  font: 400 11.5px Inter, system-ui, -apple-system, sans-serif; text-align: right; font-variant-numeric: tabular-nums; }
#takeoff-card input.tko-qty.edited { font-weight: 700; }
#takeoff-card .tko-srctag { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
  padding: 1px 7px; border: 1px solid var(--border-2, #d2ccc0); border-radius: 10px; background: rgba(0,0,0,.035); color: var(--ink-3, #6b6762);
  font-size: 9px; line-height: 13.95px; text-decoration: none; }
#takeoff-card .tko-srctag.none { border-style: dashed; background: transparent; }

/* ── Card 3 · tracked changes (SY 2026-10-05: "track changes, and undo
   changes · highlight rows that user has changed"). ─────────────────── */
/* Changed rows are light purple in Cards 3 and 4 (the edited-cell color), with
   an × at the far right that undoes that row (SY 2026-10-08). */
#takeoff-card .tko-table tr.tko-changed > td { background: rgba(139, 108, 201, 0.09); }
#takeoff-card .tko-table tr.tko-changed > td:first-child { box-shadow: inset 3px 0 0 #8b6cc9; }
#takeoff-card .tko-src-qty { text-decoration: none; white-space: nowrap; }
#takeoff-card .tko-src-qty s { color: var(--ink-4, #a4a09a); }
#takeoff-card .tko-undo-row { margin-left: 4px; padding: 0 6px; border: 1px solid var(--border-2, #d2ccc0); border-radius: 5px;
  background: var(--bg-card, #fff); color: var(--ink-2, #2e2c2a); font: 600 12px/18px Inter, system-ui, sans-serif; cursor: pointer; }
#takeoff-card .tko-undo-row:hover { border-color: var(--clay, #b85c3e); color: var(--clay, #b85c3e); }
#takeoff-card .tko-btn { padding: 5px 12px; font-size: 12px; background: transparent; color: var(--ink, #1d1b18); border-color: var(--border-2, #d2ccc0); }
#takeoff-card .tko-btn:hover { border-color: var(--ink, #1d1b18); }
#takeoff-card .tko-changes { margin-top: 10px; font-size: 12px; color: var(--ink-2, #2e2c2a); }
#takeoff-card .tko-changes summary { cursor: pointer; font-weight: 600; color: var(--amber-ink, #8f5f18); }
#takeoff-card .tko-changes ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
#takeoff-card .tko-changes s { color: var(--ink-4, #a4a09a); }
#takeoff-card .tko-up { color: var(--clay, #b85c3e); }
#takeoff-card .tko-down { color: var(--sage-ink, #3f5f44); }
#takeoff-card input.tko-qty.missing { border-style: dashed; background: transparent; }
#takeoff-card .tko-flag-add { color: var(--ink-3, #6f6a62); }
#takeoff-card .tko-flag-manual { color: var(--clay, #b85c3e); }
#takeoff-card td.num:has(.tko-flag) { white-space: nowrap; }
#takeoff-card td.num:has(.tko-flag) .tko-flag { display: inline-block; margin: 0 0 0 6px; }
/* ── Card 4 price cells colored by source (SY 2026-10-05: "green if we have
   pricing that matches a vendor quote, yellow if from atlas/bid sheet, red if
   missing price/online price"). Supersedes the older green=vendor+workbook
   rule above. The row's own source chip (last cell) decides the color; a
   quote-request mapping (src-map) counts as vendor when it cites a quote
   file (card4-editor adds src-quote). */
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr:has(> td:last-child .c3q-srctag:is(.src-atlas, .src-workbook, .src-gc, .src-map, .src-est, .src-local)) .c3q-finmat-in:not(.c3q-needs-price-in) {
  color: #8f5f18 !important;
  background: rgba(214, 178, 90, 0.16) !important;
  border-color: rgba(184, 134, 47, 0.55) !important;
}
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr:has(> td:last-child .c3q-srctag.src-vendor) .c3q-finmat-in:not(.c3q-needs-price-in),
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr:has(> td:last-child .c3q-srctag.src-quote) .c3q-finmat-in:not(.c3q-needs-price-in) {
  color: #2f7d4f !important;
  background: rgba(74, 124, 89, 0.13) !important;
  border-color: rgba(74, 124, 89, 0.55) !important;
}
#c3q-card table.c3q-tbl.c3q-grid .c3q-finmat-in.c3q-needs-price-in,
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr:has(> td:last-child .c3q-srctag.src-web) .c3q-finmat-in {
  color: #a8432a !important;
  background: rgba(184, 92, 62, 0.12) !important;
  border-color: rgba(184, 92, 62, 0.6) !important;
}
#c3q-card table.c3q-tbl.c3q-grid .c3q-finmat-in.c3q-needs-price-in::placeholder { color: #a8432a; }
/* ── 07 · Comps · Cortex auto picks (no comps chosen yet) ──────────── */
.comps-auto-note { margin: 0 0 8px; color: var(--ink-3, #6b6762); font-size: 12.5px; max-width: 75ch; }
.comps-auto-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 4px 0 10px; }
.comps-auto-table th { text-align: left; font: 600 9px "JetBrains Mono", monospace; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-4, #a4a09a); padding: 4px 6px; border-bottom: 1px solid var(--border-2, #d2ccc0); }
.comps-auto-table td { padding: 5px 6px; border-bottom: 1px solid var(--border, #e6e1d8); vertical-align: top; }
.comps-auto-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.comps-auto-table tfoot td { border-bottom: 0; font-weight: 600; }
.comps-auto-why { color: var(--ink-4, #a4a09a); font-size: 11px; }
.comps-auto-use { padding: 6px 14px; border-radius: 6px; border: 1px solid var(--ink, #1f1e1d); background: var(--ink, #1f1e1d);
  color: var(--bg-card, #fff); font-weight: 600; cursor: pointer; margin-bottom: 10px; }

/* Card 3 · assumed quantities (no count in the cited source) */
#takeoff-card .tko-assumed { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 10px; vertical-align: middle;
  border: 1px solid rgba(184,134,47,.6); background: rgba(214,178,90,.16); color: var(--amber-ink, #8f5f18);
  font: 600 9px/13.95px "JetBrains Mono", monospace; letter-spacing: .3px; text-transform: uppercase; white-space: nowrap; }
#takeoff-card .tko-flag-note { color: var(--ink-3, #6f6a62); }
/* ── Card 4 price source from the canonical pricing graph (SY 2026-10-07:
   "green if we have vendor quotes/bid sheet, yellow if atlas"). card4-editor
   tags each row data-price-source="project" when its selected price cites
   only this bid's own documents (vendor quote / bid sheet), "atlas" when it
   cites any Atlas record (other jobs' bid sheets, invoices, payroll). This
   supersedes the chip-based rule above; the repeated attribute selectors
   give it the specificity to win over the :has() chip rules. */
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr[data-price-source="project"][data-price-source="project"][data-calculation-target-id][data-calculation-component-owner] .c3q-finmat-in:not(.c3q-needs-price-in) {
  color: #2f7d4f !important;
  background: rgba(61, 122, 61, 0.16) !important;
  border-color: rgba(61, 122, 61, 0.55) !important;
}
#c3q-card table.c3q-tbl.c3q-grid > tbody > tr[data-price-source="atlas"][data-price-source="atlas"][data-calculation-target-id][data-calculation-component-owner] .c3q-finmat-in:not(.c3q-needs-price-in) {
  color: #8f5f18 !important;
  background: rgba(214, 178, 90, 0.18) !important;
  border-color: rgba(184, 134, 47, 0.55) !important;
}
/* ── Card 3 mirrors Card 4 (SY 2026-10-08): takeoff lines that Card 4 prices as
   one row are grouped under a header naming that Card 4 line. */
#takeoff-card tr.tko-group > td { background: var(--paper-2, rgba(0, 0, 0, 0.025)); font-size: 12px; padding-top: 7px; padding-bottom: 7px; }
#takeoff-card tr.tko-group .tko-group-note { color: var(--ink-4, #8a857d); font-size: 11px; font-weight: 400; }
#takeoff-card tr.tko-in-group > td:nth-child(2) { padding-left: 22px; }
/* ── 06 · VE & alternates: compact Card 4-style grid (SY 2026-10-08: "make it row
   height like card 4, brevity is king"). One line per alternate; the source note
   is a chip with the full text on hover. ───────────────────────────────────── */
#alternates-card .alt-table { table-layout: fixed; font-size: 11.5px; min-width: 900px; }
#alternates-card .alt-table th { font: 600 9.5px "JetBrains Mono", monospace; padding: 6px 6px; white-space: nowrap; }
#alternates-card .alt-table td { height: 32px; padding: 2px 6px; vertical-align: middle; }
#alternates-card .alt-table tbody tr:hover > td { background: rgba(0, 0, 0, 0.018); }
#alternates-card .alt-ln { text-align: right; font: 600 9px "JetBrains Mono", monospace; color: var(--ink-4, #a4a09a); }
#alternates-card .alt-cell { height: 24px; padding: 2px 6px; font-size: 11.5px; border-radius: 5px; }
#alternates-card .alt-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#alternates-card .alt-num { min-width: 0; background: rgba(214, 178, 90, 0.12); border-color: rgba(214, 178, 90, 0.55); }
#alternates-card .alt-num:hover { background: rgba(214, 178, 90, 0.2); }
#alternates-card .alt-price { font-size: 11.5px; padding-right: 6px; }
#alternates-card .alt-src { white-space: nowrap; overflow: hidden; }
#alternates-card .alt-chip { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
  padding: 1px 7px; border: 1px solid var(--border-2, #d2ccc0); border-radius: 10px; background: rgba(0, 0, 0, .035);
  font-size: 9px; line-height: 13.95px; color: var(--ink-3, #6b6762); cursor: help; }
#alternates-card .alt-chip-review { margin-left: 4px; border-color: rgba(184, 134, 47, 0.55); background: rgba(214, 178, 90, 0.16); color: #8f5f18; }
#alternates-card .alt-check, #alternates-card .alt-x { text-align: center; }
#alternates-card .alt-asks { font-size: 12.5px; }

/* Quote desk follows editor quantity edits (SY 2026-10-08); the edited count
   uses the editor's purple, with the takeoff count it replaced. */
.rfq-tracker-panel td.rfq-edited { color: #4a3673; background: rgba(139, 108, 201, 0.09); }
.rfq-tracker-panel .rfq-was { display: block; font-size: 9.5px; color: var(--ink-4, #a4a09a); }
#takeoff-card .tko-table tr.tko-excluded > td { opacity: .55; }
#takeoff-card .tko-flag-excluded { color: var(--clay, #b85c3e); }
/* ── Changed rows: light purple + far-right × undo (SY 2026-10-08) ───────── */
#takeoff-card .tko-src-cell { white-space: nowrap; }
#takeoff-card .tko-row-x,
#c3q-card .c3q-row-x {
  float: right; width: 20px; height: 20px; margin-left: 6px; padding: 0; line-height: 18px; text-align: center;
  font-size: 14px; color: #6a4fa3; background: transparent; border: 1px solid rgba(139, 108, 201, 0.55); border-radius: 50%; cursor: pointer;
}
#takeoff-card .tko-row-x:hover, #c3q-card .c3q-row-x:hover { background: rgba(139, 108, 201, 0.16); color: #4a3673; }
#c3q-card .c3q-row-x { display: none; }
#c3q-card table.c3q-tbl > tbody > tr[data-calculation-target-id]:has(input.c3q-edited) .c3q-row-x { display: inline-block; }
#c3q-card table.c3q-tbl > tbody > tr[data-calculation-target-id]:has(input.c3q-edited) > td { background: rgba(139, 108, 201, 0.09); }
#c3q-card table.c3q-tbl > tbody > tr[data-calculation-target-id]:has(input.c3q-edited) > td:first-child { box-shadow: inset 3px 0 0 #8b6cc9; }

/* Undo reads as a button, not a stray × (SY 2026-10-08: "i need a button that
   undos change to original"). */
#takeoff-card .tko-row-x,
#c3q-card .c3q-row-x,
#takeoff-card .tko-undo-change {
  width: auto; height: 22px; padding: 0 9px; border-radius: 11px; line-height: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  color: #4a3673; background: rgba(139, 108, 201, 0.12); border: 1px solid rgba(139, 108, 201, 0.6);
}
#takeoff-card .tko-undo-change { margin-left: 8px; float: none; cursor: pointer; }
#takeoff-card .tko-row-x { float: none; margin-left: 6px; vertical-align: middle; }
