:root{
  --bg:#0b0f14;
  --card:#121824;
  --text:#e8eefc;
  --muted:#98a3b8;
  --line:#27324a;
  --accent:#5eead4;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

.top{
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  background:linear-gradient(180deg, rgba(94,234,212,.08), transparent);
}
.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:38px; height:38px; display:grid; place-items:center;
  background:var(--card); border:1px solid var(--line); border-radius:14px
}
.title{font-weight:900; letter-spacing:.2px}
.subtitle{color:var(--muted); font-size:13px}
.actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

.btn{
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  font-weight:900;
  cursor:pointer;
}
.btn:hover{border-color:rgba(94,234,212,.45)}
.btn.mini{padding:8px 10px; font-weight:900; border-radius:10px}

.iconBtn{display:flex; align-items:center; gap:8px; padding:9px 10px}
.ico{
  width:22px; height:22px; border-radius:7px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.25);
  object-fit:cover;
}

.layout{
  display:grid;
  gap:14px;
  padding:14px;
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}

.cardHead{display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:10px}
.cardTitle{font-weight:950; font-size:18px}
.cardSub{color:var(--muted); font-size:13px}

.mapWrap{
  width:100%;
  aspect-ratio:2/1;
  border-radius:14px;
  overflow:hidden;
  border:1px solid var(--line);
}
svg{width:100%; height:100%; display:block}

.bgPhoto{opacity:.65}
.hidden{display:none}

.areaOuter{fill:rgba(255,255,255,.02); stroke:rgba(255,255,255,.2); stroke-width:2}
.areaInner{fill:rgba(94,234,212,.08); stroke:rgba(94,234,212,.45); stroke-width:2; stroke-dasharray:8 6}

.hint{margin-top:10px; color:var(--muted); font-size:13px; line-height:1.35}

.overlayLabel{fill:rgba(255,255,255,.8); font-size:12px; font-weight:900; paint-order: stroke; stroke: rgba(0,0,0,.55); stroke-width:3}
.pipeMain{fill:none; stroke:rgba(0,180,255,.9); stroke-width:6; stroke-linecap:round}
.pipe{fill:none; stroke:rgba(0,180,255,.75); stroke-width:4; stroke-linecap:round}
.drip{fill:rgba(0,180,255,1); stroke:rgba(0,0,0,.5); stroke-width:2}
.shadeRect{fill:rgba(255,220,0,.12); stroke:rgba(255,220,0,.35); stroke-width:2}
.shadeLines{fill:none; stroke:rgba(255,220,0,.35); stroke-width:2}

.plantDot{cursor:pointer}
.plantDot circle{stroke:rgba(0,0,0,.45); stroke-width:2}
.plantDot text{
  fill:rgba(255,255,255,.88);
  font-size:12px;
  font-weight:950;
  paint-order: stroke;
  stroke: rgba(0,0,0,.6);
  stroke-width: 3px;
}
.plantDot.active circle{stroke:rgba(94,234,212,1); stroke-width:4}

.grid2{
  display:grid;
  grid-template-columns: 1fr 420px;
  gap:12px;
}
@media(max-width: 980px){
  .grid2{grid-template-columns: 1fr}
}

.searchRow{margin-bottom:10px}
.inp{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  color:var(--text);
  outline:none;
}
.inp:focus{border-color:rgba(94,234,212,.6)}

.list{
  display:grid;
  gap:8px;
  max-height: 420px;
  overflow:auto;
  padding-right:4px;
}
.row{
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
}
.row:hover{border-color:rgba(94,234,212,.4)}
.row .r1{display:flex; justify-content:space-between; gap:10px; align-items:center}
.row .name{font-weight:950}
.row .zone{color:var(--muted); font-weight:900}
.row .r2{margin-top:6px; color:var(--muted); font-size:13px; line-height:1.3}

