/* style.css — Groundwater Sandbox layout + component styles.
   Dark charcoal panels, parchment accent, 13px system stack. One file, no framework. */

:root {
  --bg:        #16181c;
  --panel:     #22252b;
  --panel-2:   #2b2f37;
  --panel-3:   #333842;
  --line:      #3a3f48;
  --line-soft: #2e323a;
  --text:      #d7d9de;
  --dim:       #8b919c;
  --accent:    #d4b878;   /* parchment */
  --accent-2:  #e8d5a3;
  --accent-dim:#8a774d;
  --blue:      #5aa7e0;
  --ok:        #7fc97f;
  --warn:      #e0b45a;
  --bad:       #e06c5a;
  --danger:    #c0503f;
  --radius:    8px;
  --mono:      ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  font: 13px/1.45 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-rows: 48px 1fr;
  height: 100vh;
  overflow: hidden;
  user-select: none;
}
input, textarea, select { user-select: text; }

/* ------------------------------------------------------------- toolbar */
#toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}
#toolbar .tb-title {
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: .02em;
  margin-right: 10px;
  white-space: nowrap;
}
#toolbar .tb-spacer { flex: 1; }
#toolbar .tb-sep { width: 1px; height: 26px; background: var(--line); margin: 0 6px; }
.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.tb-btn svg { width: 19px; height: 19px; display: block; }
.tb-btn:hover { background: var(--panel-2); }
.tb-btn.active {
  background: rgba(212, 184, 120, .14);
  border-color: var(--accent-dim);
  color: var(--accent-2);
}
.tb-btn .tb-key {
  font: 10px var(--mono);
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 3px;
  line-height: 14px;
}
.tb-btn.active .tb-key { color: var(--accent); border-color: var(--accent-dim); }

/* ----------------------------------------------------------- hint strip */
#hintstrip {
  position: fixed;
  top: 56px;
  left: 12px;
  z-index: 25;
  max-width: 60vw;
  background: rgba(24, 26, 31, .92);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  color: var(--accent-2);
  font-size: 12.5px;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}

/* ------------------------------------------------------------- viewport */
#viewport {
  grid-row: 2; grid-column: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0; min-height: 0;
  background: #101216;
  --dock-h: 0px;
}
#view3d {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: block;
  outline: none;
  touch-action: none;
}

/* HUD readout card (bottom-left, above the section dock) */
#hud {
  position: absolute;
  left: 12px;
  bottom: calc(var(--dock-h) + 12px);
  z-index: 10;
  font: 12px/1.5 var(--mono);
  background: rgba(20, 22, 26, .82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 11px;
  pointer-events: none;
  white-space: pre;
  min-width: 190px;
}
#hud:empty { display: none; }
#hud .ok   { color: var(--ok); }
#hud .warn { color: var(--warn); }
#hud .bad  { color: var(--bad); }
#hud .dim  { color: var(--dim); }
#hud .badge {
  display: inline-block;
  font-size: 10px;
  line-height: 15px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(127, 201, 127, .16);
  border: 1px solid rgba(127, 201, 127, .5);
  color: var(--ok);
  vertical-align: 1px;
}

#compass {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  width: 56px; height: 56px; pointer-events: none;
  color: var(--dim); font: 11px var(--mono);
}
#scalebar {
  position: absolute; right: 12px; bottom: calc(var(--dock-h) + 12px); z-index: 10;
  color: var(--dim); font: 11px var(--mono); pointer-events: none;
}

/* --------------------------------------------------------- section dock */
#sectionDock {
  position: relative;
  flex: 0 0 auto;
  height: 220px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-top: 1px solid var(--line);
  z-index: 12;
}
#sectionResize {
  flex: 0 0 8px;
  cursor: ns-resize;
  background:
    linear-gradient(var(--line) 0 0) center / 44px 2px no-repeat,
    var(--panel-2);
  touch-action: none;
}
#sectionResize:hover { background:
    linear-gradient(var(--accent-dim) 0 0) center / 44px 2px no-repeat,
    var(--panel-3); }
#sectionCanvas { flex: 1 1 0; min-height: 0; width: 100%; display: block; }
#sectionClose {
  position: absolute; top: 12px; right: 8px;
  width: 24px; height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--dim);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
