*{box-sizing:border-box}body{margin:0;font:12px "Segoe UI",Arial,sans-serif;height:100vh;display:flex;flex-direction:column;background:#e6e9ee;color:#222;overflow:hidden}
#menubar{background:#1d2b3a;color:#fff;display:flex;align-items:center;height:28px;padding:0 6px}
.brand{font-weight:bold;color:#5fb3ff;margin-right:14px}
.menu{position:relative;padding:5px 10px;cursor:default}.menu:hover{background:#2f4660}
.menu .dd{display:none;position:absolute;left:0;top:28px;background:#fff;color:#222;min-width:240px;box-shadow:0 3px 10px #0005;z-index:50}
.dd a{display:flex;justify-content:space-between;padding:6px 12px;cursor:pointer}.dd a:hover{background:#d8e8fb}.dd i{color:#777;font-style:normal}
#toolbar{display:flex;flex-wrap:wrap;background:#f5f6f8;border-bottom:1px solid #b9c0c9;padding:2px}
.grp{display:flex;flex-wrap:wrap;align-items:center;border-right:1px solid #ccd;padding:0 4px;gap:1px}.grp b{width:100%;font-size:10px;color:#557;text-transform:uppercase}
button{font:inherit;background:#fff;border:1px solid #c5ccd5;border-radius:3px;padding:2px 6px;cursor:pointer}button:hover{background:#e3effc}button.on{background:#2b7de9;color:#fff;border-color:#1b5fb8}
#tabs{display:flex;background:#cfd6df;gap:2px;padding:2px 4px 0}#tabs .tab{padding:4px 10px;background:#e8ecf1;border-radius:4px 4px 0 0;cursor:pointer}#tabs .tab.on{background:#fff;font-weight:600}#tabs .tab i{margin-left:6px;color:#a00;font-style:normal}
#main{flex:1;display:flex;min-height:0}
.panel{background:#fafbfc;border:1px solid #b9c0c9;display:flex;flex-direction:column}
.ptabs{display:flex;gap:2px;background:#dfe4ea;padding:2px;align-items:center}.ptabs span{padding:3px 8px;cursor:pointer}.ptabs span.on{background:#fff;font-weight:600}
#left{width:200px}#right{width:230px}
#thumbbar{display:flex;flex-wrap:wrap;gap:2px;padding:3px}#thumbbar button{padding:1px 4px;font-size:11px}
#thumbs,#flags{flex:1;overflow:auto;padding:4px}
.thumb{margin:4px auto;text-align:center;border:2px solid transparent;padding:3px;cursor:pointer;position:relative;width:170px}.thumb canvas{max-width:150px;box-shadow:0 1px 4px #0004;background:#fff}
.thumb.cur{border-color:#2b7de9}.thumb.sel{background:#cfe3fb}.thumb.dragover{border-top:3px solid #e33}.thumb .fl{position:absolute;right:6px;top:4px;color:#e22;font-size:16px}
.flagrow{padding:6px;border-bottom:1px solid #ddd;cursor:pointer;display:flex;justify-content:space-between}.flagrow:hover{background:#e3effc}
#view{flex:1;position:relative;overflow:hidden;background:#7d8590}#stage{position:absolute;left:0;top:0;transform-origin:0 0}
#pdfc{display:block;background:#fff;box-shadow:0 2px 12px #0007}#ovl{position:absolute;left:0;top:0}
#empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px}
#props{padding:6px;overflow:auto}#props label{display:flex;justify-content:space-between;align-items:center;margin:4px 0;gap:6px}#props input,#props select,#props textarea{width:120px;font:inherit}#props textarea{width:100%;height:60px}
#props .meas{background:#eef5ff;padding:6px;border-radius:4px;font-weight:600;margin:6px 0}
#bottom{height:170px}#bottom .ptabs button{margin-left:10px}#mlist{overflow:auto;flex:1}
#mlist table{border-collapse:collapse;width:100%}#mlist th{position:sticky;top:0;background:#eef1f5;text-align:left}#mlist td,#mlist th{border-bottom:1px solid #e1e4e8;padding:2px 6px;white-space:nowrap}#mlist tr.sel{background:#cfe3fb}#mlist tr{cursor:pointer}
.sw{display:inline-block;width:14px;height:10px;border:1px solid #555;vertical-align:middle}
#status{display:flex;align-items:center;gap:12px;background:#1d2b3a;color:#dfe7f0;padding:2px 8px;height:26px}#status .sp{flex:1}#status button{padding:0 6px;background:#2f4660;color:#fff;border-color:#456}
#modal{position:fixed;inset:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:100}#modal .box{background:#fff;min-width:340px;max-width:520px;border-radius:6px;padding:12px 16px;box-shadow:0 6px 30px #0008}
#modal h3{margin:0 0 10px}#modal label{display:flex;justify-content:space-between;margin:6px 0;gap:10px;align-items:center}#modal input,#modal select{width:200px}#modal textarea{width:100%;height:90px}#modal .btns{text-align:right;margin-top:10px}#modal .hint{color:#666;font-size:11px}
#toast{position:fixed;bottom:40px;left:50%;transform:translateX(-50%);background:#222d;color:#fff;padding:8px 14px;border-radius:4px;display:none;z-index:200}

/* --- Revu-like skin --- */
body{background:#d6dbe1}
#menubar{background:#f3f3f3;color:#111;border-bottom:1px solid #c9c9c9;height:26px}
.brand{color:#c8102e;font-weight:700}
.menu:hover{background:#cce4f7}.menu .dd{top:26px;border:1px solid #a0a0a0;box-shadow:2px 2px 4px #0003;padding:2px 0;min-width:230px}
.dd a{padding:4px 10px 4px 28px}.dd a:hover{background:#91c9f7}.dd hr{border:0;border-top:1px solid #ddd;margin:3px 2px 3px 26px}
#toolbar{background:linear-gradient(#fbfbfb,#ebedf0);padding:2px 4px;gap:2px}
.grp{border-right:1px solid #c6cbd2;padding:0 5px}.grp b{font-weight:600;font-size:9.5px;color:#6a7480;letter-spacing:.3px}
#toolbar button{background:transparent;border:1px solid transparent;padding:2px 5px;border-radius:2px;font-size:11.5px}
#toolbar button:hover{background:#e5f1fb;border-color:#7eb4ea}#toolbar button.on{background:#cce4f7;border-color:#3a8fd9;color:#000}
#tabs{background:#bfc7d1}#tabs .tab.on{border-top:2px solid #c8102e}
.ptabs{background:#e9ecef;border-bottom:1px solid #c6cbd2}.ptabs span.on{border-bottom:2px solid #c8102e;background:#fff}
#view{background:#808891}
#status{background:#f3f3f3;color:#222;border-top:1px solid #c6cbd2}#status button{background:#fff;color:#222;border-color:#bbb}
.chesthd{display:flex;gap:4px;padding:4px}.chesthd input{flex:1;font:inherit}
#chestWrap{display:flex;flex-direction:column;flex:1;min-height:0}#chestWrap[hidden]{display:none}#chest{overflow:auto;flex:1}
.chestrow{padding:3px 6px;cursor:pointer;border-bottom:1px solid #eee;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chestrow:hover{background:#e5f1fb}.chestrow.on{background:#cce4f7;font-weight:600}.chestrow i{color:#888;font-size:10px}
#mlist tr.mlgrp td{background:#e8edf3;font-weight:600}#mlist tr.tot td{background:#dfe8f5;font-weight:700;border-top:2px solid #789}
body.nol #left,body.nor #right,body.nob #bottom{display:none}
[hidden]{display:none!important}
.brand{color:#111!important;display:flex;align-items:center;gap:5px}.logo{background:#111;color:#fff;border-radius:3px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;font-size:12px}

/* v2 right panel: Measurements + Tool Chest */
#right{width:310px;display:flex;flex-direction:column;font-size:11.5px}
#rMeas{flex:1;display:flex;flex-direction:column;min-height:0}
#rMeas[hidden]{display:none!important}
#measPanel{flex:0 1 auto;max-height:58%;display:flex;flex-direction:column;border-bottom:3px solid #c8c8c8;min-height:0}
.mscroll{overflow:auto;min-height:0}
.phead{background:linear-gradient(#f4f4f4,#e2e2e2);border-bottom:1px solid #bcbcbc;padding:3px 6px;font-weight:600;display:flex;align-items:center;justify-content:space-between}
.phead .dd{border:1px solid transparent;background:none;cursor:pointer}
.mtools{display:flex;flex-wrap:wrap;gap:1px;padding:3px;background:#f0f0f0;border-bottom:1px solid #d0d0d0}
.mtb{display:inline-flex;border:1px solid transparent;border-radius:2px}
.mtb:hover{border-color:#a8c4e0;background:#e8f1fb}.mtb.on{border-color:#5b9bd5;background:#cfe3f7}
.mtb button,.mtools .more{border:0;background:none;padding:2px 2px;cursor:pointer;color:#222;display:flex;align-items:center}
.mtb .dd,.mtools .more{font-size:8px;padding:0 1px;color:#555}
.sec .sh{background:#e6e6e6;border-bottom:1px solid #cfcfcf;border-top:1px solid #f8f8f8;padding:2px 6px;cursor:pointer;font-weight:600;user-select:none}
.sec .sb{padding:4px 6px;background:#fafafa}
.fr{display:flex;align-items:center;gap:4px;margin:2px 0;min-height:20px}
.fr>label:first-child{width:62px;color:#333;flex:none;text-align:right}
.fr .rb{display:flex;align-items:center;gap:2px;width:auto;text-align:left}
.fr input,.fr select{height:19px;font-size:11px;border:1px solid #b5b5b5;border-radius:1px;padding:0 3px;background:#fff}
.fr .grow{flex:1;min-width:0}.fr .num{width:46px}
.fr button{height:20px;font-size:11px;border:1px solid #b5b5b5;background:linear-gradient(#fdfdfd,#e9e9e9);border-radius:2px;padding:0 5px;cursor:pointer;display:inline-flex;align-items:center;gap:3px}
.fr button.on{background:#cfe3f7;border-color:#5b9bd5}
.fr .pn{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fr .cur{color:#1565c0;font-weight:600}
.sb .note{font-size:10.5px;color:#7a5b00;background:#fff6d6;border:1px solid #ecd98c;padding:1px 4px;margin-bottom:3px}
.sb .val{margin-top:3px;padding:2px 4px;background:#eef5ee;border:1px solid #c5dcc5;font-weight:600}
.vpt{width:100%;border-collapse:collapse;margin-top:3px}.vpt th{background:#ececec;text-align:left;font-weight:600;border:1px solid #d6d6d6;padding:1px 3px}
.vpt td{border:1px solid #e0e0e0;padding:1px 3px}.vpt tr[data-vp]{cursor:pointer}.vpt tr.on td{background:#cfe3f7}
.vpt button{border:0;background:none;cursor:pointer;padding:0 2px}
#tcPanel{flex:1;display:flex;flex-direction:column;min-height:0}
.tcsearch{padding:3px;border-bottom:1px solid #d6d6d6;background:#f3f3f3}.tcsearch input{width:100%;box-sizing:border-box;height:20px;font-size:11px;border:1px solid #b5b5b5;padding:0 4px}
#tcBody{flex:1;overflow:auto;background:#fff}
.tch{display:flex;align-items:center;gap:4px;background:linear-gradient(#efefef,#dedede);border-bottom:1px solid #c4c4c4;padding:2px 4px;cursor:pointer;font-weight:600;user-select:none}
.tch .tn{flex:1}.tch .tcnt{color:#777;font-weight:400;font-size:10px}.tch .gear{border:0;background:none;cursor:pointer;font-size:12px;color:#555;padding:0 2px}
.tch .gear:hover{color:#000;background:#d6e6f5}
.tct{width:100%;border-collapse:collapse;table-layout:fixed}
.tct th{background:#f2f2f2;font-weight:normal;color:#444;text-align:left;border-bottom:1px solid #ddd;border-right:1px solid #e4e4e4;padding:1px 3px;font-size:10.5px}
.tct td{padding:1px 3px;border-bottom:1px solid #f0f0f0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:18px}
.tcrow{cursor:pointer}.tcrow:hover td{background:#e8f1fb}.tcrow.on td{background:#cfe3f7}.tcrow.drag{opacity:.4}
.dropb td,.tch.dropb{box-shadow:inset 0 2px 0 #1e73be}
.popmenu{position:fixed;z-index:9999;background:#fff;border:1px solid #999;box-shadow:2px 3px 8px rgba(0,0,0,.25);padding:2px 0;min-width:170px;font-size:12px}
.popmenu a{display:flex;align-items:center;gap:6px;padding:3px 18px 3px 6px;cursor:default;white-space:pre}.popmenu a:hover{background:#cfe3f7}
.popmenu a.dis{color:#999}.popmenu a.dis:hover{background:none}.popmenu a i{margin-left:auto;font-style:normal;color:#777;padding-left:16px}
.popmenu .pi{width:14px}.popmenu hr{border:0;border-top:1px solid #ddd;margin:2px 0}
#right .ptabs span{cursor:pointer}

.menu.open{background:#cce4f7}.menu.open .dd{display:block}
#stHint{color:#245;margin-left:12px;max-width:520px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#stHint.warn{color:#c00;font-weight:600}
#view.flash{animation:bbflash .45s}@keyframes bbflash{0%{box-shadow:inset 0 0 0 4px #e33}100%{box-shadow:inset 0 0 0 4px transparent}}
.menu.nohover:not(.open) .dd{display:none!important}

/* v8 render layers */
#stage{background:#fff;box-shadow:0 1px 6px rgba(0,0,0,.35)}#stage canvas.base{position:absolute;left:0;top:0;width:100%;height:100%;image-rendering:auto}
#stage canvas.detail{position:absolute}#ovl{position:absolute;left:0;top:0;pointer-events:none;z-index:2;will-change:transform}
/* ===== v8 docks ===== */
#left,#right{width:auto}#bottom{height:auto}
.dock{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:#fafbfc;border:0}
#left.dock,#right.dock{flex:none}#bottom.dock{flex:none}
.dtabs{display:flex;align-items:stretch;background:#e9ecef;border-bottom:1px solid #c6cbd2;min-height:24px;user-select:none;flex:none}
.dtab{padding:4px 10px;cursor:pointer;white-space:nowrap;border-right:1px solid #d3d8de;font-size:11.5px}
.dtab:hover{background:#f6f8fa}.dtab.on{background:#fff;font-weight:600;box-shadow:inset 0 -2px #c8102e}.dtab.popped{font-style:italic;color:#555}
.dsp{flex:1}.dbtn{border:0;background:none;padding:0 6px;cursor:pointer;color:#444;font-size:11px}.dbtn:hover{background:#d8e8fb}
.dbody{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.pnl{flex:1;min-height:0;display:flex;flex-direction:column;overflow:auto}.pnl[hidden]{display:none!important}
#pnl-thumbs{overflow:hidden}#pnl-thumbs #thumbs{flex:1;overflow:auto}#pnl-meas{overflow:auto}#pnl-props{overflow:auto}
#pnl-markups{overflow:hidden}#pnl-markups #mlist{flex:1;overflow:auto}
.mltools{display:flex;gap:8px;align-items:center;padding:2px 6px;background:#f3f4f6;border-bottom:1px solid #d3d8de;flex:none}.mltools .sp{flex:1}
.dock.col .dbody{display:none}
#left.dock.col,#right.dock.col{width:26px!important}#left.dock.col .dtabs,#right.dock.col .dtabs{writing-mode:vertical-rl;flex-direction:column;height:100%;border-bottom:0}
#left.dock.col .dbtn:not([data-dk=col]),#right.dock.col .dbtn:not([data-dk=col]){display:none}
.dock.empty{display:none}body.dockdrag .dock.empty{display:flex;width:90px;min-height:60px;outline:2px dashed #7eb4ea;outline-offset:-4px}
body.dockdrag .dock.empty .dbody::before{content:'Drop panel here';margin:auto;color:#3a8fd9}
.dock.dropover{outline:2px solid #3a8fd9;outline-offset:-2px;background:#eaf3fd}
.split{flex:none;background:#c9cfd6;z-index:3}.split.sv{width:4px;cursor:col-resize}.split.sh{height:4px;cursor:row-resize}.split:hover,.split.drag{background:#3a8fd9}
body.splitting{user-select:none}body.splitting #view{pointer-events:none}
body.nol #left,body.nol .split[data-sp=left],body.nor #right,body.nor .split[data-sp=right],body.nob #bottom,body.nob .split[data-sp=bottom]{display:none}
.dock.empty+.split[data-sp=left],.split[data-sp=right]:has(+.dock.empty),.split[data-sp=bottom]:has(+.dock.empty){display:none}
#popHold{position:fixed;left:-20000px;top:0;width:900px;height:600px;overflow:hidden;visibility:hidden}
.popph{margin:auto;text-align:center;color:#555;padding:20px}.popph button{margin:4px}
#mlist th[data-c]{cursor:pointer;position:sticky;top:0;background:#e9ecef;z-index:1;resize:horizontal;overflow:hidden}
#mlist th.asc::after{content:' ▲';font-size:9px;color:#3a8fd9}#mlist th.desc::after{content:' ▼';font-size:9px;color:#3a8fd9}
#mlist tr.mlfilt td{padding:1px;background:#f6f7f9}#mlist tr.mlfilt input{width:100%;box-sizing:border-box;font-size:11px;border:1px solid #ccd;padding:1px 3px;min-width:40px}
/* toolbar icons */
#toolbar button{display:inline-flex;align-items:center;gap:3px}#toolbar button .ico{flex:none;color:#1f4e79}#toolbar button.on .ico{color:#c8102e}
/* properties toolbar */
#propbar{display:flex;align-items:center;gap:10px;padding:2px 8px;background:#f7f8fa;border-bottom:1px solid #c6cbd2;font-size:11.5px;min-height:24px}
#propbar label{display:inline-flex;align-items:center;gap:4px}#propbar input[type=color]{width:26px;height:18px;padding:0;border:1px solid #999}#propbar input[type=range]{width:80px}
#propbar output{width:32px;font-variant-numeric:tabular-nums}#propbar .pbl{font-weight:600;color:#1f4e79}#propbar .pbn{color:#666;flex:1;text-align:right}
#propbar.off label,#propbar.off button{opacity:.45;pointer-events:none}
#status #stUnits{color:#1f4e79}
/* menus: one drop-down at a time */
#menubar:has(.menu.open) .menu:not(.open) .dd{display:none!important}
#main>.dock{position:relative;z-index:2}#view{min-width:0;overflow:hidden}
.dock.col .dbtn[data-dk=col]{order:-1;padding:6px 0}.dock.col .dsp{display:none}#left.dock.col .dtab,#right.dock.col .dtab{border-right:0;border-bottom:1px solid #d3d8de;padding:8px 4px}
/* ===== v9 ===== */
/* compact chrome */
body.compact #menubar{height:22px;font-size:12px}body.compact .menu{padding:3px 8px}body.compact .menu .dd{top:22px}
body.compact #toolbar{padding:1px 2px;gap:0;flex-wrap:wrap;align-items:center}
body.compact #toolbar .grp{display:flex;align-items:center;padding:0 3px;border-right:1px solid #d0d4da;margin:0}
body.compact:not(.tblabels) #toolbar .grp>b{display:none}
body.compact:not(.tblabels) #toolbar button .lbl{display:none}
body.compact #toolbar button{padding:2px 3px;min-width:24px;height:24px;justify-content:center}
body.compact #status{height:20px;font-size:11px;padding:0 6px;gap:8px}body.compact #status button{padding:0 5px;height:17px;font-size:11px}
body.compact #tabs{font-size:11px}body.compact .dtabs{min-height:20px}body.compact .dtab{padding:2px 7px}
#status .tg{background:#fff;border:1px solid #bbb;border-radius:2px;color:#777}#status .tg.on{background:#cce4f7;border-color:#3a8fd9;color:#000}
#propbar.inline{border:0;background:none;margin-left:auto;min-height:0;padding:0 4px;gap:7px;font-size:11px;flex-wrap:nowrap}
#propbar.inline .pbl{display:none}#propbar.inline .pbn{max-width:150px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:none}#propbar.inline input[type=range]{width:56px}
#propbar select{font-size:11px;max-width:120px}
.dtab{display:inline-flex;align-items:center;gap:4px}.dtab .tico{flex:none;color:#1f4e79}
#left.dock.col .dtab .tt,#right.dock.col .dtab .tt{display:none}#left.dock.col .dtab,#right.dock.col .dtab{padding:7px 5px;justify-content:center}
#left.dock.col,#right.dock.col{width:24px!important}#left.dock.col .dtabs,#right.dock.col .dtabs{writing-mode:horizontal-tb}
/* maximise canvas */
body.maxcanvas #menubar,body.maxcanvas #toolbar,body.maxcanvas #tabs,body.maxcanvas .dock,body.maxcanvas .split{display:none!important}
#maxBtn{display:inline-flex;align-items:center}body.maxcanvas #maxBtn{background:#cce4f7!important}
/* thumbnails reflow into columns */
#thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));align-content:start;gap:2px}#thumbs .thumb{width:auto;margin:2px}
/* meas / tool chest splitter */
#mtSplit{height:5px;cursor:row-resize;flex:none}#rMeas #measPanel{border-bottom:0}
/* markups list */
#mlist input.depthin{width:56px;border:1px solid transparent;background:transparent;font:inherit;padding:0 2px;text-align:right}
#mlist input.depthin:hover{border-color:#bbb;background:#fff}#mlist input.depthin:focus{border-color:#3a8fd9;background:#fff;outline:0}
.mltools .popbtn{font-weight:600;color:#1f4e79;border:1px solid #3a8fd9;background:#eaf3fd}
#popZone{display:none;position:fixed;top:40px;left:50%;transform:translateX(-50%);z-index:90;padding:12px 26px;background:#eaf3fd;border:2px dashed #3a8fd9;color:#1f4e79;font-weight:600;border-radius:6px}
body.dockdrag #popZone{display:block}#popZone.over{background:#cce4f7}
/* colour palette */
.palette{position:fixed;z-index:200;background:#fff;border:1px solid #999;box-shadow:2px 3px 10px #0004;padding:6px;width:188px;font-size:11px}
.palette .pgrid{display:grid;grid-template-columns:repeat(10,1fr);gap:2px}.palette .sw2{width:16px;height:16px;border:1px solid #888;padding:0;cursor:pointer}
.palette .sw2:hover{outline:2px solid #3a8fd9}.palette .sw2.on{outline:2px solid #000}.palette .plbl{margin:5px 0 2px;color:#555}
.palette .pmore{display:flex;gap:3px;margin-top:6px}.palette .phex{width:70px;font:11px monospace}
#mtSplit.mtsp{height:5px;cursor:row-resize}
/* ===================== v10 theme: neutral greys + Revu blue accent ===================== */
:root{--bg:#eef0f3;--panel:#f7f8fa;--line:#d3d8de;--line2:#c3c9d1;--text:#1f2329;--muted:#6b7480;--acc:#1f6fd1;--acc2:#e3eefb;--acc3:#cfe2f8;--hov:#e6ebf1}
body{font:12px/1.35 "Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;color:var(--text);background:var(--bg)}
button,select,input,textarea{font:inherit;color:inherit}
button{background:#fff;border:1px solid var(--line2);border-radius:3px;padding:2px 7px;cursor:pointer}button:hover{background:var(--hov);border-color:#aab3bf}button:active{background:var(--acc3)}
input,select,textarea{border:1px solid var(--line2);border-radius:3px;background:#fff;padding:1px 4px}input:focus,select:focus,textarea:focus{outline:0;border-color:var(--acc);box-shadow:0 0 0 2px #1f6fd122}
/* menu bar */
#menubar{background:#fff;border-bottom:1px solid var(--line);height:24px}.menu{border-radius:3px}.menu:hover,.menu.open{background:var(--acc2)}
.menu .dd{border:1px solid var(--line2);border-radius:4px;box-shadow:0 6px 18px #0002;padding:4px 0}.dd a{padding:5px 14px;border-radius:0}.dd a:hover{background:var(--acc2)}.dd hr{border:0;border-top:1px solid var(--line);margin:4px 0}
/* toolbar sections */
#toolbar{display:flex;flex-wrap:wrap;align-items:stretch;gap:0;background:#fff;border-bottom:1px solid var(--line);padding:2px 4px 1px}
#toolbar.nowrap{flex-wrap:nowrap!important;overflow:hidden}
#toolbar .seg{display:flex;flex-direction:column;align-items:stretch;padding:0 6px;margin:0;border-right:1px solid var(--line);flex:none}
#toolbar .seg:last-child{border-right:0}
#toolbar .seg .gbody{display:flex;align-items:center;gap:1px;height:26px}
#toolbar .seg .gcap{font-size:9.5px;line-height:11px;text-align:center;color:var(--muted);letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;user-select:none}
#toolbar .seg-measure .gcap{color:#1f6fd1}#toolbar .seg-markup .gcap{color:#b0452a}#toolbar .seg-sketchtoscale .gcap{color:#2c7a4b}
#toolbar .seg-measure{background:linear-gradient(#fff 60%,#f3f8ff)}#toolbar .seg-markup{background:linear-gradient(#fff 60%,#fff6f3)}#toolbar .seg-sketchtoscale{background:linear-gradient(#fff 60%,#f2faf5)}
#toolbar .gbody>button{border:1px solid transparent;background:transparent;border-radius:4px;height:24px;min-width:25px;padding:0 3px;display:inline-flex;align-items:center;justify-content:center;gap:3px}
#toolbar .gbody>button:hover{background:var(--hov);border-color:var(--line2)}
#toolbar .gbody>button.on,#toolbar .gbody>button.active{background:var(--acc3);border-color:#8fb5e6;box-shadow:inset 0 0 0 1px #8fb5e6}
#toolbar .gbody>button.ovf,#toolbar .seg.allovf{display:none}
#toolbar .gbody>button svg.ico{width:17px;height:17px}
body.compact:not(.tblabels) #toolbar .gbody>button .lbl{display:none}
body.tblabels #toolbar .gbody>button{padding:0 5px}
#tbMore{font-weight:700;font-size:14px}
/* sub bar = document tabs + properties toolbar */
#subbar{display:flex;align-items:stretch;background:var(--panel);border-bottom:1px solid var(--line);min-height:25px}
#subbar #tabs{flex:1;min-width:0;background:transparent;padding:2px 4px 0;overflow:hidden}
#tabs .tab{background:#e7eaee;border:1px solid var(--line);border-bottom:0;border-radius:4px 4px 0 0;padding:3px 10px;font-size:11.5px}#tabs .tab.on{background:#fff;border-top:2px solid var(--acc);font-weight:600}
#propbar.sub{border:0;background:transparent;margin-left:auto;padding:0 8px;gap:8px;font-size:11.5px;flex:none;min-height:0;flex-wrap:nowrap;max-width:62%;overflow:hidden}
#propbar.sub .pbl{display:none}#propbar.sub .pbn{max-width:180px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--muted)}#propbar.sub input[type=range]{width:56px}
#propbar.off{opacity:.55}
/* docks / panels */
.dock{background:var(--panel)}.dtabs{background:#eceff3;border-bottom:1px solid var(--line)}.dtab{color:#3b4350;border-radius:3px 3px 0 0;font-size:11.5px}.dtab.on{background:#fff;color:var(--text);box-shadow:inset 0 2px 0 var(--acc);font-weight:600}
.split{background:var(--line)}.split:hover,.split.drag{background:var(--acc)}
#status{background:#fff;border-top:1px solid var(--line);color:#3b4350}#status button{border-radius:3px}
#status .tg.on{background:var(--acc3);border-color:#8fb5e6;color:#0d3f7a}
/* markups list */
.mltools{display:flex;align-items:center;gap:4px;flex-wrap:wrap;padding:2px 4px;background:var(--panel);border-bottom:1px solid var(--line)}.mltools .mlsep{flex:1}
.mltools #mlPgBtn,.mltools #mlGbBtn,.mltools #mlColBtn{max-width:240px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#mlist table{border-collapse:collapse;font-size:11.5px}#mlist th{background:#eef1f5;border:1px solid var(--line);font-weight:600;color:#333;position:sticky;top:0;z-index:1}
#mlist td{border-bottom:1px solid #eceff2;border-right:1px solid #f1f3f5}#mlist tr[data-id]:hover{background:#f3f7fd}
#mlist tr.sel,#mlist tr.sel:hover{background:var(--acc3)!important;box-shadow:inset 3px 0 0 var(--acc)}
#mlist tr.mlgrp{background:#eaf0f8!important;font-weight:600;cursor:pointer}#mlist tr.mlgrp.lv1{background:#f2f6fb!important}#mlist tr.mlgrp.lv2{background:#f7f9fc!important}
#mlist tr.mlgrp td{white-space:nowrap}#mlist .gcnt{color:var(--muted);font-weight:400;margin-left:6px}
#mlist tr.mltot{background:#dfe6ef;font-weight:700}
/* popup menus */
.v10pop{position:fixed;z-index:210;background:#fff;border:1px solid var(--line2);border-radius:5px;box-shadow:0 8px 24px #0003;padding:4px 0;min-width:180px;max-height:70vh;overflow:auto;font-size:12px}
.v10pop .ph{padding:4px 12px;color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.04em}
.v10pop .mi{display:flex;align-items:center;gap:7px;padding:4px 12px;cursor:pointer;white-space:nowrap}.v10pop .mi:hover{background:var(--acc2)}.v10pop .mi.on{background:var(--acc3)}
.v10pop .mi i{margin-left:auto;color:var(--muted);font-style:normal;font-size:10.5px}.v10pop hr{border:0;border-top:1px solid var(--line);margin:4px 0}.v10pop .gord{margin-left:auto;background:var(--acc);color:#fff;border-radius:8px;padding:0 6px;font-size:10px}
.v10pop.dashpop .mi{gap:10px}.v10pop .dsvg{color:#222;flex:none}
/* line style dropdown */
select.dashsel{display:none!important}
.dashbtn{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 6px;background:#fff;border:1px solid var(--line2);border-radius:3px;color:#222}.dashbtn .dcar{font-size:9px;color:var(--muted)}.dashbtn .dmix{color:var(--muted);font-style:italic;width:110px;text-align:left}
/* properties: mixed values */
#props input.mixed,#measPanel input.mixed{background:repeating-linear-gradient(135deg,#fff,#fff 6px,#f4f6f9 6px,#f4f6f9 12px)}#props .mixtag{color:var(--muted);font-size:10.5px}
#props .hint{color:var(--muted);font-size:11px;margin:4px 0 6px}
/* Bluebeam-style colour picker */
.palette.bbpal{width:auto;padding:8px;border-radius:5px;border-color:var(--line2);box-shadow:0 8px 24px #0003}
.palette .pgrid.g8{display:grid;grid-template-columns:repeat(8,18px);gap:3px}
.palette.bbpal .sw2{width:18px;height:18px;border:1px solid #9aa3ad;border-radius:2px}.palette.bbpal .sw2.empty{background:#fff;border:1px dashed #c8ced6;cursor:default}
.palette.bbpal .sw2:hover{outline:2px solid var(--acc);outline-offset:0}.palette.bbpal .sw2.on{outline:2px solid #000;outline-offset:1px}
.palette.bbpal .plbl{font-size:10.5px;color:var(--muted);margin:7px 0 3px;text-transform:uppercase;letter-spacing:.04em}.palette.bbpal .plbl:first-child{margin-top:0}
.palette.bbpal .pmore{display:flex;align-items:center;gap:6px;margin-top:6px}.palette.bbpal .pcur{width:26px;height:20px;border:1px solid #888;border-radius:2px}
.palette.bbpal .phex{width:72px}.palette.bbpal .prgb input{width:44px;margin-left:2px}.palette.bbpal .pbtns{justify-content:flex-end}
/* dialogs */
#modal{background:#1d26304d}#modal .box{border-radius:8px;border:1px solid var(--line2);box-shadow:0 18px 50px #0004;padding:14px 18px}#modal h3{font-size:14px;font-weight:600;border-bottom:1px solid var(--line);padding-bottom:8px}
#modal .btns button:last-child{background:var(--acc);color:#fff;border-color:var(--acc)}
#toast,.toast{border-radius:5px}
/* tool chest */
.tch{background:#eef1f5;border-bottom:1px solid var(--line)}.tct th{background:#f4f6f8;font-weight:600}
/* ===== v11 ===== */
#mqbox{position:fixed;border:1px solid #2b7de9;background:rgba(43,125,233,.10);pointer-events:none;z-index:60}
#mqbox.cross{border-style:dashed;background:rgba(40,170,80,.10);border-color:#2a9d4a}
#mlist tr.sel td{background:#cfe3ff!important;box-shadow:inset 0 1px #2b7de9,inset 0 -1px #2b7de9}
#mlist tr.mlgrp td{font-weight:600;background:#eef2f7}
#mlist tr.mltot.top td{font-weight:700;background:#fff7d6;border-bottom:1px solid #d9c46a}
#mlist th[draggable]{cursor:grab}#mlist th.dragging{opacity:.5}#mlist th.dropL{box-shadow:inset 3px 0 #2b7de9}#mlist th.dropR{box-shadow:inset -3px 0 #2b7de9}
.mlfb{width:100%;font-size:11px;padding:1px 4px;text-align:left;background:#fff;border:1px solid #c9ced6;border-radius:3px;color:#666;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.mlfb.on{background:#e3efff;border-color:#2b7de9;color:#0b4fa8;font-weight:600}
.fpop{min-width:220px}.fpop .fsearch{width:calc(100% - 12px);margin:4px 6px;padding:3px}.fpop .flist{max-height:260px;overflow:auto;border-top:1px solid #eee;border-bottom:1px solid #eee}
.fpop .fbtns{display:flex;justify-content:flex-end;gap:6px;padding:6px}.fpop .fbtns .pri{background:#2b7de9;color:#fff;border:1px solid #1f63c0}
.v11blk{margin-top:6px;border-top:1px solid #e3e6ea;padding-top:4px}.v11r{display:flex;align-items:center;gap:6px;margin:3px 0;font-size:12px}.v11r>span{min-width:86px;color:#444}
.v11b{display:inline-flex;align-items:center;gap:5px;padding:1px 6px;border:1px solid #c9ced6;background:#fff;border-radius:3px;cursor:pointer;font-size:12px}
.v11blk.inl{display:inline-flex;gap:8px;border:0;margin:0 0 0 8px;padding:0;flex-wrap:nowrap}.v11blk.inl .v11r{margin:0}.v11blk.inl .v11r>span{min-width:0}.v11blk.inl .defrow i{display:none}
.defrow button{font-size:11px;padding:2px 6px}.defon{color:#0b7a3b;font-size:11px}
.patsw{display:inline-block;width:22px;height:14px;border:1px solid #888;vertical-align:middle}
.pgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:4px;max-width:330px}.pcell{display:flex;align-items:center;gap:5px;padding:3px;border:1px solid transparent;border-radius:3px;cursor:pointer;font-size:11px}.pcell:hover{border-color:#2b7de9;background:#eef5ff}
.lesvg{vertical-align:middle;color:#222}.lei{display:flex!important;align-items:center;gap:6px}
.multibanner{background:#fff4d6;border:1px solid #e3c76a;padding:4px 6px;margin:4px 0;font-size:12px;border-radius:3px}
input.mixed::placeholder{color:#b06000;font-style:italic}
#pflags{padding:4px;overflow:auto;height:100%;box-sizing:border-box}.pfbar{display:flex;gap:4px;margin-bottom:4px}.pfbar button{flex:0 0 auto}.pfsearch{flex:1;min-width:40px}
.pfrow{display:flex;align-items:center;gap:5px;padding:4px;border-bottom:1px solid #eee;cursor:pointer;font-size:12px}.pfrow:hover{background:#eef5ff}.pfrow.cur{background:#dcebff}
.pfi{color:#d9480f}.pfn{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pfp{color:#777;font-size:11px}.pfrow button{border:0;background:none;cursor:pointer;padding:0 3px;color:#555}
.pfhint{color:#666;font-size:12px;padding:6px}
.menu .dd a.chk::before{content:'✓';display:inline-block;width:1.3em;color:#0b7a3b;visibility:hidden}.menu .dd a.chk.on::before{visibility:visible}.menu .dd a.chk{justify-content:flex-start}

/* ===== v11 item 14: "Mission" dark theme (default). body.th-light = v10 look ===== */
body.th-dark{--bg:#0b0c0e;--panel:#141518;--line:#2a2d33;--line2:#3a3e45;--text:#e8eaed;--muted:#8b919a;--acc:#3e8bff;--acc2:#1a2433;--acc3:#22324a;--hov:#1d2025;
 background:#0b0c0e;color:#e8eaed;font-family:Inter,"Segoe UI Variable","Segoe UI",-apple-system,"Helvetica Neue",Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}
body.th-dark :is(#menubar,#toolbar,#propbar,#subbar,#status,#tabs,#thumbbar,.dock,.panel,.pnl,.dbody,.phead,.dtabs,.ptabs,.mltools,.mtools,.mtb,.chesthd,#tcPanel,#tcBody,#measPanel,#props,#mlist,#thumbs,#flags,#pflags,#left,#right,#bottom,#chestWrap,.sec,.grp){background:#111214 !important;color:#e8eaed !important;border-color:#26292e !important;box-shadow:none !important}
body.th-dark #menubar{background:#000 !important;border-bottom:1px solid #1f2226 !important}
body.th-dark .brand{color:#fff !important;letter-spacing:.32em;text-transform:uppercase;font-weight:600}
body.th-dark :is(#menubar .menu>span,#menubar .menu,.dtab,.ptabs>*,.phead,.chesthd,.sec>h4,.sec h4,th,.tch,label.sm,.fr>label){letter-spacing:.08em;text-transform:uppercase;font-size:11px}
body.th-dark :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,#modal>div,#modal .box,.palette,.toast,#toast){background:#16181b !important;color:#e8eaed !important;border:1px solid #2e3238 !important;box-shadow:0 12px 32px #000a !important;border-radius:4px}
body.th-dark :is(.dd a,.popmenu a,.popmenu div):hover{background:#22262c !important;color:#fff !important}
body.th-dark #view{background:#1a1b1e !important}
body.th-dark #stage,body.th-dark #pdfc{background:#fff}
body.th-dark :is(button:not(.sw2):not([data-col]),select,input:not([type=color]),textarea,.dropb,.dashbtn,.mlfb){background:#0e0f11 !important;color:#e8eaed !important;border:1px solid #33373e !important;border-radius:3px;box-shadow:none !important}
body.th-dark :is(button,.dropb,.mlfb):hover{border-color:#5a606a !important;background:#1b1e22 !important}
body.th-dark :is(#toolbar,#propbar) :is(button,.tb){background:transparent !important;border-color:transparent !important}
body.th-dark :is(#toolbar,#propbar) :is(button,.tb):hover{background:#1d2025 !important;border-color:#33373e !important}
body.th-dark :is(#toolbar button.on,#toolbar button.active,#toolbar .on,.dtab.on,.dtab.active,.ptabs .on){background:#1a2433 !important;border-color:#3e8bff !important;color:#fff !important;box-shadow:inset 0 -2px 0 #3e8bff !important}
body.th-dark :is(#toolbar,#propbar,.mtb,.mltools) :is(svg,img){filter:none}
body.th-dark :is(#toolbar,.mtb,.mltools,#tbMore) img{filter:invert(.92) grayscale(1)}
body.th-dark svg:not(.lesvg):not(.patsw svg) [stroke="#222"],body.th-dark svg [stroke="#333"],body.th-dark svg [stroke="#000"]{stroke:#d8dbe0}
body.th-dark :is(#toolbar,.mtb,.mltools,#tbMore) svg{color:#d8dbe0;stroke:currentColor}
body.th-dark table{background:#111214;color:#e3e5e8}
body.th-dark :is(th,tr.mlhead th){background:#0b0c0e !important;color:#8b919a !important;border-color:#26292e !important;font-weight:500}
body.th-dark td{border-color:#1f2226 !important}
body.th-dark tr:hover td{background:#191c20}
body.th-dark tr.sel td,body.th-dark tr.sel{background:#1a2a44 !important;color:#fff !important}
body.th-dark :is(tr.grp td,tr.mlgrp td,.grp){background:#15171a !important;color:#cfd3d9 !important}
body.th-dark :is(tr.mltot td,tr.mltot){background:#0f1a28 !important;color:#9cc4ff !important;font-weight:600}
body.th-dark .thumb{background:#1a1b1e !important;border:1px solid #2a2d33 !important;color:#b9bec6}
body.th-dark .thumb.on,body.th-dark .thumb.sel,body.th-dark .thumb.active{border-color:#3e8bff !important}
body.th-dark .thumb canvas{background:#fff}
body.th-dark .sw,body.th-dark .patsw,body.th-dark .pgrid>*{border-color:#4a4f57 !important}
body.th-dark :is(.lesvg,.pgrid canvas,.pgrid svg){background:#f2f3f5 !important;border-radius:2px}
body.th-dark ::-webkit-scrollbar{width:9px;height:9px;background:#0b0c0e}
body.th-dark ::-webkit-scrollbar-thumb{background:#2c3036;border-radius:5px}
body.th-dark :is(a,.pfi){color:inherit}
body.th-dark .multibanner{background:#2a2110 !important;color:#ffcf70 !important;border-color:#5a4520 !important}
body.th-dark #status{color:#8b919a !important;font-size:11px;letter-spacing:.05em}
body.th-dark #mqbox{border-color:#3e8bff;background:#3e8bff22}
body.th-dark hr{border:0;border-top:1px solid #2a2d33}
body.th-dark #modal{background:#000b}
body.th-dark .gcap{color:#6f7680 !important;letter-spacing:.14em}
body.th-dark #tabs .tab{background:#111214 !important;color:#9aa0a8 !important;border-color:#26292e !important}
body.th-dark #tabs .tab.on{color:#fff !important;border-top:2px solid #3e8bff !important;background:#1a1b1e !important}
body.th-dark .ptabs span.on{background:transparent !important;border-bottom:2px solid #3e8bff;color:#fff}
body.th-dark #toolbar button.on .ico{color:#3e8bff}
body.th-dark #toolbar .ico{color:#d8dbe0}
body.th-dark.popwin{background:#111214 !important}
body.th-dark #pophead{background:#000 !important;color:#e8eaed !important;border-color:#26292e !important;letter-spacing:.08em;text-transform:uppercase}
/* ===== v11 item 15: animations ===== */
#toolbar{position:relative}
#tbHi{position:absolute;left:0;top:0;pointer-events:none;border-radius:5px;opacity:0;z-index:0;background:linear-gradient(#ffffff22,#ffffff08);border:1px solid #ffffff2a;box-shadow:0 0 12px #3e8bff40;transition:transform .16s cubic-bezier(.3,.7,.3,1),width .16s,height .16s,opacity .15s;will-change:transform}
body.th-light #tbHi{background:linear-gradient(#1f6fd11a,#1f6fd108);border-color:#1f6fd140;box-shadow:none}
#tbHi.on{opacity:1}
#toolbar button{position:relative;z-index:1}
#toolbar button .ico{transition:transform .15s ease,filter .15s ease;will-change:transform}
#toolbar button:hover .ico{transform:translateY(-1px) scale(1.12);filter:drop-shadow(0 0 3px #7fb4ff99)}
#toolbar button:active .ico{transform:scale(.94)}
#toolbar button.on::after{content:"";position:absolute;left:18%;right:18%;bottom:0;height:2px;border-radius:2px;background:var(--acc,#3e8bff);transform-origin:center;animation:bbUl .22s ease-out}
@keyframes bbUl{from{transform:scaleX(0);opacity:.2}to{transform:scaleX(1);opacity:1}}
#toolbar button.bbpulse .ico{animation:bbPulse .32s ease-out}
@keyframes bbPulse{0%{transform:scale(1)}40%{transform:scale(1.22)}100%{transform:scale(1)}}
#bbTip{position:fixed;z-index:99999;pointer-events:none;padding:4px 8px;border-radius:4px;font-size:11px;letter-spacing:.04em;background:#0b0c0eee;color:#e8eaed;border:1px solid #2e3238;opacity:0;transform:translateY(-3px);transition:opacity .15s,transform .15s;white-space:nowrap}
body.th-light #bbTip{background:#1f2329ee}
#bbTip.on{opacity:1;transform:none}
.dd,.popmenu,.v10pop,.v11pop,.fpop{animation:bbFade .14s ease-out}
#modal>div,#modal .box{animation:bbFade .16s ease-out}
.dbody,.panel{animation:bbFade .18s ease-out}
@keyframes bbFade{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
:is(button,.dtab,.dd a,.mlfb,tr td){transition:background-color .12s,border-color .12s,color .12s}
body.noanim *,body.noanim *::before,body.noanim *::after{animation:none !important;transition:none !important}
body.noanim #tbHi{display:none}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none !important;transition:none !important}#tbHi{display:none}}
/* ===== v12 alpha: Auto Takeoff review list ===== */
:is(#atPanel,#aiPanel){position:fixed;right:14px;top:96px;width:470px;max-height:70vh;display:flex;flex-direction:column;z-index:900;background:#14161a;color:#e8eaed;border:1px solid #2e3238;border-radius:6px;box-shadow:0 14px 40px #000b;font-size:12px;animation:bbFade .16s ease-out}
body.th-light :is(#atPanel,#aiPanel){background:#fff;color:#1f2329;border-color:#c6cbd2;box-shadow:0 10px 30px #0003}
:is(#atPanel,#aiPanel) .athd{display:flex;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid #2a2d33;letter-spacing:.14em}
:is(#atPanel,#aiPanel) .athd .atk{flex:1;letter-spacing:.04em;opacity:.75}
.atbeta{display:inline-block;padding:1px 6px;border-radius:9px;background:#ff8a1f;color:#111;font-size:9.5px;font-weight:700;letter-spacing:.12em}
:is(#atPanel,#aiPanel) .atnote{padding:6px 10px;opacity:.75;font-size:11px;line-height:1.35}
:is(#atPanel,#aiPanel) .atbody{overflow:auto;flex:1}
:is(#atPanel,#aiPanel) table{width:100%;border-collapse:collapse}
:is(#atPanel,#aiPanel) th{position:sticky;top:0;text-align:left;font-weight:500;font-size:10.5px;text-transform:uppercase;letter-spacing:.08em;padding:4px 6px}
:is(#atPanel,#aiPanel) td{padding:2px 4px;border-top:1px solid #23262b}
:is(#atPanel,#aiPanel) tr.hi td{background:#10314a}
body.th-light :is(#atPanel,#aiPanel) tr.hi td{background:#e3effc}
:is(#atPanel,#aiPanel) .atsub{width:180px}:is(#atPanel,#aiPanel) .atdep{width:48px}
:is(#atPanel,#aiPanel) .atq{white-space:nowrap;opacity:.85;font-variant-numeric:tabular-nums}
:is(#atPanel,#aiPanel) .atbtn button{padding:0 6px;margin-left:2px}
:is(#atPanel,#aiPanel) .atft{display:flex;gap:6px;justify-content:flex-end;padding:8px 10px;border-top:1px solid #2a2d33}
body.atregion #stage{cursor:crosshair}

/* ===== v13 items 5/6/10: menus click-only, opaque, above everything, scroll if tall; dark-theme popup fixes ===== */
#menubar{position:relative;z-index:2000}
.menu .dd{max-height:calc(100vh - 40px);overflow-y:auto;z-index:2001}
.menu:not(.open) .dd{display:none !important}
body.th-dark{color-scheme:dark}
body.th-dark option{background:#16181b;color:#e8eaed}
body.th-dark :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,.palette,#palette,.dashpop){background:#16181b !important;opacity:1}
body.th-dark .sw2{border:1px solid #4a4f57 !important;box-shadow:none !important}
body.th-dark .sw2.on{outline:2px solid #3e8bff;outline-offset:1px}
body.th-dark .sw2:hover{outline:1px solid #fff}
body.th-dark .patsw{border:1px solid #4a4f57 !important}
body.th-dark input[type=color]{background:#0e0f11 !important;border:1px solid #33373e !important;border-radius:3px}
body.th-dark #props .meas,body.th-dark #measPanel .meas{background:#1a2433 !important;color:#e8eaed !important;border:1px solid #22324a}
body.th-dark .dashpop .dsvg,body.th-dark .dashbtn .dsvg{color:#e8eaed}
body.th-dark .dashpop a.on,body.th-dark .v11pop .pcell.on,body.th-dark .pcell.on{background:#1a2433 !important;outline:1px solid #3e8bff}
body.th-dark :is(.v11r span,.v11r>span){color:#cfd3d9 !important;opacity:1 !important}
body.th-dark .plbl,body.th-dark .ph{color:#8b919a !important}
/* ===== v13 item 7: group subtotal rows get their own colour (blue band), TOTAL row stays amber ===== */
#mlist tr.mlgrp td{background:#dcebfd !important;color:#0b3d7a !important;font-weight:600}
#mlist tr.mlgrp.lv0 td:first-child{box-shadow:inset 3px 0 0 #2b7de9}
#mlist tr.mlgrp.lv1 td{background:#ecf4fe !important}#mlist tr.mlgrp.lv2 td{background:#f5f9ff !important}
#mlist tr.mltot.top td{background:#fff3c4 !important;color:#5a4300 !important;font-weight:700;border-bottom:2px solid #d9b74a}
body.th-dark #mlist tr.mlgrp td{background:#11253d !important;color:#cfe3ff !important}
body.th-dark #mlist tr.mlgrp.lv0 td:first-child{box-shadow:inset 3px 0 0 #3e8bff}
body.th-dark #mlist tr.mlgrp.lv1 td{background:#0e1c2e !important}body.th-dark #mlist tr.mlgrp.lv2 td{background:#0c1724 !important}
body.th-dark #mlist tr.mltot.top td{background:#2a2110 !important;color:#ffcf70 !important;border-bottom:2px solid #6b5420}
/* ===== item 8: column drag feedback ===== */
#mlist th[data-c],#mirror th[data-c]{cursor:grab;user-select:none}
body.mlcoldrag,body.mlcoldrag *{cursor:grabbing !important}
th.dragging{opacity:.45}
th.dropL{box-shadow:inset 3px 0 0 #2b7de9 !important}th.dropR{box-shadow:inset -3px 0 0 #2b7de9 !important}
/* ===== item 9: flags "+" ===== */
.pfbar .pfplus{font-weight:700;font-size:15px;line-height:1;min-width:26px;color:#0b7a3b}.pfbar .pfplus.on{color:#c40000}
/* ===== item 12: current page thumbnail highlight in every theme ===== */
.thumb.cur{border-color:#2b7de9 !important;box-shadow:0 0 0 2px #2b7de955;background:#e3effc}
body.th-dark .thumb.cur{border:2px solid #3e8bff !important;background:#13233a !important;box-shadow:0 0 0 2px #3e8bff44}

/* ===== v13 item 11: Apple theme (body.th-light.th-apple) ===== */
body.th-apple{--acc:#007aff;--acc2:#007aff1a;--acc3:#007aff33;--line:#d2d2d7;--line2:#c7c7cc;--muted:#86868b;--text:#1d1d1f;
 font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Helvetica Neue",system-ui,"Segoe UI",Roboto,Arial,sans-serif;font-size:12.5px;
 background:#f5f5f7;color:#1d1d1f;-webkit-font-smoothing:antialiased;letter-spacing:-.01em}
body.th-apple :is(#menubar,#toolbar,#propbar,#tabs,#status,#subbar){background:rgba(246,246,248,.78) !important;-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);border-color:rgba(0,0,0,.1) !important;color:#1d1d1f}
body.th-apple #menubar{height:26px;border-bottom:.5px solid rgba(0,0,0,.14) !important}
body.th-apple .brand{color:#1d1d1f;font-weight:600;letter-spacing:0}
body.th-apple .menu{border-radius:5px;padding:3px 9px;margin:0 1px;font-weight:500}
body.th-apple .menu.open,body.th-apple .menu:hover{background:rgba(0,0,0,.08) !important}
body.th-apple :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,.palette,#palette,.dashpop){background:rgba(250,250,252,.96) !important;-webkit-backdrop-filter:saturate(180%) blur(24px);backdrop-filter:saturate(180%) blur(24px);
 border:.5px solid rgba(0,0,0,.18) !important;border-radius:10px !important;box-shadow:0 10px 32px rgba(0,0,0,.18),0 1px 3px rgba(0,0,0,.1) !important;padding:5px !important;color:#1d1d1f}
body.th-apple .dd a,body.th-apple .popmenu a{border-radius:5px;padding:4px 10px}
body.th-apple :is(.dd a,.popmenu a,.v10pop .mi,.dashpop a):hover{background:#007aff !important;color:#fff !important}
body.th-apple .dd a:hover i{color:#ffffffcc}
body.th-apple .menu .dd a.chk::before{color:#007aff}body.th-apple .menu .dd a.chk:hover::before{color:#fff}
body.th-apple .dd hr{border-top:.5px solid rgba(0,0,0,.12);margin:4px 8px}
body.th-apple button{border-radius:6px;border:.5px solid rgba(0,0,0,.18);background:#fff;box-shadow:0 .5px 1px rgba(0,0,0,.12);color:#1d1d1f;padding:2px 9px}
body.th-apple button:hover{background:#f5f5f7}
body.th-apple button.on{background:#007aff;border-color:#007aff;color:#fff}
body.th-apple :is(#toolbar,#propbar) button{background:transparent;border-color:transparent;box-shadow:none;border-radius:7px}
body.th-apple :is(#toolbar,#propbar) button:hover{background:rgba(0,0,0,.06)}
body.th-apple #toolbar button.on{background:rgba(0,122,255,.14) !important;color:#007aff;border-color:transparent}
body.th-apple #toolbar button.on::after{background:#007aff}
body.th-apple .grp{border-right:.5px solid rgba(0,0,0,.1)}
body.th-apple .gcap,body.th-apple .grp b{color:#86868b;text-transform:none;letter-spacing:0;font-weight:500}
body.th-apple :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea){border-radius:6px;border:.5px solid rgba(0,0,0,.2);background:#fff;padding:2px 6px;box-shadow:inset 0 .5px 1px rgba(0,0,0,.06)}
body.th-apple :is(input,select,textarea,button):focus-visible{outline:none;box-shadow:0 0 0 3px rgba(0,122,255,.35)}
body.th-apple input[type=checkbox],body.th-apple input[type=radio],body.th-apple input[type=range]{accent-color:#007aff}
body.th-apple .panel,body.th-apple .dock{background:#fbfbfd;border-color:rgba(0,0,0,.1)}
/* segmented controls: panel tabs and dock tabs */
body.th-apple :is(.dtabs,.ptabs){background:rgba(118,118,128,.12) !important;border-radius:8px;padding:2px;margin:4px;gap:2px;display:flex}
body.th-apple :is(.dtab,.ptabs>*){border-radius:6px !important;border:0 !important;background:transparent !important;color:#1d1d1f !important;text-transform:none;letter-spacing:0;font-weight:500;padding:2px 10px}
body.th-apple :is(.dtab.on,.dtab.active,.ptabs .on){background:#fff !important;box-shadow:0 1px 3px rgba(0,0,0,.14),0 0 0 .5px rgba(0,0,0,.06) !important;color:#1d1d1f !important}
body.th-apple #tabs .tab{border-radius:7px 7px 0 0;background:rgba(0,0,0,.04)}body.th-apple #tabs .tab.on{background:#fff;font-weight:600}
body.th-apple #modal>div,body.th-apple #modal .box{border-radius:12px !important;box-shadow:0 22px 60px rgba(0,0,0,.28) !important;border:.5px solid rgba(0,0,0,.15) !important;background:rgba(252,252,254,.98) !important}
body.th-apple #modal h3{font-weight:600;letter-spacing:-.01em}
body.th-apple #modal .ok,body.th-apple button.primary{background:#007aff;color:#fff;border-color:#007aff}
body.th-apple #mlist th{background:#f5f5f7;color:#6e6e73;font-weight:600;border-color:rgba(0,0,0,.08)}
body.th-apple #mlist tr.sel td{background:#007aff !important;color:#fff !important}
body.th-apple #mlist tr.mlgrp td{background:#e8f1fd !important;color:#0a4ea8 !important}
body.th-apple #mlist tr.mltot.top td{background:#fff4d6 !important;color:#6b4e00 !important}
body.th-apple .thumb{border-radius:10px}body.th-apple .thumb.cur{border-color:#007aff !important;box-shadow:0 0 0 3px rgba(0,122,255,.25);background:#eaf3ff}
body.th-apple #props .meas{background:#eaf3ff;border-radius:8px}
body.th-apple :is(#atPanel,#aiPanel){border-radius:12px;background:rgba(252,252,254,.97);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);box-shadow:0 18px 50px rgba(0,0,0,.22)}
body.th-apple ::-webkit-scrollbar{width:10px;height:10px}body.th-apple ::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:6px;border:2px solid transparent;background-clip:content-box}
/* SF-Symbols-like toolbar glyphs: monochrome, weight-matched; the active tool tints Apple blue */
body.th-apple #toolbar svg.i3 g{filter:none !important}
body.th-apple #toolbar svg.i3{filter:grayscale(1) brightness(.42) contrast(1.6)}
body.th-apple #toolbar button.on svg.i3{filter:grayscale(1) brightness(.5) sepia(1) hue-rotate(178deg) saturate(9) brightness(1.15)}
body.th-apple #tbHi{background:rgba(0,0,0,.05);border-color:transparent;box-shadow:none;border-radius:7px}
body.th-apple #bbTip{background:rgba(30,30,32,.88);border-radius:6px;border:0}
body.th-apple .toast,body.th-apple #toast{border-radius:10px}
body.th-dark #mlist tr.mlfilt td{background:#111214 !important}
.mlfnone{display:block;text-align:center;color:var(--muted,#888)}
/* ===== v14 ===== */
/* 1. dark theme: every popup list (menus, dropdowns, colour list, line styles, fill patterns, selects) is BRIGHT on the dark chrome */
html:root body.th-dark :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,.palette,.bbpal,#palette,.dashpop,.popwin .popph){background:#fff!important;color:#1d1f23!important;border:1px solid #c9cdd3!important;box-shadow:0 12px 32px #000c!important;color-scheme:light}
html:root body.th-dark :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,.palette,.bbpal,#palette,.dashpop) :is(a,div,span,label,i,b,h4,p,td,th,li){color:#1d1f23!important;background-color:transparent;border-color:#e1e4e8!important;text-shadow:none}
html:root body.th-dark :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,.palette,.bbpal,#palette,.dashpop) i{color:#6b7280!important}
html:root body.th-dark :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,.palette,.bbpal,#palette,.dashpop) :is(button:not(.sw2):not([data-col]),input:not([type=color]),select,textarea){background:#fff!important;color:#1d1f23!important;border:1px solid #c3c8cf!important}
html:root body.th-dark :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,.palette,.bbpal,#palette,.dashpop) :is(a,div,button,li):hover{background:#e8f0fe!important;color:#0b1220!important}
html:root body.th-dark :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,.palette,.bbpal,#palette,.dashpop) :is(.on,.sel,.dashsel,.active){background:#d2e3fc!important;color:#0b1220!important}
html:root body.th-dark :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,.palette,.bbpal,#palette,.dashpop) hr{border:0;border-top:1px solid #e1e4e8}
html:root body.th-dark :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,.palette,.bbpal,#palette,.dashpop) svg [stroke="#d8dbe0"]{stroke:#222}
html:root body.th-dark :is(.v10pop,.palette,.bbpal) :is(.lesvg,canvas,svg){background:#fff!important}
html:root body.th-dark select{color-scheme:light}
html:root body.th-dark select option,html body.th-dark select optgroup{background:#fff!important;color:#1d1f23!important}
/* 2. flags list current page row: readable in every theme */
.pfrow.cur{background:#dcebff!important;color:#0b1f3a!important;box-shadow:inset 3px 0 0 #1a73e8}
.pfrow.cur :is(.pfn,.pfp,.pfi){color:#0b1f3a!important}
html:root body.th-dark .pfrow.cur{background:#1f4f8f!important;color:#fff!important;box-shadow:inset 3px 0 0 #8fc0ff}
html:root body.th-dark .pfrow.cur :is(.pfn,.pfp,.pfi){color:#fff!important}
html:root body.th-dark .pfrow:not(.cur):hover{background:#1d2025!important}
html body.th-apple .pfrow.cur{background:#d6e8ff!important;color:#0b1f3a!important}
/* snap state in the status bar */
#stSnap .snapst{display:inline-block;font:600 10px/16px system-ui,sans-serif;letter-spacing:.08em;padding:0 7px;margin-right:6px;border-radius:8px;background:#e6e7ea;color:#555;border:1px solid #c9ccd1}
#stSnap .snapst.on{background:#1a73e8;color:#fff;border-color:#1a73e8}
html:root body.th-dark #stSnap .snapst{background:#22262c;color:#aab0b8;border-color:#3a3e45}
html:root body.th-dark #stSnap .snapst.on{background:#3e8bff;color:#fff;border-color:#3e8bff}
#stSnap.flash .snapst{animation:snapfl .9s ease-out}
@keyframes snapfl{0%{box-shadow:0 0 0 0 #ffb300;transform:scale(1.25)}100%{box-shadow:0 0 0 8px #ffb30000;transform:scale(1)}}
/* maximise canvas: keep a slim menu bar and a floating restore button */
body.maxcanvas #menubar{display:flex!important}
#maxRestore{display:none}
body.maxcanvas #maxRestore{display:inline-flex;position:fixed;right:16px;top:40px;z-index:150;align-items:center;gap:4px;padding:6px 12px;border-radius:16px;background:#1a73e8!important;color:#fff!important;border:0!important;box-shadow:0 4px 14px #0005!important;font:600 12px system-ui,sans-serif;cursor:pointer}
body.maxcanvas #maxRestore:hover{background:#1559b8!important}
/* Auto Takeoff: while drawing a CJ/PMJ line the review panel lets clicks through */
body.atregion :is(#atPanel,#aiPanel){pointer-events:none;opacity:.35}
/* ===== v15 ===== */
/* --- check-mark menu items: one aligned check column (all themes) --- */
.dd a.hasck{justify-content:flex-start}
.dd a.hasck>i,.dd a>i{margin-left:auto;padding-left:18px}
.dd a .ck{display:inline-block;flex:none;width:1.4em;font-size:0;line-height:1}
.dd a .ck::before{content:'✓';font-size:12px;visibility:hidden}
.dd a .ck.on::before{visibility:visible}
.menu .dd{min-width:250px}.menu .dd a{white-space:nowrap}

/* --- item 2: bigger ribbon icons + hit targets, all themes --- */
html #toolbar .seg{padding:0 6px}
html #toolbar .seg .gbody{height:40px;gap:2px}
html #toolbar .seg .gbody>button{height:38px;min-width:38px;padding:0 4px;border-radius:7px}
html #toolbar .seg .gbody>button svg.ico,html #toolbar .seg .gbody>button svg{width:28px;height:28px}
html #toolbar .seg .gcap{font-size:10px;line-height:13px;padding-bottom:1px}
html body.tblabels #toolbar .seg .gbody>button{padding:0 7px}
html #toolbar #tbMore{font-size:18px;min-width:38px}
.v10pop .mi.tbo svg{width:22px;height:22px;flex:none}

/* --- item 1: Apple theme rework (macOS / apple.com polish) --- */
html:root body.th-apple{--acc:#0071e3;--acc2:rgba(0,113,227,.10);--acc3:rgba(0,113,227,.18);--line:rgba(0,0,0,.10);--line2:rgba(0,0,0,.16);--muted:#86868b;--text:#1d1d1f;--hov:rgba(0,0,0,.05);
 font-family:-apple-system,BlinkMacSystemFont,'SF Pro Text','SF Pro Display','Helvetica Neue',system-ui,'Segoe UI',Roboto,sans-serif;font-size:13px;color:#1d1d1f;background:#f5f5f7;-webkit-font-smoothing:antialiased;letter-spacing:-.003em}
html:root body.th-apple :is(button,input,select,textarea){font-family:inherit;font-size:12px}
/* chrome: translucent vibrancy bars */
html:root body.th-apple :is(#menubar,#toolbar,#subbar,#propbar,#status){background:rgba(250,250,252,.72)!important;-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);color:#1d1d1f!important;border-color:rgba(0,0,0,.08)!important}
html:root body.th-apple #menubar{height:28px;padding:0 8px;gap:2px;border-bottom:.5px solid rgba(0,0,0,.12)!important}
html:root body.th-apple #menubar .brand{font-weight:600;margin-right:8px;color:#1d1d1f!important}
html:root body.th-apple .menu{padding:3px 10px;border-radius:6px;font-weight:500;font-size:13px;line-height:18px}
html:root body.th-apple .menu.open,html:root body.th-apple .menu:hover{background:rgba(0,0,0,.07)!important}
html:root body.th-apple #toolbar{padding:4px 8px 2px;border-bottom:.5px solid rgba(0,0,0,.10)!important}
html:root body.th-apple #toolbar .seg{background:none!important;border-right:.5px solid rgba(0,0,0,.10)}
html:root body.th-apple #toolbar .seg .gcap{color:#86868b!important;text-transform:none;letter-spacing:0;font-weight:500;font-size:10.5px}
html:root body.th-apple #toolbar .gbody>button{background:transparent!important;border:0!important;box-shadow:none!important}
html:root body.th-apple #toolbar .gbody>button:hover{background:rgba(0,0,0,.06)!important}
html:root body.th-apple #toolbar .gbody>button.on,html:root body.th-apple #toolbar .gbody>button.active{background:rgba(0,113,227,.14)!important;box-shadow:inset 0 0 0 .5px rgba(0,113,227,.35)!important}
html:root body.th-apple #toolbar button.on::after{display:none}
html:root body.th-apple #toolbar button:hover .ico{transform:none;filter:none}
html:root body.th-apple #tbHi{display:none}
html:root body.th-apple #subbar{border-bottom:.5px solid rgba(0,0,0,.10)!important;min-height:30px;align-items:center}
html:root body.th-apple #propbar{gap:8px;padding:0 8px;font-size:12px;flex-wrap:nowrap;overflow:hidden}
html:root body.th-apple #propbar>*{flex:none;white-space:nowrap}
html:root body.th-apple #status{height:26px;font-size:11.5px;color:#6e6e73!important;padding:0 10px;gap:14px}
html:root body.th-apple #status button{background:#fff!important;color:#1d1d1f!important;border:.5px solid rgba(0,0,0,.16)!important;border-radius:6px;height:20px;padding:0 8px}
html:root body.th-apple #status button.on,html:root body.th-apple #status button.tg.on{background:#0071e3!important;color:#fff!important;border-color:#0071e3!important}
html:root body.th-apple #stSnap .snapst{background:#e8e8ed;color:#6e6e73;border:0}
html:root body.th-apple #stSnap .snapst.on{background:#0071e3;color:#fff}
html:root body.th-apple #view{background:#e8e8ed!important}
/* menus / popups: rounded, translucent, separators, blue pill hover */
html:root body.th-apple :is(.dd,.popmenu,.fpop,.v10pop,.v11pop,.palette,.bbpal,#palette,.dashpop){background:rgba(252,252,254,.97)!important;-webkit-backdrop-filter:saturate(180%) blur(30px);backdrop-filter:saturate(180%) blur(30px);border:.5px solid rgba(0,0,0,.14)!important;border-radius:10px!important;box-shadow:0 10px 36px rgba(0,0,0,.18),0 0 0 .5px rgba(0,0,0,.04)!important;padding:5px!important;color:#1d1d1f!important}
html:root body.th-apple .menu .dd{top:26px;min-width:260px}
html:root body.th-apple :is(.dd a,.popmenu a,.v10pop .mi,.dashpop a){position:relative;border-radius:6px!important;padding:4px 12px 4px 24px!important;line-height:18px;font-size:13px;color:#1d1d1f;align-items:center;min-height:24px}
html:root body.th-apple :is(.dd a,.popmenu a,.v10pop .mi,.dashpop a):hover{background:#0071e3!important;color:#fff!important}
html:root body.th-apple :is(.dd a,.popmenu a,.v10pop .mi):hover :is(i,.ck::before,b){color:#ffffffcc!important}
html:root body.th-apple :is(.dd,.popmenu) a i{color:#86868b;font-style:normal;font-size:12px}
html:root body.th-apple .dd a .ck,html:root body.th-apple .menu .dd a.chk::before{position:absolute;left:8px;width:12px;color:#0071e3}
html:root body.th-apple .dd a .ck::before{font-size:12px;font-weight:600}
html:root body.th-apple .dd a:hover .ck::before,html:root body.th-apple .menu .dd a.chk:hover::before{color:#fff}
html:root body.th-apple :is(.dd,.popmenu,.v10pop) hr{border:0;border-top:.5px solid rgba(0,0,0,.12);margin:5px 10px}
html:root body.th-apple :is(.dd,.v10pop,.popmenu) :is(.pfhint,.ph){padding:4px 12px 2px 24px!important;font-size:11px;font-weight:600;color:#86868b!important;opacity:1!important;text-transform:none;letter-spacing:0}
html:root body.th-apple .v10pop .mi.on,html:root body.th-apple .dashpop .dashsel{background:rgba(0,113,227,.12)!important;color:#0071e3!important}
html:root body.th-apple .dashpop .mi{display:grid;grid-template-columns:110px 1fr;gap:12px;padding-left:12px!important}
html:root body.th-apple .dashpop .mi>*:last-child{text-align:left}
html:root body.th-apple .v11pop .pgrid{gap:2px;padding:4px;max-width:none;grid-template-columns:repeat(3,minmax(104px,1fr))}
html:root body.th-apple .pcell{border-radius:6px;padding:4px 6px;white-space:nowrap;font-size:12px}
html:root body.th-apple .pcell:hover{background:rgba(0,113,227,.10)}
html:root body.th-apple .pcell.on{background:rgba(0,113,227,.16);box-shadow:inset 0 0 0 1px #0071e3}
html:root body.th-apple .palette :is(.sw,[data-col]){border-radius:4px;border:.5px solid rgba(0,0,0,.18)!important}
html:root body.th-apple .palette button{border-radius:6px}
/* buttons, fields, focus rings */
html:root body.th-apple button:not([data-col]):not(.sw):not(.sw2):not(.pcell){background:#fff;color:#1d1d1f;border:.5px solid rgba(0,0,0,.16);border-radius:7px;box-shadow:0 .5px 1px rgba(0,0,0,.08);padding:3px 10px;min-height:22px}
html:root body.th-apple button:hover{background:#f5f5f7}
html:root body.th-apple :is(#modal .ok,button.primary,button.pri){background:#0071e3!important;color:#fff!important;border-color:#0071e3!important}
html:root body.th-apple :is(#modal .ok,button.primary,button.pri):hover{background:#0077ed!important}
html:root body.th-apple :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea){background:#fff;border:.5px solid rgba(0,0,0,.2);border-radius:6px;padding:3px 7px;box-shadow:inset 0 .5px 1px rgba(0,0,0,.06);color:#1d1d1f;min-height:22px}
html:root body.th-apple :is(input,select,textarea,button,a,[tabindex]):focus-visible{outline:none!important;box-shadow:0 0 0 3.5px rgba(0,113,227,.4)!important;border-color:#0071e3!important}
html:root body.th-apple :is(input[type=checkbox],input[type=radio],input[type=range]){accent-color:#0071e3}
/* dialogs */
html:root body.th-apple #modal{background:rgba(0,0,0,.18)!important;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
html:root body.th-apple #modal .box,html:root body.th-apple #modal>div{background:rgba(255,255,255,.94)!important;-webkit-backdrop-filter:saturate(180%) blur(30px);backdrop-filter:saturate(180%) blur(30px);border-radius:14px!important;border:.5px solid rgba(0,0,0,.12)!important;box-shadow:0 24px 70px rgba(0,0,0,.28)!important;padding:20px 22px 16px!important}
html:root body.th-apple #modal h3{font-size:15px;font-weight:600;border:0!important;padding:0 0 10px;margin:0;letter-spacing:-.01em}
html:root body.th-apple #modal :is(.btns,.mbtns,.row:last-child){display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
html:root body.th-apple #modal button{margin-left:8px;min-width:76px;height:26px}
html:root body.th-apple #modal :is(label,.fr){font-size:12.5px}
/* panels, docks, segmented tabs */
html:root body.th-apple :is(.dock,.panel,.dbody,#props,#measPanel,#thumbs,#pflags,#tcPanel,#tcBody,#mlist){background:#fbfbfd!important;color:#1d1d1f}
html:root body.th-apple :is(.phead,.chesthd,.mltools,.mtools){background:rgba(246,246,248,.9)!important;border-color:rgba(0,0,0,.08)!important}
html:root body.th-apple :is(.dtabs,.ptabs){background:rgba(118,118,128,.12)!important;border-radius:8px;padding:2px;margin:6px;gap:2px;display:flex;align-items:center}
html:root body.th-apple :is(.dtab,.ptabs>span){border-radius:6px!important;border:0!important;background:transparent!important;color:#1d1d1f!important;text-transform:none!important;letter-spacing:0!important;font-weight:500;font-size:12px;padding:3px 10px;line-height:16px}
html:root body.th-apple :is(.dtab.on,.dtab.active,.ptabs .on){background:#fff!important;box-shadow:0 1px 3px rgba(0,0,0,.12),0 0 0 .5px rgba(0,0,0,.06)!important}
html:root body.th-apple .sec .sh{background:transparent;border:0;border-top:.5px solid rgba(0,0,0,.08);font-weight:600;font-size:12px;padding:6px 8px;color:#1d1d1f}
html:root body.th-apple .sec .sb{background:transparent;padding:4px 8px 8px}
html:root body.th-apple #props{font-size:12.5px}
html:root body.th-apple #props .meas{background:#fff;border:.5px solid rgba(0,0,0,.08);border-radius:10px;padding:8px 10px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
html:root body.th-apple #props :is(label,.row){display:grid;grid-template-columns:42% 1fr;align-items:center;gap:8px;margin:0;padding:3px 0;min-height:26px}
html:root body.th-apple #props :is(label,.row)>:is(input,select,button,.dashbtn,textarea){width:100%;justify-self:stretch;box-sizing:border-box}
html:root body.th-apple #props :is(label,.row)>input[type=checkbox]{width:auto;justify-self:start}
html:root body.th-apple :is(#mlist,#mirror){font-size:12px}
html:root body.th-apple :is(#mlist,#mirror) th{background:#f5f5f7!important;color:#6e6e73!important;font-weight:600;border-color:rgba(0,0,0,.08)!important}
html:root body.th-apple :is(#mlist,#mirror) td{border-color:rgba(0,0,0,.05)!important}
html:root body.th-apple :is(#mlist,#mirror) tr.sel td{background:#0071e3!important;color:#fff!important}
html:root body.th-apple :is(#mlist,#mirror) tr.mlgrp td{background:#f0f5fd!important;color:#0a4ea8!important}
html:root body.th-apple :is(#mlist,#mirror) tr.mltot td{background:#fbf6e9!important;color:#6b4e00!important}
html:root body.th-apple .mlfb{border-radius:6px;border:.5px solid rgba(0,0,0,.16);background:#fff}
html:root body.th-apple .pfrow{border-radius:8px;margin:1px 6px;border-bottom:0;padding:5px 8px}
html:root body.th-apple .pfrow.cur{background:#0071e3!important;color:#fff!important;box-shadow:none}
html:root body.th-apple .pfrow.cur :is(.pfn,.pfp,.pfi,button){color:#fff!important}
html:root body.th-apple .thumb{border-radius:10px;border:2px solid transparent}
html:root body.th-apple .thumb.cur{border-color:#0071e3!important;box-shadow:0 0 0 3px rgba(0,113,227,.2);background:#eef5ff}
html:root body.th-apple #tabs .tab{border-radius:8px 8px 0 0;font-size:12px}
html:root body.th-apple :is(.toast,#toast){background:rgba(29,29,31,.86)!important;color:#fff!important;border-radius:12px!important;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border:0!important;padding:8px 16px}
html:root body.th-apple #maxRestore{background:#0071e3!important}
/* Auto Takeoff panel */
html:root body.th-apple :is(#atPanel,#aiPanel){background:rgba(252,252,254,.9)!important;color:#1d1d1f!important;-webkit-backdrop-filter:saturate(180%) blur(30px);backdrop-filter:saturate(180%) blur(30px);border:.5px solid rgba(0,0,0,.14)!important;border-radius:14px!important;box-shadow:0 20px 60px rgba(0,0,0,.22)!important;width:500px;overflow:hidden}
html:root body.th-apple :is(#atPanel,#aiPanel) .athd{letter-spacing:0;font-weight:600;font-size:13px;padding:12px 14px;border-color:rgba(0,0,0,.08)!important}
html:root body.th-apple :is(#atPanel,#aiPanel) .athd .atk{letter-spacing:0;font-weight:400;color:#6e6e73;opacity:1}
html:root body.th-apple .atbeta{background:#ff9f0a;color:#fff;letter-spacing:.02em;border-radius:5px;padding:1px 6px}
html:root body.th-apple :is(#atPanel,#aiPanel) .atnote{padding:8px 14px;color:#6e6e73;opacity:1;font-size:11.5px}
html:root body.th-apple :is(#atPanel,#aiPanel) th{text-transform:none;letter-spacing:0;font-size:11px;color:#6e6e73;font-weight:600;background:rgba(246,246,248,.96);padding:6px 6px;white-space:nowrap;border-bottom:.5px solid rgba(0,0,0,.08)}
html:root body.th-apple :is(#atPanel,#aiPanel) td{border-color:rgba(0,0,0,.06)!important;padding:4px 6px;vertical-align:middle}
html:root body.th-apple :is(#atPanel,#aiPanel) .atsub{width:170px}html:root body.th-apple :is(#atPanel,#aiPanel) .atdep{width:52px}
html:root body.th-apple :is(#atPanel,#aiPanel) .atbtn{white-space:nowrap;text-align:right}
html:root body.th-apple :is(#atPanel,#aiPanel) .atbtn button{min-width:24px;min-height:22px;padding:0 6px;margin-left:4px;border-radius:6px}
html:root body.th-apple :is(#atPanel,#aiPanel) tr.hi td{background:rgba(0,113,227,.10)!important}
html:root body.th-apple :is(#atPanel,#aiPanel) .atft{padding:10px 14px;gap:8px;border-color:rgba(0,0,0,.08)!important;flex-wrap:wrap}
html:root body.th-apple #modal .cancel{background:#fff!important;color:#1d1d1f!important;border:.5px solid rgba(0,0,0,.18)!important}
html:root body.th-apple #modal .cancel:hover{background:#f5f5f7!important}
html:root body.th-apple #props label>span{display:flex;align-items:center;gap:8px}
html:root body.th-apple #props label>span>input{width:auto}
html:root body.th-apple #props label>input[type=color]{width:60px;justify-self:start;height:22px;padding:1px 2px}
html:root body.th-apple #props label.chk{display:flex;align-items:center;gap:8px;padding-left:calc(42% + 8px)}
html:root body.th-apple .pfrow button{background:transparent!important;border:0!important;box-shadow:none!important;min-height:0;padding:0 4px}
html:root body.th-apple .palette.bbpal .sw2{border-radius:4px;border:.5px solid rgba(0,0,0,.2)}
html:root body.th-apple .palette.bbpal .plbl{text-transform:none;letter-spacing:0;font-weight:600;font-size:11px;color:#86868b}
html:root body.th-apple.popwin{background:#fbfbfd!important;font-family:-apple-system,BlinkMacSystemFont,'SF Pro Text','Helvetica Neue',system-ui,sans-serif}
html:root body.th-apple #pophead{background:rgba(246,246,248,.9)!important;border-bottom:.5px solid rgba(0,0,0,.1)!important;font:600 13px -apple-system,BlinkMacSystemFont,'SF Pro Text',system-ui,sans-serif!important;padding:6px 10px!important;color:#1d1d1f}
html:root body.th-apple #mirror :is(.mltools){background:rgba(246,246,248,.9)!important;gap:6px;padding:4px 8px}
/* v15 item 9: page scale under each thumbnail */
#thumbs .thumb .tsc{font-size:10.5px;line-height:14px;color:#2a6f2a;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;margin:0 auto}
#thumbs .thumb .tsc[data-k=none]{color:#8a8f98;font-style:italic}
#thumbs .thumb .tsc[data-k=multi]{color:#b26b00}
body.th-dark #thumbs .thumb .tsc{color:#7fd17f}body.th-dark #thumbs .thumb .tsc[data-k=none]{color:#7d838c}body.th-dark #thumbs .thumb .tsc[data-k=multi]{color:#ffb547}
body.th-apple #thumbs .thumb .tsc{color:#248a3d;font-size:11px}body.th-apple #thumbs .thumb .tsc[data-k=none]{color:#86868b}
/* v15 item 8: split view */
#splitwrap{flex:1;min-width:0;min-height:0;display:grid;gap:4px;background:#5b6068;padding:4px;box-sizing:border-box}
#splitwrap.m2v{grid-template-columns:1fr 1fr}#splitwrap.m2h{grid-template-rows:1fr 1fr}
#splitwrap.m3{grid-template-columns:1.4fr 1fr;grid-template-rows:1fr 1fr}#splitwrap.m3 .spane:first-child{grid-row:1/3}
#splitwrap.m4{grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr}
.spane{display:flex;flex-direction:column;min-width:0;min-height:0;border-radius:4px;overflow:hidden;outline:2px solid transparent;outline-offset:-2px;background:#7d8590}
.spane.act{outline:2px solid #0a84ff;box-shadow:0 0 0 2px rgba(10,132,255,.35)}
.sph{display:flex;align-items:center;gap:4px;height:28px;padding:0 6px;background:#eef0f3;border-bottom:1px solid #c6cbd2;font:12px "Segoe UI",system-ui,sans-serif;white-space:nowrap;overflow:hidden;flex:none}
.sph select{max-width:180px;height:22px}.sph button{height:22px;padding:0 7px}.sph .sppg{min-width:56px;text-align:center}.sph .spsc{color:#2a6f2a;font-size:11px;margin-left:6px}.sph .spflex{flex:1}
.spane.act .sph{background:#dcebff}.sph .spact{color:#0a66d0;font-weight:600;font-size:11px}
.spb{flex:1;position:relative;min-height:0;display:flex;overflow:hidden}.spb>#view{flex:1}.spcv{position:absolute;left:0;top:0;cursor:grab;touch-action:none}
.sppopd{margin:auto;color:#fff;text-align:center;font:13px system-ui,sans-serif;line-height:2}
body.spwin{margin:0;height:100vh;display:flex;flex-direction:column;background:#7d8590}body.spwin .spb{flex:1}
#tbSplit.on{background:rgba(10,132,255,.18)!important}
body.th-dark #splitwrap{background:#000}body.th-dark .sph{background:#16181b;border-color:#2a2d33;color:#e8eaed}body.th-dark .spane.act .sph{background:#10243d}body.th-dark .sph .spact{color:#5aa9ff}body.th-dark .sph .spsc{color:#7fd17f}body.th-dark .spane{background:#24272c}
body.th-apple #splitwrap{background:#d2d2d7;gap:6px;padding:6px}body.th-apple .spane{border-radius:10px}body.th-apple .spane.act{outline-color:#0071e3}body.th-apple .sph{background:rgba(246,246,248,.92);backdrop-filter:blur(20px);font:12px -apple-system,BlinkMacSystemFont,'SF Pro Text',system-ui,sans-serif;border-bottom:.5px solid rgba(0,0,0,.1)}body.th-apple .spane.act .sph{background:rgba(232,242,255,.95)}body.th-apple .sph .spact{color:#0071e3}
/* ===== v16 ===== */
/* 3. dark theme: closed <select>s (line width, line style, etc. in the properties bar) are bright like their open lists */
html:root body.th-dark select:not(#bbNoSuchId){background:#fff!important;color:#1d1f23!important;border:1px solid #c3c8cf!important;color-scheme:light}
/* 4. Apple theme: toolbar icons keep their own colours (no grey silhouette), so Area/Volume/Perimeter/Cutout read apart */
html:root body.th-apple #toolbar svg.i3{filter:saturate(.85)!important}
html:root body.th-apple #toolbar button.on svg.i3{filter:none!important}
html:root body.th-apple #toolbar button.on{background:rgba(0,122,255,.14)!important;box-shadow:inset 0 0 0 1px rgba(0,122,255,.45)}

/* v22 AI Sheet Check */
#aiPanel{z-index:61}
#aiPanel .aikv th{text-align:left;white-space:nowrap;vertical-align:top;width:86px}
#aiPanel .aisub{font-size:11px;opacity:.85;margin-top:3px}
#aiPanel select{font-size:11px;max-width:110px}
#aiPanel details{margin:6px 0}
#aiPanel code{font-size:11px}

#atPanel tr.atstage td{background:#2a2f3a;color:#9fd3ff;font-weight:700;font-size:11px;padding:4px 6px;letter-spacing:.3px}
#atPanel .atai{border-left:3px solid #19c37d;padding-left:6px}