.info{
  border:1px solid var(--line);
  background:rgba(0,0,0,.12);
  border-radius:14px;
  padding:12px;
}
.infoTitle{font-weight:950; margin-bottom:8px}
.infoBody{color:#cbd5e1; line-height:1.35}
.badges{display:flex; flex-wrap:wrap; gap:6px; margin-top:10px}
.badge{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12px;
}

.mediaBox{
  margin-top:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  border-radius:14px;
  padding:10px;
}
.mediaHead{display:flex; justify-content:space-between; gap:10px; align-items:center}
.mediaTitle{font-weight:950}
.mediaBtns{display:flex; gap:8px; flex-wrap:wrap}
.mediaStage{
  margin-top:10px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  overflow:hidden;
  min-height:180px;
  background:rgba(0,0,0,.25);
  display:grid;
  place-items:center;
}
.mediaStage img, .mediaStage video{
  width:100%;
  height:auto;
  display:block;
}
.mediaHint{color:var(--muted); font-size:13px; padding:12px; text-align:center}

/* PNG overlay layers */
.overlayImg{
  opacity: .85;
}

/* top nav */
.navLinks{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.navA{
  text-decoration:none;
  color:var(--muted);
  font-weight:950;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid transparent;
}
.navA:hover{color:var(--text); border-color:rgba(94,234,212,.35)}
.navA.active{color:var(--text); border-color:rgba(94,234,212,.55); background:rgba(94,234,212,.06)}

/* maker */
.makerBar{display:flex; gap:12px; flex-wrap:wrap; align-items:center; margin-bottom:10px}
.makerGroup{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.makerLabel{color:var(--muted); font-size:13px; font-weight:900}
.makerStatus{color:var(--muted); font-size:13px; font-weight:900}

.makerWrap{border:1px solid var(--line); border-radius:14px; overflow:hidden}
.makerStage{position:relative; width:100%; aspect-ratio:2/1; background:rgba(0,0,0,.25)}
.makerImg, .makerCanvas, .makerSvg{
  position:absolute; inset:0;
  width:100%; height:100%;
}
.makerImg{object-fit:fill}
.makerSvg{pointer-events:none}
.makerCanvas{cursor:crosshair}
.hidden{display:none}

/* admin form layout */
.kvForm{
  display:grid;
  grid-template-columns: 170px 1fr;
  gap:10px 12px;
  align-items:center;
}
.kvForm label{color:var(--muted); font-size:13px; font-weight:900}

@media(max-width: 980px){
  .kvForm{grid-template-columns: 1fr}
}

/* overlay maker stage must not be white */
.makerStage{
  background: rgba(0,0,0,.22);
}

/* canvas should be transparent */
.makerCanvas{
  background: transparent !important;
}

/* hide ONLY active layer image to avoid double stacking with edit canvas */
.hiddenByEdit{
  opacity: 0 !important;
  pointer-events: none !important;
}

/* forms (used in trees.html) */
.kvForm{
  display:grid;
  grid-template-columns: 170px 1fr;
  gap:10px 12px;
  align-items:center;
}
.kvForm label{color:var(--muted); font-size:13px; font-weight:900}
@media(max-width: 980px){ .kvForm{grid-template-columns: 1fr} }

/* maker stage look */
.makerStage{
  background: rgba(0,0,0,.22);
}
.makerCanvas{
  background: transparent !important;
}
/* hide active overlay img so it doesn't double with edit canvas */
.hiddenByEdit{
  opacity: 0 !important;
  pointer-events: none !important;
}

/* maker stage not white */
.makerStage{ background: rgba(0,0,0,.22); }
.makerCanvas{ background: transparent !important; }
.hiddenByEdit{ opacity: 0 !important; pointer-events:none !important; }

/* trees editor form */
.kvForm{
  display:grid;
  grid-template-columns: 170px 1fr;
  gap:10px 12px;
  align-items:center;
}
.kvForm label{color:var(--muted); font-size:13px; font-weight:900}
@media(max-width: 980px){ .kvForm{grid-template-columns: 1fr} }
