/* Metre2 BIM workspace - the dense docked "serious app" layout from the mock-ups, violet accent. */
:root {
  --bg: #f3f5fb; --panel: #ffffff; --panel2: #f7f8fd; --tint: #eeedfb; --hover: rgba(106,69,224,.06); --sel: rgba(106,69,224,.12);
  --line: rgba(60,50,140,.12); --line2: rgba(60,50,140,.22); --tx: #0f1530; --tx2: #44506b; --tx3: #5d6884;
  --ink: #6a45e0; --ink2: #4a2db8; --on: #ffffff; --ok: #0b7a51; --warn: #a14a07; --bad: #c02a26; --pink: #d61f86;
  --okbg: #e3f3ec; --warnbg: #fdf0e3; --badbg: #fdeceb;
  --glow: 0 6px 18px -8px rgba(106,69,224,.6); --shadow: 0 28px 70px -24px rgba(30,20,90,.38);
  --ui: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; --mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--tx); font: 12px/1.35 var(--ui); overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
.mono { font-family: var(--mono); } .muted { color: var(--tx3); } .err { color: var(--bad); }
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#app { height: 100vh; display: flex; flex-direction: column; }

/* menu bar */
.menubar { height: 34px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; white-space: nowrap; }
.logo { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, #8b6cf0, #4a2db8); display: grid; place-items: center; color: #fff; font: 800 9px var(--mono); box-shadow: var(--glow); }
.max { padding: 2px 8px; border-radius: 999px; background: linear-gradient(135deg, #a78bfa, #6a45e0); color: #fff; font: 700 9px var(--mono); letter-spacing: .1em; }
.mtitle { flex: 1; text-align: center; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtitle b { color: var(--tx); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--tint); color: var(--tx2); font: 600 10.5px var(--ui); white-space: nowrap; }
.chip.ok { background: var(--okbg); color: var(--ok); } .chip.warn { background: var(--warnbg); color: var(--warn); } .chip.bad { background: var(--badbg); color: var(--bad); } .chip.ink { background: var(--sel); color: var(--ink2); }

/* ribbon */
.ribbon { flex: none; background: var(--panel); border-bottom: 1px solid var(--line2); }
.rtabs { display: flex; gap: 2px; padding: 4px 8px 0; align-items: flex-end; }
.rtabs > button { height: 26px; padding: 0 12px; border-radius: 7px 7px 0 0; color: var(--tx2); font-weight: 500; }
.rtabs > button:hover { background: var(--hover); }
.rtabs > button.on { background: var(--sel); color: var(--ink2); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); }
.rtabs .sp { flex: 1; } .rtabs .collapse { height: 24px; width: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--tx3); }
.ribbon.collapsed .rbody { display: none; } .ribbon.collapsed .collapse svg { transform: rotate(180deg); }
.rbody { height: 82px; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
.rpage { display: flex; align-items: stretch; height: 100%; padding: 4px 6px; }
.rgroup { display: flex; flex-direction: column; padding: 0 6px; border-right: 1px solid var(--line); }
.rgroup .cmds { flex: 1; display: flex; gap: 2px; align-items: flex-start; }
.rgroup .gname { text-align: center; font: 600 8.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--tx3); white-space: nowrap; }
.rcmd { width: 66px; min-height: 56px; padding: 5px 2px 2px; border-radius: 7px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--tx2); cursor: pointer; }
.rcmd:hover { background: var(--hover); } .rcmd.on { background: var(--sel); color: var(--ink2); }
.rcmd svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rcmd span { font-size: 11px; line-height: 1.15; text-align: center; }
.rsmall { display: flex; flex-direction: column; gap: 6px; padding: 4px 4px 0; font-size: 11px; color: var(--tx2); }
.rsmall label { display: flex; align-items: center; justify-content: space-between; gap: 8px; white-space: nowrap; }
input.num, select, .field { height: 24px; border: 1px solid var(--line2); border-radius: 6px; background: var(--panel); padding: 0 6px; font-family: var(--mono); font-size: 11.5px; }
input.num { width: 90px; text-align: right; }