#sectionClose:hover { color: var(--text); background: var(--panel-3); }
/* section chips (multi-section switcher inside the dock) */
#sectionTabs {
  position: absolute; top: 12px; left: 10px;
  display: flex; gap: 4px; flex-wrap: wrap; max-width: 60%;
}
.sec-chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--dim);
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
}
.sec-chip:hover { color: var(--text); background: var(--panel-3); }
.sec-chip.active { color: var(--text); border-color: var(--accent-dim); background: var(--panel-3); }

/* ----------------------------------------------------------- side panel */
#panel {
  grid-row: 2; grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-left: 1px solid var(--line);
}
.tabbar {
  display: flex;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
}
.tabbar button {
  flex: 1;
  padding: 9px 2px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.tabbar button:hover { color: var(--text); }
.tabbar button.active {
  color: var(--accent-2);
  border-bottom-color: var(--accent);
}
.tabbody {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}
.tabbody::-webkit-scrollbar { width: 9px; }
.tabbody::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }

/* panel building blocks */
.sect { margin-bottom: 16px; }
.sect > h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
}
.caption { color: var(--dim); font-size: 11.5px; margin: 4px 0 8px; }
.readout { font: 12px var(--mono); color: var(--text); margin: 2px 0; }
.readout .dim { color: var(--dim); }

.ctl { margin-bottom: 9px; }
.ctl-label {
  display: flex;
  justify-content: space-between;
  color: var(--text);
  margin-bottom: 3px;
  font-size: 12px;
}
.ctl-label .unit { color: var(--dim); font-size: 11px; }
.ctl-row { display: flex; align-items: center; gap: 8px; }
.ctl-row input[type=range] { flex: 1 1 auto; min-width: 0; }
.ctl-row input[type=number], .ctl-row input.numtext {
  flex: 0 0 68px;
  width: 68px;
}

input[type=number], input[type=text], input.numtext, select, textarea {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: 12px var(--mono);
  padding: 4px 6px;
  outline: none;
}
input[type=text] { font-family: inherit; }
input:focus, select:focus { border-color: var(--accent-dim); }
select { font-family: inherit; width: 100%; }
input[type=checkbox] { accent-color: var(--accent); }

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px; background: var(--panel-3);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid #00000055;
}
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--panel-3); }
input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 1px solid #00000055;
}

.row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.row > label { flex: 1; color: var(--text); }
.row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.btn:hover { background: var(--panel-3); }
.btn.primary {
  background: rgba(212,184,120,.15);
  border-color: var(--accent-dim);
  color: var(--accent-2);
}
.btn.primary:hover { background: rgba(212,184,120,.24); }
.btn.danger { color: #f0a296; border-color: #7a463d; }
.btn.danger:hover { background: rgba(192,80,63,.18); }
.btn.small { padding: 3px 8px; font-size: 11.5px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.busy::after {
  content: "";
  width: 11px; height: 11px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* segmented control */
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 9px; }
.seg button {
  flex: 1;
  padding: 5px 4px;
  border: none;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: rgba(212,184,120,.16); color: var(--accent-2); }

/* radio group */
.radios label { display: flex; gap: 7px; align-items: baseline; margin: 4px 0; cursor: pointer; }

/* cards (features, layers) */
.card {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  margin-bottom: 7px;
  overflow: hidden;
}
.card.selected { border-color: var(--accent-dim); box-shadow: 0 0 0 1px var(--accent-dim); }
.card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  cursor: pointer;
}
.card-head:hover { background: var(--panel-3); }
.card-head .icon { width: 18px; text-align: center; color: var(--accent); flex: 0 0 auto; }
.card-head .name {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  padding: 2px 4px;
}
.card-head .name:hover, .card-head .name:focus { border-color: var(--line); background: var(--panel); }
.card-head .mini {
  background: transparent; border: none; color: var(--dim);
  cursor: pointer; font-size: 13px; padding: 2px 4px; line-height: 1;
}
.card-head .mini:hover { color: var(--text); }
.card-head .mini.off { opacity: .35; }
.card-body { padding: 9px 10px 11px; border-top: 1px solid var(--line-soft); }
.card-foot { display: flex; gap: 8px; margin-top: 10px; }
.card .drag { cursor: grab; color: var(--dim); flex: 0 0 auto; }
.card.dragging { opacity: .4; }
.chip {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1px solid #00000066;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}
.group-label { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 5px; }

/* azimuth dial */
.dial { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.dial canvas {
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  cursor: grab;
}

details.adv { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 0 10px; margin-top: 10px; }
details.adv > summary { padding: 8px 0; cursor: pointer; color: var(--dim); font-size: 12px; }
details.adv[open] > summary { border-bottom: 1px solid var(--line-soft); margin-bottom: 8px; }

/* ----------------------------------------------------------- help overlay */
#helpOverlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 11, 14, .62);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-card {
  width: min(880px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 26px;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
}
.help-card h2 { margin: 0 0 4px; color: var(--accent-2); font-size: 18px; }
.help-card .sub { color: var(--dim); margin: 0 0 16px; }
.help-cols { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 22px; }
.help-cols h4 {
  margin: 0 0 8px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--accent);
}
.help-cols ul { margin: 0; padding: 0; list-style: none; }
.help-cols li { margin: 4px 0; color: var(--text); display: flex; gap: 7px; align-items: baseline; }
.help-cols li .k {
  font: 10.5px var(--mono);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 4px;
  color: var(--accent-2);
  flex: 0 0 auto;
}
.help-cols li .dim { color: var(--dim); }
.help-foot {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--dim);
  font-size: 12px;
}
@media (max-width: 900px) { .help-cols { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- toasts */
#toasts {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(28, 30, 36, .96);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 16px;
  color: var(--text);
  box-shadow: 0 8px 26px rgba(0,0,0,.5);
  pointer-events: auto;
  animation: toast-in .18s ease-out;
  max-width: 70vw;
}
.toast.leaving { animation: toast-out .25s ease-in forwards; }
.toast .undo {
  background: transparent;
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  color: var(--accent-2);
  font: inherit;
  font-size: 12px;
  padding: 3px 10px;
  cursor: pointer;
}
.toast .undo:hover { background: rgba(212,184,120,.16); }
@keyframes toast-in  { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px); } }

