:root {
  --nav: #1d2633; --nav-hi: #2b3747; --nav-txt: #c9d2de; --accent: #e8a317; --accent-d: #c98a0b;
  --bg: #f4f5f7; --panel: #fff; --line: #dde1e7; --line2: #eef0f3; --txt: #1f2733; --muted: #6b7686;
  --blue: #2563c9; --blue-l: #e8f0fd; --red: #c62f2f; --green: #1f8a4c; --sel: #fff4d6;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 13px/1.4 "Segoe UI", system-ui, sans-serif; color: var(--txt); background: var(--bg); }
#app { display: flex; height: 100vh; }
#nav { width: 176px; background: var(--nav); color: var(--nav-txt); display: flex; flex-direction: column; flex-shrink: 0; user-select: none; }
#nav .brand { padding: 14px 16px 12px; font-weight: 700; font-size: 16px; color: #fff; letter-spacing: .3px; border-bottom: 1px solid #2f3a49; }
#nav .brand b { color: var(--accent); }
#nav .sec { padding: 12px 16px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: #7f8b9b; }
#nav a { display: flex; align-items: center; gap: 8px; padding: 7px 16px; color: var(--nav-txt); text-decoration: none; cursor: pointer; border-left: 3px solid transparent; }
#nav a:hover { background: var(--nav-hi); }
#nav a.on { background: var(--nav-hi); color: #fff; border-left-color: var(--accent); }
#nav a.dis { opacity: .35; pointer-events: none; }
#nav .k { margin-left: auto; font-size: 10.5px; color: #7f8b9b; }
#nav .foot { margin-top: auto; padding: 10px 16px; font-size: 11px; color: #7f8b9b; border-top: 1px solid #2f3a49; word-break: break-all; }
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#jobbar { background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px; display: flex; align-items: center; gap: 16px; min-height: 46px; }
#jobbar .jt { font-weight: 600; font-size: 15px; }
#jobbar .jm { color: var(--muted); }
#jobbar .tot { margin-left: auto; display: flex; gap: 18px; align-items: center; }
#jobbar .tot div { text-align: right; }
#jobbar .tot small { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }
#jobbar .tot b { font-size: 15px; }
#banner:empty { display: none; }
#banner { background: #fff3cd; border-bottom: 1px solid #f0d78a; padding: 7px 16px; display: flex; gap: 12px; align-items: center; }
#banner.err { background: #fde2e2; border-color: #f2b1b1; }
#view { flex: 1; overflow: auto; padding: 14px 16px; }
#view.full { padding: 0; overflow: hidden; display: flex; }

h2 { font-size: 17px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 13.5px; margin: 0 0 8px; font-weight: 600; }
.muted { color: var(--muted); }
.r { text-align: right; } .c { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

button, .btn { font: inherit; padding: 5px 12px; border: 1px solid #c5ccd6; background: #fff; border-radius: 4px; cursor: pointer; color: var(--txt); white-space: nowrap; }
button:hover { background: #f0f2f5; }
button.pri { background: var(--accent); border-color: var(--accent-d); color: #1b1300; font-weight: 600; }
button.pri:hover { background: var(--accent-d); }
button.blue { background: var(--blue); border-color: #1d4fa3; color: #fff; }
button.danger { color: var(--red); }
button.sm { padding: 2px 8px; font-size: 12px; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; padding: 4px 6px; border: 1px solid #c5ccd6; border-radius: 3px; background: #fff; color: var(--txt); }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc0f5; outline-offset: -1px; border-color: var(--blue); }
input[type=number] { text-align: right; }
textarea { width: 100%; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
label.f input, label.f select, label.f textarea { color: var(--txt); font-size: 13px; }
.form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; }
.form .w2 { grid-column: span 2; } .form .w4 { grid-column: span 4; }

table.t { width: 100%; border-collapse: collapse; background: #fff; }
table.t th { position: sticky; top: 0; background: #eef1f5; text-align: left; font-weight: 600; font-size: 11.5px; padding: 5px 7px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
table.t td { padding: 3px 7px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.t tr:hover td { background: #f8fafc; }
table.t tr.sel td { background: var(--sel); }
table.t tr.grp td { background: #f2f4f7; font-weight: 600; color: #3a4556; }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #fafbfc; }
table.t td input, table.t td select { width: 100%; padding: 2px 5px; border-color: transparent; background: transparent; }
table.t td input:hover, table.t td select:hover { border-color: #c5ccd6; background: #fff; }
table.t td input:focus { background: #fff; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t .code { font-family: Consolas, monospace; font-size: 12px; white-space: nowrap; }
table.t tr.warn td { background: #fff1f1; }
.tblwrap { overflow: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }

.pl-sheet .ren { margin-left: 4px; padding: 0 5px; line-height: 16px; font-size: 11px; opacity: 0; }
.pl-sheet:hover .ren, .pl-sheet.on .ren { opacity: 1; }
.area-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 30; background: #fff7ed; border: 1px solid #e8590c; color: #7a2e00; border-radius: 6px; padding: 7px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.15); display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.nbadge { margin-left: 6px; background: #e8590c; color: #fff; border-radius: 9px; font-size: 10px; padding: 0 6px; line-height: 16px; }
.note { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; background: #fff; }
.note.done { opacity: .6; }
.note.done .ntext { text-decoration: line-through; }
.note .ntext { margin-top: 5px; white-space: normal; line-height: 1.45; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; background: #e9edf2; color: #3a4556; }
.pill.lock { background: #fde2e2; color: var(--red); }
.pill.mine { background: #dff3e7; color: var(--green); }
.pill.Won { background: #dff3e7; color: var(--green); } .pill.Lost { background: #f1f1f1; color: #888; } .pill.Submitted { background: var(--blue-l); color: var(--blue); } .pill.Bidding { background: #fff4db; color: #a86b00; } .pill.Approved { background: #e6f4ea; color: #1e7b34; }
.pill.alt { background: #efe7fb; color: #6b3fb5; } .pill.co { background: #fdeee0; color: #b25b0e; }

/* takeoff layout */
.to { display: flex; flex: 1; min-height: 0; min-width: 0; }
.to-left { width: 268px; border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.to-mid { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.to-right { width: 310px; border-left: 1px solid var(--line); background: #fff; overflow: auto; flex-shrink: 0; padding: 12px; }
.bdlist { border-bottom: 1px solid var(--line); max-height: 34%; overflow: auto; }
.bdlist div { padding: 5px 12px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.bdlist div:hover { background: #f5f7fa; }
.bdlist div.on { background: var(--blue-l); font-weight: 600; }
.bdlist div .n { margin-left: auto; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs div { flex: 1; text-align: center; padding: 7px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs div.on { color: var(--txt); border-bottom-color: var(--accent); font-weight: 600; }
.libsearch { padding: 8px; border-bottom: 1px solid var(--line); }
.libsearch input { width: 100%; }
.tree { flex: 1; overflow: auto; font-size: 12.5px; }
.tree .cat { padding: 5px 10px; font-weight: 600; background: #f5f6f8; cursor: pointer; border-bottom: 1px solid var(--line2); position: sticky; top: 0; }
.tree .sub { padding: 4px 10px 4px 18px; color: #4a5566; cursor: pointer; font-weight: 600; font-size: 12px; }
.tree .it { padding: 3px 10px 3px 28px; cursor: pointer; display: flex; gap: 6px; }
.tree .it:hover { background: #f1f5fb; }
.tree .it.on { background: var(--sel); }
.tree .it .cd { color: var(--muted); font-family: Consolas, monospace; font-size: 11px; min-width: 0; }
.quick { display: flex; gap: 8px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); align-items: center; }
.quick input.code { width: 230px; }
.quick input.qty { width: 90px; }
.to-grid { flex: 1; overflow: auto; }
.to-foot { display: flex; gap: 22px; padding: 7px 14px; background: #fff; border-top: 1px solid var(--line); font-size: 12.5px; }
.to-foot b { font-variant-numeric: tabular-nums; }
.pv { font-size: 12px; }
.pv td { padding: 2px 5px !important; }

/* summary */
.recap td { padding: 5px 9px; }
.recap tr.sub td { font-weight: 600; background: #f7f8fa; }
.recap tr.big td { font-size: 16px; font-weight: 700; background: #fff7e3; border-top: 2px solid var(--accent); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; }
.stat small { color: var(--muted); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.stat b { font-size: 18px; }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 22, 33, .45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 8px; min-width: 420px; max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal .mh { padding: 12px 16px; font-weight: 600; font-size: 15px; border-bottom: 1px solid var(--line); }
.modal .mb { padding: 14px 16px; overflow: auto; }
.modal .mf { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
#toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #1f2733; color: #fff; padding: 9px 14px; border-radius: 5px; box-shadow: 0 4px 14px rgba(0,0,0,.2); max-width: 420px; }
.toast.err { background: var(--red); }

.setup { max-width: 620px; margin: 60px auto; }
.setup .card { padding: 24px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.ro input, .ro select, .ro textarea { pointer-events: none; background: #f5f6f8 !important; }
.ro .edit-only { display: none !important; }
kbd { font: 11px Consolas, monospace; background: #eef0f3; border: 1px solid #d5d9e0; border-radius: 3px; padding: 0 4px; }
table.t.fixed { table-layout: fixed; }
table.t.fixed td { overflow: hidden; text-overflow: ellipsis; }
.code { font-family: Consolas, "Cascadia Mono", monospace; }
.form > * { min-width: 0; }
label.f input, label.f select, label.f textarea { min-width: 0; width: 100%; }
.tree .it > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .it .cd { white-space: nowrap; flex-shrink: 0; }
td.acts { white-space: nowrap; }
td.acts { overflow: visible !important; }
.ac-box { position: fixed; z-index: 80; background: #fff; border: 1px solid #b9c2cf; border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-height: 420px; overflow: auto; max-width: 640px; }
.ac-h { padding: 4px 10px 3px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f3f5f8; border-top: 1px solid #e3e7ee; }
.ac-h:first-child { border-top: 0; }
.libtag { display: inline-block; font-size: 10px; padding: 0 5px; border-radius: 8px; background: #e8eef8; color: #2a4a7a; margin-left: 4px; }
.libtag.vb { background: #fff2dc; color: #7a4a00; }
.ac-it { display: flex; gap: 8px; padding: 5px 10px; cursor: pointer; align-items: center; }
.ac-it.on, .ac-it:hover { background: var(--blue-l); }
.ac-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-c { color: var(--muted); font: 11px Consolas, monospace; white-space: nowrap; }
/* on-screen takeoff */
.pl-hd { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f5f6f8; border-bottom: 1px solid var(--line); }
.pl-sheets { overflow: auto; flex-shrink: 0; min-height: 80px; }
.pl-sheet { display: flex; gap: 6px; align-items: center; padding: 6px 10px; cursor: pointer; font-size: 12.5px; border-bottom: 1px solid var(--line2); }
.pl-sheet:hover { background: #f5f7fa; } .pl-sheet.on { background: var(--blue-l); font-weight: 600; }
.pl-sheet .nmw { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-sheet .nm { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.pl-sheet .sub { display: flex; gap: 6px; align-items: center; }
.pl-sheet .n { font-size: 11px; color: var(--muted); }
.pl-cond { display: flex; gap: 8px; align-items: center; padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--line2); }
.pl-cond:hover { background: #f5f7fa; } .pl-cond.on { background: var(--sel); }
.pl-cond .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.pl-cond .nm small { display: block; color: var(--muted); font-size: 11px; }
.pl-cond .q { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-cond .eye { padding: 0 5px; border-color: transparent; background: transparent; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; border: 2px solid #fff; box-shadow: 0 0 0 1px #c5ccd6; }
.sw.big { width: 22px; height: 22px; margin-top: 4px; }
.pl-colors { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.pl-colors .sw { cursor: pointer; width: 18px; height: 18px; } .pl-colors .sw.on { box-shadow: 0 0 0 2px #111; }
.pl-tools { flex-wrap: wrap; gap: 6px; row-gap: 6px; }
.seg { display: inline-flex; } .seg button { border-radius: 0; margin-left: -1px; } .seg button:first-child { border-radius: 4px 0 0 4px; } .seg button:last-child { border-radius: 0 4px 4px 0; }
.seg button.on { background: #1d2633; color: #fff; border-color: #1d2633; }
.pl-scroll { flex: 1; overflow: auto; background: #5f6670; position: relative; }
.pl-stage { position: relative; margin: 20px; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.pl-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pl-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pl-stage[data-tool=select] { cursor: default; } .pl-stage[data-tool=count] { cursor: crosshair; } .pl-stage[data-tool=line], .pl-stage[data-tool=scale], .pl-stage[data-tool=auto] { cursor: crosshair; }
.pl-lbl { font-family: "Segoe UI", Arial, sans-serif; font-weight: 700; paint-order: stroke; }
.pl-name { width: 100%; font-weight: 600; font-size: 14px; border-color: transparent; padding: 2px 4px; margin-left: -4px; }
.pl-name:hover { border-color: #c5ccd6; }
/* assembly components in the takeoff grid */
.exp { cursor: pointer; display: inline-block; width: 14px; color: var(--txt); font-size: 12px; }
tr.comp td { background: #f7f9fc; font-size: 12px; padding-top: 2px; padding-bottom: 2px; }
tr.comp td:nth-child(2) { padding-left: 18px; }
tr.comp-hd td { background: #edf2f9; font-size: 11px; color: var(--muted); font-weight: 600; }
button.del { border-color: transparent; background: transparent; padding: 1px 5px; }
button.del:hover { background: #fde2e2; }
/* show full text: wrap instead of cutting off, and let side panels be resized */
.tree .it { align-items: flex-start; }
.tree .it > span:first-child { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; }
.tree .it .cd { padding-top: 1px; }
table.t.fixed td { overflow-wrap: anywhere; }
.to-left, .to-right { resize: horizontal; overflow: auto; min-width: 220px; max-width: 60vw; }
.to-left { direction: ltr; }
.resizable { resize: horizontal; overflow: auto; min-width: 200px; max-width: 70vw; }
textarea.cell { width: 100%; border-color: transparent; background: transparent; resize: none; field-sizing: content; min-height: 24px; padding: 2px 5px; font: inherit; line-height: 1.35; }
textarea.cell:hover { border-color: #c5ccd6; background: #fff; }
.ldesc { color: var(--muted); font-size: 11.5px; padding: 0 6px 3px; line-height: 1.3; }
/* auto count review */
.rv-grid { --rv: 170px; display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--rv) + 16px), 1fr)); gap: 10px; max-height: 68vh; overflow: auto; padding: 2px; }
.rv { position: relative; border: 2px solid var(--line); border-radius: 6px; cursor: pointer; background: #fff; padding: 6px; text-align: center; opacity: .55; }
.rv img { width: var(--rv); height: var(--rv); display: block; margin: 0 auto; image-rendering: auto; }
.rv.on { border-color: var(--green); opacity: 1; box-shadow: 0 0 0 2px rgba(31,138,76,.2); }
.rv .rv-s { position: absolute; left: 4px; top: 3px; font-size: 12px; background: rgba(255,255,255,.9); padding: 0 3px; border-radius: 3px; color: var(--muted); }
.rv .rv-c { position: absolute; right: 4px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #ccd2da; color: #fff; font-size: 15px; line-height: 24px; }
.rv.on .rv-c { background: var(--green); }
.rv .rv-sh { position: absolute; left: 4px; bottom: 3px; font-size: 10px; background: #1d2633; color: #fff; padding: 0 4px; border-radius: 3px; }
.chk-row { padding: 2px 0; font-size: 12.5px; } .chk-row a { color: var(--blue); cursor: pointer; } .chk-row a:hover { text-decoration: underline; }

/* quantity boxes look like boxes */
table.t td input.qtybox, table.t td input[data-per], table.t td input[data-tot] { border: 1px solid #b9c2cf !important; background: #fff !important; border-radius: 3px; font-weight: 600; }
table.t td input.qtybox:focus, table.t td input[data-per]:focus, table.t td input[data-tot]:focus { border-color: var(--blue) !important; }
table.t td input.qtybox.plan { color: var(--blue); }
table.t td input.qtybox.ovr { color: #b25b0e; border-color: #e8a317 !important; }
.qtynote { font-size: 10.5px; color: var(--muted); text-align: right; }
tr.comp.sup td { background: #f1f8f1; }
/* cloud: people in the job, approvals */
.peer { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 10.5px; font-weight: 700; margin-left: 3px; box-shadow: 0 0 0 2px #fff; }
.peer-tag { display: inline-block; color: #fff; font-size: 10px; font-weight: 700; border-radius: 8px; padding: 1px 5px; margin-right: 5px; vertical-align: 1px; }
.cloudbar { display: flex; align-items: center; gap: 6px; }
.pill.ok { background: #e6f4ea; color: #1e7b34; }
/* job-only price / labor changes in the takeoff */
input.num.ovr { color: #1864ab; font-weight: 700; background: #e7f1ff; border-color: #74a9e8; }
.ovtxt { color: #1864ab; font-weight: 700; }
.compd { display: flex; align-items: center; gap: 6px; }
.compd .cdesc { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.compd .perin { width: 66px; flex: none; }
input.num.cbox { width: 100%; border: 1px solid #cfd6df; border-radius: 4px; padding: 3px 5px; background: #fff; }
input.num.cbox.ovr { color: #1864ab; font-weight: 700; background: #e7f1ff; border-color: #74a9e8; }
.perrow { display: flex; align-items: center; justify-content: flex-end; gap: 2px; font-size: 10.5px; color: var(--muted, #7a8594); margin-top: 2px; white-space: nowrap; }
.perrow input { width: 56px; font-size: 10.5px; padding: 0 3px; border: 1px solid #e1e6ec; border-radius: 3px; background: #fff; text-align: right; }
/* "update ready" bar */
#updbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 900; background: #1f2a37; color: #fff; padding: 9px 12px 9px 16px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.25); display: flex; align-items: center; gap: 10px; font-size: 13px; max-width: 80vw; }
#updbar .muted { color: #b8c2cf; }
#updbar button.sm:not(.pri) { background: transparent; color: #fff; border-color: #5b6878; }
/* full-sheet crosshair */
.pl-xh { position: fixed; display: none; pointer-events: none; z-index: 5; overflow: hidden; }
.pl-xh-v { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid #111; }
.pl-xh-h { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid #111; }
.pl-xh-o { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 1px solid #111; border-radius: 50%; }
.pl-scroll.xh, .pl-scroll.xh .pl-stage { cursor: none; }
#plXh.on { background: var(--accent, #2563eb); color: #fff; }
.pl-stop { background: #dc2626 !important; color: #fff !important; border-color: #b91c1c !important; font-weight: 600; }
.pl-xhbtn { font-weight: 600; border: 1px solid #94a3b8; }
.pl-done { width: 18px; height: 18px; min-width: 18px; padding: 0; border: 1.5px solid #94a3b8; border-radius: 4px; background: #fff; color: #fff; font-size: 12px; line-height: 15px; font-weight: 700; cursor: pointer; }
.pl-sheet.done .pl-done { background: #16a34a; border-color: #16a34a; }
.pl-sheet.done .nm { color: #15803d; }

/* panel splitters on the takeoff screen */
.pl-vsplit { height: 7px; flex-shrink: 0; cursor: row-resize; background: #e5e7eb; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
.pl-vsplit::after { content: ''; position: absolute; left: 50%; top: 2px; width: 34px; margin-left: -17px; height: 1px; border-top: 1px solid #9ca3af; border-bottom: 1px solid #9ca3af; }
.pl-hsplit { width: 6px; flex-shrink: 0; cursor: col-resize; background: #e5e7eb; border-right: 1px solid var(--line); }
.pl-vsplit:hover, .pl-hsplit:hover { background: #cbd5e1; }
.to-left { resize: none !important; }
.to-left { overflow-x: hidden !important; }
.pl-sheet { padding: 5px 10px; }
.to-mid { position: relative; }
.pl-busy { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: max-content; max-width: 80%; padding: 8px 14px; background: rgba(29,38,51,.88); color: #fff; border-radius: 6px; font-size: 13px; z-index: 6; pointer-events: none; }
.pl-measlist { margin: 6px 0 10px; padding: 8px 10px; background: #ecfeff; border: 1px solid #a5f3fc; border-radius: 6px; font-size: 12.5px; line-height: 1.6; }
.pl-measlist button { margin-top: 4px; }
.pl-cmp { margin: 6px 0 10px; padding: 8px 10px; background: #fff7ed; border: 1px solid #fdba74; border-radius: 6px; font-size: 12.5px; line-height: 1.5; }
.pl-cmp-list a { display: inline-block; margin: 2px 4px 2px 0; padding: 1px 7px; border: 1px solid #fdba74; border-radius: 10px; color: #c2410c; cursor: pointer; font-weight: 600; }
.pl-cmp-list a:hover { background: #ffedd5; }
.fx-types { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow: auto; }
.fx-types .pill { font-size: 11.5px; }
.fx-sheets { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; max-height: 220px; overflow: auto; font-size: 12.5px; }
.fx-t td { vertical-align: middle; }
/* vendor quotes: several vendors per package, one used */
.qt .q-grp td { background: #f1f5f9; padding: 7px 10px; font-size: 12.5px; }
.qt .q-add { float: right; cursor: pointer; color: var(--blue); font-size: 12px; }
.qt .q-off td { opacity: .55; }
.qt .q-off td:first-child { opacity: 1; }
.qt .q-low { color: #15803d; font-weight: 700; }
/* specs */
.sp-grid { display: grid; grid-template-columns: minmax(340px, 38%) 1fr; gap: 14px; align-items: start; }
.sp-left { max-height: calc(100vh - 130px); overflow: auto; }
.sp-card { padding: 10px 12px; }
.sp-card h3 { margin: 0 0 6px; font-size: 14px; }
.sp-div { margin: 10px 0 3px; font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sp-sec { display: block; padding: 3px 6px; border-radius: 4px; cursor: pointer; font-size: 12.5px; line-height: 1.35; }
.sp-sec:hover, .sp-sec.on { background: #e8f0fe; }
.sp-hit { display: block; padding: 5px 6px; border-radius: 4px; cursor: pointer; font-size: 12px; line-height: 1.35; border-bottom: 1px solid var(--line); }
.sp-hit:hover { background: #f1f5f9; }
.sp-hit mark, .sp-text mark { background: #fde68a; }
.sp-flag summary { cursor: pointer; padding: 4px 0; }
.sp-right { position: sticky; top: 0; max-height: calc(100vh - 130px); overflow: auto; }
.sp-page canvas { border: 1px solid var(--line); background: #fff; }
.sp-text { white-space: pre-wrap; font-size: 12.5px; line-height: 1.45; font-family: inherit; }
.sp-x { margin-left: 4px; color: #b91c1c; cursor: pointer; }

/* bid check */
.bc-n{display:inline-block;min-width:20px;padding:0 6px;border-radius:10px;font-size:12px;font-weight:700;text-align:center;color:#fff;margin:0 2px}
.bc-n.err{background:#d6336c}.bc-n.warn{background:#f08c00}.bc-n.info{background:#868e96}.bc-n.ok{background:#2f9e44}
.bc-sum{display:flex;align-items:center;gap:6px;margin-bottom:6px;flex-wrap:wrap}
.bc-h{margin:14px 0 4px;font-size:13px}
.bc-row{display:flex;gap:8px;align-items:center;padding:6px 8px;border-radius:6px;margin:3px 0;font-size:13px;line-height:1.35}
.bc-row.bc-err{background:#fdecef}.bc-row.bc-warn{background:#fff4e0}.bc-row.bc-info{background:#f3f4f6}

/* count from legend */
.lg-sym{width:44px;height:44px;border:1px solid var(--line);border-radius:4px;background:#fff;image-rendering:auto}
.lg-t td{vertical-align:middle}
.lg-grp{border:1px solid var(--line);border-radius:8px;padding:8px 10px;margin:8px 0}
.lg-n{font-weight:700;min-width:28px;text-align:right;font-size:15px}
.lg-hits{display:flex;flex-wrap:wrap;gap:4px;margin:8px 0 0 54px}
.lg-hit{position:relative;display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:4px;padding:2px;background:#fff;cursor:pointer}
.lg-hit img{width:56px;height:56px;display:block}
.lg-hit input{position:absolute;top:2px;left:2px;width:auto;margin:0}
.lg-hit:has(input:not(:checked)){opacity:.4}
.lg-txt{padding:3px 6px 3px 22px;font-weight:700;font-size:12px}.lg-txt small{font-weight:400;color:var(--muted);margin-left:3px}

/* price change review */
.pr-sum{font-size:14px;margin-bottom:4px;line-height:1.6}
.pr-up{color:#c92a2a}.pr-dn{color:#2b8a3e}.pr-big{color:#d9480f;font-weight:600}
.pr-bigrow td{background:#fff4e6}
.pr-jobs td,.pr-items td{padding:4px 8px}

/* addenda + scope suggestions */
.ad-blk{border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin:0 0 12px}
.ad-sum{margin:6px 0;font-size:13px}
.sd-row{display:flex;gap:8px;align-items:center;padding:5px 6px;border-radius:6px;font-size:13px}
.sd-row:hover{background:var(--hover,#f3f4f6)}.sd-row input{width:auto}.sd-row small{max-width:300px;text-align:right}

/* bid history */
.hi-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-bottom:10px}
.hi-card{margin:0;padding:12px 14px}.hi-v{font-size:24px;font-weight:700;margin:2px 0}
.pill.hi-won{background:#d3f9d8;color:#2b8a3e}.pill.hi-lost{background:#ffe3e3;color:#c92a2a}
.hi-off{color:#c92a2a;font-weight:700}.hi-warn{color:#e8590c;font-weight:600}.hi-ok{color:#2b8a3e}