/* main */
.main { flex: 1; min-height: 0; display: flex; position: relative; }
.side { background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.side.left { width: 290px; flex: none; border-right: 1px solid var(--line2); }
.side.right { width: 340px; flex: none; border-left: 1px solid var(--line2); }
.phead, .dhead { height: 32px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 10px; border-bottom: 1px solid var(--line); }
.phead .sp, .dhead .sp, .status .sp, .modal-head .sp { flex: 1; }
.icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--tx3); } .icon:hover { background: var(--hover); color: var(--tx); }
.ptabs { display: flex; gap: 2px; } .ptabs button { height: 24px; padding: 0 10px; border-radius: 6px; color: var(--tx2); font-weight: 500; } .ptabs button.on { background: var(--sel); color: var(--ink2); font-weight: 600; }
.search { margin: 8px 10px 4px; height: 28px; border: 1px solid var(--line2); border-radius: 8px; display: flex; align-items: center; gap: 6px; padding: 0 8px; color: var(--tx3); }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; background: none; }
.pbody { flex: 1; min-height: 0; overflow: auto; }
.pfoot { flex: none; border-top: 1px solid var(--line); padding: 8px 10px; }
.pfoot:empty { display: none; }
.reopen { position: absolute; z-index: 5; background: var(--panel); border: 1px solid var(--line2); color: var(--tx2); height: 28px; display: flex; align-items: center; gap: 4px; padding: 0 6px; box-shadow: 0 4px 14px -6px rgba(30,20,90,.3); }
.reopen.left { left: 0; top: 50%; border-radius: 0 8px 8px 0; border-left: 0; }
.reopen.right { right: 0; top: 50%; border-radius: 8px 0 0 8px; border-right: 0; }
.reopen.dockbtn { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); border-radius: 8px; padding: 0 10px; }

/* tree and lists */
.sec-h { font: 600 9.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--tx3); padding: 10px 12px 4px; display: flex; justify-content: space-between; }
.node { display: flex; align-items: center; gap: 6px; height: 26px; padding-right: 8px; cursor: pointer; white-space: nowrap; }
.node:hover { background: var(--hover); } .node.sel { background: var(--sel); color: var(--ink2); }
.node .tw { width: 16px; height: 16px; display: grid; place-items: center; color: var(--tx3); flex: none; }
.node .tw svg { transition: transform .12s; } .node.open > .tw svg { transform: rotate(90deg); }
.node .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; } .node .ct { font: 11px var(--mono); color: var(--tx3); }
.node .eye { width: 20px; height: 20px; display: grid; place-items: center; color: var(--tx3); border-radius: 4px; flex: none; } .node .eye:hover { background: var(--hover); color: var(--tx); }
.node.off .nm, .node.off .ct { opacity: .45; text-decoration: line-through; }
.dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.rule { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 3px 10px 3px 12px; cursor: pointer; }
.rule:hover { background: var(--hover); } .rule.sel { background: var(--sel); box-shadow: inset 2px 0 0 var(--ink); }
.rule .ref { font: 11px var(--mono); color: var(--tx3); width: 44px; flex: none; } .rule .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule .ct { font: 11px var(--mono); color: var(--tx3); } .rule .warn { color: var(--pink); font: 600 10px var(--mono); }
.cov { height: 6px; border-radius: 3px; background: var(--tint); overflow: hidden; margin: 6px 0 4px; } .cov > div { height: 100%; background: var(--ok); }
.empty-note { padding: 14px 12px; color: var(--tx3); line-height: 1.5; }
.empty-note .btn { margin-top: 8px; }

/* buttons */
.btn { height: 28px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); color: var(--tx2); font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--hover); } .btn.primary { border: 0; background: var(--ink); color: var(--on); font-weight: 600; box-shadow: var(--glow); }
.btn.danger { color: var(--bad); } .btn.small { height: 22px; padding: 0 8px; font-size: 11px; border-radius: 6px; }