/* misc */
.warn-text { color: var(--warn); font-size: 12px; }
.hr { border: none; border-top: 1px solid var(--line-soft); margin: 12px 0; }

/* ==================================================================== wave 2 */

/* toolbar emoji tool icon (props) */
.tb-btn .tb-emoji { font-size: 17px; line-height: 1; }

/* hint strip: interactive variant hosts the prop kind picker */
#hintstrip.interactive { pointer-events: auto; }
#hintstrip .hint-seg { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: 6px; vertical-align: middle; }
#hintstrip .hint-seg button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.25;
  padding: 1px 6px;
}
#hintstrip .hint-seg button.active {
  border-color: var(--accent-dim);
  background: rgba(212, 184, 120, .18);
}

/* floating pill buttons over the viewport */
.float-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(28, 30, 36, .92);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: 12px -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 5px 12px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.float-btn:hover { background: var(--panel-3); }

/* Section show/hide button, bottom-right above the scale bar */
#sectionToggle {
  position: absolute;
  right: 12px;
  bottom: calc(var(--dock-h) + 34px);
  z-index: 11;
}
#sectionToggle .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-left: 6px;
}

/* imagery attribution line, bottom-right above the Section button */
#imageryAttrib {
  position: absolute;
  right: 12px;
  bottom: calc(var(--dock-h) + 66px);
  z-index: 10;
  font: 10px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--dim);
  background: rgba(20, 22, 26, .72);
  border-radius: 4px;
  padding: 2px 7px;
  pointer-events: none;
  max-width: 44vw;
}
#imageryAttrib a { color: var(--dim); }

/* -------- bottom-left dock stack: minimap over balance card over HUD -------- */
#dockLeft {
  position: absolute;
  left: 12px;
  bottom: calc(var(--dock-h) + 12px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;          /* children opt back in */
}
#dockLeft #hud { position: static; left: auto; bottom: auto; order: 3; }
#minimap { order: 1; pointer-events: auto; }
#balanceCard { order: 2; pointer-events: auto; }

