:root{--green:#0b4b37;--deep:#073a2b;--lime:#79c326;--ink:#18231e;--muted:#68786f;--line:#d6dfd9;--paper:#fff;--bg:#e9efeb;--danger:#a2352d}
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;color:var(--ink);background:var(--bg)}
button,input,select{font:inherit}
button{cursor:pointer;border:1px solid #b9c9c0;background:#fff;border-radius:7px;padding:9px 12px;font-weight:700;color:#163d2e}
button:hover{background:#eff7f1}
button.active,.primary{background:var(--green);color:#fff;border-color:var(--green)}
button.danger{color:var(--danger)}
button:disabled{opacity:.45;cursor:not-allowed}
.topbar{height:70px;background:var(--deep);color:white;display:flex;align-items:center;gap:22px;padding:0 18px;box-shadow:0 2px 10px #0003;position:relative;z-index:3}
.brand{display:flex;align-items:center;min-width:245px}
.brandmark{font-size:36px;color:var(--lime);margin-right:10px}
.brand strong{font:700 25px Georgia,serif}
.brand small{display:block;font-size:9px;letter-spacing:1.8px;color:#bfe2cf}
.project{display:flex;align-items:center;gap:8px;flex:1}
.project .dot{width:9px;height:9px;background:var(--lime);border-radius:50%}
.project input{border:0;background:transparent;color:#fff;font-weight:700;width:210px}
.project span:last-child{font-size:12px;color:#b8cdc2}
.topbar nav{display:flex;gap:8px}
.topbar nav button{background:transparent;color:white;border-color:#6d9484}
.topbar nav .primary{background:var(--lime);border-color:var(--lime);color:#163d09}
.app{height:calc(100% - 70px);display:grid;grid-template-columns:280px minmax(600px,1fr) 300px;min-width:1080px}
.panel{background:white;padding:18px;overflow:auto}
.catalog{border-right:1px solid var(--line)}
.properties{border-left:1px solid var(--line)}
.eyebrow{font-size:10px;font-weight:800;letter-spacing:1.5px;color:#75867d}
.panel-title{display:flex;justify-content:space-between;align-items:center}
.panel h2{font:500 25px Georgia,serif;margin:5px 0 14px}
.catalog input,#selectedControls input,#selectedControls select{width:100%;padding:10px;border:1px solid #cbd8d0;border-radius:6px}
.tabs{display:flex;gap:5px;margin:12px 0;flex-wrap:wrap}
.tabs button{font-size:12px;padding:7px 9px}
.inventory{display:flex;flex-direction:column;gap:9px}
.inventory-card{border:1px solid var(--line);border-radius:9px;padding:8px;display:grid;grid-template-columns:58px 1fr 30px;align-items:center;gap:9px;background:#fff}
.inventory-card.selected{outline:2px solid var(--lime);background:#f4faee}
.inventory-card img,.swatch{width:58px;height:48px;object-fit:cover;border-radius:6px;background:#e8eee9}
.inventory-card strong{display:block;font-size:13px}
.inventory-card small{color:#4d805b}
.inventory-card button{border-radius:50%;width:30px;height:30px;padding:0;background:#edf6e9;color:#398118}
.catalog-tip{margin-top:18px;padding:12px;background:#eff5eb;border-radius:8px;font-size:12px;color:#587060}
.workspace{display:flex;flex-direction:column;min-width:0}
.tools{min-height:58px;background:#fff;border-bottom:1px solid var(--line);padding:9px 12px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.toolgroup{display:flex;gap:5px}
.check{padding:8px;font-size:12px}
.zoom{margin-left:auto;display:flex;align-items:center;border:1px solid var(--line);border-radius:7px;background:white}
.zoom button{border:0;padding:8px 11px}
.zoom output{min-width:58px;text-align:center;font-size:12px;font-weight:800}
.canvas-shell{flex:1;min-height:0;overflow:scroll;padding:28px;background:#dfe7e2;scrollbar-gutter:stable both-edges}
.plan{position:relative;width:1280px;height:960px;background:#f7faf8;box-shadow:0 4px 18px #29423524;transform-origin:top left}
.plan svg{display:block;width:100%;height:100%;touch-action:none}
.plan #reference{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.25;display:none;pointer-events:none}
.statusbar{height:36px;background:#fff;border-top:1px solid var(--line);display:flex;justify-content:space-between;padding:9px 14px;font-size:11px;color:var(--muted)}
svg .lot{stroke:#101c16;stroke-width:.38;stroke-dasharray:none;vector-effect:non-scaling-stroke;filter:drop-shadow(0 0 .12px #fff)}
svg .zone{stroke:#15241c;stroke-width:.3;stroke-dasharray:.6 .35;vector-effect:non-scaling-stroke;cursor:pointer;filter:drop-shadow(0 .15px .1px #fff)}
svg .zone.selected{stroke:#79d128;stroke-width:.32}
svg .draft{fill:#dbeede88;stroke:#0b4b37;stroke-width:.2;stroke-dasharray:.5 .3}
svg .vertex{fill:#fff;stroke:#327c36;stroke-width:.18;cursor:grab;vector-effect:non-scaling-stroke}
svg .midpoint{fill:#a6d97a;stroke:#fff;stroke-width:.12;cursor:copy;vector-effect:non-scaling-stroke}
svg .placed{cursor:move;filter:drop-shadow(0 .2px .18px #0006)}
svg .item-hit{fill:#fff;fill-opacity:.001;stroke:none;pointer-events:all;cursor:move}
svg .item-frame{fill:none;stroke:#fff;stroke-width:.28;vector-effect:non-scaling-stroke;pointer-events:none;filter:drop-shadow(0 0 .15px #10251f)}
svg .item-frame[hidden]{display:none}
.properties label{display:block;font-size:12px;font-weight:700;margin:10px 0}
.properties label input,.properties label select{margin-top:5px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.selected-photo{display:flex;align-items:center;gap:10px;background:#f1f5f1;border:1px solid var(--line);border-radius:8px;padding:8px;margin-bottom:12px}.selected-photo img{width:64px;height:58px;object-fit:contain;background:#fff;border-radius:6px}.selected-photo span{font-size:11px;font-weight:800;color:#4f6a5b}.properties label output{float:right;color:var(--green);font-weight:800}#scaleRange{padding:0!important;accent-color:var(--green)}
.measurements{border-top:1px solid var(--line);margin-top:18px;padding-top:10px}
.measurements div{display:flex;justify-content:space-between;padding:8px 0;font-size:13px}
.costcard{background:var(--deep);color:#fff;padding:16px;border-radius:10px;margin:15px 0}
.costcard span,.costcard small{display:block}
.costcard strong{font-size:28px;color:#a7df58;display:block;margin:4px 0}
.costcard small{font-size:10px;color:#bad0c4}
.legend h3{font:500 18px Georgia,serif}
.layer{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid #edf1ee;font-size:12px}
.layer button{padding:4px 7px}
.wide{width:100%;margin-top:9px}
.catalog-tip{margin-top:auto}
dialog{border:0;border-radius:15px;width:min(1280px,96vw);max-height:96vh;padding:28px;box-shadow:0 24px 80px #001a1266}
dialog::backdrop{background:#05291fbb;backdrop-filter:blur(3px)}
dialog .close{position:absolute;right:18px;top:16px;border:0;border-radius:50%;font-size:24px}
dialog h2{font:500 34px Georgia,serif;margin:5px 0 10px}
dialog img.result{width:100%;max-height:76vh;object-fit:contain;background:#edf2ee}
.modal-actions{display:flex;gap:8px;margin-top:15px}
.modal-actions button{flex:1}
.inventory-form{display:grid;gap:12px}
.inventory-form .row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.inventory-form label{font-weight:700}
.inventory-form input,.inventory-form select{width:100%;padding:11px;margin-top:5px;border:1px solid var(--line);border-radius:7px}
#toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:#153f31;color:#fff;padding:11px 18px;border-radius:8px;opacity:0;pointer-events:none;transition:.2s;z-index:9}
#toast.show{opacity:1}
svg .zone.unassigned{fill:#ffffff18;stroke:#15241c;stroke-width:.34;stroke-dasharray:.7 .4}
svg .zone.unassigned.selected{stroke:#79d128;filter:drop-shadow(0 0 .18px #fff)}
@media(max-width:1250px){.app{grid-template-columns:230px minmax(580px,1fr) 260px}
.topbar .project{display:none}
.topbar{overflow-x:auto}
.brand{min-width:220px}
}
/* Interactive 3D landscape view */
.three-wrap{position:relative;width:min(1100px,82vw);height:min(720px,72vh);min-height:520px;background:#dfe7ec;border-radius:14px;overflow:hidden;border:1px solid #c8d2cc}
#landscape3d{width:100%;height:100%;display:block;touch-action:none}
.three-help{display:flex;gap:18px;flex-wrap:wrap;margin:10px 0 14px;color:#56645d;font-size:13px}

.three-stats{display:flex;gap:8px 16px;flex-wrap:wrap;align-items:center;margin:8px 0 12px;padding:10px 12px;background:#f3f6f4;border:1px solid #c8d2cc;border-radius:10px;color:#34443c;font-size:13px}.three-stats b{width:100%}.three-stats span{white-space:nowrap}.three-wrap{position:relative}.three-error{position:absolute;inset:18px;padding:18px;background:rgba(255,255,255,.94);border:1px solid #b85d4d;border-radius:10px;color:#6b2e24;font-size:15px;line-height:1.45}
/* Build 41: restored selected-object rotation controls. */
.rotation-control{display:grid;gap:6px;margin:10px 0}.rotation-control>span{display:flex;justify-content:space-between;font-weight:700}.rotation-row{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center}.rotation-row button{white-space:nowrap}.rotation-row input[type=range]{width:100%}

/* Build 42 experimental same-page Three.js design mode */
.live3d-design{min-width:900px;min-height:640px;width:100%;height:100%;display:flex;flex-direction:column;background:#dfe7e2;border:1px solid #b9c8bf;border-radius:12px;overflow:hidden}
.live3d-design[hidden]{display:none!important}
.live3d-toolbar{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:10px 12px;background:#f7faf8;border-bottom:1px solid #c6d2cb;color:#33443b}.live3d-toolbar>div:first-child{display:flex;flex-direction:column;gap:2px}.live3d-toolbar small{color:#69786f}.live3d-actions{display:flex;gap:7px;flex-wrap:wrap}.live3d-actions button.active{background:#2f7d4a;color:#fff;border-color:#2f7d4a}
.live3d-stage{position:relative;flex:1;min-height:520px;background:#bfd4e1}.live3d-stage canvas{display:block;width:100%;height:100%;touch-action:none}.live3d-stage #live3DMessage{position:absolute;left:12px;top:12px;padding:7px 9px;border-radius:8px;background:rgba(20,30,25,.72);color:#fff;font-size:12px;pointer-events:none}
.live3d-help{display:flex;gap:18px;flex-wrap:wrap;padding:8px 12px;background:#f7faf8;border-top:1px solid #c6d2cb;color:#596960;font-size:12px}

/* Build 77: clean 3D page — canvas begins immediately with no instructional/data panels. */
.three-wrap-clean{margin-top:0}
.three-wrap-clean #landscape3d{display:block}

/* Build 78: diagnostic/runtime text must never surface in the 3D modal. */
.three-stats[hidden],#threeRuntime[hidden],#threeRuntime{display:none!important}
