:root{--bg:#070a0e;--panel:#0d1218;--panel2:#101720;--line:#283341;--text:#edf2f7;--muted:#7d8998;--accent:#dfe8f2;--editor-font:14px;--header-bg:#090d12;--sidebar-bg:#0a0e13;--editor-bg:#080c11;--editor-text:#e8edf2;--input-bg:#090d12;--input-text:#f4f7fa;--input-border:#303b48;--focus-ring:#8191a5;--btn-bg:#10161d;--btn-text:#cbd5e1;--btn-border:#34404e;--primary-text:#071018;--primary-border:#ffffff;--tab-bg:#141b23;--tab-text:#8693a3;--tab-border:#2d3947;--tab-active-bg:#141b23;--tab-active-text:#ffffff;--tab-active-border:#718197;--tree-text:#aeb9c6;--tree-active-bg:#19212b;--tree-active-text:#ffffff;--tree-active-border:#536275;--pagetab-bg:#111820;--pagetab-text:#7f8b99;--pagetab-border:#293441;--pagetab-active-bg:#1b2430;--pagetab-active-text:#ffffff;--pagetab-active-border:#617186;--modal-bg:#0e141b;--modal-border:#3b4858;--modal-p-text:#a8b3c1;--label-text:#9aa7b6;--title-text:#ffffff;--msg-text:#ffb8c2;--banner-text:#9be7ad;--banner-border:#294a35;--shield-text:#dce7f2;--shield-border:#3c4b5d;--folder-title-text:#9eabba;--folder-count:#596675;--kind-text:#8ea0b3;--kind-border:#334252;--kb-lead-text:#d8e4ef;--kb-h3-text:#cbd8e5;--kb-p-text:#9eabb9;--kb-warn-text:#e4cba7;--kb-warn-border:#6b4c2d}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}button,input,textarea,select{font:inherit}button{cursor:pointer}body{min-height:100vh}.boot{position:fixed;inset:0;z-index:9999;background:#020504;color:#a7ffba;display:grid;place-items:center;transition:opacity .7s ease}.boot.fade{opacity:0}.terminal{width:min(720px,90vw);font-size:12px;line-height:2;text-shadow:0 0 10px #43ff7a33}.boot-brand{font-weight:800;letter-spacing:.12em;margin-bottom:14px}.cursor{animation:blink .8s infinite}@keyframes blink{50%{opacity:0}}.top{height:70px;padding:0 22px;border-bottom:1px solid var(--line);background:#090d12;display:flex;align-items:center;justify-content:space-between;gap:15px}.brand{font-weight:900;font-size:14px;letter-spacing:.14em}.sub{font-size:9px;color:var(--muted);margin-top:5px}.head-actions{display:flex;align-items:center;gap:7px}.status{font-size:9px;color:#9be7ad;border:1px solid #294a35;border-radius:99px;padding:7px 9px}.ghost,.primary,.danger,.tab{border-radius:7px;padding:9px 12px}.ghost{background:#10161d;color:#cbd5e1;border:1px solid #34404e}.primary{background:var(--accent);color:#071018;border:1px solid #fff}.danger{background:#251116;color:#ffb8c2;border:1px solid #69343e}.wide{width:100%;margin-top:8px}.panel{width:min(500px,calc(100% - 28px));margin:7vh auto 0;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:28px;box-shadow:0 30px 100px #0009}.security-banner{font-size:9px;color:#9be7ad;border:1px solid #294a35;padding:7px 9px;border-radius:7px;margin-bottom:16px;letter-spacing:.04em}.shield{width:44px;height:44px;display:grid;place-items:center;border:1px solid #3c4b5d;border-radius:12px;margin-bottom:18px;color:#dce7f2}.tabs{display:flex;gap:6px;margin-bottom:20px}.tab{flex:1;background:#141b23;color:#8693a3;border:1px solid #2d3947}.tab.active{color:#fff;border-color:#718197}.panel label,.modal-box label{display:block;color:#9aa7b6;font-size:10px;margin:14px 0}.panel input,.modal-box input,.modal-box select{display:block;width:100%;margin-top:7px;padding:12px;background:#090d12;color:#f4f7fa;border:1px solid #303b48;border-radius:7px;outline:none}.panel input:focus,.modal-box input:focus,.modal-box select:focus{border-color:#8191a5;box-shadow:0 0 0 2px #8191a522}.panel .primary{width:100%;margin-top:10px}.strength,.msg{min-height:22px;font-size:10px;margin-top:8px}.msg{color:#ffb8c2}.tiny{font-size:9px;color:var(--muted)}.vault{width:min(1500px,calc(100% - 24px));height:calc(100vh - 94px);min-height:520px;margin:12px auto;border:1px solid var(--line);border-radius:11px;overflow:hidden;background:var(--panel);display:grid;grid-template-columns:300px 1fr}.sidebar{background:#0a0e13;border-right:1px solid var(--line);padding:13px;overflow:auto}.filter{width:100%;padding:10px;margin:8px 0;background:#080c11;color:#eee;border:1px solid #303b48;border-radius:7px}.tree{display:flex;flex-direction:column;gap:10px}.folder-title{font-size:10px;color:#9eabba;padding:4px}.folder-title span{float:right;color:#596675}.tree-page{width:100%;text-align:left;background:#10161d;color:#aeb9c6;border:1px solid transparent;padding:9px;border-radius:7px;margin-top:4px}.tree-page.active{background:#19212b;color:#fff;border-color:#536275}.editor{min-width:0;display:flex;flex-direction:column}.tabsbar{display:flex;align-items:center;gap:6px;padding:7px 10px;border-bottom:1px solid var(--line);background:#0a0e13;overflow:hidden}.page-tabs{display:flex;gap:5px;overflow:auto;flex:1}.page-tab{white-space:nowrap;background:#111820;color:#7f8b99;border:1px solid #293441;padding:7px 10px;border-radius:6px}.page-tab.active{color:#fff;border-color:#617186;background:#1b2430}.editor-head{display:flex;align-items:center;gap:12px;padding:12px;border-bottom:1px solid var(--line)}.title{flex:1;min-width:0;border:0;background:transparent;color:#fff;font-size:17px;font-weight:800;padding:7px;outline:none}.actions{display:flex;align-items:center;gap:7px}.editor textarea{flex:1;min-height:0;width:100%;resize:none;border:0;border-radius:0;background:#080c11;color:#e8edf2;padding:24px;font-size:var(--editor-font);line-height:1.75;outline:none}.editor-foot{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;border-top:1px solid var(--line);gap:8px}.editor-foot select{background:#10161d;color:#cbd5e1;border:1px solid #303b48;padding:6px;border-radius:6px}.modal{position:fixed;inset:0;z-index:2000;background:#000c;display:grid;place-items:center;padding:18px}.modal-box{width:min(560px,100%);background:#0e141b;border:1px solid #3b4858;border-radius:12px;padding:23px;box-shadow:0 30px 100px #000}.modal-close{float:right;border:0;background:none;color:#aeb9c6;font-size:25px}.modal-box p{color:#a8b3c1;font-size:11px;line-height:1.7}.hidden{display:none!important}body[data-theme=paper]{--bg:#dfe3e8;--panel:#f7f9fb;--panel2:#fff;--line:#b8c0ca;--text:#15202b;--muted:#536170;--accent:#17212b}body[data-theme=paper] .top,body[data-theme=paper] .sidebar,body[data-theme=paper] .tabsbar{background:#e9edf1}body[data-theme=paper] .editor textarea{background:#fff;color:#17212b}body[data-theme=slate]{--bg:#10161d;--panel:#17202a;--panel2:#1b2632;--line:#354353;--text:#e9eef4;--muted:#9aa8b7;--accent:#d9e4ef}.compact .vault{height:calc(100vh - 90px)}.compact .editor textarea{padding:14px}@media(max-width:850px){.head-actions{flex-wrap:wrap}.head-actions .danger{padding:7px 9px}.security-banner{font-size:8px;line-height:1.5}.top{height:auto;min-height:64px;padding:10px 12px}.sub{max-width:230px;line-height:1.4}.head-actions .ghost{display:none}.status{display:none}.vault{width:100%;margin:0;border-radius:0;border-left:0;border-right:0;height:calc(100vh - 64px);grid-template-columns:1fr}.sidebar{display:none}.editor-head{padding:9px}.editor textarea{padding:14px}.editor-foot{font-size:9px}.actions .tiny{display:none}.panel{margin-top:5vh;padding:22px}.page-tabs{max-width:calc(100vw - 70px)}}

.secret-box{white-space:pre-wrap;display:none;background:#090c10;border:1px solid #303844;padding:16px;border-radius:7px}.secret-box.visible{display:block}.hidden{display:none!important}
/* v12 Secure Facility Designer + Notes workspace */
:root{--accent-custom:var(--accent);--ambient:0.18;--glow:0.22;--depth:1;--grid-opacity:0;--camera-zoom:1;--surface-radius:12px}
body{background-image:radial-gradient(circle at 50% -10%,rgba(120,170,255,var(--ambient)),transparent 45%),linear-gradient(rgba(255,255,255,var(--grid-opacity)) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,var(--grid-opacity)) 1px,transparent 1px);background-size:auto,32px 32px,32px 32px;background-attachment:fixed}
.top,.vault,.panel,.modal-box,.tree-page,.page-tab,.ghost,.primary,.danger,.filter{border-radius:var(--surface-radius)}
.top{box-shadow:0 12px 40px rgba(0,0,0,.22)}
.vault{transform:scale(var(--camera-zoom));transform-origin:center top;transition:transform .25s ease,box-shadow .25s ease;box-shadow:0 calc(24px * var(--depth)) calc(90px * var(--depth)) rgba(0,0,0,.34)}
.top:after{content:"";position:absolute;inset:0;pointer-events:none;opacity:var(--glow);background:linear-gradient(90deg,transparent,rgba(120,190,255,.08),transparent);mix-blend-mode:screen}
.top{position:relative}
.editor-tools{display:flex;align-items:center;gap:8px;padding:7px 12px;border-top:1px solid var(--line);background:rgba(8,12,17,.82);backdrop-filter:blur(8px)}
.editor-tools .tiny:nth-last-child(2){margin-left:auto}
.page-kind{font-size:8px;letter-spacing:.14em;color:#8ea0b3;border:1px solid #334252;padding:5px 7px;border-radius:5px;white-space:nowrap}
.focus-mode .sidebar,.focus-mode .tabsbar,.focus-mode .top,.focus-mode .editor-foot,.focus-mode .editor-tools{display:none}
.focus-mode .vault{width:100%;height:100vh;margin:0;border:0;border-radius:0;transform:none}
.focus-mode .editor-head{padding:18px 24px}
.focus-mode .editor textarea{padding:34px;max-width:1000px;margin:auto}
.note-drawer{position:fixed;right:18px;top:86px;bottom:18px;width:min(420px,calc(100vw - 36px));z-index:1800;background:var(--panel);border:1px solid var(--line);border-radius:14px;box-shadow:0 30px 90px #000b;display:flex;flex-direction:column;overflow:hidden}
.note-drawer-head{padding:14px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px}.note-auto{margin-left:auto}.note-list{padding:10px;overflow:auto;display:grid;gap:8px}.note-card{padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);cursor:pointer}.note-card strong{display:block;font-size:11px}.note-card span{display:block;font-size:9px;color:var(--muted);margin-top:5px}.designer-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.designer-section{border:1px solid var(--line);border-radius:9px;padding:12px;background:rgba(255,255,255,.02)}.designer-section h3{font-size:10px;margin:0 0 9px;letter-spacing:.08em}.designer-section label{margin:10px 0!important}.designer-section input[type=color]{height:40px;padding:3px}.range-row{display:grid;grid-template-columns:1fr 55px;gap:8px;align-items:center}.range-row output{font-size:9px;color:var(--muted);text-align:right}
@media(max-width:850px){.head-actions .ghost{display:inline-block}.head-actions #notesBtn,.head-actions #settingsBtn{display:none}.editor-tools{overflow:auto}.page-kind{display:none}.note-drawer{right:8px;top:72px;bottom:8px;width:calc(100vw - 16px)}.designer-grid{grid-template-columns:1fr}.focus-mode .editor textarea{padding:18px}}

/* v13 Security Knowledge Base */
.kb{max-height:min(72vh,760px);overflow:auto;padding-right:3px}.kb-lead{padding:13px 14px;border:1px solid #36506a;border-radius:9px;background:linear-gradient(135deg,rgba(94,164,255,.08),rgba(255,255,255,.02));color:#d8e4ef;font-size:11px;line-height:1.75;margin-bottom:12px}.kb-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.kb-grid section{border:1px solid var(--line);border-radius:9px;padding:12px;background:rgba(255,255,255,.018)}.kb-grid h3{font-size:9px;letter-spacing:.1em;margin:0 0 7px;color:#cbd8e5}.kb-grid p{margin:0;color:#9eabb9;font-size:10px;line-height:1.7}.kb-warning{margin-top:12px;border:1px solid #6b4c2d;background:rgba(122,83,35,.12);border-radius:9px;padding:12px;color:#e4cba7;font-size:10px;line-height:1.7}.boot .terminal{animation:terminalPulse 1.8s ease-in-out infinite alternate}.boot-brand:before{content:'● SECURE BOOT  ';color:#8df0a5}@keyframes terminalPulse{from{opacity:.84;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:850px){.kb-grid{grid-template-columns:1fr}.kb{max-height:76vh}.kb-grid p{font-size:10px}.kb-lead{font-size:10px}.modal{padding:9px}.modal-box{padding:16px}.modal-close{position:sticky;top:0;z-index:2}}

/* v15 PROPERTY DESIGNER + THEMES */
.property-modal{position:fixed;inset:3vh 2vw;z-index:10002;background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:0 30px 120px #000b;display:flex;flex-direction:column;overflow:hidden}
.property-modal.hidden{display:none}.property-head{padding:12px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px;justify-content:space-between;background:color-mix(in srgb,var(--panel) 88%,var(--accent))}
.property-title{font-weight:900;letter-spacing:.1em}.property-head-actions{display:flex;gap:7px;flex-wrap:wrap}
.property-workspace{display:grid;grid-template-columns:220px minmax(0,1fr) 250px;min-height:0;flex:1}
.property-tools,.property-inspector{padding:12px;border-right:1px solid var(--line);overflow:auto;background:color-mix(in srgb,var(--panel) 92%,black)}
.property-inspector{border-left:1px solid var(--line);border-right:0}.property-canvas-wrap{position:relative;overflow:auto;background:#e8ece9;display:flex;align-items:flex-start;justify-content:center;padding:22px}
.property-canvas{position:relative;width:1000px;height:700px;min-width:700px;background:#f7f8f4;border:1px solid #aab4ae;box-shadow:0 15px 45px #0003;transform-origin:top left}
.property-grid{position:absolute;inset:0;background-image:linear-gradient(#b7c0ba55 1px,transparent 1px),linear-gradient(90deg,#b7c0ba55 1px,transparent 1px);background-size:25px 25px;pointer-events:none}
.property-object{position:absolute;display:flex;align-items:center;justify-content:center;user-select:none;touch-action:none;cursor:move;border:2px solid #25352d;background:#e7ece8cc;color:#17241d;font:700 12px ui-monospace,SFMono-Regular,monospace;box-shadow:0 3px 8px #0002;overflow:hidden}
.property-object.selected{outline:3px solid #1677ff;outline-offset:2px;z-index:50}.property-object.wall{background:#cbd1cc;border-color:#5e675f}.property-object.window{background:#b8def0aa;border-color:#26718d}.property-object.door{background:#c7a47b;border-color:#79552f}.property-object.garage{background:#aeb6b0;border-color:#47524a}.property-object.sensor,.property-object.camera,.property-object.alarm,.property-object.security{background:#ffe9a8;border-color:#806a24;border-radius:50%}.property-object.room{background:#fffef888;border-style:dashed}.property-object.custom{background:#dfe5f0}/* v40.20: distinct fills for the expanded symbol library (backgrounds only — border is set inline per object) */.property-object.exit{background:#c9f2d4}.property-object.route{background:#ffe9a8}.property-object.stairs,.property-object.elevator{background:#e6e0d2}.property-object.refuge{background:#d7f0e0}.property-object.assembly{background:#fff3c4}.property-object.pathway{background:#d9e8f566;border-style:dashed}.property-object.hydrant{background:#ffd9d9}.property-object.panel{background:#ffe9a8}.property-object.toilet,.property-object.sink,.property-object.shower,.property-object.tub{background:#d9ecf5}.property-object.bed,.property-object.sofa,.property-object.chair{background:#efe6d8}.property-object.tree,.property-object.planter{background:#d9f0d9}.property-object.pool{background:#cde9f7}.property-object.shed{background:#e3ddd0}.property-object.outlet{background:#fff3c4}.property-object.lamp{background:#fff8d9}.property-object.keybox{background:#e8e4da}.property-object.ramp{background:#e6e0d2}.property-object.northrose{background:transparent;border-style:none}.property-label{padding:4px;text-align:center;pointer-events:none}.property-tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.property-tool{min-height:52px;background:var(--panel2);border:1px solid var(--line);color:var(--text);border-radius:8px;padding:6px;font-size:10px}.property-tool:hover{border-color:var(--accent)}.property-tool .ico{font-size:18px;display:block;margin-bottom:3px}
.property-section{border:1px solid var(--line);border-radius:9px;padding:9px;margin-bottom:10px}.property-section h3{font-size:9px;margin:0 0 8px;color:var(--muted);letter-spacing:.1em}.property-section label{display:block;font-size:9px;color:var(--muted);margin:7px 0}.property-section input,.property-section select{width:100%;padding:8px;border:1px solid var(--line);border-radius:6px;background:var(--bg);color:var(--text)}.property-status{font-size:9px;color:var(--muted);padding:7px 0}
.property-template-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}.property-template{padding:8px;background:var(--panel2);border:1px solid var(--line);border-radius:7px;color:var(--text);font-size:9px;text-align:left}
.property-mini{font-size:9px;color:var(--muted)}.property-3d{background:linear-gradient(135deg,#edf2ec 0 50%,#d7ded8 50%);perspective:700px}.property-3d .property-object{transform:skewY(-8deg) rotateX(8deg);box-shadow:8px 10px 0 #87938a55,0 12px 20px #0003}
.property-print-title{display:none}
@media(max-width:1000px){.property-workspace{grid-template-columns:170px minmax(0,1fr)}.property-inspector{display:none}.property-modal{inset:1vh 1vw}.property-canvas-wrap{padding:10px}}
@media(max-width:700px){.property-workspace{grid-template-columns:1fr}.property-tools{max-height:210px;border-right:0;border-bottom:1px solid var(--line)}.property-canvas-wrap{min-height:550px}}
/* v40.15: user-selectable environment themes. Every selectable theme defines the FULL
   variable set, so switching themes visibly re-skins the whole app with readable text.
   Default is Notebook (paper). 'custom' is derived in JS from the designer color pickers. */
body[data-theme="notebook"]{--bg:#e7dfc8;--panel:#f6f1e2;--panel2:#fffdf4;--line:#d3c8ab;--text:#26221a;--muted:#7d7460;--accent:#274c77;--header-bg:#ece4cd;--sidebar-bg:#ece4cd;--editor-bg:#fffdf4;--editor-text:#26221a;--input-bg:#fffdf4;--input-text:#26221a;--input-border:#c9bd9c;--focus-ring:#274c77;--btn-bg:#fffdf4;--btn-text:#3a352a;--btn-border:#c9bd9c;--primary-text:#ffffff;--primary-border:#274c77;--tab-bg:#efe8d3;--tab-text:#6b6350;--tab-border:#d3c8ab;--tab-active-bg:#fffdf4;--tab-active-text:#26221a;--tab-active-border:#a89a72;--tree-text:#4a4436;--tree-active-bg:#fffdf4;--tree-active-text:#26221a;--tree-active-border:#a89a72;--pagetab-bg:#efe8d3;--pagetab-text:#6b6350;--pagetab-border:#d3c8ab;--pagetab-active-bg:#fffdf4;--pagetab-active-text:#26221a;--pagetab-active-border:#a89a72;--modal-bg:#f6f1e2;--modal-border:#d3c8ab;--modal-p-text:#4a4436;--label-text:#6b6350;--title-text:#26221a;--msg-text:#a33327;--banner-text:#2f5d34;--banner-border:#9db89a;--shield-text:#3a352a;--shield-border:#c9bd9c;--folder-title-text:#6b6350;--folder-count:#8a8172;--kind-text:#6b6350;--kind-border:#c9bd9c;--kb-lead-text:#3a352a;--kb-h3-text:#3a352a;--kb-p-text:#4a4436;--kb-warn-text:#7a5a2e;--kb-warn-border:#c9a86a}
body[data-theme="forest"]{--bg:#132019;--panel:#1c2b23;--panel2:#24362c;--line:#3e5949;--text:#edf7ef;--muted:#a8c1ad;--accent:#c7f0cf;--header-bg:#15241b;--sidebar-bg:#172619;--editor-bg:#0f1a13;--editor-text:#eaf6ed;--input-bg:#15241b;--input-text:#eef7f0;--input-border:#3e5949;--focus-ring:#8fd0a0;--btn-bg:#1e2f25;--btn-text:#d5e8d9;--btn-border:#3e5949;--primary-text:#0e1a12;--primary-border:#c7f0cf;--tab-bg:#1a2a20;--tab-text:#a8c1ad;--tab-border:#3e5949;--tab-active-bg:#24362c;--tab-active-text:#ffffff;--tab-active-border:#7ba889;--tree-text:#c2d8c7;--tree-active-bg:#24362c;--tree-active-text:#ffffff;--tree-active-border:#5d8269;--pagetab-bg:#1a2a20;--pagetab-text:#a8c1ad;--pagetab-border:#3e5949;--pagetab-active-bg:#24362c;--pagetab-active-text:#ffffff;--pagetab-active-border:#5d8269;--modal-bg:#1c2b23;--modal-border:#3e5949;--modal-p-text:#b9cfbe;--label-text:#a8c1ad;--title-text:#ffffff;--msg-text:#ffb8c2;--banner-text:#9be7ad;--banner-border:#294a35;--shield-text:#d5e8d9;--shield-border:#3e5949;--folder-title-text:#a8c1ad;--folder-count:#6f8a76;--kind-text:#a8c1ad;--kind-border:#3e5949;--kb-lead-text:#d8e4ef;--kb-h3-text:#cbd8e5;--kb-p-text:#9eabb9;--kb-warn-text:#e4cba7;--kb-warn-border:#6b4c2d}
body[data-theme="professional"]{--bg:#eef2f5;--panel:#ffffff;--panel2:#f5f7f9;--line:#cbd5df;--text:#17212b;--muted:#5f6d7b;--accent:#173f67;--header-bg:#e3eaf0;--sidebar-bg:#e9eef3;--editor-bg:#ffffff;--editor-text:#17212b;--input-bg:#ffffff;--input-text:#17212b;--input-border:#cbd5df;--focus-ring:#173f67;--btn-bg:#f5f7f9;--btn-text:#2c3a48;--btn-border:#cbd5df;--primary-text:#ffffff;--primary-border:#173f67;--tab-bg:#e9eef3;--tab-text:#5f6d7b;--tab-border:#cbd5df;--tab-active-bg:#ffffff;--tab-active-text:#17212b;--tab-active-border:#173f67;--tree-text:#3c4a58;--tree-active-bg:#ffffff;--tree-active-text:#17212b;--tree-active-border:#173f67;--pagetab-bg:#e9eef3;--pagetab-text:#5f6d7b;--pagetab-border:#cbd5df;--pagetab-active-bg:#ffffff;--pagetab-active-text:#17212b;--pagetab-active-border:#173f67;--modal-bg:#ffffff;--modal-border:#cbd5df;--modal-p-text:#3c4a58;--label-text:#5f6d7b;--title-text:#17212b;--msg-text:#a33327;--banner-text:#1f6b3a;--banner-border:#9db89a;--shield-text:#2c3a48;--shield-border:#cbd5df;--folder-title-text:#5f6d7b;--folder-count:#8b99a6;--kind-text:#5f6d7b;--kind-border:#cbd5df;--kb-lead-text:#1d2a36;--kb-h3-text:#1d2a36;--kb-p-text:#3c4a58;--kb-warn-text:#7a5a2e;--kb-warn-border:#c9a86a}
body[data-theme="high-vis"]{--bg:#111111;--panel:#202020;--panel2:#2b2b2b;--line:#777777;--text:#ffffff;--muted:#dddddd;--accent:#f4ff00;--header-bg:#161616;--sidebar-bg:#181818;--editor-bg:#0d0d0d;--editor-text:#ffffff;--input-bg:#161616;--input-text:#ffffff;--input-border:#777777;--focus-ring:#f4ff00;--btn-bg:#2b2b2b;--btn-text:#ffffff;--btn-border:#777777;--primary-text:#111111;--primary-border:#f4ff00;--tab-bg:#242424;--tab-text:#dddddd;--tab-border:#777777;--tab-active-bg:#333333;--tab-active-text:#f4ff00;--tab-active-border:#f4ff00;--tree-text:#eeeeee;--tree-active-bg:#333333;--tree-active-text:#f4ff00;--tree-active-border:#f4ff00;--pagetab-bg:#242424;--pagetab-text:#dddddd;--pagetab-border:#777777;--pagetab-active-bg:#333333;--pagetab-active-text:#f4ff00;--pagetab-active-border:#f4ff00;--modal-bg:#202020;--modal-border:#777777;--modal-p-text:#eeeeee;--label-text:#dddddd;--title-text:#ffffff;--msg-text:#ff9aa5;--banner-text:#f4ff00;--banner-border:#f4ff00;--shield-text:#ffffff;--shield-border:#777777;--folder-title-text:#dddddd;--folder-count:#aaaaaa;--kind-text:#dddddd;--kind-border:#777777;--kb-lead-text:#ffffff;--kb-h3-text:#f4ff00;--kb-p-text:#dddddd;--kb-warn-text:#f4ff00;--kb-warn-border:#f4ff00}
body[data-theme="cyberpunk"]{--bg:#100817;--panel:#1d0e27;--panel2:#281238;--line:#753b87;--text:#fff3ff;--muted:#d0a9da;--accent:#ff4fd8;--header-bg:#150a1e;--sidebar-bg:#170b20;--editor-bg:#110614;--editor-text:#fff0fb;--input-bg:#150a1e;--input-text:#fff3ff;--input-border:#753b87;--focus-ring:#ff4fd8;--btn-bg:#221031;--btn-text:#f2d8f7;--btn-border:#753b87;--primary-text:#1c0a24;--primary-border:#ff4fd8;--tab-bg:#1e0f2a;--tab-text:#d0a9da;--tab-border:#5c2f6e;--tab-active-bg:#2c1440;--tab-active-text:#ffffff;--tab-active-border:#ff4fd8;--tree-text:#e3c4ea;--tree-active-bg:#2c1440;--tree-active-text:#ffffff;--tree-active-border:#a05cb8;--pagetab-bg:#1e0f2a;--pagetab-text:#d0a9da;--pagetab-border:#5c2f6e;--pagetab-active-bg:#2c1440;--pagetab-active-text:#ffffff;--pagetab-active-border:#a05cb8;--modal-bg:#1d0e27;--modal-border:#753b87;--modal-p-text:#d9bce2;--label-text:#c39acb;--title-text:#ffffff;--msg-text:#ff9aa5;--banner-text:#ff9fe6;--banner-border:#a05cb8;--shield-text:#f2d8f7;--shield-border:#753b87;--folder-title-text:#c39acb;--folder-count:#8f6b98;--kind-text:#c39acb;--kind-border:#5c2f6e;--kb-lead-text:#f6e3fa;--kb-h3-text:#f6e3fa;--kb-p-text:#d9bce2;--kb-warn-text:#e4cba7;--kb-warn-border:#6b4c2d}
body[data-theme="matrix"]{--bg:#020904;--panel:#07140b;--panel2:#0b1e10;--line:#1c6331;--text:#d8ffe0;--muted:#76b986;--accent:#53ff77;--header-bg:#040f08;--sidebar-bg:#051208;--editor-bg:#020a05;--editor-text:#d8ffe0;--input-bg:#040f08;--input-text:#d8ffe0;--input-border:#1c6331;--focus-ring:#53ff77;--btn-bg:#0a1c0f;--btn-text:#c9f5d2;--btn-border:#1c6331;--primary-text:#04140a;--primary-border:#53ff77;--tab-bg:#081710;--tab-text:#76b986;--tab-border:#1c6331;--tab-active-bg:#0d2413;--tab-active-text:#eafff0;--tab-active-border:#53ff77;--tree-text:#a8d9b4;--tree-active-bg:#0d2413;--tree-active-text:#eafff0;--tree-active-border:#2f9e4f;--pagetab-bg:#081710;--pagetab-text:#76b986;--pagetab-border:#1c6331;--pagetab-active-bg:#0d2413;--pagetab-active-text:#eafff0;--pagetab-active-border:#2f9e4f;--modal-bg:#07140b;--modal-border:#1c6331;--modal-p-text:#a8d9b4;--label-text:#76b986;--title-text:#eafff0;--msg-text:#ff9aa5;--banner-text:#8df0a5;--banner-border:#1c6331;--shield-text:#c9f5d2;--shield-border:#1c6331;--folder-title-text:#76b986;--folder-count:#4d7a59;--kind-text:#76b986;--kind-border:#1c6331;--kb-lead-text:#d8ffe0;--kb-h3-text:#d8ffe0;--kb-p-text:#a8d9b4;--kb-warn-text:#e4cba7;--kb-warn-border:#6b4c2d}
body[data-theme="matrix-rain"]{--bg:#010301;--panel:#061008;--panel2:#0a190d;--line:#1e6a32;--text:#d8ffe0;--muted:#73bd82;--accent:#63ff80;--header-bg:#030d06;--sidebar-bg:#041007;--editor-bg:#020804;--editor-text:#d8ffe0;--input-bg:#030d06;--input-text:#d8ffe0;--input-border:#1e6a32;--focus-ring:#63ff80;--btn-bg:#081a0e;--btn-text:#c9f5d2;--btn-border:#1e6a32;--primary-text:#04140a;--primary-border:#63ff80;--tab-bg:#071410;--tab-text:#73bd82;--tab-border:#1e6a32;--tab-active-bg:#0c2112;--tab-active-text:#eafff0;--tab-active-border:#63ff80;--tree-text:#a8d9b4;--tree-active-bg:#0c2112;--tree-active-text:#eafff0;--tree-active-border:#2f9e4f;--pagetab-bg:#071410;--pagetab-text:#73bd82;--pagetab-border:#1e6a32;--pagetab-active-bg:#0c2112;--pagetab-active-text:#eafff0;--pagetab-active-border:#2f9e4f;--modal-bg:#061008;--modal-border:#1e6a32;--modal-p-text:#a8d9b4;--label-text:#73bd82;--title-text:#eafff0;--msg-text:#ff9aa5;--banner-text:#8df0a5;--banner-border:#1e6a32;--shield-text:#c9f5d2;--shield-border:#1e6a32;--folder-title-text:#73bd82;--folder-count:#4d7a59;--kind-text:#73bd82;--kind-border:#1e6a32;--kb-lead-text:#d8ffe0;--kb-h3-text:#d8ffe0;--kb-p-text:#a8d9b4;--kb-warn-text:#e4cba7;--kb-warn-border:#6b4c2d}
body[data-theme="matrix-rain"]::before{content:"";position:fixed;inset:0;pointer-events:none;z-index:9990;opacity:.08;background:repeating-linear-gradient(90deg,transparent 0 13px,#51ff72 14px 15px,transparent 16px 28px);animation:rainfall 1.4s linear infinite}
@keyframes rainfall{from{transform:translateY(-32px)}to{transform:translateY(32px)}}
body[data-theme="terminal"]{--bg:#030605;--panel:#0a0f0c;--panel2:#101813;--line:#295136;--text:#c9ffd3;--muted:#73a27d;--accent:#70ff8c;--header-bg:#060b08;--sidebar-bg:#070d09;--editor-bg:#030705;--editor-text:#c9ffd3;--input-bg:#060b08;--input-text:#c9ffd3;--input-border:#295136;--focus-ring:#70ff8c;--btn-bg:#0d130f;--btn-text:#bde8c6;--btn-border:#295136;--primary-text:#06130b;--primary-border:#70ff8c;--tab-bg:#0b110d;--tab-text:#73a27d;--tab-border:#295136;--tab-active-bg:#121b14;--tab-active-text:#e6ffeb;--tab-active-border:#70ff8c;--tree-text:#9fd0a9;--tree-active-bg:#121b14;--tree-active-text:#e6ffeb;--tree-active-border:#3f7d4e;--pagetab-bg:#0b110d;--pagetab-text:#73a27d;--pagetab-border:#295136;--pagetab-active-bg:#121b14;--pagetab-active-text:#e6ffeb;--pagetab-active-border:#3f7d4e;--modal-bg:#0a0f0c;--modal-border:#295136;--modal-p-text:#9fd0a9;--label-text:#73a27d;--title-text:#e6ffeb;--msg-text:#ff9aa5;--banner-text:#8df0a5;--banner-border:#295136;--shield-text:#bde8c6;--shield-border:#295136;--folder-title-text:#73a27d;--folder-count:#4a6e55;--kind-text:#73a27d;--kind-border:#295136;--kb-lead-text:#c9ffd3;--kb-h3-text:#c9ffd3;--kb-p-text:#9fd0a9;--kb-warn-text:#e4cba7;--kb-warn-border:#6b4c2d}
/* v40.15: notebook decorations (ruled lines + red margin). Colors now come from the variable block above. */
body[data-theme="notebook"] .panel{box-shadow:0 20px 55px #8a7c5533}
body[data-theme="notebook"] .editor textarea{padding-left:56px;background-image:linear-gradient(90deg,transparent 42px,#df9d9d 42px,#df9d9d 44px,transparent 44px),repeating-linear-gradient(transparent 0 calc(1.75em - 1px),#ccd8e4 calc(1.75em - 1px) 1.75em)}
/* v16 professional property-security designer enhancements */
.property-search{width:100%;box-sizing:border-box;margin:0 0 8px;padding:8px 9px;border:1px solid var(--line);border-radius:7px;background:var(--bg);color:var(--text)}
.property-tool{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:62px}.property-tool small{font-size:7px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.property-layers{display:grid;grid-template-columns:1fr 1fr;gap:5px}.layer-toggle{display:flex!important;align-items:center;gap:4px;font-size:8px!important;margin:0!important;padding:4px;background:var(--panel2);border-radius:5px}.layer-toggle input{width:auto!important;padding:0!important}
.property-field-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}.property-field-grid label{margin:0!important}.property-section textarea{width:100%;box-sizing:border-box;padding:8px;border:1px solid var(--line);border-radius:6px;background:var(--bg);color:var(--text);resize:vertical;font:inherit}
.property-checks{display:grid;gap:5px}.check-row{display:flex;align-items:flex-start;gap:7px;padding:6px;border-radius:6px;font-size:8px}.check-row.pass{background:#2d6b3b22;border:1px solid #5a9f6a55}.check-row.warn{background:#9a6d1b22;border:1px solid #c39a4a55}.check-row b{font-size:12px}.check-row small{display:block;color:var(--muted);margin-top:2px}
.property-object .coverage{position:absolute;left:50%;top:50%;width:calc(var(--coverage,25%) + 35px);height:calc(var(--coverage,25%) + 35px);transform:translate(-10%,-50%) rotate(-45deg);border-radius:100% 0 0 0;background:linear-gradient(135deg,#ffd84d2e,transparent 70%);pointer-events:none}.property-object.cable{background:repeating-linear-gradient(90deg,#555 0 12px,#9aa 12px 14px);height:8px!important;border-width:1px}.property-object.north{background:#fff;border-radius:4px}.property-object.scale{background:#fff;border-radius:3px}.property-object.text{background:#ffffffaa;border-style:dashed}.property-object.evidence{background:#f0f0f0}.property-object.electrical{background:#f2df9b}.property-object.fire,.property-object.cofire,.property-object.dual,.property-object.doorsensor,.property-object.motion,.property-object.glass,.property-object.flood,.property-object.panic,.property-object.camera,.property-object.alarm,.property-object.panel,.property-object.keypad,.property-object.lock,.property-object.reader,.property-object.intercom,.property-object.wifi,.property-object.router,.property-object.switch,.property-object.jack,.property-object.poe,.property-object.server,.property-object.smoke,.property-object.sprinkler,.property-object.extinguisher,.property-object.firepanel,.property-object.waterstop,.property-object.gasstop,.property-object.light{border-radius:50%}
@media print{.property-modal{position:static!important;inset:auto!important;overflow:visible!important}.property-tools,.property-inspector,.property-head-actions{display:none!important}.property-workspace{display:block!important}.property-canvas-wrap{overflow:visible!important;background:#fff!important;padding:0!important}.property-canvas{box-shadow:none!important;transform:none!important;max-width:100%!important}.property-head{border:0}.property-print-title{display:block}}
/* v17 interactive technical mapping controls */
.property-object{position:absolute;box-sizing:border-box;transition:outline-color .08s ease;will-change:left,top,width,height}.property-object .property-icon{display:block;font-size:20px;line-height:1;pointer-events:none;z-index:2;text-shadow:0 1px 2px #fff8}.property-object .property-label{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;z-index:3}.property-object.selected{outline:3px solid var(--accent,#1677ff);outline-offset:2px}.property-object.locked{cursor:not-allowed;outline-style:dashed}.resize-handle{position:absolute!important;width:12px!important;height:12px!important;min-width:12px!important;padding:0!important;margin:0!important;border:2px solid #fff!important;background:#1677ff!important;border-radius:50%!important;z-index:20!important;box-shadow:0 1px 3px #0008!important;cursor:nwse-resize!important}.resize-handle.nw{left:-7px;top:-7px}.resize-handle.ne{right:-7px;top:-7px;cursor:nesw-resize!important}.resize-handle.sw{left:-7px;bottom:-7px;cursor:nesw-resize!important}.resize-handle.se{right:-7px;bottom:-7px}.property-canvas:focus{outline:2px solid var(--accent);outline-offset:3px}.property-object.warning,.property-object.sos,.property-object.ambulance,.property-object.location,.property-object.lockmark,.property-object.secure,.property-object.key,.property-object.flashlight{background:#fff8!important}.property-object.warning{border-color:#b77900}.property-object.sos{border-color:#b91c1c}.property-object.ambulance{border-color:#2563eb}.property-object.location{border-color:#b91c1c}.property-object.lockmark,.property-object.secure{border-color:#475569}.property-object.key{border-color:#a16207}.property-object.flashlight{border-color:#ca8a04}.property-tool{cursor:pointer}.property-tool:focus-visible,.property-template:focus-visible,.resize-handle:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
@media(max-width:700px){.property-object .property-icon{font-size:17px}.resize-handle{width:14px!important;height:14px!important;min-width:14px!important}}
.property-object.warning,.property-object.sos,.property-object.ambulance,.property-object.flashlight,.property-object.location,.property-object.lockmark,.property-object.secure,.property-object.key{border-radius:50%}
.property-object .property-icon:empty{display:none}

.math-challenge{margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:10px;background:color-mix(in srgb,var(--panel2) 86%,transparent);text-align:center}.math-title{font-size:9px;letter-spacing:.12em;color:var(--muted);margin-bottom:8px}.math-row{display:flex;align-items:center;justify-content:center;gap:12px}.math-row strong{font:900 20px ui-monospace,SFMono-Regular,monospace;letter-spacing:.06em}.math-row input{width:70px!important;text-align:center;font:900 18px ui-monospace,SFMono-Regular,monospace}.math-challenge .tiny{margin-top:7px}.math-challenge + .primary{margin-top:4px}
/* v19 mobile designer usability: phone-sized viewports stack the palette above the canvas. */
@media(max-width:760px){
  .property-workspace{grid-template-columns:1fr}
  .property-tools{max-height:230px;border-right:0;border-bottom:1px solid var(--line)}
  .property-canvas-wrap{min-height:560px;align-items:flex-start;justify-content:flex-start;overflow:auto}
  .property-canvas{transform:scale(.78);transform-origin:top left;margin-right:-220px;margin-bottom:-155px}
  .property-inspector{display:none}
  .property-head{align-items:flex-start;flex-wrap:wrap}
  .property-head-actions{display:flex;flex-wrap:wrap}
  .property-head-actions .ghost{min-height:40px}
}

/* Secure Property Planner v21 studio enhancements */
.property-modal{z-index:5000}
.property-head-actions{max-width:100%;overflow:auto;scrollbar-width:thin}
.property-workspace{position:relative;min-width:0}
.property-tools,.property-inspector{min-width:120px;overflow:auto}
.spp-splitter{width:7px;cursor:col-resize;background:linear-gradient(90deg,transparent,#64748b66,transparent);z-index:30;touch-action:none}
.spp-splitter:hover{background:#7dd3fc99}
.spp-splitter.left{grid-column:2}.spp-splitter.right{grid-column:3}
.spp-btn-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px}.spp-btn-grid .ghost{min-height:38px;font-size:9px}
.spp-orbit{margin-top:8px;padding:8px;border:1px solid var(--line);border-radius:8px;background:var(--panel2)}
.spp-orbit>b{display:block;font-size:9px;letter-spacing:.1em;margin-bottom:6px}.spp-orbit-row{display:grid;grid-template-columns:1fr 1fr 1fr 1.4fr;gap:4px}.spp-orbit label{font-size:8px}.spp-orbit input[type=range]{width:100%}
.property-canvas{transform-style:preserve-3d;transform-origin:center center;will-change:transform;transition:transform .18s ease;backface-visibility:visible}
.property-canvas.spp-orbit-active{box-shadow:0 25px 70px #0004}
.property-canvas-wrap{perspective:1600px;transform-style:preserve-3d}
.property-object{transform-style:preserve-3d}
.property-object.tree,.property-object.pine,.property-object.palm,.property-object.holidaytree,.property-object.deadwood,.property-object.plant,.property-object.shrub,.property-object.hedge{border-radius:50%;background:#cce7c9!important}
.property-object.shed,.property-object.pool,.property-object.deck,.property-object.playground,.property-object.vehicle,.property-object.truck{border-radius:8px}
.property-object.customtext{background:#fffdf0!important;border-style:dashed!important;padding:5px;white-space:pre-wrap;overflow:hidden;text-align:left;font-size:var(--custom-font,18px);line-height:1.15}
.property-object.customshape{background:#dfe8f2!important;border-style:dashed!important}
.property-object.arrow,.property-object.route{background:linear-gradient(90deg,#3b82f6,#3b82f6 80%,transparent 80%)!important;border-color:#2563eb!important;height:8px!important}
.property-object.dimension{background:linear-gradient(90deg,transparent 0 3%,#334155 3% 97%,transparent 97%)!important;height:3px!important}
.property-object.zone{background:#60a5fa18!important;border:2px dashed #3b82f6!important}.property-object.hotspot{background:#ef444422!important;border:3px solid #ef4444!important}.property-object.cameraarc{background:#f59e0b20!important;border-color:#d97706!important}
.spp-print-options{display:grid;gap:8px;padding:10px 0}.spp-print-options label{padding:8px;border:1px solid var(--line);border-radius:7px;background:var(--panel2)}
/* v40.21: document-name row at the top of the print chooser */
.spp-docname-row{display:flex;align-items:center;gap:8px;margin:2px 0 4px;font-weight:600}
.spp-docname-row input{flex:1;min-width:0;padding:7px 9px;font-size:14px;border:1px solid var(--line);border-radius:7px;background:var(--panel2);color:inherit}
@media(max-width:900px){.property-head{position:sticky;top:0;z-index:40}.property-head-actions{width:100%;padding-bottom:3px}.property-head-actions .ghost{min-height:42px}.property-workspace{grid-template-columns:150px minmax(280px,1fr)!important}.property-inspector{position:absolute;right:0;top:0;bottom:0;width:min(340px,85vw);z-index:35;background:var(--panel);box-shadow:-15px 0 40px #0005;display:none}.property-modal.inspector-open .property-inspector{display:block}}
@media(max-width:700px){.property-workspace{display:flex!important;flex-direction:column;overflow:auto}.property-tools{width:auto!important;max-height:330px;order:0}.property-canvas-wrap{order:1;min-height:600px}.property-inspector{order:2;position:static;width:auto!important;display:block!important;max-height:500px}.spp-splitter{display:none}.spp-btn-grid{grid-template-columns:1fr 1fr}.property-canvas{transform-origin:top left}.property-head-actions .ghost{flex:1 0 auto}}
@media print{.property-modal{background:white!important;color:#111!important}.property-canvas{transform:none!important;box-shadow:none!important}.property-object{print-color-adjust:exact;-webkit-print-color-adjust:exact}.spp-enhanced-tools{display:none!important}}
/* Secure Property Planner v22 — map-first responsive studio */
.property-modal{--spp-tools:260px;--spp-inspector:330px;display:flex;flex-direction:column;background:var(--bg,#0b1117);overflow:hidden}
.property-modal.hidden{display:none}
.property-workspace{display:grid!important;grid-template-columns:var(--spp-tools) minmax(0,1fr) var(--spp-inspector)!important;grid-template-rows:minmax(0,1fr);flex:1;min-height:0;width:100%;overflow:hidden}
.property-tools,.property-inspector{width:auto!important;min-width:0!important;max-width:none!important;min-height:0;height:auto!important;overflow:auto!important;overscroll-behavior:contain}
.property-canvas-wrap{grid-column:2;grid-row:1;min-width:0!important;min-height:0!important;width:100%!important;height:100%!important;overflow:auto!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:radial-gradient(circle at center,#25313b22,transparent 65%)!important;touch-action:none}
.property-canvas{flex:0 0 auto;margin:30px!important}
.spp-mapbar{position:absolute;left:12px;right:12px;bottom:12px;z-index:80;display:flex;align-items:center;gap:6px;padding:7px;background:#0b1117e8;border:1px solid #71809655;border-radius:12px;box-shadow:0 12px 35px #0008;backdrop-filter:blur(12px)}
.spp-mapbar button{min-width:38px;min-height:36px;padding:6px 9px}.spp-mapbar .spp-zoom-label{min-width:54px;text-align:center;font:700 11px ui-monospace,monospace;color:#dbeafe}.spp-mapbar .spp-map-spacer{flex:1}
.spp-drawer-toggle{position:absolute;top:12px;z-index:90;min-width:44px;min-height:44px;border-radius:10px;box-shadow:0 8px 25px #0006}.spp-drawer-left{left:12px}.spp-drawer-right{right:12px}
.property-modal.spp-left-collapsed{--spp-tools:58px}.property-modal.spp-right-collapsed{--spp-inspector:0px}.property-modal.spp-right-collapsed .property-inspector{display:none!important}.property-modal.spp-left-collapsed .property-tools>*:not(.spp-mobile-tool-launcher){display:none}.property-modal.spp-left-collapsed .property-tools{overflow:hidden!important}
.spp-mobile-tool-launcher{display:none!important}
.spp-resize-grip{position:absolute;top:0;bottom:0;width:10px;z-index:70;cursor:col-resize;touch-action:none}.spp-grip-left{left:var(--spp-tools);transform:translateX(-5px)}.spp-grip-right{right:var(--spp-inspector);transform:translateX(5px)}
.property-modal.spp-right-collapsed .spp-grip-right{display:none}.property-modal.spp-left-collapsed .spp-grip-left{display:none}
.spp-mobile-overlay{display:none}
@media(max-width:900px){
 .property-head{flex:0 0 auto;max-height:112px;overflow:auto}
 .property-workspace{grid-template-columns:1fr!important;grid-template-rows:1fr!important;position:relative}
 .property-tools{position:absolute!important;left:0;top:0;bottom:0;width:min(360px,88vw)!important;z-index:100;background:var(--panel,#101820);box-shadow:18px 0 45px #0009;transform:translateX(-105%);transition:transform .22s ease}
 .property-inspector{position:absolute!important;right:0;top:0;bottom:0;width:min(390px,92vw)!important;z-index:100;background:var(--panel,#101820);box-shadow:-18px 0 45px #0009;transform:translateX(105%);transition:transform .22s ease}
 .property-modal.spp-tools-open .property-tools{transform:translateX(0)}
 .property-modal.spp-inspector-open .property-inspector{transform:translateX(0)}
 .property-canvas-wrap{grid-column:1;grid-row:1;min-height:0!important}
 .spp-grip-left,.spp-grip-right{display:none}
 .spp-drawer-toggle{display:block}
 .spp-mapbar{left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));overflow-x:auto;white-space:nowrap}
 .spp-mapbar button{flex:0 0 auto}
 .spp-mobile-tool-launcher{display:block!important}
 .property-modal.spp-left-collapsed .property-tools{display:block!important}
 .property-modal.spp-right-collapsed .property-inspector{display:block!important}
}
@media(min-width:901px){.spp-drawer-toggle{display:none}.spp-mobile-overlay{display:none!important}}
@media(max-width:600px){
 .property-head{padding:8px!important}.property-title{font-size:13px!important}.property-mini{font-size:8px!important}
 .property-head-actions{gap:4px!important}.property-head-actions .ghost{min-height:38px!important;padding:7px 9px!important;font-size:9px!important}
 .property-canvas{margin:12px!important}
 .spp-mapbar{padding:5px;gap:4px;border-radius:10px}.spp-mapbar button{min-width:40px;min-height:40px;font-size:11px}
}
@media print{.spp-mapbar,.spp-drawer-toggle,.spp-resize-grip,.spp-mobile-overlay{display:none!important}.property-canvas-wrap{height:auto!important;min-height:0!important}.property-canvas{margin:0!important}}

@media(max-width:600px){
 #pdNew,#pdSave,#pdLoad,#pdReport,#pdHelp{display:none!important}
 .property-canvas-wrap{touch-action:pan-x pan-y!important}
 .property-modal.spp-tools-open .property-canvas-wrap,.property-modal.spp-inspector-open .property-canvas-wrap{filter:brightness(.72)}
}
/* v23 print reliability: same-document preview works on mobile browsers that block window.open(). */
.spp-print-preview{position:fixed;inset:0;z-index:12000;background:#26313a;overflow:auto;color:#17241d;font-family:Arial,sans-serif}
.spp-print-toolbar{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:12px;padding:10px 14px;background:#0b1117;color:#eef4f8;border-bottom:1px solid #52606d;box-shadow:0 8px 25px #0008}
.spp-print-toolbar .spp-print-meta{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:#b9c6d1}
.spp-print-toolbar>div{display:flex;gap:7px}
.spp-print-paper{width:min(1120px,calc(100% - 24px));margin:18px auto 40px;background:#fff;box-shadow:0 18px 60px #0008;padding:16mm;color:#17241d}
.spp-print-paper section{break-after:page;page-break-after:always;min-height:30mm}
.spp-print-paper section:last-child{break-after:auto;page-break-after:auto}
.spp-print-paper .cover{display:grid;align-content:center;min-height:235mm;text-align:center}
.spp-print-paper .brand{font-weight:700}
.spp-print-paper h1{font-size:24pt;margin:0 0 12pt}.spp-print-paper h2{font-size:15pt;border-bottom:1px solid #888;padding-bottom:4pt}
.spp-print-paper svg{display:block;width:100%;height:auto;max-height:245mm;border:1px solid #999;background:white}
.spp-print-paper .print-map{overflow:hidden}.spp-print-paper table{border-collapse:collapse;width:100%;font-size:7pt}.spp-print-paper td,.spp-print-paper th{border:1px solid #aaa;padding:3pt;vertical-align:top}.spp-print-paper th{background:#e9eee9}
.spp-print-paper .notes{white-space:normal;min-height:80mm;border:1px solid #bbb;padding:8pt}.spp-print-paper .checks{font-size:8pt}
.spp-print-legend,.print-legend{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5pt}.print-legend span{border:1px solid #ccc;padding:4pt;font-size:8pt}
/* v40.20 Atlas: photo documentation grid in printed reports. */
.print-photos{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8pt}
.print-photos figure{margin:0;border:1px solid #ccc;padding:4pt;break-inside:avoid}
.print-photos img{display:block;width:100%;height:auto;max-height:60mm;object-fit:contain;background:#f4f6f4}
.print-photos figcaption{font-size:7pt;padding-top:3pt}
@media(max-width:700px){.print-photos{grid-template-columns:1fr 1fr}}
.spp-printing .spp-print-preview{position:static;background:#fff;overflow:visible}.spp-printing .spp-print-toolbar{display:none}.spp-printing .spp-print-paper{width:auto;margin:0;box-shadow:none;padding:0}.spp-printing .spp-print-paper section{break-after:page;page-break-after:always}.spp-printing .spp-print-paper section:last-child{break-after:auto;page-break-after:auto}
@page{margin:10mm}
@media(max-width:700px){.spp-print-toolbar{padding:8px;gap:6px}.spp-print-toolbar strong{font-size:10px}.spp-print-toolbar .spp-print-meta{display:none}.spp-print-toolbar>div{margin-left:auto}.spp-print-toolbar button{min-height:42px;padding:8px 10px}.spp-print-paper{width:calc(100% - 12px);margin:8px auto 24px;padding:7mm}.spp-print-paper table{font-size:6pt}.spp-print-legend,.print-legend{grid-template-columns:1fr 1fr}.spp-print-paper .cover{min-height:230mm}}
@media print{body>*:not(#sppPrintPreview){display:none!important}body.spp-printing #sppPrintPreview{display:block!important;position:static!important;background:#fff!important}.spp-print-preview{position:static!important;background:#fff!important;overflow:visible!important}.spp-print-toolbar{display:none!important}.spp-print-paper{width:auto!important;margin:0!important;box-shadow:none!important;padding:0!important}.spp-print-paper section{break-after:page;page-break-after:always}.spp-print-paper section:last-child{break-after:auto;page-break-after:auto}.spp-print-paper svg{max-height:245mm!important}.spp-print-paper table{font-size:6.5pt!important}}

/* v24 — print/mobile layout hardening. The print UI never replaces or squeezes the designer. */
html.spp-print-active,html.spp-print-active body{width:100%;height:100%;overflow:hidden!important}
.spp-print-preview{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom)}
.spp-print-toolbar{min-height:58px;flex-wrap:wrap;white-space:normal}
.spp-print-toolbar strong{flex:0 0 auto}
.spp-print-toolbar .spp-print-meta{min-width:120px}
.spp-print-toolbar>div{flex-wrap:wrap;align-items:center}
.spp-print-toolbar button{white-space:nowrap}
.spp-print-paper{max-width:1120px;min-width:0;overflow:visible}
.spp-print-paper section{min-width:0;overflow:visible}
.spp-print-paper h1,.spp-print-paper h2,.spp-print-paper p,.spp-print-paper span,.spp-print-paper td,.spp-print-paper th{overflow-wrap:anywhere;word-break:normal}
.spp-print-paper .print-map{width:100%;overflow:hidden}
.spp-print-paper .print-map svg{max-width:100%;height:auto}
.spp-print-paper .print-table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.spp-print-paper table{min-width:760px}

/* The selection dialog itself must scroll on short/narrow phones. */
#modal{overflow:auto;align-items:flex-start;overscroll-behavior:contain}
#modal .modal-box{max-height:calc(100dvh - 24px);overflow:auto;margin:auto}

@media(max-width:700px){
  .spp-print-preview{padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  .spp-print-toolbar{position:sticky;top:0;padding:8px;gap:6px;align-items:center}
  .spp-print-toolbar strong{font-size:10px}
  .spp-print-toolbar .spp-print-meta{display:block;flex:1 1 100%;order:3;font-size:9px;white-space:normal;line-height:1.35;max-height:2.8em;overflow:hidden}
  .spp-print-toolbar>div{width:100%;margin:0;display:grid;grid-template-columns:1fr 1fr}
  .spp-print-toolbar button{width:100%;min-height:44px;font-size:10px}
  .spp-print-paper{width:calc(100% - 12px);margin:8px auto 24px;padding:6mm;box-shadow:0 8px 28px #0006}
  .spp-print-paper .cover{min-height:210mm;padding:10mm 2mm}
  .spp-print-paper svg{max-height:none;width:100%;height:auto}
  .spp-print-paper .print-map{overflow:hidden}
  .spp-print-paper .print-legend,.spp-print-paper .spp-print-legend{grid-template-columns:1fr}
  .spp-print-paper table{min-width:0;width:100%;font-size:9px}
  .spp-print-paper table thead{display:none}
  .spp-print-paper table,.spp-print-paper tbody,.spp-print-paper tr,.spp-print-paper td{display:block;width:100%}
  .spp-print-paper tr{border:1px solid #aaa;margin:0 0 10px;padding:5px;break-inside:avoid;page-break-inside:avoid}
  .spp-print-paper td{border:0!important;border-bottom:1px solid #ddd!important;padding:5px 4px!important;min-height:24px}
  .spp-print-paper td:last-child{border-bottom:0!important}
  .spp-print-paper td::before{content:attr(data-label) ": ";font-weight:700;color:#39463d}
  #modal{padding:8px}
  #modal .modal-box{width:100%;max-width:560px;max-height:calc(100dvh - 16px);padding:16px}
}

@media print{
  html.spp-print-active,html.spp-print-active body{height:auto!important;overflow:visible!important}
  .spp-print-preview{width:auto!important;max-width:none!important;height:auto!important;max-height:none!important;overflow:visible!important;padding:0!important}
  .spp-print-paper{max-width:none!important;width:auto!important;min-width:0!important;margin:0!important;padding:0!important;box-shadow:none!important;overflow:visible!important}
  .spp-print-paper .print-table-wrap{overflow:visible!important}
  .spp-print-paper table{min-width:0!important;width:100%!important}
  .spp-print-paper table thead{display:table-header-group!important}
  .spp-print-paper table,.spp-print-paper tbody,.spp-print-paper tr,.spp-print-paper td,.spp-print-paper th{display:table-cell!important;width:auto!important}
  .spp-print-paper tbody{display:table-row-group!important}
  .spp-print-paper tr{display:table-row!important;border:0!important;margin:0!important;padding:0!important}
  .spp-print-paper td::before{content:none!important}
  .spp-print-paper td,.spp-print-paper th{overflow-wrap:anywhere;word-break:break-word}
  .spp-print-paper section{break-inside:auto;page-break-inside:auto}
  .spp-print-paper .cover{min-height:0!important}
}

/* v24 mobile designer viewport: use the whole safe viewport, never a clipped fixed sheet. */
@media(max-width:600px){
 .property-modal{inset:0!important;width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;border-left:0!important;border-right:0!important}
 .property-head{padding-top:max(8px,env(safe-area-inset-top))!important}
 .property-workspace{height:auto!important;min-height:0!important;flex:1 1 auto!important}
 .property-canvas-wrap{height:100%!important;min-height:0!important;padding-bottom:calc(58px + env(safe-area-inset-bottom))!important}
 .spp-mapbar{bottom:calc(8px + env(safe-area-inset-bottom))!important}
}


/* Secure Property Planner v25 — responsive studio + reliable print dialogs */
#modal{z-index:12050!important}
#modal .modal-box{max-height:calc(100dvh - 24px);overflow:auto;-webkit-overflow-scrolling:touch}
.property-modal{isolation:isolate}
.property-canvas-wrap{background-color:#18231e!important;background-image:
 linear-gradient(rgba(130,170,145,.10) 1px,transparent 1px),
 linear-gradient(90deg,rgba(130,170,145,.10) 1px,transparent 1px),
 radial-gradient(circle at center,rgba(80,120,95,.16),transparent 68%)!important;
 background-size:25px 25px,25px 25px,auto!important;}
.property-canvas{box-shadow:0 18px 55px rgba(0,0,0,.35)!important}
.property-modal.spp-fit-active .property-canvas{will-change:transform}

@media (min-width:901px){
 .property-head{min-height:58px}
 .property-head-actions{max-width:78%;justify-content:flex-end}
 .property-workspace{min-height:0}
 .property-canvas-wrap{padding:32px!important}
}

@media (max-width:900px){
 .property-head{max-height:78px!important;overflow:hidden!important;padding:7px 9px!important}
 .property-title{font-size:12px!important;letter-spacing:.08em}
 .property-mini{font-size:7px!important;line-height:1.2}
 .property-head-actions{width:auto!important;max-width:100%;display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;padding:0!important;gap:4px!important;-webkit-overflow-scrolling:touch}
 .property-head-actions .ghost{display:none!important;flex:0 0 auto!important;min-height:36px!important;padding:7px 9px!important;font-size:9px!important}
 .property-head-actions #pdPrint,
 .property-head-actions #pdClose,
 .property-head-actions #sppToolsToggle,
 .property-head-actions #sppInspectorToggle,
 .property-head-actions #sppFullscreen{display:block!important}
 .property-head-actions #pdPrint::before{content:'🖨 ';}
 .property-head-actions #sppToolsToggle::before{content:'☰ ';}
 .property-head-actions #sppInspectorToggle::before{content:'☷ ';}
 .property-head-actions #sppFullscreen::before{content:'⛶ ';}
 .property-workspace{height:calc(100dvh - 78px)!important}
 .property-canvas-wrap{touch-action:pan-x pan-y!important;padding:12px 8px 76px!important}
 .property-canvas{margin:12px!important}
}

@media (max-width:600px){
 .property-modal{inset:0!important;border-radius:0!important}
 .property-head{max-height:76px!important}
 .property-workspace{height:calc(100dvh - 76px)!important}
 .property-head-actions #pdPrint{font-size:0!important;min-width:42px!important}
 .property-head-actions #pdPrint::before{font-size:15px!important}
 .property-head-actions #pdClose{font-size:0!important;min-width:42px!important}
 .property-head-actions #pdClose::before{content:'×';font-size:19px!important}
 .property-head-actions #sppToolsToggle,.property-head-actions #sppInspectorToggle,.property-head-actions #sppFullscreen{font-size:0!important;min-width:42px!important}
 .property-head-actions #sppToolsToggle::before,.property-head-actions #sppInspectorToggle::before,.property-head-actions #sppFullscreen::before{font-size:15px!important}
 .spp-mapbar{max-width:calc(100vw - 16px);overflow-x:auto!important;justify-content:flex-start!important}
 .spp-mapbar .spp-map-spacer{display:none}
 #modal{z-index:12050!important;padding:8px!important}
 #modal .modal-box{width:100%!important;max-height:calc(100dvh - 16px)!important;margin:auto!important;padding:14px!important}
}

/* Print preview remains independently scrollable on small screens. */
html.spp-print-active,html.spp-print-active body{overflow:hidden!important}
.spp-print-preview{z-index:13000!important;overscroll-behavior:contain!important}
.spp-print-paper{min-height:0!important}
@media(max-width:600px){
 .spp-print-preview{height:100dvh!important;overflow-y:auto!important;overflow-x:hidden!important}
 .spp-print-toolbar{position:sticky!important;top:0!important;z-index:10!important;background:#0b1117!important}
 .spp-print-paper{margin:8px 6px 28px!important;width:calc(100% - 12px)!important}
}

/* v27 — final responsive conflict fix.
   Earlier legacy mobile rules used a stacked designer.  The intended v22-v25
   mobile UX is drawer-based, so these rules deliberately come last. */
@media (max-width:900px){
  .property-workspace{
    display:block!important;
    position:relative!important;
    width:100%!important;
    height:calc(100dvh - 78px)!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  .property-canvas-wrap{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    padding:12px 8px calc(76px + env(safe-area-inset-bottom))!important;
    overflow:auto!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
  .property-tools,
  .property-inspector{
    position:absolute!important;
    top:0!important;
    bottom:0!important;
    height:auto!important;
    max-height:none!important;
    width:min(360px,88vw)!important;
    z-index:100!important;
    display:block!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    background:var(--panel,#101820)!important;
  }
  .property-tools{
    left:0!important;
    right:auto!important;
    transform:translateX(-105%)!important;
    border-right:1px solid var(--line)!important;
    border-bottom:0!important;
    box-shadow:18px 0 45px #0009!important;
  }
  .property-inspector{
    right:0!important;
    left:auto!important;
    width:min(390px,92vw)!important;
    transform:translateX(105%)!important;
    border-left:1px solid var(--line)!important;
    box-shadow:-18px 0 45px #0009!important;
  }
  .property-modal.spp-tools-open .property-tools{transform:translateX(0)!important}
  .property-modal.spp-inspector-open .property-inspector{transform:translateX(0)!important}
  .property-modal.spp-tools-open .property-canvas-wrap,
  .property-modal.spp-inspector-open .property-canvas-wrap{filter:brightness(.72)!important}
  .spp-splitter,.spp-resize-grip{display:none!important}
}
@media (max-width:600px){
  .property-workspace{height:calc(100dvh - 76px)!important}
  .property-canvas-wrap{padding:8px 6px calc(78px + env(safe-area-inset-bottom))!important;align-items:flex-start!important;justify-content:flex-start!important;overflow:auto!important}
  .property-canvas{margin:8px!important;max-width:none!important;flex:0 0 auto!important}
  .property-head-actions{overflow-x:auto!important;scrollbar-width:none}
  .property-head-actions::-webkit-scrollbar{display:none}
  .spp-mapbar{left:8px!important;right:8px!important;bottom:calc(8px + env(safe-area-inset-bottom))!important}
}
/* v27 mobile map usability: keep the drawing genuinely usable rather than shrinking it to a thumbnail.
   The canvas is intentionally larger than the narrow viewport; the map workspace provides touch scrolling/panning. */
@media (max-width:600px){
  .property-canvas{transform:scale(.58)!important;transform-origin:top left!important;margin-right:-420px!important;margin-bottom:-285px!important}
}
@media (max-width:390px){
  .property-canvas{transform:scale(.54)!important;margin-right:-460px!important;margin-bottom:-315px!important}
}
@media (min-width:601px) and (max-width:900px){
  .property-canvas{transform-origin:center center!important}
}
@media (max-width:380px){
  .property-head{padding-left:6px!important;padding-right:6px!important}
  .property-title{font-size:11px!important}
  .property-mini{font-size:6.5px!important}
  .property-head-actions .ghost{min-width:40px!important;width:40px!important;padding:6px!important}
  .property-canvas-wrap{padding-left:4px!important;padding-right:4px!important}
  .spp-mapbar{left:4px!important;right:4px!important}
  .spp-mapbar button{min-width:38px!important;min-height:38px!important;padding:6px!important}
}


/* v29 — designer command bar and history controls. */
.property-head-actions{align-items:center;gap:6px}
.property-head-actions button:disabled{opacity:.35;cursor:not-allowed;filter:saturate(.4)}
@media(max-width:900px){
  .property-head-actions{max-width:100%;overflow-x:auto;flex-wrap:nowrap!important;padding-bottom:3px;-webkit-overflow-scrolling:touch}
  .property-head-actions button{flex:0 0 auto;min-height:42px}
}
@media(max-width:520px){
  .property-head{padding:9px!important}
  .property-head-actions{width:100%;order:2}
  .property-title{font-size:12px}
  .property-mini{font-size:8px}
}

/* v30 — mobile canvas control correction.
   Do not force a CSS transform on the drawing: the designer's JavaScript zoom
   controls and Fit calculation must remain authoritative. */
@media (max-width:600px){
  .property-canvas{transform:scale(1)!important;transform-origin:top left!important;margin-right:0!important;margin-bottom:0!important;}
}
@media (max-width:390px){
  .property-canvas{transform:scale(1)!important;}
}

/* v31 object control surface */
.property-quick-actions{position:fixed;z-index:1000;display:flex;flex-wrap:wrap;gap:5px;padding:7px;border:1px solid var(--line,#38504a);border-radius:12px;background:var(--panel,#101820);box-shadow:0 12px 35px #0009;max-width:min(520px,92vw)}
.property-quick-actions button{min-height:38px;padding:7px 10px;border:1px solid var(--line,#38504a);border-radius:8px;background:var(--panel2,#17231f);color:inherit;cursor:pointer;font-weight:700}
.property-quick-actions button:hover{filter:brightness(1.15)}
.property-quick-actions .q-danger{border-color:#a64b4b}
.property-object-info{line-height:1.55}
@media(max-width:600px){.property-quick-actions{position:fixed;left:8px!important;right:8px;top:auto!important;bottom:max(12px,env(safe-area-inset-bottom));max-width:none;justify-content:center}.property-quick-actions button{flex:1 1 30%;min-width:92px}.property-object-info{font-size:14px}}

/* v32 — explicit escape routes for every mobile designer layer */
.spp-pane-head{display:flex;align-items:center;justify-content:space-between;gap:8px;position:sticky;top:0;z-index:5;padding:10px 10px;background:var(--panel,#101820);border-bottom:1px solid var(--line,#38504a)}
.spp-pane-head strong{font-size:11px;letter-spacing:.12em;color:var(--text,#edf2f7)}
.spp-pane-back{min-height:38px!important;padding:7px 11px!important}
.spp-mobile-overlay{display:none}
@media(max-width:900px){
  .spp-mobile-overlay{display:block;position:fixed;inset:0;z-index:90;border:0;background:#0000;color:transparent;pointer-events:none}
  .property-modal.spp-tools-open .spp-mobile-overlay,
  .property-modal.spp-inspector-open .spp-mobile-overlay{pointer-events:auto;color:#dfe8e3;background:#0005;font-weight:800;text-align:center;padding-top:calc(100dvh - 76px);font-size:12px;letter-spacing:.08em}
  .property-modal.spp-tools-open .property-tools,
  .property-modal.spp-inspector-open .property-inspector{z-index:100!important}
  .spp-pane-head{margin:0}
}
@media(max-width:600px){
  .spp-pane-head{min-height:54px;padding:8px 10px}
  .spp-pane-back{min-width:96px!important;font-size:11px!important}
  .property-quick-actions{padding-bottom:calc(7px + env(safe-area-inset-bottom))!important}
  .property-quick-actions .q-back{flex:1 1 100%!important;min-width:100%!important}
}

/* v34 — Paint-like studio presentation. These rules intentionally override legacy
   mobile scaling/stacking rules above. The drawing is the primary surface. */
.property-modal{background:#0a100d!important;display:flex;flex-direction:column;overflow:hidden!important}
.property-head{flex:0 0 auto!important;background:linear-gradient(180deg,#17231d,#101a15)!important;border-bottom:1px solid #385044!important;padding:10px 14px!important}
.property-title{font-size:16px!important;letter-spacing:.14em!important}.property-mini{font-size:10px!important;letter-spacing:.05em}
.property-head-actions{max-width:70%!important;flex-wrap:nowrap!important;overflow-x:auto!important;scrollbar-width:thin!important}
.property-head-actions button{white-space:nowrap!important}
.property-workspace{flex:1 1 auto!important;min-height:0!important;display:grid!important;grid-template-columns:var(--spp-tools,245px) minmax(0,1fr) var(--spp-inspector,330px)!important;overflow:hidden!important;background:#0d1511!important}
.property-tools,.property-inspector{background:linear-gradient(180deg,#111c16,#0b120f)!important;padding:10px!important;overflow:auto!important;min-height:0!important}
.property-tools{border-right:1px solid #30483b!important}.property-inspector{border-left:1px solid #30483b!important}
.property-canvas-wrap{grid-column:2!important;grid-row:1!important;position:relative!important;min-width:0!important;min-height:0!important;width:auto!important;height:auto!important;overflow:auto!important;display:block!important;padding:70px 32px 48px!important;background:#202b25!important;background-image:linear-gradient(rgba(150,180,160,.10) 1px,transparent 1px),linear-gradient(90deg,rgba(150,180,160,.10) 1px,transparent 1px),radial-gradient(circle at center,rgba(100,140,115,.14),transparent 68%)!important;background-size:25px 25px,25px 25px,auto!important;overscroll-behavior:contain!important;touch-action:pan-x pan-y!important}
.property-canvas{margin:20px!important;min-width:400px!important;box-shadow:0 20px 65px #0008!important;border:2px solid #6b7d72!important;background:#f7f8f4!important;transform-origin:top left!important}
.property-object{cursor:grab!important}.property-object:active{cursor:grabbing!important}
.property-object.selected{outline:3px solid #1683ff!important;outline-offset:3px!important;box-shadow:0 0 0 6px #1683ff26,0 5px 16px #0004!important}
.property-ink{overflow:visible;pointer-events:none}
.property-ink[data-id]{cursor:pointer}
.spp-paintbar{position:absolute!important;left:12px;right:12px;top:10px;z-index:55;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px;background:#101a15ed;border:1px solid #40574a;border-radius:12px;box-shadow:0 10px 30px #0006;backdrop-filter:blur(8px)}
.spp-paint-group{display:flex;gap:5px;align-items:center;overflow-x:auto;scrollbar-width:none}.spp-paint-group::-webkit-scrollbar{display:none}
.spp-paintbar button{min-height:38px;padding:7px 11px;border:1px solid #3d5447;border-radius:8px;background:#17241d;color:#e9f2eb;font:700 11px ui-monospace,SFMono-Regular,monospace;white-space:nowrap;cursor:pointer}.spp-paintbar button:hover,.spp-paintbar button.active{border-color:#9ed5aa;background:#294134;box-shadow:inset 0 0 0 1px #9ed5aa44}
.spp-paint-security{margin-left:auto}.spp-paint-security button:first-child{border-color:#718c79}.spp-paint-status{position:absolute;left:16px;bottom:10px;z-index:54;padding:5px 9px;border:1px solid #3d5447;border-radius:7px;background:#0e1712e8;color:#d4e3d7;font:600 10px ui-monospace,SFMono-Regular,monospace;pointer-events:none}
.spp-draw-mode .property-object{pointer-events:none!important}.spp-draw-mode .property-grid{pointer-events:none!important}
.property-quick-actions{z-index:1000!important;background:#101a15f5!important;border:1px solid #63816e!important;border-radius:12px!important;padding:6px!important;box-shadow:0 16px 40px #0009!important;display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:5px!important;max-width:280px!important}
.property-quick-actions.hidden{display:none!important}.property-quick-actions button{min-height:40px!important;border-radius:8px!important}.property-quick-actions .q-back{grid-column:1/-1!important}
.spp-pane-head{position:sticky;top:-10px;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 2px 9px;background:#111c16f2;border-bottom:1px solid #30483b;margin-bottom:8px}.spp-pane-head strong{font-size:11px;letter-spacing:.12em}.spp-pane-back{min-height:36px!important}
@media(max-width:900px){
 .property-modal{width:100vw!important;height:100dvh!important;inset:0!important;border-radius:0!important}
 .property-head{min-height:58px!important;max-height:70px!important;padding:max(7px,env(safe-area-inset-top)) 8px 7px!important;gap:6px!important}
 .property-title{font-size:12px!important}.property-mini{font-size:7px!important}
 .property-head-actions{max-width:58%!important;gap:4px!important}.property-head-actions button{min-height:38px!important;padding:7px 9px!important;font-size:9px!important}
 .property-workspace{display:block!important;position:relative!important;height:auto!important;overflow:hidden!important}
 .property-canvas-wrap{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;padding:62px 8px calc(62px + env(safe-area-inset-bottom))!important;overflow:auto!important;display:block!important}
 .property-canvas{margin:14px!important;min-width:700px!important;transform:none!important}
 .property-tools,.property-inspector{position:absolute!important;top:auto!important;bottom:0!important;height:min(68dvh,620px)!important;max-height:min(68dvh,620px)!important;width:100%!important;z-index:100!important;transform:translateY(105%)!important;transition:transform .22s ease!important;border:1px solid #40574a!important;border-bottom:0!important;border-radius:16px 16px 0 0!important;box-shadow:0 -18px 45px #000b!important;padding:10px 10px calc(12px + env(safe-area-inset-bottom))!important}
 .property-tools{left:0!important;right:0!important}.property-inspector{left:0!important;right:0!important}
 .property-modal.spp-tools-open .property-tools,.property-modal.spp-inspector-open .property-inspector{transform:translateY(0)!important}
 .property-modal.spp-tools-open .property-canvas-wrap,.property-modal.spp-inspector-open .property-canvas-wrap{filter:brightness(.62)!important}
 .spp-mobile-overlay{position:fixed!important;inset:0!important;z-index:90!important;background:#0007!important;color:#fff!important;border:0!important;font-weight:800!important;font-size:12px!important;display:none!important;padding-bottom:68dvh!important;text-align:center;pointer-events:none!important}.property-modal.spp-tools-open .spp-mobile-overlay,.property-modal.spp-inspector-open .spp-mobile-overlay{display:block!important;pointer-events:auto!important}
 .spp-mobile-overlay:not(:focus){text-indent:-9999px}
 .spp-paintbar{left:7px;right:7px;top:7px;padding:5px;border-radius:10px;overflow:hidden}.spp-paint-group{max-width:100%}.spp-paintbar button{min-height:40px;padding:8px 10px;font-size:10px}.spp-paint-security{display:none}.spp-paint-status{bottom:7px;left:9px;font-size:9px}
 .spp-mapbar{display:none!important}
}
@media(max-width:600px){
 .property-head-actions #pdClose{display:block!important;font-size:0!important;min-width:42px!important}.property-head-actions #pdClose::before{content:'←';font-size:19px!important}
 .property-head-actions #pdPrint{display:block!important;font-size:0!important;min-width:42px!important}.property-head-actions #pdPrint::before{content:'🖨';font-size:15px!important}
 .property-head-actions #sppToolsToggle,.property-head-actions #sppInspectorToggle,.property-head-actions #sppFullscreen{display:block!important;font-size:0!important;min-width:42px!important}.property-head-actions #sppToolsToggle::before{content:'☰';font-size:17px!important}.property-head-actions #sppInspectorToggle::before{content:'☷';font-size:17px!important}.property-head-actions #sppFullscreen::before{content:'⛶';font-size:17px!important}
 .property-head-actions #pdUndo,.property-head-actions #pdRedo,.property-head-actions #pdSave,.property-head-actions #pdExport,.property-head-actions #pdNew,.property-head-actions #pdLoad,.property-head-actions #pdReport,.property-head-actions #pdHelp{display:none!important}
 .property-canvas{margin:10px!important;min-width:700px!important;min-height:500px!important;transform:none!important}
 .spp-paintbar{top:5px;left:5px;right:5px}.spp-paint-group{width:100%}.spp-paintbar button{min-width:68px}.spp-paintbar button{flex:0 0 auto}.spp-paint-group:first-child{overflow-x:auto!important;max-width:100%;padding-bottom:2px}
 .property-tools,.property-inspector{height:min(72dvh,650px)!important;max-height:min(72dvh,650px)!important}
 .spp-pane-head{top:-10px;padding-top:4px}.spp-pane-back{min-width:100px!important}
}
@media(min-width:901px){
 .spp-mobile-overlay{display:none!important}.spp-pane-head .spp-pane-back{display:none!important}
 .property-tools{scrollbar-width:thin}.property-inspector{scrollbar-width:thin}
}
/* v34.1 — JS owns designer zoom; remove the legacy thumbnail scaling on touch layouts. */
@media(max-width:900px){
  .property-canvas{transform-origin:top left!important;margin:12px!important;}
}
@media(max-width:600px){
  .property-canvas{transform-origin:top left!important;margin:10px!important;}
}
@media(max-width:900px){.property-canvas{transform:var(--spp-transform,scale(1))!important;transform-origin:top left!important}}

/* v35 — map-as-application studio controls */
.spp-studio-bar{position:absolute;left:12px;right:12px;bottom:10px;z-index:56;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 9px;background:#0e1712ed;border:1px solid #40574a;border-radius:12px;box-shadow:0 10px 30px #0007;backdrop-filter:blur(8px);color:#e6f0e8}
.spp-studio-group,.spp-nav-group,.spp-levels{display:flex;align-items:center;gap:5px;min-width:0}.spp-studio-group{flex:1}.spp-studio-group label{display:flex!important;align-items:center;gap:6px;margin:0!important;font-size:9px;color:#9fb1a4;white-space:nowrap}.spp-studio-bar select{background:#15221b;color:#edf7ef;border:1px solid #3d5447;border-radius:7px;padding:7px 8px;max-width:250px}.spp-levels{overflow-x:auto;scrollbar-width:none}.spp-levels::-webkit-scrollbar{display:none}.spp-levels button{white-space:nowrap;padding:6px 8px!important;font-size:9px!important;min-height:34px!important}.spp-levels button.active{background:#294134!important;border-color:#9ed5aa!important}.spp-nav-group{flex:0 0 auto}.spp-nav-group button{min-height:34px!important;padding:6px 9px!important;font-size:9px!important;white-space:nowrap}.spp-analysis-summary{display:flex;justify-content:space-between;gap:10px;padding:9px 10px;margin-bottom:7px;border:1px solid #40574a;border-radius:8px;background:#15221b;color:#dfece2;font-size:10px}.spp-analysis-summary span{color:#9fb1a4}.spp-findings{display:grid;gap:6px;margin:10px 0}.property-canvas-wrap{contain:layout paint}.property-canvas{contain:layout style}.property-object.selected{outline:3px solid #1683ff!important;outline-offset:3px!important}
@media(max-width:900px){.spp-studio-bar{left:7px;right:7px;bottom:calc(8px + env(safe-area-inset-bottom));overflow:hidden;flex-direction:column;align-items:stretch;gap:5px}.spp-studio-group{overflow:hidden}.spp-studio-group label{font-size:8px}.spp-studio-bar select{max-width:46vw;flex:0 1 auto}.spp-levels{flex:1}.spp-nav-group{overflow-x:auto;justify-content:flex-start}.spp-nav-group button{flex:0 0 auto}.spp-paint-status{bottom:118px!important}.property-canvas-wrap{padding-bottom:145px!important}}
@media(max-width:600px){.spp-studio-bar{bottom:calc(6px + env(safe-area-inset-bottom));padding:5px 6px;border-radius:10px}.spp-studio-group{display:block}.spp-studio-group label{display:flex!important}.spp-studio-bar select{max-width:100%;width:100%;height:34px}.spp-levels{margin-top:4px}.spp-nav-group{width:100%;gap:4px}.spp-nav-group button{min-width:40px!important}.spp-nav-group button:last-child{display:none}.spp-paint-status{display:none}.property-canvas-wrap{padding-bottom:132px!important}}
@media(max-width:900px){.property-canvas{transform:var(--spp-transform,scale(1))!important;transform-origin:top left!important}}

/* v36 professional property studio */
.spp-v36 .property-tools{background:linear-gradient(180deg,#0c151b,#091016)!important}
.spp-v36 .property-inspector{background:linear-gradient(180deg,#101a21,#0b1218)!important}
.spp-v36 .property-canvas-wrap{background-color:#dfe5df!important;background-image:linear-gradient(45deg,rgba(40,60,50,.045) 25%,transparent 25%,transparent 75%,rgba(40,60,50,.045) 75%),linear-gradient(45deg,rgba(40,60,50,.045) 25%,transparent 25%,transparent 75%,rgba(40,60,50,.045) 75%)!important;background-size:28px 28px!important;background-position:0 0,14px 14px!important}
.spp-v36 .property-canvas{background:#fff!important;border:1px solid #9aa8a0!important;box-shadow:0 12px 36px rgba(0,0,0,.25)!important}
.spp-pro-template-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.spp-pro-template{display:flex!important;align-items:center;gap:7px;text-align:left!important;min-height:45px!important;padding:6px 8px!important}
.spp-pro-template b{font-size:18px;min-width:24px;text-align:center}.spp-pro-template span{font-size:10px;line-height:1.15}
.spp-pro-actions{display:grid;gap:5px;margin-top:8px}
.spp-audit-list{display:grid;gap:6px}.spp-audit-list .check-row{display:flex;gap:9px;padding:9px;border-radius:8px;background:#ffffff08}
.spp-measure-mode .property-canvas{cursor:crosshair!important}.spp-measure-mode .spp-paint-status{background:#183d2b!important;color:#d8ffe4!important}
@media(min-width:901px){.spp-v36 .property-head-actions{overflow-x:auto}.spp-v36 .property-tools,.spp-v36 .property-inspector{scrollbar-width:thin}.spp-v36 .property-canvas-wrap{min-height:0}}
@media(max-width:700px){.spp-pro-template-grid{grid-template-columns:1fr 1fr}.spp-v36 .property-canvas-wrap{background-size:22px 22px!important}.spp-v36 .property-canvas{margin:24px!important}.spp-v36 .spp-paintbar{bottom:calc(10px + env(safe-area-inset-bottom))!important;max-width:calc(100vw - 12px)!important;overflow-x:auto!important}.spp-v36 .spp-paintbar button{min-width:44px!important;min-height:44px!important}.spp-v36 .property-tools,.spp-v36 .property-inspector{width:min(94vw,390px)!important}}

/* v37 — input and overlay reliability */
.spp-mobile-overlay{pointer-events:none!important}
.property-modal.spp-tools-open .spp-mobile-overlay,.property-modal.spp-inspector-open .spp-mobile-overlay{pointer-events:auto!important}
.spp-draw-surface{touch-action:none!important;cursor:crosshair!important}
.spp-draw-surface[data-tool=pan]{cursor:grab!important}
.spp-object-dragging{touch-action:none!important;cursor:grabbing!important}
.spp-paintbar{z-index:200!important}
.spp-studio-bar{z-index:190!important}
.property-object{touch-action:none}
@media(max-width:900px){.spp-paintbar{z-index:200!important}.spp-studio-bar{z-index:190!important}.property-canvas-wrap{touch-action:pan-x pan-y}.property-modal.spp-tools-open .property-canvas-wrap,.property-modal.spp-inspector-open .property-canvas-wrap{filter:brightness(.58)!important}.property-modal.spp-tools-open .spp-paintbar,.property-modal.spp-inspector-open .spp-paintbar,.property-modal.spp-tools-open .spp-studio-bar,.property-modal.spp-inspector-open .spp-studio-bar{pointer-events:none!important}}

/* v38 — map-first professional drafting workspace
   The map is the application. Side panels collapse out of the working area,
   the canvas gets an explicit scaled stage for reliable scrolling, and a
   compact rail keeps common drafting tools one tap away. */
.property-modal.spp-v38 .property-workspace{grid-template-columns:var(--spp-tools,76px) minmax(0,1fr) var(--spp-inspector,0px)!important}
.property-modal.spp-v38.spp-left-collapsed .property-tools{width:76px!important;padding:8px 6px!important;overflow:hidden!important}
.property-modal.spp-v38.spp-right-collapsed .property-inspector{display:none!important}
.property-modal.spp-v38 .property-tools{position:relative!important}
.property-modal.spp-v38 .property-canvas-wrap{display:block!important;align-items:initial!important;justify-content:initial!important;overflow:auto!important;scrollbar-gutter:stable both-edges!important;background:#d8ded9!important;background-image:linear-gradient(rgba(50,70,58,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(50,70,58,.07) 1px,transparent 1px),radial-gradient(circle at 50% 35%,rgba(255,255,255,.65),transparent 58%)!important;background-size:25px 25px,25px 25px,auto!important;}
.property-modal.spp-v38 .property-canvas{position:absolute!important;left:28px!important;top:72px!important;margin:0!important;transform-origin:top left!important;}
.property-modal.spp-v38 .spp-canvas-spacer{position:relative!important;display:block!important;flex:none!important;pointer-events:none!important;}
.property-modal.spp-v38 .spp-tool-rail{display:flex;flex-direction:column;align-items:stretch;gap:5px;position:relative;z-index:210}
.property-modal.spp-v38 .spp-tool-rail button{min-height:54px!important;width:64px!important;padding:5px 3px!important;border:1px solid #3d5447;border-radius:9px;background:#132019;color:#e9f2eb;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:19px;cursor:pointer;touch-action:manipulation}
.property-modal.spp-v38 .spp-tool-rail button small{font:700 8px ui-monospace,SFMono-Regular,monospace;letter-spacing:.03em;color:#b8c8bd}
.property-modal.spp-v38 .spp-tool-rail button:hover,.property-modal.spp-v38 .spp-tool-rail button:focus-visible{border-color:#9ed5aa;background:#21372a;outline:2px solid #9ed5aa55;outline-offset:1px}
.property-modal.spp-v38.spp-left-collapsed .property-tools>*:not(.spp-tool-rail){display:none!important}
.property-modal.spp-v38:not(.spp-left-collapsed) .spp-tool-rail{display:none}
.property-modal.spp-v38 .spp-paintbar{left:10px!important;right:10px!important;top:8px!important;z-index:300!important;max-width:calc(100% - 20px)!important}
.property-modal.spp-v38 .spp-paint-group:first-child{max-width:calc(100% - 120px);overflow-x:auto}
.property-modal.spp-v38 .spp-mapbar{left:10px!important;right:10px!important;bottom:9px!important;z-index:300!important}
.property-modal.spp-v38 .property-object{touch-action:none!important}
.property-modal.spp-v38 .property-canvas-wrap.spp-draw-surface{touch-action:none!important}
.property-modal.spp-v38 .property-canvas-wrap[data-tool=pan]{touch-action:none!important}
.property-modal.spp-v38 .property-head-actions{max-width:58%!important}
.property-modal.spp-v38 .property-head-actions #sppToolsToggle::after{content:' Tools'}
.property-modal.spp-v38 .property-head-actions #sppInspectorToggle::after{content:' Inspector'}
@media(min-width:901px){
  .property-modal.spp-v38 .property-tools{border-right:1px solid #30483b!important}
  .property-modal.spp-v38 .property-canvas-wrap{padding:0!important}
  .property-modal.spp-v38:not(.spp-left-collapsed){--spp-tools:285px}
  .property-modal.spp-v38:not(.spp-right-collapsed){--spp-inspector:360px}
  .property-modal.spp-v38:not(.spp-left-collapsed) .property-tools{padding:10px!important}
}
@media(max-width:900px){
  .property-modal.spp-v38 .property-workspace{grid-template-columns:1fr!important}
  .property-modal.spp-v38 .property-canvas-wrap{padding:0!important;overflow:auto!important}
  .property-modal.spp-v38 .property-canvas{left:18px!important;top:68px!important}
  .property-modal.spp-v38 .spp-tool-rail{display:none!important}
  .property-modal.spp-v38 .spp-paintbar{top:7px!important;left:7px!important;right:7px!important}
  .property-modal.spp-v38 .spp-paint-group:first-child{max-width:100%!important}
  .property-modal.spp-v38 .spp-paintbar button{min-width:48px!important;min-height:44px!important;padding:7px 9px!important}
  .property-modal.spp-v38 .property-canvas-wrap{overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important}
}
@media(max-width:600px){
  .property-modal.spp-v38 .property-canvas{left:12px!important;top:62px!important}
  .property-modal.spp-v38 .spp-paintbar{max-width:calc(100vw - 14px)!important}
  .property-modal.spp-v38 .spp-paint-group:first-child{padding-bottom:1px}
  .property-modal.spp-v38 .spp-paintbar button{min-width:54px!important;min-height:46px!important;font-size:10px!important}
  .property-modal.spp-v38 .spp-mapbar{bottom:calc(8px + env(safe-area-inset-bottom))!important}
}

/* V39 technical drafting workstation */
.property-modal.spp-v38 .spp-v39-paintbar{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;padding:6px 7px;background:#10151aef;border:1px solid #42505b;box-shadow:0 8px 28px rgba(0,0,0,.28);overflow:auto;white-space:nowrap;scrollbar-width:thin}
.property-modal.spp-v38 .spp-v39-paintbar .spp-main-tools{display:flex;flex:0 0 auto;gap:4px}
.property-modal.spp-v38 .spp-v39-paintbar .spp-v39-options,.property-modal.spp-v38 .spp-v39-paintbar .spp-v39-actions{display:flex;align-items:center;gap:4px;flex:0 0 auto;padding-left:5px;border-left:1px solid #394650}
.property-modal.spp-v38 .spp-v39-paintbar label{display:flex;align-items:center;gap:3px;color:#c9d3dc;font:700 10px ui-monospace,SFMono-Regular,monospace}
.property-modal.spp-v38 .spp-v39-paintbar select{height:34px;background:#172029;color:#eef3f7;border:1px solid #42505b;border-radius:6px;padding:3px 5px}
.property-modal.spp-v38 .spp-v39-paintbar input[type=color]{width:34px;height:34px;padding:2px;border:1px solid #42505b;border-radius:6px;background:#172029}
.property-modal.spp-v38 .spp-v39-paintbar button{min-height:36px!important;min-width:auto!important;padding:7px 10px!important;background:#182129;border-color:#40505d;color:#e9eef2}
.property-modal.spp-v38 .spp-v39-paintbar button.active{background:#2d4b3b;border-color:#9ed5aa;box-shadow:inset 0 0 0 1px #9ed5aa44}
.property-modal.spp-v38 .spp-v39-status{left:14px;bottom:64px;padding:5px 8px;border-radius:6px;background:#10151acc;border:1px solid #3b4650;color:#d8e0e7;z-index:290}
.property-modal.spp-v38 .property-object.customshape[data-shape="ellipse"]{border-radius:50%!important}
.property-modal.spp-v38 .property-object.arrow{background:transparent!important;border-top-width:0!important;border-left-width:0!important;border-right-width:0!important;border-bottom-width:4px!important;border-radius:0!important}
.property-modal.spp-v38 .property-object.arrow:after{content:"";position:absolute;right:-2px;top:50%;width:0;height:0;border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:14px solid currentColor;transform:translateY(-50%);color:inherit}
@media(max-width:900px){
 .property-modal.spp-v38 .spp-v39-paintbar{left:6px!important;right:6px!important;top:6px!important;padding:5px!important;max-width:calc(100% - 12px)!important}
 .property-modal.spp-v38 .spp-v39-paintbar .spp-v39-options,.property-modal.spp-v38 .spp-v39-paintbar .spp-v39-actions{display:none}
 .property-modal.spp-v38 .spp-v39-paintbar .spp-main-tools{overflow-x:auto;width:100%;scrollbar-width:none}
 .property-modal.spp-v38 .spp-v39-paintbar .spp-main-tools::-webkit-scrollbar{display:none}
 .property-modal.spp-v38 .spp-v39-paintbar button{min-width:54px!important;min-height:46px!important;padding:7px 9px!important;font-size:10px!important}
 .property-modal.spp-v38 .spp-v39-status{display:none}
}
@media(max-width:520px){
 .property-modal.spp-v38 .spp-v39-paintbar button{min-width:58px!important}
}

/* SPP v40 Paint Studio */
.spp-paint-modal{position:fixed;inset:0;z-index:9000;background:#10131a;color:#e9edf4;display:flex;flex-direction:column;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.spp-paint-modal.hidden{display:none}
.spp-paint-shell{display:flex;flex-direction:column;min-height:100%;height:100%;background:#e9edf4;color:#17202b}
.spp-paint-head{height:58px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 12px;background:#20242c;color:#fff;border-bottom:1px solid #39414e}
.spp-paint-brand{display:flex;align-items:center;gap:10px;min-width:180px}.spp-paint-brand>span{font-size:25px}.spp-paint-brand b{display:block;letter-spacing:.08em;font-size:14px}.spp-paint-brand small{display:block;font-size:9px;opacity:.65;letter-spacing:.08em}.spp-paint-head-actions{display:flex;gap:6px;overflow:auto}.spp-paint-head .ghost,.spp-paint-head .primary{min-height:34px;white-space:nowrap}
.spp-paint-ribbon{display:flex;gap:12px;align-items:stretch;overflow:auto;padding:7px 10px;background:#f7f8fa;border-bottom:1px solid #c9ced6;box-shadow:0 1px 4px #0002}.spp-paint-toolbox,.spp-paint-group{padding:3px 9px;border-right:1px solid #d0d4db;min-width:max-content}.spp-paint-group>b,.spp-paint-toolbox>b{display:block;font-size:9px;letter-spacing:.1em;color:#596271;margin-bottom:4px}.spp-paint-tool-grid{display:grid;grid-template-columns:repeat(5,minmax(48px,1fr));gap:3px}.spp-paint-tool{border:1px solid transparent;background:transparent;border-radius:5px;padding:4px 6px;min-height:48px;cursor:pointer;color:#27303b}.spp-paint-tool span{display:block;font-size:18px;line-height:18px}.spp-paint-tool small{font-size:9px}.spp-paint-tool:hover{background:#e5e9ef}.spp-paint-tool.active{background:#d9e8ff;border-color:#78a8e8;box-shadow:inset 0 -2px #2c70cf}
.spp-paint-group label{font-size:11px;display:flex;align-items:center;gap:7px;margin:5px 0}.spp-paint-group input[type=range]{width:115px}.spp-paint-group output{width:38px;text-align:right;font-variant-numeric:tabular-nums}.spp-swatch-pair{display:flex;align-items:center;gap:4px;margin-bottom:3px}.spp-big-swatch{width:32px;height:28px;border:2px solid #555;box-shadow:2px 2px 0 #999;cursor:pointer}.spp-big-swatch+button{margin-left:-12px;transform:translate(10px,6px)}.spp-palette{display:grid;grid-template-columns:repeat(12,18px);gap:2px}.spp-palette-swatch{width:18px;height:18px;border:1px solid #777;background:var(--sw);padding:0;cursor:pointer}.spp-paint-actions{display:flex;gap:3px;align-items:center}.spp-paint-actions .ghost{padding:5px 8px;min-height:28px}.spp-paint-status-group{min-width:150px}.spp-paint-status-group #paintStatus{font-size:11px;color:#465365}
.spp-paint-main{display:grid;grid-template-columns:210px minmax(0,1fr) 245px;min-height:0;flex:1}.spp-paint-left,.spp-paint-right{background:#f7f8fa;padding:10px;overflow:auto;border-right:1px solid #c9ced6}.spp-paint-right{border-right:0;border-left:1px solid #c9ced6}.spp-paint-panel-title{font-size:10px;font-weight:800;letter-spacing:.1em;color:#596271;margin:2px 0 9px}.spp-paint-layers{display:flex;flex-direction:column;gap:3px;margin-bottom:10px}.spp-paint-layer{display:flex;gap:7px;align-items:center;text-align:left;border:1px solid #d1d6de;background:#fff;border-radius:4px;padding:7px;cursor:pointer;color:#27303b;min-height:34px}.spp-paint-layer.active{border-color:#4387df;background:#e8f1ff}.spp-paint-layer span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.spp-paint-help{margin-top:16px;padding:9px;background:#eef1f5;border:1px solid #d5dae2;border-radius:5px;font-size:10px;display:grid;gap:5px;color:#566170}.spp-paint-help b{color:#26303d}
.spp-paint-stage-wrap{position:relative;overflow:auto;background:#aeb5bf;padding:45px 45px 55px;min-width:0;min-height:0;display:flex;touch-action:pan-x pan-y}.spp-paint-stage{position:relative;width:1200px;height:800px;margin:auto;flex:0 0 auto;touch-action:none;box-shadow:0 5px 22px #0004;background:#fff}.spp-paint-stage:before{content:"";position:absolute;inset:0;pointer-events:none;background-image:linear-gradient(#8ca0b722 1px,transparent 1px),linear-gradient(90deg,#8ca0b722 1px,transparent 1px);background-size:20px 20px;opacity:.0}.spp-paint-stage.grid:before{opacity:1}.spp-paint-stage canvas{position:absolute;inset:0;width:100%;height:100%}.spp-paint-ruler{position:absolute;background:#e4e7eb;color:#657080;font:9px ui-monospace,monospace;z-index:4;overflow:hidden}.spp-paint-ruler.top{top:8px;left:45px;right:45px;height:26px}.spp-paint-ruler.left{top:45px;left:8px;bottom:55px;width:26px}.spp-paint-inspector{display:grid;gap:7px;margin-bottom:18px}.spp-paint-inspector label,.spp-paint-right>label{font-size:11px;display:grid;gap:3px}.spp-paint-inspector input,.spp-paint-inspector textarea,.spp-paint-right input{width:100%;box-sizing:border-box;padding:6px;border:1px solid #c6ccd5;border-radius:4px;background:#fff;color:#18212c}.spp-paint-right .wide{margin-top:6px}
@media(max-width:1050px){.spp-paint-main{grid-template-columns:170px minmax(0,1fr)}.spp-paint-right{display:none}.spp-paint-tool-grid{grid-template-columns:repeat(5,46px)}}
@media(max-width:700px){.spp-paint-head{height:auto;min-height:52px;align-items:flex-start}.spp-paint-brand small{display:none}.spp-paint-head-actions{max-width:60%;flex-wrap:wrap}.spp-paint-ribbon{gap:6px}.spp-paint-toolbox{min-width:250px}.spp-paint-group{padding-right:7px}.spp-paint-main{grid-template-columns:1fr}.spp-paint-left{position:absolute;z-index:8;left:0;top:116px;bottom:0;width:230px;transform:translateX(-102%);transition:transform .2s}.spp-paint-stage-wrap{padding:40px 18px 40px}.spp-paint-ruler.top{left:18px;right:18px}.spp-paint-ruler.left{left:4px}.spp-paint-brand{min-width:120px}}

/* v40.6 UI reliability — mobile Paint layers, safe-area controls, and touch targets */
.spp-paint-head-actions{scrollbar-width:none}
.spp-paint-head-actions::-webkit-scrollbar{display:none}
.spp-paint-head-actions button{touch-action:manipulation}
@media(max-width:700px){
  .spp-paint-modal{padding-bottom:env(safe-area-inset-bottom)}
  .spp-paint-head{padding-top:max(7px,env(safe-area-inset-top));}
  .spp-paint-head-actions{max-width:72%;overflow-x:auto;flex-wrap:nowrap}
  .spp-paint-head-actions button{min-height:40px;flex:0 0 auto}
  .spp-paint-left{display:block;transform:translateX(-102%);pointer-events:none}
  .spp-paint-left.mobile-open{transform:translateX(0);pointer-events:auto;box-shadow:12px 0 30px rgba(0,0,0,.25)}
  .spp-paint-stage-wrap{touch-action:none}
  .spp-paint-stage{margin:0 auto}
}
/* v40.8: object-properties inspector becomes a right slide-over on tablet/phone,
   where it was previously display:none with no way to open it. */
#paintInspectorToggle{display:none}
@media(max-width:1050px){
  #paintInspectorToggle{display:inline-flex}
  .spp-paint-right{display:block;position:absolute;z-index:8;right:0;top:116px;bottom:0;width:252px;transform:translateX(102%);transition:transform .2s;pointer-events:none;border-left:1px solid #c9ced6;box-shadow:-12px 0 30px rgba(0,0,0,.25)}
  .spp-paint-right.mobile-open{transform:translateX(0);pointer-events:auto}
}
@media(max-width:430px){
  .spp-paint-brand{min-width:96px}
  .spp-paint-brand>b{font-size:12px}
  .spp-paint-head-actions{max-width:68%}
  .spp-paint-head-actions button{padding:7px 8px}
  .spp-paint-ribbon{padding-left:6px;padding-right:6px}
}

/* ============ v40.8 additions ============ */
/* Paint Studio image objects on the property map */
.property-object.paint-image{background:#fff;border-style:dashed}
.property-object.paint-image img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none}
.property-object.paint-image .paint-image-caption{position:absolute;left:0;right:0;bottom:-19px;text-align:center;font-size:10px;line-height:14px;color:#33414f;background:#ffffffd9;border-radius:3px;padding:1px 4px}
/* Load-design dialog */
.spp-design-list{display:flex;flex-direction:column;gap:8px;max-height:46vh;overflow:auto;margin:10px 0}
.spp-design-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 11px;border:1px solid #d7dde3;border-radius:8px;background:#fbfcfd}
.spp-design-row .tiny{color:#66707c}
.spp-design-row-btns{display:flex;gap:6px;flex-shrink:0}
.spp-design-actions{display:flex;justify-content:flex-end;margin-top:6px}
/* 3D depth: extruded walls + rooms, soft object shadows */
.property-canvas.property-3d .property-object{box-shadow:0 16px 26px #00000055}
.property-canvas.property-3d .property-object.wall::after,.property-canvas.property-3d .property-object.room::after{content:"";position:absolute;left:4px;right:-4px;top:calc(var(--spp-extrude,13px) * -1);height:var(--spp-extrude,13px);background:inherit;border:1px solid #0000002e;border-bottom:0;transform:skewX(-55deg);transform-origin:bottom left;filter:brightness(1.12);pointer-events:none}
.property-canvas.property-3d .property-object.room::after{left:8px;right:-8px;filter:brightness(1.07)}
/* header actions wrap instead of overflowing */
.property-head-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.property-head-actions .ghost,.property-head-actions .primary{white-space:nowrap}
/* touch-sized resize handles */
@media(pointer:coarse){
  .resize-handle{width:22px!important;height:22px!important;min-width:22px!important;border-width:3px!important}
  .resize-handle.nw{left:-12px;top:-12px}.resize-handle.ne{right:-12px;top:-12px}
  .resize-handle.sw{left:-12px;bottom:-12px}.resize-handle.se{right:-12px;bottom:-12px}
  .property-object{min-width:24px;min-height:24px}
}
/* paint header: hide undo/redo on small screens by class (Send to Map stays visible) */
@media(max-width:700px){
  .spp-paint-head-actions .paint-compact-hide{display:none}
}

/* ===== v40.10 mobile: ONE coherent layout. Neutralizes every legacy scale hack above. ===== */
/* Desktop: studio bar docks above the zoom mapbar so the two never overlap. */
.spp-studio-bar{bottom:70px!important;top:auto!important;}
@media(max-width:900px){
  /* Single-column workspace; the canvas wrap is a plain scroll container (no flex centering). */
  .property-modal .property-workspace{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:minmax(0,1fr)!important;}
  .property-modal .property-canvas-wrap{display:block!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important;touch-action:pan-x pan-y!important;min-height:0!important;padding:12px!important;align-items:stretch!important;justify-content:flex-start!important;}
  /* Canvas keeps its exact pixel size; JS inline transform (zoom) always wins over this. */
  .property-modal .property-canvas{transform:none;margin:0 auto 14px!important;min-width:0!important;touch-action:none!important;}
  .property-modal.spp-v38 .property-canvas{left:12px!important;top:126px!important;}
  /* Every header button stays visible and reachable: one scrollable row. */
  #pdNew,#pdSave,#pdLoad,#pdReport,#pdHelp{display:inline-block!important;}
  .property-head-actions{flex-wrap:nowrap!important;overflow-x:auto!important;}
  .property-head-actions .ghost,.property-head-actions .primary{flex:0 0 auto!important;}
  /* Bars stack without overlapping: draw tools top, zoom strip under them, studio bar bottom. */
  .spp-paintbar{top:6px!important;left:6px!important;right:6px!important;}
  .spp-mapbar{top:66px!important;bottom:auto!important;left:6px!important;right:6px!important;}
  .spp-studio-bar{bottom:6px!important;top:auto!important;}
  .property-canvas-wrap{padding-bottom:150px!important;}
}

/* ================= v40.12: "way better" pass ================= */
/* 1. Inner scroll viewport: the wrap stops being the scroller, so the pinned
      paintbar / zoom mapbar / studio bar no longer scroll away with the map. */
@media screen{
.property-canvas-wrap{overflow:hidden!important}
.spp-canvas-scroll{position:absolute!important;inset:0!important;overflow:auto!important;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;display:block!important;padding:40px 32px 60px;box-sizing:border-box}
}
@media print{
/* printing: flatten the scroller so the whole map prints */
.spp-canvas-scroll{position:static!important;overflow:visible!important;padding:0!important;display:block!important}
}
@media screen and (max-width:900px){
  .property-canvas-wrap{overflow:hidden!important;padding:0!important}
  .spp-canvas-scroll{padding:120px 12px 160px!important}
  /* the zoom bar was display:none on mobile — re-enabled, parked under the paintbar */
  .spp-mapbar{display:flex!important;top:66px!important;bottom:auto!important;left:6px!important;right:6px!important}
}
/* 2. Header: never clip the action row again at any width. Title truncates with
      an ellipsis; the buttons scroll horizontally instead of vanishing. */
.property-head{gap:10px}
.property-head>div:first-child{flex:0 1 auto!important;min-width:0!important;overflow:hidden}
.property-title{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:100%!important}
.property-head-actions{flex:1 1 auto!important;min-width:0!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;justify-content:flex-start!important;scrollbar-width:thin}
.property-head-actions .ghost,.property-head-actions .primary{flex:0 0 auto!important;white-space:nowrap!important}
/* 3. Object labels: no more mid-word ellipsis ("Kitche", "DC- …") — labels may
      extend past small symbols instead of being cut. */
.property-object .property-label{overflow:visible!important;max-width:none!important;white-space:nowrap!important;text-overflow:clip!important}
/* 4. Measurement mode visuals + active state */
.spp-measure-line{position:absolute;height:3px;background:#d97706;box-shadow:0 0 0 1px #fff;transform-origin:left center;z-index:60;pointer-events:none}
.spp-measure-tag{position:absolute;z-index:61;pointer-events:none;background:#d97706;color:#fff;font:700 11px system-ui,sans-serif;padding:2px 8px;border-radius:9px;white-space:nowrap;box-shadow:0 1px 4px #0006}
.spp-measure-mode #pdCanvas{cursor:crosshair!important}
#sppMeasure.active{outline:2px solid #d97706!important;outline-offset:1px}
/* 5. Paintbar must never drop below the canvas as a static block again */
.spp-paintbar{position:absolute!important;z-index:200}
/* 6. Toasts above everything on mobile drawers */
.spp-toast{z-index:13000!important}

/* v40.15: notebook theme moved to the full variable block in the themes section above;
   only its ruled-lines/margin decorations remain there. */

/* v40.15: variable-driven components — every theme in the settings dropdown now
   re-skins the whole app. :root defaults reproduce the original dark look exactly. */
.top{background-color:var(--header-bg)}
.status{color:var(--banner-text);border-color:var(--banner-border)}
.ghost{background-color:var(--btn-bg);color:var(--btn-text);border-color:var(--btn-border)}
.primary{background-color:var(--accent);color:var(--primary-text);border-color:var(--primary-border)}
.security-banner{color:var(--banner-text);border-color:var(--banner-border)}
.shield{border-color:var(--shield-border);color:var(--shield-text)}
.msg{color:var(--msg-text)}
.tab{background-color:var(--tab-bg);color:var(--tab-text);border-color:var(--tab-border)}
.tab.active{color:var(--tab-active-text);border-color:var(--tab-active-border);background-color:var(--tab-active-bg)}
.panel label,.modal-box label{color:var(--label-text)}
.panel input,.modal-box input,.modal-box select{background-color:var(--input-bg);color:var(--input-text);border-color:var(--input-border)}
.panel input:focus,.modal-box input:focus,.modal-box select:focus{border-color:var(--focus-ring);box-shadow:0 0 0 2px color-mix(in srgb,var(--focus-ring) 30%,transparent)}
.sidebar{background-color:var(--sidebar-bg)}
.filter{background-color:var(--editor-bg);color:var(--input-text);border-color:var(--input-border)}
.folder-title{color:var(--folder-title-text)}
.folder-title span{color:var(--folder-count)}
.tree-page{background-color:var(--btn-bg);color:var(--tree-text)}
.tree-page.active{background-color:var(--tree-active-bg);color:var(--tree-active-text);border-color:var(--tree-active-border)}
.tabsbar{background-color:var(--sidebar-bg)}
.page-tab{background-color:var(--pagetab-bg);color:var(--pagetab-text);border-color:var(--pagetab-border)}
.page-tab.active{color:var(--pagetab-active-text);border-color:var(--pagetab-active-border);background-color:var(--pagetab-active-bg)}
.title{color:var(--title-text)}
.editor textarea{background-color:var(--editor-bg);color:var(--editor-text)}
.editor-foot select{background-color:var(--btn-bg);color:var(--btn-text);border-color:var(--input-border)}
.editor-tools{background:color-mix(in srgb,var(--sidebar-bg) 82%,transparent)}
.modal-box{background-color:var(--modal-bg);border-color:var(--modal-border)}
.modal-close{color:var(--tree-text)}
.modal-box p{color:var(--modal-p-text)}
.secret-box{background-color:var(--input-bg);border-color:var(--input-border)}
.page-kind{color:var(--kind-text);border-color:var(--kind-border)}
.kb-lead{color:var(--kb-lead-text)}
.kb-grid h3{color:var(--kb-h3-text)}
.kb-grid p{color:var(--kb-p-text)}
.kb-warning{color:var(--kb-warn-text);border-color:var(--kb-warn-border)}

/* ================= v40.15: designer header overflow fix ================= */
/* The header's 14 action buttons overflowed leftward and became unreachable:
   competing rules set max-width:58% + justify-content:flex-end, which pushes
   overflow to the unreachable left side. This definitive block makes the
   actions row scroll from the start and lets the header wrap on narrow screens. */
.property-head{flex-wrap:wrap!important;row-gap:6px}
.property-head-actions{flex:1 1 auto!important;min-width:0!important;max-width:none!important;justify-content:flex-start!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:thin}
.property-head-actions::-webkit-scrollbar{height:6px}
.property-head-actions::-webkit-scrollbar-thumb{background:#71809688;border-radius:3px}
.property-head-actions button{flex:0 0 auto!important}
/* v40.39: main app header overflow fix (Claude headless-test finding) —
   11 header buttons pushed off-screen on desktop with no way to reach them.
   Same treatment as the v40.15 designer-header fix: scrollable from the start. */
.top{flex-wrap:wrap!important;row-gap:8px}
.head-actions{flex:1 1 auto!important;min-width:0!important;max-width:none!important;justify-content:flex-start!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:thin}
.head-actions::-webkit-scrollbar{height:6px}
.head-actions::-webkit-scrollbar-thumb{background:#71809688;border-radius:3px}
.head-actions button{flex:0 0 auto!important}

/* v40.19: Paint Studio spotlight CTA — fixed high-contrast colors so it pops in every theme */
.paint-cta{border-radius:7px;padding:9px 14px;font-weight:800;letter-spacing:.02em;background:linear-gradient(135deg,#ffc53d,#ff8a1e);color:#241300;border:1px solid #ffe1a1;box-shadow:0 0 16px #ff9a2a55,0 2px 8px #0006;animation:paintCtaPulse 1.8s ease-in-out 3;white-space:nowrap}
.paint-cta:hover{filter:brightness(1.07)}
.paint-cta:active{transform:translateY(1px)}
@keyframes paintCtaPulse{0%,100%{box-shadow:0 0 12px #ff9a2a44,0 2px 8px #0006}50%{box-shadow:0 0 30px #ff9a2acc,0 2px 10px #0007;transform:scale(1.045)}}
@media (prefers-reduced-motion:reduce){.paint-cta{animation:none}}

/* v40.20 folder-style pages (tabs) */
.spp-page-tabs{display:flex;gap:4px;align-items:flex-end;padding:8px 16px 0;border-bottom:1px solid var(--line);background:var(--sidebar-bg);overflow-x:auto;flex:none}
.spp-page-tab{display:flex;align-items:center;gap:7px;background:var(--pagetab-bg);color:var(--pagetab-text);border:1px solid var(--pagetab-border);border-bottom:0;border-radius:9px 9px 0 0;padding:8px 10px;font-size:10px;white-space:nowrap;max-width:220px}
.spp-page-tab.active{background:var(--pagetab-active-bg);color:var(--pagetab-active-text);border-color:var(--pagetab-active-border);font-weight:700}
.spp-page-tab-icon{font-size:12px}
.spp-page-tab-name{overflow:hidden;text-overflow:ellipsis}
.spp-page-tab-x{display:grid;place-items:center;width:18px;height:18px;border-radius:50%;font-size:12px;line-height:1;color:var(--muted)}
.spp-page-tab-x:hover{background:#69343e;color:#ffb8c2}
.spp-page-add{flex:none;background:transparent;color:var(--muted);border:1px dashed var(--tab-border);border-radius:9px 9px 0 0;padding:8px 12px;font-size:10px;margin-left:4px}
.spp-page-add:hover{color:var(--text);border-color:var(--focus-ring)}
.spp-page-kind-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.spp-page-kind{display:flex;align-items:center;gap:10px;padding:12px;text-align:left}
.spp-page-kind b{font-size:18px}
/* document editor for non-map pages */
.property-workspace.spp-page-mode{grid-template-columns:minmax(0,1fr)}
.property-workspace.spp-page-mode .property-tools,.property-workspace.spp-page-mode .property-inspector{display:none}
.spp-page-editor{flex:1;overflow:auto;padding:22px;max-width:980px;margin:0 auto;width:100%}
.spp-pe-head{display:flex;align-items:baseline;gap:12px;margin-bottom:6px;flex-wrap:wrap}
.spp-pe-head h3{margin:0;font-size:15px;letter-spacing:.04em}
.spp-pe-actions{margin:10px 0}
.spp-pe-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:9px}
.spp-pe-table{width:100%;border-collapse:collapse;font-size:11px}
.spp-pe-table th{font-size:9px;letter-spacing:.08em;color:var(--muted);text-align:left;padding:9px 10px;border-bottom:1px solid var(--line);background:var(--panel2)}
.spp-pe-table td{padding:6px 8px;border-bottom:1px solid var(--line)}
.spp-pe-table tr:last-child td{border-bottom:0}
.spp-pe-table input{width:100%;background:var(--input-bg);color:var(--input-text);border:1px solid var(--input-border);border-radius:6px;padding:8px;font-size:11px}
.spp-pe-table input:focus{border-color:var(--focus-ring);outline:none}
.spp-pe-notes{width:100%;min-height:320px;background:var(--input-bg);color:var(--input-text);border:1px solid var(--input-border);border-radius:9px;padding:14px;font-size:12px;line-height:1.7;resize:vertical}
.spp-pe-count{text-align:right;margin-top:6px}
.spp-pe-progress{font-size:11px;margin:8px 0;color:var(--muted)}
.spp-pe-progress b{color:var(--text)}
.spp-pe-check-list{display:grid;gap:8px;margin-bottom:6px}
.spp-pe-check-row{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:var(--panel2)}
.spp-pe-check-row input[type=checkbox]{width:18px;height:18px;accent-color:var(--accent);flex:none}
.spp-pe-check-row input[type=text]{flex:1;background:var(--input-bg);color:var(--input-text);border:1px solid var(--input-border);border-radius:6px;padding:8px;font-size:11px}
.spp-pe-del{flex:none;padding:6px 10px}
/* print: documentation pages */
.print-checklist{display:grid;gap:6px}
.print-check-row{display:flex;gap:10px;align-items:baseline;font-size:11pt}
@media(max-width:700px){
  .spp-page-tabs{padding:6px 8px 0}
  .spp-page-tab{max-width:150px}
  .spp-page-editor{padding:14px}
  .spp-page-kind-grid{grid-template-columns:1fr}
}
@media print{.spp-page-tabs{display:none!important}}

/* v40.20 3D expansion: route animation + studio checkbox */
.spp-check{display:flex!important;align-items:center;gap:8px;flex-direction:row!important}
.spp-check input{width:auto}
.property-canvas.spp-route-anim .property-object.route::after,.property-canvas.spp-route-anim .property-object.arrow::after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(90deg,rgba(255,255,255,.9) 0 10px,transparent 10px 22px);animation:sppRouteMarch 1s linear infinite;border-radius:inherit}
@keyframes sppRouteMarch{to{background-position:22px 0}}
@media (prefers-reduced-motion:reduce){.property-canvas.spp-route-anim .property-object.route::after,.property-canvas.spp-route-anim .property-object.arrow::after{animation:none}}

/* v40.20 object list / search */
.spp-obj-list{display:grid;gap:4px;max-height:280px;overflow:auto;margin-top:6px}
.spp-obj-row{display:flex;align-items:center;gap:8px;background:var(--panel2);border:1px solid var(--line);border-radius:7px;padding:7px 9px;font-size:10px;color:var(--text);text-align:left;width:100%}
.spp-obj-row:hover{border-color:var(--focus-ring)}
.spp-obj-row.active{border-color:var(--focus-ring);box-shadow:0 0 0 1px var(--focus-ring)}
.spp-obj-row .ico{font-size:13px;flex:none}
.spp-obj-row .nm{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.spp-obj-row small{color:var(--muted);flex:none}
/* v40.20 evacuation poster */
.spp-evac-poster .spp-print-paper{font-family:Arial,Helvetica,sans-serif}
.spp-evac-poster .evac-title{text-align:center;border:6px solid #b00020;border-radius:12px;padding:18px;margin-bottom:14px}
.spp-evac-poster .evac-title h1{font-size:30pt;margin:0 0 6px;color:#b00020;letter-spacing:.02em}
.spp-evac-poster .evac-title h2{font-size:18pt;margin:0 0 4px}
.spp-evac-poster .evac-title p{margin:2px 0}
.spp-evac-poster section h2{font-size:16pt;border-bottom:3px solid #17241d;padding-bottom:4px}
.spp-evac-poster .evac-list{columns:2;font-size:12pt;line-height:1.6}
.spp-evac-poster .evac-instructions ol{font-size:13pt;line-height:1.8}
.spp-evac-poster .evac-instructions{background:#fff8e6;border:2px solid #b8860b;border-radius:10px;padding:12px 18px}
/* v40.20 ink-saver print mode */
.spp-ink-saver .spp-print-paper{background:#fff!important}
.spp-ink-saver .spp-print-paper *{background:transparent!important;color:#000!important;box-shadow:none!important;text-shadow:none!important;border-color:#000!important}
.spp-ink-saver .print-map svg{filter:grayscale(1) contrast(1.15)}
.spp-ink-saver .evac-title{border-color:#000!important}
.spp-ink-saver .evac-title h1{color:#000!important}
.spp-ink-saver .evac-instructions{border-color:#000!important}
@media print{.spp-obj-list,.spp-page-tabs{display:none!important}}


/* ===== v40.22 responsive QA hardening =====
   Verified against the v40.21 DOM/CSS structure. These rules are intentionally
   last so they override legacy responsive patches without removing features.
*/
html,body{width:100%;max-width:100%;overflow-x:hidden}
button,input,textarea,select{max-width:100%}
img,svg,canvas{max-width:100%}

/* Header: never let a growing action set push the brand off-screen. */
.top{min-width:0}
.top>div:first-child{min-width:0;max-width:100%}
.brand{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.head-actions{min-width:0;max-width:68vw;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;scrollbar-width:thin}
.head-actions>*{flex:0 0 auto}

/* Main vault: preserve the existing desktop camera/zoom behavior, but prevent
   accidental page-level horizontal scrollbars at narrow widths. */
.vault{max-width:calc(100vw - 24px);min-width:0}
.editor,.editor-head,.editor-foot,.tabsbar{min-width:0}
.actions{min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap}
.actions>*{flex:0 0 auto}

/* Auth panel is comfortable on small phones and respects notches. */
.panel{max-width:calc(100vw - 28px)}
@media(max-width:850px){
  .top{width:100%;padding-top:max(10px,env(safe-area-inset-top));padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));align-items:center}
  .top>div:first-child{flex:1 1 auto;min-width:0}
  .brand{font-size:clamp(11px,3.1vw,14px);letter-spacing:.08em;white-space:normal;line-height:1.25}
  .sub{max-width:100%;font-size:8px}
  .head-actions{flex:0 1 auto;max-width:58vw;padding-bottom:2px}
  .head-actions .ghost{display:inline-block}
  .vault{width:100%;max-width:none;margin:0;height:calc(100dvh - 64px);min-height:0;border-radius:0}
  .editor-head{flex-wrap:wrap;row-gap:6px}
  .title{min-width:120px}
  .editor-foot{padding-bottom:max(8px,env(safe-area-inset-bottom))}
  .modal{padding:max(9px,env(safe-area-inset-top)) max(9px,env(safe-area-inset-right)) max(9px,env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left))}
  .modal-box{max-height:calc(100dvh - 18px);overflow:auto}
}

/* Small phones: make the login view vertically efficient and controls easy to tap. */
@media(max-width:480px){
  .panel{width:calc(100vw - 20px);margin:3vh auto 0;padding:18px}
  .tabs{gap:4px}
  .tab{padding:10px 8px;font-size:11px}
  .panel label{margin:12px 0}
  .panel input{padding:13px 11px}
  .panel .primary,.wide{min-height:44px}
  .security-banner{font-size:8px}
  .shield{margin-bottom:12px}
  .boot .terminal{width:calc(100vw - 30px);font-size:10px}
}

/* Property Designer / Paint Studio: keep dialogs inside the visual viewport. */
.property-modal{max-width:96vw;max-height:94dvh}
@media(max-width:900px){
  .property-modal{inset:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));max-width:none;max-height:none}
  .property-head{min-width:0}
  .property-title{min-width:0;flex:1 1 auto}
  .property-head-actions{min-width:0;max-width:100%;flex:1 1 100%}
}
@media(max-width:700px){
  .property-modal{border-radius:10px}
  .property-head{padding:9px 10px}
  .property-head-actions button{min-height:42px}
  .spp-page-editor{padding-bottom:calc(18px + env(safe-area-inset-bottom))}
}

/* Tables and long values must scroll inside their component, never the page. */
.spp-pe-table-wrap,.spp-obj-list,.kb,.note-list{max-width:100%;overflow-x:auto}
.spp-pe-table{min-width:560px}
@media(max-width:700px){.spp-pe-table{min-width:500px}}

/* Respect accessibility settings globally. */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}
}

/* Safe-area support for the full-screen Paint Studio. */
.spp-paint-modal{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}


/* ===== v40.39 mobile + desktop layout (last-wins) ===== */
html,body{width:100%;max-width:100%;overflow-x:clip;min-height:100%;min-height:100dvh}
button,input,textarea,select{max-width:100%}
.property-canvas,.property-canvas canvas,.spp-paint-stage,.spp-paint-stage canvas,#paintCanvas,#paintOverlay,.property-ink{
  max-width:none!important
}

/* Vault camera-zoom was scaling the whole app and causing overflow. */
.vault{transform:none!important;max-width:min(1500px,calc(100vw - 24px));min-width:0}

.brand-block,.top>div:first-child{min-width:0;max-width:100%}
.brand{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sub{max-width:100%}
.head-toolbar{display:flex;align-items:center;gap:8px;min-width:0}
.head-actions{display:flex;align-items:center;gap:7px;min-width:0;max-width:min(68vw,920px);overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
.head-actions>*{flex:0 0 auto}
.menu-toggle,.pages-toggle{display:none}

/* Never hide vault chrome buttons — they live in the scroll row / menu. */
.head-actions .ghost,.head-actions .danger,.head-actions .paint-cta,.head-actions .primary,
.head-actions #notesBtn,.head-actions #settingsBtn,.head-actions #kbBtn,.head-actions #guideBtn{
  display:inline-flex!important;align-items:center;justify-content:center
}
.head-actions .hidden{display:none!important}

/* Auth panel */
.panel{width:min(500px,calc(100% - 28px));max-width:calc(100vw - 28px)}
.math-row{flex-wrap:wrap}
.math-row input{width:72px!important;min-height:44px}
.panel .primary,.panel .wide,.tab{min-height:44px}

/* Property / paint dialogs fill the visual viewport. */
.property-modal{max-width:100vw;max-height:100dvh;inset:2vh 1.5vw}
.spp-paint-modal{inset:0;height:100dvh;max-height:100dvh;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}

/* Tables stay inside their component. */
.spp-pe-table-wrap,.spp-obj-list,.kb,.note-list,.spp-design-list{max-width:100%;overflow-x:auto}

/* Sidebar overlay + nav drawer */
.sidebar-backdrop{display:none}
body.sidebar-open .sidebar-backdrop,body.nav-open .nav-backdrop{display:block}

@media(max-width:1100px){
  .top{height:auto;min-height:64px;padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top));align-items:center;gap:10px}
  .brand{font-size:clamp(11px,3.1vw,14px);letter-spacing:.08em;white-space:normal;line-height:1.25}
  .sub{font-size:8px;max-width:100%;line-height:1.4}
  .menu-toggle{display:inline-flex!important;min-width:44px;min-height:44px}
  .head-actions{
    display:none;position:absolute;z-index:80;top:100%;left:8px;right:8px;
    max-width:calc(100vw - 16px);width:auto;
    flex-direction:column;align-items:stretch;flex-wrap:nowrap;overflow:auto;
    max-height:min(70dvh,520px);padding:8px;gap:6px;
    background:var(--header-bg,var(--panel));border:1px solid var(--line);border-radius:12px;
    box-shadow:0 18px 50px #0007
  }
  body.nav-open .head-actions{display:flex}
  .head-actions>*{width:100%;justify-content:flex-start}
  .head-toolbar{position:static}
}

@media(max-width:900px){
  .pages-toggle{display:inline-flex!important;min-width:44px;min-height:44px}
  .pages-toggle.hidden{display:none!important}
  .vault{width:100%;max-width:none;margin:0;border-radius:0;border-left:0;border-right:0;height:calc(100dvh - 64px);min-height:0;grid-template-columns:1fr}
  .sidebar{
    display:none;position:fixed;z-index:90;left:0;top:0;bottom:0;
    width:min(320px,88vw);padding-top:max(13px,env(safe-area-inset-top));
    background:var(--sidebar-bg,var(--panel));box-shadow:18px 0 40px #0008;overflow:auto
  }
  body.sidebar-open .sidebar{display:block}
  .editor-head{flex-wrap:wrap;row-gap:6px}
  .title{min-width:120px}
  .editor-foot{padding-bottom:max(8px,env(safe-area-inset-bottom));flex-wrap:wrap}
  .editor-tools{overflow:auto}
  .page-kind{display:none}
  .actions{min-width:0;max-width:100%;overflow-x:auto}
  .modal{padding:max(9px,env(safe-area-inset-top)) max(9px,env(safe-area-inset-right)) max(9px,env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left))}
  .modal-box{max-height:calc(100dvh - 18px);overflow:auto;width:min(560px,100%)}
}

@media(max-width:480px){
  .panel{width:calc(100vw - 20px);margin:3vh auto 0;padding:18px}
  .tabs{gap:4px}
  .tab{padding:10px 8px;font-size:11px}
  .panel input{padding:13px 11px;min-height:44px}
  .security-banner{font-size:8px;line-height:1.45}
  .boot .terminal{width:calc(100vw - 30px);font-size:10px}
  .shield{margin-bottom:12px}
}

@media(max-width:900px){
  .property-modal{
    inset:0!important;max-width:none!important;max-height:none!important;border-radius:0!important;
    padding-top:env(safe-area-inset-top)
  }
  .property-head{min-width:0}
  .property-head-actions{min-width:0;max-width:100%;flex:1 1 100%;overflow-x:auto;flex-wrap:nowrap}
  .property-head-actions button{min-height:42px}
  /* Kill every leftover scale() hack from older patches. */
  .property-canvas{transform:var(--spp-transform,none)!important;margin-right:0!important;margin-bottom:0!important}
}

@media(max-width:700px){
  .property-modal .property-canvas{transform:var(--spp-transform,none)!important}
  .spp-paint-head{padding-top:max(7px,env(safe-area-inset-top))}
  .spp-paint-head-actions{overflow-x:auto;flex-wrap:nowrap;max-width:100%}
  .spp-paint-head-actions button{min-height:40px;flex:0 0 auto}
  .spp-paint-ribbon{overflow-x:auto;-webkit-overflow-scrolling:touch}
  #paintLayersToggle,#paintInspectorToggle{display:inline-flex!important}
}

@media(min-width:1101px){
  .menu-toggle,.pages-toggle{display:none!important}
  .head-actions{display:flex!important;position:static;flex-direction:row;max-height:none;width:auto;background:transparent;border:0;box-shadow:none;padding:0}
}

/* Paint studio: keep drawing surface from being width-clamped. */
.spp-paint-stage{width:1200px;height:800px}
.spp-paint-stage canvas{width:100%!important;height:100%!important}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}
}

/* ===== v40.39 mobile map repair (last-wins) ===== */
/* The v38 "map is the application" layer was built for desktop: it forces
   .property-tools to position:relative (killing the v34 <=900px bottom sheet)
   and .property-canvas to position:absolute (fighting the v40.12 inner scroll
   box). On phones this left a black void where the map should be.
   At <=900px, neutralize those v38 rules so the designed mobile layout works:
   bottom-sheet tools + in-flow canvas inside the v40.12 scroll box. */
@media(max-width:900px){
  .property-modal.spp-v38 .property-tools{position:absolute!important}
  .property-modal.spp-v38 .property-canvas{position:relative!important;left:auto!important;top:auto!important;transform:var(--spp-transform,none)!important}
  .property-modal.spp-v38 .property-canvas-wrap{overflow:hidden!important}
  .property-modal.spp-v38 .spp-canvas-scroll{position:absolute!important;inset:0!important;overflow:auto!important}
}

/* ===== v40.39 paint studio: responsive on small screens ===== */
/* The paint stage is fixed 1200x800; on phones the JS fitPaint() scales it,
   but if the container has no size yet the canvas can render black.
   Ensure the modal and stage-wrap always have a usable size. */
@media(max-width:1100px){
  .spp-paint-modal{position:fixed!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;border-radius:0!important}
  .spp-paint-stage-wrap{min-height:50vh!important;min-width:200px!important}
  .spp-paint-stage{min-width:200px!important;min-height:150px!important}
}

/* ===== v40.39: touch-friendly resize handles ===== */
/* 12px handles are unusable on touch screens. On coarse-pointer devices,
   enlarge to 28px with a larger hit area so Send-to-Map images and all
   map objects can be resized by finger. */
@media (pointer:coarse){
  .resize-handle{width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important}
  .resize-handle.nw{left:-14px!important;top:-14px!important}
  .resize-handle.ne{right:-14px!important;top:-14px!important}
  .resize-handle.sw{left:-14px!important;bottom:-14px!important}
  .resize-handle.se{right:-14px!important;bottom:-14px!important}
}

/* ===== v40.39: bulletproof canvas visibility (mobile black-canvas fix) ===== */
/* The map canvas must never render as a black void. These rules guarantee
   a visible light canvas even if JS sizing fails or the design is empty. */
#pdCanvas.property-canvas{
  background:#f7f8f4!important;
  min-width:280px!important;
  min-height:200px!important;
}
.property-canvas-wrap{
  min-height:200px!important;
}
/* Ensure the wrap has a light base even if v38 grid fails to load */
.property-canvas-wrap:not(.spp-v38){
  background:#e8ece9!important;
}
/* If the canvas has no objects, show a clear hint instead of emptiness */
#pdCanvas.property-canvas:empty::before{
  content:'🗺️ Map is empty — tap Tools to add rooms, doors, sensors';
  display:flex;align-items:center;justify-content:center;
  width:100%;min-height:200px;color:#5a6b5e;font-style:italic;
  font-size:15px;text-align:center;padding:20px;box-sizing:border-box;
}

/* ===== v40.39: mobile paint studio layout (corrected selectors) ===== */
@media (max-width:900px){
  .spp-paint-modal{
    inset:0!important;
    border-radius:0!important;
  }
  .spp-paint-shell{
    display:flex!important;
    flex-direction:column!important;
    height:100%!important;
    max-height:100vh!important;
  }
  .spp-paint-head{
    flex-wrap:wrap!important;
    gap:6px!important;
    padding:8px!important;
    flex:0 0 auto!important;
  }
  .spp-paint-head-actions{
    flex-wrap:wrap!important;
    gap:6px!important;
  }
  .spp-paint-head-actions button{
    min-height:44px!important;
    padding:8px 12px!important;
    font-size:13px!important;
  }
  /* Ribbon: horizontal scroll, tools in a row */
  .spp-paint-ribbon{
    display:flex!important;
    flex-direction:row!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    gap:8px!important;
    padding:8px!important;
    flex:0 0 auto!important;
    -webkit-overflow-scrolling:touch!important;
    align-items:flex-start!important;
  }
  .spp-paint-toolbox{
    flex:0 0 auto!important;
  }
  #paintTools.spp-paint-tool-grid{
    display:flex!important;
    flex-direction:row!important;
    gap:4px!important;
    flex-wrap:nowrap!important;
  }
  #paintTools .spp-paint-tool{
    flex:0 0 auto!important;
    min-width:52px!important;
    min-height:48px!important;
  }
  .spp-paint-group{
    flex:0 0 auto!important;
  }
  /* Main: canvas fills remaining space, sidebars hidden on mobile */
  .spp-paint-main{
    flex:1!important;
    min-height:0!important;
    display:flex!important;
    flex-direction:column!important;
  }
  .spp-paint-left,
  .spp-paint-right{
    display:none!important;
  }
  .spp-paint-stage-wrap{
    flex:1!important;
    min-height:250px!important;
    overflow:auto!important;
    background:#9aa0a6!important;
  }
}


/* ===== v40.39: mobile map fills viewport (no dead space) ===== */
@media (max-width:900px){
  .property-modal.spp-v38 .property-workspace,
  .property-modal .property-workspace{
    display:flex!important;
    flex-direction:column!important;
    flex:1 1 auto!important;
    min-height:0!important;
  }
  .property-modal.spp-v38 .property-canvas-wrap,
  .property-modal .property-canvas-wrap{
    flex:1 1 auto!important;
    min-height:60vh!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:flex-start!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  /* Studio bar: in normal flow, not absolute overlay */
  .property-modal.spp-v38 .spp-studio-bar,
  .property-modal .spp-studio-bar{
    position:relative!important;
    flex:0 0 auto!important;
  }
}

/* ===== v40.39: nuclear mobile map visibility ===== */
@media (max-width:900px){
  /* Force the entire modal content area light - no black allowed */
  .property-modal .property-body,
  .property-modal .property-workspace,
  .property-modal .property-canvas-wrap{
    background:#f0f2ef!important;
  }
  /* Force canvas visible with light background */
  .property-modal #pdCanvas{
    background:#f7f8f4!important;
    min-width:280px!important;
    min-height:200px!important;
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
  }
  /* Ensure canvas children (objects) are visible */
  .property-modal #pdCanvas > *{
    visibility:visible!important;
  }
}

/* ===== v40.39: mobile map - complete bypass of v38 grid ===== */
@media (max-width:900px){
  /* Kill the v38 grid entirely */
  .property-modal.spp-v38 .property-body,
  .property-modal.spp-v38 .property-workspace{
    display:block!important;
    grid-template-areas:none!important;
    grid-template-columns:none!important;
    grid-template-rows:none!important;
  }
  /* Hide desktop-only panels on mobile */
  .property-modal.spp-v38 .property-tools,
  .property-modal.spp-v38 .property-inspector,
  .property-modal.spp-v38 .property-objects-panel{
    display:none!important;
  }
  /* Canvas wrapper: simple scrollable block */
  .property-modal .property-canvas-wrap{
    display:block!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch!important;
    background:#f0f2ef!important;
    min-height:60vh!important;
    max-height:70vh!important;
    width:100%!important;
    position:relative!important;
  }
  /* Canvas: ensure visible */
  .property-modal #pdCanvas{
    background:#f7f8f4!important;
    background-image:none!important;
    display:block!important;
    position:relative!important;
    margin:0 auto!important;
  }
  /* Objects must be visible */
  .property-modal #pdCanvas .property-object{
    visibility:visible!important;
    opacity:1!important;
  }
}

/* ===== v40.39: paint mobile - coherent flex layout ===== */
@media (max-width:900px){
  .spp-paint-modal .spp-paint-main{
    display:flex!important;
    flex-direction:column!important;
    flex:1 1 auto!important;
    min-height:0!important;
  }
  .spp-paint-modal .spp-paint-stage-wrap{
    flex:1 1 auto!important;
    min-height:0!important;
    width:100%!important;
    overflow:auto!important;
    background:#e8e8e8!important;
    padding:10px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
  .spp-paint-modal #paintCanvas{
    background:#fff!important;
    box-shadow:0 2px 8px rgba(0,0,0,0.2)!important;
    flex:0 0 auto!important;
  }
  /* Kill the beige ribbon dead space - tools are in the header row */
  .spp-paint-modal .spp-paint-ribbon:empty{
    display:none!important;
  }
}

/* ===== v40.39: kill black overlay on mobile map ===== */
@media (max-width:900px){
  /* Modal background light, not black */
  .property-modal{
    background:#f0f2ef!important;
  }
  .property-modal .property-body{
    background:#f0f2ef!important;
  }
  /* Canvas takes most of the screen */
  .property-modal .property-canvas-wrap{
    min-height:75vh!important;
    max-height:80vh!important;
  }
  /* Hide the v38 dark tool panels that overlay */
  .property-modal.spp-v38 .spp-tool-rail,
  .property-modal.spp-v38 .spp-v39-paintbar,
  .property-modal.spp-v38 .spp-v39-status{
    display:none!important;
  }
}

/* ===== v40.42: CONSOLIDATED mobile layout (replaces all v40.39-v40.41 patches) =====
   Single source of truth for ≤900px. No competing rules. */
@media (max-width:900px){
  /* --- MAP: vertical flex, canvas fills, toolbar in flow --- */
  .property-modal .property-workspace{
    display:flex!important;
    flex-direction:column!important;
    flex:1 1 auto!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  .property-modal .property-tools{
    flex:0 0 auto!important;
    max-height:32vh!important;
    overflow-y:auto!important;
  }
  .property-modal .property-canvas-wrap.property-canvas-wrap{
    display:flex!important;
    flex-direction:column!important;
    flex:1 1 auto!important;
    min-height:0!important;
    min-width:0!important;
    width:100%!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    overflow:hidden!important;
    padding:8px!important;
    padding-bottom:8px!important;
  }
  .property-modal .spp-canvas-spacer{
    display:none!important;
  }
  .property-modal .property-canvas{
    flex:1 1 auto!important;
    min-height:0!important;
    min-width:0!important;
    width:100%!important;
    height:100%!important;
  }
  .property-modal .spp-studio-bar.spp-studio-bar{
    position:relative!important;
    flex:0 0 auto!important;
    left:auto!important;
    right:auto!important;
    top:auto!important;
    bottom:auto!important;
    margin-top:8px!important;
  }
  /* --- PAINT: canvas fills, rulers hidden --- */
  .spp-paint-modal .spp-paint-main{
    display:flex!important;
    flex-direction:column!important;
    flex:1 1 auto!important;
    min-height:0!important;
  }
  .spp-paint-modal .spp-paint-stage-wrap{
    flex:1 1 auto!important;
    min-height:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:12px!important;
    overflow:auto!important;
  }
  .spp-paint-ruler{
    display:none!important;
  }
  .spp-paint-modal .spp-paint-ribbon{
    padding:6px!important;
    gap:6px!important;
    flex:0 0 auto!important;
  }
  .spp-paint-modal .spp-paint-toolbox>b,
  .spp-paint-modal .spp-paint-group>b{
    display:none!important;
  }
  /* --- MENU: full-width dropdown under header --- */
  .head-actions{
    display:none;
    position:absolute;
    z-index:80;
    top:100%;
    left:8px;
    right:8px;
    width:auto;
    max-width:calc(100vw - 16px);
    flex-direction:column;
    align-items:stretch;
    flex-wrap:nowrap;
    overflow:auto;
    max-height:min(70dvh,520px);
    padding:8px;
    gap:6px;
    background:var(--header-bg,var(--panel));
    border:1px solid var(--line);
    border-radius:12px;
    box-shadow:0 18px 50px #0007;
  }
  body.nav-open .head-actions{display:flex}
  .head-actions>*{width:100%;justify-content:flex-start}
  .head-toolbar{position:static}
}
