/* ConFacts: the compare screens of the 2026-11 redesign (CompareFlow,
   CompareStep2-Bids, CompareStep3-Running, CompareReport). The page styles
   are the design's own, ported from its static pages and scoped under .cx so
   nothing leaks onto the rest of /app/; the shared system lives in cf.css.
   The design's #8A8795 text grey is var(--soft) here (DESIGN.md: it fails
   4.5:1 at these sizes). Rendered by compare.js. */

/* ═════════ The flow's own header (steps 1 to 3) ═════════ */
.cmp-flowbar { display: none; position: sticky; top: 0; z-index: 60; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
body[data-flow="compare"] .cmp-flowbar { display: block; }
body[data-flow="compare"] .topbar,
body[data-flow="compare"] .site-foot { display: none; }
/* Numbered by what is shown: the Bids step exists only in the design preview. */
.cmp-steps { counter-reset: cstep; }
.cmp-steps li .n::before { counter-increment: cstep; content: counter(cstep); }

/* ═════════ Shared pieces ═════════ */
.cx .tl { position: static; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.cx .tl.t0 { background: #1E3448; color: #FFFFFF; }
/* One ink tile for every contractor (DESIGN.md: initials are ink, never a
   finding's colour). By column they were green and amber, and the
   typeahead coloured by suggestion order, so a contractor changed colour
   between steps (UI audit 2026-11-23, batch 6b). */
.cx .tl.t1, .cx .tl.t2 { background: #1E3448; color: #FFFFFF; }
.cx .sample-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: 11.5px; font-weight: 600; }
.cx .error-line { margin-top: 14px; }
.cx .cmp-bill { margin: 20px 0 0; }
.cx .human-check { justify-content: flex-start; }

/* ═════════ Step 1: who's bidding ═════════ */
.cx-flow .hero-card { min-height: calc(100vh - 94px); }
.cx-flow .cx-wrap { position: relative; z-index: 1; padding-top: 72px; padding-bottom: 72px; }
.cx .cf-top { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 40px; }
.cx .cf-top.left { text-align: left; align-items: flex-start; margin-bottom: 32px; }
.cx .cf-top .chip { background: rgba(255, 255, 255, .7); }
.cx .slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cx .slot { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 18px; background: #FFFFFF; border: 1px solid var(--line2); box-shadow: 0 20px 44px -28px rgba(46, 26, 96, .4); text-align: left; font: inherit; color: var(--ink); min-height: 168px; transition: border-color .3s, box-shadow .3s; }
.cx .slot:focus-within { border-color: #BDB5D9; box-shadow: 0 0 0 4px rgba(142, 123, 224, .12), 0 20px 44px -28px rgba(46, 26, 96, .4); }
.cx .slot.empty { border-style: dashed; background: rgba(255, 255, 255, .55); box-shadow: none; align-items: center; justify-content: center; cursor: pointer; gap: 6px; transition: background .3s, border-color .3s; }
.cx .slot.empty:hover { background: #FFFFFF; border-color: #8E7BE0; }
/* Keyboard focus shows (UI audit 2026-11-23, batch 6): "box-shadow: none"
   above had removed the site's focus ring from this button. */
.cx .slot.empty:focus-visible { outline: none; background: #FFFFFF; border: 2px solid var(--ink); box-shadow: 0 0 0 4px rgba(150, 128, 220, .45); }
.cx .slot[hidden] { display: none; }
.cx .sl-plus { width: 40px; height: 40px; border-radius: 999px; background: var(--ink); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 4px; }
.cx .sl-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cx .sl-l { font-size: 12.5px; font-weight: 600; color: var(--soft); }
.cx .sl-in { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border: 1.5px solid var(--line2); border-radius: 12px; font-size: 15px; font-weight: 500; background: #FFFFFF; transition: border-color .25s; }
.cx .sl-in:focus-within { border-color: var(--ink); }
.cx .sl-in svg { flex-shrink: 0; color: var(--muted); }
.cx .sl-in input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 500 15px var(--f); color: var(--ink); padding: 0; }
.cx .sl-in input::placeholder { color: var(--soft); font-weight: 400; }
.cx .sl-f { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--soft); border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.cx .cf-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.cx .cf-price { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.cx .cf-price b { font-size: 16px; }
.cx .cf-price span { font-size: 13px; color: var(--muted); }
.cx .btn:disabled, .cx .btn.dis { opacity: .35; cursor: default; }
.cx .cf-tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 44px; padding-top: 28px; border-top: 1px solid rgba(23, 22, 28, .08); text-align: left; }
.cx .cf-tips > div { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted); }
.cx .cf-tips b { color: var(--ink); font-size: 14.5px; }
.cx .cf-ti { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .8); display: flex; align-items: center; justify-content: center; color: var(--ink); margin-bottom: 6px; }

/* Step 2 shares step 1's form: the hero steps aside for the plain section. */
.cx-flow[data-step="2"] .hero-card { background: none; min-height: 0; margin: 0; border-radius: 0; box-shadow: none; }
.cx-flow[data-step="2"] .hero-card::before,
.cx-flow[data-step="2"] .hero-card::after { display: none; }
.cx-flow[data-step="2"] .cx-wrap { padding-top: 64px; padding-bottom: 96px; }
.cx-flow[data-step="2"] .cx-s1,
.cx-flow[data-step="1"] .cx-s2 { display: none; }

/* ═════════ Step 2: add their bids (design preview) ═════════ */
.cx .bids { display: grid; grid-template-columns: repeat(var(--bn, 3), minmax(0, 1fr)); gap: 16px; align-items: start; }
.cx .bid { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--line2); border-radius: 18px; background: #FFFFFF; }
.cx .bid-h { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.cx .bid-file { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--wash); font-size: 12.5px; }
.cx .bid-file div { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cx .bid-file b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx .bid-file span { color: var(--muted); }
.cx .bid-file.up { background: #F8F5FE; }
.cx .sl-ok { width: 24px; height: 24px; border-radius: 999px; background: var(--ok-dot); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.cx .up-t { display: inline-flex; align-items: center; gap: 6px; color: var(--warn) !important; }
.cx .up-bar { height: 4px; border-radius: 4px; background: var(--lav2); overflow: hidden; margin-top: -4px; }
.cx .up-bar i { display: block; height: 100%; width: 100%; background: var(--ink); border-radius: 4px; transform-origin: left; animation: cf-loop 3.2s var(--ease) infinite; }
.cx .run-lbl { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--soft); }
.cx .bfs { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cx .bf { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.cx .bf span { color: var(--muted); }
.cx .bf.skl span, .cx .bf.skl b { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, #F3F1F8, #E9E5F3, #F3F1F8); background-size: 200% 100%; animation: cx-shim 1.4s linear infinite; }
.cx .bf.skl span { width: 70px; } .cx .bf.skl b { width: 90px; }
@keyframes cx-shim { to { background-position: -200% 0; } }
.cx .drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 230px; border: 1.5px dashed #BDB5D9; border-radius: 14px; background: #FBFAFE; font: inherit; color: var(--ink); }
.cx .drop-ic { width: 52px; height: 52px; border-radius: 14px; background: #FFFFFF; border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.cx .reads { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 24px; }
.cx .reads .chip { height: 28px; font-size: 12.5px; }
.cx .reads .chip.sc-chip { background: var(--lav2); color: #5B45C9; border-color: #E1DAF7; font-weight: 600; }
.cx .cx-back { background: none; border: 0; cursor: pointer; font: inherit; }
.cx .cx-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.cx .cx-private { display: flex; gap: 8px; align-items: center; margin-top: 18px; }

/* ═════════ Step 3: comparing ═════════ */
.cx-run { padding: 64px 0 96px; min-height: 820px; }
.cx .run-top { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; align-items: end; margin-bottom: 28px; }
.cx .run-top .h1 { margin-top: 8px; }
.cx .cx-lead { margin: 12px 0 0; font-size: 16px; line-height: 1.5; color: var(--ink2); }
.cx .cx-lead .out { color: var(--bad); font-weight: 600; }
.cx .ov { display: flex; flex-direction: column; gap: 8px; }
.cx .ov-t { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); }
.cx .ov-t > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.cx .ov-bar { height: 8px; border-radius: 8px; background: var(--wash2); overflow: hidden; }
.cx .ov-bar i { display: block; height: 100%; width: 100%; border-radius: 8px; background: linear-gradient(90deg, #8E7BE0, var(--ink)); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .8s var(--ease); }
.cx .run-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 16px; align-items: start; }
.cx .run-col { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line2); border-radius: 18px; background: #FFFFFF; min-width: 0; }
.cx .run-h { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.cx .run-h > div:not(.run-ring) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cx .run-h b { font-size: 14.5px; overflow-wrap: anywhere; }
.cx .run-ring { margin-left: auto; flex-shrink: 0; }
.cx .run-ring .ring { width: 54px; height: 54px; }
.cx .run-ring .ring-n { font-size: 17px; }
.cx .run-word { margin-left: auto; flex-shrink: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: right; }
.cx .run-word.bad { color: var(--bad); }
.cx .run-list { border: 1px solid var(--line); border-radius: 12px; }
.cx .run-list .chk { padding: 8px 12px; font-size: 12.5px; }
.cx .run-list .chk-n small { font-size: 11px; }
/* A live row shows one state at a time, with its word: never colour alone. */
.cx .chk-st .s0, .cx .chk-st .s1 { opacity: 1; }
.cx .chk-st > span { animation: none !important; }
.cx .chk .sq { animation: none !important; }
.cx .run-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; }
.cx .run-foot .cmp-prov { flex: 1 1 140px; }
.cx .run-col .cmp-still { padding: 4px 2px; }
.cx .run-col .cmp-limited, .cx .run-col .cmp-failed, .cx .run-col .cmp-pick { margin: 0; }
.cx .run-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; margin-top: 16px; align-items: stretch; }
.cx .cx-feed { padding: 18px; border: 1px solid var(--line2); border-radius: 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cx .fd { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.cx .fd .sq { margin-top: 4px; }
.cx .run-lbl + .fd { border-top: 0; }
.cx .fd-none { color: var(--muted); }
.cx .ready { display: flex; flex-direction: column; gap: 8px; justify-content: center; align-items: flex-start; padding: 24px; border-radius: 18px; background: radial-gradient(70% 90% at 100% 110%, rgba(255, 168, 120, .25), rgba(255, 168, 120, 0)), var(--night); color: #FFFFFF; }
.cx .ready b { font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.cx .ready > span:not(.kicker) { font-size: 14px; color: var(--night-muted); margin-bottom: 6px; }
.cx .ready .kicker { color: var(--night-muted); }

/* ═════════ The comparison report ═════════ */
.cx-rep .hero-card { background: radial-gradient(50% 60% at 85% 10%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0)), linear-gradient(180deg, #F8F5FE 0%, #EFE9FC 60%, #F3E4E0 100%); }
.cx-rep .cx-wrap { position: relative; z-index: 1; padding-top: 48px; padding-bottom: 48px; }
.cx .crumb-a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #CFCCD8; }
.cx .cr-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.cx .cr-top > div:first-child { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cx .cr-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cx .cr-meta .chip { height: 24px; font-size: 12px; background: rgba(255, 255, 255, .7); }
.cx .cr-top .sub { max-width: 640px; }
.cx .cr-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.cx .cr-cards { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
.cx .cr-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; background: rgba(255, 255, 255, .92); min-width: 0; }
.cx .cr-ch { display: flex; align-items: center; gap: 12px; }
.cx .cr-ch > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cx .cr-ch b { font-size: 16px; overflow-wrap: anywhere; }
.cx .cr-cs { display: flex; align-items: center; gap: 16px; }
.cx .cr-cs .ring { width: 92px; height: 92px; }
.cx .cr-cs .ring-n { font-size: 28px; }
.cx .cr-cs > div:last-child { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.cx .ring.nil .arc { stroke: var(--idle); }
.cx .cr-k { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.cx .cr-k div { display: flex; flex-direction: column; gap: 2px; }
.cx .cr-k b { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cx .cr-k b.bad { color: var(--bad); } .cx .cr-k b.warn { color: var(--warn); } .cx .cr-k b.ok { color: var(--ok); }
.cx .cr-k span { font-size: 11.5px; color: var(--soft); }
.cx .cr-prov { margin: 0; font-size: 12.5px; color: var(--warn); }
.cx .cr-open { font-size: 14px; }
.cx .cx-lead.cr-lead { margin: 0; font-size: 15px; }

.cx .r1-page { background: #FFFFFF; padding: 40px 24px 96px; }
.cx .r1-layout { display: grid; grid-template-columns: 210px minmax(0, 980px); gap: 36px; justify-content: center; align-items: start; }
.cx .r1-side { align-self: stretch; }
.cx [data-sec] { scroll-margin-top: 96px; }
.cx .r1-h { margin: 0 0 16px; font-size: 26px; font-weight: 500; letter-spacing: -.025em; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cx .r1-count { font-size: 13px; font-weight: 500; color: var(--soft); letter-spacing: 0; }
.cx .r1-disc { margin: 30px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.55; color: var(--soft); }
.cx .cr-doc { min-width: 0; }
.cx .cr-sec { padding: 8px 0 40px; }
.cx .cr-looks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cx .cr-look { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--line2); border-left: 4px solid var(--idle); border-radius: 14px; background: #FFFFFF; min-width: 0; }
.cx .cr-look.bad { border-left-color: var(--bad-dot); } .cx .cr-look.warn { border-left-color: var(--warn-dot); }
.cx .cr-look > div { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cx .cr-look b { font-size: 16px; overflow-wrap: anywhere; }
.cx .cr-look p { margin: 2px 0 6px; font-size: 14px; color: var(--ink2); line-height: 1.5; overflow-wrap: anywhere; }
.cx .cr-w { font-size: 12px; font-weight: 600; color: var(--muted); }
.cx .cr-w.bad { color: var(--bad); } .cx .cr-w.warn { color: var(--warn); }
.cx .cr-ln { width: 26px; height: 26px; border-radius: 999px; background: var(--ink); color: #FFFFFF; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cx .srcchip { white-space: normal; }
.cx .cr-none { margin: 0; padding: 18px; border: 1px solid var(--line2); border-radius: 14px; font-size: 14.5px; color: var(--ink2); }
.cx .cr-hrow { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.cx .cr-hrow .r1-h { margin: 0; }
.cx .cr-tg { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; font: 500 14px var(--f); color: var(--ink2); padding: 0; }
.cx .cr-sw { width: 38px; height: 22px; border-radius: 999px; background: var(--line2); position: relative; transition: background .3s; }
.cx .cr-sw i { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 999px; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .35s var(--ease); }
.cx .cr-tg[aria-pressed="true"] .cr-sw { background: var(--ink); }
.cx .cr-tg[aria-pressed="true"] .cr-sw i { transform: translateX(16px); }
.cx .cr-scroll { border: 1px solid var(--line2); border-radius: 16px; overflow: clip; background: #FFFFFF; }
.cx .cr-t { min-width: 0; }
.cx .cr-r { display: grid; grid-template-columns: 200px repeat(var(--cols, 3), minmax(0, 1fr)); border-top: 1px solid var(--line); transition: background .3s; }
.cx .cr-r:first-child { border-top: 0; }
.cx .cr-r.diff { background: #FFFCF5; }
.cx .cr-r.same.gone { display: none; }
.cx .cr-hd { background: var(--wash) !important; position: sticky; top: 66px; z-index: 2; }
.cx .cr-l { padding: 12px 16px; font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cx .cr-l .diff { font-size: 10.5px; font-family: var(--m); color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 1px 6px; }
.cx .cr-note { font-size: 11.5px; color: var(--soft); line-height: 1.35; }
.cx .cr-hc { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 14px; min-width: 0; }
.cx .cr-hc > div { min-width: 0; }
.cx .cr-hc .n { font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; }
.cx .cr-hc .s { font-size: 12px; color: var(--muted); font-weight: 500; }
.cx .cr-hc .s small { font-size: 11px; color: var(--soft); }
.cx .cr-hc .s.dq { color: var(--bad); font-weight: 600; }
.cx .cr-hc .p { display: none; }
.cx .cr-c { display: flex; align-items: flex-start; gap: 8px; padding: 12px 16px; font-size: 14px; font-weight: 500; border-left: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.cx .cr-c .sq { margin-top: 4px; flex-shrink: 0; }
.cx .cr-c.bad { color: var(--bad); } .cx .cr-c.warn { color: var(--warn); } .cx .cr-c.nil { color: var(--muted); }
.cx .cr-c.pr { flex-direction: column; gap: 8px; align-items: stretch; }
.cx .cr-c.pr b { font-size: 20px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); }
.cx .cr-qs { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 12px; }
.cx .cr-q { padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-width: 0; }
.cx .cr-q ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.45; font-weight: 500; overflow-wrap: anywhere; }
.cx .cr-q .btn { margin-top: auto; }
.cx .cr-q .cr-ch b { font-size: 15px; }
.cx .cr-src { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.cx .cr-src span:last-child { color: var(--muted); }
.cx .r1-next { margin: 0 14px 14px; }
.cx .r1-next .cx-next-in { padding-top: 80px; padding-bottom: 80px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.cx .r1-next .cx-next-in > div:first-child { display: flex; flex-direction: column; gap: 12px; }
.cx .r1-next .h2 { color: #FFFFFF; }
.cx .cx-next-acts { display: flex; gap: 10px; flex-wrap: wrap; }

/* The design's sample sections (preview only): bids and scope of work. */
.cx .ai-tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--lav2); color: #5B45C9; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.cx .ai-dot { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, #8E7BE0, #5B45C9); color: #FFFFFF; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 6px 16px rgba(91, 69, 201, .28); }
.cx .ai-dot svg { width: 17px; height: 17px; }
.cx .sc-sum { border: 1px solid #E1DAF7; border-radius: 18px; padding: 20px 22px; background: linear-gradient(160deg, #F8F5FE 0%, #FFFFFF 70%); margin-bottom: 14px; position: relative; overflow: hidden; }
.cx .sc-sum::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(142, 123, 224, .18), rgba(142, 123, 224, 0) 70%); pointer-events: none; }
.cx .sc-sh { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cx .sc-sh > div { display: flex; flex-direction: column; gap: 2px; }
.cx .sc-sh b { font-size: 16px; }
.cx .sc-sum ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cx .sc-sum li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; color: #26242D; }
.cx .sc-sum li .sq { margin-top: 5px; }
.cx .sc-meters { border: 1px solid var(--line2); border-radius: 16px; background: #FFFFFF; padding: 16px 18px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.cx .sc-mh { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cx .sc-mh b { font-size: 14.5px; }
.cx .sc-leg { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.cx .sc-leg span { display: inline-flex; align-items: center; gap: 5px; }
.cx .sc-leg i, .cx .sc-fill i { display: block; border-radius: 3px; }
.cx .sc-leg i { width: 10px; height: 10px; }
.cx .sc-m { display: grid; grid-template-columns: 150px minmax(0, 1fr) 190px; gap: 14px; align-items: center; }
.cx .sc-mn { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cx .sc-bar { height: 12px; border-radius: 99px; background: #F3F2F7; overflow: hidden; }
.cx .sc-fill { display: flex; gap: 2px; height: 100%; transform-origin: left center; }
.cx .sc-fill i { height: 100%; flex: 0 0 calc(var(--w) - 2px); border-radius: 2px; }
.cx .sc-fill i.ok, .cx .sc-leg i.ok { background: #2FA877; } .cx .sc-fill i.bad, .cx .sc-leg i.bad { background: var(--bad-dot); } .cx .sc-fill i.warn, .cx .sc-leg i.warn { background: var(--warn-dot); } .cx .sc-fill i.miss, .cx .sc-leg i.miss { background: #CFCCD8; }
.cx .sc-ml { font-size: 13px; font-weight: 600; }
.cx .sc-ml.ok { color: var(--ok); } .cx .sc-ml.bad { color: var(--bad); } .cx .sc-ml.warn { color: var(--warn); }
.cx .cr-r.sc-g { grid-template-columns: 1fr; background: var(--wash); }
.cx .cr-r.sc-g .cr-l { font-family: var(--m); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--soft); padding: 8px 16px; }
.cx .sc-ddh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; flex-wrap: wrap; }
.cx .sc-ddh h3 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.cx .sc-dds { display: flex; flex-direction: column; gap: 10px; }
.cx .sc-dd { border: 1px solid var(--line2); border-radius: 16px; background: #FFFFFF; transition: border-color .3s, box-shadow .3s; }
.cx .sc-dd.open { border-color: #CFC4F2; box-shadow: 0 10px 30px rgba(91, 69, 201, .08); }
.cx .sc-dh { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.cx .sc-dt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cx .sc-dt b { font-size: 15.5px; }
.cx .sc-pill { white-space: nowrap; }
.cx .sc-chev { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .4s var(--ease), background .3s; }
.cx .sc-dd.open .sc-chev { transform: rotate(180deg); background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.cx .sc-bw { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.cx .sc-dd.open .sc-bw { grid-template-rows: 1fr; }
.cx .sc-bw > div { overflow: hidden; min-height: 0; }
.cx .sc-body { padding: 4px 18px 18px 64px; display: flex; flex-direction: column; gap: 16px; }
.cx .sc-by { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cx .sc-blk { display: flex; flex-direction: column; gap: 8px; }
.cx .sc-blk p { margin: 0; font-size: 14.5px; line-height: 1.55; color: #26242D; }
.cx .sc-lb { font-family: var(--m); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--soft); }
.cx .sc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cx .sc-ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.cx .sc-ul li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: #26242D; }
.cx .sc-ul li .sq { margin-top: 4px; }
.cx .sc-ul li > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.cx .sc-q { font-family: var(--m); font-size: 12px; background: #FFF6E4; color: #6B4A00; border-radius: 6px; padding: 2px 7px; align-self: flex-start; }
.cx .sc-ask { background: var(--wash); border-radius: 14px; padding: 14px 16px; align-items: flex-start; }
.cx .sc-ask ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; line-height: 1.45; }

@media (max-width: 1080px) {
  .cx .run-top, .cx .run-bottom { grid-template-columns: 1fr; }
  .cx .cr-looks, .cx .cr-qs { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .cx .slots, .cx .bids, .cx .run-grid, .cx .cf-tips { grid-template-columns: 1fr; }
  .cx-flow .cx-wrap, .cx-flow[data-step="2"] .cx-wrap { padding-top: 36px; padding-bottom: 48px; }
  .cx-flow .hero-card { min-height: 0; }
  .cx-run { padding: 36px 0 64px; min-height: 0; }
  .cx .cf-bar .btn-lg { width: 100%; justify-content: center; }
  .cx .cx-acts { width: 100%; margin-left: 0; }
  .cx .slot { min-height: 0; }
  .cx .slot.empty { min-height: 120px; }
  .cx .r1-page { padding: 10px 20px 48px; }   /* DESIGN.md's 20px phone gutter */
  .cx .r1-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cx .r1-side { position: sticky; top: 64px; z-index: 30; margin: 0 -20px 10px; padding: 8px 20px; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .cx .r1-side::-webkit-scrollbar { display: none; }
  .cx .r1-h { font-size: 22px; flex-wrap: nowrap; gap: 10px; }
  .cx .r1-count { white-space: nowrap; font-size: 12.5px; }
  .cx .cr-scroll { overflow-x: auto; }
  .cx .cr-t { min-width: 640px; }
  .cx .cr-r { grid-template-columns: 130px repeat(var(--cols, 3), minmax(150px, 1fr)); }
  .cx .cr-l { position: sticky; left: 0; z-index: 1; background: #FFFFFF; }
  .cx .cr-r.diff .cr-l { background: #FFFCF5; }
  .cx .cr-hd .cr-l { background: var(--wash); }
  .cx .cr-hd { position: static; }
  .cx .cr-cards { gap: 10px; margin-top: 20px; }
  .cx .cr-card { padding: 14px; gap: 10px; }
  .cx .cr-cs .ring { width: 64px; height: 64px; }
  .cx .cr-cs .ring-n { font-size: 20px; }
  .cx .cr-k b { font-size: 18px; }
  .cx .cr-acts { display: grid; grid-template-columns: auto auto auto; gap: 5px; }
  .cx .cr-acts .btn { height: 38px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
  .cx .cr-long { display: none; }
  .cx .r1-next .cx-next-in { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 40px; gap: 22px; }
  .cx .r1-next .h2 { font-size: 28px; }
  .cx .r1-next .btn { height: 40px; padding: 0 14px; font-size: 14px; }
  .cx .sc-tbl .cr-note { display: none; }
  .cx .sc-m { grid-template-columns: 1fr; gap: 6px; }
  .cx .sc-ml { font-size: 12.5px; }
  .cx .sc-cols { grid-template-columns: 1fr; }
  .cx .sc-body { padding: 4px 14px 16px; }
  .cx .sc-dh { flex-wrap: wrap; padding: 12px 14px; }
  .cx .sc-dt { flex: 1 1 calc(100% - 100px); }
  .cx .sc-pill { order: 3; margin-left: 48px; }
  .cx .sc-sum { padding: 16px; }
  .cx .sc-sum li { font-size: 14px; }
  .cx .cr-r.sc-g .cr-l { position: sticky; left: 0; background: var(--wash); width: max-content; }
  .cx .sc-ddh h3 { font-size: 17px; }
}
/* Phones (UI audit 2026-11-23, batch 4). The record table: one contractor at
   a time beside the checks, picked by .cr-pick, which sticks under the
   section bar. The bids and scope tables still scroll, and say so. */
.cx .cr-pick, .cx .cr-swipe { display: none; }
.cx .sl-dd { overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 860px) {
  .cx .cr-swipe { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--muted); }
}
@media (max-width: 640px) {
  .cx .cr-pick { display: flex; gap: 6px; position: sticky; top: 124px; z-index: 20; margin: 0 -2px 10px; padding: 6px 2px;
    background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .cx .cr-pk { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; border-radius: 12px;
    border: 1px solid var(--line2); background: #FFFFFF; color: var(--ink); font: 500 14px var(--f); cursor: pointer; }
  .cx .cr-pk span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cx .cr-pk[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); font-weight: 600; }
  .cx .cr-t[data-show] { min-width: 0; }
  .cx .cr-scroll:has(.cr-t[data-show]) { overflow-x: visible; }
  .cx .cr-t[data-show] .cr-r:not(.sc-g) { grid-template-columns: 116px minmax(0, 1fr); }
  .cx .cr-t[data-show="0"] [data-col]:not([data-col="0"]),
  .cx .cr-t[data-show="1"] [data-col]:not([data-col="1"]),
  .cx .cr-t[data-show="2"] [data-col]:not([data-col="2"]) { display: none; }
}
@media (max-width: 560px) {
  .cmp-flowbar .flowbar-in { gap: 10px; }
  /* Exit stays: the check flow shows it, and it was the only way out. */
  .cmp-flowbar .steps { gap: 4px; }
}
@media (max-width: 400px) {
  .cmp-flowbar .logo span { display: none; }   /* room for Exit and four steps */
}

/* Reduced motion: every state is drawn in its final form. */
@media (prefers-reduced-motion: reduce) {
  .cx .ov-bar i, .cx .cr-sw, .cx .cr-sw i, .cx .sc-bw, .cx .sc-chev { transition: none; }
  .cx .up-bar i, .cx .bf.skl span, .cx .bf.skl b { animation: none; }
}

@media print {
  .cmp-flowbar, .cx .r1-side, .cx .cr-acts, .cx .r1-next, .cx .cr-tg, .cx .cr-q .btn { display: none !important; }
  .cx-rep .hero-card { background: none; }
  .cx .r1-page { padding: 0; }
  .cx .r1-layout { display: block; }
  .cx .cr-hd { position: static; }
  .cx .cr-r.same.gone { display: grid; }
}

/* ═════════ Fit to the design (review pass) ═════════ */
.cx .cmp-form { max-width: none; }
/* The slot's frame shows the focus (ink border), so the input draws none. */
.cf .cx .sl-in input:focus, .cf .cx .sl-in input:focus-visible { outline: none; box-shadow: none; }
.cx .sl-in:focus-within { box-shadow: 0 0 0 3px rgba(142, 123, 224, .18); }
/* The step you are on is a pill, as in the design. */
.cmp-steps li.on { background: #FFFFFF; box-shadow: 0 0 0 1px var(--line2); height: 30px; padding: 0 12px 0 4px; border-radius: 999px; }
.cx .srcchip { height: auto; min-height: 24px; padding: 3px 9px; line-height: 1.4; }
@media (max-width: 860px) {
  .cmp-steps li + li::before { display: none; }
}

/* The slots' typeahead (A8, design CompareFlow step 1) */
.cx .slot { position: relative; }
.cx .slot.done { border-color: #BFE3CF; }
.cx .sl-dd { display: flex; flex-direction: column; border: 1px solid #E1DEE8; border-radius: 12px; overflow: hidden; margin-top: -4px; background: #FFFFFF; box-shadow: 0 18px 40px -24px rgba(46, 26, 96, .45); }
.cx .sl-dd[hidden] { display: none; }
.cx .sl-s { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-top: 1px solid #EDEBF2; background: #FFFFFF; cursor: pointer; text-align: left; font: inherit; color: var(--ink); transition: background .2s; }
.cx .sl-s:first-child { border-top: 0; }
.cx .sl-s:hover, .cx .sl-s[aria-selected="true"] { background: #F8F7FB; }
.cx .sl-st { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cx .sl-st b { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.cx .sl-st span { font-size: 12px; color: var(--muted); }
.cx .sl-tag { font-size: 11px; font-weight: 600; font-style: normal; white-space: nowrap; }
.cx .sl-tag.ok { color: #0C7650; } .cx .sl-tag.bad { color: var(--bad); } .cx .sl-tag.mine { color: var(--muted); }
.cx .sl-match:empty { display: none; }
.cx .sl-match { display: flex; flex-direction: column; gap: 8px; }
.cx .sl-m { display: flex; align-items: center; gap: 12px; }
.cx .sl-mt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.cx .sl-mt b { font-size: 14px; letter-spacing: .01em; overflow-wrap: anywhere; }
.cx .sl-mt span { font-size: 12.5px; color: var(--muted); }
.cx .sl-ok { width: 24px; height: 24px; border-radius: 999px; background: #13A36E; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.cx .sl-src { color: var(--soft); }
.cx .sl-warn { color: #8F5B00; }
.cx .sl-wait { color: var(--muted); }
.cx .sl-f[hidden] { display: none; }

/* Bids read for real (A1, A2) */
.cx .bid-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cx .bid-input:focus-visible + * , .cx .drop:focus-within { outline: 2px solid #8E7BE0; outline-offset: 2px; }
.cx .drop { cursor: pointer; }
.cx .drop.over { border-color: #8E7BE0; background: #F4F0FF; }
.cx .bid-flags { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cx .bid-flags li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--ink2); }
.cx .bid-flags .sq { margin-top: 4px; }
.cx .bid-forget { margin-top: 10px; align-self: flex-start; }
.cx .bf.bad b { color: var(--bad); }
.cx .bf.warn b { color: #8F5B00; }
.cx .run-bid { margin-top: 12px; }
.cx .cr-ns { color: var(--muted); font-weight: 400; }
.cx .cr-bid-note { color: var(--muted); margin: -6px 0 12px; }
.sq.miss { background: #FFFFFF; border-color: #C9C6D1; }
.cx .bid-forget { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cx .bid-forget:hover { color: var(--ink); }

/* Tap targets on the comparison, on a phone (UI audit 2026-11-23, batch 6). */
@media (max-width: 860px) {
  .cx .cr-tg { min-height: 44px; }
}

/* The three score cards stay side by side down to 900px, compact (UI audit
   2026-11-23, batch 6b: at 1024px they stacked into about 1,000px). */
@media (min-width: 901px) and (max-width: 1080px) {
  .cx .cr-card { padding: 14px; gap: 10px; }
  .cx .cr-cs .ring { width: 64px; height: 64px; }
  .cx .cr-cs .ring-n { font-size: 20px; }
  .cx .cr-k b { font-size: 18px; }
}
@media (max-width: 900px) { .cx .cr-cards { grid-template-columns: 1fr; } }

/* The comparison on a phone: the same single sticky bar as the report, and
   the contractor picker right under it. */
@media (max-width: 860px) {
  body[data-view="compare"] .cx .r1-side { top: 0; }
}
@media (max-width: 640px) {
  body[data-view="compare"] .cx .cr-pick { top: 60px; }
}

/* A bid on a phone (UI audit 2026-11-23, batch 6b): "Drop a PDF" is
   computer wording and each drop zone was 230px tall. Two buttons instead:
   the camera first, then a file. */
.cx .drop-m { display: none; }
@media (max-width: 860px) {
  .cx .drop { display: none; }
  .cx .drop-m { display: flex; gap: 8px; flex-wrap: wrap; }
  .cx .drop-m .btn { flex: 1 1 140px; }
}

/* A file that isn't a bid (UI: compare bid fixes, 2026-11-23). */
.cx .bid-notbid { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 14px; line-height: 1.45; }
.cx .bid-notbid .sq { margin-top: 3px; flex-shrink: 0; }
