*{box-sizing:border-box}body{margin:0;background:#f5f4ef;color:#293a35;font:14px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button{font:inherit;cursor:pointer;border:1px solid #d8dfd8;border-radius:7px;background:#fff;padding:9px 12px;color:#344b41}button:hover{background:#eaf1e9}header{height:82px;background:#fff;display:flex;align-items:center;gap:10px;padding:0 28px;border-bottom:1px solid #dfe4dc}.brand{font-size:21px;font-weight:650;white-space:nowrap}.brand b{background:#294d3b;color:#fff;border-radius:9px;padding:6px 9px;margin-right:8px}.brand span{font-size:9px;background:#edf1e6;color:#667a50;padding:4px;border-radius:4px;margin-left:9px}.project{margin:auto;font-weight:550}.project small{display:block;font-size:11px;color:#8b958d;margin-top:5px}main{display:flex;height:calc(100dvh - 82px)}aside{width:260px;flex-shrink:0;padding:30px 22px;background:#fbfcf8;border-right:1px solid #dfe4dc;overflow:auto}.eyebrow{letter-spacing:2px;font-size:10px;color:#849383;font-weight:700}h2{font-size:23px;letter-spacing:-.8px;margin:14px 0 8px}p{color:#7b877d;line-height:1.6;font-size:12px}.part{display:flex;align-items:center;gap:13px;width:100%;text-align:left;padding:14px 10px;margin:10px 0}.part i{font-style:normal;background:#e8ede5;border-radius:7px;width:37px;height:40px;display:grid;place-items:center;color:#4f7355;font-size:20px}.part strong{display:block;font-size:12px}.part small{display:block;font-size:10px;color:#929b92;margin-top:5px}.part em{margin-left:auto;font-style:normal;font-size:20px}.tip{margin-top:35px;border-top:1px solid #e0e5dc;padding-top:22px;font-size:12px}.note{font-size:10px;color:#929c91;line-height:1.65;margin-top:24px}.workspace{flex:1;min-width:0;display:flex;flex-direction:column;padding:20px}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px;font-size:12px}.dot{display:inline-block;width:7px;height:7px;background:#739475;border-radius:50%;margin-right:7px}#count{color:#92a08f;margin-left:12px}.tools{display:flex;align-items:center;gap:8px}.tools button{padding:7px 10px;font-size:11px}.tools label{display:flex;align-items:center;gap:6px}input[type=color]{border:0;background:none;width:28px;height:29px;cursor:pointer}#canvas{position:relative;flex:1;overflow:auto;background-color:#fffefb;background-image:radial-gradient(#dbe1d7 .8px,transparent .8px);background-size:20px 20px;border:1px solid #dce2d8;border-radius:12px;touch-action:none}#wires{position:absolute;width:1400px;height:1000px;pointer-events:none}#components{position:absolute;width:1400px;height:1000px;pointer-events:none}.component{position:absolute;width:185px;border-radius:12px;background:#244d40;color:#edf5e9;box-shadow:0 9px 22px #263f3120;border:2px solid transparent;pointer-events:auto;touch-action:none;user-select:none}.component.selected{border-color:#e4b758}.component.sensor{background:#53755c}.component.generic{background:#596c79}.drag{padding:20px 20px 12px;cursor:grab}.drag small{color:#b0c4b2;font-size:9px;letter-spacing:2px}.drag h3{margin:7px 0 10px;font-size:20px;font-weight:600}.chip{border:1px solid #81968a;background:#34443e;border-radius:5px;padding:12px;text-align:center;font:10px monospace;color:#a9b7ac;letter-spacing:1px;margin-bottom:12px}.pins{padding:0 0 15px}.pin{height:32px;display:flex;justify-content:space-between;align-items:center;padding:0 14px;font:10px monospace}.pin button{position:absolute;right:-9px;width:15px;height:15px;border:3px solid #e6dba6;border-radius:50%;background:#304c3e;padding:0}.pin button.active{background:#ed914d;box-shadow:0 0 0 5px #ed914d44}.pin button:hover{background:#f6b75c}.pin span{color:#b9cdbd}.pin b{font-weight:400;color:#e8eddf}.sensor .pin button,.generic .pin button{left:-9px;right:auto}.sensor .pin,.generic .pin{padding-left:18px}path.wire{fill:none;stroke-width:3;pointer-events:stroke;cursor:pointer;stroke-linejoin:round;stroke-linecap:round}path.wire.selected{stroke-width:6;filter:drop-shadow(0 0 3px #d9a558)}footer{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:#82917e;padding-top:12px}footer button{padding:3px 9px}#empty{position:absolute;top:45%;width:100%;text-align:center;color:#8c9a89}@media(max-width:900px){header{padding:0 15px}.project{display:none}.brand{margin-right:auto}aside{width:205px;padding:22px 14px}.workspace{padding:12px}.toolbar{align-items:flex-start;flex-direction:column}.tools{flex-wrap:wrap}#count{margin-left:5px}}@media(max-width:600px){header{height:65px}.brand{font-size:16px}.brand span{display:none}header button{font-size:11px;padding:7px}main{height:calc(100dvh - 65px);flex-direction:column}aside{width:100%;padding:10px;border-right:0;display:flex;overflow:auto;flex-shrink:0}aside>div:not(#library),aside>h2,aside>p{display:none}#library{display:flex;gap:7px}.part{margin:0;width:150px;padding:7px}.part i{width:27px;height:30px}.part small{font-size:9px}.workspace{min-height:0;flex:1}}
.drag{height:127px;padding:16px 18px 8px}.drag small{display:block;line-height:10px}.drag h3{line-height:24px}.chip{padding:10px;line-height:12px;margin:0}

path.wire.hovered:not(.wire-hit){stroke-width:5;filter:drop-shadow(0 0 3px #526b5670)}path.wire.selected:not(.wire-hit){stroke-width:6;filter:drop-shadow(0 0 3px #d9a558)}path.wire.wire-hit{stroke:transparent;stroke-width:16;filter:none}

#canvas{overflow:hidden;cursor:grab;overscroll-behavior:contain}#canvas.panning{cursor:grabbing}#world{position:absolute;left:0;top:0;width:1400px;height:1000px;transform-origin:0 0;pointer-events:none}#view-reset{min-width:50px;margin-right:10px}.component{cursor:default}

aside{width:225px;padding:22px 16px}.right-panel{border-left:1px solid #dfe4dc;border-right:0}aside h2{font-size:20px;margin:22px 0 14px}.add-action{width:100%;text-align:left;background:#294d3b;color:#fff;border-color:#294d3b}.add-action:hover{background:#3b6550}.search{width:100%;padding:10px;border:1px solid #d8dfd8;border-radius:7px;background:white;font:12px inherit;margin-bottom:8px;outline-color:#799d79}.wire-row{width:100%;display:flex;gap:10px;text-align:left;margin:8px 0;padding:12px 10px}.wire-row i{width:5px;flex-shrink:0;border-radius:3px}.wire-row strong{display:block;font-size:12px;margin-bottom:7px}.wire-row small{display:block;font-size:10px;color:#839080;line-height:1.8}.wire-row.active{border-color:#b79451;background:#f8f2e4}.workspace{padding:16px;min-width:280px}.toolbar{align-items:flex-start;flex-wrap:wrap}.tools{flex-wrap:wrap}.part[hidden]{display:none}#wire-help{font-size:11px}@media(max-width:1000px){aside{width:190px;padding:15px 12px}.part{padding:10px 6px;gap:7px}.part i{width:30px}.project{display:none}}@media(max-width:600px){main{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:150px 1fr}aside{width:auto;display:block;overflow:auto;padding:10px}aside h2{display:block!important;font-size:14px;margin:8px 0}.left-panel{grid-column:1;grid-row:1}.right-panel{grid-column:2;grid-row:1}.workspace{grid-column:1/3;grid-row:2}.add-action{padding:6px}.search{padding:6px;margin-bottom:3px}#library{display:block}.part{width:100%;margin:3px 0}.tip{display:none}.wire-row{padding:7px;margin:4px 0}.wire-row small{font-size:9px}.toolbar{margin-bottom:8px}}
.right-panel #wire-list{display:block}

#routing-warning{position:absolute;left:16px;right:16px;bottom:16px;background:#fff2d7;border:1px solid #e2c68d;color:#72552d;padding:12px 16px;border-radius:8px;font-size:12px;pointer-events:none}

dialog{width:min(660px,calc(100vw - 28px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid #dce3d8;border-radius:16px;padding:28px;background:#fbfcf8;color:#293a35;box-shadow:0 30px 100px #122a3450}dialog::backdrop{background:#17291f88;backdrop-filter:blur(3px)}.modal-heading{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:24px}.modal-heading h2{margin:10px 0 0;font-size:26px}.modal-heading>button{border:0;background:transparent;font-size:18px}.field-label{font-size:12px;font-weight:600;display:block}.name-input{width:100%;font:15px inherit;padding:12px 14px;border:1px solid #ccd7cb;border-radius:8px;margin:9px 0 22px;outline-color:#769778}.image-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.choose-image{font-size:12px;text-decoration:underline;cursor:pointer;color:#53755c}#crop-placeholder{border:1px dashed #bccbb9;border-radius:10px;padding:25px;text-align:center;background:#f1f5ed}#crop-placeholder>span{display:block;font-size:35px;color:#829c7e;margin-bottom:12px}#crop-placeholder b{display:block;font-size:13px}#crop-placeholder p{margin:8px 0 18px}#crop-canvas{width:100%;height:auto;display:block;border-radius:9px;cursor:crosshair;touch-action:none}.crop-tools{display:flex;align-items:center;gap:12px}.crop-tools p{flex:1;font-size:11px}.crop-tools button{font-size:11px;white-space:nowrap}.component-scope{font-size:11px;margin:18px 0;color:#82917e;line-height:1.6}.modal-actions{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid #e0e6db;padding-top:20px;margin-top:20px}.primary{background:#294d3b;color:white;border-color:#294d3b}.primary:hover{background:#3a6550}#component-error{color:#a53e2e;font-size:12px}.part>img{width:37px;height:42px;object-fit:contain;border-radius:4px}.part div{min-width:0}.part strong{overflow-wrap:anywhere}.custom-component .drag{height:127px}.custom-component .drag>img{display:block;width:100%;height:64px;object-fit:contain}.custom-component h3{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.custom-component .pins{padding:0}.name-input:focus{outline:2px solid #769778}body:has(dialog[open]){overflow:hidden}
/* Image workspace: images are shared by library, detail page and canvas. */
#world,#components{width:0;height:0;overflow:visible}#wires{width:1px;height:1px;overflow:visible}.component.image-component{padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:inherit;cursor:grab;outline:none}.component.image-component.selected{outline:calc(1.5px * var(--ui-scale,1)) solid #ae965d;outline-offset:calc(5px * var(--ui-scale,1))}.component-picture{width:100%;height:100%;object-fit:fill;display:block;pointer-events:none;user-select:none}.terminal{position:absolute;transform:translate(-50%,-50%);width:12px;height:12px;min-width:0;padding:0;border:2px solid #d8c380;border-radius:50%;background:#2d493c;cursor:crosshair;z-index:2}.terminal.active,.terminal:hover{background:#f4b95e;box-shadow:0 0 0 4px #e5b96b44}.resize-handle{position:absolute;width:calc(10px * var(--ui-scale,1));height:calc(10px * var(--ui-scale,1));padding:0;min-width:0;background:#fffefb;border:calc(1.5px * var(--ui-scale,1)) solid #ae965d;border-radius:calc(2px * var(--ui-scale,1));z-index:4;touch-action:none}.resize-handle.nw{left:calc(-5px * var(--ui-scale,1));top:calc(-5px * var(--ui-scale,1));transform:translate(-50%,-50%);cursor:nwse-resize}.resize-handle.ne{right:calc(-5px * var(--ui-scale,1));top:calc(-5px * var(--ui-scale,1));transform:translate(50%,-50%);cursor:nesw-resize}.resize-handle.sw{left:calc(-5px * var(--ui-scale,1));bottom:calc(-5px * var(--ui-scale,1));transform:translate(-50%,50%);cursor:nesw-resize}.resize-handle.se{right:calc(-5px * var(--ui-scale,1));bottom:calc(-5px * var(--ui-scale,1));transform:translate(50%,50%);cursor:nwse-resize}.resize-handle[hidden]{display:none}.drag-preview{position:fixed;object-fit:fill;pointer-events:none;z-index:9999;opacity:.8;filter:drop-shadow(0 8px 12px #1d382733)}body.library-dragging{cursor:grabbing;user-select:none}#canvas.drop-ready{outline:2px solid #94b88d;outline-offset:-3px}#selection-box{position:absolute;border:1px solid #8aa77c;background:#8aa77c20;pointer-events:none;z-index:5}#canvas.select-mode{cursor:crosshair}#canvas.space-pan{cursor:grab}.part{touch-action:none;user-select:none}.part img{pointer-events:none}.part em{font-size:18px;color:#94a28d}.product-image-area{height:380px;display:flex;align-items:center;justify-content:center;background:repeating-conic-gradient(#f0f3ec 0% 25%,#fafbf7 0% 50%) 0 0/18px 18px;border-radius:10px;padding:20px}.product-image-area img{max-width:100%;max-height:100%;object-fit:contain}#product-pins{display:flex;gap:7px;flex-wrap:wrap}#product-pins span{font-size:11px;background:#edf1e6;border-radius:5px;padding:6px 10px;color:#526650}.view-controls{display:flex;align-items:center;gap:5px;white-space:nowrap}#view-reset{margin-right:0}.tool-switch{display:flex;gap:4px}.tool-switch button.active{border-color:#648467;background:#e4eddf;color:#345a3d}.tools button:disabled{opacity:.4;cursor:default}.tools{row-gap:6px}#status{max-width:65%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(max-width:900px){.product-image-area{height:300px}.tools{gap:5px}footer{gap:8px;flex-wrap:wrap}#status{max-width:100%}}
.component.image-component{isolation:isolate}
#component-dialog.reviewing{width:min(1060px,calc(100vw - 28px))}#detection-progress{background:#eef3e8;border-radius:10px;padding:22px;margin-top:14px}#detection-progress b{font-size:13px}#detection-progress progress{display:block;width:100%;height:10px;margin:18px 0;accent-color:#507951}#detection-progress button{font-size:11px}.review-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}.review-heading h3{margin:0;font-size:17px}.review-heading p{max-width:600px;font-size:11px}.review-heading button{white-space:nowrap;font-size:11px}.review-layout{display:grid;grid-template-columns:minmax(240px,1fr) minmax(290px,1fr);gap:24px}.review-picture{background:#eef1e9;border-radius:10px;padding:14px;text-align:center}.review-picture p{font-size:10px}.review-picture>button{font-size:11px}#review-board{display:inline-block;position:relative;vertical-align:top;line-height:0}#review-image{display:block;max-height:570px;max-width:100%;width:auto;height:auto}#review-overlay{position:absolute;inset:0;width:100%;height:100%;touch-action:none;overflow:visible}.review-point{fill:#4d805580;stroke:#fff;stroke-width:1.8;cursor:move}.review-point.uncertain{fill:#d89428a0;stroke:#fff1cc}.review-point.active{fill:#e5b14088;stroke:#203d30;stroke-width:2.5}.review-list-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;margin:0 0 10px}.review-list-heading label{font-size:10px;white-space:nowrap;color:#6f7e68}#review-pin-list{max-height:570px;overflow:auto;padding-right:5px}.review-pin-row{display:flex;align-items:center;gap:7px;padding:7px;margin:4px 0;border:1px solid #e0e6dc;background:white;border-radius:7px}.review-pin-row.active{border-color:#819e72}.review-pin-row.uncertain{background:#fff8e9;border-color:#ebd4a6}.pin-index{padding:6px 7px;font-size:10px;min-width:42px}.review-pin-row input{width:70px;min-width:40px;flex:1;border:1px solid #d9dfd4;border-radius:4px;font:12px monospace;padding:7px}.review-status{font-size:9px;color:#8b956e;min-width:40px}.review-pin-row.uncertain .review-status{color:#a56f24}.remove-review-pin{border:0;padding:5px 8px;font-size:17px;color:#8b9a81}.review-confirm{display:flex;align-items:center;gap:8px;background:#edf2e7;border-radius:8px;padding:13px;font-size:12px;margin-top:18px}.review-confirm input{accent-color:#537655}.primary:disabled{opacity:.45;cursor:default}#crop-placeholder button{margin:3px}#use-esp32-sample{background:#e4eddd}.crop-tools{flex-wrap:wrap}#pin-review[hidden],#detection-progress[hidden]{display:none}@media(max-width:700px){.review-layout{grid-template-columns:1fr}.review-picture #review-image{max-height:420px}.review-list-area #review-pin-list{max-height:300px}.review-heading{flex-wrap:wrap}dialog{padding:18px}#component-dialog.reviewing{max-height:94dvh}.review-confirm{font-size:11px}}

body{height:100dvh;display:flex;flex-direction:column}body>header{flex-shrink:0}body>main{flex:1;min-height:0;height:auto}#notes-panel{flex-shrink:0;background:#fbfcf8;border-top:1px solid #d9e2d4;max-height:40dvh;overflow:auto}#notes-panel summary{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:11px 25px;cursor:pointer;list-style:none;user-select:none;font-size:12px;color:#526b4e}#notes-panel summary::-webkit-details-marker{display:none}#notes-panel summary:hover{background:#edf2e7}.notes-title{font-weight:600}.notes-summary{display:flex;align-items:center;gap:12px;font-size:11px;color:#829077}.notes-chevron{display:inline-block;transition:transform .15s}.notes-open{display:none}#notes-panel[open] .notes-open{display:inline}#notes-panel[open] .notes-closed{display:none}#notes-panel[open] .notes-chevron{transform:rotate(180deg)}.notes-content{max-width:1000px;margin:0 auto;padding:5px 24px 17px}.notes-content>label{display:block;font-size:11px;color:#6b7e62;margin:0 0 8px}#project-notes{display:block;width:100%;min-height:85px;max-height:22dvh;resize:vertical;border:1px solid #d0dcc8;border-radius:8px;padding:12px;background:#fffefb;color:#344d3a;font:13px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;outline-color:#799b6d}.notes-meta{display:flex;justify-content:space-between;gap:10px;margin-top:8px;color:#8b9983;font-size:10px}.notes-error{color:#a05034}@media(max-width:600px){#notes-panel summary{padding:10px 14px;font-size:11px}.notes-content{padding:4px 14px 12px}.notes-meta{font-size:9px;flex-wrap:wrap}#notes-panel{max-height:42dvh}}

.save-error{color:#a14f35!important}#server-loading{position:fixed;inset:0;background:#f5f6ef;z-index:9000;display:grid;place-items:center;text-align:center;padding:30px}#server-loading[hidden]{display:none}#loading-actions{display:flex;gap:15px;align-items:center;justify-content:center}#loading-actions[hidden]{display:none}.login-page{display:grid;place-items:center;background:#edf1e7;padding:25px}.login-page>main.login-card{display:block;flex:initial;min-height:0;height:auto;width:min(480px,100%);padding:45px;background:#fffefb;border:1px solid #d7dfd1;border-radius:15px;box-shadow:0 20px 60px #223c2610}.login-card h1{font-size:30px;line-height:1.25;letter-spacing:-1px}.login-card p{font-size:14px}.login-action{display:inline-block;background:#294d3b;color:#fff;text-decoration:none;border-radius:8px;padding:13px 20px;margin:12px 0 25px}.login-card small{display:block;color:#85917b;font-size:11px}.backup-info{padding:18px;background:#edf2e7;border-radius:10px;margin:20px 0}.backup-info>b{font-size:13px}dl{font-size:12px;margin-bottom:0}dt{color:#849078;margin-top:15px}dd{margin:5px 0;color:#40583b;overflow-wrap:anywhere}.backup-actions{display:flex;gap:8px;flex-wrap:wrap;font-size:12px}#backup-error{color:#a14f35;font-size:12px}#backup-progress{font-size:12px}#sync-problem{position:fixed;left:20px;right:20px;bottom:20px;z-index:8000;border:1px solid #c8ab6a;background:#fff7df;border-radius:10px;padding:20px;box-shadow:0 10px 40px #3e301b30;font-size:12px}#sync-problem[hidden]{display:none}#sync-problem button,#sync-problem a{font-size:11px;margin:5px}#sync-problem p{color:#776544}#account-dialog button:disabled{opacity:.4;cursor:default}
