/* V4 shared components */

/* icons */
.icon{display:inline-flex;flex:none}
.icon svg{width:100%;height:100%;fill:currentColor}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:36px;padding:0 16px;border-radius:8px;font-weight:500;font-size:13px;transition:background .15s,transform .1s}
.btn:active{transform:scale(.98)}
.btn-primary{background:var(--ember);color:#fff}
.btn-primary:hover{background:var(--ember-400)}
.btn-secondary{background:#fff;border:1px solid var(--st-300)}
.btn-secondary:hover{background:var(--st-100)}
.btn-ghost{color:var(--st-600)}
.btn-ghost:hover{background:var(--st-100)}
.btn-sm{height:30px;padding:0 12px;font-size:12.5px}
.btn-lg{height:48px;padding:0 20px;font-size:14px;font-weight:600;border-radius:12px}

/* chips (subtle V4) */
.chip{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:999px;font-family:var(--f-mono);font-weight:500;font-size:9px;letter-spacing:.10em;text-transform:uppercase;white-space:nowrap}
.chip-legal{color:var(--alert);background:var(--alert-bg)}
.chip-auto{color:var(--water);background:var(--water-bg)}
.chip-editavel,.chip-ia{color:var(--ember-700);background:var(--ember-t10)}
.chip-neutral{color:var(--st-600);background:var(--gray-t12)}
.chip-forest{color:var(--forest-700);background:var(--forest-t10)}

/* fields */
.field{display:flex;flex-direction:column;gap:8px}
.field label{font-weight:600;font-size:12px;display:flex;align-items:center;justify-content:space-between;gap:8px}
.control{display:flex;align-items:center;gap:8px;height:44px;padding:0 12px;border:1px solid var(--st-200);border-radius:8px;background:#fff;font-size:13.5px;transition:border-color .15s,box-shadow .15s}
.control:focus-within{border-color:var(--ember);box-shadow:0 0 0 3px rgba(226,107,22,.15)}
.control input{flex:1;border:0;outline:0;background:none;font-size:13.5px;min-width:0}
.control input::placeholder{color:var(--st-400)}
.control.readonly{background:var(--paper)}
textarea.control{height:auto;min-height:88px;padding:10px 12px;resize:vertical;width:100%;outline:0}
.helper{font-size:11.5px;color:var(--st-400)}
.helper.mono{font-family:var(--f-mono);font-size:10.5px}
.helper.error{color:var(--alert)}
.field.error .control{border-color:var(--alert)}

/* pill chips list (members etc) */
.chips-wrap{display:flex;flex-wrap:wrap;gap:6px}
.pill-item{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 12px;border:1px solid var(--st-200);border-radius:999px;background:#fff;font-size:12px;color:var(--st-700)}
.pill-item .x{cursor:pointer;color:var(--st-400);display:inline-flex}
.pill-item .x:hover{color:var(--alert)}

/* cards */
.card{background:#fff;border:1px solid var(--st-200);border-radius:12px;padding:14px}
.card-lg{border-radius:16px;padding:24px}
.dashed{border:1px dashed var(--st-300);background:none}

/* checkbox */
.check-row{display:flex;align-items:center;gap:10px;padding:6px 0;cursor:pointer;font-size:13.5px}
.checkbox{width:18px;height:18px;border-radius:5px;border:1.5px solid var(--st-300);background:#fff;display:flex;align-items:center;justify-content:center;color:#fff;flex:none;transition:all .12s}
.check-row.on .checkbox{background:var(--ember);border-color:var(--ember)}
.check-row:not(.on){color:var(--st-600)}

/* segmented */
.segmented{display:flex;gap:2px;padding:2px;background:var(--st-100);border-radius:8px}
.segmented button{flex:1;height:28px;border-radius:6px;font-size:12px;font-weight:500;color:var(--st-500)}
.segmented button.on{background:#fff;border:1px solid var(--st-200);font-weight:600;color:var(--ink)}

/* mini meta pill */
.meta-pill{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 8px;border-radius:6px;background:var(--st-100);font-family:var(--f-mono);font-size:10px;color:var(--st-600)}

/* overlay/sheet */
#overlay-root{position:fixed;inset:0;z-index:100;display:none}
#overlay-root.open{display:block}
.scrim{position:absolute;inset:0;background:rgba(28,25,23,.45);opacity:0;transition:opacity .18s}
#overlay-root.open .scrim{opacity:1}
.sheet{position:absolute;left:50%;top:50%;transform:translate(-50%,-48%);opacity:0;transition:all .2s cubic-bezier(.2,.8,.3,1);background:#fff;border-radius:16px;box-shadow:var(--sh-md);max-height:84vh;overflow:auto}
#overlay-root.open .sheet{transform:translate(-50%,-50%);opacity:1}

/* toast-ish floating card on map */
.map-card{position:absolute;background:#fff;border-radius:12px;box-shadow:var(--sh-md);border:1px solid var(--st-200)}

/* topbar */
#topbar{position:fixed;top:0;left:0;right:0;height:var(--topbar-h);background:#fff;border-bottom:var(--hairline);display:flex;align-items:center;padding:0 24px;z-index:50}
#topbar .brand{display:flex;align-items:center;gap:8px;color:var(--ember);font-family:var(--f-mono);font-weight:500;font-size:12px;letter-spacing:.12em}
#topbar .crumb{position:absolute;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:10px;font-size:14px}
#topbar .crumb .dim{color:var(--st-400);font-size:13px}
#topbar .right{margin-left:auto;display:flex;align-items:center;gap:16px;font-size:13px;color:var(--st-400)}
#topbar .avatar{width:30px;height:30px;border-radius:50%;background:var(--st-200);display:flex;align-items:center;justify-content:center;font-weight:600;font-size:12px;color:var(--st-600)}

/* bottombar */
#bottombar{position:fixed;bottom:0;left:0;right:0;height:var(--bottombar-h);background:#fff;border-top:var(--hairline);display:flex;align-items:center;padding:0 24px;gap:16px;z-index:50}
.ring{width:32px;height:32px;flex:none}
.stepnav{display:flex;align-items:center;gap:4px}
.stepnav .step{width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;color:var(--st-400)}
.stepnav .step:hover{background:var(--st-100)}
.stepnav .step.on{width:auto;padding:0 16px 0 14px;gap:8px;background:var(--ember-t10);color:var(--ember-700);font-weight:600;font-size:14px}
.aibar{flex:1;max-width:506px;margin:0 auto;height:48px;border:1px solid var(--st-200);border-radius:999px;display:flex;align-items:center;gap:10px;padding:0 6px 0 16px;background:#fff;cursor:text}
.aibar input{flex:1;border:0;outline:0;font-size:13.5px;background:none}
.aibar .send{width:36px;height:36px;border-radius:50%;background:var(--ember);color:#fff;display:flex;align-items:center;justify-content:center;flex:none}
.btn-export{height:48px;border-radius:12px;background:var(--ember);color:#fff;font-weight:600;font-size:14px;display:inline-flex;align-items:center;gap:8px;padding:0 18px}

/* workspace */
#workspace{position:fixed;top:var(--topbar-h);bottom:var(--bottombar-h);left:0;right:0;display:flex}
#panel{width:var(--panel-w);flex:none;background:#fff;border-right:var(--hairline);display:flex;flex-direction:column}
#panel-scroll{flex:1;overflow-y:auto}
.panel-head{display:flex;align-items:center;gap:12px;padding:28px 24px 24px;font-family:var(--f-display);font-size:24px;letter-spacing:.01em}
.panel-head .icon{color:var(--ember)}
.panel-body{display:flex;flex-direction:column;gap:40px;padding:4px 24px 40px}
#panel-nav{height:44px;border-top:var(--hairline);display:flex;align-items:center;justify-content:space-between;padding:0 24px;background:#fff;font-weight:500;font-size:12px}
#panel-nav .prev{color:var(--st-500)} #panel-nav .next{color:var(--ember-700)}
#panel-nav button:hover{text-decoration:underline}
#map-area{flex:1;position:relative;background:#F3F1EE}
#map{position:absolute;inset:0}

/* map furniture */
.map-fab{position:absolute;display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--st-200);border-radius:999px;box-shadow:var(--sh-xs);padding:0 14px;height:36px;font-weight:500;font-size:13px}
.map-fab .count{background:var(--ember);color:#fff;border-radius:50%;width:18px;height:18px;display:flex;align-items:center;justify-content:center;font-family:var(--f-mono);font-size:10px}
.zoom-h{position:absolute;top:16px;right:16px;display:flex;background:#fff;border:1px solid var(--st-200);border-radius:10px;box-shadow:var(--sh-xs);overflow:hidden}
.zoom-h button{width:36px;height:36px;display:flex;align-items:center;justify-content:center;color:var(--st-600)}
.zoom-h button:hover{background:var(--st-100)}
.zoom-h button+button{border-left:1px solid var(--st-200)}
.legend{position:absolute;left:16px;bottom:16px;background:#fff;border:1px solid var(--st-200);border-radius:12px;box-shadow:var(--sh-xs);padding:12px 14px;display:flex;flex-direction:column;gap:8px}
.layers-panel{position:absolute;top:60px;left:16px;width:260px;background:#fff;border:1px solid var(--st-200);border-radius:16px;box-shadow:var(--sh-md);padding:14px 0 10px;display:none}
.layers-panel.open{display:block}
.layers-panel .row{display:flex;align-items:center;gap:8px;padding:0 14px;height:36px;font-size:13px}
.toggle{width:28px;height:16px;border-radius:999px;background:var(--st-300);position:relative;flex:none;margin-left:auto;transition:background .15s;cursor:pointer}
.toggle::after{content:'';position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;transition:left .15s}
.toggle.on{background:var(--ember)}
.toggle.on::after{left:14px}