/* centre */
.centre { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.stage { flex: 1; min-height: 0; position: relative; background: #f6f8fc; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.home { position: absolute; inset: 0; overflow: auto; display: flex; justify-content: center; padding: 40px 20px; background: var(--bg); }
.home-card { width: min(760px, 100%); }
.home h1 { font-size: 20px; margin: 0 0 14px; font-weight: 650; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; border: 1.5px dashed var(--line2); border-radius: 14px; background: var(--panel); color: var(--tx2); text-align: center; cursor: pointer; }
.drop.over { border-color: var(--ink); background: var(--tint); } .drop small { color: var(--tx3); max-width: 420px; }
.projects { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.projects li { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; cursor: pointer; }
.projects li:hover { border-color: var(--ink); }
.projects .name { font-weight: 600; } .projects .meta { color: var(--tx3); grid-column: 1; font-size: 11.5px; } .projects .acts { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; }
.badge { margin-left: 8px; font: 600 10px var(--mono); color: var(--warn); background: var(--warnbg); padding: 1px 6px; border-radius: 999px; }
.job { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); width: min(520px, 92%); background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; z-index: 6; }
.job-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 10px; } .steps li { flex: 1; text-align: center; font-size: 11px; color: var(--tx3); padding: 4px; border-radius: 6px; background: var(--panel2); }
.steps li.now { background: var(--sel); color: var(--ink2); font-weight: 600; } .steps li.done { color: var(--ok); }
.meter { height: 6px; border-radius: 3px; background: var(--tint); overflow: hidden; margin-bottom: 8px; } #meterFill { height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: 11.5px; } .kv dt { color: var(--tx3); } .kv dd { margin: 0; font-family: var(--mono); }
.vbar, .vmodes { position: absolute; top: 10px; display: flex; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 6px 20px -10px rgba(30,20,90,.35); z-index: 3; }
.vbar { left: 50%; transform: translateX(-50%); } .vmodes { right: 10px; }
.vbar button, .vmodes button { height: 26px; padding: 0 10px; border-radius: 7px; color: var(--tx2); font-weight: 500; white-space: nowrap; } .vbar button.on, .vmodes button.on { background: var(--sel); color: var(--ink2); font-weight: 600; }
.legend { position: absolute; left: 10px; top: 10px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; min-width: 220px; z-index: 3; box-shadow: 0 6px 20px -10px rgba(30,20,90,.35); }
.legend .lbl { font: 600 9.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--tx3); margin-bottom: 6px; }
.legend .ramp { height: 8px; border-radius: 4px; } .legend .ticks { display: flex; justify-content: space-between; font: 10.5px var(--mono); color: var(--tx3); margin-top: 3px; }
.legend .key { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; }
.hud { position: absolute; left: 10px; bottom: 10px; margin: 0; font: 10.5px/1.45 var(--mono); color: var(--tx2); background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; z-index: 2; white-space: pre; }

