
/* ---- inline-style ---- */
:root{--bg:#f5f5f5;--panel:#fff;--line:#d7d7d7;--soft:#ececec;--text:#1f1f1f;--muted:#666;--blue:#1664d6;--blueSoft:#eaf2ff;--red:#b42318;--redSoft:#fdecea;--green:#15803d;--orange:#d97706;--shadow:0 1px 2px rgba(0,0,0,.08);--accent:#d92c32;--accentSoft:#f8d9dd;--accentSoft2:#f4e8ea;--accentBorder:#e5a7ad}
*{box-sizing:border-box}
html,body{height:100%;margin:0;overflow:hidden;font-family:Arial,Helvetica,sans-serif;font-size:13px;color:var(--text);background:var(--bg)}
.app{height:100vh;display:grid;grid-template-columns:370px 1fr;grid-template-rows:auto 1fr 30px;grid-template-areas:"toolbar toolbar" "sidebar map" "status status"}
.toolbar{grid-area:toolbar;display:flex;gap:7px;align-items:center;flex-wrap:wrap;padding:8px 10px;background:var(--panel);border-bottom:1px solid var(--line);box-shadow:var(--shadow);z-index:1000}
.project-toolbar{min-height:48px}
.float-toolbar{
  grid-area:map;
  position:relative;
  align-self:start;
  justify-self:center;
  z-index:1200;
  display:none;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
  max-width:calc(100% - 28px);
  margin-top:12px;
  padding:8px;
  background:rgba(255,255,255,.96);
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 4px 18px rgba(0,0,0,.18);
}
body:not(.draw-active):not(.vertex-editing):not(.measure-active):not(.image-overlay-selected) #selectedFloatToolbar{display:flex}
body.draw-active #drawFloatToolbar{display:flex}
body.draw-active #map, body.draw-active #editOverlay{cursor:crosshair}
body.vertex-editing #vertexFloatToolbar{display:flex}

.title{font-weight:700;padding-right:12px;border-right:1px solid var(--line)}
.group{display:flex;gap:6px;align-items:center;flex-wrap:wrap;padding-right:8px;border-right:1px solid #e6e6e6}.group:last-child{border-right:0}.spacer{flex:1}.location-search-box{width:220px;height:30px;border:1px solid var(--line);border-radius:4px;padding:0 8px}.location-marker{background:#1664d6;border:3px solid #fff;border-radius:50%;width:18px;height:18px;box-shadow:0 0 0 2px rgba(22,100,214,.45),0 2px 8px rgba(0,0,0,.35)}.snap-tolerance{width:54px;height:30px;border:1px solid var(--line);border-radius:4px;padding:0 6px}.snap-indicator{position:absolute;width:22px;height:22px;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;border:2px solid #fff;background:rgba(22,100,214,.22);box-shadow:0 0 0 2px #1664d6,0 2px 8px rgba(0,0,0,.35);z-index:4}.snap-indicator:after{content:"";position:absolute;left:50%;top:50%;width:6px;height:6px;border-radius:50%;background:#1664d6;transform:translate(-50%,-50%)}.pick-menu{position:absolute;z-index:2200;min-width:230px;max-width:360px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 28px rgba(0,0,0,.22);padding:6px;display:none}.pick-menu.active{display:block}.pick-title{font-weight:700;font-size:12px;color:var(--muted);padding:5px 7px;border-bottom:1px solid var(--soft);margin-bottom:4px}.pick-item{display:flex;gap:7px;align-items:center;width:100%;justify-content:flex-start;border:0;background:#fff;padding:7px;border-radius:5px;text-align:left;min-height:0}.pick-item:hover,.pick-item.active{background:var(--blueSoft)}.pick-swatch{width:12px;height:12px;border-radius:3px;border:1px solid rgba(0,0,0,.25);flex:0 0 auto}.pick-meta{color:var(--muted);font-size:11px;margin-top:1px}.layer-order-btn{min-width:25px;width:25px;padding:0}.lock-btn.locked{background:var(--redSoft);color:var(--red);border-color:#f3c8c8}.opacity-input{width:72px;height:24px}.feature-row.locked,.file-card.locked{opacity:.72}.feature-row.locked .feature-name:after,.file-card.locked .file-name:after{content:' locked';font-weight:600;color:var(--red);font-size:10px;text-transform:uppercase;letter-spacing:.04em}
button,select,input{font:inherit}
button{min-height:30px;border:1px solid var(--line);border-radius:4px;background:#fff;padding:0 9px;cursor:pointer;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;line-height:1.1;text-align:center}
button:hover{background:#fafafa}button.primary{background:var(--blueSoft);border-color:#cfe0ff;color:#0f4fae}button.danger{background:var(--redSoft);border-color:#f3c8c8;color:var(--red)}
button.active{background:#dceaff;border-color:#9abfff;box-shadow:inset 0 0 0 1px #9abfff}button:disabled{opacity:.45;cursor:not-allowed}
select{height:30px;border:1px solid var(--line);border-radius:4px;background:#fff;padding:0 8px}

.sidebar{grid-area:sidebar;display:flex;flex-direction:column;min-width:0;background:var(--panel);border-right:1px solid var(--line);overflow:hidden}
.sidebar-section{padding:10px;border-bottom:1px solid var(--line);overflow:auto;flex:0 0 auto}
.project-section{flex:0 0 190px;min-height:110px}.files-section{flex:1 1 auto;min-height:120px}.selected-section{flex:0 0 270px;min-height:130px;border-bottom:0}
.sidebar-resizer{height:7px;flex:0 0 7px;cursor:row-resize;background:#f1f1f1;border-top:1px solid var(--line);border-bottom:1px solid var(--line);position:relative}
.sidebar-resizer:after{content:"";position:absolute;left:50%;top:2px;width:34px;height:2px;margin-left:-17px;border-top:1px solid #bbb;border-bottom:1px solid #bbb}
.sidebar-resizer:hover{background:#e8f0ff}.section-title{font-weight:700;display:flex;justify-content:space-between;gap:8px;margin-bottom:8px}.subtle{font-size:12px;color:var(--muted)}
.dropzone{border:1px dashed #b9b9b9;border-radius:6px;padding:12px;text-align:center;background:#fafafa;color:var(--muted);cursor:pointer;margin-bottom:8px;user-select:none}.dropzone.dragover{border-color:var(--blue);background:var(--blueSoft);color:#0f4fae}
.notice{border:1px solid #ead7a2;background:#fff8e1;color:#624400;border-radius:5px;padding:8px;font-size:12px;line-height:1.35}
.file-card{border:1px solid var(--line);border-radius:6px;overflow:hidden;background:#fff;margin-bottom:8px}.file-head{display:flex;gap:7px;align-items:center;padding:8px;background:#fafafa;border-bottom:1px solid var(--soft)}.file-card.collapsed .feature-row{display:none}.collapse-btn{min-width:26px;width:26px;padding:0;font-weight:700}
.file-main,.feature-main{flex:1;min-width:0}.file-name,.feature-name{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-meta,.feature-meta{color:var(--muted);font-size:12px;margin-top:2px;display:flex;gap:8px;flex-wrap:wrap}.sleeping-badge{display:inline-flex;align-items:center;border:1px solid #ead7a2;background:#fff8e1;color:#624400;border-radius:999px;padding:1px 6px;font-size:11px}
.file-actions,.feature-actions{display:flex;gap:4px;align-items:center;flex-wrap:wrap}.icon-btn{min-height:26px;line-height:24px;font-size:12px;padding:0 7px}.file-color{width:30px;height:27px;padding:0;border:1px solid var(--line);border-radius:4px;background:#fff;cursor:pointer}
.feature-row{display:flex;gap:7px;align-items:flex-start;padding:8px;border-top:1px solid #efefef;cursor:pointer;background:#fff}.feature-row:hover{background:#fafafa}.feature-row.selected{background:#eef5ff;outline:1px solid #cfe0ff;outline-offset:-1px}.feature-row.picked{background:#fff8e1;outline:1px solid #ead7a2;outline-offset:-1px}
.edit-stack{
  margin-top:10px;
  border-top:1px solid var(--line);
  padding-top:8px;
}
.edit-stack-title{
  font-weight:700;
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin-bottom:6px;
}
.edit-row{
  display:flex;
  gap:6px;
  align-items:center;
  border:1px solid var(--line);
  border-radius:5px;
  padding:6px;
  margin-bottom:5px;
  background:#fff;
}
.edit-row.disabled{opacity:.5;background:#fafafa}
.edit-row-main{flex:1;min-width:0}
.edit-row-name{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.edit-row-meta{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.edit-mini{min-height:23px;font-size:11px;padding:0 6px}
.edit-empty{font-size:12px;color:var(--muted)}
.kv{display:grid;grid-template-columns:118px 1fr;gap:6px 8px}.k{color:var(--muted)}.input-row{display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin-bottom:8px}.input-row input[type=text]{height:30px;border:1px solid var(--line);border-radius:4px;padding:0 8px;flex:1;min-width:0}
#map{grid-area:map;width:100%;height:100%;background:#ddd}
#editOverlay{grid-area:map;position:relative;z-index:850;pointer-events:none;overflow:hidden}
#editOverlay.lasso{pointer-events:auto;cursor:crosshair}
#editOverlay.drawing{pointer-events:auto;cursor:crosshair}
#editOverlay.shift-pan{pointer-events:none}
#editOverlay.zooming{opacity:0;pointer-events:none}
#editSvg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.vtx,.mid{position:absolute;border-radius:50%;transform:translate(-50%,-50%);pointer-events:auto;border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.55),0 1px 4px rgba(0,0,0,.4)}
.vtx{width:15px;height:15px;background:#b42318;cursor:move}.vtx.selected{width:18px;height:18px;background:#ff9f1c;box-shadow:0 0 0 2px #9a5b00,0 1px 5px rgba(0,0,0,.45)}.vtx.lasso-passive{pointer-events:none;cursor:crosshair}
.mid{width:9px;height:9px;background:#16a34a;cursor:copy;z-index:2;border-width:1.5px}.mid:before,.mid:after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:#fff}.mid:before{width:5px;height:1.5px}.mid:after{width:1.5px;height:5px}.mid:hover{width:13px;height:13px;background:#22c55e}
.draw-dot{position:absolute;width:12px;height:12px;border-radius:50%;transform:translate(-50%,-50%);background:#1664d6;border:2px solid #fff;box-shadow:0 0 0 1px #0f4fae,0 1px 4px rgba(0,0,0,.35);pointer-events:auto;cursor:pointer}
.draw-dot.first{width:16px;height:16px;background:#16a34a;box-shadow:0 0 0 2px #065f46,0 1px 5px rgba(0,0,0,.45)}
.draw-dot:hover{transform:translate(-50%,-50%) scale(1.25)}
.draw-hint{position:absolute;transform:translate(8px,-28px);background:#fff;border:1px solid #cfe0ff;color:#0f4fae;border-radius:4px;padding:3px 6px;font-size:12px;box-shadow:0 1px 3px rgba(0,0,0,.16);pointer-events:none;white-space:nowrap}
.draw-shape-guide{position:absolute;transform:translate(8px,8px);background:#111827;color:#fff;border:1px solid rgba(255,255,255,.18);border-radius:4px;padding:4px 7px;font-size:12px;box-shadow:0 2px 8px rgba(0,0,0,.24);pointer-events:none;white-space:nowrap;z-index:3}
.draw-toolbar-label{font-weight:700;color:#1f2937;margin-right:2px;white-space:nowrap}
.draw-toolbar-chip{display:inline-flex;align-items:center;gap:5px;height:26px;padding:0 8px;border:1px solid var(--line);background:#f8fafc;border-radius:4px;font-size:12px;color:#374151;white-space:nowrap}
.draw-setting{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:#4b5563;white-space:nowrap}
.draw-setting input,.draw-setting select{height:26px;border:1px solid #cfd7e3;border-radius:4px;background:#fff;padding:0 6px;font-size:12px;color:#111827}
.draw-setting input[type=number]{width:70px}
.draw-setting.hidden{display:none!important}
.draw-tool-separator{height:1px;background:var(--line);margin:5px 0}
.rail-flyout button[data-draw-tool] .flyout-icon{font-weight:700}
body.night-mode .draw-toolbar-label{color:#e5e7eb}
body.night-mode .draw-toolbar-chip{background:#1f2937;border-color:#374151;color:#d1d5db}
body.night-mode .draw-setting{color:#d1d5db}
body.night-mode .draw-setting input,body.night-mode .draw-setting select{background:#111827;border-color:#374151;color:#e5e7eb}

#mouseCoords{
  grid-area:map;
  align-self:end;
  justify-self:end;
  z-index:700;
  margin:0 10px 10px 0;
  padding:5px 8px;
  background:rgba(255,255,255,.92);
  border:1px solid var(--line);
  border-radius:4px;
  box-shadow:0 1px 3px rgba(0,0,0,.16);
  font-family:Consolas,Menlo,monospace;
  font-size:12px;
  pointer-events:none;
}
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.32);
  z-index:3000;
  display:none;
  align-items:center;
  justify-content:center;
}
.modal-backdrop.active{display:flex}
.modal{
  width:min(760px,calc(100vw - 28px));
  max-height:calc(100vh - 28px);
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 10px 40px rgba(0,0,0,.28);
  display:flex;
  flex-direction:column;
}
.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:12px;
  border-bottom:1px solid var(--line);
  font-weight:700;
}
.modal-body{padding:12px;overflow:auto}
.modal-foot{display:flex;justify-content:flex-end;gap:8px;padding:12px;border-top:1px solid var(--line)}
#coordText{
  width:100%;
  min-height:220px;
  resize:vertical;
  border:1px solid var(--line);
  border-radius:5px;
  padding:8px;
  font-family:Consolas,Menlo,monospace;
  font-size:12px;
}
.coord-help{
  color:var(--muted);
  font-size:12px;
  line-height:1.4;
  margin:8px 0;
}
.coord-error{
  display:none;
  color:var(--red);
  background:var(--redSoft);
  border:1px solid #f3c8c8;
  border-radius:5px;
  padding:8px;
  margin-top:8px;
}
.coord-preview{
  color:var(--muted);
  margin-top:8px;
  font-size:12px;
}
.import-preview-list{border:1px solid var(--line);border-radius:6px;overflow:hidden;margin-top:8px}
.import-preview-row{display:grid;grid-template-columns:1fr auto;gap:8px;padding:8px;border-bottom:1px solid var(--soft);font-size:12px}
.import-preview-row:last-child{border-bottom:0}
.import-preview-name{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.import-preview-meta{color:var(--muted);margin-top:3px}
.import-preview-badge{align-self:center;border:1px solid #cfe0ff;background:var(--blueSoft);color:#0f4fae;border-radius:999px;padding:3px 7px;font-size:11px}
.import-overlay{
  grid-area:map;
  align-self:center;
  justify-self:center;
  z-index:2500;
  min-width:300px;
  max-width:520px;
  background:rgba(255,255,255,.96);
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 8px 32px rgba(0,0,0,.24);
  padding:14px;
  display:none;
}
.import-overlay.active{display:block}
.import-title{font-weight:700;margin-bottom:6px}
.import-message{color:var(--muted);font-size:12px;margin-bottom:10px;line-height:1.35}
.import-bar{
  height:8px;
  background:#eef2f7;
  border-radius:999px;
  overflow:hidden;
  border:1px solid #e1e6ef;
}
.import-bar-fill{
  height:100%;
  width:0%;
  background:var(--blue);
  transition:width .18s ease;
}
.recovery-overlay{
  position:fixed;
  inset:0;
  z-index:4000;
  background:rgba(0,0,0,.34);
  display:none;
  align-items:center;
  justify-content:center;
}
.recovery-overlay.active{display:flex}
.recovery-card{
  width:min(520px,calc(100vw - 28px));
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 10px 40px rgba(0,0,0,.30);
  padding:14px;
}
.recovery-title{font-weight:700;margin-bottom:8px}
.recovery-body{color:var(--muted);font-size:13px;line-height:1.4;margin-bottom:12px}
.recovery-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.geom-input{
  height:30px;
  border:1px solid var(--line);
  border-radius:4px;
  padding:0 8px;
  width:120px;
}
.geom-info-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  border-radius:50%;
  border:1px solid #cfe0ff;
  background:var(--blueSoft);
  color:#0f4fae;
  font-weight:700;
  font-size:12px;
  cursor:help;
  position:relative;
}
.geom-tooltip{
  display:none;
  position:absolute;
  top:48px;
  left:50%;
  transform:translateX(-20%);
  z-index:3000;
  width:330px;
  max-width:calc(100vw - 24px);
  background:#fff;
  border:1px solid var(--line);
  border-radius:7px;
  box-shadow:0 8px 24px rgba(0,0,0,.20);
  padding:10px;
  font-size:12px;
  line-height:1.35;
  color:var(--text);
}
.geom-tooltip.active{display:block}
.geom-tooltip-title{font-weight:700;margin-bottom:4px}
.geom-tooltip-setup{color:var(--muted);margin-top:6px}
.geom-op-grid{display:grid;grid-template-columns:130px 1fr;gap:9px 10px;align-items:center}
.geom-op-grid input[type=range]{width:100%}
.geom-op-grid input[type=number]{height:30px;border:1px solid var(--line);border-radius:4px;padding:0 8px;width:120px}
.geom-op-summary{margin-top:10px;border:1px solid #cfe0ff;background:var(--blueSoft);color:#0f4fae;border-radius:5px;padding:8px;font-size:12px;line-height:1.35}
.geom-op-warning{margin-top:8px;border:1px solid #f3c8c8;background:var(--redSoft);color:var(--red);border-radius:5px;padding:8px;font-size:12px;display:none;white-space:pre-wrap}
.geom-op-note{font-size:12px;color:var(--muted);line-height:1.35;margin-top:8px}
.geometry-preview-panel{
  grid-area:map;
  align-self:start;
  justify-self:end;
  z-index:1190;
  display:none;
  width:340px;
  max-width:calc(100vw - 30px);
  margin:64px 12px 0 0;
  background:rgba(255,255,255,.96);
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 4px 18px rgba(0,0,0,.18);
  padding:10px;
  font-size:12px;
  line-height:1.35;
}
.geometry-preview-panel.active{display:block}
.geometry-preview-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.geometry-preview-desc{color:var(--muted);margin-bottom:8px}
.geometry-inline-controls{display:grid;grid-template-columns:110px 1fr;gap:7px 8px;align-items:center;margin-bottom:8px}
.geometry-inline-controls input[type=range]{width:100%}
.geometry-inline-controls input[type=number]{width:86px;height:28px;border:1px solid var(--line);border-radius:4px;padding:0 6px}
.geometry-inline-control-pair{display:flex;gap:6px;align-items:center}
.geometry-preview-summary{border:1px solid #cfe0ff;background:var(--blueSoft);color:#0f4fae;border-radius:5px;padding:7px;margin-top:6px}
.geometry-preview-warning{display:none;border:1px solid #f3c8c8;background:var(--redSoft);color:var(--red);border-radius:5px;padding:7px;margin-top:6px;white-space:pre-wrap}
.geometry-preview-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
.statusbar{grid-area:status;display:flex;gap:10px;align-items:center;padding:0 10px;background:var(--panel);border-top:1px solid var(--line);font-size:12px;white-space:nowrap;overflow:hidden}
.status-pill{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:999px;padding:3px 8px;background:#fff}.dirty{color:#8a4b00}.ok{color:var(--green)}.error{color:var(--red)}.perf-pill{color:#0f4fae;background:var(--blueSoft);border-color:#cfe0ff}

.layer-menu{position:absolute;z-index:2600;width:230px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 28px rgba(0,0,0,.22);padding:6px;display:none}
.layer-menu.active{display:block}
.layer-menu-title{font-weight:700;color:var(--muted);font-size:12px;padding:6px 8px;border-bottom:1px solid var(--soft);margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.layer-menu button{width:100%;justify-content:flex-start;border:0;background:#fff;border-radius:5px;min-height:28px}
.layer-menu button:hover{background:var(--blueSoft)}
.layer-menu-row{display:flex;align-items:center;gap:8px;padding:6px 8px}
.layer-menu-row input[type=range]{flex:1;min-width:0}
.layer-kebab{min-width:28px;width:28px;padding:0;font-size:18px;line-height:1}
.layer-mini{min-width:26px;width:26px;padding:0}
.layer-icon{min-width:24px;width:24px;padding:0;border:0;background:transparent;font-size:14px}
.layer-icon:hover{background:var(--soft)}
.file-head,.feature-row{align-items:center}
.file-actions,.feature-actions{flex:0 0 auto;flex-wrap:nowrap;gap:3px}
.file-main,.feature-main{min-width:0}
.file-meta,.feature-meta{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.feature-row{padding:7px 8px}
.file-head{padding:7px 8px}
.feature-row .feature-actions .opacity-input,
.feature-row .feature-actions .layer-order-btn,
.feature-row .feature-actions [data-a="featfront"],
.feature-row .feature-actions [data-a="featback"],
.feature-row .feature-actions [data-a="featlock"],
.feature-row .feature-actions [data-a="zoomfeat"],
.feature-row .feature-actions label,
.file-head .file-actions .opacity-input,
.file-head .file-actions .layer-order-btn,
.file-head .file-actions [data-a="filelock"],
.file-head .file-actions [data-a="zoomfile"],
.file-head .file-actions [data-a="removefile"],
.file-head .file-actions label{display:none!important}


body.measure-active #measureFloatToolbar{display:flex}
body.measure-active #map, body.measure-active #editOverlay{cursor:crosshair}
.measure-label{background:rgba(255,255,255,.94);border:1px solid var(--line);border-radius:4px;padding:3px 6px;box-shadow:0 1px 4px rgba(0,0,0,.22);white-space:nowrap}
.annotation-label{background:transparent;border:0;white-space:nowrap;text-shadow:0 1px 2px rgba(255,255,255,.95),0 -1px 2px rgba(255,255,255,.95)}
.measure-point-marker{border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 2px rgba(0,0,0,.35),0 1px 5px rgba(0,0,0,.35)}
.measure-popup-actions{display:flex;gap:5px;flex-wrap:wrap;margin-top:6px}
.measure-popup-actions button{min-height:24px;font-size:12px}


.measure-toolbar{top:auto;align-self:start;justify-self:center;max-width:calc(100% - 36px)}
.measure-toolbar input[type=text]{height:30px;width:180px;max-width:28vw;border:1px solid var(--line);border-radius:4px;padding:0 8px}
.measure-style-panel{grid-area:map;align-self:start;justify-self:center;z-index:1210;margin-top:62px;background:rgba(255,255,255,.97);border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 18px rgba(0,0,0,.18);padding:8px;display:none;gap:8px;align-items:center;flex-wrap:wrap}
.measure-style-panel.active{display:flex}
.measure-style-panel label{display:flex;gap:5px;align-items:center;color:var(--muted);font-size:12px}
.measure-style-panel input[type=number]{height:28px;width:56px;border:1px solid var(--line);border-radius:4px;padding:0 6px}
.measure-style-panel select{height:28px}
.measure-label{transform-origin:center center}
.measure-label-inner{transform-origin:center center;display:inline-block}
.measure-label-small .measure-label-inner{transform:scale(.82)}
.measure-label-tiny .measure-label-inner{transform:scale(.68)}
.measure-point-marker{cursor:pointer}


/* v9 measure layout fix */
.measure-toolbar{
  align-self:start;
  justify-self:center;
  margin-top:12px;
  max-width:calc(100% - 360px);
  margin-left:220px;
}
.measure-style-panel{
  margin-top:62px;
  margin-left:220px;
  max-width:calc(100% - 380px);
}
.measure-label{
  background:rgba(255,255,255,.72);
  border:1px solid rgba(90,90,90,.28);
  border-radius:3px;
  padding:1px 4px;
  box-shadow:0 1px 2px rgba(0,0,0,.10);
  pointer-events:none;
}
.measure-label-inner{
  line-height:1.1;
}
.measure-label-small{
  background:rgba(255,255,255,.55);
  border-color:rgba(90,90,90,.18);
  padding:0 3px;
}
.measure-label-tiny{
  background:transparent;
  border:0;
  box-shadow:none;
  padding:0;
}
.measure-label-total{
  background:rgba(255,255,255,.82);
  border:1px solid rgba(40,40,40,.30);
  font-weight:700;
}
.measure-label-total.measure-label-tiny{
  background:rgba(255,255,255,.55);
  border:0;
}


body.image-overlay-selected #imageOverlayToolbar{display:flex}
#imageTraceLayer{grid-area:map;position:relative;z-index:760;pointer-events:none;overflow:hidden}
.trace-image-wrap{position:absolute;left:0;top:0;transform-origin:0 0;pointer-events:auto;will-change:transform;user-select:none}
.trace-image-wrap.locked{pointer-events:none}
.trace-image-wrap img{position:absolute;left:0;top:0;width:100%;height:100%;user-select:none;-webkit-user-drag:none;pointer-events:none}
.trace-image-wrap.selected{outline:2px dashed rgba(22,100,214,.85);outline-offset:0}
.trace-image-handle{position:absolute;width:14px;height:14px;border-radius:50%;background:#1664d6;border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.55),0 1px 4px rgba(0,0,0,.35);pointer-events:auto;z-index:3;transform:translate(-50%,-50%)}
.trace-image-handle.tl{cursor:nwse-resize}.trace-image-handle.tr{cursor:nesw-resize}.trace-image-handle.br{cursor:nwse-resize}.trace-image-handle.bl{cursor:nesw-resize}
.trace-image-label{position:absolute;left:8px;top:8px;background:rgba(255,255,255,.88);border:1px solid var(--line);border-radius:4px;padding:2px 5px;font-size:12px;color:#0f4fae;pointer-events:none;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.image-overlay-toolbar input[type=range]{width:120px}
.image-overlay-row{display:flex;gap:7px;align-items:center;padding:7px 8px;border-top:1px solid #efefef;background:#fff}
.image-overlay-row.selected{background:#eef5ff;outline:1px solid #cfe0ff;outline-offset:-1px}
.image-overlay-row.locked .feature-name:after{content:' locked';color:var(--red);font-weight:600;font-size:10px;text-transform:uppercase;letter-spacing:.04em}


/* v10 image trace fix */
body.image-overlay-selected #imageOverlayToolbar{display:flex}
.image-overlay-toolbar{
  justify-self:center;
  align-self:start;
  margin-top:12px;
  max-width:calc(100% - 360px);
  margin-left:220px;
}
#imageTraceLayer{
  grid-area:map;
  position:relative;
  z-index:740;
  pointer-events:none;
  overflow:hidden;
}
#imageTraceSvg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}
.trace-image-poly{
  pointer-events:auto;
  cursor:move;
}
.trace-image-poly.locked{
  pointer-events:none;
}
.trace-image-frame{
  fill:none;
  stroke:#1664d6;
  stroke-width:2;
  stroke-dasharray:7 5;
  pointer-events:none;
}
.trace-image-handle{
  position:absolute;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#1664d6;
  border:2px solid #fff;
  box-shadow:0 0 0 1px rgba(0,0,0,.55),0 1px 4px rgba(0,0,0,.35);
  pointer-events:auto;
  z-index:3;
  transform:translate(-50%,-50%);
}
.trace-image-handle.corner{cursor:nwse-resize}
.trace-image-handle.rotate{
  width:16px;
  height:16px;
  background:#d97706;
  cursor:grab;
}
.trace-image-label{
  position:absolute;
  transform:translate(8px,-30px);
  background:rgba(255,255,255,.88);
  border:1px solid var(--line);
  border-radius:4px;
  padding:2px 5px;
  font-size:12px;
  color:#0f4fae;
  pointer-events:none;
  max-width:220px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.image-overlay-toolbar input[type=range]{width:120px}
.image-overlay-toolbar button.active{background:#dceaff;border-color:#9abfff;box-shadow:inset 0 0 0 1px #9abfff}


/* v10 canvas image trace renderer */
#imageTraceLayer{
  grid-area:map;
  position:relative;
  z-index:740;
  pointer-events:none;
  overflow:hidden;
}
#imageTraceCanvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}
#imageTraceHitLayer{
  position:absolute;
  inset:0;
  pointer-events:none;
}
body.image-overlay-selected #imageTraceHitLayer{
  pointer-events:auto;
}
.trace-image-frame{
  position:absolute;
  pointer-events:none;
  border:2px dashed rgba(22,100,214,.9);
  transform-origin:0 0;
}
.trace-image-handle{
  position:absolute;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#1664d6;
  border:2px solid #fff;
  box-shadow:0 0 0 1px rgba(0,0,0,.55),0 1px 4px rgba(0,0,0,.35);
  pointer-events:auto;
  z-index:3;
  transform:translate(-50%,-50%);
}
.trace-image-handle.corner{cursor:nwse-resize}
.trace-image-handle.rotate{
  width:16px;
  height:16px;
  background:#d97706;
  cursor:grab;
}
.trace-image-label{
  position:absolute;
  transform:translate(8px,-30px);
  background:rgba(255,255,255,.88);
  border:1px solid var(--line);
  border-radius:4px;
  padding:2px 5px;
  font-size:12px;
  color:#0f4fae;
  pointer-events:none;
  max-width:220px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.image-overlay-toolbar{
  justify-self:center;
  align-self:start;
  margin-top:12px;
  max-width:calc(100% - 360px);
  margin-left:220px;
}
body.image-overlay-selected #imageOverlayToolbar{display:flex}


/* v10 image render fix */
#imageTraceDomLayer{
  position:absolute;
  inset:0;
  pointer-events:none;
}
.trace-image-dom{
  position:absolute;
  left:0;
  top:0;
  transform-origin:0 0;
  pointer-events:auto;
  user-select:none;
  -webkit-user-drag:none;
}
.trace-image-dom.locked{
  pointer-events:none;
}
.trace-image-dom img{
  display:block;
  width:100%;
  height:100%;
  object-fit:fill;
  user-select:none;
  -webkit-user-drag:none;
  pointer-events:none;
}
body.image-overlay-selected #imageTraceHitLayer{
  pointer-events:auto;
}


/* v10 georeference mode fixes */
.image-overlay-toolbar button.active{background:#dceaff;border-color:#9abfff;box-shadow:inset 0 0 0 1px #9abfff}
.trace-image-handle.corner{cursor:nwse-resize}
.trace-image-handle.perspective{background:#7c3aed}
.trace-image-label{z-index:4}


/* v10 perspective + rotate fix */
#imageTraceSvg2{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  overflow:visible;
}
.trace-image-svg{
  pointer-events:none;
}
.trace-image-handle.rotate{
  width:20px;
  height:20px;
  background:#f59e0b;
  cursor:crosshair;
}
.trace-rotate-arm{
  position:absolute;
  height:2px;
  background:#d97706;
  transform-origin:0 50%;
  pointer-events:none;
  z-index:2;
}


/* v10 stable image tools */
#imageTraceCanvas,
#imageTraceSvg2{
  display:none!important;
}
.trace-image-dom{
  z-index:1;
}
.trace-image-frame{
  z-index:2;
}
.trace-image-handle{
  z-index:5;
}
.trace-image-handle.rotate{
  width:22px;
  height:22px;
  background:#f59e0b;
  cursor:crosshair;
}
.trace-rotate-arm{
  position:absolute;
  height:2px;
  background:#d97706;
  transform-origin:0 50%;
  pointer-events:none;
  z-index:4;
}
.trace-perspective-note{
  position:absolute;
  background:rgba(255,255,255,.92);
  border:1px solid #cfe0ff;
  color:#0f4fae;
  border-radius:4px;
  padding:3px 6px;
  font-size:12px;
  pointer-events:none;
  z-index:4;
}


/* v10 perspective alignment fix */
#imageTraceCanvas{
  display:block!important;
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}
#imageTraceSvg2{display:none!important}
.trace-image-edge{
  position:absolute;
  height:2px;
  background:rgba(22,100,214,.9);
  transform-origin:0 50%;
  pointer-events:none;
  z-index:3;
}


/* v10 no-disappear perspective */
#imageTraceCanvas,
#imageTraceSvg2{
  display:none!important;
}
.trace-perspective-note{
  position:absolute;
  background:rgba(255,255,255,.92);
  border:1px solid #cfe0ff;
  color:#0f4fae;
  border-radius:4px;
  padding:3px 6px;
  font-size:12px;
  pointer-events:none;
  z-index:4;
}



/* v13 Canva/Photopea UX rehaul ------------------------------------------------- */
:root{
  --bg:#f7f8fa;--panel:#ffffff;--panel2:#fbfcfe;--line:#e5e7eb;--soft:#f1f5f9;
  --text:#111827;--muted:#6b7280;--blue:#2563eb;--blueSoft:#dbeafe;--blueSoft2:#eff6ff;
  --red:#dc2626;--redSoft:#fee2e2;--green:#16a34a;--orange:#f59e0b;
  --radius:12px;--radius-sm:8px;--shadow:0 10px 30px rgba(15,23,42,.10);--shadow-sm:0 2px 10px rgba(15,23,42,.07)
}
html,body{font-family:"Inter","Segoe UI Variable","Segoe UI",Arial,sans-serif;background:var(--bg);color:var(--text);font-size:13px}
.app{grid-template-columns:64px 315px minmax(360px,1fr) 330px;grid-template-rows:56px minmax(0,1fr) 32px;grid-template-areas:"toolbar toolbar toolbar toolbar" "toolrail sidebar map inspector" "status status status status";gap:0;background:var(--bg)}
.toolbar{grid-area:toolbar;min-height:56px;flex-wrap:nowrap;gap:10px;padding:8px 12px;background:rgba(255,255,255,.94);backdrop-filter:blur(12px);border-bottom:1px solid var(--line);box-shadow:0 1px 0 rgba(15,23,42,.03);overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.title{font-size:15px;font-weight:800;letter-spacing:-.01em;border-right:0;display:flex;align-items:center;gap:9px;padding-right:4px;white-space:nowrap}.title:before{content:"⬡";display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:9px;background:#111827;color:white;font-size:16px}.group{border-right:0;background:#f8fafc;border:1px solid #eef2f7;border-radius:999px;padding:4px;gap:4px;flex-wrap:nowrap}.group label.subtle{padding:0 4px}.spacer{min-width:8px}
button{border:1px solid transparent;background:transparent;border-radius:9px;min-height:32px;padding:0 10px;color:#1f2937;transition:background .16s ease,border-color .16s ease,box-shadow .16s ease,transform .08s ease}button:hover{background:#f1f5f9}button:active{transform:translateY(1px)}button.primary{background:var(--blue);border-color:var(--blue);color:#fff;box-shadow:0 1px 2px rgba(37,99,235,.22)}button.primary:hover{background:#1d4ed8}button.danger{background:#fff;border-color:#fecaca;color:var(--red)}button.danger:hover{background:var(--redSoft)}button.active{background:var(--blueSoft2);border-color:#bfdbfe;color:#1d4ed8;box-shadow:inset 0 0 0 1px #bfdbfe}select,input[type=text],input[type=number],textarea{border:1px solid var(--line)!important;border-radius:9px!important;background:#fff;box-shadow:0 1px 1px rgba(15,23,42,.03)}select{height:32px}.location-search-box{width:235px}
.tool-rail{grid-area:toolrail;background:#0f172a;color:#e5e7eb;border-right:1px solid #111827;display:flex;flex-direction:column;align-items:center;gap:7px;padding:10px 7px;z-index:900;box-shadow:4px 0 16px rgba(15,23,42,.12)}.tool-rail .rail-logo{width:40px;height:40px;border-radius:13px;background:#2563eb;color:white;display:flex;align-items:center;justify-content:center;font-weight:900;margin-bottom:6px;box-shadow:0 8px 20px rgba(37,99,235,.35)}.rail-btn{width:46px;height:46px;min-height:46px;border-radius:14px;color:#d1d5db;background:transparent;border:1px solid transparent;padding:0;display:flex;flex-direction:column;gap:2px;align-items:center;justify-content:center}.rail-btn .ico{font-size:18px;line-height:18px}.rail-btn .lbl{font-size:9px;line-height:10px}.rail-btn:hover{background:rgba(255,255,255,.09);color:white}.rail-btn.active{background:#1d4ed8;color:white;border-color:rgba(255,255,255,.16);box-shadow:0 8px 20px rgba(37,99,235,.25)}.rail-spacer{flex:1}.rail-tip{font-size:10px;color:#94a3b8;writing-mode:vertical-rl;transform:rotate(180deg);letter-spacing:.08em;text-transform:uppercase;margin-bottom:6px}
.sidebar{grid-area:sidebar;background:var(--panel2);border-right:1px solid var(--line);box-shadow:1px 0 0 rgba(15,23,42,.02);overflow:hidden}.sidebar-section{padding:12px;overflow:auto;border-bottom:1px solid var(--line)}.project-section{flex:0 0 170px;min-height:120px}.files-section{flex:1 1 auto;min-height:0}.selected-section{grid-area:inspector;display:flex;flex-direction:column;background:var(--panel2);border-left:1px solid var(--line);border-right:0;border-bottom:0;min-width:0;overflow:auto;padding:14px;z-index:880}.sidebar-resizer[data-resizer="files-selected"]{display:none}.section-title{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#475569;margin-bottom:10px}.section-title span:first-child{font-weight:800}.dropzone{border:1px dashed #cbd5e1;background:#fff;border-radius:14px;padding:13px;color:#64748b;transition:all .16s ease}.dropzone:hover,.dropzone.dragover{border-color:var(--blue);background:var(--blueSoft2);color:#1d4ed8}.notice{background:#fff;border:1px solid #e2e8f0;color:#475569;border-radius:12px;box-shadow:var(--shadow-sm)}
.file-card{border:1px solid #e2e8f0;border-radius:14px;overflow:hidden;background:#fff;margin-bottom:10px;box-shadow:var(--shadow-sm)}.file-head{background:#fff;border-bottom:1px solid #eef2f7;padding:9px 9px}.feature-row,.image-overlay-row{border-top:1px solid #f1f5f9;padding:9px 10px;background:#fff;transition:background .14s ease,box-shadow .14s ease}.feature-row:hover,.image-overlay-row:hover{background:#f8fafc}.feature-row.selected,.image-overlay-row.selected{background:var(--blueSoft2);outline:1px solid #bfdbfe;box-shadow:inset 3px 0 0 var(--blue)}.feature-row.picked{background:#fffbeb;box-shadow:inset 3px 0 0 #f59e0b}.file-name,.feature-name{font-weight:750;letter-spacing:-.01em}.file-meta,.feature-meta{font-size:11px;color:#64748b;margin-top:3px}.file-color{width:22px;height:22px;border-radius:7px;padding:0}.collapse-btn,.layer-kebab{border-radius:8px;background:#f8fafc}.layer-kebab{font-size:17px}.sleeping-badge{background:#fffbeb;border-color:#fde68a;color:#92400e}.image-overlay-row .feature-main:before{content:"IMG";margin-right:7px}.feature-row .feature-main:before{content:"⬡";margin-right:7px;color:var(--blue)}
.float-toolbar{border-radius:16px;border:1px solid rgba(226,232,240,.96);background:rgba(255,255,255,.94);backdrop-filter:blur(14px);box-shadow:var(--shadow);padding:7px;gap:5px}.selected-float-toolbar{max-width:calc(100% - 38px)}.image-overlay-toolbar{border-color:#bfdbfe;box-shadow:0 12px 34px rgba(37,99,235,.14)}.image-overlay-toolbar strong{background:#0f172a;color:white;border-radius:10px;padding:8px 10px;margin-right:3px}.image-overlay-toolbar label.subtle{padding-left:8px}.image-overlay-toolbar input[type=range]{accent-color:var(--blue)}
#map{background:#eef2f7}.leaflet-control-zoom{border:0!important;box-shadow:var(--shadow-sm)!important}.leaflet-control-zoom a{border-radius:10px!important;margin-bottom:4px;border:1px solid #e2e8f0!important}.leaflet-control-attribution{border-radius:10px 0 0 0}.statusbar{height:32px;background:#fff;border-top:1px solid var(--line);color:#475569}.status-pill{border-color:#e2e8f0;background:#f8fafc;border-radius:999px;padding:3px 9px}.perf-pill{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe}
#selectedPanel{display:flex;flex-direction:column;gap:10px}.inspector-card{background:#fff;border:1px solid #e2e8f0;border-radius:16px;box-shadow:var(--shadow-sm);padding:12px}.inspector-card h3{margin:0 0 10px;font-size:13px;letter-spacing:-.01em}.inspector-grid{display:grid;grid-template-columns:110px 1fr;gap:7px 10px;font-size:12px}.inspector-grid .k{color:#64748b}.inspector-actions{display:flex;gap:7px;flex-wrap:wrap}.inspector-actions button{background:#f8fafc;border-color:#e2e8f0}.inspector-actions button.primary{background:var(--blue);border-color:var(--blue)}.empty-inspector{height:100%;display:flex;align-items:center;justify-content:center;text-align:center;color:#64748b;border:1px dashed #cbd5e1;border-radius:18px;background:#fff;padding:24px}.kv{grid-template-columns:110px 1fr}.edit-stack{background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:12px;margin-top:0}.edit-row{border-color:#e2e8f0;border-radius:12px;background:#f8fafc}
.trace-image-handle{box-shadow:0 0 0 1px rgba(15,23,42,.55),0 4px 10px rgba(15,23,42,.22)}.trace-image-handle.corner{background:#2563eb}.trace-image-handle.perspective{background:#7c3aed}.trace-image-handle.rotate{background:#f59e0b}.trace-image-frame,.trace-image-edge{filter:drop-shadow(0 1px 1px rgba(255,255,255,.9))}.trace-perspective-note,.trace-image-label{border-radius:9px;box-shadow:var(--shadow-sm)}
.command-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.34);z-index:5000;display:none;align-items:flex-start;justify-content:center;padding-top:10vh}.command-backdrop.active{display:flex}.command-palette{width:min(620px,calc(100vw - 30px));background:#fff;border:1px solid #e2e8f0;border-radius:18px;box-shadow:0 26px 70px rgba(15,23,42,.28);overflow:hidden}.command-palette input{width:100%;height:52px;border:0!important;border-bottom:1px solid #e2e8f0!important;border-radius:0!important;padding:0 18px;font-size:16px;outline:none}.command-list{max-height:360px;overflow:auto;padding:7px}.command-item{display:grid;grid-template-columns:32px 1fr auto;gap:10px;align-items:center;width:100%;text-align:left;border-radius:12px;padding:10px;background:#fff;border:0}.command-item:hover,.command-item.active{background:#eff6ff}.command-icon{font-size:17px}.command-title{font-weight:750}.command-hint{font-size:11px;color:#64748b}.kbd{font-size:11px;color:#64748b;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:6px;padding:2px 6px}.mini-help{grid-area:map;align-self:end;justify-self:center;z-index:760;margin-bottom:12px;background:rgba(15,23,42,.86);color:#fff;border-radius:999px;padding:7px 12px;font-size:12px;pointer-events:none;box-shadow:var(--shadow)}
@media (max-width:1100px){.app{grid-template-columns:56px 285px minmax(320px,1fr);grid-template-areas:"toolbar toolbar toolbar" "toolrail sidebar map" "status status status"}.selected-section{position:absolute;right:12px;top:72px;width:310px;max-height:calc(100vh - 120px);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}}



/* v13.1 structural UI corrections and Canva-style polish */
.inspector-panel{grid-area:inspector;min-width:0;overflow:auto;display:flex;flex-direction:column;background:var(--panel2);border-left:1px solid var(--line);border-right:0;border-bottom:0;padding:14px;z-index:880}
.sidebar .selected-section{display:none!important}
.files-section .section-title:after{content:" drag · hide · lock · edit";font-weight:500;color:#94a3b8;letter-spacing:0;text-transform:none;margin-left:auto}
.top-action{display:inline-flex;align-items:center;gap:6px}
.file-card.layers-empty{padding:16px;color:#64748b;text-align:center;border-style:dashed;background:#fff}
.layer-thumb{width:34px;height:28px;border-radius:8px;object-fit:cover;background:#f1f5f9;border:1px solid #e2e8f0;flex:0 0 auto;box-shadow:inset 0 0 0 1px rgba(255,255,255,.5)}
.layer-thumb.poly{display:flex;align-items:center;justify-content:center;color:#2563eb;font-size:17px;background:#eff6ff}
.layer-row-main{display:flex;gap:9px;align-items:center;min-width:0;flex:1}
.image-overlay-row .feature-main:before,.feature-row .feature-main:before{content:none!important}
.inspector-header{display:flex;align-items:center;gap:10px;margin-bottom:10px}.inspector-icon{width:36px;height:36px;border-radius:13px;background:#eff6ff;color:#1d4ed8;display:flex;align-items:center;justify-content:center;font-weight:900;font-size:17px}.inspector-title{font-size:15px;font-weight:850;letter-spacing:-.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.inspector-subtitle{font-size:11px;color:#64748b;margin-top:2px}.inspector-control{display:flex;flex-direction:column;gap:5px;margin-bottom:10px}.inspector-control label{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:#64748b;font-weight:800}.inspector-control input[type=text],.inspector-control input[type=number],.inspector-control select{width:100%;height:34px}.inspector-toggle-row{display:flex;gap:8px;align-items:center;justify-content:space-between;padding:8px 0;border-top:1px solid #f1f5f9}.inspector-mode-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.inspector-mode-grid button{border-color:#e2e8f0;background:#f8fafc}.inspector-mode-grid button.active{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}.inspector-danger-zone{border-top:1px solid #fee2e2;margin-top:4px;padding-top:10px}.empty-inspector strong{display:block;color:#111827;margin-bottom:6px}.empty-inspector{min-height:220px}.property-note{font-size:11px;color:#64748b;line-height:1.35}.geometry-quick-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.geometry-quick-grid button{background:#f8fafc;border-color:#e2e8f0}.measure-layer-row{display:flex;align-items:center;gap:9px;padding:9px 10px;border-top:1px solid #f1f5f9;background:#fff;cursor:pointer}.measure-layer-row:hover{background:#f8fafc}.measure-layer-row.selected{background:#eff6ff;box-shadow:inset 3px 0 0 var(--blue)}.toolbar::-webkit-scrollbar{height:6px}.toolbar::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px}.statusbar{gap:8px}.modal{border-radius:18px}.modal-head{padding:14px 16px}.modal-foot{padding:12px 16px}.modal-body{padding:16px}.trace-image-handle:hover,.vtx:hover,.mid:hover{transform:translate(-50%,-50%) scale(1.16)}.trace-image-handle.rotate:hover{transform:translate(-50%,-50%) scale(1.12)}

/* v14 Measure / Annotate split */
.rail-flyout{position:fixed;left:72px;top:220px;z-index:2400;display:none;width:236px;background:rgba(255,255,255,.98);border:1px solid #e2e8f0;border-radius:16px;box-shadow:0 18px 44px rgba(15,23,42,.20);padding:8px;backdrop-filter:blur(14px)}
.rail-flyout.active{display:block;animation:flyoutIn .14s ease-out}
@keyframes flyoutIn{from{opacity:0;transform:translateX(-6px) scale(.98)}to{opacity:1;transform:translateX(0) scale(1)}}
.rail-flyout-title{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#64748b;font-weight:900;padding:7px 9px 8px}
.rail-flyout button{width:100%;justify-content:flex-start;gap:10px;min-height:54px;border:0;background:#fff;border-radius:12px;padding:8px 9px;text-align:left}
.rail-flyout button:hover{background:#eff6ff;color:#1d4ed8}
.rail-flyout button strong{display:block;font-size:13px;color:#0f172a;line-height:1.1}
.rail-flyout button small{display:block;font-size:11px;color:#64748b;line-height:1.25;margin-top:3px;white-space:normal}
.flyout-icon{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:#eff6ff;color:#1d4ed8;font-weight:900;flex:0 0 auto}
.measure-top-group{border-right:1px solid #e6e6e6}.annotate-top-group{border-right:1px solid #e6e6e6}
.measure-toolbar.annotation-mode{border-color:#fde68a;box-shadow:0 12px 34px rgba(245,158,11,.14)}
.measure-toolbar.annotation-mode strong{background:#92400e;color:white;border-radius:10px;padding:8px 10px;margin-right:3px}
.measure-toolbar.measurement-mode{border-color:#bfdbfe;box-shadow:0 12px 34px rgba(37,99,235,.12)}
.measure-toolbar.measurement-mode strong{background:#1e3a8a;color:white;border-radius:10px;padding:8px 10px;margin-right:3px}
.measure-layer-card .file-head{background:#f8fafc}.annotation-layer-card .file-head{background:#fffbeb}
.annotation-layer-card .layer-thumb.poly{background:#fffbeb;color:#92400e}.measure-layer-card .layer-thumb.poly{background:#eff6ff;color:#1d4ed8}


/* v15 compact responsive top bar ------------------------------------------------ */
.compact-topbar{
  min-height:56px;
  height:56px;
  display:grid;
  grid-template-columns:auto auto minmax(220px,1fr) auto auto;
  align-items:center;
  gap:10px;
  overflow:visible;
  padding:8px 12px;
}
.topbar-brand{display:flex;align-items:baseline;gap:9px;min-width:0;white-space:nowrap}
.topbar-brand .title{padding-right:0;font-size:15px;min-width:0}
.topbar-subtitle{font-size:11px;color:#64748b;letter-spacing:.02em}
.topbar-actions{display:flex;align-items:center;gap:4px;background:#f8fafc;border:1px solid #eef2f7;border-radius:999px;padding:4px;min-width:0}
.topbar-core button{padding:0 10px}
.icon-action{min-width:32px;width:32px;padding:0;font-size:16px;line-height:1}
.topbar-search-wrap{display:flex;align-items:center;gap:4px;min-width:220px;max-width:520px;justify-self:stretch;background:#f8fafc;border:1px solid #eef2f7;border-radius:999px;padding:4px}
.topbar-search-wrap .location-search-box{width:100%;min-width:120px;height:32px;border-radius:999px!important;box-shadow:none}
.topbar-search-wrap button{flex:0 0 auto}
.topbar-export-compact select{max-width:120px}
.topbar-export-compact #exportScope{width:86px}
.topbar-export-compact #exportFormat{width:126px}
.topbar-more-wrap{position:relative;display:flex;align-items:center;justify-content:flex-end}
.topbar-more-btn{background:#fff;border-color:#e2e8f0;border-radius:999px;box-shadow:0 1px 2px rgba(15,23,42,.06)}
.top-more-menu{
  position:absolute;
  right:0;
  top:calc(100% + 9px);
  width:300px;
  max-height:calc(100vh - 82px);
  overflow:auto;
  display:none;
  z-index:3600;
  background:rgba(255,255,255,.98);
  border:1px solid #e2e8f0;
  border-radius:16px;
  box-shadow:0 24px 60px rgba(15,23,42,.22);
  padding:9px;
  backdrop-filter:blur(14px);
}
.top-more-menu.active{display:block;animation:flyoutIn .14s ease-out}
.top-more-menu button{width:100%;justify-content:flex-start;background:#fff;border-radius:12px;border:0;min-height:38px;text-align:left}
.top-more-menu button:hover{background:#eff6ff;color:#1d4ed8}
.top-more-menu button.danger{color:#dc2626;border:0;background:#fff}
.top-more-menu button.danger:hover{background:#fee2e2}
.top-menu-section-title{margin:10px 7px 6px;font-size:10px;line-height:1;text-transform:uppercase;letter-spacing:.10em;font-weight:900;color:#64748b}
.top-menu-section-title:first-child{margin-top:4px}
.top-menu-grid.two{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.top-menu-label{display:grid;grid-template-columns:88px 1fr;align-items:center;gap:8px;padding:4px 7px;font-size:12px;color:#64748b}
.top-menu-label select,.top-menu-full{width:100%;height:32px}
@media (max-width:1320px){
  .compact-topbar{grid-template-columns:auto auto minmax(180px,1fr) auto;}
  .topbar-export-compact{display:none;}
  .topbar-subtitle{display:none;}
}
@media (max-width:980px){
  .compact-topbar{grid-template-columns:auto auto 1fr auto;gap:7px;padding:7px 9px;}
  .topbar-brand .title{font-size:13px}
  .topbar-core #saveBtn,.topbar-core #fitAllBtn{display:none;}
  .topbar-search-wrap{min-width:120px;}
}
@media (max-width:760px){
  .compact-topbar{grid-template-columns:auto 1fr auto;}
  .topbar-core{display:none;}
  .topbar-search-wrap{min-width:0;}
  .topbar-search-wrap #clearLocationSearchBtn{display:none;}
}

@media (max-width:1100px){.inspector-panel{position:absolute;right:12px;top:72px;width:310px;max-height:calc(100vh - 120px);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}}



/* v20 vertex editor safety: real vertex handles must always win hit-testing over midpoint insert handles */
.vtx{z-index:6!important}
.mid{z-index:2!important}
#editOverlay.vertex-dragging .mid{display:none!important;pointer-events:none!important}

/* v25 inspector simplification: polygon geometry tools are only in top bar.
   v24 professional visual hardening pass ---------------------------------------
   Purpose: keep the Canva-style workflow, but remove the soft/AI-SaaS visual
   treatment. This is intentionally CSS-only for layout/skin safety. */
:root{
  --bg:#f3f4f6;
  --panel:#ffffff;
  --panel2:#f7f7f8;
  --line:#d6d8dc;
  --soft:#eceef1;
  --text:#1f2328;
  --muted:#5f6873;
  --blue:#1f5fbf;
  --blueSoft:#dbe8f7;
  --blueSoft2:#eef4fb;
  --red:#b42318;
  --redSoft:#f8e7e5;
  --green:#15803d;
  --orange:#b7791f;
  --radius:4px;
  --radius-sm:3px;
  --shadow:0 1px 2px rgba(31,35,40,.12);
  --shadow-sm:none;
}
html,body{
  font-family:"Segoe UI",Arial,Helvetica,sans-serif;
  font-size:13px;
  background:var(--bg);
  color:var(--text);
}
.app{
  grid-template-columns:56px 305px minmax(360px,1fr) 315px;
  grid-template-rows:46px minmax(0,1fr) 28px;
}
.toolbar,
.compact-topbar{
  min-height:46px;
  height:46px;
  padding:6px 8px;
  gap:8px;
  background:#fff;
  border-bottom:1px solid var(--line);
  box-shadow:none;
  backdrop-filter:none;
}
.topbar-brand{gap:7px}
.topbar-brand .title,
.title{
  font-size:13px;
  font-weight:700;
  letter-spacing:0;
  color:#20252b;
}
.title:before,
.topbar-brand .title:before{
  content:none!important;
  display:none!important;
}
.topbar-subtitle{font-size:11px;color:#66707b;letter-spacing:0}
.topbar-actions,
.topbar-search-wrap,
.group{
  background:#f8f8f9;
  border:1px solid var(--line);
  border-radius:3px;
  padding:3px;
  gap:3px;
}
.topbar-search-wrap{min-width:210px;max-width:480px}
button{
  min-height:28px;
  border:1px solid var(--line);
  border-radius:3px;
  background:#fff;
  color:#252a31;
  padding:0 8px;
  box-shadow:none!important;
  transition:background-color .12s ease,border-color .12s ease,color .12s ease;
}
button:hover{background:#f0f2f4;border-color:#c5c9cf}
button:active{transform:none}
button.primary{
  background:var(--blue);
  border-color:#174f9f;
  color:#fff;
}
button.primary:hover{background:#174f9f;border-color:#154987}
button.danger{background:#fff;border-color:#d7aaa6;color:var(--red)}
button.danger:hover{background:var(--redSoft);border-color:#c9837d}
button.active{
  background:var(--blueSoft);
  border-color:#86a9d4;
  color:#174f9f;
  box-shadow:none!important;
}
select,
input[type=text],
input[type=number],
textarea,
.location-search-box,
.topbar-search-wrap .location-search-box{
  height:28px;
  border-radius:3px!important;
  border-color:var(--line)!important;
  box-shadow:none!important;
  background:#fff;
}
select{height:28px;padding:0 6px}
.topbar-more-btn{border-radius:3px;background:#fff;border-color:var(--line)}
.top-more-menu,
.rail-flyout,
.pick-menu,
.layer-menu,
.command-palette,
.modal,
.recovery-card,
.import-overlay,
.geometry-preview-panel{
  border-radius:4px!important;
  border:1px solid var(--line)!important;
  box-shadow:0 3px 12px rgba(31,35,40,.16)!important;
  backdrop-filter:none!important;
  background:#fff!important;
}
.top-more-menu{padding:5px;width:286px;top:calc(100% + 5px)}
.top-more-menu.active,
.rail-flyout.active{animation:none}
.top-more-menu button,
.rail-flyout button,
.command-item{
  border-radius:3px;
  min-height:34px;
}
.top-more-menu button:hover,
.rail-flyout button:hover,
.command-item:hover,
.command-item.active{
  background:var(--blueSoft2);
  color:#174f9f;
}
.top-menu-section-title,
.rail-flyout-title{
  margin:8px 5px 4px;
  font-size:10px;
  letter-spacing:.07em;
  color:#66707b;
}
.tool-rail{
  background:#2f333a;
  color:#d8dde3;
  border-right:1px solid #24282e;
  box-shadow:none;
  padding:7px 6px;
  gap:4px;
}
.tool-rail .rail-logo{
  width:34px;
  height:32px;
  border-radius:3px;
  background:#20252b;
  color:#fff;
  box-shadow:none;
  font-size:11px;
  letter-spacing:.04em;
  margin-bottom:5px;
}
.rail-btn{
  width:42px;
  height:42px;
  min-height:42px;
  border-radius:3px;
  color:#cbd1d8;
  border:1px solid transparent;
  background:transparent;
  padding:0;
  gap:2px;
}
.rail-btn:hover{background:#3c424a;color:#fff;border-color:#49515b}
.rail-btn.active{background:#1f5fbf;color:#fff;border-color:#2c6ccf;box-shadow:none!important}
.rail-btn .ico{height:17px;line-height:17px;display:flex;align-items:center;justify-content:center}
.rail-btn .ico svg{
  width:17px;
  height:17px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.rail-btn .ico svg circle{fill:currentColor;stroke:none}
.rail-btn .lbl{font-size:9px;line-height:10px;font-weight:500}
.rail-tip{font-size:9px;color:#a4acb5;letter-spacing:.06em}
.rail-flyout{left:64px;width:226px;padding:5px}
.rail-flyout button{gap:8px;padding:7px;min-height:44px;background:#fff;border:0}
.rail-flyout button strong{font-size:12px;font-weight:700;color:#20252b}
.rail-flyout button small{font-size:11px;color:#66707b;margin-top:2px}
.flyout-icon{
  width:22px;
  height:22px;
  border:1px solid #cfd3d8;
  border-radius:3px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#30363d;
  background:#f4f5f6;
  font-size:11px;
  font-weight:700;
  flex:0 0 auto;
}
.sidebar,
.selected-section,
.inspector-panel{
  background:var(--panel2);
  box-shadow:none;
}
.sidebar{border-right:1px solid var(--line)}
.selected-section,
.inspector-panel{border-left:1px solid var(--line);padding:10px}
.sidebar-section{padding:9px;border-bottom:1px solid var(--line)}
.project-section{flex-basis:150px;min-height:108px}
.section-title{
  font-size:10px;
  letter-spacing:.065em;
  color:#59626e;
  margin-bottom:7px;
}
.dropzone{
  border-radius:4px;
  padding:9px;
  background:#fff;
  border-color:#c7ccd3;
  color:#66707b;
  transition:background-color .12s ease,border-color .12s ease,color .12s ease;
}
.dropzone:hover,
.dropzone.dragover{background:#eef4fb;border-color:#8facd0;color:#174f9f}
.notice{
  border-radius:3px;
  box-shadow:none;
  background:#fff;
  border-color:var(--line);
  color:#5f6873;
  padding:7px;
}
.file-card,
.inspector-card,
.edit-stack{
  border-radius:4px;
  border:1px solid var(--line);
  box-shadow:none;
  margin-bottom:7px;
  background:#fff;
}
.file-head{padding:6px 7px;background:#fff;border-bottom:1px solid #e7e9ec}
.feature-row,
.image-overlay-row,
.measure-layer-row{
  padding:6px 7px;
  border-top:1px solid #e9ebee;
  gap:7px;
  background:#fff;
  transition:background-color .12s ease;
}
.feature-row:hover,
.image-overlay-row:hover,
.measure-layer-row:hover{background:#f3f5f7}
.feature-row.selected,
.image-overlay-row.selected,
.measure-layer-row.selected{
  background:#dbe8f7;
  outline:0;
  box-shadow:inset 3px 0 0 var(--blue)!important;
}
.feature-row.picked{background:#fff6df;box-shadow:inset 3px 0 0 #b7791f!important}
.file-name,
.feature-name{font-weight:650;letter-spacing:0}
.file-meta,
.feature-meta{font-size:11px;color:#66707b;margin-top:1px}
.layer-row-main{gap:7px}
.layer-thumb{
  width:28px;
  height:23px;
  border-radius:3px;
  border:1px solid #cfd3d8;
  background:#f0f2f4;
  box-shadow:none;
  font-size:10px;
  font-weight:700;
  color:#30363d;
}
.layer-thumb.poly{
  background:#f0f2f4;
  color:#30363d;
  font-size:10px;
}
.file-color{width:20px;height:20px;border-radius:3px}
.collapse-btn,
.layer-kebab,
.layer-mini,
.icon-btn{
  border-radius:3px;
  background:#fff;
  border-color:var(--line);
}
.sleeping-badge,
.status-pill,
.kbd{
  border-radius:3px;
  background:#f4f5f6;
  border-color:#d6d8dc;
  color:#59626e;
}
.float-toolbar,
.measure-style-panel,
.geometry-preview-panel{
  border-radius:4px;
  border:1px solid var(--line);
  background:#fff;
  box-shadow:0 2px 8px rgba(31,35,40,.12);
  backdrop-filter:none;
  padding:5px;
  gap:4px;
}
.image-overlay-toolbar,
.measure-toolbar.measurement-mode,
.measure-toolbar.annotation-mode{border-color:#c7ccd3;box-shadow:0 2px 8px rgba(31,35,40,.12)}
.image-overlay-toolbar strong,
.measure-toolbar.measurement-mode strong,
.measure-toolbar.annotation-mode strong{
  background:#30363d;
  color:#fff;
  border-radius:3px;
  padding:6px 8px;
  font-size:12px;
}
#map{background:#e6e8eb}
.leaflet-control-zoom{box-shadow:none!important;border:1px solid var(--line)!important}
.leaflet-control-zoom a{border-radius:0!important;margin-bottom:0!important;border:0!important;border-bottom:1px solid var(--line)!important}
.leaflet-control-attribution{border-radius:0}
.statusbar{
  height:28px;
  background:#fff;
  border-top:1px solid var(--line);
  color:#59626e;
  gap:6px;
  padding:0 8px;
  font-size:11px;
}
.status-pill{padding:2px 6px;background:#fff;border-color:#e0e3e7}
.perf-pill{background:#f4f7fb;color:#174f9f;border-color:#cbd8e8}
#selectedPanel{gap:7px}
.inspector-card{padding:9px}
.inspector-card h3{font-size:12px;margin-bottom:7px;font-weight:700}
.inspector-header{gap:8px;margin-bottom:8px}
.inspector-icon{
  width:30px;
  height:30px;
  border-radius:3px;
  background:#eef4fb;
  color:#174f9f;
  font-size:13px;
}
.inspector-title{font-size:13px;font-weight:700;letter-spacing:0}
.inspector-subtitle{font-size:11px;color:#66707b}
.inspector-control{gap:4px;margin-bottom:8px}
.inspector-control label{font-size:10px;letter-spacing:.06em;color:#66707b;font-weight:700}
.inspector-control input[type=text],
.inspector-control input[type=number],
.inspector-control select{height:28px}
.inspector-mode-grid,
.geometry-quick-grid{gap:5px}
.empty-inspector{
  min-height:180px;
  border-radius:4px;
  background:#fff;
  border-color:#c7ccd3;
  padding:18px;
}
.modal-head{padding:10px 12px}.modal-body{padding:12px}.modal-foot{padding:10px 12px}
.command-backdrop{background:rgba(31,35,40,.28)}
.command-palette{width:min(560px,calc(100vw - 30px));overflow:hidden}
.command-palette input{height:44px;font-size:14px;padding:0 12px}
.command-list{padding:5px;max-height:330px}
.command-item{grid-template-columns:24px 1fr auto;gap:8px;padding:8px}
.command-icon{
  width:22px;
  height:22px;
  border-radius:3px;
  background:#f0f2f4;
  border:1px solid #d6d8dc;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:700;
  color:#30363d;
}
.command-title{font-weight:650}.command-hint{font-size:11px;color:#66707b}
.mini-help{border-radius:4px;background:rgba(31,35,40,.84);box-shadow:none;padding:5px 9px}
.vtx{
  width:12px;
  height:12px;
  background:#b42318;
  border:1px solid #fff;
  box-shadow:0 0 0 1px rgba(31,35,40,.6)!important;
  z-index:6!important;
}
.vtx.selected{
  width:14px;
  height:14px;
  background:#c77800;
  box-shadow:0 0 0 1px rgba(31,35,40,.7)!important;
}
.mid{
  width:8px;
  height:8px;
  background:#15803d;
  border:1px solid #fff;
  box-shadow:0 0 0 1px rgba(31,35,40,.5)!important;
  z-index:2!important;
}
.mid:hover{width:9px;height:9px;background:#15803d}
.trace-image-handle{
  width:12px;
  height:12px;
  border:1px solid #fff;
  box-shadow:0 0 0 1px rgba(31,35,40,.6)!important;
}
.trace-image-handle.rotate{width:16px;height:16px;background:#b7791f}
.trace-image-handle.corner{background:#1f5fbf}
.trace-image-handle.perspective{background:#4b5563}
.trace-image-frame{border-color:#1f5fbf;filter:none}
.trace-image-edge{background:#1f5fbf;filter:none}
.trace-perspective-note,
.trace-image-label,
.measure-label{
  border-radius:3px;
  box-shadow:none;
}
.trace-image-handle:hover,
.vtx:hover,
.mid:hover{transform:translate(-50%,-50%)!important}
.trace-image-handle.rotate:hover{transform:translate(-50%,-50%)!important}
.annotation-label{text-shadow:0 1px 1px rgba(255,255,255,.95),0 -1px 1px rgba(255,255,255,.95)}
@media (max-width:1320px){
  .compact-topbar{grid-template-columns:auto auto minmax(180px,1fr) auto}
}
@media (max-width:1100px){
  .app{grid-template-columns:52px 280px minmax(320px,1fr)}
  .inspector-panel,.selected-section{border-radius:4px!important;box-shadow:0 3px 12px rgba(31,35,40,.16)!important}
}
@media (max-width:980px){
  .compact-topbar{padding:5px 7px;gap:6px}
}



/* v27: put tools in their natural homes instead of the More menu */
.compact-project-menu{width:220px!important}
.rail-flyout-label{
  display:grid;
  grid-template-columns:1fr;
  gap:4px;
  padding:7px;
  margin:4px 0 0;
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  text-transform:none;
}
.rail-flyout-label select{
  width:100%;
  height:28px;
  border:1px solid var(--line);
  border-radius:3px;
  background:#fff;
  color:var(--text);
  padding:0 7px;
  font-size:12px;
  font-weight:400;
}
.map-display-control{
  grid-area:map;
  align-self:end;
  justify-self:start;
  z-index:710;
  margin:0 0 10px 10px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:3px;
  box-shadow:0 1px 2px rgba(31,35,40,.10);
  padding:5px 7px;
  pointer-events:auto;
}
.map-display-control label{
  display:flex;
  align-items:center;
  gap:7px;
  font-size:12px;
  font-weight:700;
  color:var(--muted);
}
.map-display-control select{
  height:26px;
  min-width:96px;
  border:1px solid var(--line);
  border-radius:3px;
  background:#fff;
  color:var(--text);
  padding:0 7px;
  font-weight:400;
}



/* v29 favicon accent + lighter day-mode rail -------------------------------
   Use restrained hints of the favicon red and remove the dark left rail in
   day mode. Night mode remains dark. */
.tool-rail{
  background:#f4f5f7;
  color:#4b5563;
  border-right:1px solid var(--line);
}
.tool-rail .rail-logo{
  background:#eef0f3;
  color:#4b5563;
  border:1px solid var(--line);
}
.rail-btn{
  color:#55606d;
}
.rail-btn:hover{
  background:#eceff3;
  color:#1f2937;
  border-color:#cfd5dc;
}
.rail-btn.active{
  background:var(--accentSoft2);
  color:var(--accent);
  border-color:var(--accentBorder);
}
.rail-tip{color:#7b8591}
.section-title{
  color:#66707b;
}
.section-title span:first-child{
  position:relative;
}
.section-title span:first-child:before{
  content:"";
  display:inline-block;
  width:7px;
  height:7px;
  margin-right:6px;
  border-radius:50%;
  background:var(--accentSoft);
  border:1px solid var(--accentBorder);
  vertical-align:middle;
}
.feature-row.selected,
.image-overlay-row.selected,
.measure-layer-row.selected{
  background:#f7f1f2;
  box-shadow:inset 3px 0 0 var(--accent)!important;
}
.inspector-icon{
  background:var(--accentSoft2);
  color:var(--accent);
}
.top-more-menu button.danger,
button.danger{
  color:var(--accent);
  border-color:var(--accentBorder);
}
.top-more-menu button.danger:hover,
button.danger:hover{
  background:var(--accentSoft2);
}
.map-display-control{
  border-color:#d3d7dd;
}
.theme-toggle-btn.active,
#themeToggleBtn.active{
  background:var(--accentSoft2);
  border-color:var(--accentBorder);
  color:var(--accent);
}
body.night-mode{
  --accent:#ff6b72;
  --accentSoft:#3f2529;
  --accentSoft2:#2f2226;
  --accentBorder:#6a3b42;
}
body.night-mode .tool-rail{
  background:var(--panel2);
  color:var(--text);
  border-right-color:var(--line);
}
body.night-mode .rail-btn.active,
body.night-mode #themeToggleBtn.active{
  background:var(--accentSoft2);
  color:var(--accent);
  border-color:var(--accentBorder);
}
body.night-mode .inspector-icon{
  background:var(--accentSoft2);
  color:var(--accent);
}
body.night-mode .feature-row.selected,
body.night-mode .image-overlay-row.selected,
body.night-mode .measure-layer-row.selected{
  background:#252027;
  box-shadow:inset 3px 0 0 var(--accent)!important;
}
body.night-mode .section-title span:first-child:before{
  background:var(--accentSoft);
  border-color:var(--accentBorder);
}

/* v28 night mode -------------------------------------------------------------
   A restrained dark workspace for late-night tracing/editing. It keeps the
   professional density from v24 and only changes presentation; tool logic is
   untouched. */
.map-display-control{
  display:flex;
  align-items:center;
  gap:7px;
}
.theme-toggle-btn{
  min-height:26px;
  height:26px;
  padding:0 8px;
  border-radius:3px;
  font-size:12px;
}
body.night-mode{
  --bg:#12161d;
  --panel:#1b2028;
  --panel2:#171b22;
  --line:#303743;
  --soft:#242b35;
  --text:#d7dce3;
  --muted:#9aa4b1;
  --blue:#6ea8ff;
  --blueSoft:#1f3552;
  --blueSoft2:#18283e;
  --red:#ff746c;
  --redSoft:#3a2325;
  --green:#4fb06a;
  --orange:#d4a148;
  --shadow:0 1px 2px rgba(0,0,0,.45);
  background:#12161d;
  color:var(--text);
}
body.night-mode .compact-topbar,
body.night-mode .toolbar,
body.night-mode .statusbar,
body.night-mode .sidebar,
body.night-mode .selected-section,
body.night-mode .inspector-panel,
body.night-mode .tool-rail,
body.night-mode .float-toolbar,
body.night-mode .measure-style-panel,
body.night-mode .geometry-preview-panel,
body.night-mode .map-display-control,
body.night-mode .top-more-menu,
body.night-mode .rail-flyout,
body.night-mode .command-palette,
body.night-mode .modal,
body.night-mode .pick-menu,
body.night-mode .layer-menu{
  background:var(--panel);
  color:var(--text);
  border-color:var(--line);
  box-shadow:var(--shadow);
  backdrop-filter:none;
}
body.night-mode .sidebar,
body.night-mode .selected-section,
body.night-mode .inspector-panel,
body.night-mode .tool-rail{
  background:var(--panel2);
}
body.night-mode .topbar-actions,
body.night-mode .topbar-search-wrap,
body.night-mode .group,
body.night-mode .file-card,
body.night-mode .inspector-card,
body.night-mode .edit-stack,
body.night-mode .dropzone,
body.night-mode .notice,
body.night-mode .empty-inspector,
body.night-mode .feature-row,
body.night-mode .image-overlay-row,
body.night-mode .measure-layer-row,
body.night-mode .file-head,
body.night-mode .layer-thumb,
body.night-mode .command-icon,
body.night-mode .flyout-icon,
body.night-mode .status-pill,
body.night-mode .kbd{
  background:#1b2028;
  color:var(--text);
  border-color:var(--line);
}
body.night-mode .file-head,
body.night-mode .feature-row,
body.night-mode .image-overlay-row,
body.night-mode .measure-layer-row{
  border-color:#2a313c;
}
body.night-mode button,
body.night-mode select,
body.night-mode input,
body.night-mode textarea{
  background:#202632;
  color:var(--text);
  border-color:#3a4350;
}
body.night-mode button:hover,
body.night-mode .top-more-menu button:hover,
body.night-mode .rail-flyout button:hover,
body.night-mode .command-item:hover,
body.night-mode .command-item.active{
  background:#253044;
  color:#f2f6fb;
  border-color:#4a5566;
}
body.night-mode button.primary,
body.night-mode .rail-btn.active,
body.night-mode #themeToggleBtn.active{
  background:#2f6fca;
  border-color:#3f7fde;
  color:#fff;
}
body.night-mode button.danger,
body.night-mode .top-more-menu button.danger{
  background:#2a1b1d;
  border-color:#5a2b2d;
  color:#ff8b83;
}
body.night-mode button.danger:hover,
body.night-mode .top-more-menu button.danger:hover{
  background:#3a2325;
  color:#ffb0aa;
}
body.night-mode .topbar-brand .title,
body.night-mode .title,
body.night-mode .file-name,
body.night-mode .feature-name,
body.night-mode .inspector-title,
body.night-mode .inspector-card h3,
body.night-mode .empty-inspector strong,
body.night-mode .rail-flyout button strong,
body.night-mode .command-title{
  color:#f2f4f7;
}
body.night-mode .topbar-subtitle,
body.night-mode .subtle,
body.night-mode .section-title,
body.night-mode .file-meta,
body.night-mode .feature-meta,
body.night-mode .inspector-subtitle,
body.night-mode .inspector-control label,
body.night-mode .property-note,
body.night-mode .rail-flyout button small,
body.night-mode .command-hint,
body.night-mode .top-menu-section-title,
body.night-mode .top-menu-label,
body.night-mode .statusbar{
  color:var(--muted);
}
body.night-mode .feature-row:hover,
body.night-mode .image-overlay-row:hover,
body.night-mode .measure-layer-row:hover{
  background:#202836;
}
body.night-mode .feature-row.selected,
body.night-mode .image-overlay-row.selected,
body.night-mode .measure-layer-row.selected{
  background:#1f3552;
  box-shadow:inset 3px 0 0 #6ea8ff!important;
}
body.night-mode .feature-row.picked{
  background:#342b1d;
  box-shadow:inset 3px 0 0 #d4a148!important;
}
body.night-mode .dropzone:hover,
body.night-mode .dropzone.dragover{
  background:#1f3552;
  border-color:#527fb8;
  color:#cde2ff;
}
body.night-mode .inspector-icon,
body.night-mode .layer-thumb.poly,
body.night-mode .measure-layer-card .layer-thumb.poly{
  background:#1f3552;
  color:#bcd8ff;
  border-color:#38567a;
}
body.night-mode .annotation-layer-card .layer-thumb.poly{
  background:#342b1d;
  color:#f6d38a;
  border-color:#6b5125;
}
body.night-mode .image-overlay-toolbar strong,
body.night-mode .measure-toolbar.measurement-mode strong,
body.night-mode .measure-toolbar.annotation-mode strong{
  background:#2c3440;
  color:#fff;
}
body.night-mode #map{
  background:#0d1117;
}
body.night-mode .leaflet-control-zoom,
body.night-mode .leaflet-bar,
body.night-mode .leaflet-control-attribution{
  background:#1b2028!important;
  border-color:var(--line)!important;
  color:var(--muted)!important;
}
body.night-mode .leaflet-control-zoom a,
body.night-mode .leaflet-control a{
  background:#1b2028!important;
  color:#d7dce3!important;
  border-color:var(--line)!important;
}
body.night-mode .leaflet-control-zoom a:hover,
body.night-mode .leaflet-control a:hover{
  background:#253044!important;
}
body.night-mode .leaflet-control-attribution a{
  color:#9ec5ff!important;
}
body.night-mode .modal-backdrop,
body.night-mode .command-backdrop{
  background:rgba(0,0,0,.55);
}
body.night-mode .modal-head,
body.night-mode .modal-foot{
  border-color:var(--line);
}
body.night-mode .coord-error,
body.night-mode .geometry-preview-warning,
body.night-mode .geom-op-warning{
  background:#3a2325;
  color:#ffb0aa;
  border-color:#6b3436;
}
body.night-mode .coord-preview,
body.night-mode .coord-help,
body.night-mode .geometry-preview-desc{
  color:var(--muted);
}
body.night-mode .geometry-preview-summary,
body.night-mode .geom-op-summary{
  background:#1f3552;
  border-color:#38567a;
  color:#cde2ff;
}
body.night-mode .measure-label{
  background:rgba(24,29,38,.78);
  color:#f2f4f7;
  border-color:rgba(140,151,165,.36);
}
body.night-mode .measure-label-total{
  background:rgba(24,29,38,.88);
}
body.night-mode .annotation-label{
  color:#f2f4f7;
  text-shadow:0 1px 1px rgba(0,0,0,.9),0 -1px 1px rgba(0,0,0,.9);
}
body.night-mode .mouse-coords,
body.night-mode #mouseCoords{
  background:rgba(24,29,38,.92);
  color:#f2f4f7;
  border-color:var(--line);
}
body.night-mode .mini-help{
  background:rgba(0,0,0,.78);
}
body.night-mode ::placeholder{
  color:#778393;
}
body.night-mode ::selection{
  background:#315d98;
  color:#fff;
}


/* v29 final override pass */
.tool-rail{
  background:#f4f5f7!important;
  color:#4b5563!important;
  border-right:1px solid var(--line)!important;
}
.tool-rail .rail-logo{
  background:#eef0f3!important;
  color:#4b5563!important;
  border:1px solid var(--line)!important;
}
.rail-btn{color:#55606d!important}
.rail-btn:hover{background:#eceff3!important;color:#1f2937!important;border-color:#cfd5dc!important}
.rail-btn.active{background:var(--accentSoft2)!important;color:var(--accent)!important;border-color:var(--accentBorder)!important}
.rail-tip{color:#7b8591!important}
.section-title span:first-child:before{
  content:"";
  display:inline-block;
  width:7px;
  height:7px;
  margin-right:6px;
  border-radius:50%;
  background:var(--accentSoft);
  border:1px solid var(--accentBorder);
  vertical-align:middle;
}
.feature-row.selected,
.image-overlay-row.selected,
.measure-layer-row.selected{
  background:#f7f1f2!important;
  box-shadow:inset 3px 0 0 var(--accent)!important;
}
.inspector-icon{background:var(--accentSoft2)!important;color:var(--accent)!important}
button.danger,
.top-more-menu button.danger{color:var(--accent)!important;border-color:var(--accentBorder)!important}
button.danger:hover,
.top-more-menu button.danger:hover{background:var(--accentSoft2)!important}
.theme-toggle-btn.active,
#themeToggleBtn.active{background:var(--accentSoft2)!important;border-color:var(--accentBorder)!important;color:var(--accent)!important}
body.night-mode .tool-rail{background:var(--panel2)!important;color:var(--text)!important;border-right-color:var(--line)!important}
body.night-mode .rail-btn.active,
body.night-mode #themeToggleBtn.active{background:var(--accentSoft2)!important;color:var(--accent)!important;border-color:var(--accentBorder)!important}
body.night-mode .inspector-icon{background:var(--accentSoft2)!important;color:var(--accent)!important}
body.night-mode .feature-row.selected,
body.night-mode .image-overlay-row.selected,
body.night-mode .measure-layer-row.selected{background:#252027!important;box-shadow:inset 3px 0 0 var(--accent)!important}
body.night-mode .section-title span:first-child:before{background:var(--accentSoft)!important;border-color:var(--accentBorder)!important}


/* v30 vertex-drag stability */
#editOverlay.vertex-dragging .vtx{cursor:grabbing!important}
body.vertex-drag-active, body.vertex-drag-active *{cursor:grabbing!important}



/* v32 responsive toolbar + project panel display fix -------------------------
   Keep map controls usable on small screens and ensure the Project panel opens
   at a content-safe height instead of clipping its own text. */
:root{
  --map-toolbar-left-safe:62px;
  --map-toolbar-right-safe:10px;
}

/* Floating toolbars now occupy a safe strip that starts to the right of the
   Leaflet zoom control. Long toolbars scroll horizontally instead of wrapping
   down over map controls or swallowing the map canvas. */
.float-toolbar{
  justify-self:start!important;
  align-self:start!important;
  margin:8px var(--map-toolbar-right-safe) 0 var(--map-toolbar-left-safe)!important;
  max-width:calc(100% - var(--map-toolbar-left-safe) - var(--map-toolbar-right-safe))!important;
  width:auto!important;
  max-height:46px!important;
  min-height:0!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  padding:6px 7px!important;
}
.float-toolbar > *{
  flex:0 0 auto!important;
}
.float-toolbar button,
.float-toolbar select,
.float-toolbar input{
  min-height:28px;
}
.float-toolbar::-webkit-scrollbar{height:6px}
.float-toolbar::-webkit-scrollbar-thumb{background:#c5cad2;border-radius:999px}
body.night-mode .float-toolbar::-webkit-scrollbar-thumb{background:#4a5362}

/* Keep Leaflet's own map buttons in their lane and above map tiles, but not on
   top of the editor toolbar. */
.leaflet-top.leaflet-left{
  z-index:790!important;
}
.leaflet-control-zoom{
  box-shadow:0 1px 2px rgba(31,35,40,.14)!important;
}

/* Bottom map display controls are compact and allowed to wrap before they
   collide with the coordinate readout. */
.map-display-control{
  max-width:calc(100% - 170px)!important;
  flex-wrap:wrap;
  row-gap:5px;
}
#mouseCoords{
  max-width:min(330px,calc(100% - 24px));
  overflow:hidden;
  text-overflow:ellipsis;
}

/* The Project panel was opening too short after the visual-density pass.  Give
   it enough default height for the import dropzone + notice, while keeping the
   Layers panel flexible. */
.sidebar{
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
}
#projectSection.project-section{
  flex:0 0 212px!important;
  min-height:188px!important;
  max-height:36vh;
  overflow:auto!important;
}
#filesSection.files-section{
  flex:1 1 auto!important;
  min-height:0!important;
}
#projectSection .section-title{
  margin-bottom:8px!important;
}
#projectSection .dropzone{
  line-height:1.32;
  margin-bottom:8px!important;
}
#projectSection #modeNotice,
#modeNotice{
  line-height:1.32;
  margin-top:0!important;
}
.sidebar-resizer[data-resizer="project-files"]{
  flex:0 0 6px!important;
  height:6px!important;
}

/* On genuinely narrow screens, put the floating toolbar underneath the zoom
   buttons instead of beside them. This keeps both controls reachable. */
@media (max-width:980px){
  :root{--map-toolbar-left-safe:8px;--map-toolbar-right-safe:8px;}
  .float-toolbar{
    margin-top:52px!important;
    max-height:44px!important;
  }
  #projectSection.project-section{
    flex-basis:196px!important;
    min-height:174px!important;
  }
}

/* On short screens, use slightly tighter project copy but never let it render
   underneath the resizer. */
@media (max-height:720px){
  #projectSection.project-section{
    flex-basis:190px!important;
    min-height:168px!important;
    max-height:42vh;
  }
  #projectSection .dropzone{
    padding:7px!important;
    font-size:12px;
  }
  #modeNotice{
    padding:6px!important;
    font-size:11px;
  }
}


/* v35 selected polygon context toolbar + vertex scale controls */
.polygon-context-toolbar{
  position:fixed;
  z-index:1450;
  display:none;
  align-items:center;
  gap:3px;
  padding:4px;
  background:var(--panel);
  border:1px solid var(--border, var(--line));
  border-radius:4px;
  box-shadow:0 2px 8px rgba(15,23,42,.16);
  pointer-events:auto;
  white-space:nowrap;
  user-select:none;
}
.polygon-context-toolbar.active{display:flex}
.polygon-context-toolbar button{
  min-height:26px;
  height:26px;
  padding:0 8px;
  border-radius:3px;
  font-size:12px;
}
.polygon-context-toolbar .danger{color:var(--danger);border-color:rgba(180,35,24,.32);background:transparent}
.polygon-context-toolbar .danger:hover{background:var(--redSoft, rgba(180,35,24,.08))}
.vertex-scale-group{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding-left:8px;
  margin-left:4px;
  border-left:1px solid var(--border, var(--line));
}
.vertex-scale-input{
  width:58px;
  height:28px;
  border:1px solid var(--border, var(--line));
  border-radius:3px;
  padding:0 6px;
  background:var(--panel);
  color:var(--text);
}
.vertex-scale-mini{min-width:30px;width:30px;padding:0;font-weight:700}
.vertex-scale-apply{min-width:48px}
@media (max-width: 900px){
  .polygon-context-toolbar{max-width:calc(100vw - 24px);overflow-x:auto}
  .polygon-context-toolbar button{padding:0 7px}
  .vertex-scale-group{padding-left:5px;margin-left:2px}
}

/* v37 edge-drag polygon editing: drag a segment parallel inward/outward */
.edge-drag-handle{
  position:absolute;
  height:14px;
  transform-origin:left center;
  pointer-events:auto;
  cursor:ns-resize;
  z-index:1;
  border-radius:2px;
  background:transparent;
}
.edge-drag-handle::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:50%;
  height:3px;
  transform:translateY(-50%);
  background:transparent;
  border-radius:2px;
}
.edge-drag-handle:hover::before,
.edge-drag-handle.dragging::before{
  background:rgba(31,95,191,.38);
  box-shadow:0 0 0 1px rgba(255,255,255,.85),0 0 0 2px rgba(31,95,191,.42);
}
#editOverlay.edge-dragging .mid{display:none!important;pointer-events:none!important}
body.night-mode .edge-drag-handle:hover::before,
body.night-mode .edge-drag-handle.dragging::before{
  background:rgba(96,165,250,.45);
  box-shadow:0 0 0 1px rgba(15,23,42,.9),0 0 0 2px rgba(96,165,250,.5);
}

/* v47 vertex-mode centre move handle: direct polygon translate inside Edit vertices */
.polygon-centre-move-handle{
  position:absolute;
  width:24px;
  height:24px;
  border-radius:50%;
  transform:translate(-50%,-50%);
  pointer-events:auto;
  z-index:5;
  cursor:grab;
  background:#ffffff;
  border:2px solid var(--accent,#d92c32);
  box-shadow:0 0 0 2px rgba(255,255,255,.88),0 2px 8px rgba(15,23,42,.28);
}
.polygon-centre-move-handle::before,
.polygon-centre-move-handle::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  background:var(--accent,#d92c32);
  border-radius:999px;
}
.polygon-centre-move-handle::before{width:13px;height:2px}
.polygon-centre-move-handle::after{width:2px;height:13px}
.polygon-centre-move-handle:hover{transform:translate(-50%,-50%) scale(1.08);}
.polygon-centre-move-handle.dragging{cursor:grabbing;background:var(--accentSoft,#f8d9dd);box-shadow:0 0 0 3px rgba(217,44,50,.18),0 3px 10px rgba(15,23,42,.32)}
body.vertex-centre-move-active, body.vertex-centre-move-active *{cursor:grabbing!important}
body.night-mode .polygon-centre-move-handle{background:#111827;border-color:var(--accent,#ff6b72);box-shadow:0 0 0 2px rgba(15,23,42,.92),0 2px 8px rgba(0,0,0,.45)}
body.night-mode .polygon-centre-move-handle.dragging{background:var(--accentSoft,#3f2529)}


/* v39 polygon format converter */
.converter-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,340px);gap:12px;align-items:start}
.converter-panel{border:1px solid var(--line);background:#f8fafc;border-radius:4px;padding:10px}
.converter-panel h4{margin:0 0 8px;font-size:13px;color:#111827}
.converter-dropzone{border:1px dashed #b8c1cc;background:#fff;border-radius:4px;padding:16px;text-align:center;color:var(--muted);cursor:pointer}
.converter-dropzone:hover,.converter-dropzone.dragover{border-color:var(--blue);background:#eef6ff;color:#174f9f}
.converter-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.converter-output-row{display:flex;flex-direction:column;gap:7px;margin:10px 0}
.converter-output-row input,.converter-output-row select{width:100%;min-width:0;box-sizing:border-box}
.converter-output-row button{width:100%;justify-content:center}
.converter-list{display:flex;flex-direction:column;gap:6px;max-height:220px;overflow:auto;margin-top:10px}
.converter-file-row{display:flex;justify-content:space-between;gap:10px;border:1px solid #e5e7eb;background:#fff;border-radius:4px;padding:8px 9px;font-size:12px}
.converter-file-row strong{display:block;font-size:12px;color:#111827;max-width:430px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.converter-file-row small{color:var(--muted)}
.converter-badge{align-self:center;font-weight:800;color:#174f9f;background:#eaf2ff;border:1px solid #cfe0ff;border-radius:999px;padding:2px 7px;white-space:nowrap}
.converter-status{white-space:pre-wrap;min-height:20px;margin-top:8px}
.converter-status.error{color:var(--red)}
.converter-status.ok{color:#166534}
body.night-mode .converter-panel,body.night-mode .converter-dropzone,body.night-mode .converter-file-row{background:#1f2937;border-color:#374151}
body.night-mode .converter-dropzone:hover,body.night-mode .converter-dropzone.dragover{background:#1e3a5f;border-color:#60a5fa;color:#dbeafe}
body.night-mode .converter-file-row strong{color:#e5e7eb}
body.night-mode .converter-badge{background:#253452;border-color:#3b5a8c;color:#bfdbfe}
@media(max-width:820px){.converter-grid{grid-template-columns:1fr}.converter-output-row{display:flex;flex-direction:column}}

/* v41 polygon validator / repair */
.validator-modal{width:min(1120px,calc(100vw - 28px))}
.validator-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,420px);gap:12px;align-items:start}
.validator-panel{border:1px solid var(--line);background:#f8fafc;border-radius:4px;padding:10px}
.validator-panel h4{margin:0 0 8px;font-size:13px;color:#111827}
.validator-dropzone{border:1px dashed #b8c1cc;background:#fff;border-radius:4px;padding:18px;text-align:center;color:var(--muted);cursor:pointer;min-height:96px;display:flex;align-items:center;justify-content:center;line-height:1.35}
.validator-dropzone:hover,.validator-dropzone.dragover{border-color:var(--blue);background:#eef6ff;color:#174f9f}
.validator-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.validator-list{display:flex;flex-direction:column;gap:6px;max-height:180px;overflow:auto;margin-top:10px}
.validator-file-row{display:flex;justify-content:space-between;gap:10px;border:1px solid #e5e7eb;background:#fff;border-radius:4px;padding:8px 9px;font-size:12px}
.validator-file-row strong{display:block;font-size:12px;color:#111827;max-width:520px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.validator-file-row small{color:var(--muted)}
.validator-badge{align-self:center;font-weight:800;color:#174f9f;background:#eaf2ff;border:1px solid #cfe0ff;border-radius:999px;padding:2px 7px;white-space:nowrap}
.validator-overview{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 10px}
.validator-chip{border:1px solid #d1d5db;background:#fff;border-radius:999px;padding:4px 8px;font-size:12px;color:#374151}
.validator-chip.error{border-color:#fecaca;background:#fff1f2;color:#b91c1c;font-weight:700}
.validator-chip.warning{border-color:#fed7aa;background:#fff7ed;color:#9a3412;font-weight:700}
.validator-chip.ok{border-color:#bbf7d0;background:#f0fdf4;color:#166534;font-weight:700}
.validator-issue-list{border:1px solid #e5e7eb;background:#fff;border-radius:4px;min-height:220px;max-height:320px;overflow:auto;padding:6px;display:flex;flex-direction:column;gap:6px}
.validator-issue{border:1px solid #e5e7eb;border-left-width:4px;border-radius:4px;background:#fff;padding:7px 8px;font-size:12px;line-height:1.35}
.validator-issue strong{display:block;font-size:12px;margin-bottom:2px}
.validator-issue small{display:block;color:var(--muted);margin-top:2px}
.validator-issue.error{border-left-color:#dc2626;background:#fffafa}
.validator-issue.warning{border-left-color:#d97706;background:#fffaf2}
.validator-issue.info{border-left-color:#2563eb;background:#f8fbff}
.validator-options{display:grid;grid-template-columns:1fr;gap:7px;font-size:13px;margin-top:8px}
.validator-options label{display:flex;align-items:center;gap:8px}
.validator-output-row{display:flex;flex-direction:column;gap:7px;margin:10px 0}
.validator-output-row input,.validator-output-row select{width:100%;box-sizing:border-box}
.validator-output-row button{width:100%;justify-content:center}
.validator-output-text{width:100%;min-height:170px;resize:vertical;font-family:Consolas,Menlo,monospace;font-size:12px;box-sizing:border-box;background:#fff;border:1px solid var(--line);border-radius:4px;padding:8px}
.validator-status{white-space:pre-wrap;min-height:20px;margin-top:8px;font-size:12px}
.validator-status.error{color:var(--red)}
.validator-status.ok{color:#166534}
.validator-status.warn{color:#9a3412}
body.night-mode .validator-panel,body.night-mode .validator-dropzone,body.night-mode .validator-file-row,body.night-mode .validator-issue-list,body.night-mode .validator-issue,body.night-mode .validator-chip,body.night-mode .validator-output-text{background:#1f2937;border-color:#374151;color:#e5e7eb}
body.night-mode .validator-dropzone:hover,body.night-mode .validator-dropzone.dragover{background:#1e3a5f;border-color:#60a5fa;color:#dbeafe}
body.night-mode .validator-file-row strong,body.night-mode .validator-panel h4{color:#e5e7eb}
body.night-mode .validator-badge{background:#253452;border-color:#3b5a8c;color:#bfdbfe}
@media(max-width:900px){.validator-grid{grid-template-columns:1fr}.validator-modal{width:min(760px,calc(100vw - 28px))}}



/* v46 transform tools */
body.polygon-move-active #map,
body.polygon-move-active #editOverlay{cursor:grab!important}
body.polygon-move-active #editOverlay{pointer-events:auto}
body.polygon-move-dragging #map,
body.polygon-move-dragging #editOverlay{cursor:grabbing!important}
body.polygon-move-active #editOverlay.polygon-move-ready{pointer-events:auto}


/* v48 hole/layer/style management */
.vtx.hole-vtx{background:#7c3aed!important;box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(124,58,237,.55)!important}
.hole-centre-handle{position:absolute;width:24px;height:24px;border-radius:50%;transform:translate(-50%,-50%);z-index:8;cursor:pointer;background:#7c3aed;border:3px solid #fff;box-shadow:0 3px 10px rgba(0,0,0,.28),0 0 0 3px rgba(124,58,237,.35)}
.hole-centre-handle:before{content:"";position:absolute;left:50%;top:50%;width:8px;height:8px;border-radius:50%;background:#fff;transform:translate(-50%,-50%)}
.hole-centre-handle:hover{transform:translate(-50%,-50%) scale(1.12)}
.hole-manager-list{display:flex;flex-direction:column;gap:6px;grid-column:1/-1;width:100%}
.hole-manager-row{display:grid;grid-template-columns:1fr auto auto auto;gap:6px;align-items:center;border:1px solid var(--line);border-radius:8px;padding:7px;background:#fff}
.hole-manager-row strong{font-size:12px}.hole-manager-row .subtle{font-size:11px}.hole-manager-row button{min-height:28px;padding:0 8px}.solo-banner{margin:0 0 10px 0;padding:10px;border:1px solid #fde68a;background:#fffbeb;border-radius:12px;color:#92400e;display:flex;align-items:center;justify-content:space-between;gap:8px}.solo-banner strong{font-size:12px}.solo-row{box-shadow:inset 3px 0 0 #f59e0b!important;background:#fffbeb!important}.step2-inspector-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.step2-inspector-grid button{background:#f8fafc;border-color:#e2e8f0}.style-chip{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:#64748b}.style-chip:before{content:"";width:12px;height:12px;border-radius:4px;background:var(--style-chip-color,#1664d6);border:1px solid rgba(0,0,0,.2)}
body.night-mode .hole-manager-row{background:#15171b;border-color:#303744}body.night-mode .solo-banner{background:#2a2114;border-color:#8a5a12;color:#facc15}body.night-mode .step2-inspector-grid button{background:#15171b;border-color:#303744;color:#e5e7eb}



/* v49 phase 3: editor polish, grouped workflows, mode states */
.mode-banner{
  grid-area:map;
  align-self:start;
  justify-self:center;
  z-index:1185;
  margin-top:58px;
  display:none;
  align-items:center;
  gap:9px;
  max-width:min(720px,calc(100% - 150px));
  padding:7px 11px;
  border:1px solid rgba(15,23,42,.16);
  border-left:4px solid var(--blue);
  border-radius:999px;
  background:rgba(255,255,255,.96);
  color:#111827;
  box-shadow:0 4px 18px rgba(15,23,42,.18);
  font-size:12px;
  pointer-events:none;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.mode-banner.active{display:flex}
.mode-banner strong{font-size:12px;font-weight:850;letter-spacing:.01em;color:#0f172a}
.mode-banner span{color:#475569;overflow:hidden;text-overflow:ellipsis}
.mode-banner[data-kind="draw"]{border-left-color:#1664d6}
.mode-banner[data-kind="vertex"]{border-left-color:var(--accent,#d92c32)}
.mode-banner[data-kind="hole"]{border-left-color:#7c3aed}
.mode-banner[data-kind="measure"]{border-left-color:#15803d}
.mode-banner[data-kind="image"]{border-left-color:#d97706}
.mode-banner[data-kind="geometry"]{border-left-color:#0f766e}
.mode-banner[data-kind="solo"]{border-left-color:#f59e0b}
.fullscreen-editor-btn{height:26px;min-height:26px;border-radius:3px;padding:0 8px;font-size:12px;background:#fff;border-color:var(--line);color:var(--text)}
.fullscreen-editor-btn.active{background:#111827;border-color:#111827;color:#fff}
body.editor-fullscreen-active .app{height:100vh;width:100vw;background:var(--bg)}
body.editor-fullscreen-active .topbar-subtitle::after{content:" · fullscreen";color:var(--accent,#d92c32);font-weight:800}
#geometryActionSelect optgroup{font-weight:800;color:#334155;background:#f8fafc}
#geometryActionSelect option{font-weight:400;color:#111827;background:#fff}
#geometryActionSelect option:disabled{color:#9ca3af}
body.geometry-preview-open .geometry-preview-panel{box-shadow:0 8px 30px rgba(15,23,42,.22)}
body.drawing-hole #map, body.drawing-hole #editOverlay{cursor:crosshair!important}
body.vertex-editing .polygon-centre-move-handle{outline:2px solid rgba(217,44,50,.15)}
body.vertex-centre-move-active .mode-banner{border-left-color:var(--accent,#d92c32);background:rgba(255,255,255,.98)}
body.night-mode .mode-banner{background:rgba(17,24,39,.96);border-color:#374151;color:#e5e7eb;box-shadow:0 8px 24px rgba(0,0,0,.42)}
body.night-mode .mode-banner strong{color:#f9fafb}
body.night-mode .mode-banner span{color:#cbd5e1}
body.night-mode .fullscreen-editor-btn{background:#111827;border-color:#374151;color:#e5e7eb}
body.night-mode .fullscreen-editor-btn.active{background:#e5e7eb;border-color:#e5e7eb;color:#111827}
body.night-mode #geometryActionSelect optgroup{background:#1f2937;color:#e5e7eb}
body.night-mode #geometryActionSelect option{background:#111827;color:#e5e7eb}

/* v59: geometry tool selection opens the preview/apply panel, so the old Run button is intentionally hidden. */
#runGeometryBtn.geometry-run-legacy{display:none!important;}
#geometryActionSelect{min-width:210px;}
@media(max-width:980px){.mode-banner{margin-top:100px;max-width:calc(100% - 24px);border-radius:10px;white-space:normal}.map-display-control{max-width:calc(100% - 24px)!important}}



/* v50 mode system: persistent active tool bar and clearer interaction states */
.mode-banner{
  pointer-events:auto!important;
  min-height:38px;
  max-width:min(920px,calc(100% - 170px));
  padding:6px 7px 6px 12px;
  gap:10px;
  border-radius:10px;
  display:flex;
  opacity:.98;
}
.mode-banner:not(.active){display:flex;opacity:.94;border-left-color:#64748b;background:rgba(255,255,255,.92)}
.mode-banner strong{flex:0 0 auto;min-width:max-content}
.mode-banner span#modeBannerHint{flex:1 1 auto;min-width:120px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mode-banner-metric{flex:0 0 auto;color:#0f172a!important;font-weight:800;background:#f8fafc;border:1px solid #e2e8f0;border-radius:999px;padding:3px 8px;max-width:240px}
.mode-banner-metric:empty{display:none}
.mode-banner-controls{display:flex;align-items:center;gap:5px;flex:0 0 auto;margin-left:2px}
.mode-banner-btn{height:26px;min-height:26px;border-radius:7px;padding:0 9px;font-size:12px;font-weight:750;background:#fff;border:1px solid #cbd5e1;color:#0f172a;box-shadow:0 1px 0 rgba(15,23,42,.04)}
.mode-banner-btn.primary{background:#1664d6;border-color:#1664d6;color:#fff}
.mode-banner-btn:hover:not(:disabled){filter:brightness(.98);box-shadow:0 2px 6px rgba(15,23,42,.12)}
.mode-banner-btn:disabled{display:none}
.mode-banner[data-kind="select"]{border-left-color:#64748b}
.mode-banner[data-kind="edit"]{border-left-color:var(--accent,#d92c32)}
.mode-banner[data-kind="shape"]{border-left-color:#1664d6}
.mode-banner[data-kind="preview"]{border-left-color:#0f766e}
body.night-mode .mode-banner-metric{background:#1f2937;border-color:#374151;color:#f9fafb!important}
body.night-mode .mode-banner-btn{background:#111827;border-color:#374151;color:#e5e7eb}
body.night-mode .mode-banner-btn.primary{background:#2563eb;border-color:#2563eb;color:#fff}
.leaflet-overlay-pane path.selected-polygon-map-path{filter:drop-shadow(0 0 2px rgba(255,255,255,.95)) drop-shadow(0 0 5px rgba(217,44,50,.55));}
.leaflet-overlay-pane path.picked-polygon-map-path{filter:drop-shadow(0 0 3px rgba(245,158,11,.45));}
body.vertex-editing #editOverlay{cursor:default!important}
body.vertex-editing .vtx{cursor:grab!important}
body.vertex-drag-active .vtx, body.vertex-drag-active #editOverlay{cursor:grabbing!important}
body.edge-drag-active #editOverlay, body.edge-drag-active .edge-drag-handle{cursor:ns-resize!important}
body.vertex-centre-move-active #editOverlay, body.vertex-centre-move-active .polygon-centre-move-handle{cursor:grabbing!important}
body.mode-draw-active #editOverlay, body.mode-draw-active #map{cursor:crosshair!important}
body.mode-draw-freehand #editOverlay{cursor:crosshair!important}
body.mode-geometry-preview .geometry-preview-panel{outline:2px solid rgba(15,118,110,.25)}
body.mode-image-active .trace-image-wrap.selected{outline-width:3px;outline-style:solid;outline-color:rgba(37,99,235,.9)}
body.has-selection:not(.vertex-editing):not(.draw-active) #selectedFloatToolbar{box-shadow:0 8px 28px rgba(217,44,50,.16),var(--shadow)}
@media(max-width:980px){.mode-banner{max-width:calc(100% - 24px);align-items:flex-start}.mode-banner span#modeBannerHint{white-space:normal}.mode-banner-controls{margin-left:auto}.mode-banner-metric{display:none}}



/* v51: reduce toolbar clutter and make active-mode actions reliable */
#modeBanner[data-kind="select"]{display:none!important}
body.mode-has-active-tool #selectedFloatToolbar,
body.draw-active #selectedFloatToolbar,
body.vertex-editing #selectedFloatToolbar,
body.measure-active #selectedFloatToolbar,
body.image-overlay-selected #selectedFloatToolbar,
body.mode-geometry-preview #selectedFloatToolbar{display:none!important}
body.mode-draw-active:not(.mode-draw-has-settings) #drawFloatToolbar{display:none!important}
body.mode-draw-active #drawFloatToolbar #finishDrawBtn,
body.mode-draw-active #drawFloatToolbar #undoDrawBtn,
body.mode-draw-active #drawFloatToolbar #cancelDrawBtn{display:none!important}
body.mode-draw-active.mode-draw-has-settings #drawFloatToolbar{
  margin-top:104px;
  padding:6px 8px;
  gap:8px;
  z-index:1180;
}
body.mode-draw-active.mode-draw-has-settings #drawFloatToolbar .draw-toolbar-label,
body.mode-draw-active.mode-draw-has-settings #drawFloatToolbar .draw-toolbar-chip{display:none!important}
.mode-banner-controls{pointer-events:auto!important}
.mode-banner-controls button{pointer-events:auto!important}
.mode-banner[data-kind="draw"],
.mode-banner[data-kind="hole"],
.mode-banner[data-kind="vertex"],
.mode-banner[data-kind="measure"],
.mode-banner[data-kind="preview"],
.mode-banner[data-kind="image"],
.mode-banner[data-kind="solo"]{
  z-index:1300;
}


/* v52: active mode toolbar placement cleanup
   The active tool/mode banner is an informational status strip only. It lives
   in the top-right of the map lane, below the app topbar, and no longer carries
   Finish/Cancel buttons. Other floating editor toolbars are kept below it. */
#modeBanner.mode-banner{
  grid-area:map!important;
  align-self:start!important;
  justify-self:end!important;
  margin:8px 12px 0 0!important;
  max-width:min(560px,calc(100% - 28px))!important;
  min-width:0!important;
  min-height:32px!important;
  padding:6px 10px!important;
  gap:8px!important;
  border-radius:8px!important;
  pointer-events:none!important;
  z-index:1290!important;
}
#modeBanner .mode-banner-controls,
#modeBannerFinishBtn,
#modeBannerCancelBtn{
  display:none!important;
}
#modeBanner strong{
  flex:0 0 auto!important;
}
#modeBanner span#modeBannerHint{
  flex:1 1 auto!important;
  min-width:0!important;
  max-width:360px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#modeBanner .mode-banner-metric{
  max-width:150px!important;
}
body.mode-draw-active.mode-draw-has-settings #drawFloatToolbar{
  margin-top:50px!important;
  z-index:1180!important;
}
body.vertex-editing #vertexFloatToolbar,
body.measure-active #measureFloatToolbar,
body.image-overlay-selected #imageOverlayToolbar{
  margin-top:50px!important;
  z-index:1180!important;
}
@media(max-width:980px){
  #modeBanner.mode-banner{
    justify-self:stretch!important;
    margin:8px 12px 0 12px!important;
    max-width:none!important;
  }
  #modeBanner span#modeBannerHint{
    max-width:none!important;
  }
  body.mode-draw-active.mode-draw-has-settings #drawFloatToolbar,
  body.vertex-editing #vertexFloatToolbar,
  body.measure-active #measureFloatToolbar,
  body.image-overlay-selected #imageOverlayToolbar{
    margin-top:54px!important;
  }
}



/* v53: structured desktop inspector redesign */
#selectedPanel.v53-inspector-panel{gap:8px}
.v53-inspector-shell{display:flex;flex-direction:column;gap:8px}
.v53-inspector-section{background:#fff;border:1px solid #e2e8f0;border-radius:14px;box-shadow:var(--shadow-sm);overflow:hidden}
.v53-inspector-section summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 11px;font-size:12px;font-weight:800;letter-spacing:-.01em;color:#0f172a;user-select:none}
.v53-inspector-section summary::-webkit-details-marker{display:none}
.v53-inspector-section summary:after{content:'›';font-size:18px;line-height:1;color:#64748b;transform:rotate(90deg);transition:transform .14s ease}
.v53-inspector-section:not([open]) summary:after{transform:rotate(0deg)}
.v53-section-title{display:flex;align-items:center;gap:7px;min-width:0}.v53-section-title b{white-space:nowrap}.v53-section-subtitle{font-size:10px;color:#64748b;font-weight:700;text-transform:uppercase;letter-spacing:.045em;white-space:nowrap}.v53-section-body{padding:0 11px 11px;display:flex;flex-direction:column;gap:9px}.v53-section-note{font-size:11px;color:#64748b;line-height:1.35;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:8px}.v53-control{display:grid;gap:5px}.v53-control label{font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:#64748b;font-weight:800}.v53-control input[type="text"],.v53-control input[type="number"],.v53-control select{width:100%;min-height:30px;border:1px solid #d7dee8;border-radius:9px;background:#fff;color:#0f172a;padding:0 8px;font-size:12px}.v53-control input[type="range"]{width:100%}.v53-two-col{display:grid;grid-template-columns:1fr 1fr;gap:7px}.v53-three-col{display:grid;grid-template-columns:1fr 1fr 1fr;gap:7px}.v53-actions{display:flex;gap:7px;flex-wrap:wrap}.v53-actions button,.v53-action-grid button,.v53-mini-button{background:#f8fafc;border-color:#e2e8f0;min-height:30px}.v53-actions button.primary,.v53-action-grid button.primary{background:var(--blue);border-color:var(--blue);color:#fff}.v53-actions button.danger,.v53-action-grid button.danger{color:#b42318;border-color:#fecaca;background:#fff5f5}.v53-action-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.v53-action-grid button:disabled,.v53-actions button:disabled{opacity:.45;cursor:not-allowed}.v53-kv{display:grid;grid-template-columns:minmax(84px,42%) 1fr;gap:7px 9px;font-size:12px}.v53-kv .k{color:#64748b}.v53-kv .v{min-width:0;overflow:hidden;text-overflow:ellipsis}.v53-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid #e2e8f0;background:#f8fafc;border-radius:10px;padding:8px 9px;font-size:12px}.v53-toggle-row span{color:#475569}.v53-style-row{display:grid;grid-template-columns:1fr 1fr;gap:7px}.v53-style-row input[type="color"]{width:100%;height:32px;padding:2px;border:1px solid #d7dee8;border-radius:9px;background:#fff}.v53-status-pill{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:800}.v53-status-ok{background:#ecfdf5;color:#047857;border:1px solid #bbf7d0}.v53-status-warn{background:#fff7ed;color:#c2410c;border:1px solid #fed7aa}.v53-status-error{background:#fef2f2;color:#b42318;border:1px solid #fecaca}.v53-style-preview{display:flex;align-items:center;gap:8px}.v53-swatch{width:24px;height:24px;border-radius:7px;border:2px solid var(--v53-stroke,#1664d6);background:var(--v53-fill,#1664d6);box-shadow:inset 0 0 0 999px rgba(255,255,255,calc(1 - var(--v53-alpha,.18)))}.v53-history-list{display:flex;flex-direction:column;gap:6px}.v53-history-row{display:grid;grid-template-columns:auto 1fr auto auto auto auto;gap:5px;align-items:center;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:6px}.v53-history-row.disabled{opacity:.55}.v53-history-main{min-width:0}.v53-history-name{font-size:12px;font-weight:800;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.v53-history-meta{font-size:11px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.v53-history-row button{min-height:24px;padding:0 6px;background:#fff;border-color:#e2e8f0}.v53-history-row button.danger{color:#b42318}.v53-export-format{display:grid;grid-template-columns:1fr auto;gap:7px;align-items:center}.v53-export-format select{min-height:30px;border:1px solid #d7dee8;border-radius:9px;background:#fff;padding:0 8px;font-size:12px}.v53-muted-strong{font-size:12px;font-weight:800;color:#334155}.v53-inspector-section .style-chip{font-size:11px}
body.night-mode .v53-inspector-section{background:#111418;border-color:#303744;box-shadow:none}body.night-mode .v53-inspector-section summary{color:#e5e7eb}body.night-mode .v53-section-note,body.night-mode .v53-toggle-row,body.night-mode .v53-history-row{background:#15171b;border-color:#303744;color:#d1d5db}body.night-mode .v53-control input[type="text"],body.night-mode .v53-control input[type="number"],body.night-mode .v53-control select,body.night-mode .v53-export-format select,body.night-mode .v53-style-row input[type="color"]{background:#0f1115;border-color:#303744;color:#e5e7eb}body.night-mode .v53-kv .k,body.night-mode .v53-section-subtitle,body.night-mode .v53-section-note,body.night-mode .v53-history-meta{color:#9ca3af}body.night-mode .v53-actions button,body.night-mode .v53-action-grid button,body.night-mode .v53-history-row button,body.night-mode .v53-mini-button{background:#15171b;border-color:#303744;color:#e5e7eb}body.night-mode .v53-actions button.primary,body.night-mode .v53-action-grid button.primary{background:var(--blue);border-color:var(--blue);color:#fff}body.night-mode .v53-history-name{color:#e5e7eb}

/* ---- v71MovementOptionsCss ---- */
.image-move-behaviour-control{display:inline-flex;align-items:center;gap:4px;font-size:11px;color:#4b5563;border-left:1px solid #d9dde3;padding-left:6px;margin-left:2px}
.image-move-behaviour-control select{height:24px;min-height:24px;border:1px solid #cfd4dc;border-radius:0;background:#fff;color:#1f2328;font-size:11px;padding:0 4px}
.inspector-control select,.v53-control select{border-radius:0!important}

/* ---- v91-reference-overlays-style ---- */
/* v91 Reference Overlay Manager -------------------------------------------------
   Reference overlays are separate from editable project layers. They sit above
   the basemap for tracing/context and expose the same layer-panel style controls
   as image/annotation/measurement layers. */
.reference-overlay-modal{width:min(900px,calc(100vw - 28px));max-height:calc(100vh - 28px);}
.reference-overlay-intro{display:flex;gap:12px;align-items:flex-start;margin-bottom:14px;padding:12px;border:1px solid var(--line);background:#fff;border-radius:10px;}
.reference-overlay-intro .ref-icon{width:34px;height:34px;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;background:#f8fafc;color:#111827;border-radius:9px;flex:0 0 auto;}
.reference-overlay-intro strong{display:block;margin-bottom:3px;font-size:14px;}
.reference-overlay-intro .subtle{line-height:1.35;}
.ref-tabs{display:flex;gap:8px;margin:8px 0 14px;flex-wrap:wrap;}
.ref-tab{height:36px;padding:0 13px;border:1px solid var(--line);background:#fff;color:var(--text);border-radius:8px;font-weight:700;display:inline-flex;align-items:center;gap:7px;}
.ref-tab.active{background:#111827;color:#fff;border-color:#111827;}
.ref-pane{display:none;border:1px solid var(--line);border-radius:10px;background:#fff;padding:14px;}
.ref-pane.active{display:block;}
.ref-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.ref-grid.one{grid-template-columns:1fr;}
.ref-card{border:1px solid var(--line);border-radius:10px;background:#fafafa;padding:12px;}
.ref-card h4{margin:0 0 8px;font-size:13px;}
.ref-control{display:flex;flex-direction:column;gap:5px;margin-bottom:10px;}
.ref-control label{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:800;}
.ref-control input[type=text],.ref-control input[type=number],.ref-control textarea,.ref-control select{width:100%;min-height:34px;}
.ref-control textarea{min-height:96px;resize:vertical;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;line-height:1.35;padding:8px;}
.ref-control input[type=range]{width:100%;}
.ref-inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.ref-inline > *{flex:0 0 auto;}
.ref-inline .ref-flex{flex:1 1 180px;}
.ref-help{font-size:12px;line-height:1.45;color:var(--muted);margin:0 0 10px;}
.ref-status{min-height:18px;font-size:12px;color:var(--muted);margin-top:8px;}
.ref-status.error{color:#b42318;font-weight:700;}
.ref-status.ok{color:#15803d;font-weight:700;}
.reference-layer-card .ref-layer-row{display:flex;align-items:center;gap:8px;padding:8px 9px;border-top:1px solid #f1f5f9;background:#fff;cursor:pointer;}
.reference-layer-card .ref-layer-row:hover{background:#f8fafc;}
.reference-layer-card .ref-layer-row.selected{background:#fff3f4;box-shadow:inset 3px 0 0 var(--accent,#d92c32);}
.reference-layer-card .ref-layer-row.hidden{opacity:.55;}
.reference-layer-card .ref-kind-badge{width:24px;height:24px;border:1px solid #cfd3d8;background:#f8fafc;color:#30363d;display:flex;align-items:center;justify-content:center;border-radius:4px;font-weight:800;font-size:10px;flex:0 0 auto;}
.reference-layer-card .ref-kind-badge.tile{color:#174f9f;background:#eff6ff;border-color:#bfdbfe;}
.reference-layer-card .ref-kind-badge.geojson{color:#15803d;background:#edf7ef;border-color:#bfd8c6;}
.reference-layer-card .ref-kind-badge.geotiff{color:#7b520c;background:#fff8e5;border-color:#d8bd78;}
.reference-layer-card .v91-ref-controls{display:flex;gap:5px;margin-left:auto;align-items:center;}
.reference-layer-card .v91-ref-btn{width:25px;height:25px;border:1px solid #cfd3d8;background:#fff;color:#4b5563;display:inline-flex;align-items:center;justify-content:center;padding:0;border-radius:2px;}
.reference-layer-card .v91-ref-btn.active{border-color:#ef9a9e;color:var(--accent,#d92c32);background:#fff5f5;}
.reference-layer-card .v91-ref-btn.locked{border-color:#cfd3d8;color:#111827;background:#f8fafc;}
.reference-layer-card .v91-ref-btn svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;}
.reference-layer-card .layer-kebab{margin-left:0;}
.ref-layer-menu-note{font-size:11px;color:var(--muted);padding:0 10px 6px;}
.ref-inspector-type{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);font-weight:800;margin-bottom:2px;}
.ref-inspector-bounds{font-size:11px;color:var(--muted);line-height:1.35;word-break:break-word;}
.ref-disabled-note{font-size:11px;color:var(--muted);background:#f8fafc;border:1px solid var(--line);padding:8px;border-radius:6px;margin-top:8px;}
body.night-mode .reference-overlay-intro,
body.night-mode .ref-pane,
body.night-mode .ref-card,
body.night-mode .reference-layer-card .ref-layer-row{background:#15171b!important;border-color:#303744!important;color:#e5e7eb!important;}
body.night-mode .reference-overlay-intro .ref-icon,
body.night-mode .reference-layer-card .ref-kind-badge,
body.night-mode .reference-layer-card .v91-ref-btn{background:#111318!important;border-color:#303744!important;color:#e5e7eb!important;}
body.night-mode .ref-tab{background:#111318!important;border-color:#303744!important;color:#e5e7eb!important;}
body.night-mode .ref-tab.active{background:#e5e7eb!important;color:#111318!important;border-color:#e5e7eb!important;}
body.night-mode .reference-layer-card .ref-layer-row:hover{background:#1f2937!important;}
body.night-mode .reference-layer-card .ref-layer-row.selected{background:#252027!important;box-shadow:inset 3px 0 0 var(--accent,#ff6b72)!important;}
body.night-mode .reference-layer-card .v91-ref-btn.active{background:#3f2529!important;border-color:#8b3d45!important;color:#ff9aa2!important;}
body.night-mode .reference-layer-card .v91-ref-btn.locked{background:#1f2937!important;color:#f9fafb!important;}
body.night-mode .ref-disabled-note{background:#111318!important;border-color:#303744!important;color:#a4acb5!important;}
@media(max-width:760px){.ref-grid{grid-template-columns:1fr}.reference-overlay-modal{width:min(720px,calc(100vw - 14px));}.ref-tabs{gap:6px}.ref-tab{height:34px;padding:0 10px}.reference-layer-card .ref-layer-row{gap:6px;padding:8px 7px}}

/* ---- editPolygonProductionStyle ---- */
/* EditPolygon production shell, SEO information and mobile guidance */
.topbar-brand .title{margin:0;line-height:1.1}
.topbar-brand .topbar-subtitle{max-width:240px;overflow:hidden;text-overflow:ellipsis}
.top-menu-link{display:flex;align-items:center;width:100%;min-height:34px;padding:0 10px;color:inherit;text-decoration:none;box-sizing:border-box;font:inherit}
.top-menu-link:hover{background:#eef0f2;color:#20252b}
.status-info-link{margin-left:auto;min-height:20px;padding:1px 7px;border:1px solid var(--line);background:transparent;color:var(--muted);font:inherit;white-space:nowrap;cursor:pointer}
.status-info-link:hover,.status-info-link:focus-visible{border-color:var(--accent);color:var(--accent);outline:none}
.seo-info-drawer{position:fixed;right:10px;bottom:35px;z-index:3900;font-family:Arial,Helvetica,sans-serif;color:#1f2937}
.seo-info-drawer>summary{display:flex;align-items:center;justify-content:center;min-height:30px;padding:0 10px;border:1px solid #cfd3d8;background:#fff;color:#374151;box-shadow:0 2px 8px rgba(31,35,40,.14);cursor:pointer;font-size:11px;font-weight:700;list-style:none;user-select:none}
.seo-info-drawer>summary::-webkit-details-marker{display:none}
.seo-info-drawer>summary:hover,.seo-info-drawer>summary:focus-visible{border-color:#dc2626;color:#b91c1c;outline:none}
.seo-info-drawer[open]>summary{display:none}
.seo-info-card{width:min(720px,calc(100vw - 24px));max-height:min(78vh,780px);overflow:auto;background:#fff;border:1px solid #cfd3d8;box-shadow:0 12px 36px rgba(15,23,42,.24);padding:22px;box-sizing:border-box}
.seo-info-card:focus{outline:none}
.seo-info-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-bottom:13px;border-bottom:1px solid #e5e7eb}
.seo-info-head h2{margin:2px 0 0;font-size:23px;line-height:1.15;color:#111827}
.seo-eyebrow{margin:0;color:#b91c1c;font-size:11px;font-weight:800;letter-spacing:.09em;text-transform:uppercase}
.seo-info-close{width:32px;height:32px;padding:0;border:1px solid #d1d5db;background:#fff;color:#4b5563;font-size:22px;line-height:1;cursor:pointer}
.seo-info-close:hover,.seo-info-close:focus-visible{border-color:#dc2626;color:#b91c1c;outline:none}
.seo-lead{margin:17px 0;font-size:14px;line-height:1.65;color:#374151}
.seo-info-card section{margin:19px 0;padding-top:2px}
.seo-info-card h3{margin:0 0 8px;font-size:15px;line-height:1.3;color:#111827}
.seo-info-card p,.seo-info-card li{font-size:13px;line-height:1.58;color:#4b5563}
.seo-info-card a{color:#b91c1c;text-decoration:underline;text-underline-offset:2px}
.seo-feature-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 22px;margin:0;padding-left:19px}
.seo-faq{border-top:1px solid #e5e7eb}
.seo-faq:last-of-type{border-bottom:1px solid #e5e7eb}
.seo-faq>summary{padding:10px 2px;cursor:pointer;font-size:13px;font-weight:700;color:#374151}
.seo-faq>p{margin:0 2px 12px}
.seo-info-actions{display:flex;justify-content:flex-end;gap:8px;padding-top:15px;border-top:1px solid #e5e7eb}
.seo-info-actions button,.seo-primary-link{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 13px;border:1px solid #cfd3d8;background:#fff;color:#374151;text-decoration:none!important;font-size:12px;font-weight:700;cursor:pointer;box-sizing:border-box}
.seo-primary-link{border-color:#c81e28;background:#c81e28;color:#fff!important}
.seo-info-actions button:hover{border-color:#9ca3af;background:#f3f4f6}
.mobile-desktop-notice{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(15,23,42,.72);box-sizing:border-box}
.mobile-desktop-notice[hidden]{display:none}
.mobile-desktop-card{width:min(430px,100%);background:#fff;border:1px solid #d1d5db;box-shadow:0 20px 50px rgba(0,0,0,.32);padding:24px;text-align:center;color:#1f2937}
.mobile-desktop-card img{display:block;margin:0 auto 10px;border-radius:14px}
.mobile-desktop-card h2{margin:0 0 9px;font-size:21px}
.mobile-desktop-card p{margin:0;color:#4b5563;font-size:14px;line-height:1.55}
.mobile-desktop-actions{display:flex;flex-direction:column;gap:9px;margin-top:18px}
.mobile-desktop-actions a{color:#b91c1c;font-size:12px}
.no-script-message{position:fixed;inset:0;z-index:2147483647;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px;background:#f4f5f6;color:#1f2937;text-align:center;font-family:Arial,Helvetica,sans-serif}
.no-script-title{margin:0 0 12px;font-size:28px;font-weight:800}
.no-script-message p{max-width:700px;margin:5px auto;line-height:1.55}
body.night-mode .top-menu-link:hover{background:#202632;color:#f3f4f6}
body.night-mode .status-info-link{border-color:#303744;color:#aeb7c4}
body.night-mode .seo-info-drawer{color:#e5e7eb}
body.night-mode .seo-info-drawer>summary,body.night-mode .seo-info-card,body.night-mode .seo-info-close{background:#15181f;color:#e5e7eb;border-color:#303744}
body.night-mode .seo-info-head,body.night-mode .seo-faq,body.night-mode .seo-faq:last-of-type,body.night-mode .seo-info-actions{border-color:#303744}
body.night-mode .seo-info-head h2,body.night-mode .seo-info-card h3{color:#f3f4f6}
body.night-mode .seo-lead,body.night-mode .seo-info-card p,body.night-mode .seo-info-card li,body.night-mode .seo-faq>summary{color:#cbd5e1}
body.night-mode .seo-info-actions button{background:#202632;color:#e5e7eb;border-color:#414a57}
@media(max-width:1180px){.topbar-brand .topbar-subtitle{display:none}.status-info-link{display:none}}
@media(max-width:720px){.seo-info-drawer{right:6px;bottom:34px}.seo-info-card{padding:17px;max-height:82vh}.seo-feature-grid{grid-template-columns:1fr}.seo-info-head h2{font-size:20px}}
@media(prefers-reduced-motion:reduce){.seo-info-card,.mobile-desktop-card{scroll-behavior:auto}}

/* ---- inline-style ---- */
html.v121-app-booting body{visibility:visible!important}html.v121-app-booting::before{display:none!important}

/* ---- v56RectilinearProfessionalUi ---- */
/* v56 rectilinear professional UI pass ---------------------------------------
   Final visual override applied after all feature scripts/styles. This restores
   the dense desktop-editor/GIS look: rectangular controls, low shadow, muted
   states, no pill-heavy SaaS styling. Geometry handles remain circular where
   circularity carries interaction meaning. */
:root{
  --radius:3px!important;
  --radius-sm:2px!important;
  --shadow:none!important;
  --shadow-sm:none!important;
  --ui-radius:2px;
  --ui-border:#d6d9de;
  --ui-border-strong:#bcc3cc;
  --ui-bg:#ffffff;
  --ui-bg-soft:#f3f5f7;
  --ui-bg-active:#e7edf5;
  --ui-text:#1f2328;
  --ui-muted:#606975;
}
html,body{font-family:"Segoe UI",Arial,sans-serif!important;font-size:12px!important;color:var(--ui-text)!important;background:#f1f2f4!important}
.app{background:#f1f2f4!important}
/* Global editor chrome */
.toolbar,.project-toolbar,.compact-topbar{
  background:#fff!important;
  border-bottom:1px solid #cfd3d8!important;
  box-shadow:none!important;
  min-height:46px!important;
  padding:5px 7px!important;
  gap:5px!important;
  backdrop-filter:none!important;
}
.title{font-size:12px!important;font-weight:700!important;letter-spacing:0!important;gap:0!important;padding-right:5px!important}
.title:before{display:none!important;content:none!important}
.topbar-subtitle{font-size:10px!important;color:#6b737c!important}
.group,.topbar-actions,.topbar-search-wrap{
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  padding:0!important;
  gap:3px!important;
  box-shadow:none!important;
}
button,.icon-action,.topbar-more-btn,.fullscreen-editor-btn,.theme-toggle-btn,
select,input[type=text],input[type=search],input[type=number],textarea{
  border-radius:var(--ui-radius)!important;
  box-shadow:none!important;
  transition:none!important;
}
button,.icon-action,.topbar-more-btn,.fullscreen-editor-btn,.theme-toggle-btn{
  min-height:24px!important;
  height:auto!important;
  padding:0 7px!important;
  border:1px solid var(--ui-border)!important;
  background:#fff!important;
  color:#1f2328!important;
  font-weight:500!important;
  transform:none!important;
}
button:hover,.icon-action:hover,.topbar-more-btn:hover,.fullscreen-editor-btn:hover,.theme-toggle-btn:hover{background:#eef1f4!important;border-color:var(--ui-border-strong)!important}
button.primary,.icon-action.primary{background:#1259b2!important;border-color:#0f4f9f!important;color:#fff!important}
button.primary:hover{background:#0f4f9f!important;color:#fff!important}
button.active,.rail-btn.active,.theme-toggle-btn.active,#themeToggleBtn.active{background:#e6edf7!important;border-color:#9eb8d6!important;color:#174f9f!important;box-shadow:inset 2px 0 0 #174f9f!important}
button.danger{background:#fff!important;border-color:#ddb5b5!important;color:#b42318!important}
button.danger:hover{background:#f7eaea!important;color:#941b12!important}
select,input[type=text],input[type=search],input[type=number],textarea{
  height:24px!important;
  border:1px solid var(--ui-border)!important;
  background:#fff!important;
  padding:0 6px!important;
  color:#1f2328!important;
}
.location-search-box{height:24px!important;width:260px!important}
/* Panels and section chrome */
.sidebar,.selected-section,.inspector-panel{background:#f4f5f6!important;box-shadow:none!important}
.sidebar{border-right:1px solid #cfd3d8!important}.selected-section,.inspector-panel{border-left:1px solid #cfd3d8!important;padding:8px!important}
.sidebar-section{padding:8px!important;border-bottom:1px solid #d8dbe0!important}
.section-title{font-size:10px!important;letter-spacing:.06em!important;color:#59626e!important;margin-bottom:6px!important}
.section-title span:first-child:before{display:none!important;content:none!important}
.dropzone,.notice,.file-card,.inspector-card,.edit-stack,.selected-panel-card,.empty-inspector,
.converter-panel,.validator-panel,.converter-dropzone,.validator-dropzone{
  border-radius:2px!important;
  box-shadow:none!important;
  background:#fff!important;
  border:1px solid var(--ui-border)!important;
}
.dropzone{border-style:dashed!important;padding:8px!important}.notice{padding:6px!important;color:#5f6873!important}
/* Tool rail and flyouts */
.tool-rail{background:#f8f9fa!important;color:#30363d!important;border-right:1px solid #cfd3d8!important;box-shadow:none!important;gap:4px!important;padding:6px 5px!important}
.tool-rail .rail-logo{display:none!important}.rail-btn{width:42px!important;height:40px!important;min-height:40px!important;border-radius:2px!important;color:#30363d!important;background:transparent!important;border:1px solid transparent!important}
.rail-btn:hover{background:#eef1f4!important;color:#111827!important;border-color:#d6d9de!important}.rail-btn.active{background:#e6edf7!important;color:#174f9f!important;border-color:#9eb8d6!important;box-shadow:inset 3px 0 0 #174f9f!important}.rail-btn .lbl{font-size:9px!important;font-weight:500!important}.rail-tip{color:#6b737c!important}
.rail-flyout,.top-more-menu,.layer-menu,.pick-menu,.command-palette,.modal{
  border-radius:2px!important;
  box-shadow:0 2px 8px rgba(31,35,40,.16)!important;
  border:1px solid var(--ui-border)!important;
  background:#fff!important;
  backdrop-filter:none!important;
}
.rail-flyout button,.top-more-menu button,.layer-menu button,.pick-item,.command-item{border-radius:2px!important;background:#fff!important}
.rail-flyout button:hover,.top-more-menu button:hover,.layer-menu button:hover,.pick-item:hover,.command-item:hover,.command-item.active{background:#eef1f4!important}
.flyout-icon,.command-icon{border-radius:2px!important;background:#eef1f4!important;border:1px solid #cfd3d8!important;color:#30363d!important}
/* Layers panel: keep names readable; actions compact and rectangular */
.v54-layer-tools{
  border:1px solid var(--ui-border)!important;
  border-radius:2px!important;
  background:#fff!important;
  margin:6px 0 8px!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
.v54-layer-search-row{padding:6px!important;background:#fff!important;border-bottom:1px solid #e3e5e8!important;gap:4px!important}
.v54-layer-search-row input{height:24px!important;border-radius:2px!important;border-color:var(--ui-border)!important;background:#fff!important;padding:0 6px!important}
.v54-layer-search-row button{min-width:24px!important;width:24px!important;height:24px!important;min-height:24px!important;border-radius:2px!important;padding:0!important}
.v54-filter-row{padding:5px 6px!important;gap:3px!important;background:#fff!important;border-bottom:1px solid #e3e5e8!important}
.v54-filter-row button{
  min-height:22px!important;
  height:22px!important;
  border-radius:2px!important;
  padding:0 6px!important;
  font-size:10px!important;
  background:#fff!important;
  border-color:#d7dbe0!important;
  color:#3f4750!important;
  font-weight:500!important;
}
.v54-filter-row button.active{background:#e6edf7!important;border-color:#9eb8d6!important;color:#174f9f!important;font-weight:700!important;box-shadow:inset 0 -2px 0 #174f9f!important}
.v54-layer-results{font-size:10px!important;color:#69727d!important;padding:0 6px 6px!important}
.file-card,.v54-file-card{border-radius:2px!important;margin-bottom:5px!important;border:1px solid var(--ui-border)!important;box-shadow:none!important;background:#fff!important}
.file-head,.v54-file-head{padding:5px 6px!important;background:#fff!important;border-bottom:1px solid #e3e5e8!important;gap:5px!important;min-height:28px!important}
.feature-row,.image-overlay-row,.measure-layer-row,.v54-feature-row{padding:5px 6px!important;gap:5px!important;min-height:28px!important;background:#fff!important;border-top:1px solid #e7e9ec!important;align-items:center!important}
.feature-row:hover,.image-overlay-row:hover,.measure-layer-row:hover,.v54-feature-row:hover{background:#f0f2f4!important}
.feature-row.selected,.image-overlay-row.selected,.measure-layer-row.selected,.v54-feature-row.selected{background:#e7edf5!important;box-shadow:inset 3px 0 0 #d92c32!important;outline:0!important}
.feature-row.picked,.v54-feature-row.picked{background:#fbf4e4!important;box-shadow:inset 3px 0 0 #9c6a14!important}
.file-main,.feature-main{min-width:0!important;flex:1 1 auto!important}.file-name,.feature-name{font-size:12px!important;font-weight:700!important;color:#1f2328!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;line-height:1.15!important}.file-meta,.feature-meta{font-size:10px!important;color:#606975!important;margin-top:1px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;display:block!important}.file-actions,.feature-actions,.v54-layer-quick{flex:0 0 auto!important;gap:2px!important;margin-left:2px!important;display:flex!important;flex-wrap:nowrap!important}.v54-layer-quick.file{margin-left:auto!important}.v54-icon-btn,.layer-kebab,.collapse-btn,.icon-btn,.layer-mini{
  min-width:22px!important;
  width:22px!important;
  height:22px!important;
  min-height:22px!important;
  padding:0!important;
  border-radius:2px!important;
  background:#fff!important;
  border:1px solid #d7dbe0!important;
  color:#2f3740!important;
  font-size:10px!important;
  font-weight:700!important;
  line-height:1!important;
  box-shadow:none!important;
}
.v54-icon-btn:hover,.layer-kebab:hover,.collapse-btn:hover,.icon-btn:hover,.layer-mini:hover{background:#eef1f4!important;border-color:#bfc6cf!important}.v54-icon-btn.active{background:#fff!important;border-color:#9eb8d6!important;color:#174f9f!important;box-shadow:inset 0 -2px 0 #174f9f!important}.v54-icon-btn.warn{background:#fff!important;border-color:#c6a261!important;color:#7b520c!important;box-shadow:inset 0 -2px 0 #9c6a14!important}.v54-icon-btn.danger{background:#fff!important;border-color:#d7a8a8!important;color:#9a1c12!important}.v54-icon-btn.off{opacity:.55!important;background:#fafafa!important;color:#6b737c!important}.v54-geom-badge,.sleeping-badge,.status-pill,.kbd,.v53-status-pill,.converter-badge,.validator-badge,.validator-chip{
  border-radius:2px!important;
  padding:1px 4px!important;
  font-size:10px!important;
  font-weight:700!important;
  letter-spacing:.02em!important;
  background:#eef1f4!important;
  color:#30363d!important;
  border:1px solid #cfd3d8!important;
}
.v54-geom-badge.poly,.v54-geom-badge.multi,.v54-geom-badge.line,.v54-geom-badge.point{background:#eef1f4!important;color:#174f9f!important;border-color:#cbd8e8!important}.v54-geom-badge.invalid{background:#f7eaea!important;color:#b42318!important;border-color:#ddb5b5!important}.v54-bulk-bar,.v54-picked-solo-banner,.solo-banner{border-radius:2px!important;box-shadow:none!important;background:#fff8e5!important;border:1px solid #d8bd78!important;padding:6px!important;color:#704a06!important}
/* Inspector: remove card-pill feel */
#selectedPanel.v53-inspector-panel,.v53-inspector-shell{gap:5px!important}.v53-inspector-section{
  border-radius:2px!important;
  box-shadow:none!important;
  border:1px solid var(--ui-border)!important;
  background:#fff!important;
  overflow:hidden!important;
}
.v53-inspector-section summary{padding:7px 9px!important;min-height:28px!important;font-size:12px!important;font-weight:700!important;color:#1f2328!important;background:#fff!important;border-bottom:0!important}.v53-inspector-section[open] summary{border-bottom:1px solid #e3e5e8!important}.v53-inspector-section summary:after{font-size:14px!important;color:#59626e!important}.v53-section-subtitle{font-size:9px!important;color:#59626e!important;letter-spacing:.045em!important}.v53-section-body{padding:7px 9px 9px!important;gap:7px!important}.v53-section-note,.v53-toggle-row,.v53-history-row,.geometry-preview-summary,.geometry-preview-warning,.geom-op-summary,.geom-op-warning{
  border-radius:2px!important;
  background:#f5f6f7!important;
  border:1px solid #dcdfe4!important;
  box-shadow:none!important;
}
.v53-control input[type="text"],.v53-control input[type="number"],.v53-control select,.v53-export-format select,.v53-style-row input[type="color"]{border-radius:2px!important;height:24px!important;min-height:24px!important}.v53-actions button,.v53-action-grid button,.v53-mini-button,.v53-history-row button{border-radius:2px!important;background:#fff!important;border-color:var(--ui-border)!important}.v53-actions button:hover,.v53-action-grid button:hover,.v53-mini-button:hover,.v53-history-row button:hover{background:#eef1f4!important}.v53-action-grid{gap:5px!important}.v53-actions{gap:5px!important}.v53-style-preview{gap:6px!important}.v53-swatch,.style-chip:before{border-radius:2px!important}.v53-history-row{padding:5px!important;gap:4px!important}.v53-kv{gap:5px 7px!important}.v53-kv .k{color:#606975!important}.v53-muted-strong{color:#30363d!important}
/* Mode banner and floating bars */
#modeBanner.mode-banner,.mode-banner{
  border-radius:2px!important;
  box-shadow:0 2px 6px rgba(31,35,40,.15)!important;
  border:1px solid var(--ui-border-strong)!important;
  border-left:3px solid #174f9f!important;
  background:#fff!important;
  padding:5px 8px!important;
  min-height:28px!important;
  font-size:11px!important;
  gap:6px!important;
  backdrop-filter:none!important;
}
.mode-banner strong{font-size:11px!important;font-weight:700!important;color:#1f2328!important}.mode-banner span{color:#4f5965!important}.mode-banner-metric{border-radius:2px!important;background:#f5f6f7!important;border-color:#dcdfe4!important;padding:1px 5px!important;font-size:10px!important}.float-toolbar,.selected-float-toolbar,.measure-style-panel,.geometry-preview-panel,.measure-toolbar,.image-overlay-toolbar{
  border-radius:2px!important;
  box-shadow:0 2px 7px rgba(31,35,40,.16)!important;
  border:1px solid var(--ui-border-strong)!important;
  background:#fff!important;
  padding:4px!important;
  gap:3px!important;
  backdrop-filter:none!important;
}
.float-toolbar button,.selected-float-toolbar button,.measure-toolbar button,.image-overlay-toolbar button{min-height:24px!important;border-radius:2px!important;padding:0 6px!important}.draw-toolbar-chip,.draw-hint,.draw-shape-guide,.measure-label,.trace-image-label,.trace-perspective-note,.mini-help{border-radius:2px!important;box-shadow:0 1px 3px rgba(31,35,40,.18)!important}
/* Map display */
.map-display-control{border-radius:2px!important;box-shadow:none!important;border:1px solid var(--ui-border)!important;background:#fff!important;padding:4px!important}
/* Keep actual editing affordances circular where required */
.vtx,.mid,.draw-dot,.snap-indicator,.measure-point-marker,.trace-image-handle,.polygon-centre-move-handle,.hole-centre-handle{border-radius:50%!important}
/* Night mode equivalent */
body.night-mode{--ui-bg:#15171b;--ui-bg-soft:#1d2026;--ui-bg-active:#252027;--ui-text:#e5e7eb;--ui-muted:#a4acb5;--ui-border:#303744;--ui-border-strong:#414a57;background:#111318!important;color:#e5e7eb!important}
body.night-mode .toolbar,body.night-mode .sidebar,body.night-mode .selected-section,body.night-mode .inspector-panel,body.night-mode .v53-inspector-section,body.night-mode .file-card,body.night-mode .v54-layer-tools,body.night-mode #modeBanner.mode-banner,body.night-mode .float-toolbar{background:#15171b!important;border-color:#303744!important;color:#e5e7eb!important}
body.night-mode .feature-row,body.night-mode .file-head,body.night-mode .v54-layer-search-row,body.night-mode .v54-filter-row,body.night-mode .v53-inspector-section summary{background:#15171b!important;border-color:#303744!important;color:#e5e7eb!important}
body.night-mode button,body.night-mode select,body.night-mode input[type=text],body.night-mode input[type=search],body.night-mode input[type=number],body.night-mode textarea{background:#111318!important;border-color:#303744!important;color:#e5e7eb!important}
body.night-mode button:hover{background:#20242b!important;border-color:#414a57!important}.night-mode .feature-name,.night-mode .file-name,.night-mode .mode-banner strong{color:#e5e7eb!important}.night-mode .feature-meta,.night-mode .file-meta,.night-mode .v53-section-subtitle,.night-mode .v53-kv .k,.night-mode .mode-banner span{color:#a4acb5!important}

/* ---- v57RedAccentProfessionalCleanup ---- */
/* v57 professional cleanup ---------------------------------------------------
   Remove residual pill/card styling from new UI work and restore the earlier
   white desktop-editor surface with restrained favicon-red accents. */
:root{
  --accent:#d92c32!important;
  --accentSoft:#f8e8ea!important;
  --accentSoft2:#f5eeee!important;
  --accentBorder:#d9a3a8!important;
  --ui-radius:0px!important;
  --radius:0px!important;
  --radius-sm:0px!important;
}
/* Remove pill/rounded treatment globally from UI chrome, while leaving map/edit handles alone. */
button,.icon-action,.topbar-more-btn,.fullscreen-editor-btn,.theme-toggle-btn,
select,input[type=text],input[type=search],input[type=number],textarea,
.dropzone,.notice,.file-card,.file-head,.feature-row,.v54-layer-tools,
.v54-layer-search-row,.v54-filter-row,.v54-filter-row button,.v54-icon-btn,
.layer-kebab,.collapse-btn,.icon-btn,.layer-mini,.v53-inspector-section,
.v53-inspector-section summary,.v53-section-note,.v53-toggle-row,.v53-history-row,
.v53-status-pill,.v54-geom-badge,.sleeping-badge,.status-pill,.kbd,
.float-toolbar,.selected-float-toolbar,.measure-style-panel,.geometry-preview-panel,
.measure-toolbar,.image-overlay-toolbar,#modeBanner.mode-banner,.mode-banner,
.top-more-menu,.rail-flyout,.layer-menu,.pick-menu,.command-palette,.modal,
.converter-panel,.validator-panel,.converter-dropzone,.validator-dropzone,
.converter-badge,.validator-badge,.validator-chip,.v54-bulk-bar,.v54-picked-solo-banner,.solo-banner,
.hole-manager-row,.step2-inspector-grid button,.style-chip:before{
  border-radius:0!important;
}
/* Restore red as the app accent: active states, selected feature bars, mode banner. */
button.active,.rail-btn.active,.theme-toggle-btn.active,#themeToggleBtn.active,
.v54-filter-row button.active,.v54-icon-btn.active{
  background:var(--accentSoft2)!important;
  border-color:var(--accentBorder)!important;
  color:#9e2027!important;
  box-shadow:inset 3px 0 0 var(--accent)!important;
}
.v54-filter-row button.active,.v54-icon-btn.active{box-shadow:inset 0 -2px 0 var(--accent)!important}
.rail-btn.active{box-shadow:inset 3px 0 0 var(--accent)!important}
.feature-row.selected,.image-overlay-row.selected,.measure-layer-row.selected,.v54-feature-row.selected{
  background:#f7f0f1!important;
  box-shadow:inset 3px 0 0 var(--accent)!important;
}
#modeBanner.mode-banner,.mode-banner{
  border-left-color:var(--accent)!important;
}
/* Keep primary action buttons professional; use dark-neutral, not saturated blue. */
button.primary,.icon-action.primary{
  background:#26303b!important;
  border-color:#1f2731!important;
  color:#fff!important;
}
button.primary:hover,.icon-action.primary:hover{background:#1f2731!important;color:#fff!important}
/* Left rail: white/grey base with red active hint. */
.tool-rail{background:#f7f8f9!important;border-right:1px solid #cfd3d8!important;color:#252a31!important}
.rail-btn{color:#252a31!important;background:transparent!important;border-color:transparent!important}
.rail-btn:hover{background:#eef0f2!important;border-color:#d2d6dc!important;color:#111827!important}
.rail-btn.active{background:var(--accentSoft2)!important;color:#9e2027!important;border-color:var(--accentBorder)!important}
/* Flyout/menu rows: remove boxed-per-item styling. These should read like desktop menus, not cards. */
.rail-flyout{
  width:248px!important;
  padding:5px 0!important;
  background:#fff!important;
  border:1px solid #cfd3d8!important;
  box-shadow:0 2px 8px rgba(31,35,40,.16)!important;
}
.rail-flyout-title{
  margin:0 0 3px!important;
  padding:7px 10px 6px!important;
  border-bottom:1px solid #dfe2e6!important;
  font-size:10px!important;
  color:#59626e!important;
  letter-spacing:.07em!important;
}
.rail-flyout button,
.top-more-menu button,
.layer-menu button,
.pick-item,
.command-item{
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  background:transparent!important;
  border-radius:0!important;
}
.rail-flyout button{
  min-height:43px!important;
  padding:6px 10px!important;
  gap:8px!important;
}
.rail-flyout button:hover,.top-more-menu button:hover,.layer-menu button:hover,.pick-item:hover,.command-item:hover,.command-item.active{
  background:#eef0f2!important;
  color:#20252b!important;
}
.rail-flyout button strong{font-size:12px!important;font-weight:700!important;color:#20252b!important;line-height:1.1!important}
.rail-flyout button small{font-size:11px!important;color:#66707b!important;line-height:1.22!important;margin-top:2px!important}
.flyout-icon,.command-icon{
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  background:#f2f3f5!important;
  border:1px solid #cdd2d8!important;
  color:#30363d!important;
}
/* Reduce noisy borders inside layer panel. Only containers and selected states should carry strong lines. */
.v54-layer-tools{border-color:#cfd3d8!important;background:#fff!important;overflow:hidden!important}
.v54-layer-search-row{border-bottom:1px solid #e0e3e7!important;background:#fff!important}
.v54-filter-row{border-bottom:1px solid #e0e3e7!important;background:#fff!important}
.v54-filter-row button{
  border:1px solid transparent!important;
  background:transparent!important;
  color:#3f4750!important;
  padding:0 5px!important;
}
.v54-filter-row button:hover{border-color:#d2d6dc!important;background:#f2f3f5!important}
.v54-filter-row button.active{border-color:var(--accentBorder)!important;background:var(--accentSoft2)!important;color:#9e2027!important}
.file-card,.v54-file-card{border-color:#cfd3d8!important}
.file-head,.v54-file-head{background:#fafafa!important;border-bottom:1px solid #e0e3e7!important}
.feature-row,.image-overlay-row,.measure-layer-row,.v54-feature-row{border-top:1px solid #e7e9ec!important;background:#fff!important}
.feature-row:hover,.image-overlay-row:hover,.measure-layer-row:hover,.v54-feature-row:hover{background:#f2f3f5!important}
.v54-icon-btn,.layer-kebab,.collapse-btn,.icon-btn,.layer-mini{
  background:#fff!important;
  border-color:#d3d7dd!important;
  color:#30363d!important;
}
.v54-icon-btn.active{background:#fff!important;color:#9e2027!important;border-color:var(--accentBorder)!important}
.v54-icon-btn.off{opacity:.55!important;background:#f8f8f8!important;color:#6a737d!important}
.v54-icon-btn.danger{color:#9a1c12!important;border-color:#d7aaa6!important;background:#fff!important}
.v54-geom-badge,.sleeping-badge,.status-pill,.kbd{
  background:#f1f2f4!important;
  color:#30363d!important;
  border-color:#d2d6dc!important;
}
.v54-geom-badge.poly,.v54-geom-badge.multi,.v54-geom-badge.line,.v54-geom-badge.point{
  background:#f1f2f4!important;
  color:#30363d!important;
  border-color:#d2d6dc!important;
}
.v54-geom-badge.invalid{background:#f7eaea!important;color:#b42318!important;border-color:#ddb5b5!important}
/* Inspector accordion: rectangular list panels, minimal card feel. */
.v53-inspector-section{
  border:1px solid #cfd3d8!important;
  background:#fff!important;
  margin-bottom:5px!important;
  box-shadow:none!important;
}
.v53-inspector-section summary{
  background:#fff!important;
  padding:7px 9px!important;
}
.v53-inspector-section[open] summary{background:#fafafa!important;border-bottom:1px solid #e0e3e7!important}
.v53-section-subtitle{color:#59626e!important}
.v53-status-pill,.converter-badge,.validator-badge,.validator-chip{
  background:#f1f2f4!important;
  color:#30363d!important;
  border-color:#d2d6dc!important;
}
.v53-status-ok{background:#edf7ef!important;color:#15803d!important;border-color:#bfd8c6!important}
.v53-status-warn{background:#fff8e5!important;color:#7b520c!important;border-color:#d8bd78!important}
.v53-status-error{background:#f7eaea!important;color:#b42318!important;border-color:#ddb5b5!important}
/* Top More menu also as a plain menu, not button cards. */
.top-more-menu,.layer-menu,.pick-menu,.command-palette{
  padding:5px 0!important;
}
.top-menu-section-title,.v54-menu-group-title{
  border-top:1px solid #e0e3e7!important;
  margin:7px 0 3px!important;
  padding:7px 10px 0!important;
}
.top-menu-section-title:first-child,.v54-menu-group:first-child .v54-menu-group-title{border-top:0!important;margin-top:0!important}
.top-more-menu button,.layer-menu button{padding-left:10px!important;padding-right:10px!important}
/* Mode banner: compact and squared with red accent only. */
#modeBanner.mode-banner,.mode-banner{
  background:#fff!important;
  border:1px solid #cfd3d8!important;
  border-left:3px solid var(--accent)!important;
  box-shadow:0 1px 4px rgba(31,35,40,.14)!important;
}
/* Preserve functional circular editing handles only. */
.vtx,.mid,.draw-dot,.snap-indicator,.measure-point-marker,.trace-image-handle,.polygon-centre-move-handle,.hole-centre-handle{border-radius:50%!important}
/* Night mode mirrors the squared/red-accent scheme. */
body.night-mode button.active,body.night-mode .rail-btn.active,body.night-mode #themeToggleBtn.active,body.night-mode .v54-filter-row button.active,body.night-mode .v54-icon-btn.active{
  background:#2f2226!important;
  border-color:#6a3b42!important;
  color:#ff6b72!important;
  box-shadow:inset 3px 0 0 #ff6b72!important;
}
body.night-mode .feature-row.selected,body.night-mode .v54-feature-row.selected{background:#252027!important;box-shadow:inset 3px 0 0 #ff6b72!important}
body.night-mode #modeBanner.mode-banner,body.night-mode .mode-banner{border-left-color:#ff6b72!important}

/* ---- v58StandardPreviewWorkflow ---- */
/* v58 standard geometry preview workflow: compact desktop/GIS styling. */
.geometry-preview-panel{width:390px!important;border-radius:2px!important;box-shadow:0 2px 10px rgba(31,35,40,.18)!important;border-color:#c9ced6!important}
.geometry-preview-summary{background:#fff7f7!important;border-color:#d9b4b8!important;color:#7f1d1d!important;border-radius:2px!important}
.geometry-preview-stats{margin-top:7px;border:1px solid #d6d9de;background:#fff}
.step4-preview-grid{display:grid;grid-template-columns:92px 1fr 1fr;font-size:11px;line-height:1.25}
.step4-preview-grid>div{padding:5px 6px;border-top:1px solid #eceef1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.step4-preview-grid>div:nth-child(-n+3){border-top:0;background:#f3f4f6;color:#475569;font-weight:700;text-transform:uppercase;letter-spacing:.035em;font-size:10px}
.step4-preview-grid>div:nth-child(3n+1){color:#606975;background:#fafafa;font-weight:700}
.step4-muted{color:#6b7280;font-size:10px;margin-left:3px}
.step4-valid{display:inline-flex;border:1px solid #d6d9de;background:#f7f7f7;color:#30363d;padding:1px 4px;border-radius:2px;font-weight:700;font-size:10px}
.step4-valid.ok{background:#edf7ef;color:#15803d;border-color:#bfd8c6}.step4-valid.warn{background:#fff8e5;color:#7b520c;border-color:#d8bd78}
.geometry-preview-impact{display:flex;flex-direction:column;gap:4px;margin-top:6px}.step4-impact{border-left:3px solid #9ca3af;background:#f7f7f7;border-top:1px solid #e1e4e8;border-right:1px solid #e1e4e8;border-bottom:1px solid #e1e4e8;padding:5px 7px;font-size:11px;color:#30363d}.step4-impact.warn{border-left-color:#b42318;background:#fff7f7}.step4-impact.info{border-left-color:#9e2027;background:#fffafa}
.step4-no-result{padding:7px;font-size:11px;color:#606975;background:#fafafa;border-left:3px solid #9e2027}
.geometry-preview-actions{border-top:1px solid #e1e4e8;padding-top:7px}.geometry-preview-actions .primary{background:#9e2027!important;border-color:#8d1d23!important;color:#fff!important}
body.night-mode .geometry-preview-stats{background:#161b22;border-color:#3a3f46}.night-mode .step4-preview-grid>div{border-color:#30363d}.night-mode .step4-preview-grid>div:nth-child(-n+3),body.night-mode .step4-preview-grid>div:nth-child(3n+1){background:#1f242b;color:#c7ced8}.night-mode .step4-impact{background:#1f242b;border-color:#30363d;color:#c7ced8}.night-mode .step4-impact.warn,.night-mode .step4-impact.info{background:#2b2022}

/* ---- v61LayerIconControls ---- */
/* v61 layer list icon controls ----------------------------------------------
   Replace text badges / letter controls with restrained monochrome SVG icons.
   Keeps the rectilinear professional UI and red accent, without emoji or SaaS pills. */
:root{
  --layer-icon-line:#30363d;
  --layer-icon-muted:#6b737c;
  --layer-icon-bg:#f4f5f6;
  --layer-icon-red:#9e2027;
  --layer-icon-red-soft:#fff4f4;
}
.feature-row .feature-main:before,
.image-overlay-row .feature-main:before{content:none!important;display:none!important}
.v54-badge-slot{width:24px!important;min-width:24px!important;display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important}
.v54-geom-badge,
.v61-object-icon{
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  padding:0!important;
  border:1px solid #cfd3d8!important;
  border-radius:2px!important;
  background:#f4f5f6!important;
  color:var(--layer-icon-line)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  line-height:1!important;
}
.v54-geom-badge span{display:none!important}
.v61-icon{width:14px;height:14px;display:block;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:square;stroke-linejoin:miter;vector-effect:non-scaling-stroke}
.v61-icon .fill{fill:currentColor;stroke:none}
.v61-object-icon.text{font-weight:800;font-size:13px;font-family:"Segoe UI",Arial,sans-serif;color:#30363d!important}
.v61-object-icon.file{background:#eef0f3!important}
.v54-geom-badge.invalid,.v61-object-icon.invalid{background:#f7eaea!important;color:#b42318!important;border-color:#ddb5b5!important}
.v61-object-icon.image{background:#f4f5f6!important;color:#30363d!important}
.v61-object-icon.measure{background:#f4f5f6!important;color:#30363d!important}
.v54-layer-quick{gap:3px!important}
.v61-layer-btn,
.v54-icon-btn.v61-layer-btn{
  width:22px!important;
  min-width:22px!important;
  height:22px!important;
  min-height:22px!important;
  padding:0!important;
  border:1px solid #d3d7dd!important;
  border-radius:2px!important;
  background:#fff!important;
  color:#30363d!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  font-size:0!important;
}
.v61-layer-btn:hover{background:#eef0f2!important;border-color:#bdc3cc!important;color:#20252b!important}
.v61-layer-btn svg{width:13px;height:13px;display:block;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:square;stroke-linejoin:miter;vector-effect:non-scaling-stroke}
.v61-layer-btn.v61-off{color:#7a828c!important;background:#f8f8f8!important;opacity:.72!important}
.v61-layer-btn.v61-off svg .slash{display:block!important}
.v61-layer-btn.v61-picked,
.v61-layer-btn.v61-locked{
  color:var(--layer-icon-red)!important;
  border-color:#d7aaa6!important;
  background:#fffafa!important;
}
.v61-layer-btn.v61-picked{box-shadow:inset 0 -2px 0 var(--layer-icon-red)!important}
.v61-layer-btn .v61-check-fill{display:none;fill:var(--layer-icon-red);stroke:none}
.v61-layer-btn.v61-picked .v61-check-fill{display:block}
.v61-layer-btn.v61-picked .v61-check-mark{stroke:#fff!important;stroke-width:2!important}
.v61-layer-btn.v61-picked .v61-check-box{stroke:var(--layer-icon-red)!important}
.v61-layer-btn.v61-unlocked svg .shackle-open{display:block!important}
.v61-layer-btn.v61-locked svg .shackle-open{display:none!important}
.v61-layer-btn.v61-locked svg .shackle-closed{display:block!important}
.v61-layer-btn.v61-unlocked svg .shackle-closed{display:none!important}
.v61-layer-btn .slash{display:none}
.layer-kebab{font-size:15px!important;line-height:1!important}
.file-color{border-radius:2px!important}
.feature-row.selected .v54-geom-badge,.v54-feature-row.selected .v54-geom-badge{border-color:#c9b2b5!important;background:#fff!important;color:#9e2027!important}
.feature-row.picked .v54-geom-badge,.v54-feature-row.picked .v54-geom-badge{border-color:#d7aaa6!important;background:#fffafa!important;color:#9e2027!important}
body.night-mode .v54-geom-badge,
body.night-mode .v61-object-icon,
body.night-mode .v61-layer-btn,
body.night-mode .v54-icon-btn.v61-layer-btn{
  background:#1b2028!important;
  border-color:#3a3f46!important;
  color:#d7dce3!important;
}
body.night-mode .v61-layer-btn.v61-picked,
body.night-mode .v61-layer-btn.v61-locked{
  color:#ff6b72!important;
  border-color:#6a3b42!important;
  background:#2b2022!important;
}
body.night-mode .feature-row.selected .v54-geom-badge,
body.night-mode .v54-feature-row.selected .v54-geom-badge{
  border-color:#6a3b42!important;
  color:#ff6b72!important;
  background:#2b2022!important;
}

/* ---- v62LayerIconRenderFix ---- */
/* v62: DOM-independent icon render fix for the layer list.
   The previous pass left fallback text visible because the layer panel is rendered from
   an internal closure. This pass targets the actual DOM/classes and forces icon-only
   controls without relying on internal render hooks. */
.v54-geom-badge{
  width:22px!important;height:22px!important;min-width:22px!important;padding:0!important;
  border-radius:2px!important;border:1px solid #cfd3d8!important;background:#f4f5f6!important;
  color:#2f363d!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
  font-size:0!important;line-height:1!important;letter-spacing:0!important;overflow:hidden!important;
}
.v54-geom-badge svg{width:14px!important;height:14px!important;display:block!important;fill:none!important;stroke:currentColor!important;stroke-width:1.65!important;stroke-linecap:square!important;stroke-linejoin:miter!important;vector-effect:non-scaling-stroke!important}
.v54-geom-badge .fill{fill:currentColor!important;stroke:none!important}
.v54-geom-badge.poly{background:#f4f5f6!important;border-color:#cfd3d8!important;color:#2f363d!important}
.v54-geom-badge.multi{background:#f4f5f6!important;border-color:#cfd3d8!important;color:#2f363d!important}
.v54-geom-badge.line,.v54-geom-badge.point{background:#f4f5f6!important;border-color:#cfd3d8!important;color:#2f363d!important}
.v54-geom-badge.invalid{background:#f8eeee!important;border-color:#d7aaa6!important;color:#9e2027!important}
.v54-icon-btn.v55-pick,
.v54-icon-btn.v55-vis,
.v54-icon-btn.v55-lock,
.v54-icon-btn.v61-layer-btn{
  width:23px!important;min-width:23px!important;height:23px!important;min-height:23px!important;padding:0!important;
  border-radius:2px!important;border:1px solid #d3d7dd!important;background:#fff!important;color:#2f363d!important;
  font-size:0!important;line-height:1!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
  box-shadow:none!important;overflow:hidden!important;
}
.v54-icon-btn.v55-pick:hover,.v54-icon-btn.v55-vis:hover,.v54-icon-btn.v55-lock:hover{background:#eef0f2!important;border-color:#bdc3cc!important}
.v54-icon-btn.v55-pick svg,.v54-icon-btn.v55-vis svg,.v54-icon-btn.v55-lock svg,.v54-icon-btn.v61-layer-btn svg{
  width:14px!important;height:14px!important;display:block!important;fill:none!important;stroke:currentColor!important;
  stroke-width:1.65!important;stroke-linecap:square!important;stroke-linejoin:miter!important;vector-effect:non-scaling-stroke!important;
}
.v54-icon-btn.v55-pick.warn,.v54-icon-btn.v55-pick.v62-picked,
.v54-icon-btn.v55-vis.active,.v54-icon-btn.v55-lock.danger,
.v54-icon-btn.v61-layer-btn.v61-picked,.v54-icon-btn.v61-layer-btn.v61-locked{
  color:#9e2027!important;border-color:#d7aaa6!important;background:#fffafa!important;
}
.v54-icon-btn.v55-vis.off,.v54-icon-btn.v62-off{color:#747c85!important;background:#f8f8f8!important;opacity:.78!important}
.v54-icon-btn.v55-pick.warn,.v54-icon-btn.v55-pick.v62-picked{box-shadow:inset 0 -2px 0 #9e2027!important}
.v54-icon-btn .v62-fill{fill:currentColor!important;stroke:none!important}
.v54-icon-btn .v62-hidden{display:none!important}
.v54-icon-btn.v55-pick.warn .v62-unpicked,.v54-icon-btn.v55-pick.v62-picked .v62-unpicked{display:none!important}
.v54-icon-btn.v55-pick.warn .v62-picked-mark,.v54-icon-btn.v55-pick.v62-picked .v62-picked-mark{display:block!important}
.v54-icon-btn.v55-pick .v62-picked-mark{display:none!important}
.v54-icon-btn.v55-vis.off .v62-eye-slash,.v54-icon-btn.v62-off .v62-eye-slash{display:block!important}
.v54-icon-btn.v55-vis .v62-eye-slash{display:none!important}
.v54-icon-btn.v55-lock .v62-lock-closed{display:none!important}
.v54-icon-btn.v55-lock.danger .v62-lock-open{display:none!important}
.v54-icon-btn.v55-lock.danger .v62-lock-closed{display:block!important}
.v54-layer-quick{gap:3px!important;flex:0 0 auto!important}
.v54-badge-slot{width:23px!important;min-width:23px!important;display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important}
.feature-row .feature-main,.file-head .file-main{min-width:0!important;flex:1 1 auto!important}
.feature-row .feature-name,.file-head .file-name{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
body.night-mode .v54-geom-badge,
body.night-mode .v54-icon-btn.v55-pick,
body.night-mode .v54-icon-btn.v55-vis,
body.night-mode .v54-icon-btn.v55-lock{
  background:#1b2028!important;border-color:#3a3f46!important;color:#d7dce3!important;
}
body.night-mode .v54-icon-btn.v55-pick.warn,
body.night-mode .v54-icon-btn.v55-pick.v62-picked,
body.night-mode .v54-icon-btn.v55-vis.active,
body.night-mode .v54-icon-btn.v55-lock.danger{
  color:#ff6b72!important;border-color:#6a3b42!important;background:#2b2022!important;
}

/* ---- v63MatchingImageIcon ---- */
/* v63: layer-list image icons use the exact same pictogram geometry as the left tool rail image icon. */
.layer-thumb.v61-object-icon.image svg rect{rx:1!important}

/* ---- v67ImageThumbVertexAllFixStyle ---- */
/* v67: keep the Image overlays header as the generic image icon, but show each
   individual overlay as the real thumbnail. Reintroduce Vertex as all-visible
   polygon vertex edit, without touching image map interaction. */
.image-overlay-row .v67-image-thumb{
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  flex:0 0 22px!important;
  display:block!important;
  object-fit:cover!important;
  border:1px solid #cfd3d8!important;
  border-radius:1px!important;
  background:#fff!important;
  padding:0!important;
  box-sizing:border-box!important;
}
.image-overlay-row .v67-image-thumb-empty{
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  flex:0 0 22px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:1px solid #cfd3d8!important;
  border-radius:1px!important;
  color:#2f3540!important;
  background:#fff!important;
  box-sizing:border-box!important;
}
.image-overlay-row .v67-image-thumb-empty svg,
.layer-thumb.v67-image-group-icon svg{
  width:15px!important;
  height:15px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.6!important;
  stroke-linecap:square!important;
  stroke-linejoin:miter!important;
}
.tool-rail [data-rail="vertex"]{display:flex!important}
.tool-rail [data-rail="vertex"] svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:square;stroke-linejoin:miter}
.tool-rail [data-rail="vertex"] svg circle{fill:#fff;stroke:currentColor;stroke-width:1.6}
.tool-rail [data-rail="vertex"].active svg circle{fill:#d92c32;stroke:#d92c32}

/* ---- v69ImageThumbVertexStyle ---- */
.image-overlay-row .v69-image-thumb{
  width:22px!important;height:22px!important;min-width:22px!important;flex:0 0 22px!important;
  display:block!important;object-fit:cover!important;border:1px solid #cfd3d8!important;border-radius:1px!important;
  background:#fff!important;padding:0!important;box-sizing:border-box!important;
}
.image-overlay-row .v69-image-thumb-empty{
  width:22px!important;height:22px!important;min-width:22px!important;flex:0 0 22px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;border:1px solid #cfd3d8!important;
  border-radius:1px!important;color:#2f3540!important;background:#fff!important;box-sizing:border-box!important;
}
.image-overlay-row .v69-image-thumb-empty svg,.layer-thumb.v69-image-group-icon svg{
  width:15px!important;height:15px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.6!important;stroke-linecap:square!important;stroke-linejoin:miter!important;
}
.tool-rail [data-rail="vertex"]{display:flex!important;}
.tool-rail [data-rail="vertex"] svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:square;stroke-linejoin:miter;}
.tool-rail [data-rail="vertex"] svg circle{fill:#fff;stroke:currentColor;stroke-width:1.6;}
.tool-rail [data-rail="vertex"].active svg circle{fill:#d92c32;stroke:#d92c32;}

/* ---- v70ImageModeVertexRootFixStyle ---- */
/* v70: image mode controls and layer image rendering: no post-render thumbnail replacement. */
.image-overlay-toolbar button.active,
.inspector-mode-grid button.active{
  background:#fffafa!important;
  border-color:#d7aaa6!important;
  color:#9e2027!important;
  box-shadow:inset 0 -2px 0 #9e2027!important;
}
.image-overlay-row .v69-image-thumb,
.image-overlay-row .v70-image-thumb{
  width:22px!important;height:22px!important;min-width:22px!important;flex:0 0 22px!important;
  display:block!important;object-fit:cover!important;border:1px solid #cfd3d8!important;border-radius:1px!important;
  background:#fff!important;padding:0!important;box-sizing:border-box!important;
}
.image-overlay-row .v69-image-thumb-empty,
.image-overlay-row .v70-image-thumb-empty{
  width:22px!important;height:22px!important;min-width:22px!important;flex:0 0 22px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;border:1px solid #cfd3d8!important;
  border-radius:1px!important;color:#2f3540!important;background:#fff!important;box-sizing:border-box!important;
}
.layer-thumb.v69-image-group-icon,
.layer-thumb.v70-image-group-icon{
  width:22px!important;height:22px!important;min-width:22px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
  border:1px solid #cfd3d8!important;border-radius:1px!important;background:#f4f5f6!important;color:#2f363d!important;
}
.layer-thumb.v69-image-group-icon svg,.layer-thumb.v70-image-group-icon svg,
.image-overlay-row .v69-image-thumb-empty svg,.image-overlay-row .v70-image-thumb-empty svg{
  width:15px!important;height:15px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.6!important;stroke-linecap:square!important;stroke-linejoin:miter!important;
}

/* ---- v72-import-export-precision-style ---- */
.v72-fieldset{border:1px solid var(--line,#cfd6df);padding:8px;margin:8px 0;background:#fff}
  .v72-fieldset legend{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted,#667085);font-weight:700;padding:0 4px}
  .v72-grid{display:grid;grid-template-columns:128px 1fr;gap:6px 8px;align-items:center;font-size:12px}
  .v72-grid label{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#667085);font-weight:700}
  .v72-grid input,.v72-grid select{width:100%;box-sizing:border-box;border:1px solid var(--line,#cfd6df);border-radius:0;background:#fff;height:26px;padding:3px 6px;font:12px/1.2 system-ui,-apple-system,Segoe UI,Arial,sans-serif}
  .v72-import-options{display:grid;grid-template-columns:160px 1fr;gap:8px;align-items:center;border:1px solid var(--line,#cfd6df);padding:8px;margin:8px 0;background:#f7f8fa}
  .v72-import-options label{font-size:11px;text-transform:uppercase;letter-spacing:.06em;font-weight:700;color:#44516a}
  .v72-import-options select{border:1px solid var(--line,#cfd6df);border-radius:0;height:28px;background:white}
  .v72-review-table{border:1px solid var(--line,#cfd6df);margin-top:8px;background:#fff}
  .v72-review-row{display:grid;grid-template-columns:1fr auto;gap:8px;border-bottom:1px solid var(--line,#cfd6df);padding:7px 8px;align-items:start}
  .v72-review-row:last-child{border-bottom:none}
  .v72-review-name{font-weight:700;color:#172033}
  .v72-review-meta{font-size:11px;color:#536071;margin-top:2px}
  .v72-review-badge{border:1px solid #b8c0cc;padding:2px 5px;font-size:10px;font-weight:700;color:#334155;white-space:nowrap;background:#f7f8fa}
  .v72-warning-list{margin:8px 0 0 0;border:1px solid #e4b3b3;background:#fff7f7;color:#8f1d1d;padding:7px 9px;font-size:12px;line-height:1.35}
  .v72-warning-list div+div{margin-top:3px}
  .v72-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--line,#cfd6df);margin:8px 0;background:#fff}
  .v72-summary-grid div{padding:7px 8px;border-right:1px solid var(--line,#cfd6df)}
  .v72-summary-grid div:last-child{border-right:none}
  .v72-summary-grid strong{display:block;font-size:14px;color:#111827}.v72-summary-grid span{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:#607086}
  #v72ExportModal .modal{width:min(680px,calc(100vw - 48px))}
  .v72-export-summary{border:1px solid var(--line,#cfd6df);background:#f7f8fa;padding:8px;margin-top:8px;font-size:12px;line-height:1.4;color:#334155}
  .v72-export-warn{border-color:#e4b3b3;background:#fff7f7;color:#8f1d1d}
  .v72-check-row{display:flex;gap:8px;align-items:center;font-size:12px;margin-top:6px}.v72-check-row input{accent-color:var(--accent,#d92c32)}
  #v72CoordPanel{position:absolute;left:322px;bottom:28px;z-index:880;background:#fff;border:1px solid #b8c0cc;box-shadow:0 1px 2px rgba(0,0,0,.18);padding:7px 8px;display:none;min-width:360px;font:12px/1.25 system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:#1e293b}
  #v72CoordPanel.active{display:block}
  #v72CoordPanel .v72-coord-title{font-weight:700;margin-bottom:5px;color:#111827}
  #v72CoordPanel .v72-coord-row{display:grid;grid-template-columns:44px 1fr 44px 1fr auto auto;gap:5px;align-items:center}
  #v72CoordPanel input{height:24px;border:1px solid #cbd5e1;border-radius:0;padding:2px 5px;font-size:12px}
  #v72CoordPanel button{height:24px;border:1px solid #b8c0cc;border-radius:0;background:#fff;padding:2px 7px;font-size:12px}
  #v72CoordPanel button.primary{background:#9f1f2c;color:#fff;border-color:#9f1f2c}
  #v72CoordPanel .v72-coord-note{font-size:11px;color:#607086;margin-top:5px}
  body.night-mode .v72-fieldset,body.night-mode .v72-review-table,body.night-mode #v72CoordPanel{background:#101827;color:#dbe4ee;border-color:#334155}

/* ---- v74LayerControlsForImagesMeasuresAnnotationsStyle ---- */
/* v74: non-polygon layers use the same compact visibility/lock controls as polygon layers. */
.v74-layer-quick{display:inline-flex;align-items:center;gap:3px;flex:0 0 auto;margin-left:auto;}
.file-head .v74-layer-quick{margin-left:6px;}
.image-overlay-row .v74-layer-quick,.measure-layer-row .v74-layer-quick{margin-left:4px;}
.image-overlay-row.hidden,.measure-layer-row.hidden{opacity:.62;background:#f7f8fa!important;}
.image-overlay-row.locked,.measure-layer-row.locked{background:#fafafa!important;}
.image-overlay-row.locked .feature-name::after,.measure-layer-row.locked .feature-name::after{content:'  locked';font-weight:500;color:#7a828c;font-size:10px;text-transform:uppercase;letter-spacing:.04em;}
.v74-layer-quick .v61-layer-btn svg{width:14px!important;height:14px!important;}
.v74-image-layer-menu-note,.v74-measure-layer-menu-note{font-size:11px;color:#667085;padding:4px 8px 7px;border-bottom:1px solid #e3e6ea;}
.measure-layer-row .feature-actions,.image-overlay-row .feature-actions{display:inline-flex;align-items:center;gap:3px;}
.image-overlay-row .v70-image-thumb,.image-overlay-row .v74-image-thumb{width:22px!important;height:22px!important;min-width:22px!important;flex:0 0 22px!important;object-fit:cover!important;border:1px solid #cfd3d8!important;border-radius:1px!important;background:#fff!important;}

/* ---- v75NonPolygonLayerControlsFixStyle ---- */
/* v75: non-polygon rows use the same compact controls as polygon rows.
   This is a root-level post-render pass so it works regardless of which earlier
   sidebar renderer produced image / measurement / annotation cards. */
.image-overlay-row > input[data-img-a="vis"]{display:none!important;}
.file-head .v75-layer-controls,
.image-overlay-row .v75-layer-controls,
.measure-layer-row .v75-layer-controls{
  display:inline-flex!important;align-items:center!important;gap:3px!important;flex:0 0 auto!important;margin-left:4px!important;
}
.file-head .v75-layer-controls{margin-left:6px!important;}
.v75-layer-btn{
  width:23px!important;height:23px!important;min-width:23px!important;padding:0!important;
  border:1px solid #d3d7dd!important;border-radius:1px!important;background:#fff!important;color:#2f363d!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;line-height:1!important;box-shadow:none!important;
}
.v75-layer-btn:hover{background:#f1f2f4!important;border-color:#bbc1ca!important;}
.v75-layer-btn svg{width:14px!important;height:14px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.65!important;stroke-linecap:square!important;stroke-linejoin:miter!important;vector-effect:non-scaling-stroke!important;}
.v75-layer-btn.v75-on{color:#9e2027!important;border-color:#d7aaa6!important;background:#fffafa!important;}
.v75-layer-btn.v75-off{color:#777f89!important;background:#f8f8f8!important;opacity:.75!important;}
.v75-layer-btn.v75-locked{color:#9e2027!important;border-color:#d7aaa6!important;background:#fffafa!important;}
.v75-layer-btn .v75-slash,.v75-layer-btn .v75-lock-closed{display:none;}
.v75-layer-btn.v75-off .v75-slash{display:block;}
.v75-layer-btn.v75-locked .v75-lock-open{display:none;}
.v75-layer-btn.v75-locked .v75-lock-closed{display:block;}
.image-overlay-row.hidden,.measure-layer-row.hidden{opacity:.62;background:#f7f8fa!important;}
.image-overlay-row.locked,.measure-layer-row.locked{background:#fafafa!important;}
.image-overlay-row.locked .feature-name::after,.measure-layer-row.locked .feature-name::after{
  content:' locked';font-weight:500;color:#747c85;font-size:10px;text-transform:uppercase;letter-spacing:.035em;
}
.image-overlay-row .feature-actions,.measure-layer-row .feature-actions{display:inline-flex!important;align-items:center!important;gap:3px!important;}
.file-head .layer-row-main{min-width:0!important;}
.measure-layer-row .feature-main,.image-overlay-row .feature-main{min-width:0!important;flex:1 1 auto!important;}
body.night-mode .v75-layer-btn{background:#1b2028!important;border-color:#3a3f46!important;color:#d7dce3!important;}
body.night-mode .v75-layer-btn.v75-on,body.night-mode .v75-layer-btn.v75-locked{color:#ff6b72!important;border-color:#6a3b42!important;background:#2b2022!important;}

/* ---- v76LayerControlsAndMenuCloseStyle ---- */
/* v76: non-polygon layer controls are rendered/maintained as first-class controls. */
.image-overlay-row > input[data-img-a="vis"]{display:none!important;}
.v76-layer-controls{
  display:inline-flex!important;
  align-items:center!important;
  gap:3px!important;
  flex:0 0 auto!important;
  margin-left:4px!important;
}
.file-head .v76-layer-controls{margin-left:auto!important;}
.image-overlay-row .v76-layer-controls,
.measure-layer-row .v76-layer-controls{margin-left:4px!important;}
.v76-layer-btn{
  width:23px!important;
  height:23px!important;
  min-width:23px!important;
  padding:0!important;
  border:1px solid #d3d7dd!important;
  border-radius:1px!important;
  background:#fff!important;
  color:#2f363d!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  box-shadow:none!important;
}
.v76-layer-btn:hover{background:#f1f2f4!important;border-color:#bbc1ca!important;}
.v76-layer-btn svg{width:14px!important;height:14px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.65!important;stroke-linecap:square!important;stroke-linejoin:miter!important;vector-effect:non-scaling-stroke!important;}
.v76-layer-btn.v76-on{color:#9e2027!important;border-color:#d7aaa6!important;background:#fffafa!important;}
.v76-layer-btn.v76-off{color:#777f89!important;background:#f8f8f8!important;opacity:.75!important;}
.v76-layer-btn.v76-locked{color:#9e2027!important;border-color:#d7aaa6!important;background:#fffafa!important;}
.v76-layer-btn .v76-slash,.v76-layer-btn .v76-lock-closed{display:none;}
.v76-layer-btn.v76-off .v76-slash{display:block;}
.v76-layer-btn.v76-locked .v76-lock-open{display:none;}
.v76-layer-btn.v76-locked .v76-lock-closed{display:block;}
.image-overlay-row.hidden,.measure-layer-row.hidden{opacity:.62;background:#f7f8fa!important;}
.image-overlay-row.locked,.measure-layer-row.locked{background:#fafafa!important;}
.image-overlay-row .feature-actions,.measure-layer-row .feature-actions{display:inline-flex!important;align-items:center!important;gap:3px!important;}
.image-overlay-row .feature-main,.measure-layer-row .feature-main{min-width:0!important;flex:1 1 auto!important;}
body.night-mode .v76-layer-btn{background:#1b2028!important;border-color:#3a3f46!important;color:#d7dce3!important;}
body.night-mode .v76-layer-btn.v76-on,body.night-mode .v76-layer-btn.v76-locked{color:#ff6b72!important;border-color:#6a3b42!important;background:#2b2022!important;}

/* ---- v83FinalLayerButtonSafetyStyle ---- */
.image-overlay-row > input[data-img-a="vis"]{display:none!important;}
.image-overlay-row > .v74-layer-quick,.image-overlay-row > .v75-layer-controls,.image-overlay-row > .v76-layer-controls,.image-overlay-row > .v81-layer-controls,.image-overlay-row > .v82-layer-controls,
.measure-layer-row > .v74-layer-quick,.measure-layer-row > .v75-layer-controls,.measure-layer-row > .v76-layer-controls,.measure-layer-row > .v81-layer-controls,.measure-layer-row > .v82-layer-controls{display:none!important;}
.image-layer-card > .file-head > .v74-layer-quick,.image-layer-card > .file-head > .v75-layer-controls,.image-layer-card > .file-head > .v76-layer-controls,.image-layer-card > .file-head > .v81-layer-controls,.image-layer-card > .file-head > .v82-layer-controls,
.measure-layer-card > .file-head > .v74-layer-quick,.measure-layer-card > .file-head > .v75-layer-controls,.measure-layer-card > .file-head > .v76-layer-controls,.measure-layer-card > .file-head > .v81-layer-controls,.measure-layer-card > .file-head > .v82-layer-controls,
.annotation-layer-card > .file-head > .v74-layer-quick,.annotation-layer-card > .file-head > .v75-layer-controls,.annotation-layer-card > .file-head > .v76-layer-controls,.annotation-layer-card > .file-head > .v81-layer-controls,.annotation-layer-card > .file-head > .v82-layer-controls{display:none!important;}
.v83-layer-controls{display:flex!important;align-items:center!important;gap:3px!important;flex:0 0 auto!important;margin-left:3px!important;}
.file-head > .v83-layer-controls{margin-left:auto!important;}
.image-overlay-row > .v83-layer-controls,.measure-layer-row > .v83-layer-controls{margin-left:3px!important;}
.v83-layer-controls .v83-layer-btn{width:22px!important;height:22px!important;min-width:22px!important;min-height:22px!important;padding:0!important;}
.v83-layer-controls .v83-layer-btn svg{width:13px!important;height:13px!important;}
.v83-layer-controls .v83-eye.v61-off .slash{display:block!important;}
.v83-layer-controls .v83-eye:not(.v61-off) .slash{display:none!important;}
.v83-layer-controls .v83-lock.v61-locked .shackle-open{display:none!important;}
.v83-layer-controls .v83-lock.v61-locked .shackle-closed{display:block!important;}
.v83-layer-controls .v83-lock.v61-unlocked .shackle-open{display:block!important;}
.v83-layer-controls .v83-lock.v61-unlocked .shackle-closed{display:none!important;}

/* ---- v90NightModeCompletePolish ---- */
/* v90: final night-mode polish -------------------------------------------------
   This is deliberately placed last. Earlier professional-cleanup passes used
   light backgrounds with !important, so night mode needs a final, scoped,
   high-specificity pass for every chrome surface. */
body.night-mode{
  --bg:#0f1117!important;
  --panel:#15181f!important;
  --panel2:#11141a!important;
  --line:#303744!important;
  --soft:#1c212a!important;
  --text:#e5e7eb!important;
  --muted:#9ca3af!important;
  --accent:#ff6b72!important;
  --accentSoft:#3a2226!important;
  --accentSoft2:#2b2023!important;
  --accentBorder:#6a3b42!important;
  --blue:#7db1ff!important;
  --blueSoft:#17253a!important;
  --blueSoft2:#111d2f!important;
  --red:#ff746c!important;
  --redSoft:#372124!important;
  color-scheme:dark!important;
  background:#0f1117!important;
  color:#e5e7eb!important;
}
body.night-mode .app,
body.night-mode .project-toolbar,
body.night-mode .compact-topbar,
body.night-mode .toolbar,
body.night-mode .statusbar,
body.night-mode .sidebar,
body.night-mode .sidebar-section,
body.night-mode .project-section,
body.night-mode .files-section,
body.night-mode .selected-section,
body.night-mode .inspector-panel,
body.night-mode .tool-rail,
body.night-mode .map-display-control,
body.night-mode .float-toolbar,
body.night-mode .selected-float-toolbar,
body.night-mode .image-overlay-toolbar,
body.night-mode .measure-toolbar,
body.night-mode .polygon-context-toolbar,
body.night-mode .measure-style-panel,
body.night-mode .geometry-preview-panel,
body.night-mode #modeBanner.mode-banner,
body.night-mode .mode-banner,
body.night-mode .command-palette,
body.night-mode .modal,
body.night-mode .top-more-menu,
body.night-mode .layer-menu,
body.night-mode .pick-menu,
body.night-mode .rail-flyout,
body.night-mode .converter-panel,
body.night-mode .validator-panel{
  background:#15181f!important;
  color:#e5e7eb!important;
  border-color:#303744!important;
  box-shadow:0 1px 2px rgba(0,0,0,.45)!important;
  backdrop-filter:none!important;
}
body.night-mode .sidebar,
body.night-mode .tool-rail,
body.night-mode .selected-section,
body.night-mode .inspector-panel{
  background:#11141a!important;
}
body.night-mode .project-toolbar,
body.night-mode .compact-topbar,
body.night-mode .statusbar{
  background:#0f1117!important;
}
body.night-mode #map{
  background:#0a0d12!important;
}
body.night-mode .sidebar-resizer,
body.night-mode .sidebar-resizer[data-resizer]{
  background:#15181f!important;
  border-color:#303744!important;
}
body.night-mode .sidebar-resizer:after{
  border-color:#4b5563!important;
}

/* Project, layer, and inspector cards */
body.night-mode .dropzone,
body.night-mode .notice,
body.night-mode #modeNotice,
body.night-mode .file-card,
body.night-mode .file-head,
body.night-mode .feature-row,
body.night-mode .image-overlay-row,
body.night-mode .measure-layer-row,
body.night-mode .v54-file-card,
body.night-mode .v54-feature-row,
body.night-mode .v54-layer-tools,
body.night-mode .v54-layer-search-row,
body.night-mode .v54-filter-row,
body.night-mode .inspector-card,
body.night-mode .v53-inspector-section,
body.night-mode .v53-inspector-section summary,
body.night-mode .v53-section-note,
body.night-mode .v53-toggle-row,
body.night-mode .v53-history-row,
body.night-mode .empty-inspector,
body.night-mode .selected-panel-card,
body.night-mode .edit-stack,
body.night-mode .topbar-actions,
body.night-mode .topbar-search-wrap,
body.night-mode .group,
body.night-mode .image-move-behaviour-control,
body.night-mode .converter-dropzone,
body.night-mode .validator-dropzone,
body.night-mode .v72-fieldset,
body.night-mode .v72-review-table,
body.night-mode #v72CoordPanel{
  background:#171b22!important;
  color:#e5e7eb!important;
  border-color:#303744!important;
  box-shadow:none!important;
}
body.night-mode .dropzone,
body.night-mode .converter-dropzone,
body.night-mode .validator-dropzone{
  background:#141820!important;
  border-style:dashed!important;
  color:#9ca3af!important;
}
body.night-mode .dropzone:hover,
body.night-mode .dropzone.dragover,
body.night-mode .converter-dropzone.dragover,
body.night-mode .validator-dropzone.dragover{
  background:#17253a!important;
  border-color:#35547a!important;
  color:#cfe3ff!important;
}
body.night-mode .notice,
body.night-mode #modeNotice{
  background:#151b24!important;
  color:#c7d2df!important;
  border-color:#334155!important;
}
body.night-mode .file-head,
body.night-mode .image-layer-card>.file-head,
body.night-mode .measure-layer-card>.file-head,
body.night-mode .annotation-layer-card>.file-head{
  background:#141820!important;
  border-bottom-color:#303744!important;
}
body.night-mode .feature-row,
body.night-mode .image-overlay-row,
body.night-mode .measure-layer-row,
body.night-mode .v54-feature-row{
  background:#171b22!important;
  border-top-color:#303744!important;
}
body.night-mode .feature-row:hover,
body.night-mode .image-overlay-row:hover,
body.night-mode .measure-layer-row:hover,
body.night-mode .v54-feature-row:hover,
body.night-mode .v54-file-card:hover{
  background:#1d2430!important;
}
body.night-mode .feature-row.selected,
body.night-mode .image-overlay-row.selected,
body.night-mode .measure-layer-row.selected,
body.night-mode .v54-feature-row.selected,
body.night-mode .v54-file-card.selected{
  background:#252027!important;
  outline:0!important;
  box-shadow:inset 3px 0 0 #ff6b72!important;
}
body.night-mode .feature-row.picked,
body.night-mode .v54-feature-row.picked,
body.night-mode .v54-file-card.picked{
  background:#2a2418!important;
  box-shadow:inset 3px 0 0 #d4a148!important;
}
body.night-mode .feature-row.hidden-state,
body.night-mode .v54-feature-row.hidden-state,
body.night-mode .image-overlay-row.hidden-state,
body.night-mode .measure-layer-row.hidden-state{
  opacity:.72!important;
}

/* Text and labels */
body.night-mode .title,
body.night-mode .file-name,
body.night-mode .feature-name,
body.night-mode .inspector-title,
body.night-mode .empty-inspector strong,
body.night-mode h3,
body.night-mode strong,
body.night-mode .v53-section-title,
body.night-mode .v53-history-name,
body.night-mode .top-menu-label,
body.night-mode .mode-banner strong{
  color:#e5e7eb!important;
}
body.night-mode .topbar-subtitle,
body.night-mode .section-title,
body.night-mode .subtle,
body.night-mode .file-meta,
body.night-mode .feature-meta,
body.night-mode .inspector-subtitle,
body.night-mode .inspector-control label,
body.night-mode .property-note,
body.night-mode .v53-section-subtitle,
body.night-mode .v53-kv .k,
body.night-mode .v53-section-note,
body.night-mode .v53-history-meta,
body.night-mode .top-menu-section-title,
body.night-mode .v54-menu-group-title,
body.night-mode .rail-tip,
body.night-mode .command-hint,
body.night-mode .statusbar,
body.night-mode .map-display-control label,
body.night-mode .image-move-behaviour-control{
  color:#9ca3af!important;
}
body.night-mode .files-section .section-title:after{
  color:#7f8a99!important;
}
body.night-mode .section-title span:first-child:before{
  background:#3a2226!important;
  border-color:#6a3b42!important;
}

/* Inputs and buttons */
body.night-mode button,
body.night-mode select,
body.night-mode input,
body.night-mode textarea,
body.night-mode input[type=text],
body.night-mode input[type=search],
body.night-mode input[type=number],
body.night-mode input[type=range],
body.night-mode .location-search-box,
body.night-mode .snap-tolerance,
body.night-mode .image-move-behaviour-control select{
  background:#111318!important;
  color:#e5e7eb!important;
  border-color:#303744!important;
  box-shadow:none!important;
}
body.night-mode input[type=checkbox]{
  accent-color:#ff6b72!important;
}
body.night-mode input[type=color]{
  background:#111318!important;
  border-color:#303744!important;
}
body.night-mode input[type=range]{
  accent-color:#6ea8ff!important;
}
body.night-mode button:hover,
body.night-mode .icon-btn:hover,
body.night-mode .v54-icon-btn:hover,
body.night-mode .layer-kebab:hover,
body.night-mode .collapse-btn:hover,
body.night-mode .mode-banner-btn:hover,
body.night-mode .top-more-menu button:hover,
body.night-mode .layer-menu button:hover,
body.night-mode .rail-flyout button:hover,
body.night-mode .pick-item:hover,
body.night-mode .command-item:hover,
body.night-mode .command-item.active{
  background:#202632!important;
  color:#f3f4f6!important;
  border-color:#414a57!important;
}
body.night-mode button:disabled,
body.night-mode select:disabled,
body.night-mode input:disabled{
  background:#0f1117!important;
  color:#6b7280!important;
  border-color:#252b35!important;
  opacity:.75!important;
}
body.night-mode button.active,
body.night-mode .icon-btn.active,
body.night-mode .v54-icon-btn.active,
body.night-mode .v54-filter-row button.active,
body.night-mode .rail-btn.active,
body.night-mode #themeToggleBtn.active,
body.night-mode .theme-toggle-btn.active,
body.night-mode .inspector-mode-grid button.active,
body.night-mode .mode-banner-btn.active{
  background:#2b2023!important;
  color:#ff8a90!important;
  border-color:#6a3b42!important;
  box-shadow:inset 3px 0 0 #ff6b72!important;
}
body.night-mode .v54-filter-row button.active{
  box-shadow:inset 0 -2px 0 #ff6b72!important;
}
body.night-mode button.primary,
body.night-mode .mode-banner-btn.primary,
body.night-mode .v53-actions button.primary,
body.night-mode .v53-action-grid button.primary{
  background:#26303b!important;
  border-color:#414a57!important;
  color:#fff!important;
}
body.night-mode button.danger,
body.night-mode .top-more-menu button.danger,
body.night-mode .layer-menu button.danger{
  background:#1b1315!important;
  color:#ff8a90!important;
  border-color:#6a3b42!important;
}
body.night-mode button.danger:hover,
body.night-mode .top-more-menu button.danger:hover,
body.night-mode .layer-menu button.danger:hover{
  background:#2b2023!important;
}

/* Icons, thumbnails, badges and layer controls */
body.night-mode .layer-thumb,
body.night-mode .layer-thumb.poly,
body.night-mode .v61-object-icon,
body.night-mode .inspector-icon,
body.night-mode .command-icon,
body.night-mode .flyout-icon,
body.night-mode .status-pill,
body.night-mode .kbd,
body.night-mode .sleeping-badge,
body.night-mode .v54-geom-badge,
body.night-mode .converter-badge,
body.night-mode .validator-badge,
body.night-mode .validator-chip,
body.night-mode .converter-chip,
body.night-mode .layer-mini,
body.night-mode .v61-layer-btn,
body.night-mode .v75-layer-btn,
body.night-mode .v76-layer-btn,
body.night-mode .v83-layer-btn,
body.night-mode .v54-icon-btn.v55-pick,
body.night-mode .v54-icon-btn.v55-vis,
body.night-mode .v54-icon-btn.v55-lock{
  background:#1b2028!important;
  color:#d7dce3!important;
  border-color:#3a3f46!important;
}
body.night-mode .inspector-icon,
body.night-mode .v61-layer-btn.v61-picked,
body.night-mode .v61-layer-btn.v61-locked,
body.night-mode .v54-icon-btn.v55-vis.active,
body.night-mode .v54-icon-btn.v55-lock.danger,
body.night-mode .v75-layer-btn.v75-on,
body.night-mode .v75-layer-btn.v75-locked,
body.night-mode .v76-layer-btn.v76-on,
body.night-mode .v76-layer-btn.v76-locked,
body.night-mode .v83-layer-btn.v61-picked,
body.night-mode .v83-layer-btn.v61-locked,
body.night-mode .v83-layer-btn.v61-off{
  background:#2b2023!important;
  color:#ff8a90!important;
  border-color:#6a3b42!important;
}
body.night-mode .annotation-layer-card .layer-thumb.poly{
  background:#2c2618!important;
  color:#f6d38a!important;
  border-color:#6b5125!important;
}
body.night-mode .measure-layer-card .layer-thumb.poly{
  background:#17253a!important;
  color:#bcd8ff!important;
  border-color:#38567a!important;
}
body.night-mode .image-overlay-row .v69-image-thumb,
body.night-mode .image-overlay-row .layer-thumb,
body.night-mode .file-color{
  border-color:#414a57!important;
  background-color:#111318!important;
}

/* Menus, palettes and popovers */
body.night-mode .top-more-menu button,
body.night-mode .layer-menu button,
body.night-mode .rail-flyout button,
body.night-mode .pick-item,
body.night-mode .command-item{
  background:#15181f!important;
  color:#e5e7eb!important;
  border-color:#303744!important;
}
body.night-mode .top-menu-section-title,
body.night-mode .v54-menu-group-title{
  border-top-color:#303744!important;
}
body.night-mode .modal-head,
body.night-mode .modal-actions,
body.night-mode .command-backdrop{
  border-color:#303744!important;
}
body.night-mode .command-backdrop{
  background:rgba(0,0,0,.58)!important;
}

/* Inspector details */
body.night-mode .inspector-toggle-row,
body.night-mode .inspector-actions,
body.night-mode .inspector-grid,
body.night-mode .v53-kv,
body.night-mode .v53-actions,
body.night-mode .v53-action-grid,
body.night-mode .v53-history-row{
  border-color:#303744!important;
}
body.night-mode .inspector-mode-grid button,
body.night-mode .geometry-quick-grid button,
body.night-mode .step2-inspector-grid button,
body.night-mode .hole-manager-row{
  background:#111318!important;
  border-color:#303744!important;
  color:#e5e7eb!important;
}
body.night-mode .inspector-mode-grid button:hover,
body.night-mode .geometry-quick-grid button:hover,
body.night-mode .step2-inspector-grid button:hover{
  background:#202632!important;
}
body.night-mode .geom-op-warning,
body.night-mode .step4-impact.warn,
body.night-mode .step4-impact.info{
  background:#2b2023!important;
  border-color:#6a3b42!important;
  color:#ffb0aa!important;
}
body.night-mode .geometry-preview-summary,
body.night-mode .geom-op-summary{
  background:#17253a!important;
  border-color:#38567a!important;
  color:#cde2ff!important;
}
body.night-mode .coord-preview,
body.night-mode .coord-help,
body.night-mode .geometry-preview-desc{
  color:#9ca3af!important;
}

/* Leaflet chrome */
body.night-mode .leaflet-control-zoom a,
body.night-mode .leaflet-bar a,
body.night-mode .leaflet-bar a:hover,
body.night-mode .leaflet-control-layers,
body.night-mode .leaflet-control-attribution{
  background:#111318!important;
  color:#e5e7eb!important;
  border-color:#303744!important;
}
body.night-mode .leaflet-control-zoom a:hover,
body.night-mode .leaflet-bar a:hover{
  background:#202632!important;
}
body.night-mode .leaflet-control-attribution a{
  color:#9ec5ff!important;
}
body.night-mode .leaflet-container{
  background:#0a0d12!important;
}

/* Map labels and editing overlays */
body.night-mode .measure-label{
  background:rgba(17,19,23,.86)!important;
  color:#f2f4f7!important;
  border-color:rgba(140,151,165,.36)!important;
}
body.night-mode .measure-label-total{
  background:rgba(17,19,23,.94)!important;
}
body.night-mode .annotation-label{
  color:#f2f4f7!important;
  text-shadow:0 1px 1px rgba(0,0,0,.9),0 -1px 1px rgba(0,0,0,.9)!important;
}
body.night-mode .mouse-coords,
body.night-mode #mouseCoords{
  background:rgba(17,19,23,.92)!important;
  color:#f2f4f7!important;
  border-color:#303744!important;
}
body.night-mode .mini-help{
  background:rgba(0,0,0,.78)!important;
  color:#e5e7eb!important;
}
body.night-mode .mode-banner-metric{
  background:#111827!important;
  border-color:#374151!important;
  color:#f9fafb!important;
}
body.night-mode .image-overlay-toolbar strong,
body.night-mode .measure-toolbar.measurement-mode strong,
body.night-mode .measure-toolbar.annotation-mode strong{
  background:#0f1117!important;
  color:#e5e7eb!important;
}

/* Browser polish */
body.night-mode ::placeholder{color:#778393!important;}
body.night-mode ::selection{background:#315d98!important;color:#fff!important;}
body.night-mode ::-webkit-scrollbar{width:10px;height:10px;}
body.night-mode ::-webkit-scrollbar-track{background:#11141a;}
body.night-mode ::-webkit-scrollbar-thumb{background:#303744;border:2px solid #11141a;}
body.night-mode ::-webkit-scrollbar-thumb:hover{background:#414a57;}

/* ---- v111ToolbarOverlapFix ---- */
/* v111: top-of-map toolbar / mode notice collision prevention
   Keep the active mode notice and the action toolbars in separate vertical lanes.
   The value is updated by JS from the live height of #modeBanner, so long/wrapped
   notices on narrow screens still push the toolbars down instead of overlapping. */
:root{
  --v111-map-toolbar-stack-offset:54px;
}
#modeBanner.mode-banner{
  max-width:min(560px,calc(100% - 24px))!important;
  min-width:0!important;
  overflow:hidden!important;
}
#selectedFloatToolbar.float-toolbar,
#drawFloatToolbar.float-toolbar,
#vertexFloatToolbar.float-toolbar,
#measureFloatToolbar.float-toolbar,
#imageOverlayToolbar.float-toolbar{
  margin-top:var(--v111-map-toolbar-stack-offset,54px)!important;
  max-width:calc(100% - 24px)!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
#selectedFloatToolbar.float-toolbar,
#drawFloatToolbar.float-toolbar,
#vertexFloatToolbar.float-toolbar,
#measureFloatToolbar.float-toolbar{
  justify-self:start!important;
  margin-left:12px!important;
}
#imageOverlayToolbar.float-toolbar{
  justify-self:center!important;
  margin-left:0!important;
}
.float-toolbar select,
.float-toolbar input[type="text"],
.float-toolbar input[type="number"]{
  min-width:0!important;
}
@media(max-width:980px){
  #modeBanner.mode-banner{
    justify-self:stretch!important;
    margin:8px 12px 0 12px!important;
    max-width:none!important;
  }
  #selectedFloatToolbar.float-toolbar,
  #drawFloatToolbar.float-toolbar,
  #vertexFloatToolbar.float-toolbar,
  #measureFloatToolbar.float-toolbar,
  #imageOverlayToolbar.float-toolbar{
    justify-self:stretch!important;
    margin-left:12px!important;
    margin-right:12px!important;
    max-width:none!important;
  }
}

/* ---- v115ImageToolbarBarCleanup ---- */
/* v115: make the top map chrome deterministic.
   There should be one active tool/action strip in the top lane beside the
   Leaflet zoom buttons. The function/status banner lives in the second lane.
   Image overlays already have their own toolbar, so the separate image-mode
   banner is hidden to avoid the duplicate bar/flicker shown in v114. */
:root{
  --v115-toolbar-left:62px;
  --v115-toolbar-right:10px;
  --v115-toolbar-top:8px;
  --v115-banner-top:50px;
  --v115-mouse-bottom:34px;
}
#selectedFloatToolbar.float-toolbar,
#drawFloatToolbar.float-toolbar,
#vertexFloatToolbar.float-toolbar,
#measureFloatToolbar.float-toolbar,
#imageOverlayToolbar.float-toolbar{
  grid-area:map!important;
  align-self:start!important;
  justify-self:start!important;
  margin-top:var(--v115-toolbar-top,8px)!important;
  margin-left:var(--v115-toolbar-left,62px)!important;
  margin-right:var(--v115-toolbar-right,10px)!important;
  margin-bottom:0!important;
  max-width:calc(100% - var(--v115-toolbar-left,62px) - var(--v115-toolbar-right,10px))!important;
  width:auto!important;
  min-width:0!important;
  max-height:40px!important;
  min-height:0!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  box-sizing:border-box!important;
  transform:none!important;
  transition:none!important;
  z-index:1330!important;
}
#selectedFloatToolbar.float-toolbar > *,
#drawFloatToolbar.float-toolbar > *,
#vertexFloatToolbar.float-toolbar > *,
#measureFloatToolbar.float-toolbar > *,
#imageOverlayToolbar.float-toolbar > *{
  flex:0 0 auto!important;
}
body.image-overlay-selected #selectedFloatToolbar.float-toolbar,
body.image-overlay-selected #drawFloatToolbar.float-toolbar,
body.image-overlay-selected #vertexFloatToolbar.float-toolbar,
body.image-overlay-selected #measureFloatToolbar.float-toolbar{
  display:none!important;
}
#imageOverlayToolbar.float-toolbar strong{
  max-width:165px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#modeBanner.mode-banner{
  grid-area:map!important;
  align-self:start!important;
  justify-self:start!important;
  margin-top:var(--v115-banner-top,50px)!important;
  margin-left:var(--v115-toolbar-left,62px)!important;
  margin-right:var(--v115-toolbar-right,10px)!important;
  margin-bottom:0!important;
  max-width:calc(100% - var(--v115-toolbar-left,62px) - var(--v115-toolbar-right,10px))!important;
  min-width:0!important;
  width:auto!important;
  max-height:34px!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  box-sizing:border-box!important;
  transform:none!important;
  transition:none!important;
  pointer-events:none!important;
  z-index:1260!important;
}
/* The image toolbar already carries the image name, active mode and actions.
   Hiding this duplicate status strip removes the selected/not-selected mismatch
   and prevents the two bars from fighting for the same lane. */
#modeBanner.mode-banner[data-kind="image"]{
  display:none!important;
}
#modeBanner.mode-banner span#modeBannerHint{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#modeBanner.mode-banner .mode-banner-metric{
  flex:0 0 auto!important;
  max-width:150px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
#mouseCoords{
  align-self:end!important;
  justify-self:end!important;
  margin:0 10px var(--v115-mouse-bottom,34px) 0!important;
  transform:none!important;
  transition:none!important;
  z-index:820!important;
}
@media(max-width:760px){
  #selectedFloatToolbar.float-toolbar,
  #drawFloatToolbar.float-toolbar,
  #vertexFloatToolbar.float-toolbar,
  #measureFloatToolbar.float-toolbar,
  #imageOverlayToolbar.float-toolbar,
  #modeBanner.mode-banner{
    margin-left:var(--v115-toolbar-left,54px)!important;
    margin-right:8px!important;
    max-width:calc(100% - var(--v115-toolbar-left,54px) - 8px)!important;
  }
  #imageOverlayToolbar.float-toolbar strong{max-width:110px!important;}
}

/* ---- v113ToolbarLayoutAndMouseCoordsFix ---- */
/* v113: map chrome layout fix
   Active floating toolbars belong beside the Leaflet zoom buttons at the top of
   the map. The mode/function banner sits in a second lane below the toolbar, and
   the mouse-coordinate readout sits above Leaflet attribution. */
:root{
  --v113-toolbar-top:8px;
  --v113-toolbar-left:62px;
  --v113-toolbar-right:12px;
  --v113-toolbar-height:38px;
  --v113-banner-top:56px;
  --v113-mousecoords-bottom:30px;
}
#selectedFloatToolbar.float-toolbar,
#drawFloatToolbar.float-toolbar,
#vertexFloatToolbar.float-toolbar,
#measureFloatToolbar.float-toolbar,
#imageOverlayToolbar.float-toolbar{
  grid-area:map!important;
  align-self:start!important;
  justify-self:start!important;
  margin-top:var(--v113-toolbar-top,8px)!important;
  margin-left:var(--v113-toolbar-left,62px)!important;
  margin-right:var(--v113-toolbar-right,12px)!important;
  max-width:calc(100% - var(--v113-toolbar-left,62px) - var(--v113-toolbar-right,12px))!important;
  width:auto!important;
  max-height:46px!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  z-index:1320!important;
  box-sizing:border-box!important;
}
#imageOverlayToolbar.float-toolbar{
  justify-self:start!important;
}
#modeBanner.mode-banner{
  grid-area:map!important;
  align-self:start!important;
  justify-self:end!important;
  margin-top:var(--v113-banner-top,56px)!important;
  margin-right:12px!important;
  margin-left:var(--v113-toolbar-left,62px)!important;
  max-width:calc(100% - var(--v113-toolbar-left,62px) - 24px)!important;
  z-index:1260!important;
}
#mouseCoords{
  align-self:end!important;
  justify-self:end!important;
  margin:0 10px var(--v113-mousecoords-bottom,30px) 0!important;
  z-index:820!important;
}
@media(max-width:980px){
  #selectedFloatToolbar.float-toolbar,
  #drawFloatToolbar.float-toolbar,
  #vertexFloatToolbar.float-toolbar,
  #measureFloatToolbar.float-toolbar,
  #imageOverlayToolbar.float-toolbar{
    margin-left:var(--v113-toolbar-left,58px)!important;
    margin-right:8px!important;
    max-width:calc(100% - var(--v113-toolbar-left,58px) - 8px)!important;
    justify-self:start!important;
  }
  #modeBanner.mode-banner{
    justify-self:stretch!important;
    margin-left:8px!important;
    margin-right:8px!important;
    max-width:none!important;
  }
}

/* ---- v114ToolbarStabilityFix ---- */
/* v114: stable map toolbar lanes.
   The previous dynamic collision solver used toolbar/banner dimensions to move
   each other, which could oscillate when an image toolbar changed width or the
   banner wrapped. This final pass uses fixed lanes: toolbar beside Leaflet zoom;
   mode banner below it; mouse coords above attribution. */
:root{
  --v114-toolbar-left:62px;
  --v114-toolbar-right:10px;
  --v114-toolbar-top:8px;
  --v114-banner-top:52px;
  --v114-mouse-bottom:30px;
}
#selectedFloatToolbar.float-toolbar,
#drawFloatToolbar.float-toolbar,
#vertexFloatToolbar.float-toolbar,
#measureFloatToolbar.float-toolbar,
#imageOverlayToolbar.float-toolbar{
  grid-area:map!important;
  align-self:start!important;
  justify-self:start!important;
  margin-top:var(--v114-toolbar-top,8px)!important;
  margin-left:var(--v114-toolbar-left,62px)!important;
  margin-right:var(--v114-toolbar-right,10px)!important;
  margin-bottom:0!important;
  max-width:calc(100% - var(--v114-toolbar-left,62px) - var(--v114-toolbar-right,10px))!important;
  width:auto!important;
  min-width:0!important;
  max-height:40px!important;
  min-height:0!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  box-sizing:border-box!important;
  transform:none!important;
  transition:none!important;
  z-index:1320!important;
}
#imageOverlayToolbar.float-toolbar{
  justify-self:start!important;
  margin-left:var(--v114-toolbar-left,62px)!important;
}
#selectedFloatToolbar.float-toolbar > *,
#drawFloatToolbar.float-toolbar > *,
#vertexFloatToolbar.float-toolbar > *,
#measureFloatToolbar.float-toolbar > *,
#imageOverlayToolbar.float-toolbar > *{
  flex:0 0 auto!important;
}
#imageOverlayToolbar.float-toolbar strong{
  max-width:160px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#modeBanner.mode-banner{
  grid-area:map!important;
  align-self:start!important;
  justify-self:start!important;
  margin-top:var(--v114-banner-top,52px)!important;
  margin-left:var(--v114-toolbar-left,62px)!important;
  margin-right:var(--v114-toolbar-right,10px)!important;
  margin-bottom:0!important;
  max-width:calc(100% - var(--v114-toolbar-left,62px) - var(--v114-toolbar-right,10px))!important;
  min-width:0!important;
  width:auto!important;
  max-height:34px!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  box-sizing:border-box!important;
  transform:none!important;
  transition:none!important;
  pointer-events:none!important;
  z-index:1260!important;
}
#modeBanner.mode-banner span#modeBannerHint{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#modeBanner.mode-banner .mode-banner-metric{
  flex:0 0 auto!important;
  max-width:150px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
#mouseCoords{
  align-self:end!important;
  justify-self:end!important;
  margin:0 10px var(--v114-mouse-bottom,30px) 0!important;
  transform:none!important;
  transition:none!important;
  z-index:820!important;
}
@media(max-width:760px){
  #selectedFloatToolbar.float-toolbar,
  #drawFloatToolbar.float-toolbar,
  #vertexFloatToolbar.float-toolbar,
  #measureFloatToolbar.float-toolbar,
  #imageOverlayToolbar.float-toolbar,
  #modeBanner.mode-banner{
    margin-left:var(--v114-toolbar-left,54px)!important;
    margin-right:8px!important;
    max-width:calc(100% - var(--v114-toolbar-left,54px) - 8px)!important;
  }
  #imageOverlayToolbar.float-toolbar strong{max-width:110px!important;}
}

/* ---- v117UiPolishFixes ---- */
/* v117: deterministic map chrome, usable vertex toolbar and overflow-safe panels. */
:root{
  --v117-map-toolbar-left:62px;
  --v117-map-toolbar-right:10px;
  --v117-map-toolbar-top:8px;
  --v117-mode-banner-top:54px;
}
#selectedFloatToolbar.float-toolbar,
#drawFloatToolbar.float-toolbar,
#vertexFloatToolbar.float-toolbar,
#measureFloatToolbar.float-toolbar,
#imageOverlayToolbar.float-toolbar{
  grid-area:map!important;
  align-self:start!important;
  justify-self:start!important;
  margin-top:var(--v117-map-toolbar-top,8px)!important;
  margin-left:var(--v117-map-toolbar-left,62px)!important;
  margin-right:var(--v117-map-toolbar-right,10px)!important;
  margin-bottom:0!important;
  max-width:calc(100% - var(--v117-map-toolbar-left,62px) - var(--v117-map-toolbar-right,10px))!important;
  width:auto!important;
  min-width:0!important;
  max-height:44px!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  box-sizing:border-box!important;
  transform:none!important;
  transition:none!important;
  z-index:1440!important;
}
#modeBanner.mode-banner{
  grid-area:map!important;
  align-self:start!important;
  justify-self:start!important;
  margin-top:var(--v117-mode-banner-top,54px)!important;
  margin-left:var(--v117-map-toolbar-left,62px)!important;
  margin-right:var(--v117-map-toolbar-right,10px)!important;
  margin-bottom:0!important;
  max-width:calc(100% - var(--v117-map-toolbar-left,62px) - var(--v117-map-toolbar-right,10px))!important;
  width:auto!important;
  min-width:0!important;
  max-height:36px!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  box-sizing:border-box!important;
  transform:none!important;
  transition:none!important;
  z-index:1320!important;
  pointer-events:none!important;
}
/* Keep the vertex-mode exit control reachable when the toolbar must scroll. */
#vertexFloatToolbar #doneVerticesBtn{
  position:sticky!important;
  right:0!important;
  z-index:4!important;
  margin-left:4px!important;
  background:var(--panel,#fff)!important;
  box-shadow:-10px 0 10px -8px rgba(15,23,42,.32)!important;
}
body.night-mode #vertexFloatToolbar #doneVerticesBtn{
  background:#15171b!important;
}
#vertexFloatToolbar #deleteVerticesBtn{min-width:112px!important;}
/* Long names/properties should wrap inside the inspector rather than creating a hidden horizontal lane. */
#selectedSection,
#selectedPanel,
.inspector-panel{
  overflow-x:hidden!important;
  min-width:0!important;
}
#selectedPanel .inspector-card,
#selectedPanel .inspector-grid,
#selectedPanel .kv,
#selectedPanel .input-row,
#selectedPanel .property-note{
  min-width:0!important;
  max-width:100%!important;
}
#selectedPanel .inspector-grid > *,
#selectedPanel .kv > *,
#selectedPanel .property-note{
  min-width:0!important;
  overflow-wrap:anywhere!important;
  word-break:break-word;
}
/* The left Vertex tool is a real toggle, not merely a passive state lamp. */
.tool-rail [data-rail="vertex"]{cursor:pointer!important;}
.tool-rail [data-rail="vertex"][aria-disabled="true"]{opacity:.55;}
@media(max-width:620px){
  #selectedFloatToolbar.float-toolbar,
  #drawFloatToolbar.float-toolbar,
  #vertexFloatToolbar.float-toolbar,
  #measureFloatToolbar.float-toolbar,
  #imageOverlayToolbar.float-toolbar,
  #modeBanner.mode-banner{
    margin-left:8px!important;
    margin-right:8px!important;
    max-width:calc(100% - 16px)!important;
  }
}

/* ---- v120SidebarInteractionFixes ---- */
/* v120: minimise the side panels, not the floating map toolbars. */
.app{
  --v120-left-sidebar-width:305px;
  --v120-right-sidebar-width:315px;
  grid-template-columns:56px var(--v120-left-sidebar-width) minmax(360px,1fr) var(--v120-right-sidebar-width)!important;
  transition:grid-template-columns .16s ease;
}
.app.v120-left-sidebar-collapsed{--v120-left-sidebar-width:34px;}
.app.v120-right-sidebar-collapsed{--v120-right-sidebar-width:34px;}

.v120-sidebar-toggle{
  flex:0 0 26px!important;
  width:26px!important;
  min-width:26px!important;
  height:24px!important;
  min-height:24px!important;
  padding:0!important;
  margin-left:auto!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:1px solid #c7ccd2!important;
  border-radius:3px!important;
  background:#fff!important;
  color:#27313c!important;
  font-size:16px!important;
  font-weight:800!important;
  line-height:1!important;
  cursor:pointer!important;
}
.v120-sidebar-toggle:hover{background:#eef2f6!important;border-color:#9da5ae!important;}
.section-title .v120-sidebar-toggle{margin-top:-4px!important;margin-bottom:-3px!important;}

.v120-collapsed-rail{
  display:none;
  width:100%;
  height:100%;
  min-height:0;
  align-items:center;
  flex-direction:column;
  gap:8px;
  padding:6px 4px;
  background:#f4f5f6;
  color:#475569;
  border-color:#cfd3d8;
  overflow:hidden;
  user-select:none;
}
.v120-collapsed-rail button{
  width:25px!important;
  min-width:25px!important;
  height:25px!important;
  min-height:25px!important;
  padding:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:1px solid #c7ccd2!important;
  border-radius:3px!important;
  background:#fff!important;
  color:#27313c!important;
  font-size:16px!important;
  font-weight:800!important;
}
.v120-collapsed-rail button:hover{background:#eef2f6!important;}
.v120-collapsed-rail span{
  writing-mode:vertical-rl;
  transform:rotate(180deg);
  font-size:10px;
  line-height:1;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  white-space:nowrap;
}

.sidebar.v120-sidebar-collapsed{overflow:hidden!important;padding:0!important;}
.sidebar.v120-sidebar-collapsed > :not(.v120-collapsed-rail){display:none!important;}
.sidebar.v120-sidebar-collapsed > .v120-collapsed-rail{display:flex!important;border-right:1px solid #cfd3d8;}

#selectedSection.v120-sidebar-collapsed{
  overflow:hidden!important;
  padding:0!important;
  min-width:0!important;
}
#selectedSection.v120-sidebar-collapsed > :not(.v120-collapsed-rail){display:none!important;}
#selectedSection.v120-sidebar-collapsed > .v120-collapsed-rail{display:flex!important;border-left:1px solid #cfd3d8;}

body.night-mode .v120-collapsed-rail{background:#15171b!important;color:#d7dce2!important;border-color:#303744!important;}
body.night-mode .v120-sidebar-toggle,
body.night-mode .v120-collapsed-rail button{background:#15171b!important;color:#e5e7eb!important;border-color:#4b5563!important;}
body.night-mode .v120-sidebar-toggle:hover,
body.night-mode .v120-collapsed-rail button:hover{background:#242830!important;}

/* Keep the Project/Layers splitter usable whenever the left sidebar is expanded. */
.sidebar-resizer[data-resizer="project-files"]{
  flex:0 0 10px!important;
  height:10px!important;
  min-height:10px!important;
  cursor:ns-resize!important;
  touch-action:none!important;
  user-select:none!important;
  z-index:8!important;
}
.sidebar-resizer[data-resizer="project-files"]:after{
  top:3px!important;
  width:44px!important;
  margin-left:-22px!important;
  border-top:1px solid #9ca3af!important;
  border-bottom:1px solid #9ca3af!important;
}
.sidebar-resizer[data-resizer="project-files"]:hover,
.sidebar-resizer[data-resizer="project-files"].is-dragging{background:#dbeafe!important;}
body.v120-sidebar-resizing,body.v120-sidebar-resizing *{cursor:ns-resize!important;user-select:none!important;}
#projectSection.project-section{min-height:105px!important;}

/* Explicitly neutralise any stale classes saved in an older generated copy. */
.toolbar-collapse-toggle,.toolbar-collapsed-label,.v119-toolbar-toggle,.v119-toolbar-label{display:none!important;}
.collapsible-toolbar,.v119-collapsible-toolbar{max-width:none;}
.collapsible-toolbar.toolbar-is-collapsed > *,
.v119-collapsible-toolbar.v119-toolbar-collapsed > *{display:revert!important;}

@media(max-width:1100px){
  .app{
    grid-template-columns:56px var(--v120-left-sidebar-width) minmax(320px,1fr)!important;
  }
  #selectedSection.v120-sidebar-collapsed{
    width:34px!important;
    min-width:34px!important;
    padding:0!important;
  }
}

/* ---- v122GeometryCodeEditorStyle ---- */
/* v125: selected-polygon GeoJSON editor, repair assistant and responsive controls. */
.gce-inspector-section .v53-section-body{gap:8px!important}
.gce-meta{display:grid;grid-template-columns:1fr;gap:4px;font-size:11px;color:#59626e}
.gce-meta-row{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.gce-meta-row strong{min-width:0;color:#1f2328;text-align:right;font-weight:700;overflow-wrap:anywhere}
.gce-note{font-size:11px;line-height:1.42;color:#59626e;background:#f7f8fa;border:1px solid #dfe3e8;padding:8px}
.gce-note strong{color:#1f2328}
.gce-large-gate{display:grid;gap:8px;padding:10px;border:1px solid #dfe3e8;background:#f7f8fa}
.gce-large-gate strong{font-size:12px;color:#1f2328}
.gce-large-gate p{margin:0;font-size:11px;line-height:1.4;color:#59626e}
.gce-editor-wrap{display:grid;gap:6px}
.gce-code{width:100%;min-height:280px;max-height:58vh;resize:vertical;box-sizing:border-box;border:1px solid #c8cdd4;background:#fbfcfd;color:#171a1f;padding:10px;font:11px/1.48 Consolas,"SFMono-Regular",Menlo,Monaco,"Liberation Mono",monospace;tab-size:2;white-space:pre;overflow:auto;outline:none}
.gce-code:focus{border-color:var(--blue);box-shadow:0 0 0 2px rgba(22,100,214,.12)}
.gce-code[readonly]{background:#f3f4f6;color:#6b7280}
.gce-editor-foot{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:5px 8px;font-size:10px;color:#667085}
.gce-editor-foot>span:first-child{min-width:0;overflow-wrap:anywhere}
.gce-state{display:inline-flex;align-items:center;gap:5px;max-width:100%;border:1px solid #dfe3e8;background:#fff;padding:2px 6px;font-weight:700;white-space:normal;line-height:1.2;text-align:center}
.gce-state.dirty{border-color:#fdba74;background:#fff7ed;color:#9a3412}
.gce-state.valid{border-color:#86efac;background:#f0fdf4;color:#166534}
.gce-state.error{border-color:#fca5a5;background:#fef2f2;color:#b42318}
.gce-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:6px}
.gce-toolbar button{display:flex;align-items:center;justify-content:center;width:100%;min-width:0;min-height:34px;height:auto;padding:6px 8px;background:#f7f8fa;border-color:#dfe3e8;font-size:11px;line-height:1.18;text-align:center;white-space:normal!important;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;word-break:normal}
.gce-toolbar #gceCheck,.gce-toolbar #gceRevert{grid-column:1/-1}
.gce-result .gce-toolbar{grid-template-columns:minmax(0,1fr)}
.gce-result .gce-toolbar button{grid-column:1!important;min-height:36px}
.gce-toolbar button.primary{background:var(--blue);border-color:var(--blue);color:#fff}
.gce-toolbar button.danger{background:#fff5f5;border-color:#fecaca;color:#b42318}
.gce-toolbar button:disabled{opacity:.45;cursor:not-allowed}
.gce-result{display:grid;gap:7px}
.gce-result:empty{display:none}
.gce-alert{display:grid;gap:6px;padding:9px;border:1px solid #dfe3e8;background:#f7f8fa;font-size:11px;line-height:1.4}
.gce-alert.ok{border-color:#86efac;background:#f0fdf4;color:#166534}
.gce-alert.warn{border-color:#fdba74;background:#fff7ed;color:#9a3412}
.gce-alert.error{border-color:#fca5a5;background:#fef2f2;color:#991b1b}
.gce-alert-title{font-size:12px;font-weight:800;color:inherit}
.gce-list{display:grid;gap:4px;margin:0;padding:0;list-style:none}
.gce-list li{position:relative;padding-left:15px}
.gce-list li:before{content:"";position:absolute;left:2px;top:.55em;width:5px;height:5px;background:currentColor;border-radius:50%;opacity:.75}
.gce-list .safe{color:#166534}.gce-list .review{color:#9a3412}.gce-list .error{color:#991b1b}.gce-list .info{color:#475569}
.gce-comparison{display:grid;grid-template-columns:1.1fr 1fr 1fr;border:1px solid #dfe3e8;background:#fff;font-size:10px}
.gce-comparison>div{padding:5px 6px;border-right:1px solid #e5e7eb;border-bottom:1px solid #e5e7eb;min-width:0;overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere}
.gce-comparison>div:nth-child(3n){border-right:0}.gce-comparison>div:nth-last-child(-n+3){border-bottom:0}
.gce-comparison .head{font-weight:800;background:#f7f8fa;color:#475569}.gce-comparison .label{color:#667085}
.gce-conflict{padding:8px;border:1px solid #fca5a5;background:#fef2f2;color:#991b1b;font-size:11px;line-height:1.4}
.gce-session-line{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;font-size:10px;line-height:1.35;color:#667085}
.gce-session-line strong{min-width:0;color:#344054;overflow-wrap:anywhere}
body.night-mode .gce-meta,body.night-mode .gce-editor-foot,body.night-mode .gce-session-line{color:#9ca3af}
body.night-mode .gce-meta-row strong,body.night-mode .gce-note strong,body.night-mode .gce-large-gate strong,body.night-mode .gce-session-line strong{color:#e5e7eb}
body.night-mode .gce-note,body.night-mode .gce-large-gate,body.night-mode .gce-alert{background:#111418;border-color:#303744;color:#cbd5e1}
body.night-mode .gce-code{background:#0d0f12;border-color:#3a414d;color:#e5e7eb}
body.night-mode .gce-code[readonly]{background:#15171b;color:#9ca3af}
body.night-mode .gce-state{background:#15171b;border-color:#303744;color:#cbd5e1}
body.night-mode .gce-toolbar button{background:#15171b;border-color:#303744;color:#e5e7eb}
body.night-mode .gce-toolbar button.primary{background:var(--blue);border-color:var(--blue);color:#fff}
body.night-mode .gce-toolbar button.danger{background:#2b1719;border-color:#7f1d1d;color:#fecaca}
body.night-mode .gce-comparison{background:#111418;border-color:#303744;color:#d1d5db}
body.night-mode .gce-comparison>div{border-color:#303744}body.night-mode .gce-comparison .head{background:#15171b;color:#cbd5e1}
body.night-mode .gce-conflict{background:#2b1719;border-color:#7f1d1d;color:#fecaca}
@media(max-width:1100px){.gce-code{max-height:42vh}}