/* water-balance card */
#balanceCard {
  background: rgba(20, 22, 26, .88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: 11.5px var(--mono);
  color: var(--text);
  min-width: 190px;
  max-width: 280px;
}
#balanceCard .bal-head {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}
#balanceCard .bal-head:hover { color: var(--accent-2); }
#balanceCard .bal-caret { color: var(--dim); }
#balanceCard .bal-sum { font-size: 10.5px; }
#balanceCard .bal-body { padding: 2px 10px 8px; }
#balanceCard .bal-row { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
#balanceCard .bal-row .dim { flex: 0 0 22px; font-size: 10px; }
#balanceCard .bal-bar {
  flex: 1;
  height: 7px;
  border-radius: 4px;
  background: var(--panel-3);
  overflow: hidden;
}
#balanceCard .bal-bar > i { display: block; height: 100%; }
#balanceCard .bal-bar.in > i { background: var(--blue); }
#balanceCard .bal-bar.out > i { background: var(--warn); }
#balanceCard table { border-collapse: collapse; width: 100%; margin: 5px 0 3px; }
#balanceCard td { padding: 1px 0; }
#balanceCard td.num { text-align: right; color: var(--blue); }
#balanceCard td.num.outv { color: var(--warn); }
#balanceCard .dim { color: var(--dim); }

/* minimap inset */
#minimap .mm-card {
  width: 184px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  position: relative;
}
#minimap .mm-map {
  width: 100%;
  height: 140px;
  background: #0d0f12;
  cursor: pointer;
  position: relative;
  z-index: 0;
  isolation: isolate;            /* keep Leaflet pane z-indexes contained */
}
#minimap .mm-btn {
  position: absolute;
  top: 4px; right: 4px;
  z-index: 1;
  width: 20px; height: 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(28, 30, 36, .92);
  color: var(--dim);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
#minimap .mm-btn:hover { color: var(--text); }
#minimap .mm-globe { font-size: 15px; padding: 4px 9px; }
#minimap .leaflet-control-attribution { font-size: 8px; opacity: .85; }

/* modals (map picker, wells import) */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 11, 14, .62);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  width: min(720px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; flex: 1; font-size: 14px; color: var(--accent-2); }
.modal-close {
  width: 24px; height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--dim);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); background: var(--panel-3); }
.modal-body { padding: 12px 16px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-body textarea { width: 100%; resize: vertical; }
.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}

/* map picker canvas */
.map-canvas {
  height: min(420px, 55vh);
  border-radius: 8px;
  overflow: hidden;
  background: #0d0f12;
  position: relative;
  z-index: 0;
  isolation: isolate;
}
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
}
.map-status { margin-top: 8px; }
.map-fetch-row { display: flex; gap: 7px; align-items: center; margin-top: 6px; cursor: pointer; color: var(--text); }

/* wells-import preview + mapping */
.imp-table { border-collapse: collapse; font: 11px var(--mono); margin-top: 8px; }
.imp-table th, .imp-table td {
  border: 1px solid var(--line-soft);
  padding: 2px 6px;
  text-align: left;
  white-space: nowrap;
}
.imp-table th { color: var(--accent); font-weight: 600; }
.imp-map-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 10px;
  margin: 8px 0;
}

/* national groundwater-viewer import */
.gwv-src { display: flex; gap: 6px; align-items: center; cursor: pointer; color: var(--text); font-size: 12px; }
.gwv-results { margin-top: 4px; }
.gwv-results .imp-table { width: 100%; }
.gwv-results .imp-table select { font: 11px var(--mono); padding: 0 2px; }
.gwv-gone td { opacity: .5; }
.gwv-st-live { color: var(--ok); }
.gwv-st-idle { color: var(--warn); }
.gwv-st-gone { color: var(--bad); }
.gwv-st-unknown { color: var(--dim); }
.gwv-abstraction { color: var(--blue); }
.gwv-artesian { color: var(--warn); }
.gwv-dim { color: var(--dim); }