/* bottom dock: bill and carbon tables */
.dock { height: 300px; flex: none; display: flex; flex-direction: column; background: var(--panel); border-top: 1px solid var(--line2); }
.dbody { flex: 1; min-height: 0; overflow: auto; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11.5px; }
.grid th { position: sticky; top: 0; background: var(--panel2); text-align: left; font: 600 9.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); padding: 6px 8px; border-bottom: 1px solid var(--line2); white-space: nowrap; z-index: 1; }
.grid th.r, .grid td.r { text-align: right; }
.grid td { padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-family: var(--mono); color: var(--tx); }
.grid td.t { font-family: var(--ui); max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.grid tr.sec td { background: var(--panel2); font-weight: 650; font-family: var(--ui); }
.grid tr.sub td { font-weight: 650; border-bottom: 1px solid var(--line2); }
.grid tr.item { cursor: pointer; } .grid tr.item:hover td { background: var(--hover); } .grid tr.item.sel td { background: var(--sel); }
.grid tr.tot td { font-weight: 700; background: var(--tint); }
.grid input.cell { width: 86px; height: 22px; border: 1px solid transparent; border-radius: 5px; background: transparent; text-align: right; font: 11.5px var(--mono); padding: 0 4px; }
.grid input.cell:hover { border-color: var(--line2); } .grid input.cell:focus { border-color: var(--ink); background: var(--panel); outline: 0; }
.grid input.cell.unpriced::placeholder { color: var(--pink); }
.link { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 5px; background: var(--sel); color: var(--ink2); font: 600 10.5px var(--mono); }
.flag { color: var(--warn); } .src { color: var(--tx3); font-size: 10.5px; }
.bar { height: 6px; border-radius: 3px; background: var(--tint); min-width: 120px; overflow: hidden; } .bar > div { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #f0b429, #d7263d); }

/* right panel content */
.rp { padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.rp .lbl { font: 600 9.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--tx3); margin-bottom: 4px; }
.rp input.field, .rp select.field { width: 100%; height: 28px; }
.rp .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cond { display: grid; grid-template-columns: 82px 92px 1fr 22px; gap: 4px; margin-bottom: 4px; }
.cond select, .cond input { width: 100%; height: 26px; border: 1px solid var(--line2); border-radius: 6px; background: var(--panel); padding: 0 4px; font: 11px var(--mono); min-width: 0; }
.addc { color: var(--ink); font-weight: 600; font-size: 11.5px; }
.card { border: 1px solid var(--line2); border-radius: 10px; padding: 10px; background: var(--panel2); }
.mini { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 11.5px; } .mini .n { font-family: var(--mono); text-align: right; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; } .kpi b { display: block; font-size: 20px; font-weight: 650; margin: 2px 0; } .kpi small { color: var(--tx3); font-size: 10.5px; }
.hbar { display: grid; grid-template-columns: 1fr 110px 62px; align-items: center; gap: 8px; font-size: 11.5px; margin: 3px 0; }
.hbar .n { font-family: var(--mono); text-align: right; } .hbar .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 11.5px; } .pp-table td { padding: 3px 0; border-bottom: 1px solid var(--line); vertical-align: top; } .pp-table td:first-child { color: var(--tx3); width: 44%; padding-right: 8px; } .pp-table td:last-child { font-family: var(--mono); word-break: break-word; }
details.pp { border-bottom: 1px solid var(--line); } details.pp summary { cursor: pointer; padding: 6px 0; font-weight: 600; }
.note { font-size: 11px; color: var(--tx3); line-height: 1.45; }

/* status */
.status { height: 24px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 10px; background: var(--panel); border-top: 1px solid var(--line); color: var(--tx3); font-size: 11px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(15,21,48,.35); display: grid; place-items: center; z-index: 20; }
.modal-card { width: min(900px, 94vw); max-height: 86vh; display: flex; flex-direction: column; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); }
.modal-head { height: 40px; display: flex; align-items: center; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.modal-body { overflow: auto; padding: 12px 16px 16px; }
@media (max-width: 900px) { .side.left { width: 240px; } .side.right { width: 280px; } }

/* 4D: timeline and Gantt */
.dbody { position: relative; }
.tl { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tl input[type=range] { width: 260px; accent-color: var(--ink); }
.tl .when { font-weight: 600; min-width: 74px; } .tl .cnt { font-size: 11px; }
.grid.gantt th.bars, .grid.gantt td.bars { width: 45%; min-width: 300px; position: relative; padding: 0; }
.grid.gantt .months { position: relative; height: 14px; } .grid.gantt .months span { position: absolute; top: 0; font: 9.5px var(--mono); color: var(--tx3); border-left: 1px solid var(--line2); padding-left: 3px; letter-spacing: 0; text-transform: none; }
.grid.gantt td.bars i { position: absolute; top: 6px; height: 12px; border-radius: 3px; background: #8b6cf0; }
.grid.gantt td.bars i.crit { background: #d7263d; } .grid.gantt td.bars i.empty { background: transparent; border: 1px dashed #a9a3cf; }
.grid.gantt td.bars i.ms { width: 10px; height: 10px; top: 7px; border-radius: 1px; background: #0f1530; transform: translateX(-5px) rotate(45deg); }
.grid.gantt tr.sel td.bars i { box-shadow: 0 0 0 2px rgba(106,69,224,.35); }
.nowwrap { position: absolute; pointer-events: none; z-index: 1; } .nowline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #e0218a; }
.dhead #dsum { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.dhead .ptabs button { white-space: nowrap; }
/* the colour bar grew: display modes move to the bottom left, the stats above them */
.vmodes { left: 10px; right: auto; top: auto; bottom: 10px; }
.hud { bottom: 52px; }
.rule .ref { width: auto; min-width: 44px; white-space: nowrap; }
.vbar { max-width: calc(100% - 20px); overflow-x: auto; }
.legend { top: 52px; }
/* Find by property */
.qrow { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--line, #e3e6ee); border-radius: 6px; background: var(--panel2, #fafbfd); }
.qrow2 { display: grid; grid-template-columns: 112px 1fr auto; gap: 4px; align-items: center; }
.qrow2 .field, .qrow > .field { min-width: 0; width: 100%; }
.qand { font-size: 11px; color: var(--tx3); text-align: center; margin: -2px 0; }
/* bill item text, arrangement switch, rate library */
.grid td.desc { white-space: normal; min-width: 380px; max-width: 640px; }
.grid .spec { font-size: 10.5px; color: var(--tx3); line-height: 1.35; margin-top: 2px; white-space: normal; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 4px 10px; font: inherit; font-size: 11.5px; color: var(--tx2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: var(--tint); color: #4a2db8; font-weight: 600; }
.chip.lib { height: 15px; font-size: 9px; padding: 0 4px; margin-left: 3px; background: var(--tint); color: #4a2db8; border-radius: 4px; vertical-align: middle; }
.libsug .ref { min-width: 64px; }
.libsug .ct { color: var(--tx3); }
.grid input.cell.t { text-align: left; font-family: var(--ui); }
/* view tools: section panel, measurements */
.toolp { position: absolute; right: 12px; top: 52px; width: 290px; background: rgba(255,255,255,.97); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; font-size: 12px; z-index: 6; box-shadow: 0 6px 24px rgba(30,20,90,.08); }
.toolp .th { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .toolp .th b { flex: 1; }
.toolp .row { display: flex; gap: 6px; align-items: center; margin: 6px 0; flex-wrap: wrap; } .toolp .row select { flex: 1; min-width: 0; }
.toolp .ax { display: grid; grid-template-columns: 88px 1fr 1fr; gap: 4px; align-items: center; color: var(--tx2); }
.toolp .ax input { width: 100%; accent-color: #6a45e0; }
.toolp.refp { right: auto; left: 12px; width: 320px; max-height: calc(100% - 70px); overflow: auto; }
.refp .note { color: var(--tx2); margin-bottom: 6px; } .refi { border-top: 1px solid var(--line); padding: 4px 0; } .refi .nm { flex: 1; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.refi.open .nm { color: #6a45e0; } .refi .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; margin: 6px 0; } .refi .grid2 label { display: flex; flex-direction: column; gap: 2px; color: var(--tx2); }
.refi .grid2 .w2 { grid-column: span 2; } .refi .grid2 .field { width: 100%; } .refi input[type=color] { width: 36px; height: 22px; padding: 0; border: 1px solid var(--line2); border-radius: 4px; }
svg.measures { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
svg.measures line { stroke: #6a45e0; stroke-width: 2; } svg.measures circle { fill: #fff; stroke: #6a45e0; stroke-width: 2; } svg.measures circle.pend { fill: #6a45e0; }
svg.measures rect { fill: #6a45e0; } svg.measures text { fill: #fff; font: 600 11px var(--mono); }
.stage.measuring canvas { cursor: crosshair; }
.rcmd.on { background: var(--sel); }
/* ---------- phone layout: the model full screen, panels as sheets from a bottom bar ---------- */
.mnav { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: 58px; }
  .menubar .chip#storage { display: none; } .menubar .mtitle { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rtabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; } .rtabs button { flex: none; }
  .ribbon .rbody { display: none; position: absolute; left: 0; right: 0; z-index: 40; background: var(--panel); border-bottom: 1px solid var(--line2); box-shadow: 0 12px 30px -12px rgba(20,10,60,.35); overflow-x: auto; }
  .ribbon.mopen .rbody { display: flex; } .ribbon .collapse { display: none; }
  .side, .dock { position: fixed !important; left: 0; right: 0; bottom: 58px; width: auto !important; height: 62vh !important; z-index: 30; border: 0; border-top: 1px solid var(--line2); border-radius: 14px 14px 0 0; box-shadow: 0 -14px 40px -14px rgba(20,10,60,.35); }
  .reopen { display: none !important; }
  .status { display: none; }
  .vbar { top: 6px; } .legend { top: 44px; left: 6px; min-width: 0; max-width: calc(100% - 12px); font-size: 10.5px; padding: 6px 8px; }
  .vmodes { bottom: 8px; left: 6px; } .toolp { right: 6px; left: 6px; width: auto; top: 44px; }
  .stage canvas { touch-action: none; }
  .mnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 58px; z-index: 35; background: var(--panel); border-top: 1px solid var(--line2); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .mnav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; color: var(--tx2); border-radius: 10px; }
  .mnav button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
  .mnav button.on { background: var(--sel); color: #4a2db8; }
  .grid { font-size: 11px; } .grid td.desc { min-width: 220px; }
  .home-card { padding: 14px; }
}

/* clash detection */
.clashp .csets { display: flex; gap: 12px; padding: 8px 12px; flex-wrap: wrap; align-items: flex-start; border-bottom: 1px solid var(--line); }
.clashp .cset { display: flex; flex-direction: column; gap: 5px; min-width: 200px; font-size: 12px; } .clashp .cset > b { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--tx2); }
.clashp .vs { align-self: center; color: var(--tx2); font-size: 12px; } .clashp details summary { cursor: pointer; color: var(--tx2); }
.clashp .ccls { max-height: 160px; overflow: auto; display: grid; gap: 2px; padding: 4px 0; } .clashp .ccls label { white-space: nowrap; }
.clashp tr.sel td { background: var(--hover); } .clashp td select.field { height: 22px; }
.clashp td.t { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* guided tour */
.tour { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 18px 50px rgba(30,20,90,.22); z-index: 50; padding: 12px 14px 10px; font-size: 13px; line-height: 1.5; }
.tour-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; } .tour-h b { flex: 1; font-size: 15px; } .tour-n { font: 600 11px var(--mono); color: #6a45e0; background: rgba(106,69,224,.1); padding: 2px 7px; border-radius: 10px; }
.tour-b { color: var(--tx2); min-height: 60px; } .tour-b b { color: var(--tx); }
.tour-f { display: flex; align-items: center; gap: 8px; margin-top: 10px; } .tour-dots { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; }
.tour-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); cursor: pointer; } .tour-dots span.done { background: #b9a8f0; } .tour-dots span.on { background: #6a45e0; width: 18px; border-radius: 4px; }
.tour-cta { display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin-bottom: 16px; border-radius: 12px; background: linear-gradient(120deg, rgba(106,69,224,.1), rgba(106,69,224,.02)); border: 1px solid rgba(106,69,224,.25); }
.tour-cta div { flex: 1; display: flex; flex-direction: column; gap: 2px; } .tour-cta span { color: var(--tx2); font-size: 12.5px; }
@media (max-width: 760px) { .tour { bottom: 64px; } .tour-cta { flex-direction: column; align-items: stretch; } }

/* drawings */
.modal.wide .modal-card { width: 96vw; max-height: 92vh; height: 92vh; } .modal.wide .modal-body { flex: 1; display: flex; min-height: 0; }
.dwg { display: grid; grid-template-columns: 250px 1fr; gap: 14px; flex: 1; min-height: 0; width: 100%; }
.dwg-opts { display: flex; flex-direction: column; gap: 9px; font-size: 12px; overflow: auto; } .dwg-opts > label { display: flex; flex-direction: column; gap: 3px; color: var(--tx2); }
.dwg-opts .field { width: 100%; height: 28px; } .dwg-checks { display: flex; flex-direction: column; gap: 5px; } .dwg-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.dwg-prev { background: #e9ebf0; border-radius: 10px; padding: 10px; min-height: 0; display: flex; } .dwg-prev svg { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
@media (max-width: 760px) { .dwg { grid-template-columns: 1fr; } .dwg-prev { min-height: 50vh; } }
/* ---------- team: account, sign-in, people (bench40) ---------- */
.acct { display: flex; align-items: center; } .acct-btn { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 3px; border-radius: 999px; color: var(--tx2); font-weight: 500; }
.acct-btn:hover { background: var(--hover); }
.av { --h: 260; width: 22px; height: 22px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font: 600 9.5px/1 var(--ui); letter-spacing: .02em; color: #fff; background: hsl(var(--h) 52% 48%); }
.av.ring { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px hsl(var(--h) 60% 58%); margin-left: -4px; } .av.more { background: var(--tx3); margin-left: -4px; }
.presence { display: flex; align-items: center; gap: 2px; padding-left: 6px; } .presence .btn { margin-left: 10px; }
.acct-menu { position: fixed; z-index: 40; min-width: 240px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.acct-menu .who { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; } .acct-menu .who span { color: var(--tx3); font-size: 11.5px; }
.acct-menu button { text-align: left; padding: 7px 10px; border-radius: 8px; display: flex; justify-content: space-between; gap: 10px; color: var(--tx); } .acct-menu button:hover { background: var(--hover); }
.acct-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.aform { width: min(420px, 100%); margin: 4px auto 6px; display: flex; flex-direction: column; gap: 12px; font-size: 12.5px; }
.aform label { display: flex; flex-direction: column; gap: 4px; } .aform label > span { font-weight: 600; color: var(--tx2); }
.aform input:not([type=radio]):not([type=checkbox]), .aform select, .ppl input, .ppl select { height: 32px; border: 1px solid var(--line2); border-radius: 8px; padding: 0 10px; background: var(--panel); font: inherit; color: var(--tx); }
.aform input:focus, .ppl input:focus { outline: 2px solid rgba(106,69,224,.35); border-color: var(--ink); } .aform input[readonly] { background: var(--panel2); color: var(--tx2); }
.aform small { color: var(--tx3); font-weight: 400; } .aform .btn.primary { height: 34px; font-size: 13px; }
.aform label.radio, .aform label.check { flex-direction: row; align-items: flex-start; gap: 8px; } .aform label.radio > span, .aform label.check > span { font-weight: 400; color: var(--tx); }
.aform .indent { padding-left: 24px; display: flex; flex-direction: column; gap: 8px; margin-top: -4px; }
.anote { margin: 0; color: var(--tx2); line-height: 1.5; } .aerr { color: var(--bad); background: var(--badbg); padding: 8px 10px; border-radius: 8px; }
.alinks { display: flex; justify-content: space-between; gap: 10px; } .alinks a, .ppl a { color: var(--ink2); }
.adone p { margin: 0 0 10px; line-height: 1.55; }
.upl .meter { margin: 0 0 6px; }
.team-intro { display: flex; gap: 10px; align-items: center; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line2); }
.team-intro div { flex: 1; display: flex; flex-direction: column; gap: 2px; } .team-intro span { color: var(--tx2); }
.inv-row { display: flex; gap: 8px; align-items: center; padding: 10px 14px; margin-bottom: 10px; border-radius: 12px; background: linear-gradient(120deg, rgba(106,69,224,.12), rgba(106,69,224,.03)); border: 1px solid rgba(106,69,224,.3); } .inv-row span { flex: 1; }
.sec-row { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; } .sec-row h2 { margin: 0; font-size: 13px; font-weight: 650; color: var(--tx2); text-transform: uppercase; letter-spacing: .06em; } .sec-row .sp { flex: 1; }
.projects.team { margin-top: 10px; } .projects .name .chip { margin-left: 8px; font-size: 10px; vertical-align: 1px; }
.home .sec-row + label.drop { margin-top: 10px; }
.pick { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; } .pick li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 10px; }
.pick li span { flex: 1; display: flex; flex-direction: column; } .pick small { color: var(--tx3); }
.ppl { width: min(620px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 12px; font-size: 12.5px; } .ppl h3 { margin: 6px 0 0; font-size: 12px; color: var(--tx2); }
.addp { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .addp input { flex: 1; min-width: 200px; } .addp .aerr { flex-basis: 100%; }
.plist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); } .plist li:first-child { border-top: 0; }
.plist .av { width: 28px; height: 28px; font-size: 11px; } .plist .pn { flex: 1; display: flex; flex-direction: column; min-width: 0; } .plist .pn small { color: var(--tx3); overflow: hidden; text-overflow: ellipsis; }
.plist .pn .chip { font-size: 10px; margin-left: 4px; } .plist li.pend { background: var(--panel2); } .plist li.pend .av { opacity: .55; }
.plist select { height: 26px; font-size: 12px; } .plist .icon { color: var(--tx3); }
.roles { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; padding: 10px 12px; background: var(--panel2); border-radius: 10px; color: var(--tx2); font-size: 11.5px; } .roles dt { font-weight: 600; color: var(--tx); } .roles dd { margin: 0; }
.alog { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow: auto; } .alog li { display: flex; gap: 12px; padding: 6px 2px; border-top: 1px solid var(--line); } .alog .t { width: 78px; flex: none; color: var(--tx3); font-family: var(--mono); font-size: 11px; }
.cnotice { position: absolute; top: 54px; left: 50%; transform: translateX(-50%); z-index: 6; max-width: min(720px, 92%); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--panel); border: 1px solid rgba(106,69,224,.35); border-radius: 12px; box-shadow: var(--shadow); font-size: 12.5px; }
.cnotice > span { flex: 1; line-height: 1.4; }
@media (max-width: 760px) { .acct-btn span { display: none; } .presence .av { display: none; } .team-intro, .inv-row { flex-wrap: wrap; } .cnotice { top: auto; bottom: 70px; } }