/* interference-assessment results */
.itf-wrap { max-height: 220px; overflow-y: auto; margin: 4px 0; }
.itf-table { border-collapse: collapse; font: 11px var(--mono); width: 100%; }
.itf-table th, .itf-table td { padding: 2px 6px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.itf-table th { color: var(--accent); font-weight: 600; }
.itf-table td.num, .itf-table th:nth-child(n+2) { text-align: right; }

/* Ground tab per-edge boundary overrides */
.edge-grid {
  display: grid;
  grid-template-columns: 20px 1fr 74px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.edge-grid input[type=number] { width: 74px; }

/* small caption inside a radio label (boundary modes) */
.radios .caption { display: block; margin: 1px 0 3px; }

/* ------------------------------------------------- feedback & roadmap overlay */
.fb-overlay {
  position: fixed;
  inset: 0;
  z-index: 68;                       /* above the help overlay (60), below toasts (70),
                                        so a 'saved' toast is still readable over the card */
  background: rgba(10, 11, 14, .62);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-card {
  width: min(820px, 94vw);
  height: min(720px, 88vh);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  overflow: hidden;
  user-select: text;
}
.fb-head { display: flex; align-items: center; padding: 18px 22px 0; }
.fb-head h2 { margin: 0; flex: 1; color: var(--accent-2); font-size: 18px; }
.fb-x {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--dim); font-size: 13px; line-height: 1; padding: 5px 8px; cursor: pointer;
}
.fb-x:hover { color: var(--text); background: var(--panel-2); }

.fb-tabs { display: flex; gap: 4px; padding: 14px 22px 0; border-bottom: 1px solid var(--line-soft); }
.fb-tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--dim); font: inherit; padding: 7px 12px; cursor: pointer;
}
.fb-tab:hover { color: var(--text); }
.fb-tab.on { color: var(--accent-2); border-bottom-color: var(--accent); }

.fb-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 18px 22px 20px; overflow-y: auto; }
.fb-intro { margin: 0 0 16px; color: var(--dim); font-size: 12.5px; }
.fb-row { display: flex; gap: 14px; }
.fb-row .fb-field { flex: 1; }
.fb-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.fb-field > span { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); }
.fb-field input, .fb-field select, .fb-field textarea {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  font: inherit; padding: 7px 9px;
}
.fb-field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.fb-field input:focus, .fb-field select:focus, .fb-field textarea:focus {
  outline: none; border-color: var(--accent-dim);
}
.fb-grow { flex: 1; min-height: 0; }
.fb-grow textarea { flex: 1; }
.fb-foot { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.fb-status { flex: 1; color: var(--dim); font-size: 12px; }
.fb-status.warn { color: var(--warn); }

/* the rendered todo list */
.fb-md { font-size: 12.5px; line-height: 1.6; }
.fb-md h1 { font-size: 17px; color: var(--accent-2); margin: 0 0 10px; }
.fb-md h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent);
  margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line-soft);
}
.fb-md h3 { font-size: 13px; color: var(--accent-2); margin: 16px 0 6px; }
.fb-md p { margin: 0 0 9px; }
.fb-md ul, .fb-md ol { margin: 0 0 12px; padding-left: 18px; }
.fb-md li { margin: 3px 0; }
.fb-md li.sub { margin-left: 16px; color: var(--dim); }
.fb-md li.cont { list-style: none; margin-left: 0; color: var(--dim); }
.fb-md code { font: 11.5px var(--mono); background: var(--panel-2); border-radius: 3px; padding: 1px 4px; }
.fb-md a { color: var(--blue); }
.fb-md hr { border: 0; border-top: 1px solid var(--line-soft); margin: 18px 0; }
.fb-md blockquote {
  margin: 0 0 12px; padding: 9px 13px;
  border-left: 2px solid var(--accent-dim); background: var(--panel-2); border-radius: 0 6px 6px 0;
}
.fb-md blockquote p:last-child { margin-bottom: 0; }
.fb-md table { border-collapse: collapse; width: 100%; margin: 0 0 12px; }
.fb-md th, .fb-md td { border: 1px solid var(--line-soft); padding: 5px 8px; text-align: left; }
.fb-md th { color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.fb-md .dim { color: var(--dim); }

/* DEM provenance readout (Ground tab) — says which elevation source a site actually got,
   because LINZ blends 1 m LiDAR with the 8 m national DEM and the tiles look identical. */
.dem-readout { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.dem-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dem-dot.fine { background: #46b16b; }
.dem-dot.coarse { background: #c8a13a; }

/* Pause / play beside the solver readout. Its own element rather than part of #hud: that card is
   pointer-events:none and is rewritten every frame, so a button inside it could not be clicked. */
#simPause {
  align-self: flex-start;
  width: 30px; height: 30px;
  margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
  color: var(--fg);
  background: rgba(20, 22, 26, .82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  pointer-events: auto;
}
#simPause:hover { border-color: var(--accent); }
#simPause.paused { color: var(--warn); border-color: var(--warn); }
